fixturize 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/fixturize.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmU5ZTBiZGU1OTVhZGUxNjBhZTAxZGNhNGQwNDQxYjg3YWI5YzBlMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OThlNmJhODYzZjJmYjliMGRmOGY0OGIxOGFlYTdiZWE0YzA1NjAxOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzA2ZGZiOTAyZDVkODdmYTg1YzE0NGU2NjMzMGY4NWMxYmYwMWZhNjA3MWIx
|
10
|
+
MTdmNGY4MGE3YzlkYjA2OTJhODk1MjEzZTI3NzRmNTA5MWZlMWU0ZTViMDY1
|
11
|
+
ZDdhZmEwYzJmMzdiMjdiYmRiMDcyMGZhZTM3YjY2OTJlZmYyZjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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?
|