Class: Artifactory::GemImport::Worker::Importer
- Defined in:
- lib/artifactory/gem_import/worker/importer.rb
Instance Attribute Summary collapse
-
#force ⇒ Object
readonly
Returns the value of attribute force.
-
#only ⇒ Object
readonly
Returns the value of attribute only.
-
#source_repo ⇒ Object
readonly
Returns the value of attribute source_repo.
-
#target_repo ⇒ Object
readonly
Returns the value of attribute target_repo.
Instance Method Summary collapse
- #import! ⇒ Object
-
#initialize(source_repo:, target_repo:, only: /.+/, force: false) ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
#initialize(source_repo:, target_repo:, only: /.+/, force: false) ⇒ Importer
Returns a new instance of Importer.
10 11 12 13 14 15 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 10 def initialize(source_repo:, target_repo:, only: /.+/, force: false) @source_repo = source_repo @target_repo = target_repo @only = only @force = force end |
Instance Attribute Details
#force ⇒ Object (readonly)
Returns the value of attribute force.
8 9 10 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 8 def force @force end |
#only ⇒ Object (readonly)
Returns the value of attribute only.
8 9 10 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 8 def only @only end |
#source_repo ⇒ Object (readonly)
Returns the value of attribute source_repo.
8 9 10 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 8 def source_repo @source_repo end |
#target_repo ⇒ Object (readonly)
Returns the value of attribute target_repo.
8 9 10 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 8 def target_repo @target_repo end |
Instance Method Details
#import! ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/artifactory/gem_import/worker/importer.rb', line 17 def import! output_counts missing_gems .map { |spec| Gem.new spec: spec, source_repo: source_repo, target_repo: target_repo, cache_dir: tmp_dir } .each { |gem| process gem } summary ensure remove_tmp_dir! end |