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
35 36 37 38 39 40 41 42 |
# File 'lib/circleci/cli.rb', line 35 def branch_name repository = Rugged::Repository.new('.') head = repository.head return nil unless head.branch? head.name.sub(%r{\Arefs/heads/}, '') end |
.project ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/circleci/cli.rb', line 26 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
100 101 102 |
# File 'lib/circleci/cli.rb', line 100 def browse Command::BrowseCommand.run() end |
#build ⇒ Object
84 85 86 |
# File 'lib/circleci/cli.rb', line 84 def build Command::BuildCommand.run() end |
#builds ⇒ Object
70 71 72 |
# File 'lib/circleci/cli.rb', line 70 def builds Command::BuildsCommand.run() end |
#cancel ⇒ Object
132 133 134 |
# File 'lib/circleci/cli.rb', line 132 def cancel Command::CancelCommand.run() end |
#projects ⇒ Object
47 48 49 |
# File 'lib/circleci/cli.rb', line 47 def projects Command::ProjectsCommand.run() end |
#retry ⇒ Object
117 118 119 |
# File 'lib/circleci/cli.rb', line 117 def retry Command::RetryCommand.run() end |
#version ⇒ Object
165 166 167 |
# File 'lib/circleci/cli.rb', line 165 def version say CircleCI::CLI::VERSION end |
#watch ⇒ Object
160 161 162 |
# File 'lib/circleci/cli.rb', line 160 def watch Command::WatchCommand.run() end |