Class: NPM2Gem::FileCopier

Inherits:
Object
  • Object
show all
Defined in:
lib/npm2gem/file_copier.rb

Instance Method Summary collapse

Constructor Details

#initialize(from_base, to_base) ⇒ FileCopier

Returns a new instance of FileCopier.



5
6
7
8
# File 'lib/npm2gem/file_copier.rb', line 5

def initialize(from_base, to_base)
  @from_base = from_base
  @to_base = to_base
end

Instance Method Details

#copy(input_paths) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/npm2gem/file_copier.rb', line 10

def copy(input_paths)
  input_paths.each do |input_path|
    # TODO: replace with polymorphism, for the love of god
    if input_path.is_a?(Hash)
      copy_to_subfolder(input_path)
    else
      copy_single(input_path)
    end
  end
end