Sha256: d111d27d43e49212fde5256f71e7661f9e508f228bc68b4d98802c45f36d44eb

Contents?: true

Size: 726 Bytes

Versions: 20

Compression:

Stored size: 726 Bytes

Contents

module Distil
  
  class JavascriptBaseProduct < Product
    option :bootstrap_script, "#{ASSETS_DIR}/distil.js"
    option :bootstrap

    def initialize(settings, target)
      super(settings, target)
      
      @join_string=<<-eos
        
        /*jsl:ignore*/;/*jsl:end*/
        
      eos
      
      if bootstrap.nil?
        self.bootstrap= (APP_TYPE==target.target_type)
      end
    end

    def can_embed_file?(file)
      ["html", "js"].include?(file.content_type)
    end

    def bootstrap_source
      @bootstrap_source||=File.read(bootstrap_script).strip
    end
    
    def copy_bootstrap_script
      FileUtils.cp bootstrap_script, target.project.output_folder if !bootstrap
    end
    
  end
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
distil-0.13.6 lib/distil/product/javascript-base-product.rb
distil-0.13.5 lib/distil/product/javascript-base-product.rb
distil-0.13.4 lib/distil/product/javascript-base-product.rb
distil-0.13.3 lib/distil/product/javascript-base-product.rb
distil-0.13.2 lib/distil/product/javascript-base-product.rb
distil-0.13.1 lib/distil/product/javascript-base-product.rb
distil-0.13.0 lib/distil/product/javascript-base-product.rb
distil-0.12.6 lib/distil/product/javascript-base-product.rb
distil-0.12.4 lib/distil/product/javascript-base-product.rb
distil-0.12.3 lib/distil/product/javascript-base-product.rb
distil-0.12.2 lib/distil/product/javascript-base-product.rb
distil-0.12.1 lib/distil/product/javascript-base-product.rb
distil-0.12.0 lib/distil/product/javascript-base-product.rb
distil-0.11.8 lib/distil/product/javascript-base-product.rb
distil-0.11.6 lib/distil/product/javascript-base-product.rb
distil-0.11.5 lib/distil/product/javascript-base-product.rb
distil-0.11.4 lib/distil/product/javascript-base-product.rb
distil-0.11.3 lib/distil/product/javascript-base-product.rb
distil-0.11.1 lib/distil/product/javascript-base-product.rb
distil-0.11.0 lib/distil/product/javascript-base-product.rb