heroku_release 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/heroku_release.rb +10 -2
- data/lib/heroku_release/version.rb +1 -1
- data/spec/task_spec.rb +4 -3
- metadata +5 -5
data/Gemfile.lock
CHANGED
data/lib/heroku_release.rb
CHANGED
@@ -36,7 +36,7 @@ module HerokuRelease
|
|
36
36
|
release_name = get_release_name
|
37
37
|
commit_version_file(release_name) if config.version_file_path
|
38
38
|
output "Tagging release as '#{release_name}'"
|
39
|
-
execute "git tag -a #{release_name} -m '#{
|
39
|
+
execute "git tag -a #{release_name} -m '#{quoted_tag_comment}'"
|
40
40
|
execute "git push --tags origin"
|
41
41
|
execute "git push --tags #{config.heroku_remote}"
|
42
42
|
commit_changelog if config.changelog_path
|
@@ -86,6 +86,10 @@ module HerokuRelease
|
|
86
86
|
execute "git push origin :refs/tags/#{tag_name}"
|
87
87
|
end
|
88
88
|
|
89
|
+
def quoted_tag_comment
|
90
|
+
tag_comment.gsub("'") { %q{'\''} } # quote single quotes
|
91
|
+
end
|
92
|
+
|
89
93
|
def tag_comment
|
90
94
|
return ENV['COMMENT'] if ENV['COMMENT']
|
91
95
|
if config.prompt_for_comments
|
@@ -130,11 +134,15 @@ module HerokuRelease
|
|
130
134
|
|
131
135
|
def commit_changelog
|
132
136
|
output "Committing #{config.changelog_path}"
|
133
|
-
|
137
|
+
write_changelog
|
134
138
|
execute "git add #{config.changelog_path}"
|
135
139
|
execute "git commit -m 'Updated #{config.changelog_path}'"
|
136
140
|
execute "git push origin master"
|
137
141
|
end
|
142
|
+
|
143
|
+
def write_changelog
|
144
|
+
File.open(config.changelog_path, "w") { |f| f.print(changelog_warning + changelog) }
|
145
|
+
end
|
138
146
|
|
139
147
|
def changelog_warning
|
140
148
|
"# NOTE: this file is autogenerated by the heroku_release gem - do not hand edit\n\n"
|
data/spec/task_spec.rb
CHANGED
@@ -36,10 +36,10 @@ describe HerokuRelease::Task do
|
|
36
36
|
|
37
37
|
describe "tag" do
|
38
38
|
it "create git tag with release name and comment and pushes it to origin and to heroku" do
|
39
|
-
ENV['COMMENT'] = "
|
39
|
+
ENV['COMMENT'] = "don't forget to comment"
|
40
40
|
@task.expects(:get_release_name).returns("release-123")
|
41
41
|
@task.expects(:commit_version_file).never
|
42
|
-
expect_tag_created("release-123",
|
42
|
+
expect_tag_created("release-123", ENV['COMMENT'])
|
43
43
|
|
44
44
|
@task.tag
|
45
45
|
end
|
@@ -87,7 +87,8 @@ describe HerokuRelease::Task do
|
|
87
87
|
|
88
88
|
def expect_tag_created(release_name, comment = "Tagged release")
|
89
89
|
git = sequence('git')
|
90
|
-
|
90
|
+
quoted_comment = comment.gsub("'") { %q{'\''} }
|
91
|
+
@task.expects(:execute).with("git tag -a #{release_name} -m '#{quoted_comment}'").in_sequence(git)
|
91
92
|
@task.expects(:execute).with("git push --tags origin").in_sequence(git)
|
92
93
|
@task.expects(:execute).with("git push --tags #{@config.heroku_remote}").in_sequence(git)
|
93
94
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Peter Marklund
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-07 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
84
|
requirements:
|
85
85
|
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
hash:
|
87
|
+
hash: 1071170481
|
88
88
|
segments:
|
89
89
|
- 0
|
90
90
|
version: "0"
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
hash:
|
96
|
+
hash: 1071170481
|
97
97
|
segments:
|
98
98
|
- 0
|
99
99
|
version: "0"
|