Class: Artifactory::GemImport::Gem
- Inherits:
-
Object
- Object
- Artifactory::GemImport::Gem
- Defined in:
- lib/artifactory/gem_import/gem.rb,
lib/artifactory/gem_import/gem/errors.rb
Defined Under Namespace
Classes: Errors
Instance Attribute Summary collapse
-
#cache_dir ⇒ Object
readonly
Returns the value of attribute cache_dir.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#foreign_representation ⇒ Object
Returns the value of attribute foreign_representation.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_repo ⇒ Object
readonly
Returns the value of attribute source_repo.
-
#target_repo ⇒ Object
readonly
Returns the value of attribute target_repo.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #cache_path ⇒ Object
- #filename ⇒ Object
-
#initialize(spec:, source_repo:, target_repo:, cache_dir:) ⇒ Gem
constructor
A new instance of Gem.
- #source_gems_url ⇒ Object
- #source_headers ⇒ Object
- #source_url ⇒ Object
- #target_gems_url ⇒ Object
- #target_headers ⇒ Object
- #target_url ⇒ Object
Constructor Details
#initialize(spec:, source_repo:, target_repo:, cache_dir:) ⇒ Gem
Returns a new instance of Gem.
13 14 15 16 17 18 19 |
# File 'lib/artifactory/gem_import/gem.rb', line 13 def initialize(spec:, source_repo:, target_repo:, cache_dir:) @name, @version, _lang = spec @cache_dir = cache_dir @source_repo = source_repo @target_repo = target_repo @errors = Errors.new end |
Instance Attribute Details
#cache_dir ⇒ Object (readonly)
Returns the value of attribute cache_dir.
8 9 10 |
# File 'lib/artifactory/gem_import/gem.rb', line 8 def cache_dir @cache_dir end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/artifactory/gem_import/gem.rb', line 9 def errors @errors end |
#foreign_representation ⇒ Object
Returns the value of attribute foreign_representation.
11 12 13 |
# File 'lib/artifactory/gem_import/gem.rb', line 11 def foreign_representation @foreign_representation end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/artifactory/gem_import/gem.rb', line 6 def name @name end |
#source_repo ⇒ Object (readonly)
Returns the value of attribute source_repo.
7 8 9 |
# File 'lib/artifactory/gem_import/gem.rb', line 7 def source_repo @source_repo end |
#target_repo ⇒ Object (readonly)
Returns the value of attribute target_repo.
7 8 9 |
# File 'lib/artifactory/gem_import/gem.rb', line 7 def target_repo @target_repo end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/artifactory/gem_import/gem.rb', line 6 def version @version end |
Instance Method Details
#cache_path ⇒ Object
45 46 47 |
# File 'lib/artifactory/gem_import/gem.rb', line 45 def cache_path @cache_path ||= File.join(cache_dir, filename) end |
#filename ⇒ Object
49 50 51 |
# File 'lib/artifactory/gem_import/gem.rb', line 49 def filename @filename ||= "#{name}-#{version}.gem" end |
#source_gems_url ⇒ Object
25 26 27 |
# File 'lib/artifactory/gem_import/gem.rb', line 25 def source_gems_url source_repo.gems_url end |
#source_headers ⇒ Object
29 30 31 |
# File 'lib/artifactory/gem_import/gem.rb', line 29 def source_headers source_repo.headers end |
#source_url ⇒ Object
21 22 23 |
# File 'lib/artifactory/gem_import/gem.rb', line 21 def source_url @source_url ||= File.join(source_repo.gems_url, filename) end |
#target_gems_url ⇒ Object
37 38 39 |
# File 'lib/artifactory/gem_import/gem.rb', line 37 def target_gems_url target_repo.gems_url end |
#target_headers ⇒ Object
41 42 43 |
# File 'lib/artifactory/gem_import/gem.rb', line 41 def target_headers target_repo.headers end |
#target_url ⇒ Object
33 34 35 |
# File 'lib/artifactory/gem_import/gem.rb', line 33 def target_url @target_url ||= File.join(target_repo.gems_url, filename) end |