primedia-qa_release_tasks 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cli.rb CHANGED
@@ -1,16 +1,22 @@
1
1
  module CLI
2
2
  def warn(message)
3
- STDERR.puts "*" * 50
4
- STDERR.puts "Warning: #{message}"
5
- STDERR.puts "*" * 50
3
+ wrap(STDERR){ STDERR.puts "Warning: #{message}" }
6
4
  end
7
5
 
8
6
  def error(message)
9
- STDERR.puts "*" * 50
10
- STDERR.puts "Error: #{message}"
11
- STDERR.puts "*" * 50
7
+ wrap(STDERR){ STDERR.puts "Error: #{message}" }
12
8
  exit 1
13
9
  end
10
+
11
+ def stars(num=50)
12
+ return "*" * num
13
+ end
14
+
15
+ def wrap(stream=STDOUT)
16
+ stream.puts stars
17
+ yield
18
+ stream.puts stars
19
+ end
14
20
 
15
21
  def ask(question, default=nil, valid_response=nil, invalid_message=nil)
16
22
  loop do
data/lib/git/tagger.rb CHANGED
@@ -14,14 +14,19 @@ module Git
14
14
  assert_on_qa_branch
15
15
  assert_no_local_modifications
16
16
  update_qa if options[:update]
17
+ fetch_tags
17
18
  tag_next_version(options)
18
- git_push_tags
19
+ push_tags
19
20
  ensure
20
21
  system 'git checkout qa_branch' unless get_branch == 'qa_branch'
21
22
  end
22
23
  end
23
24
 
24
25
  private
26
+
27
+ def fetch_tags
28
+ system("git fetch --tags")
29
+ end
25
30
 
26
31
  def assert_no_local_modifications
27
32
  if needs_commit?
@@ -36,10 +41,11 @@ module Git
36
41
  end
37
42
 
38
43
  def update_qa
44
+ verify_update_is_ok
39
45
  system("git checkout master") &&
40
- system("git pull") &&
46
+ system("git pull --rebase") &&
41
47
  system("git checkout qa_branch") &&
42
- system("git pull") &&
48
+ system("git pull --rebase") &&
43
49
  response = %x(git merge master)
44
50
 
45
51
  unless $?.success?
@@ -56,6 +62,14 @@ module Git
56
62
  warn "There are outstanding changes in qa_branch that may need to be merged into master"
57
63
  end
58
64
  end
65
+
66
+ def verify_update_is_ok
67
+ wrap do
68
+ answer = ask "This will pull the latest changes from master into the qa_branch. Continue?",
69
+ nil, /^yes|no$/i, "You must enter either 'yes' or 'no'"
70
+ abort "Exiting" unless answer.match(/^yes$/i)
71
+ end
72
+ end
59
73
 
60
74
  def tag_next_version(options={})
61
75
  tag = next_version(options)
@@ -66,7 +80,7 @@ module Git
66
80
  system "git tag #{tag}"
67
81
  end
68
82
 
69
- def git_push_tags
83
+ def push_tags
70
84
  system "git push --tags"
71
85
  end
72
86
  end
@@ -6,7 +6,7 @@ require 'git/tagger'
6
6
  require 'tasks/qa_release'
7
7
 
8
8
  module QaReleaseTasks
9
- VERSION = '0.5.1'
9
+ VERSION = '0.5.3'
10
10
 
11
11
  def self.version
12
12
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primedia-qa_release_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Noble
@@ -10,7 +10,7 @@ autorequire: qa_release_tasks
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-04-13 00:00:00 -07:00
13
+ date: 2009-04-14 00:00:00 -07:00
14
14
  default_executable: git-changelog
15
15
  dependencies: []
16
16