46 47 48 49 50 51 52 53 54 55 56
# File 'lib/synco/command.rb', line 46 def call if @options[:version] puts "synco v#{Synco::VERSION}" elsif @options[:help] or @command.nil? print_usage else chdir do @command.call end end end
30 31 32 33 34 35 36
# File 'lib/synco/command.rb', line 30 def chdir(&block) if root = @options[:root] Dir.chdir(root, &block) else yield end end