step-up 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/GEM_VERSION +1 -1
  3. data/lib/step-up/cli.rb +26 -3
  4. metadata +8 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf6868e93e9c2c3fb67af31efb0e0a878a534ef3
4
- data.tar.gz: 0b00af93fde08866ae04b4f5295a1f87b3a70cdb
3
+ metadata.gz: 18b66f3cb606e91efdfa44298f2c67e501706faa
4
+ data.tar.gz: cdb0092f51b4175246f5a566cb0a588645daf266
5
5
  SHA512:
6
- metadata.gz: 0093e9ee7ba24112e5e617661453e2bf19f26054e335e17ef88e33861ae94e476d97661f2494be74fbfb43c7f23d1741d71db83dced3cd1eebac3ae2895a0f23
7
- data.tar.gz: d178135b6bdd49221c9be5eb4dba030dd107594e28ebedd86edd7a819e3f174ad2358b1a0dc1a2b964a30e2f69317577d77434020a806726f57ad0518a781187
6
+ metadata.gz: 9b9910e9585e16041d9b1111a723a1609a0cc0c60eb6062f85b4c7bf3e27b2f480c9f2ccccde470b95b0e33574808d1daeeedeec504c09ff285eb8cacb7a7ff7
7
+ data.tar.gz: fc6144a4e0d7e77a9c37de1ab8809360035082673a2445151210ca524a972e50c1ca8c7adc6268fb8abfbba9721d1e814cd14ebf29ab353ddec4d8f78ecf0e0a
data/GEM_VERSION CHANGED
@@ -1 +1 @@
1
- v0.9.3
1
+ v0.9.4
data/lib/step-up/cli.rb CHANGED
@@ -15,6 +15,7 @@ module StepUp
15
15
  method_options %w(level -l) => :string, %w(steps -s) => :boolean, %w(message -m) => :string, :'no-editor' => :boolean # $ stepup version create [--level|-l <level-name>] [--steps|-s] [--message|-m <comment-string>] [--no-editor]
16
16
  method_options %w(mask -M) => :string # stepup version show --mask development_hudson_build_0
17
17
  method_options %w(masks) => :string # stepup version show --masks
18
+ method_options %w(format -f) => :string
18
19
  VERSION_ACTIONS = %w[show create help]
19
20
  def version(action = nil, commit_base = nil)
20
21
  unless VERSION_ACTIONS.include?(action)
@@ -253,6 +254,7 @@ module StepUp
253
254
  end
254
255
 
255
256
  def version_show
257
+ formats = %w[default mvn mvn-snapshot]
256
258
  if options[:levels]
257
259
  puts "Current version levels:"
258
260
  version_levels.each do |level|
@@ -270,14 +272,35 @@ module StepUp
270
272
  end
271
273
  puts masks.join("\n") if masks.any?
272
274
  else
275
+ format = options[:format] || "default"
276
+ unless formats.member?(format)
277
+ puts "Unknown format #{format.inspect}. Must be one of #{formats.inspect}"
278
+ exit 1
279
+ end
273
280
  mask = options[:mask]
274
281
  mask = nil if mask !~ /0/
282
+ version = nil
275
283
  if options[:"next-release"]
276
- tag = driver.next_version_tag(commit_object, options[:level])
277
- puts tag if tag
284
+ tag = driver.cached_next_version_tag(commit_object, options[:level])
285
+ version = tag
278
286
  else
279
- puts driver(mask).last_version_tag(commit_object || "HEAD", true)
287
+ version = driver(mask).last_version_tag(commit_object || "HEAD", true)
288
+ end
289
+ return unless version
290
+ if format =~ /\Amvn/
291
+ if version =~ /\+/
292
+ suf = $'
293
+ version = driver.cached_next_version_tag(commit_object, options[:level])
294
+ version = "#{ version }+#{ suf }"
295
+ end
296
+ version = version.gsub(/^\D+/, '')
297
+ if format == "mvn-snapshot"
298
+ version = version.gsub(/(\d+)\+\d*$/){ |c| "#{$1}-SNAPSHOT" }
299
+ elsif format == "mvn"
300
+ version = version.gsub(/(\d+)\+(\d*)$/){ |c| "#{$1}.rc#{$2}" }
301
+ end
280
302
  end
303
+ puts version
281
304
  end
282
305
  end
283
306
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: step-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Manzan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-04 00:00:00.000000000 Z
12
+ date: 2014-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -79,16 +79,16 @@ files:
79
79
  - lib/step-up/parser/version_mask.rb
80
80
  - lib/step-up/ranged_notes.rb
81
81
  - lib/step-up/version.rb
82
- - templates/default/Capfile
83
- - templates/default/Gemfile
84
- - templates/default/Rakefile
85
- - templates/default/lib/version.rb
86
- - GEM_VERSION
87
82
  - spec/lib/config_spec.rb
88
83
  - spec/lib/step-up/driver/git_spec.rb
89
84
  - spec/lib/step-up/parser/version_mask_spec.rb
90
85
  - spec/lib/step-up/ranged_notes_spec.rb
91
86
  - spec/spec_helper.rb
87
+ - templates/default/Capfile
88
+ - templates/default/Gemfile
89
+ - templates/default/Rakefile
90
+ - templates/default/lib/version.rb
91
+ - GEM_VERSION
92
92
  homepage: https://github.com/kawamanza/step-up
93
93
  licenses: []
94
94
  metadata: {}
@@ -112,9 +112,4 @@ rubygems_version: 2.0.3
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: The best way to manage your project's versioning
115
- test_files:
116
- - spec/lib/config_spec.rb
117
- - spec/lib/step-up/driver/git_spec.rb
118
- - spec/lib/step-up/parser/version_mask_spec.rb
119
- - spec/lib/step-up/ranged_notes_spec.rb
120
- - spec/spec_helper.rb
115
+ test_files: []