Class: Gitcycle
- Inherits:
-
Object
- Object
- Gitcycle
- Includes:
- Assist, Branch, Checkout, Commit, Discuss, Incident, Open, Pull, Push, QA, Ready, Review, Setup
- Defined in:
- lib/gitcycle.rb,
lib/gitcycle/qa.rb,
lib/gitcycle/open.rb,
lib/gitcycle/pull.rb,
lib/gitcycle/push.rb,
lib/gitcycle/ready.rb,
lib/gitcycle/setup.rb,
lib/gitcycle/assist.rb,
lib/gitcycle/branch.rb,
lib/gitcycle/commit.rb,
lib/gitcycle/review.rb,
lib/gitcycle/discuss.rb,
lib/gitcycle/checkout.rb,
lib/gitcycle/incident.rb
Defined Under Namespace
Modules: Assist, Branch, Checkout, Commit, Discuss, Incident, Open, Pull, Push, QA, Ready, Review, Setup
Constant Summary collapse
- API =
if ENV['ENV'] == 'test' "http://127.0.0.1:3000/api" else "http://gitcycle.bleacherreport.com/api" end
- ERROR =
{ :unrecognized_url => 1, :could_not_find_branch => 2, :told_not_to_merge => 3, :cannot_qa => 4, :conflict_when_merging => 5, :something_went_wrong => 6, :git_origin_not_found => 7, :last_command_errored => 8, }
Instance Method Summary collapse
-
#initialize(args = nil) ⇒ Gitcycle
constructor
A new instance of Gitcycle.
- #start(args = []) ⇒ Object
Methods included from Setup
Methods included from Review
Methods included from Ready
Methods included from QA
Methods included from Push
Methods included from Pull
Methods included from Open
Methods included from Incident
Methods included from Discuss
Methods included from Commit
Methods included from Checkout
Methods included from Branch
Methods included from Assist
Constructor Details
#initialize(args = nil) ⇒ Gitcycle
Returns a new instance of Gitcycle.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/gitcycle.rb', line 66 def initialize(args=nil) $remotes = {} if ENV['CONFIG'] @config_path = File.(ENV['CONFIG']) else @config_path = File.("~/.gitcycle.yml") end load_config load_git start(args) if args end |
Instance Method Details
#start(args = []) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/gitcycle.rb', line 81 def start(args=[]) command = args.shift `git --help`.scan(/\s{3}(\w+)\s{3}/).flatten.each do |cmd| if command == cmd && !self.respond_to?(command) exec_git(cmd, args) end end if command.nil? puts "\nNo command specified\n".red elsif command =~ /^-/ command_not_recognized elsif self.respond_to?(command) send(command, *args) else command_not_recognized end end |