Class: GithubFlowCli::Local
- Inherits:
-
Object
- Object
- GithubFlowCli::Local
- Defined in:
- lib/github_flow_cli/local.rb
Class Method Summary collapse
Class Method Details
.git ⇒ Object
20 21 22 |
# File 'lib/github_flow_cli/local.rb', line 20 def git @git ||= Git.open(File.('.')) end |
.repo ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/github_flow_cli/local.rb', line 6 def repo return @repo if @repo url = git.remote.url match = url&.match(%r{.*[:/](?<owner>.*?)/(?<name>.*?)\.git$}) return nil unless match[:owner] && match[:name] @repo = Octokit::Repository.from_url("/#{match[:owner]}/#{match[:name]}") rescue ArgumentError => ex if ex. =~ /path does not exist/ nil else raise end end |