git_reflow 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +348 -348
- data/Gemfile.lock +13 -15
- data/LICENSE +20 -20
- data/README.rdoc +461 -461
- data/Rakefile +8 -8
- data/bin/console +7 -7
- data/bin/setup +6 -6
- data/circle.yml +5 -5
- data/exe/git-reflow +36 -36
- data/git_reflow.gemspec +1 -1
- data/lib/git_reflow/commands/deliver.rb +10 -10
- data/lib/git_reflow/commands/refresh.rb +20 -20
- data/lib/git_reflow/commands/review.rb +13 -13
- data/lib/git_reflow/commands/setup.rb +11 -11
- data/lib/git_reflow/commands/stage.rb +9 -9
- data/lib/git_reflow/commands/start.rb +22 -22
- data/lib/git_reflow/commands/status.rb +7 -7
- data/lib/git_reflow/config.rb +9 -9
- data/lib/git_reflow/git_server/base.rb +68 -68
- data/lib/git_reflow/git_server/bit_bucket/pull_request.rb +84 -84
- data/lib/git_reflow/git_server/bit_bucket.rb +101 -101
- data/lib/git_reflow/git_server/git_hub/pull_request.rb +4 -1
- data/lib/git_reflow/git_server/pull_request.rb +11 -2
- data/lib/git_reflow/git_server.rb +63 -63
- data/lib/git_reflow/logger.rb +49 -0
- data/lib/git_reflow/merge_error.rb +9 -9
- data/lib/git_reflow/os_detector.rb +23 -23
- data/lib/git_reflow/rspec/command_line_helpers.rb +12 -8
- data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
- data/lib/git_reflow/rspec.rb +2 -2
- data/lib/git_reflow/sandbox.rb +11 -6
- data/lib/git_reflow/version.rb +1 -1
- data/lib/git_reflow/workflow.rb +59 -59
- data/lib/git_reflow/workflows/core.rb +238 -238
- data/lib/git_reflow/workflows/flat_merge.rb +10 -10
- data/lib/git_reflow.rb +11 -0
- data/spec/fixtures/awesome_workflow.rb +7 -0
- data/spec/fixtures/git/git_config +7 -0
- data/spec/fixtures/issues/comment.json.erb +27 -0
- data/spec/fixtures/issues/comments.json +29 -0
- data/spec/fixtures/issues/comments.json.erb +15 -0
- data/spec/fixtures/pull_requests/comment.json.erb +45 -0
- data/spec/fixtures/pull_requests/comments.json +47 -0
- data/spec/fixtures/pull_requests/comments.json.erb +15 -0
- data/spec/fixtures/pull_requests/commits.json +29 -0
- data/spec/fixtures/pull_requests/external_pull_request.json +145 -0
- data/spec/fixtures/pull_requests/pull_request.json +142 -0
- data/spec/fixtures/pull_requests/pull_request.json.erb +142 -0
- data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -0
- data/spec/fixtures/pull_requests/pull_requests.json +136 -0
- data/spec/fixtures/repositories/commit.json +53 -0
- data/spec/fixtures/repositories/commit.json.erb +53 -0
- data/spec/fixtures/repositories/commits.json.erb +13 -0
- data/spec/fixtures/repositories/statuses.json +31 -0
- data/spec/fixtures/workflow_with_super.rb +8 -0
- data/spec/lib/git_reflow/config_spec.rb +74 -0
- data/spec/lib/git_reflow/git_helpers_spec.rb +182 -0
- data/spec/lib/git_reflow/git_server/bit_bucket_spec.rb +81 -0
- data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +587 -0
- data/spec/lib/git_reflow/git_server/git_hub_spec.rb +221 -0
- data/spec/lib/git_reflow/git_server/pull_request_spec.rb +524 -0
- data/spec/lib/git_reflow/git_server_spec.rb +101 -0
- data/spec/lib/git_reflow/logger_spec.rb +18 -0
- data/spec/lib/git_reflow/sandbox_spec.rb +15 -0
- data/spec/lib/git_reflow/workflow_spec.rb +59 -0
- data/spec/lib/git_reflow/workflows/core_spec.rb +665 -0
- data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +59 -0
- data/spec/lib/git_reflow_spec.rb +75 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/fake_github.rb +128 -0
- data/spec/support/fixtures.rb +54 -0
- data/spec/support/github_helpers.rb +109 -0
- data/spec/support/mock_pull_request.rb +17 -0
- data/spec/support/web_mocks.rb +39 -0
- metadata +83 -6
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
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
|
+
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
|
7
|
+
task :default => :spec
|
8
|
+
|
data/bin/console
CHANGED
@@ -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
|
data/circle.yml
CHANGED
@@ -7,12 +7,12 @@ dependencies:
|
|
7
7
|
- >
|
8
8
|
case $CIRCLE_NODE_INDEX in
|
9
9
|
0)
|
10
|
-
rvm-exec 2.
|
11
|
-
rvm-exec 2.
|
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
12
|
;;
|
13
13
|
1)
|
14
|
-
rvm-exec 2.
|
15
|
-
rvm-exec 2.
|
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
16
|
;;
|
17
17
|
2)
|
18
18
|
rvm-exec ruby-head gem install bundler
|
@@ -22,5 +22,5 @@ dependencies:
|
|
22
22
|
|
23
23
|
test:
|
24
24
|
override:
|
25
|
-
- case $CIRCLE_NODE_INDEX in 0) rvm-exec 2.
|
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
26
|
parallel: true
|
data/exe/git-reflow
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
$: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
|
3
|
-
require 'rubygems'
|
4
|
-
require 'gli'
|
5
|
-
require 'git_reflow'
|
6
|
-
|
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
|
22
|
-
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)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$: << File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../lib')
|
3
|
+
require 'rubygems'
|
4
|
+
require 'gli'
|
5
|
+
require 'git_reflow'
|
6
|
+
|
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
|
22
|
+
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)
|
data/git_reflow.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.add_development_dependency('wwtd', '1.3.0')
|
31
31
|
|
32
32
|
s.add_dependency('colorize', '>= 0.7.0')
|
33
|
-
s.add_dependency('gli', '2.
|
33
|
+
s.add_dependency('gli', '2.15.0')
|
34
34
|
s.add_dependency('highline')
|
35
35
|
s.add_dependency('httpclient')
|
36
36
|
s.add_dependency('github_api', '0.15.0')
|
@@ -1,10 +1,10 @@
|
|
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
|
+
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 +1,20 @@
|
|
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
|
+
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 +1,13 @@
|
|
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
|
+
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 +1,11 @@
|
|
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
|
+
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 +1,9 @@
|
|
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
|
+
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,22 +1,22 @@
|
|
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
|
-
if args.empty?
|
16
|
-
raise "usage: git-reflow start [new-branch-name]"
|
17
|
-
else
|
18
|
-
GitReflow.start feature_branch: args[0], base: options[:base]
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
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
|
+
if args.empty?
|
16
|
+
raise "usage: git-reflow start [new-branch-name]"
|
17
|
+
else
|
18
|
+
GitReflow.start feature_branch: args[0], base: options[:base]
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -1,7 +1,7 @@
|
|
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
|
+
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
|
data/lib/git_reflow/config.rb
CHANGED
@@ -10,9 +10,9 @@ module GitReflow
|
|
10
10
|
else
|
11
11
|
local = local ? '--local ' : ''
|
12
12
|
if all
|
13
|
-
new_value = GitReflow::Sandbox.run "git config #{local}--get-all #{key}", loud: false
|
13
|
+
new_value = GitReflow::Sandbox.run "git config #{local}--get-all #{key}", loud: false, blocking: false
|
14
14
|
else
|
15
|
-
new_value = GitReflow::Sandbox.run "git config #{local}--get #{key}", loud: false
|
15
|
+
new_value = GitReflow::Sandbox.run "git config #{local}--get #{key}", loud: false, blocking: false
|
16
16
|
end
|
17
17
|
instance_variable_set(:"@#{key.tr('.-', '_')}", new_value.strip)
|
18
18
|
end
|
@@ -21,28 +21,28 @@ module GitReflow
|
|
21
21
|
def set(key, value, local: false)
|
22
22
|
value = "#{value}".strip
|
23
23
|
if local
|
24
|
-
GitReflow::Sandbox.run "git config --replace-all #{key} \"#{value}\"", loud: false
|
24
|
+
GitReflow::Sandbox.run "git config --replace-all #{key} \"#{value}\"", loud: false, blocking: false
|
25
25
|
else
|
26
|
-
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --replace-all #{key} \"#{value}\"", loud: false
|
26
|
+
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --replace-all #{key} \"#{value}\"", loud: false, blocking: false
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def unset(key, value: nil, local: false)
|
31
31
|
value = (value.nil?) ? "" : "\"#{value}\""
|
32
32
|
if local
|
33
|
-
GitReflow::Sandbox.run "git config --unset-all #{key} #{value}", loud: false
|
33
|
+
GitReflow::Sandbox.run "git config --unset-all #{key} #{value}", loud: false, blocking: false
|
34
34
|
else
|
35
|
-
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --unset-all #{key} #{value}", loud: false
|
35
|
+
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --unset-all #{key} #{value}", loud: false, blocking: false
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
def add(key, value, local: false, global: false)
|
40
40
|
if global
|
41
|
-
GitReflow::Sandbox.run "git config --global --add #{key} \"#{value}\"", loud: false
|
41
|
+
GitReflow::Sandbox.run "git config --global --add #{key} \"#{value}\"", loud: false, blocking: false
|
42
42
|
elsif local
|
43
|
-
GitReflow::Sandbox.run "git config --add #{key} \"#{value}\"", loud: false
|
43
|
+
GitReflow::Sandbox.run "git config --add #{key} \"#{value}\"", loud: false, blocking: false
|
44
44
|
else
|
45
|
-
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --add #{key} \"#{value}\"", loud: false
|
45
|
+
GitReflow::Sandbox.run "git config -f #{CONFIG_FILE_PATH} --add #{key} \"#{value}\"", loud: false, blocking: false
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -1,68 +1,68 @@
|
|
1
|
-
require 'git_reflow/config'
|
2
|
-
|
3
|
-
module GitReflow
|
4
|
-
class GitServer::Base
|
5
|
-
extend GitHelpers
|
6
|
-
|
7
|
-
@@connection = nil
|
8
|
-
|
9
|
-
def initialize(options)
|
10
|
-
site_url = self.class.site_url
|
11
|
-
api_endpoint = self.class.api_endpoint
|
12
|
-
|
13
|
-
self.class.site_url = site_url
|
14
|
-
self.class.api_endpoint = api_endpoint
|
15
|
-
|
16
|
-
authenticate
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.connection
|
20
|
-
raise "#{self.class.to_s}.connection method must be implemented"
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.user
|
24
|
-
raise "#{self.class.to_s}.user method must be implemented"
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.api_endpoint
|
28
|
-
raise "#{self.class.to_s}.api_endpoint method must be implemented"
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.api_endpoint=(api_endpoint, options = {local: false})
|
32
|
-
raise "#{self.class.to_s}.api_endpoint= method must be implemented"
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.site_url
|
36
|
-
raise "#{self.class.to_s}.site_url method must be implemented"
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.site_url=(site_url, options = {local: false})
|
40
|
-
raise "#{self.class.to_s}.site_url= method must be implemented"
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.project_only?
|
44
|
-
GitReflow::Config.get("reflow.local-projects", all: true).include? "#{remote_user}/#{remote_repo_name}"
|
45
|
-
end
|
46
|
-
|
47
|
-
def connection
|
48
|
-
@connection ||= self.class.connection
|
49
|
-
end
|
50
|
-
|
51
|
-
def authenticate
|
52
|
-
raise "#{self.class.to_s}#authenticate method must be implemented"
|
53
|
-
end
|
54
|
-
|
55
|
-
def find_open_pull_request(options)
|
56
|
-
raise "#{self.class.to_s}#find_open_pull_request(options) method must be implemented"
|
57
|
-
end
|
58
|
-
|
59
|
-
def get_build_status sha
|
60
|
-
raise "#{self.class.to_s}#get_build_status(sha) method must be implemented"
|
61
|
-
end
|
62
|
-
|
63
|
-
def colorized_build_description status
|
64
|
-
raise "#{self.class.to_s}#colorized_build_description(status) method must be implemented"
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
1
|
+
require 'git_reflow/config'
|
2
|
+
|
3
|
+
module GitReflow
|
4
|
+
class GitServer::Base
|
5
|
+
extend GitHelpers
|
6
|
+
|
7
|
+
@@connection = nil
|
8
|
+
|
9
|
+
def initialize(options)
|
10
|
+
site_url = self.class.site_url
|
11
|
+
api_endpoint = self.class.api_endpoint
|
12
|
+
|
13
|
+
self.class.site_url = site_url
|
14
|
+
self.class.api_endpoint = api_endpoint
|
15
|
+
|
16
|
+
authenticate
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.connection
|
20
|
+
raise "#{self.class.to_s}.connection method must be implemented"
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.user
|
24
|
+
raise "#{self.class.to_s}.user method must be implemented"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.api_endpoint
|
28
|
+
raise "#{self.class.to_s}.api_endpoint method must be implemented"
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.api_endpoint=(api_endpoint, options = {local: false})
|
32
|
+
raise "#{self.class.to_s}.api_endpoint= method must be implemented"
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.site_url
|
36
|
+
raise "#{self.class.to_s}.site_url method must be implemented"
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.site_url=(site_url, options = {local: false})
|
40
|
+
raise "#{self.class.to_s}.site_url= method must be implemented"
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.project_only?
|
44
|
+
GitReflow::Config.get("reflow.local-projects", all: true).include? "#{remote_user}/#{remote_repo_name}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def connection
|
48
|
+
@connection ||= self.class.connection
|
49
|
+
end
|
50
|
+
|
51
|
+
def authenticate
|
52
|
+
raise "#{self.class.to_s}#authenticate method must be implemented"
|
53
|
+
end
|
54
|
+
|
55
|
+
def find_open_pull_request(options)
|
56
|
+
raise "#{self.class.to_s}#find_open_pull_request(options) method must be implemented"
|
57
|
+
end
|
58
|
+
|
59
|
+
def get_build_status sha
|
60
|
+
raise "#{self.class.to_s}#get_build_status(sha) method must be implemented"
|
61
|
+
end
|
62
|
+
|
63
|
+
def colorized_build_description status
|
64
|
+
raise "#{self.class.to_s}#colorized_build_description(status) method must be implemented"
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|