Rakefile in u3d-1.1.4 vs Rakefile in u3d-1.1.5
- old
+ new
@@ -94,12 +94,15 @@
`which hub`
raise "Missing hub command. This script requires the hub command. Get it from https://hub.github.com" unless $CHILD_STATUS.exitstatus.zero?
end
def hub_config
- require 'YAML'
- File.open(File.expand_path("~/.config/hub"), 'r:bom|utf-8') { |f| Psych.safe_load(f.read) }
+ @hub_config ||=
+ begin
+ require 'YAML'
+ File.open(File.expand_path("~/.config/hub"), 'r:bom|utf-8') { |f| Psych.safe_load(f.read) }
+ end
end
def hub_user(server)
hub_config[server][0]['user']
end
@@ -109,10 +112,19 @@
user = hub_user(server)
`git remote -v`.split("\n").map(&:split).select { |a| a[2] == '(push)' && a[1] =~ /#{server}.#{user}/ }.first[0]
end
+
+def github_team
+ %w[lacostej niezbop]
+end
+
+def github_reviewers
+ server = 'github.com'
+ github_team - [hub_user(server)]
+end
###
task :ensure_git_clean do
branch = run_command('git rev-parse --abbrev-ref HEAD', "Couldn't get current git branch").strip
UI.user_error!("You are not on 'master' but on '#{branch}'") unless branch == "master"
@@ -154,10 +166,10 @@
sh "git commit -m '#{msg}'"
ensure_hub!
hub_remote = hub_fork_remote_name
sh "git push #{hub_remote}"
- sh "hub pull-request -m '#{msg}' -l nochangelog"
+ sh "hub pull-request -m '#{msg}' -r '#{github_reviewers.join(',')}' -l nochangelog"
sh 'git checkout master'
sh "git branch -D #{pr_branch}"
end
desc 'Bump the version number to the version entered interactively; pushes a commit to master'