Sha256: 7e21b1e8edd9c30015703bee48cb367dc43ce3308756cf6992211df9c31ed96e

Contents?: true

Size: 1.13 KB

Versions: 26

Compression:

Stored size: 1.13 KB

Contents

require 'fig/statement'
require 'fig/statement/environment_variable'

module Fig; end

# A statement that sets the value of an environment variable.
class Fig::Statement::Set < Fig::Statement
  include Fig::Statement::EnvironmentVariable

  # Yields on error.
  def self.parse_name_value(combined, &error_block)
    variable, raw_value = seperate_name_and_value combined, &error_block

    return [variable, tokenize_value(raw_value, &error_block)]
  end

  def self.parse_v0_name_value(combined, &error_block)
    variable, raw_value = seperate_name_and_value combined, &error_block
    base_v0_value_validation(variable, raw_value, &error_block)
    return [variable, tokenize_value(raw_value, &error_block)]
  end

  def initialize(line_column, source_description, name, tokenized_value)
    super(line_column, source_description)

    @name = name
    @tokenized_value = tokenized_value
  end

  def statement_type()
    return 'set'
  end

  def is_environment_variable?()
    return true
  end

  def deparse_as_version(deparser)
    return deparser.set(self)
  end

  private

  def minimum_grammar()
    return standard_minimum_grammar
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/statement/set.rb
fig-1.22.1.beta.1 lib/fig/statement/set.rb
fig-1.22.0 lib/fig/statement/set.rb
fig-1.21.1.beta.2 lib/fig/statement/set.rb
fig-1.21.1.beta.1 lib/fig/statement/set.rb
fig-1.21.0 lib/fig/statement/set.rb
fig-1.20.1.beta.1 lib/fig/statement/set.rb
fig-1.20.0 lib/fig/statement/set.rb
fig-1.19.0 lib/fig/statement/set.rb
fig-1.18.0 lib/fig/statement/set.rb
fig-1.17.0 lib/fig/statement/set.rb
fig-1.16.1.beta.1 lib/fig/statement/set.rb
fig-1.16.0 lib/fig/statement/set.rb
fig-1.15.1.beta.2 lib/fig/statement/set.rb
fig-1.15.1.beta.1 lib/fig/statement/set.rb
fig-1.15.0 lib/fig/statement/set.rb
fig-1.14.0 lib/fig/statement/set.rb
fig-1.13.0 lib/fig/statement/set.rb
fig-1.12.0 lib/fig/statement/set.rb
fig-1.11.0 lib/fig/statement/set.rb