Class: Ruboto::Util::AssetCopier
- Defined in:
- lib/ruboto/util/asset_copier.rb
Instance Method Summary collapse
- #copy(from, to = '') ⇒ Object
- #copy_from_absolute_path(from, to = '') ⇒ Object
-
#initialize(from, to) ⇒ AssetCopier
constructor
A new instance of AssetCopier.
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 |