Class: Fig::Statement::Override
- Inherits:
-
Fig::Statement
- Object
- Fig::Statement
- Fig::Statement::Override
- Defined in:
- lib/fig/statement/override.rb
Overview
Overrides one package version dependency with another.
config whatever
override somedependency/3.2.6
end
indicates that, regardless of which version of somedependency the blah package says it needs, the blah package will actually use v3.2.6.
Constant Summary
Constants inherited from Fig::Statement
ENVIRONMENT_VARIABLE_NAME_REGEX
Instance Attribute Summary collapse
-
#package_name ⇒ Object
readonly
Returns the value of attribute package_name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from Fig::Statement
#column, #line, #source_description
Class Method Summary collapse
-
.parse_descriptor(raw_string, options = {}) ⇒ Object
Centralized definition of requirements for descriptors for override statements.
Instance Method Summary collapse
- #deparse_as_version(deparser) ⇒ Object
-
#initialize(line_column, source_description, package_name, version) ⇒ Override
constructor
A new instance of Override.
- #minimum_grammar_for_emitting_input ⇒ Object
- #minimum_grammar_for_publishing ⇒ Object
- #statement_type ⇒ Object
Methods inherited from Fig::Statement
#is_asset?, #is_environment_variable?, position_description, #position_string, #urls, #walk_statements
Constructor Details
#initialize(line_column, source_description, package_name, version) ⇒ Override
Returns a new instance of Override.
31 32 33 34 35 36 |
# File 'lib/fig/statement/override.rb', line 31 def initialize(line_column, source_description, package_name, version) super(line_column, source_description) @package_name = package_name @version = version end |
Instance Attribute Details
#package_name ⇒ Object (readonly)
Returns the value of attribute package_name.
17 18 19 |
# File 'lib/fig/statement/override.rb', line 17 def package_name @package_name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
17 18 19 |
# File 'lib/fig/statement/override.rb', line 17 def version @version end |
Class Method Details
.parse_descriptor(raw_string, options = {}) ⇒ Object
Centralized definition of requirements for descriptors for override statements.
21 22 23 24 25 26 27 28 29 |
# File 'lib/fig/statement/override.rb', line 21 def self.parse_descriptor(raw_string, = {}) = {} .merge!() [:name] = :required [:version] = :required [:config] = :forbidden return Fig::PackageDescriptor.parse(raw_string, ) end |
Instance Method Details
#deparse_as_version(deparser) ⇒ Object
42 43 44 |
# File 'lib/fig/statement/override.rb', line 42 def deparse_as_version(deparser) return deparser.override(self) end |
#minimum_grammar_for_emitting_input ⇒ Object
46 47 48 |
# File 'lib/fig/statement/override.rb', line 46 def minimum_grammar_for_emitting_input() return [0] end |
#minimum_grammar_for_publishing ⇒ Object
50 51 52 |
# File 'lib/fig/statement/override.rb', line 50 def minimum_grammar_for_publishing() return [0] end |
#statement_type ⇒ Object
38 39 40 |
# File 'lib/fig/statement/override.rb', line 38 def statement_type() return 'override' end |