git_reflow 0.8.10 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/multi-ruby-tests.yml +33 -0
  3. data/.rubocop.yml +2 -0
  4. data/.ruby-version +1 -1
  5. data/Appraisals +1 -6
  6. data/CHANGELOG.md +466 -348
  7. data/Gemfile.lock +100 -70
  8. data/LICENSE +20 -20
  9. data/README.md +36 -12
  10. data/Rakefile +15 -8
  11. data/Workflow +3 -0
  12. data/bin/console +7 -7
  13. data/bin/setup +6 -6
  14. data/exe/git-reflow +14 -30
  15. data/git_reflow.gemspec +25 -24
  16. data/lib/git_reflow.rb +3 -14
  17. data/lib/git_reflow/config.rb +52 -17
  18. data/lib/git_reflow/git_helpers.rb +69 -22
  19. data/lib/git_reflow/git_server/base.rb +68 -68
  20. data/lib/git_reflow/git_server/git_hub.rb +53 -40
  21. data/lib/git_reflow/git_server/git_hub/pull_request.rb +25 -17
  22. data/lib/git_reflow/git_server/pull_request.rb +19 -3
  23. data/lib/git_reflow/merge_error.rb +9 -9
  24. data/lib/git_reflow/rspec.rb +1 -0
  25. data/lib/git_reflow/rspec/command_line_helpers.rb +23 -6
  26. data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
  27. data/lib/git_reflow/rspec/workflow_helpers.rb +18 -0
  28. data/lib/git_reflow/sandbox.rb +16 -6
  29. data/lib/git_reflow/version.rb +1 -1
  30. data/lib/git_reflow/workflow.rb +305 -10
  31. data/lib/git_reflow/workflows/FlatMergeWorkflow +38 -0
  32. data/lib/git_reflow/workflows/core.rb +208 -79
  33. data/spec/fixtures/authentication_failure.json +3 -0
  34. data/spec/fixtures/awesome_workflow.rb +2 -6
  35. data/spec/fixtures/git/git_config +7 -7
  36. data/spec/fixtures/issues/comment.json.erb +27 -27
  37. data/spec/fixtures/issues/comments.json +29 -29
  38. data/spec/fixtures/issues/comments.json.erb +15 -15
  39. data/spec/fixtures/pull_requests/comment.json.erb +45 -45
  40. data/spec/fixtures/pull_requests/comments.json +47 -47
  41. data/spec/fixtures/pull_requests/comments.json.erb +15 -15
  42. data/spec/fixtures/pull_requests/commits.json +29 -29
  43. data/spec/fixtures/pull_requests/external_pull_request.json +145 -145
  44. data/spec/fixtures/pull_requests/pull_request.json +142 -142
  45. data/spec/fixtures/pull_requests/pull_request.json.erb +142 -142
  46. data/spec/fixtures/pull_requests/pull_request_branch_nonexistent_error.json +32 -0
  47. data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -32
  48. data/spec/fixtures/pull_requests/pull_requests.json +136 -136
  49. data/spec/fixtures/repositories/commit.json +53 -53
  50. data/spec/fixtures/repositories/commit.json.erb +53 -53
  51. data/spec/fixtures/repositories/commits.json.erb +13 -13
  52. data/spec/fixtures/repositories/statuses.json +31 -31
  53. data/spec/fixtures/users/user.json +32 -0
  54. data/spec/lib/git_reflow/git_helpers_spec.rb +115 -12
  55. data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +6 -6
  56. data/spec/lib/git_reflow/git_server/git_hub_spec.rb +77 -3
  57. data/spec/lib/git_reflow/git_server/pull_request_spec.rb +41 -7
  58. data/spec/lib/git_reflow/workflow_spec.rb +259 -14
  59. data/spec/lib/git_reflow/workflows/core_spec.rb +224 -65
  60. data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +17 -6
  61. data/spec/lib/git_reflow_spec.rb +2 -25
  62. data/spec/spec_helper.rb +3 -0
  63. data/spec/support/github_helpers.rb +1 -1
  64. data/spec/support/mock_pull_request.rb +17 -17
  65. data/spec/support/web_mocks.rb +39 -39
  66. metadata +52 -53
  67. data/circle.yml +0 -26
  68. data/lib/git_reflow/commands/deliver.rb +0 -10
  69. data/lib/git_reflow/commands/refresh.rb +0 -20
  70. data/lib/git_reflow/commands/review.rb +0 -13
  71. data/lib/git_reflow/commands/setup.rb +0 -11
  72. data/lib/git_reflow/commands/stage.rb +0 -9
  73. data/lib/git_reflow/commands/start.rb +0 -18
  74. data/lib/git_reflow/commands/status.rb +0 -7
  75. data/lib/git_reflow/workflows/flat_merge.rb +0 -10
  76. data/spec/fixtures/workflow_with_super.rb +0 -8
