git_reflow 0.8.9 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/multi-ruby-tests.yml +33 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +2 -0
  5. data/.ruby-version +1 -0
  6. data/Appraisals +1 -6
  7. data/CHANGELOG.md +466 -348
  8. data/Gemfile.lock +99 -72
  9. data/LICENSE +20 -20
  10. data/README.md +481 -0
  11. data/Rakefile +15 -8
  12. data/Workflow +3 -0
  13. data/_config.yml +1 -0
  14. data/bin/console +7 -7
  15. data/bin/setup +6 -6
  16. data/exe/git-reflow +20 -36
  17. data/git_reflow.gemspec +26 -30
  18. data/lib/git_reflow.rb +3 -15
  19. data/lib/git_reflow/config.rb +48 -13
  20. data/lib/git_reflow/git_helpers.rb +69 -22
  21. data/lib/git_reflow/git_server.rb +63 -63
  22. data/lib/git_reflow/git_server/base.rb +68 -68
  23. data/lib/git_reflow/git_server/bit_bucket.rb +101 -101
  24. data/lib/git_reflow/git_server/bit_bucket/pull_request.rb +84 -84
  25. data/lib/git_reflow/git_server/git_hub.rb +53 -41
  26. data/lib/git_reflow/git_server/git_hub/pull_request.rb +16 -14
  27. data/lib/git_reflow/git_server/pull_request.rb +4 -2
  28. data/lib/git_reflow/merge_error.rb +9 -9
  29. data/lib/git_reflow/rspec.rb +3 -2
  30. data/lib/git_reflow/rspec/command_line_helpers.rb +23 -6
  31. data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
  32. data/lib/git_reflow/rspec/workflow_helpers.rb +18 -0
  33. data/lib/git_reflow/sandbox.rb +16 -6
  34. data/lib/git_reflow/version.rb +1 -1
  35. data/lib/git_reflow/workflow.rb +304 -9
  36. data/lib/git_reflow/workflows/FlatMergeWorkflow +38 -0
  37. data/lib/git_reflow/workflows/core.rb +364 -238
  38. data/spec/fixtures/authentication_failure.json +3 -0
  39. data/spec/fixtures/awesome_workflow.rb +3 -7
  40. data/spec/fixtures/git/git_config +7 -7
  41. data/spec/fixtures/issues/comment.json.erb +27 -27
  42. data/spec/fixtures/issues/comments.json +29 -29
  43. data/spec/fixtures/issues/comments.json.erb +15 -15
  44. data/spec/fixtures/pull_requests/comment.json.erb +45 -45
  45. data/spec/fixtures/pull_requests/comments.json +47 -47
  46. data/spec/fixtures/pull_requests/comments.json.erb +15 -15
  47. data/spec/fixtures/pull_requests/commits.json +29 -29
  48. data/spec/fixtures/pull_requests/external_pull_request.json +145 -145
  49. data/spec/fixtures/pull_requests/pull_request.json +142 -142
  50. data/spec/fixtures/pull_requests/pull_request.json.erb +142 -142
  51. data/spec/fixtures/pull_requests/pull_request_branch_nonexistent_error.json +32 -0
  52. data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -32
  53. data/spec/fixtures/pull_requests/pull_requests.json +136 -136
  54. data/spec/fixtures/repositories/commit.json +53 -53
  55. data/spec/fixtures/repositories/commit.json.erb +53 -53
  56. data/spec/fixtures/repositories/commits.json.erb +13 -13
  57. data/spec/fixtures/repositories/statuses.json +31 -31
  58. data/spec/fixtures/users/user.json +32 -0
  59. data/spec/lib/git_reflow/git_helpers_spec.rb +115 -12
  60. data/spec/lib/git_reflow/git_server/bit_bucket_spec.rb +81 -81
  61. data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +10 -10
  62. data/spec/lib/git_reflow/git_server/git_hub_spec.rb +77 -3
  63. data/spec/lib/git_reflow/git_server/pull_request_spec.rb +9 -3
  64. data/spec/lib/git_reflow/git_server_spec.rb +101 -101
  65. data/spec/lib/git_reflow/sandbox_spec.rb +1 -1
  66. data/spec/lib/git_reflow/workflow_spec.rb +304 -59
  67. data/spec/lib/git_reflow/workflows/core_spec.rb +225 -67
  68. data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +71 -59
  69. data/spec/lib/git_reflow_spec.rb +2 -25
  70. data/spec/spec_helper.rb +3 -0
  71. data/spec/support/fixtures.rb +54 -54
  72. data/spec/support/github_helpers.rb +99 -109
  73. data/spec/support/mock_pull_request.rb +17 -17
  74. data/spec/support/web_mocks.rb +39 -39
  75. metadata +51 -74
  76. data/README.rdoc +0 -461
  77. data/circle.yml +0 -26
  78. data/lib/git_reflow/commands/deliver.rb +0 -10
  79. data/lib/git_reflow/commands/refresh.rb +0 -20
  80. data/lib/git_reflow/commands/review.rb +0 -13
  81. data/lib/git_reflow/commands/setup.rb +0 -11
  82. data/lib/git_reflow/commands/stage.rb +0 -9
  83. data/lib/git_reflow/commands/start.rb +0 -18
  84. data/lib/git_reflow/commands/status.rb +0 -7
  85. data/lib/git_reflow/os_detector.rb +0 -23
  86. data/lib/git_reflow/workflows/flat_merge.rb +0 -10
  87. data/spec/fixtures/workflow_with_super.rb +0 -8
