Sha256: 69210b1b0aad1c64184114c48a595b2f7ea8406025b3b28c05e0024708105c05

Contents?: true

Size: 569 Bytes

Versions: 16

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module CiToolkit
  # Use this to create an instance of Dvcs implementation based on the service type
  # set in an environment value called DVCS_SERVICW with value of gitlab or github
  class DvcsPrFactory
    SERVICES = {
      "gitlab" => CiToolkit::GitlabPr,
      "github" => CiToolkit::GithubPr
    }.freeze

    private_constant :SERVICES

    def self.create(bitrise_env = CiToolkit::BitriseEnv.new)
      service = ENV["DVCS_SERVICE"]
      (SERVICES[service.to_s.downcase] || CiToolkit::DvcsPr).new bitrise_env
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ci_toolkit-1.5.15 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.14 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.13 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.12 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.11 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.10 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.9 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.8 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.7 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.6 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.5 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.4 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.3 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.2 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.1 lib/ci_toolkit/dvcs_pr_factory.rb
ci_toolkit-1.5.0 lib/ci_toolkit/dvcs_pr_factory.rb