@@ -1,115 +1,145 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.8.10)
4
+ git_reflow (0.9.4)
5
+ bundler (>= 1.10.0)
6
+ codenamev_bitbucket_api (= 0.4.1)
5
7
  colorize (>= 0.7.0)
6
- github_api (= 0.15.0)
7
- gli (= 2.17.0)
8
+ github_api (= 0.19)
8
9
  highline
9
10
  httpclient
10
- reenhanced_bitbucket_api (= 0.3.2)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- addressable (2.4.0)
15
+ activesupport (6.0.3.4)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 0.7, < 2)
18
+ minitest (~> 5.1)
19
+ tzinfo (~> 1.1)
20
+ zeitwerk (~> 2.2, >= 2.2.2)
21
+ addressable (2.7.0)
22
+ public_suffix (>= 2.0.2, < 5.0)
16
23
  appraisal (2.2.0)
17
24
  bundler
18
25
  rake
19
26
  thor (>= 0.14.0)
20
- byebug (10.0.2)
27
+ byebug (11.1.3)
21
28
  chronic (0.10.2)
22
- coderay (1.1.2)
29
+ codenamev_bitbucket_api (0.4.1)
30
+ faraday (< 2.0)
31
+ faraday_middleware (< 2.0)
32
+ hashie
33
+ multi_json (< 2.0)
34
+ nokogiri (>= 1.5.2)
35
+ simple_oauth (>= 0.3.0)
36
+ coderay (1.1.3)
23
37
  colorize (0.8.1)
24
- crack (0.4.3)
25
- safe_yaml (~> 1.0.0)
38
+ concurrent-ruby (1.1.7)
39
+ crack (0.4.4)
26
40
  descendants_tracker (0.0.4)
27
41
  thread_safe (~> 0.3, >= 0.3.1)
28
- diff-lcs (1.3)
29
- faraday (0.9.2)
42
+ diff-lcs (1.4.4)
43
+ faraday (1.1.0)
30
44
  multipart-post (>= 1.2, < 3)
31
- faraday_middleware (0.9.2)
32
- faraday (>= 0.7.4, < 0.10)
33
- github_api (0.15.0)
34
- addressable (~> 2.4.0)
45
+ ruby2_keywords
46
+ faraday-http-cache (2.2.0)
47
+ faraday (>= 0.8)
48
+ faraday_middleware (1.0.0)
49
+ faraday (~> 1.0)
50
+ github_api (0.19.0)
51
+ addressable (~> 2.4)
35
52
  descendants_tracker (~> 0.0.4)
36
- faraday (~> 0.8, < 0.10)
37
- hashie (>= 3.4)
38
- mime-types (>= 1.16, < 3.0)
53
+ faraday (>= 0.8, < 2)
54
+ hashie (~> 3.5, >= 3.5.2)
39
55
  oauth2 (~> 1.0)
40
- gli (2.17.0)
41
- hashdiff (0.3.7)
42
- hashie (3.5.7)
43
- highline (1.7.10)
56
+ github_changelog_generator (1.15.2)
57
+ activesupport
58
+ faraday-http-cache
59
+ multi_json
60
+ octokit (~> 4.6)
61
+ rainbow (>= 2.2.1)
62
+ rake (>= 10.0)
63
+ retriable (~> 3.0)
64
+ hashdiff (1.0.1)
65
+ hashie (3.6.0)
66
+ highline (2.0.3)
44
67
  httpclient (2.8.3)
45
- jwt (1.5.6)
46
- method_source (0.9.0)
47
- mime-types (2.99.3)
48
- mini_portile2 (2.3.0)
49
- multi_json (1.13.1)
68
+ i18n (1.8.5)
69
+ concurrent-ruby (~> 1.0)
70
+ jwt (2.2.2)
71
+ method_source (1.0.0)
72
+ mini_portile2 (2.4.0)
73
+ minitest (5.14.2)
74
+ multi_json (1.15.0)
50
75
  multi_xml (0.6.0)
51
- multipart-post (2.0.0)
52
- nokogiri (1.8.2)
53
- mini_portile2 (~> 2.3.0)
54
- oauth2 (1.4.0)
55
- faraday (>= 0.8, < 0.13)
56
- jwt (~> 1.0)
76
+ multipart-post (2.1.1)
77
+ nokogiri (1.10.10)
78
+ mini_portile2 (~> 2.4.0)
79
+ oauth2 (1.4.4)
80
+ faraday (>= 0.8, < 2.0)
81
+ jwt (>= 1.0, < 3.0)
57
82
  multi_json (~> 1.3)
