Class: Snaptoken::Commands::Fancy

Inherits:
BaseCommand show all
Defined in:
lib/snaptoken/commands/fancy.rb

Constant Summary

Constants inherited from BaseCommand

BaseCommand::ERROR_MSG

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCommand

#current_or_latest_step, #current_step, inherited, #initialize, #latest_step, #needs!, #select_step, #step_path, #steps

Constructor Details

This class inherits a constructor from Snaptoken::Commands::BaseCommand

Class Method Details

.nameObject



2
3
4
# File 'lib/snaptoken/commands/fancy.rb', line 2

def self.name
  "fancy"
end

.summaryObject



6
7
8
# File 'lib/snaptoken/commands/fancy.rb', line 6

def self.summary
  "Run steps.diff through colordiff, diff-so-fancy, and less"
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
# File 'lib/snaptoken/commands/fancy.rb', line 10

def run
  needs! :config, :diff

  FileUtils.cd(@config[:path]) do
    exec("cat steps.diff | colordiff | diff-so-fancy | less --tabs=4 -RFX")
  end
end