Class: Synco::Command::Top
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Synco::Command::Top
- Defined in:
- lib/synco/command.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/synco/command.rb', line 59 def call if [:version] puts "synco v#{Synco::VERSION}" elsif [:help] or @command.nil? print_usage(program_name) else chdir do @command.call end end end |
#chdir(&block) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/synco/command.rb', line 43 def chdir(&block) if root = [:root] Dir.chdir(root, &block) else yield end end |