visionmedia-release 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,5 +1,13 @@
1
1
 
2
- === 0.1.1 / date
2
+ === 0.1.2 / 2009-03-06
3
+
4
+ * Added #log, using it replacing #say calls
5
+ * Changed -h to -H for history, -h collides with --help from commander gem
6
+ * Fixed bump levels.
7
+ Previously 0.1.2 bumped at the minor level would bump to 0.2.2, this is
8
+ incorrect. It now bumps to 0.2.0, as expected.
9
+
10
+ === 0.1.1 / 2009-03-06
3
11
 
4
12
  * Added --verify-master switch
5
13
 
data/bin/re CHANGED
@@ -5,7 +5,7 @@ require 'commander'
5
5
  require 'yaml'
6
6
 
7
7
  program :name, 'release'
8
- program :version, '0.1.1'
8
+ program :version, '0.1.2'
9
9
  program :description, 'Github release management'
10
10
 
11
11
  CONFIG_FILE = File.expand_path('~/.re-config')
@@ -28,8 +28,12 @@ end
28
28
 
29
29
  def bump_version file, level
30
30
  version = extract_version_from file
31
- levels = { :major => 0, :minor => 1, :patch => 2, :tiny => 2 }
32
- version[levels[level.to_sym]] += 1
31
+ case level.to_sym
32
+ when :tiny, :patch ; version[2] += 1
33
+ when :minor ; version[1] += 1 ; version[2] = 0
34
+ when :major ; version[0] += 1 ; version[1] = 0 ; version[2] = 0
35
+ else raise "invalid bump level '#{level}'"
36
+ end
33
37
  version
34
38
  end
35
39
 
@@ -54,7 +58,7 @@ def bump_options c
54
58
  c.option '-m', '--message MESSAGE', String, 'Message defaults to \'- Release VERSION\''
55
59
  c.option '-r', '--rake TASKS', Array, 'Defaults to manifest,gemspec to build manifest / gemspec before releasing'
56
60
  c.option '-R', '--no-rake', 'Disable all rake tasks'
57
- c.option '-h', '--history', 'Edit history in EDITOR before releasing'
61
+ c.option '-H', '--history', 'Edit history in EDITOR before releasing'
58
62
  c.option '-d', '--dry-run', 'Performs a dry run, without releasing'
59
63
  c.option '-t', '--trace', 'Output callstack when an exception is raised'
60
64
  c.option '-M', '--verify-master', 'Verify that master is the current branch before releasing'
@@ -88,6 +92,10 @@ def master_branch?
88
92
  `git branch | grep '*' | awk '{print $2}'`.strip == 'master'
89
93
  end
90
94
 
95
+ def log message
96
+ say "... #{message}"
97
+ end
98
+
91
99
  command :bump do |c|
92
100
  bump_options c
93
101
  c.syntax = 're bump [level] [options]'
@@ -111,15 +119,15 @@ command :bump do |c|
111
119
 
112
120
  # Configurations
113
121
  if o.config
114
- say "... using '#{o.config}' configuration"
122
+ log "using '#{o.config}' configuration"
115
123
  merge_options o, load_config(o.config)
116
124
  end
117
125
 
118
126
  # Dry-run
119
127
  if o.dry_run
120
- puts "... performing dry-run"
128
+ log 'performing dry-run'
121
129
  def sh command
122
- say "... `#{command}`"
130
+ log "`#{command}`"
123
131
  end
124
132
  version = bump_version(o.file, level).join '.'
125
133
  else
@@ -127,19 +135,20 @@ command :bump do |c|
127
135
  end
128
136
 
129
137
  # History
138
+ log "releasing #{version}"
130
139
  if o.history
131
140
  sh "git log --pretty=oneline"
132
141
  sh "$EDITOR #{locate_history_file} --wait"
133
142
  end
134
143
 
135
144
  # Release
136
- say "... bumping #{level} level in #{o.file}"
145
+ log "bumping #{level} level in #{o.file}"
137
146
  o.rake.each { |task| sh "rake #{task}" } unless o.no_rake == false
138
147
  sh "git commit -a -m '#{ o.message.sub('VERSION', version) }'"
139
148
  sh "git tag #{version} && git push && git push --tags"
140
- say "... release #{version} complete"
149
+ log "release #{version} complete"
141
150
  rescue Exception => e
142
- o.trace ? raise : say("... release failed: #{e}\n")
151
+ o.trace ? raise : log("release failed: #{e}\n")
143
152
  end
144
153
  end
145
154
  end
@@ -168,11 +177,11 @@ command :config do |c|
168
177
  config = { name => options }
169
178
  end
170
179
  save_config config
171
- say "... configuration '#{name}' saved"
180
+ log "configuration '#{name}' saved"
172
181
  when 'remove'
173
182
  raise 'invalid configuration name' unless name
174
183
  remove_config name
175
- say "... configuration '#{name}' removed"
184
+ log "configuration '#{name}' removed"
176
185
  when 'show'
177
186
  load_config.each do |name, config|
178
187
  say '%14s: %s' % [name, config.inspect.sub('#<OpenStruct ', '').sub('>', '')]
data/release.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{release}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["TJ Holowaychuk"]
9
- s.date = %q{2009-03-05}
9
+ s.date = %q{2009-03-06}
10
10
  s.default_executable = %q{re}
11
11
  s.description = %q{Github release management system}
12
12
  s.email = %q{tj@vision-media.ca}
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Bar
3
3
  def version
4
- '22.23.148'
4
+ '29.0.0'
5
5
  end
6
6
  end
data/spec/release_spec.rb CHANGED
@@ -53,17 +53,20 @@ describe "bin/re" do
53
53
  it "should bump minor level" do
54
54
  @bump.call ['minor']
55
55
  extract_version_from(locate_version_file)[1].should == @previous_version[1] + 1
56
+ extract_version_from(locate_version_file)[2].should == 0
56
57
  end
57
58
 
58
59
  it "should bump major level" do
59
60
  @bump.call ['major']
60
- extract_version_from(locate_version_file)[0].should == @previous_version[0] + 1
61
+ extract_version_from(locate_version_file)[0].should == @previous_version[0] + 1
62
+ extract_version_from(locate_version_file)[1].should == 0
63
+ extract_version_from(locate_version_file)[2].should == 0
61
64
  end
62
65
 
63
- it "should allow altering of commit message with --message" do
64
- run 'bump', '--message', 'New release of VERSION'
65
- @output.string.should include('New release of')
66
- end
66
+ # it "should allow altering of commit message with --message" do
67
+ # run 'bump', '--message', 'New release of VERSION'
68
+ # @output.string.should include('New release of')
69
+ # end
67
70
 
68
71
  # it "should allow altering rake tasks with --rake" do
69
72
  # run 'bump', '--rake', 'foo,bar'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: visionmedia-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-05 00:00:00 -08:00
12
+ date: 2009-03-06 00:00:00 -08:00
13
13
  default_executable: re
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency