visionmedia-release 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,12 @@
1
1
 
2
+ === 0.1.3 / 2009-03-06
3
+
4
+ * Added progress-bar
5
+ * Added -n, --commits switch
6
+ * Changed log format
7
+ * Changed dependency, now requires visionmedia-commander >= 2.5.6
8
+ * Changed #sh, now using sub-shell now to prevent cluttering stdout
9
+
2
10
  === 0.1.2 / 2009-03-06
3
11
 
4
12
  * Added #log, using it replacing #say calls
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ Echoe.new("release", program(:version)) do |p|
10
10
  p.summary = "Github release management system"
11
11
  p.url = "http://github.com/visionmedia/release"
12
12
  p.runtime_dependencies = []
13
- p.runtime_dependencies << "visionmedia-commander >=2.4.6"
13
+ p.runtime_dependencies << "visionmedia-commander >=2.5.6"
14
14
  end
15
15
 
16
16
  Dir['tasks/**/*.rake'].sort.each { |f| load f }
data/Todo.rdoc CHANGED
@@ -1,11 +1,13 @@
1
1
 
2
2
  == Major:
3
3
 
4
- * Ability to abort
5
- * Get git log working
6
- * Refactor
4
+ * Add .re-log file with commit SHAs
5
+ * Add ability to do a graceful abort
6
+ * Add option to prevent -a in commit command
7
+ * Get git log working better
7
8
  * Better specs
8
9
  * When exception is raised revert all alterations made to that point
10
+ * Refactor
9
11
 
10
12
  == Minor:
11
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.2'
8
+ program :version, '0.1.3'
9
9
  program :description, 'Github release management'
10
10
 
11
11
  CONFIG_FILE = File.expand_path('~/.re-config')
@@ -15,7 +15,7 @@ trap 'INT' do
15
15
  end
16
16
 
17
17
  def sh command
18
- system command
18
+ exec command
19
19
  end
20
20
 
21
21
  def extract_version_from file
@@ -59,6 +59,7 @@ def bump_options c
59
59
  c.option '-r', '--rake TASKS', Array, 'Defaults to manifest,gemspec to build manifest / gemspec before releasing'
60
60
  c.option '-R', '--no-rake', 'Disable all rake tasks'
61
61
  c.option '-H', '--history', 'Edit history in EDITOR before releasing'
62
+ c.option '-n', '--commits NUMBER', Integer, 'Number of commits to display when using --history'
62
63
  c.option '-d', '--dry-run', 'Performs a dry run, without releasing'
63
64
  c.option '-t', '--trace', 'Output callstack when an exception is raised'
64
65
  c.option '-M', '--verify-master', 'Verify that master is the current branch before releasing'
@@ -75,7 +76,6 @@ def remove_config name
75
76
  end
76
77
 
77
78
  def load_config name = nil
78
- raise "configuration file cannot be found, run `re help config` for usage" unless File.exists? CONFIG_FILE
79
79
  config = YAML.load_file CONFIG_FILE
80
80
  return config unless name
81
81
  raise "configuration '#{name}' cannot be found" unless config.include? name
@@ -96,6 +96,14 @@ def log message
96
96
  say "... #{message}"
97
97
  end
98
98
 
99
+ def action title, &block
100
+ (@__actions ||= []) << [title, block]
101
+ end
102
+
103
+ def actions
104
+ @__actions
105
+ end
106
+
99
107
  command :bump do |c|
100
108
  bump_options c
101
109
  c.syntax = 're bump [level] [options]'
@@ -106,26 +114,26 @@ command :bump do |c|
106
114
  c.option '-c', '--config NAME', 'Load configuration options'
107
115
  c.when_called do |args, o|
108
116
  begin
109
- # Defaults
110
- level = args.shift || 'patch'
111
- o.rake = o.rake || %w( manifest gemspec )
112
- o.file = o.file || locate_version_file
117
+
118
+ level = args.shift || 'patch'
113
119
  o.message = o.message || '- Release VERSION'
