Sha256: 6222fd99f6fa359df4f3d4df3cbe90905b87111c9f91f0ae22842d414531eb02

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

module WebResourceBundler
  
  class ResourceFileType

    CSS					= {:value => 1 , :name => 'style'  , :ext => 'css'   } 
    JS					= {:value => 2 , :name => 'script' , :ext => 'js'    } 
    MHTML_CSS		= {:value => 3 , :name => 'style'  , :ext => 'css'   } 
    BASE64_CSS	= {:value => 4 , :name => 'style'  , :ext => 'css'   } 
    MHTML				= {:value => 5 , :name => 'mhtml'  , :ext => 'mhtml' } 

		CSS_TYPES		= [CSS, BASE64_CSS]
		MHTML_TYPES = [CSS, MHTML_CSS, MHTML]
  end

  class ResourceFile  

    attr_accessor :type, :path, :content

    def initialize(path, content, type)
      @type    = type
      @content = content
      @path    = path
    end

		class << self

			def new_js_file(path, content = "")
				ResourceFile.new(path, content, ResourceFileType::JS) 
			end

			def new_css_file(path, content = "")
				ResourceFile.new(path, content, ResourceFileType::CSS)
			end

			def new_mhtml_css_file(path, content = "")
				ResourceFile.new(path, content, ResourceFileType::MHTML_CSS)
			end

			def new_mhtml_file(path, content = "")
				ResourceFile.new(path, content, ResourceFileType::MHTML)
			end

		end
    
    def clone
      ResourceFile.new(self.path.dup, self.content.dup, self.type.dup)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
web_resource_bundler-0.0.23 lib/web_resource_bundler/content_management/resource_file.rb
web_resource_bundler-0.0.22 lib/web_resource_bundler/content_management/resource_file.rb
web_resource_bundler-0.0.21 lib/web_resource_bundler/content_management/resource_file.rb