Class: Houcho::CLI::Main
- Inherits:
-
Thor
- Object
- Thor
- Houcho::CLI::Main
- Defined in:
- lib/houcho/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.empty_args(klass, chell, mesod) ⇒ Object
26 27 28 29 |
# File 'lib/houcho/cli.rb', line 26 def self.empty_args(klass, chell, mesod) klass.class.task_help(chell, mesod) exit end |
.puts_details(e, indentsize = 0, cnt = 1) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/houcho/cli.rb', line 31 def self.puts_details(e, indentsize = 0, cnt = 1) case e when Array e.sort.each.with_index(1) do |v, i| (indentsize-1).times {print ' '} print i != e.size ? '├─ ' : '└─ ' puts v end puts '' when Hash e.each do |k,v| if indentsize != 0 (indentsize).times {print ' '} end title = k.to_s.color(0,255,0) title = '[' + k.to_s.color(219,112,147) + ']' if indentsize == 0 puts title puts_details(v, indentsize+1, cnt+1) end end end |
Instance Method Details
#init ⇒ Object
22 23 24 |
# File 'lib/houcho/cli.rb', line 22 def init Houcho::Repository.init end |