Sha256: 4720a635dbd45d629cd5aa14338c1756033cb48a3fc8daa4f087cd0ebc665f5e

Contents?: true

Size: 907 Bytes

Versions: 10

Compression:

Stored size: 907 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, location, glob_if_not_url)
    super(line_column, source_description)

    @location        = location
    @glob_if_not_url = glob_if_not_url
  end

  def statement_type()
    return 'resource'
  end

  def asset_name()
    if Fig::URL.is_url?(location())
      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

10 entries across 10 versions & 1 rubygems

Version Path
fig-1.4.0 lib/fig/statement/resource.rb
fig-1.3.0 lib/fig/statement/resource.rb
fig-1.2.0 lib/fig/statement/resource.rb
fig-1.1.0 lib/fig/statement/resource.rb
fig-1.0.0 lib/fig/statement/resource.rb
fig-0.2.5 lib/fig/statement/resource.rb
fig-0.2.3 lib/fig/statement/resource.rb
fig-0.2.1 lib/fig/statement/resource.rb
fig-0.1.81 lib/fig/statement/resource.rb
fig-0.1.79 lib/fig/statement/resource.rb