Class: Recode::Runner

Inherits:
Object
  • Object
show all
Includes:
Colsole, ChangeVariations
Defined in:
lib/recode/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ChangeVariations

#change_variations

Constructor Details

#initialize(path: nil, extensions: nil, old_string: nil, new_string: nil) ⇒ Runner

Returns a new instance of Runner.



9
10
11
12
# File 'lib/recode/runner.rb', line 9

def initialize(path: nil, extensions: nil, old_string: nil, new_string: nil)
  @path, @extensions = path, extensions
  @old_string, @new_string = old_string, new_string
end

Instance Attribute Details

#extensionsObject

Returns the value of attribute extensions.



6
7
8
# File 'lib/recode/runner.rb', line 6

def extensions
  @extensions
end

#handlerObject

Returns the value of attribute handler.



7
8
9
# File 'lib/recode/runner.rb', line 7

def handler
  @handler
end

#new_stringObject

Returns the value of attribute new_string.



6
7
8
# File 'lib/recode/runner.rb', line 6

def new_string
  @new_string
end

#old_stringObject

Returns the value of attribute old_string.



6
7
8
# File 'lib/recode/runner.rb', line 6

def old_string
  @old_string
end

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/recode/runner.rb', line 6

def path
  @path
end

Instance Method Details

#execute(handler) ⇒ Object



14
15
16
17
18
# File 'lib/recode/runner.rb', line 14

def execute(handler)
  @handler = handler
  refactor_filenames
  refactor_contents
end