semantic-version 2.0.0.pre.alpha.2 → 2.0.0.pre.alpha.3

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: 8ab245c417014558c7034b5692dc17532fc0d253
4
- data.tar.gz: 660f07bf67170be21faf606cd622c1afea2b0366
3
+ metadata.gz: bfcb34f79fc21a8ebfc00478290628a1a1247169
4
+ data.tar.gz: 89676c746d1195f11210f8a95cf4ed7ca67306e5
5
5
  SHA512:
6
- metadata.gz: ac2b2458ce74a1c4ce9c02f9c2e0b6cd9d4a486f64135d03ff73842858fcadf1b9bae9923931cc1a5f2fafd70d2c56df72cef1845c90dfceb241f8182725f291
7
- data.tar.gz: 649f48151f9703142f692ae84140c67e65a953325eceb41df557584f682047577d68e11140bb9413099201bd9dd8136c973c4b7c7386f606085373299dea2787
6
+ metadata.gz: 38c27d6a71f47eda91b60dbe624f000a22e3f2410db1a0d0d3f0853676c2fee9116734df87f8a896a990da43606754262a28712f1d476f7e7f05903c029e3b82
7
+ data.tar.gz: 4924886e59f04fc85cff3eb335c9246454cdb06b632d717e8224932013a881814dd0de3d27fdd7ea1de832173c9e13a7f69a2e886f8cb8bb7982ca047321e6ce
@@ -31,10 +31,14 @@ module Semantic
31
31
 
32
32
  def version
33
33
  @version ||= Semantic::Version.read version_filepath
34
+ rescue
35
+ nil
34
36
  end
35
37
 
36
38
  def version_filepath
37
39
  @version_filepath ||= Pathname.new find_version_file
40
+ rescue
41
+ nil
38
42
  end
39
43
 
40
44
  def find_version_file
@@ -62,7 +66,7 @@ module Semantic
62
66
  end
63
67
  end
64
68
  end
65
- end
69
+ end if @prompt_for_version_file
66
70
  end
67
71
 
68
72
  def update_version(type, level = default_level, incrementor = default_incrementor, num = default_num)
@@ -107,7 +111,7 @@ include Semantic::Version::Tasks
107
111
 
108
112
  desc [
109
113
  'Show version number in',
110
- version_filepath ? version_filepath : '.version',
114
+ version_filepath ? version_filepath : '.version file',
111
115
  version ? "(v#{version})" : nil,
112
116
  ].compact.join(' ')
113
117
  task :version do
@@ -167,6 +171,7 @@ namespace :version do
167
171
 
168
172
  desc generate_description(type, default_level, types[default_type], default_num) if type == default_type
169
173
  task type do
174
+ @prompt_for_version_file = true
170
175
  update_version(type, default_level, types[type], default_num)
171
176
  end
172
177
 
@@ -176,12 +181,14 @@ namespace :version do
176
181
 
177
182
  desc generate_description(type, level, types[type], default_num) if type == default_type and level != default_level
178
183
  task level do
184
+ @prompt_for_version_file = true
179
185
  update_version(type, level, types[type], default_num)
180
186
  end
181
187
 
182
188
  namespace level do
183
189
  desc generate_description(type, level, types[type], 'the specified number') unless true # type == default_type
184
190
  task types[type], :num do |_, opts|
191
+ @prompt_for_version_file = true
185
192
  update_version(type, level, types[type], Integer(opts[:num]))
186
193
  end
187
194
  end
@@ -194,22 +201,26 @@ namespace :version do
194
201
 
195
202
  desc generate_description(:release)
196
203
  task :release do
204
+ @prompt_for_version_file = true
197
205
  update_version(:release)
198
206
  end
199
207
 
200
208
  task :number do
209
+ @prompt_for_version_file = true
201
210
  say version.number
202
211
  end
203
212
 
204
213
  %i[prerelease meta].each do |data|
205
214
 
206
215
  task data do
216
+ @prompt_for_version_file = true
207
217
  say version.send data
208
218
  end
209
219
 
210
220
  namespace data do
211
221
 
212
222
  task :clear do
223
+ @prompt_for_version_file = true
213
224
  updated_version = version.tap do |v|
214
225
  v.send :"#{data}=", nil
215
226
  end
@@ -217,6 +228,7 @@ namespace :version do
217
228
  end
218
229
 
219
230
  task :set, :to do |_, opts|
231
+ @prompt_for_version_file = true
220
232
  updated_version = version.tap do |v|
221
233
  v.send :"#{data}=", *opts[:to].split('.')
222
234
  end
@@ -224,6 +236,7 @@ namespace :version do
224
236
  end
225
237
 
226
238
  task :append, :element do |_, opts|
239
+ @prompt_for_version_file = true
227
240
  updated_version = version.tap do |v|
228
241
  v.send(:"#{data}") << opts[:element]
229
242
  end
@@ -1 +1 @@
1
- 2.0.0-alpha.2
1
+ 2.0.0-alpha.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic-version
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.2
4
+ version: 2.0.0.pre.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Keele