Module: Artifactory::GemImport

Defined in:
lib/artifactory/gem_import.rb,
lib/artifactory/gem_import/cli.rb,
lib/artifactory/gem_import/gem.rb,
lib/artifactory/gem_import/gems.rb,
lib/artifactory/gem_import/repo.rb,
lib/artifactory/gem_import/worker.rb,
lib/artifactory/gem_import/version.rb,
lib/artifactory/gem_import/gem_specs.rb,
lib/artifactory/gem_import/bookkeeper.rb,
lib/artifactory/gem_import/gem/errors.rb,
lib/artifactory/gem_import/worker/base.rb,
lib/artifactory/gem_import/gems/cleaner.rb,
lib/artifactory/gem_import/gems/uploader.rb,
lib/artifactory/gem_import/gems/verifier.rb,
lib/artifactory/gem_import/worker/remover.rb,
lib/artifactory/gem_import/bookkeeper/base.rb,
lib/artifactory/gem_import/gem_specs/specs.rb,
lib/artifactory/gem_import/gems/downloader.rb,
lib/artifactory/gem_import/worker/importer.rb,
lib/artifactory/gem_import/gem_specs/parser.rb,
lib/artifactory/gem_import/bookkeeper/counter.rb,
lib/artifactory/gem_import/bookkeeper/reviewer.rb,
lib/artifactory/gem_import/bookkeeper/publisher.rb,
lib/artifactory/gem_import/gem_specs/downloader.rb,
lib/artifactory/gem_import/worker/missing_detector.rb

Defined Under Namespace

Modules: Bookkeeper, GemSpecs, Gems, Worker Classes: Cli, Gem, Repo

Constant Summary collapse

Error =
Class.new StandardError
ClientError =
Class.new Error
VERSION =
"0.2.2"

Class Method Summary collapse

Class Method Details

.delete!(repo:, only: /.+/) ⇒ Object



28
29
30
31
32
# File 'lib/artifactory/gem_import.rb', line 28

def delete!(repo:, only: /.+/)
  Worker::Remover
    .new(target_repo: repo, only: only)
    .remove!
end

.import!(source_repo:, target_repo:, only: /.+/, force: false) ⇒ Object



16
17
18
19
20
# File 'lib/artifactory/gem_import.rb', line 16

def import!(source_repo:, target_repo:, only: /.+/, force: false)
  Worker::Importer
    .new(source_repo: source_repo, target_repo: target_repo, only: only, force: force)
    .import!
end

.show_missing(source_repo:, target_repo:, only: /.+/) ⇒ Object



22
23
24
25
26
# File 'lib/artifactory/gem_import.rb', line 22

def show_missing(source_repo:, target_repo:, only: /.+/)
  Worker::MissingDetector
    .new(source_repo: source_repo, target_repo: target_repo, only: only)
    .detect!
end

.source_repo(url:) ⇒ Object



34
35
36
37
# File 'lib/artifactory/gem_import.rb', line 34

def source_repo(url:)
  Repo.new url: url,
           headers: {}
end

.target_repo(url:, api_key:) ⇒ Object



39
40
41
42
# File 'lib/artifactory/gem_import.rb', line 39

def target_repo(url:, api_key:)
  Repo.new url: url,
           headers: { "X-JFrog-Art-Api" => api_key }
end