cliutils 1.3.0 → 1.3.1

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: c9dcbf526eb200d6ad6ce2b5c1e76ffdcf3ae0c4
4
- data.tar.gz: 62fe908e18ab47851682dd3dd53c71b425c9aa81
3
+ metadata.gz: 0b935a6abdb2d5219fc26e2e48196ac7457d1356
4
+ data.tar.gz: d0e4774d9efc3c844f7d88adf646a3466d8625f0
5
5
  SHA512:
6
- metadata.gz: 5916ccafc3e3e5df98ac6edb49a05ab04676df72d271774c4fb1230b7b8fd106d33cfa64813a0a8526314d6026bfbe81e1ce3b6616293337bb8c96c1e1e38912
7
- data.tar.gz: 1e01491ced1114a355c9721d8c5e3969909d904fa0cc1b4738a17253af92c727870d2b47485e1a9a18c0be7baffcef7df1abd83ce740963bcc545eb32868f10e
6
+ metadata.gz: 9e27d2ac30177630a86aeb0e994a31160fb598fd2ad9970ad1958e46a2af80f7b6837a3cab7a0a962a5d97d3ef25f1e6860b5df8111fb3a7e01f2adae9a33f53
7
+ data.tar.gz: 9970736e7841b7a8762fc3c2cee06c0412b8c076c01e4e21fc46d0f4429316a1430a3d66f5dfb89e8c6fe874aed0cb7008db63c53e70f1eda30f2cc64ae89971
data/HISTORY.md CHANGED
@@ -1,4 +1,8 @@
1
- # 1.3.9 (2014-04-12)
1
+ # 1.3.1 (2014-04-12)
2
+
3
+ * Modified version check to include missing current version
4
+
5
+ # 1.3.0 (2014-04-12)
2
6
 
3
7
  * Revised Configurator version checking
4
8
  * Added some documentation
data/README.md CHANGED
@@ -143,7 +143,7 @@ messenger.success('But Luke still blew up the Death Star!')
143
143
  # Outputs 'Starting up...', runs the code in
144
144
  # `# do stuff here`, and once complete,
145
145
  # outputs 'Done!' on the same line.
146
- messenger.info_block('Starting up...', 'Done!', multiline = false) {
146
+ messenger.info_block('Starting up...', 'Done!', multiline = false) {
147
147
  # ...do stuff here...
148
148
  }
149
149
 
@@ -282,7 +282,9 @@ user_data:
282
282
 
283
283
  ### Checking Configuration Versions
284
284
 
285
- Often, you'll want to check the user's current version of your app against the last version that required some sort of configuration change. `configurator` allows for this via its `compare_version` method.
285
+ Often, you'll want to check the user's current version of your app against the last version that required some sort of configuration change; moreover, you'll want to run some "re-configuration" steps if the user's version is older than the last version that required a configuration update.
286
+
287
+ `configurator` allows for this via its `compare_version` method.
286
288
 
287
289
  Assume you have a config file that looks like this:
288
290
 
@@ -312,16 +314,19 @@ configuration.current_version = configuration.app_data['APP_VERSION']
312
314
  # a re-configuration in a property of the Configurator.
313
315
  configuration.last_version = LATEST_CONFIG_VERSION
314
316
 
315
- # Run the check and use a block to get
316
- # the current and "last-needing-changes"
317
- # versions (and do something about it).
317
+ # Run the check. If the current version is older than
318
+ # the "last" version, use a block to tell the Configurator
319
+ # what to do.
318
320
  configuration.compare_version do |c, l|
319
321
  puts "We need to update from #{c} to #{l}..."
320
322
  # ...do stuff...
321
323
  end
322
324
  ```
323
325
 
324
- Note that if the current version is *later* than the last version that required re-configuration, the whole block is skipped over (allowing your app to get on with its day).
326
+ Two items to note:
327
+
328
+ 1. If the `current_version` parameter is `nil`, the Configurator will assume that it the app needs to be updated when `compare_version` is run.
329
+ 2. Note that if the current version is *later* than the last version that required re-configuration, the whole block is skipped over (allowing your app to get on with its day).
325
330
 
326
331
  ## Prefs
327
332
 
@@ -559,7 +564,7 @@ validators:
559
564
  - expand_filepath # Runs File.expand_path on the answer
560
565
  - lowercase # Turns "AnSwEr" into "answer"
561
566
  - prefix: 'test ' # Prepends 'test ' to the answer
562
- - suffix: 'test ' # Appends 'test ' to the answer
567
+ - suffix: 'test ' # Appends 'test ' to the answer
563
568
  - titlecase # Turns "the answer" into "The Answer"
564
569
  - uppercase # Turns "answer" to "ANSWER"
565
570
  ```
@@ -65,7 +65,7 @@ module CLIUtils
65
65
  c_version = Gem::Version.new(@current_version)
66
66
  l_version = Gem::Version.new(@last_version)
67
67
 
68
- if c_version < l_version
68
+ if @current_version.nil? || c_version < l_version
69
69
  yield @current_version, @last_version
70
70
  end
71
71
  end
@@ -1,5 +1,5 @@
1
1
  # Stores constants to use.
2
2
  module CLIUtils
3
3
  # The current version of the gem
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Bach