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

inherited, #initialize, #latest_step, #needs!, #parseopts!, #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
9
# File 'lib/snaptoken/commands/fancy.rb', line 6

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

.usageObject



11
12
13
# File 'lib/snaptoken/commands/fancy.rb', line 11

def self.usage
  ""
end

Instance Method Details

#runObject



18
19
20
21
22
23
24
# File 'lib/snaptoken/commands/fancy.rb', line 18

def run
  needs! :config, :diff

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

#setopts!(o) ⇒ Object



15
16
# File 'lib/snaptoken/commands/fancy.rb', line 15

def setopts!(o)
end