Class: Piston::Commands::Info

Inherits:
Base
  • Object
show all
Defined in:
lib/piston/commands/info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#force, #guess_wc, #initialize, logger, #logger, #quiet, #verbose, #working_copy!

Constructor Details

This class inherits a constructor from Piston::Commands::Base

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/piston/commands/info.rb', line 6

def options
  @options
end

Instance Method Details

#run(wcdir) ⇒ Object



8
9
10
11
# File 'lib/piston/commands/info.rb', line 8

def run(wcdir)
  working_copy = working_copy!(wcdir)
  working_copy.info.to_yaml
end

#start(*args) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/piston/commands/info.rb', line 13

def start(*args)
	args.flatten.map {|d| Pathname.new(d).expand_path}.each do |wcdir|
		begin
			run(wcdir)
		rescue Piston::WorkingCopy::NotWorkingCopy
			puts "#{wcdir} is not a working copy"
		end
	end
end