Class: Piston::Commands::Diff

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

Instance Attribute Summary

Attributes inherited from Base

#options

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 Method Details

#runObject



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

def run
  working_copy = working_copy!(options[:wcdir])
  working_copy.diff
end

#start(*args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/piston/commands/diff.rb', line 11

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