Module: ZSteg::CLI

Defined in:
lib/zsteg.rb

Defined Under Namespace

Classes: Cli, Mask, Reflow

Class Method Summary collapse

Class Method Details

.new(*args) ⇒ Object

shortcut for ZSteg::CLI::Cli.new, mostly for RSpec



30
31
32
33
# File 'lib/zsteg.rb', line 30

def new *args
  require 'zsteg/cli/cli'
  Cli.new(*args)
end

.runObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/zsteg.rb', line 18

def run
  a = File.basename($0).downcase.scan(/\w+/) - %w'zsteg rb'
  a = %w'cli' if a.empty?

  klass = a.map(&:capitalize).join
  req = a.join('_')
  require File.expand_path( File.join('zsteg', 'cli', req), File.dirname(__FILE__))

  const_get(klass).new.run
end