Class: GemEnforcer::Setup::Helper::Retrieval
- Inherits:
-
Object
- Object
- GemEnforcer::Setup::Helper::Retrieval
- Defined in:
- lib/gem_enforcer/setup/helper/retrieval.rb
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#retrieval_factory ⇒ Object
readonly
Returns the value of attribute retrieval_factory.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(gem_name:, server:, git:) ⇒ Retrieval
constructor
A new instance of Retrieval.
- #retrieve_version_list ⇒ Object
- #valid_config? ⇒ Boolean
Constructor Details
#initialize(gem_name:, server:, git:) ⇒ Retrieval
Returns a new instance of Retrieval.
9 10 11 12 13 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 9 def initialize(gem_name:, server:, git:) @gem_name = gem_name @server = server @git = git end |
Instance Attribute Details
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
7 8 9 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 7 def gem_name @gem_name end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
7 8 9 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 7 def git @git end |
#retrieval_factory ⇒ Object (readonly)
Returns the value of attribute retrieval_factory.
7 8 9 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 7 def retrieval_factory @retrieval_factory end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
7 8 9 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 7 def server @server end |
Instance Method Details
#errors ⇒ Object
19 20 21 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 19 def errors @errors ||= [] end |
#retrieve_version_list ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 23 def retrieve_version_list unless valid_config? raise ConfigError, "Attempted to run validations with invalid Version Configurations" end retrieval_factory.gem_versions(name: gem_name).sort end |
#valid_config? ⇒ Boolean
15 16 17 |
# File 'lib/gem_enforcer/setup/helper/retrieval.rb', line 15 def valid_config? @valid_config ||= validate_config end |