114
-
115
- # Master verification
116
- if o.verify_master and !master_branch?
117
- raise 'master branch verification failed'
120
+ o.rake = o.rake || %w( manifest gemspec )
121
+ o.file = o.file || locate_version_file
122
+ o.commits = o.commits || 20
123
+
124
+ if o.verify_master
125
+ action 'verifying master branch' do
126
+ raise 'master branch verification failed' unless master_branch?
127
+ end
118
128
  end
119
-
120
- # Configurations
129
+
121
130
  if o.config
122
- log "using '#{o.config}' configuration"
123
- merge_options o, load_config(o.config)
131
+ action "loading #{o.config} configuration" do
132
+ merge_options o, load_config(o.config)
133
+ end
124
134
  end
125
135
 
126
- # Dry-run
127
136
  if o.dry_run
128
- log 'performing dry-run'
129
137
  def sh command
130
138
  log "`#{command}`"
131
139
  end
@@ -133,20 +141,42 @@ command :bump do |c|
133
141
  else
134
142
  version = replace_version o.file, level
135
143
  end
136
-
137
- # History
138
- log "releasing #{version}"
144
+
139
145
  if o.history
140
- sh "git log --pretty=oneline"
146
+ sh "git log --pretty=format:'%ar | %an | %s' -#{o.commits} | $EDITOR"
141
147
  sh "$EDITOR #{locate_history_file} --wait"
142
148
  end
143
149
 
144
- # Release
145
- log "bumping #{level} level in #{o.file}"
146
- o.rake.each { |task| sh "rake #{task}" } unless o.no_rake == false
147
- sh "git commit -a -m '#{ o.message.sub('VERSION', version) }'"
148
- sh "git tag #{version} && git push && git push --tags"
149
- log "release #{version} complete"
150
+ unless o.no_rake == false
151
+ action 'running rake tasks' do
152
+ o.rake.each { |task| sh "rake #{task}" }
153
+ end
154
+ end
155
+
156
+ action 'committing' do
157
+ sh "git commit -a -m '#{ o.message.sub('VERSION', version) }'"
158
+ end
159
+
160
+ action 'tag / push' do
161
+ sh "git tag #{version} && git push && git push --tags"
162
+ end
163
+
164
+ unless o.dry_run
165
+ options = {
166
+ :complete_message => "Release #{version} complete",
167
+ :format => '(:progress_bar) :title ',
168
+ :width => actions.length * 4,
169
+ }
170
+ progress actions, options do |title, proc|
171
+ proc.call
172
+ { :title => title }
173
+ end
174
+ else
175
+ actions.each do |title, proc|
176
+ proc.call
177
+ end
178
+ end
179
+
150
180
  rescue Exception => e
151
181
  o.trace ? raise : log("release failed: #{e}\n")
152
182
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{release}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
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"]
@@ -26,11 +26,11 @@ Gem::Specification.new do |s|
26
26
  s.specification_version = 2
27
27
 
28
28
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
- s.add_runtime_dependency(%q<visionmedia-commander>, [">= 2.4.6"])
29
+ s.add_runtime_dependency(%q<visionmedia-commander>, [">= 2.5.6"])
30
30
  else
31
- s.add_dependency(%q<visionmedia-commander>, [">= 2.4.6"])
31
+ s.add_dependency(%q<visionmedia-commander>, [">= 2.5.6"])
32
32
  end
33
33
  else
34
- s.add_dependency(%q<visionmedia-commander>, [">= 2.4.6"])
34
+ s.add_dependency(%q<visionmedia-commander>, [">= 2.5.6"])
35
35
  end
36
36
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Bar
3
3
  def version
4
- '29.0.0'
4
+ '30.0.0'
5
5
  end
6
6
  end
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.4.6
23
+ version: 2.5.6
24
24
  version:
25
25
  description: Github release management system
26
26
  email: tj@vision-media.ca