Module: AssetHelper
- Included in:
- CmdInit
- Defined in:
- lib/punt/asset_helper.rb
Instance Method Summary collapse
- #asset_path(*path) ⇒ Object
- #copy_without_overwriting(src: nil, dst: nil) ⇒ Object
- #dst_path(*asset) ⇒ Object
- #src_path(*asset) ⇒ Object
Instance Method Details
#asset_path(*path) ⇒ Object
14 15 16 |
# File 'lib/punt/asset_helper.rb', line 14 def asset_path(*path) return File.join(File.dirname(__FILE__), "..", "..", "assets", path) end |
#copy_without_overwriting(src: nil, dst: nil) ⇒ Object
2 3 4 |
# File 'lib/punt/asset_helper.rb', line 2 def copy_without_overwriting(src: nil, dst: nil) FileUtils.cp(src_path(src), dst_path(dst)) unless File.exists?(dst_path(dst)) end |
#dst_path(*asset) ⇒ Object
10 11 12 |
# File 'lib/punt/asset_helper.rb', line 10 def dst_path(*asset) File.join(asset) end |
#src_path(*asset) ⇒ Object
6 7 8 |
# File 'lib/punt/asset_helper.rb', line 6 def src_path(*asset) asset_path(asset) end |