Sha256: cb141a234bb55df3a0ce3df040cae334d2dea783d6aca598eaa808e0dace4ccf

Contents?: true

Size: 840 Bytes

Versions: 3

Compression:

Stored size: 840 Bytes

Contents

require 'fig/statement'
require 'fig/statement/asset'
require 'fig/url'

module Fig; end
class  Fig::Statement; end

# Specifies a file (possibly via a URL) that is part of the current package.
#
# Differs from an Archive in that the contents will not be extracted.
class Fig::Statement::Resource < Fig::Statement
  include Fig::Statement::Asset

  def initialize(line_column, source_description, url, glob_if_not_url)
    super(line_column, source_description)

    @url             = url
    @glob_if_not_url = glob_if_not_url
  end

  def asset_name()
    if Fig::URL.is_url?(url())
      return standard_asset_name()
    end

    # This resource will end up being bundled with others and will not live in
    # the package by itself.
    return nil
  end

  def unparse_as_version(unparser)
    return unparser.resource(self)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fig-0.1.77 lib/fig/statement/resource.rb
fig-0.1.76 lib/fig/statement/resource.rb
fig-0.1.75 lib/fig/statement/resource.rb