Class: Jib::StaticFiles
- Inherits:
-
Object
- Object
- Jib::StaticFiles
- Defined in:
- lib/jib.rb
Instance Method Summary collapse
Instance Method Details
#copy ⇒ Object
104 105 106 107 108 109 |
# File 'lib/jib.rb', line 104 def copy copy_targets.each do |src, dest| FileUtils.mkdir_p(File.dirname(dest)) Kernel.system("cp #{src} #{dest}") end end |
#copy_targets ⇒ Object
111 112 113 114 115 116 117 118 119 |
# File 'lib/jib.rb', line 111 def copy_targets target( Jib.config.sources.select {|src| File.extname(src) =~ /\.js|\.ejs/}, Jib.config.source_path ) + target( Jib.config.specs.select {|src| File.extname(src) =~ /\.js|\.ejs/}, Jib.config.spec_path ) end |
#target(sources, path) ⇒ Object
121 122 123 124 125 126 127 128 |
# File 'lib/jib.rb', line 121 def target(sources, path) sources.map do |filename| [ File.join(Jib.root, path, filename), File.join(File.join(Jib.workspace_path, path, filename)) ] end end |