58
83
  multi_xml (~> 0.5)
59
84
  rack (>= 1.2, < 3)
60
- pry (0.11.3)
61
- coderay (~> 1.1.0)
62
- method_source (~> 0.9.0)
63
- pry-byebug (3.6.0)
64
- byebug (~> 10.0)
65
- pry (~> 0.10)
66
- rack (2.0.4)
67
- rake (12.3.1)
68
- rdoc (6.0.3)
69
- reenhanced_bitbucket_api (0.3.2)
70
- faraday (~> 0.9.0)
71
- faraday_middleware (~> 0.9.0)
72
- hashie (>= 3.2)
73
- multi_json (>= 1.7.5, < 2.0)
74
- nokogiri (>= 1.5.2)
75
- simple_oauth (>= 0.3.0)
76
- rspec (3.7.0)
77
- rspec-core (~> 3.7.0)
78
- rspec-expectations (~> 3.7.0)
79
- rspec-mocks (~> 3.7.0)
80
- rspec-core (3.7.1)
81
- rspec-support (~> 3.7.0)
82
- rspec-expectations (3.7.0)
85
+ octokit (4.19.0)
86
+ faraday (>= 0.9)
87
+ sawyer (~> 0.8.0, >= 0.5.3)
88
+ pry (0.13.1)
89
+ coderay (~> 1.1)
90
+ method_source (~> 1.0)
91
+ pry-byebug (3.9.0)
92
+ byebug (~> 11.0)
93
+ pry (~> 0.13.0)
94
+ public_suffix (4.0.6)
95
+ rack (2.2.3)
96
+ rainbow (3.0.0)
97
+ rake (13.0.1)
98
+ rdoc (6.2.1)
99
+ retriable (3.1.2)
100
+ rspec (3.10.0)
101
+ rspec-core (~> 3.10.0)
102
+ rspec-expectations (~> 3.10.0)
103
+ rspec-mocks (~> 3.10.0)
104
+ rspec-core (3.10.0)
105
+ rspec-support (~> 3.10.0)
106
+ rspec-expectations (3.10.0)
83
107
  diff-lcs (>= 1.2.0, < 2.0)
84
- rspec-support (~> 3.7.0)
85
- rspec-mocks (3.7.0)
108
+ rspec-support (~> 3.10.0)
109
+ rspec-mocks (3.10.0)
86
110
  diff-lcs (>= 1.2.0, < 2.0)
87
- rspec-support (~> 3.7.0)
88
- rspec-support (3.7.1)
89
- safe_yaml (1.0.4)
111
+ rspec-support (~> 3.10.0)
112
+ rspec-support (3.10.0)
113
+ ruby2_keywords (0.0.2)
114
+ sawyer (0.8.2)
115
+ addressable (>= 2.3.5)
116
+ faraday (> 0.8, < 2.0)
90
117
  simple_oauth (0.3.1)
91
- thor (0.20.0)
118
+ thor (1.0.1)
92
119
  thread_safe (0.3.6)
93
- webmock (3.3.0)
120
+ tzinfo (1.2.7)
121
+ thread_safe (~> 0.1)
122
+ webmock (3.9.3)
94
123
  addressable (>= 2.3.6)
95
124
  crack (>= 0.3.2)
96
- hashdiff
97
- wwtd (1.3.0)
125
+ hashdiff (>= 0.4.0, < 2.0.0)
126
+ wwtd (1.4.0)
127
+ zeitwerk (2.4.1)
98
128
 
99
129
  PLATFORMS
100
130
  ruby
101
131
 
102
132
  DEPENDENCIES
103
133
  appraisal (= 2.2.0)
104
- bundler (~> 1.16)
105
134
  chronic
106
135
  git_reflow!
136
+ github_changelog_generator
107
137
  pry-byebug
108
- rake (~> 12.3)
138
+ rake (~> 13.0.1)
109
139
  rdoc
110
- rspec (~> 3.7.0)
140
+ rspec (~> 3.9)
111
141
  webmock
112
- wwtd (= 1.3.0)
142
+ wwtd (= 1.4)
113
143
 
114
144
  BUNDLED WITH
115
- 1.16.1
145
+ 2.1.4
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2014 Reenhanced L.L.C.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Reenhanced L.L.C.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,11 +4,11 @@
4
4
  </h1>
5
5
 
6
6
  <p>
