Class: CircleCI::CLI::Runner
- Inherits:
-
Thor
- Object
- Thor
- CircleCI::CLI::Runner
- Defined in:
- lib/circleci/cli.rb
Overview
rubocop:disable Metrics/ClassLength
Class Method Summary collapse
Instance Method Summary collapse
- #browse ⇒ Object
- #build ⇒ Object
- #builds ⇒ Object
- #cancel ⇒ Object
- #projects ⇒ Object
- #retry ⇒ Object
- #version ⇒ Object
- #watch ⇒ Object
Class Method Details
.branch_name ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/circleci/cli.rb', line 34 def branch_name repository = Rugged::Repository.new('.') head = repository.head return nil unless head.branch? head.name.sub(%r{\Arefs/heads/}, '') end |
.project ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/circleci/cli.rb', line 25 def project repository = Rugged::Repository.new('.') origin = repository.remotes.find { |r| r.name == 'origin' } regexp = %r{(?:git@|https://)github.com(?::|/)([\w_-]+/[.\w_-]+?)(?:\.git)*$} return Regexp.last_match(1) if origin.url =~ regexp nil end |
Instance Method Details
#browse ⇒ Object
99 100 101 |
# File 'lib/circleci/cli.rb', line 99 def browse Command::BrowseCommand.run() end |
#build ⇒ Object
83 84 85 |
# File 'lib/circleci/cli.rb', line 83 def build Command::BuildCommand.run() end |
#builds ⇒ Object
69 70 71 |
# File 'lib/circleci/cli.rb', line 69 def builds Command::BuildsCommand.run() end |
#cancel ⇒ Object
131 132 133 |
# File 'lib/circleci/cli.rb', line 131 def cancel Command::CancelCommand.run() end |
#projects ⇒ Object
46 47 48 |
# File 'lib/circleci/cli.rb', line 46 def projects Command::ProjectsCommand.run() end |
#retry ⇒ Object
116 117 118 |
# File 'lib/circleci/cli.rb', line 116 def retry Command::RetryCommand.run() end |
#version ⇒ Object
164 165 166 |
# File 'lib/circleci/cli.rb', line 164 def version say CircleCI::CLI::VERSION end |
#watch ⇒ Object
159 160 161 |
# File 'lib/circleci/cli.rb', line 159 def watch Command::WatchCommand.run() end |