initial-test-data 0.6.1 → 0.6.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: 05d95588e443768898d5547187d606fd796cf7f4
4
- data.tar.gz: 6ca2346cdac11e3068d815e479a740edc72cbbce
3
+ metadata.gz: b4fb14f578c4e2c01b28a54d6072b677e1819b87
4
+ data.tar.gz: bf1a184245e624bc74ae7c7f9c567c6d575c999d
5
5
  SHA512:
6
- metadata.gz: e7d871df257a88d2aadea4eafe2323572cf660ba6c716a0b4b16f606dd647182a0f36ca225e46c7cce46c570e1a209406355380c8d8646573a096a7b64c60404
7
- data.tar.gz: 94c78e1f4e73147a0858c3729461e3edadd503b61a3caf5bbb5cead92c1f7e720559998dc0666c76d761135f7cd4518b2192c37106d00c6762c3b5aca94b776a
6
+ metadata.gz: 232b6b0d93893945b85cca9a6e4f741ffeb52bdd24847222276d6cbeef1eb285b033c052a77c391c7d7e50f364787b8f956a6c76419db812cd45ae2c9fae6c6b
7
+ data.tar.gz: 2fbca9f2f3086fdeba96484cafe49e7996096f71a768a8fb36aa65a396d24f3c73f7b2861e58a2b8e56e3b77f366213aea8062f8639294e822ef8781eb3c8e7b
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG - initial-test-data
2
2
 
3
+ ## 0.6.3 (February 28, 2016)
4
+
5
+ * Bug fix: Load record ids when `REINIT` is set 0.
6
+
7
+ ## 0.6.2 (February 28, 2016) yanked
8
+
9
+ * Determine by `REINIT` environment variable if reinitialization is required.
10
+
3
11
  ## 0.6.1 (February 28, 2016)
4
12
 
5
13
  * Users should require factory_girl patch explicitly.
data/README.md CHANGED
@@ -197,6 +197,20 @@ named `initial_data_record_ids.yml` in the `tmp` directory
197
197
  to track the primary key values of registered records.
198
198
  Please do not remove or tamper it.
199
199
 
200
+ ### Environment variable `REINIT`
201
+
202
+ If you want to enforce the initialization process, add `REINIT=1` before the command:
203
+
204
+ ```text
205
+ REINIT=1 bin/rake test
206
+ ```
207
+
208
+ When you want to skip it, place `REINIT=0` before the command:
209
+
210
+ ```text
211
+ REINIT=0 bin/rake test
212
+ ```
213
+
200
214
  Example
201
215
  -------
202
216
 
@@ -20,7 +20,8 @@ module InitialTestData
20
20
 
21
21
  needs_reinitialization = true
22
22
  record_ids_path = Rails.root.join('tmp', 'initial_data_record_ids.yml')
23
- if File.exists?(record_ids_path) && md5_digest == md5_digest_cache
23
+ if File.exists?(record_ids_path) &&
24
+ (ENV['REINIT'] == '0' || md5_digest == md5_digest_cache)
24
25
  begin
25
26
  RECORD_IDS.merge! YAML.load_file(record_ids_path)
26
27
  needs_reinitialization = false
@@ -28,7 +29,7 @@ module InitialTestData
28
29
  end
29
30
  end
30
31
 
31
- if needs_reinitialization
32
+ if ENV['REINIT'] == '1' || (needs_reinitialization && ENV['REINIT'] != '0')
32
33
  SequenceEnumerator.reset
33
34
  RECORD_IDS.clear
34
35
  initialize_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: initial-test-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsutomu KURODA