7
- <a href="https://circleci.com/gh/reenhanced/git-reflow/tree/master" title="current build status">
8
- <img alt="Circle CI" src="https://circleci.com/gh/reenhanced/gitreflow.svg?style=svg&circle-token=d94825c17c7e33558dc2a82b37afad7b558e5a12">
7
+ <a href="https://actions-badge.atrox.dev/reenhanced/gitreflow/goto?ref=master" title="git workflow">
8
+ <img alt="Git workflow powered by git-reflow" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Freenhanced%2Fgitreflow%2Fbadge%3Fref%3Dmaster&style=flat">
9
9
  </a>
10
10
  <a href="https://github.com/reenhanced/gitreflow" title="git workflow">
11
- <img alt="Git workflow powered by git-reflow" src="https://img.shields.io/badge/git--reflow-v0.8.10-blue.svg?style=flat">
11
+ <img alt="Git workflow powered by git-reflow" src="https://img.shields.io/badge/git--reflow-v0.9.0-blue.svg?style=flat">
12
12
  </a>
13
13
  <a href="http://inch-ci.org/github/reenhanced/gitreflow" title="documentation coverage">
14
14
  <img src="http://inch-ci.org/github/reenhanced/gitreflow.svg?branch=master&style=shields" alt="Git-Reflow Documentation" />
@@ -117,7 +117,7 @@ This sets up a feature branch remotely and brings a local copy to your machine.
117
117
 
118
118
  `git reflow start` takes in the name of the new branch name that you want to create your feature on.
119
119
  In addition, it takes in an optional flag of a _base-branch_ name (`--base`). If you don't pass in this parameter,
120
- then it defaults to "master". The base branch name is the base branch that you want to base your feature off of.
120
+ then it will look up the `reflow.base-branch` git configuration or default to "master". The base branch name is the base branch that you want to base your feature off of.
121
121
  This ensures that every time you start a new base branch, it will be based off of your latest remote base.
122
122
 
123
123
  git reflow start nh-branch-name --base base-branch-name
@@ -137,6 +137,9 @@ git reflow refresh -r <remote-location> -b <base-branch>
137
137
 
138
138
  You pass in the name of the remote to fetch from and the name of the **base-branch** that you would like to merge into your **feature-branch**. The **remote-location** defaults to `origin` and the base-branch defaults to `master`. This command also takes in remote and branch name as flag options.
139
139
 
140
+ > **Note:** If no `base-branch` argument is provided, then we'll look for a `reflow.base-branch` git
141
+ > configuration and fallback to `master` as the default.
142
+
140
143
  ### Reviewing your work
