Class: Commands::DiffCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/diffcommand.rb

Instance Method Summary collapse

Constructor Details

#initialize(tracker) ⇒ DiffCommand

Returns a new instance of DiffCommand.



9
10
11
# File 'lib/commands/diffcommand.rb', line 9

def initialize(tracker)
	@tracker_is = tracker
end

Instance Method Details

#help(commandcontext) ⇒ Object



20
21
22
# File 'lib/commands/diffcommand.rb', line 20

def help(commandcontext)
	commandcontext.output 'Use pug diff <type> <path to pugs to compare to>'
end

#run(commandcontext) ⇒ Object



13
14
15
16
17
18
# File 'lib/commands/diffcommand.rb', line 13

def run(commandcontext)
	type = commandcontext.pop_command! 'Missing type'
	pugspath_was = commandcontext.pop_command! 'Missing path to pugs'
	tracker_was = Tracker.new(pugspath_was)
	DeltaTracker.new().get(type, @tracker_is, tracker_was){|d| commandcontext.output(d) }
end