verlane 0.0.2.4 → 0.0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecc72704d75378fd0669c0d0c124aaa15cfcb7e2
4
- data.tar.gz: fb4cd695b4a40e7045beb7aefdb2fd41217d46fb
3
+ metadata.gz: 1fb4d9ef5c9309708b22675c8079e0b542306730
4
+ data.tar.gz: 695d338b44fa12e25b8b0339663954fd4c4a3a75
5
5
  SHA512:
6
- metadata.gz: fb95404828f90e5ea86995a2301000fd63ba9dc3f1e7f539d0557530bfa21e08ff3ac0691760f6d9d3648a7052bc08130b95dca318cbc40462fd0a088835c6da
7
- data.tar.gz: b4a9b2f9680fb0cc217efa5fafc0608d2544b67547d11604949f75b48310b9e8a230ad18d3ef52477d566557f819f739b0b0180ab6ffcbfd3ac84614884b4216
6
+ metadata.gz: 312960356bb7a28f3e56190c21a39db15922c6cc814f49abc8a647b4b56ed7031db6b3397ace0ffe20047d74ef03e5248487519c1130c6e0ca74b0c210f905b4
7
+ data.tar.gz: d674942a7dfac879631ddbde29feeeccca52dfa1d206b69704e4e13d227bfb16a9ae0250996bf55a244dd54e4c1f02b598159da442c7eb4078b9cf3b72017823
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2.4
1
+ 0.0.2.5
@@ -3,25 +3,42 @@ require 'versionomy'
3
3
  require 'yaml'
4
4
 
5
5
  VERSION = if File.exists?('VERSION.yml')
6
- Versionomy.create(YAML.load_file('VERSION.yml'))
6
+ yaml = YAML.load_file('VERSION.yml')
7
+ ver = Versionomy.create(yaml)
8
+ if !ver.prerelease? and yaml[:build] and yaml[:build] > ver.tiny2
9
+ ver = ver.change(tiny2: yaml[:build])
10
+ end
11
+ ver
7
12
  elsif File.exists?('VERSION')
8
13
  Versionomy.parse(File.read('VERSION').strip)
9
14
  else
10
15
  Versionomy.create(major: 0, minor: 0, tiny: 1)
11
16
  end
12
17
 
13
- def bump_version(version)
14
- field = case version.release_type
15
- when :alpha
16
- :alpha_version
17
- when :beta
18
- :beta_version
19
- when :release_candidate
20
- :release_candidate_version
21
- else
22
- :tiny2
18
+ def bump_version(version, fields = {})
19
+ if fields.empty?
20
+ key = case version.release_type
21
+ when :alpha
22
+ :alpha_version
23
+ when :beta
24
+ :beta_version
25
+ when :release_candidate
26
+ :release_candidate_version
27
+ else
28
+ :tiny2
29
+ end
30
+ fields[key] = true
31
+ end
32
+
33
+ build = version.tiny2
34
+
35
+ new_ver = fields.inject(version) {|version, chg| field, change = chg; change.kind_of?(TrueClass) ? version.bump(field) : version.change(field => change) }
36
+
37
+ if new_ver.tiny2 < build
38
+ new_ver.change(tiny2: build)
39
+ else
40
+ new_ver
23
41
  end
24
- version.bump(field)
25
42
  end
26
43
 
27
44
  def save_version(version)
@@ -33,6 +50,7 @@ def save_version(version)
33
50
  ver.merge!(version.values_hash)
34
51
  ver[:string] = version.to_s
35
52
  ver[:short] = version.to_s
53
+ ver[:build] = version.tiny2
36
54
 
37
55
  if File.exists?('VERSION.yml')
38
56
  File.open('VERSION.yml', 'w') {|io| io.write ver.to_yaml}
@@ -61,9 +79,9 @@ namespace :version do
61
79
 
62
80
  namespace :bump do
63
81
  VERSION.field_names[0..4].each do |field|
64
- desc "Bump version to #{VERSION.bump(field).to_s}"
82
+ desc "Bump version to #{bump_version(VERSION, field => true).to_s}"
65
83
  task field do
66
- save_version(VERSION.bump(field))
84
+ save_version(bump_version(VERSION, field => true))
67
85
  end
68
86
  end
69
87
  end
@@ -73,16 +91,16 @@ namespace :version do
73
91
  save_version(VERSION.release)
74
92
  end
75
93
 
76
- desc "Prepare for release #{VERSION.bump(:minor).change(release_type: :beta).to_s}"
94
+ desc "Prepare for release #{bump_version(VERSION, minor: true, release_type: :beta).to_s}"
77
95
  task :pre do
78
- save_version(VERSION.bump(:minor).change(release_type: :beta))
96
+ save_version(bump_version(VERSION, minor: true, release_type: :beta))
79
97
  end
80
98
 
81
99
  namespace :pre do
82
100
  VERSION.field_names[0..2].each do |field|
83
- desc "Prepare for release #{VERSION.bump(field).change(release_type: :beta).to_s}"
101
+ desc "Prepare for release #{bump_version(VERSION, field => true, release_type: :beta).to_s}"
84
102
  task field do
85
- save_version(VERSION.bump(field).change(release_type: :beta))
103
+ save_version(bump_version(VERSION, field => true, release_type: :beta))
86
104
  end
87
105
  end
88
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.4
4
+ version: 0.0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikko Kokkonen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-30 00:00:00.000000000 Z
11
+ date: 2013-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: versionomy