Sha256: ce6a327568191fb23cfee0dcc40b8902dca9b34941bffec40f6fe6923b1dc07a

Contents?: true

Size: 1.14 KB

Versions: 15

Compression:

Stored size: 1.14 KB

Contents

# coding: utf-8

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

15 entries across 15 versions & 1 rubygems

Version Path
fig-1.27.10 lib/fig/statement/set.rb
fig-1.27.8 lib/fig/statement/set.rb
fig-1.27.5 lib/fig/statement/set.rb
fig-1.27.4 lib/fig/statement/set.rb
fig-1.27.3 lib/fig/statement/set.rb
fig-1.27.0 lib/fig/statement/set.rb
fig-1.26.1.beta.1 lib/fig/statement/set.rb
fig-1.26.0 lib/fig/statement/set.rb
fig-1.25.1.beta.1 lib/fig/statement/set.rb
fig-1.25.0 lib/fig/statement/set.rb
fig-1.24.1.beta.3 lib/fig/statement/set.rb
fig-1.24.1.beta.2 lib/fig/statement/set.rb
fig-1.24.1.beta.1 lib/fig/statement/set.rb
fig-1.24.0 lib/fig/statement/set.rb
fig-1.23.1.beta.1 lib/fig/statement/set.rb