class Fig::Statement
A statement within a package definition file (package.fig).
Constants
- ENVIRONMENT_VARIABLE_NAME_REGEX
Attributes
Public Class Methods
This mess of getting these as a single array necessary is due to limitations of the “*” array splat operator in ruby v1.8.
# File lib/fig/statement.rb, line 31 def initialize(line_column, source_description) if line_column @line, @column = *line_column end @source_description = source_description end
# File lib/fig/statement.rb, line 11 def self.position_description(line, column, source_description) if not line or not column return '' if not source_description return " (#{source_description})" end description = " (line #{line}, column #{column}" if source_description description << ", #{source_description}" end description << ')' return description end
Public Instance Methods
# File lib/fig/statement.rb, line 52 def deparse_as_version(deparser) raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/statement.rb, line 78 def is_asset?() return false end
# File lib/fig/statement.rb, line 82 def is_environment_variable?() return false end
Returns a two element array containing the version and an explanation of why the version is necessary if the version is greater than 0.
# File lib/fig/statement.rb, line 60 def minimum_grammar_for_emitting_input() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
Returns a two element array containing the version and an explanation of why the version is necessary if the version is greater than 0.
# File lib/fig/statement.rb, line 68 def minimum_grammar_for_publishing() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
Returns a representation of the position of this statement, if the position is known, empty string otherwise. This is written with the idea that you can do something like “puts %Q<Found a statement%{statement.position_string()}.>” and get nice looking output regardless of whether the position is actually known or not.
# File lib/fig/statement.rb, line 91 def position_string return Fig::Statement.position_description( @line, @column, @source_description ) end
A name for this kind of Statement
, usually a keyword for this statement as it appears in package definition files.
# File lib/fig/statement.rb, line 41 def statement_type() raise NotImplementedError.new( "#{__callee__}() not implemented on #{self.class}." ) end
# File lib/fig/statement.rb, line 74 def urls() return [] end
Block will receive a Statement
.
# File lib/fig/statement.rb, line 48 def walk_statements(&block) return end