Class: Mercurd::CLI
- Inherits:
-
Thor
- Object
- Thor
- Mercurd::CLI
- Defined in:
- lib/mercurd/cli.rb
Instance Method Summary collapse
Instance Method Details
#cloc(src = nil) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/mercurd/cli.rb', line 27 def cloc(src = nil) cmd = `which cloc` puts "cloc not found" and return if cmd.blank? prefix = "Count Lines of Code" dir = src ? src : '.' ret = `cloc #{dir}` puts [prefix, ret].join("\n\n") end |
#generate(entity, name) ⇒ Object
37 38 39 |
# File 'lib/mercurd/cli.rb', line 37 def generate(entity, name) Mercurd::Generators::Feature.start([entity, name]) end |
#requirements ⇒ Object
22 23 24 |
# File 'lib/mercurd/cli.rb', line 22 def requirements `brew install cloc` end |
#zen ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mercurd/cli.rb', line 10 def zen puts <<-ZEN The Zen of Code Reading - Good first. - Document first. - When have to. - For writting. ZEN end |