Class: Ruboto::Util::AssetCopier

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboto/util/asset_copier.rb

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ AssetCopier

Returns a new instance of AssetCopier.



4
5
6
7
# File 'lib/ruboto/util/asset_copier.rb', line 4

def initialize(from, to)
  @from = from
  @to = to
end

Instance Method Details

#copy(from, to = '') ⇒ Object



9
10
11
12
# File 'lib/ruboto/util/asset_copier.rb', line 9

def copy(from, to='')
  FileUtils.mkdir_p(File.join(@to, to))
  FileUtils.cp_r(Dir[File.join(@from, from)], File.join(@to, to))
end

#copy_from_absolute_path(from, to = '') ⇒ Object



14
15
16
17
# File 'lib/ruboto/util/asset_copier.rb', line 14

def copy_from_absolute_path(from, to='')
  FileUtils.mkdir_p(File.join(@to, to))
  FileUtils.cp_r(Dir[from], File.join(@to, to))
end