141
144
  ![git reflow review](http://reenhanced.com/reflow/git-reflow-review.gif)
142
145
  ```
@@ -150,9 +153,11 @@ We assume you know what you're doing, so if you need something different, do it
150
153
 
151
154
  After making commits to your branch, run `review`. Didn't push it up? No problem, we'll do it for you.
152
155
  ```
153
- git reflow review -t <title> -m <message>
156
+ git reflow review -t <title> -m <message> <base-branch>
154
157
  ```
155
- > **Note:** `-t` and `-m` are optional.
158
+ > **Note:** `-t` and `-m` are optional, as is the `base-branch` argument. If no
159
+ > base-branch is provided, then we'll look for a `reflow.base-branch` git
160
+ > configuration and fallback to `master` as the default.
156
161
 
157
162
  If you do not pass the title or message options to the review command, you will be given an editor to write your PR request commit message, similar to `git commit`. The first line is the title, the rest is the body.
158
163
 
@@ -202,9 +207,12 @@ If not, create it and print "Pull request created at http://pull-url/". If so, p
202
207
  ### Checking your branch status
203
208
  ![git reflow status](http://reenhanced.com/reflow/git-reflow-status.gif)
204
209
  ```
205
- git reflow status
210
+ git reflow status <base-branch>
206
211
  ```
207
212
 
213
+ > **Note:** If no `base-branch` is provided, then we'll look for a `reflow.base-branch` git
214
+ > configuration and fallback to `master` as the default.
215
+
208
216
  Sometimes you start working on a branch and can't get back to it for a while. It happens. Use +status+ to check on the status of your work.
209
217
 
210
218
  ```
@@ -226,10 +234,13 @@ to find out where your pull request is at. But in case you want to take a look,
226
234
  ### Delivering approved code
227
235
  ![git-reflow deliver](http://reenhanced.com/reflow/git-reflow-deliver.gif)
228
236
  ```
229
- git reflow deliver
237
+ git reflow deliver <base-branch>
230
238
  ```
231
239
 
232
- > **Note:** This documentation is for the process for the github "remote" merge process via the github_api.
240
+ > **Note:** If no `base-branch` argument is provided, then we'll look for a `reflow.base-branch` git
241
+ > configuration and fallback to `master` as the default.
242
+
243
+ > **Also:** This documentation is for the process for the github "remote" merge process via the github_api.
233
244
  For the bitbucket standard or github manual process (used when the user applies -f force flag to the "remote" merge via the github_api), please go to section B.
234
245
 
235
246
 
@@ -432,17 +443,30 @@ If the review is done, it's time to merge. Here's what happens:
432
443
 
433
444
  In order to streamline delivery you can set the following git config to:
434
445
 
435
- 1. always clean up the feature branch after the PR is merged
446
+ 1. always clean up the remote feature branch after the PR is merged
447
+ ```
448
+ git config --global --add "reflow.always-cleanup-remote" "true"
436
449
  ```
437
- git config --global --add "reflow.always-cleanup" "true"
450
+ 2. always clean up the local feature branch after the PR is merged
438
451
  ```
439
- 2. always deliver without further prompt
452
+ git config --global --add "reflow.always-cleanup-local" "true"
453
+ ```
454
+ 3. always deliver without further prompt
440
455
  ```
441
456
  git config --global --add "reflow.always-deliver" "true"
442
457
  ```
443
458
 
444
459
  See our [Advanced Usage](https://github.com/reenhanced/gitreflow/wiki/Full-List-of-Configuration-Options) for more ways you can customize your workflow.
445
460
 
461
+ ## Customization
462
+
463
+ Git-reflow's default process isn't meant to fit every team, which is why we've introduced [Custom Workflows](https://github.com/reenhanced/gitreflow/wiki/Custom-Workflows). With a custom workflow, you can:
464
+
465
+ * Add hooks to be run before, or after any command
466
+ * Use one of our pre-configured workflows as a basis for your own
467
+ * Override any of the default commands
468
+ * Create new commands
469
+
446
470
  ---
447
471
 
448
472
  ## Contributing
data/Rakefile CHANGED
@@ -1,8 +1,15 @@
1
- #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
3
- require "rspec/core/rake_task"
4
-
5
- RSpec::Core::RakeTask.new(:spec)
6
-
7
- task :default => :spec
8
-
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
3
+ require "rspec/core/rake_task"
4
+ require "github_changelog_generator/task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
9
+ config.user = 'reenhanced'
10
+ config.project = 'gitreflow'
11
+ config.since_tag = 'v0.9.2'
12
+ config.future_release = 'master'
13
+ end
14
+
15
+ task :default => :spec
@@ -0,0 +1,3 @@
1
+ # This file is empty on purpose in case there are any custom workflows configured locally.
2
+ # Eventually we will update it to:
3
+ # use "OpenSourceWorkflow"
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "git_reflow"
5
-
6
- require "irb"
7
- IRB.start
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "git_reflow"
5
+
6
+ require "irb"
7
+ IRB.start
data/bin/setup CHANGED
@@ -1,6 +1,6 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
@@ -1,36 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  $: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
3
3
  require 'rubygems'
4
- require 'gli'
5
4
  require 'git_reflow'
6
5
 
7
- include GLI::App
8
-
9
- program_desc 'Git Reflow manages your git workflow.'
10
-
11
- version GitReflow::VERSION
12
-
13
- commands_from 'git_reflow/commands'
14
-
15
- pre do |global,command,options,args|
16
- # Pre logic here
17
- # Return true to proceed; false to abourt and not call the
18
- # chosen command
19
- # Use skips_pre before a command to skip this block
20
- # on that command only
21
- true
6
+ reflow_command = ARGV.shift
7
+ if reflow_command.nil? || GitReflow.workflow.commands[reflow_command.to_sym].nil?
8
+ GitReflow.help
9
+ elsif ARGV.include? "--help"
10
+ GitReflow.documentation_for_command(reflow_command)
11
+ else
12
+ trap 'INT' do
13
+ GitReflow.say "Aborted.", :error
14
+ exit
15
+ end
16
+
17
+ command_options = GitReflow.parse_command_options!(reflow_command)
18
+ GitReflow.logger.debug "Running command `#{reflow_command}` with options: #{command_options.inspect}"
19
+ GitReflow.public_send(reflow_command.to_sym, command_options)
22
20
  end
23
-
24
- post do |global,command,options,args|
25
- # Post logic here
26
- # Use skips_post before a command to skip this
27
- # block on that command only
28
- end
29
-
30
- on_error do |exception|
31
- # Error logic here
32
- # return false to skip default error handling
33
- true
34
- end
35
-
36
- exit run(ARGV)