Class: JBundle::Writer
- Inherits:
-
Object
- Object
- JBundle::Writer
- Defined in:
- lib/jbundle/writer.rb
Constant Summary collapse
- TOKENS =
Interpolation tokens
{ :version => '[:version]' }
Instance Method Summary collapse
-
#initialize(compiler, config, target_dir) ⇒ Writer
constructor
A new instance of Writer.
- #write ⇒ Object
Constructor Details
#initialize(compiler, config, target_dir) ⇒ Writer
Returns a new instance of Writer.
44 45 46 47 |
# File 'lib/jbundle/writer.rb', line 44 def initialize(compiler, config, target_dir) @compiler, @config, @version, @target_dir = compiler, config, config.version, target_dir @out = [] end |
Instance Method Details
#write ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/jbundle/writer.rb', line 49 def write release_targets do |versioned_target, version_string| if @compiler.buildable? # versionable JS file @out << write_file( @compiler.src, versioned_target, @compiler.dir, interpolate(@compiler.name, TOKENS[:version] => version_string) ) @out << write_file( @compiler.min, versioned_target, @compiler.dir, interpolate(@compiler.min_name, TOKENS[:version] => version_string) ) else # Other files (HTML, SWF, etc) @out << copy_file( @compiler.src_path, versioned_target, @compiler.dir, interpolate(@compiler.name, TOKENS[:version] => version_string) ) end end @out end |