class Recode::Command

Public Instance Methods

run() click to toggle source
# File lib/recode/command.rb, line 20
def run
  runner = Runner.new path: path, 
    extensions: extensions, 
    old_string: old_string, 
    new_string: new_string

  runner.execute handler
end

Private Instance Methods

extensions() click to toggle source
# File lib/recode/command.rb, line 45
def extensions
  args['EXTENSIONS']
end
handler() click to toggle source
# File lib/recode/command.rb, line 31
def handler
  if args['--prompt']
    Handler::Prompt.new
  elsif args['--apply']
    Handler::Apply.new
  else
    Handler::Output.new
  end
end
new_string() click to toggle source
# File lib/recode/command.rb, line 53
def new_string
  args['NEW']
end
old_string() click to toggle source
# File lib/recode/command.rb, line 49
def old_string
  args['OLD']
end
path() click to toggle source
# File lib/recode/command.rb, line 41
def path
  "."
end