origin 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/lib/origin/extensions/hash.rb +16 -0
- data/lib/origin/extensions/object.rb +20 -0
- data/lib/origin/mergeable.rb +1 -0
- data/lib/origin/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -135,6 +135,22 @@ module Origin
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|
138
|
+
# Get the object as expanded.
|
139
|
+
#
|
140
|
+
# @example Get the object expanded.
|
141
|
+
# obj.__expand_complex__
|
142
|
+
#
|
143
|
+
# @return [ Hash ] The expanded hash.
|
144
|
+
#
|
145
|
+
# @since 1.0.5
|
146
|
+
def __expand_complex__
|
147
|
+
replacement = {}
|
148
|
+
each_pair do |key, value|
|
149
|
+
replacement.merge!(key.specify(value))
|
150
|
+
end
|
151
|
+
replacement
|
152
|
+
end
|
153
|
+
|
138
154
|
# Update all the values in the hash with the provided block.
|
139
155
|
#
|
140
156
|
# @example Update the values in place.
|
@@ -126,6 +126,26 @@ module Origin
|
|
126
126
|
[ self ]
|
127
127
|
end
|
128
128
|
|
129
|
+
# Get the object as expanded.
|
130
|
+
#
|
131
|
+
# @example Get the object expanded.
|
132
|
+
# obj.__expand_complex__
|
133
|
+
#
|
134
|
+
# @return [ Object ] self.
|
135
|
+
#
|
136
|
+
# @since 1.0.5
|
137
|
+
def __expand_complex__
|
138
|
+
self
|
139
|
+
end
|
140
|
+
|
141
|
+
# Is the object a regex.
|
142
|
+
#
|
143
|
+
# @example Is the object a regex?
|
144
|
+
# obj.regexp?
|
145
|
+
#
|
146
|
+
# @return [ false ] Always false.
|
147
|
+
#
|
148
|
+
# @since 1.0.4
|
129
149
|
def regexp?
|
130
150
|
false
|
131
151
|
end
|
data/lib/origin/mergeable.rb
CHANGED
@@ -196,6 +196,7 @@ module Origin
|
|
196
196
|
# @since 1.0.0
|
197
197
|
def prepare(field, operator, value)
|
198
198
|
return value if operator =~ /exists|type|size/
|
199
|
+
value = value.__expand_complex__
|
199
200
|
serializer = serializers[field]
|
200
201
|
serializer ? serializer.evolve(value) : value
|
201
202
|
end
|
data/lib/origin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: origin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash:
|
148
|
+
hash: 2569120382874520482
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|