Class: Abt::Providers::Devops::Services::ProjectPicker

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/abt/providers/devops/services/project_picker.rb

Defined Under Namespace

Classes: Result

Constant Summary collapse

AZURE_DEV_URL_REGEX =
%r{^https://dev\.azure\.com/(?<organization>[^/]+)/(?<project>[^/]+)}.freeze
VS_URL_REGEX =
%r{^https://(?<organization>[^.]+)\.visualstudio\.com/(?<project>[^/]+)}.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli:) ⇒ ProjectPicker

Returns a new instance of ProjectPicker.



27
28
29
# File 'lib/abt/providers/devops/services/project_picker.rb', line 27

def initialize(cli:)
  @cli = cli
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



25
26
27
# File 'lib/abt/providers/devops/services/project_picker.rb', line 25

def cli
  @cli
end

Class Method Details

.call(**args) ⇒ Object



21
22
23
# File 'lib/abt/providers/devops/services/project_picker.rb', line 21

def self.call(**args)
  new(**args).call
end

Instance Method Details

#callObject



31
32
33
34
35
# File 'lib/abt/providers/devops/services/project_picker.rb', line 31

def call
  Result.new(
    path: Path.from_ids(organization_name: organization_name, project_name: project_name)
  )
end