data/circle.yml DELETED
@@ -1,26 +0,0 @@
1
- dependencies:
2
- cache_directories:
3
- - '~/.rvm/rubies'
4
- - 'vendor'
5
-
6
- override:
7
- - >
8
- case $CIRCLE_NODE_INDEX in
9
- 0)
10
- rvm-exec 2.2.7 gem install bundler
11
- rvm-exec 2.2.7 bash -c "bundle check --path=vendor/bundle_2.1 || bundle install --path=vendor/bundle_2.2"
12
- ;;
13
- 1)
14
- rvm-exec 2.3.4 gem install bundler
15
- rvm-exec 2.3.4 bash -c "bundle check --path=vendor/bundle_2.2 || bundle install --path=vendor/bundle_2.3"
16
- ;;
17
- 2)
18
- rvm-exec ruby-head gem install bundler
19
- rvm-exec ruby-head bash -c "bundle check --path=vendor/bundle_head || bundle install --path=vendor/bundle_head"
20
- ;;
21
- esac
22
-
23
- test:
24
- override:
25
- - case $CIRCLE_NODE_INDEX in 0) rvm-exec 2.2.7 bundle exec rake ;; 1) rvm-exec 2.3.4 bundle exec rake ;; 2) rvm-exec ruby-head bundle exec rake ;; esac:
26
- parallel: true
@@ -1,10 +0,0 @@
1
- desc 'deliver your feature branch'
2
- long_desc 'merge your feature branch down to your base branch, and cleanup your feature branch'
3
-
4
- command :deliver do |c|
5
- c.desc 'merge your feature branch down to your base branch, and cleanup your feature branch'
6
- c.switch [:f, :'skip-lgtm'], desc: 'skip the lgtm checks and deliver your feature branch'
7
- c.action do |global_options, options, args|
8
- GitReflow.deliver base: args[0], force: options[:'skip-lgtm']
9
- end
10
- end
@@ -1,20 +0,0 @@
1
- desc 'Updates and synchronizes your base branch and feature branch.'
2
- long_desc <<LONGTIME
3
- Performs the following:\n
4
- \t$ git checkout <base_branch>\n
5
- \t$ git pull <remote_location> <base_branch>\n
6
- \t$ git checkout <current_branch>\n
7
- \t$ git pull origin <current_branch>\n
8
- \t$ git merge <base_branch>\n
9
- LONGTIME
10
- arg_name '[remote_location] - remote repository name to fetch updates from (origin by default), [base_branch] - branch that you want to merge with (master by default)'
11
- command :refresh do |c|
12
- c.desc 'updates base_branch based on remote and merges the base with your feature_branch'
13
- c.flag [:r,:remote], default_value: 'origin'
14
- c.flag [:b,:base], default_value: 'master'
15
- c.action do |global_options, options, args|
16
-
17
- GitReflow.refresh base: options[:base], remote: options[:remote]
18
-
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- desc 'review will push your latest feature branch changes to your remote repo and create a pull request'
2
- arg_name 'Describe arguments to review here'
3
- command :review do |c|
4
- c.desc 'push your latest feature branch changes to your remote repo and create a pull request against the destination branch'
5
- c.arg_name '[destination_branch] - the branch you want to merge your feature branch into'
6
- c.flag [:t, :title]
7
- c.flag [:m, :message]
8
- c.action do |global_options,options,args|
9
-
10
- GitReflow.review base: args[0], title: options[:title], body: options[:message]
11
-
12
- end
13
- end
@@ -1,11 +0,0 @@
1
- desc 'Setup your GitHub account'
2
- command :setup do |c|
3
- c.desc 'sets up your api token with GitHub'
4
- c.switch [:l, :local], default_value: false, desc: 'setup GitReflow for the current project only'
5
- c.switch [:e, :enterprise], default_value: false, desc: 'setup GitReflow with a Github Enterprise account'
6
- c.action do |global_options, options, args|
7
-
8
- GitReflow.setup local: options[:local], enterprise: options[:enterprise]
9
-
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- desc 'Deliver your changes to a staging server'
2
- command :stage do |c|
3
- c.desc 'deliver your feature branch to the staging branch'
4
- c.action do |global_options, options, args|
5
-
6
- GitReflow.stage
7
-
8
- end
9
- end
@@ -1,18 +0,0 @@
1
-
2
- desc 'Start will create a new feature branch and setup remote tracking'
3
- long_desc <<LONGTIME
4
- Performs the following:\n
5
- \t$ git checkout <base_branch>\n
6
- \t$ git pull origin <base_branch>\n
7
- \t$ git push origin <base_branch>:refs/heads/[new_feature_branch]\n
8
- \t$ git checkout --track -b [new_feature_branch] origin/[new_feature_branch]\n
9
- LONGTIME
10
- arg_name '[new-feature-branch-name] - name of the new feature branch'
11
- command :start do |c|
12
- c.flag [:b,:base], default_value: 'master'
13
- c.action do |global_options, options, args|
14
-
15
- GitReflow.start feature_branch: args[0], base: options[:base]
16
-
17
- end
18
- end
@@ -1,7 +0,0 @@
1
- desc 'Display information about the status of your feature in the review process'
2
- arg_name "destination_branch - the branch you're merging your feature into ('master' is default)"
3
- command :status do |c|
4
- c.action do |global_options, options, args|
5
- GitReflow.status destination_branch: args[0]
6
- end
7
- end
@@ -1,23 +0,0 @@
1
- # Thanks to http://stackoverflow.com/questions/170956/how-can-i-find-which-operating-system-my-ruby-program-is-running-on
2
- # and to Thoughtbot: https://github.com/thoughtbot/cocaine/blob/master/lib/cocaine/os_detector.rb
3
- module GitReflow
4
- class OSDetector
5
- def windows?
6
- (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
7
- end
8
-
9
- def mac?
10
- (/darwin/ =~ RUBY_PLATFORM) != nil
11
- end
12
-
13
- def unix?
14
- !OS.windows?
15
- end
16
-
17
- def linux?
18
- OS.unix? and not OS.mac?
19
- end
20
- end
21
-
22
- OS = OSDetector.new
23
- end
@@ -1,10 +0,0 @@
1
- class FlatMerge < GitReflow::Workflows::Core
2
- def self.deliver(**params)
3
- base_branch = params[:base] || 'master'
4
- params[:squash] = false
5
-
6
- super(**params)
7
- end
8
- end
9
-
10
- FlatMerge
@@ -1,8 +0,0 @@
1
- class WorkflowWithSuper < GitReflow::Workflows::Core
2
- def self.start(**args)
3
- GitReflow.say "Super."
4
- super(feature_branch: args[:feature_branch], base: args[:base])
5
- end
6
- end
7
-
8
- WorkflowWithSuper