fixturize 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fixturize.rb +12 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b35e34022bad9e7c2219f5d246b213dcfbbecb
|
4
|
+
data.tar.gz: 61577b83f233220ddf5987784199d71b430bd240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbfaf5ea7e20fed5b139ca0b4bfcabe10c5da384368806bec7b481799bb1d09d0a44de94358f637f39252953d5baf1078e53c7d564a469179e802677be93b04
|
7
|
+
data.tar.gz: 35047bc2a104ceba398ec73c5294588e6f71b18f9bb6fbbe67c06f680fe31e8d22e632f42994898ac1bfd30a7d11aac8a88c1b82c9aa8ab495bf2c73f64cea8f
|
data/lib/fixturize.rb
CHANGED
@@ -82,7 +82,10 @@ class Fixturize
|
|
82
82
|
def index!
|
83
83
|
return unless enabled?
|
84
84
|
|
85
|
-
collection.ensure_index({
|
85
|
+
collection.ensure_index({
|
86
|
+
:name => Mongo::ASCENDING,
|
87
|
+
:type => Mongo::ASCENDING,
|
88
|
+
})
|
86
89
|
end
|
87
90
|
|
88
91
|
def fixture_name(name = nil, &block)
|
@@ -115,11 +118,13 @@ class Fixturize
|
|
115
118
|
name = fixture_name(name, &block)
|
116
119
|
self.current_instrumentation = name
|
117
120
|
|
118
|
-
|
119
|
-
find({ :name => name
|
120
|
-
sort({ :
|
121
|
+
all_instrumentations = collection.
|
122
|
+
find({ :name => name }).
|
123
|
+
sort({ :'$natural' => Mongo::ASCENDING }).
|
121
124
|
to_a
|
122
125
|
|
126
|
+
db_instrumentations = all_instrumentations.select { |i| i['type'] == INSTRUMENT_DATABASE }
|
127
|
+
|
123
128
|
if db_instrumentations.any?
|
124
129
|
uninstall!
|
125
130
|
|
@@ -127,10 +132,7 @@ class Fixturize
|
|
127
132
|
load_data_from(instrumentation)
|
128
133
|
end
|
129
134
|
|
130
|
-
ivar_instrumentations =
|
131
|
-
find({ :name => name, :type => INSTRUMENT_IVARS }).
|
132
|
-
sort({ :timestamp => Mongo::ASCENDING }).
|
133
|
-
to_a
|
135
|
+
ivar_instrumentations = all_instrumentations.select { |i| i['type'] == INSTRUMENT_IVARS }
|
134
136
|
|
135
137
|
if ivar_instrumentations.any?
|
136
138
|
ivar_instrumentations.each do |instrumentation|
|
@@ -149,7 +151,7 @@ class Fixturize
|
|
149
151
|
:collection_name => collection_name.to_s,
|
150
152
|
:method_name => method_name.to_s,
|
151
153
|
:args => BSON::Binary.new(Marshal.dump(args)),
|
152
|
-
:timestamp => Time.now.to_f
|
154
|
+
:timestamp => Time.now.to_f, # unused, just for reference
|
153
155
|
# :json_args => args.to_json,
|
154
156
|
})
|
155
157
|
end
|
@@ -168,7 +170,7 @@ class Fixturize
|
|
168
170
|
:ivar => ivar,
|
169
171
|
:model => obj.class.to_s,
|
170
172
|
:id => obj.id,
|
171
|
-
:timestamp => Time.now.to_f
|
173
|
+
:timestamp => Time.now.to_f, # unused, just for reference
|
172
174
|
})
|
173
175
|
end
|
174
176
|
end
|
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.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Taylor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: method_source
|