Commit 3883fe1

mokha <mokha@cisco.com>
2018-02-14 02:20:35
move cat to template.
1 parent 55b0c46
Changed files (2)
lib
lib/xsay/templates/cat.template
@@ -0,0 +1,5 @@
+    ("`-''-/").___..--''"`-._
+     `6_ 6  )   `-.  (     ).`-.__.`)
+     (_Y_.)'  ._   )  `._ `. ``-..-'
+   _..`--'_..-_/  /--'_.' ,'
+  (il),-''  (li),'  ((!.-'
lib/xsay.rb
@@ -5,13 +5,7 @@ module Xsay
   class CLI < Thor
     desc "cat <message>", "xsay cat meow"
     def cat(message)
-      template = <<-MESSAGE
-    ("`-''-/").___..--''"`-._
-     `6_ 6  )   `-.  (     ).`-.__.`)
-     (_Y_.)'  ._   )  `._ `. ``-..-'
-   _..`--'_..-_/  /--'_.' ,'
-  (il),-''  (li),'  ((!.-'
-      MESSAGE
+      template = IO.read(File.expand_path("xsay/templates/cat.template", File.dirname(__FILE__)))
       render(message, template)
     end