lib/assemblage/config.rb
def bundle(bundle_name, type, *filelist)
      raise Error.new("Invalid bundle type, must be one of #{VALID_TYPES.inspect}") unless VALID_TYPES.include?(type)
      # verify ordered files exist
      basedir = type_to_path(type)
      filelist.each do|name|
        path = File.join(basedir, bundle_name.to_s, name)
        path << ".#{type.to_s}" unless path.match(/\.#{type.to_s}$/)
        unless File.exist?(path)
          error = MissingFile.new("Missing reference to file: #{name} at #{path}")
          error.filepath = path
          error.bundle = bundle_name
          raise error
        end

        # add a reference
        @bundles[type] ||= {}
        @bundles[type][bundle_name] ||= []
        @bundles[type][bundle_name] << {:name => name, :path => path}
      end
    end
#
# configure the bundle to be explicit
#
configure the bundle to be explicit
configure the bundle to be explicit
def bundle(bundle_name, type, *filelist)
      raise Error.new("Invalid bundle type, must be one of #{VALID_TYPES.inspect}") unless VALID_TYPES.include?(type)
      basedir = type_to_path(type)
      filelist.each do|name|
        path = File.join(basedir, bundle_name.to_s, name)
        path << ".#{type.to_s}" unless path.match(/\.#{type.to_s}$/)
        unless File.exist?(path)
          error = MissingFile.new("Missing reference to file: #{name} at #{path}")
          error.filepath = path
          error.bundle = bundle_name
          raise error
        end
        @bundles[type] ||= {}
        @bundles[type][bundle_name] ||= []
        @bundles[type][bundle_name] << {:name => name, :path => path}
      end
    end
def bundle ( bundle_name , type , * filelist ) raise Error . new ( "Invalid bundle type, must be one of #{VALID_TYPES.inspect}" ) unless VALID_TYPES . include? ( type ) basedir = type_to_path ( type ) filelist . each do | name | path = File . join ( basedir , bundle_name . to_s , name ) path << ".#{type.to_s}" unless path . match ( / \. #{ type . to_s } $ / ) unless File . exist? ( path ) error = MissingFile . new ( "Missing reference to file: #{name} at #{path}" ) error . filepath = path error . bundle = bundle_name raise error end @bundles [ type ] ||= { } @bundles [ type ] [ bundle_name ] ||= [ ] @bundles [ type ] [ bundle_name ] << { :name => name , :path => path } end end
configure the bundle to be explicit
configure the bundle to be explicit
# verify ordered files exist # add a reference
bundle_name
type
filelist