fixturize 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/fixturize.rb +10 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjdhY2FmMDZjYTE2MDg0ODE4YjUxMDA2ZWZjZDlkOGYzM2M1MzViZg==
4
+ MmU5ZTBiZGU1OTVhZGUxNjBhZTAxZGNhNGQwNDQxYjg3YWI5YzBlMQ==
5
5
  data.tar.gz: !binary |-
6
- Yjc3ZWQ2YjIzZmRjZjI0MGY4YTgyNjgyMzE1NmYxZTJlMmQyZjY3MQ==
6
+ OThlNmJhODYzZjJmYjliMGRmOGY0OGIxOGFlYTdiZWE0YzA1NjAxOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzdjZmU0MTZjYzgxNmU0MTEyMWM2NzIzNGJiMWYwMDI2MjQ1MzQ1M2ViNzgx
10
- NjllYTNjOGE3ZjE2MmY2OTc2YTVmN2U1YTE5M2ViZjI4YWVhMjQzYWE0OWMw
11
- Y2E1YmZmZGYzMmQ1YjE1MGRiZjA3YmQxMzliNzk2ODhlYzE2NDY=
9
+ NzA2ZGZiOTAyZDVkODdmYTg1YzE0NGU2NjMzMGY4NWMxYmYwMWZhNjA3MWIx
10
+ MTdmNGY4MGE3YzlkYjA2OTJhODk1MjEzZTI3NzRmNTA5MWZlMWU0ZTViMDY1
11
+ ZDdhZmEwYzJmMzdiMjdiYmRiMDcyMGZhZTM3YjY2OTJlZmYyZjk=
12
12
  data.tar.gz: !binary |-
13
- MGM4NTljNTRjODk3ZmFhZTdkOTBlNjExM2NhM2MxZGYzZmE3NmU0NWNhNGI5
14
- OTcyOGZmM2RkZTFjNTM0NTkxY2RlMTFjOGNiYmJlYTA1ODI3MjYxOGZiMmU1
15
- YzE0OTMzMTQ0YmU0ZDk3ZmE5OGEyN2U1ZDBmZGQzMjQwM2Q0MDQ=
13
+ OTNiMTU0NmVkYzA3MGFmODc5ODczZjQ4Yjk2ZDI4YjkwMWQyMjc4Njk0MGI1
14
+ YWVjOTNhYmYxNDMyODgxNzFlZjZlMTE3MTI4YzYzZjZhOWM5ZmZiYWU1MWFi
15
+ ZjZmZWNhYjRjNTRjYzMxNDU2MzI0Y2Q1NzBmNDNiNDQwNDZmNmU=
data/lib/fixturize.rb CHANGED
@@ -57,6 +57,8 @@ class Fixturize
57
57
  end
58
58
 
59
59
  def clear_old_versions!
60
+ return unless enabled?
61
+
60
62
  database.collections.select do |c|
61
63
  c.name =~ /fixturize_/ && c.name != self.collection_name
62
64
  end.each do |c|
@@ -65,6 +67,8 @@ class Fixturize
65
67
  end
66
68
 
67
69
  def refresh!(name = nil)
70
+ return unless enabled?
71
+
68
72
  if name
69
73
  collection.remove({ :name => name.to_s })
70
74
  else
@@ -72,6 +76,12 @@ class Fixturize
72
76
  end
73
77
  end
74
78
 
79
+ def index!
80
+ return unless enabled?
81
+
82
+ collection.ensure_index({ :name => Mongo::ASCENDING, :type => Mongo::ASCENDING })
83
+ end
84
+
75
85
  def fixture_name(name = nil, &block)
76
86
  if !name && block.respond_to?(:source_location)
77
87
  # is this portable?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixturize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Taylor