code-ruby 1.6.9 → 1.6.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 +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/code/concerns/shared.rb +6 -3
- data/lib/code/object/dictionary.rb +9 -0
- data/lib/code/object/range.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0867ea95cf4d089deb39820f05c1547d4c0d6e9464fcd13327021092fd0c61c0'
|
4
|
+
data.tar.gz: 510513c7b820cfcb51809678b92d67d8c5371e56d1c4d0ce5b8e0bb7e3db2291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ab87db7351c2e826e44d5966dd108f86617b49ae44cf6dfd3f62bd4d17134485a8281149af5facd670e97ebd7e669f39e5b95e173f5bc539ad9e4b7880e927a
|
7
|
+
data.tar.gz: 053dd30a22b5ff9b1043a5f2ac126f10fb04ebaea425a2cd110ea302f956173eaa94e2c4538fd8bff8eb3672043b10a5b9cde74c54a73052ed9c40eda33c46c3
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.11
|
data/lib/code/concerns/shared.rb
CHANGED
@@ -162,20 +162,23 @@ class Code
|
|
162
162
|
|
163
163
|
def <=>(other)
|
164
164
|
code_other = other.to_code
|
165
|
+
return -1 if self.class != code_other.class
|
165
166
|
|
166
|
-
|
167
|
+
raw <=> code_other.raw
|
167
168
|
end
|
168
169
|
|
169
170
|
def ==(other)
|
170
171
|
code_other = other.to_code
|
172
|
+
return false if self.class != code_other.class
|
171
173
|
|
172
|
-
|
174
|
+
raw == code_other.raw
|
173
175
|
end
|
174
176
|
|
175
177
|
def eql?(other)
|
176
178
|
code_other = other.to_code
|
179
|
+
return false if self.class != code_other.class
|
177
180
|
|
178
|
-
|
181
|
+
raw.eql?(code_other.raw)
|
179
182
|
end
|
180
183
|
|
181
184
|
def code_and(other)
|
@@ -1018,6 +1018,15 @@ class Code
|
|
1018
1018
|
raw.dup.to_h { |key, value| [key, value].map(&:code_deep_duplicate) }
|
1019
1019
|
)
|
1020
1020
|
end
|
1021
|
+
|
1022
|
+
def <=>(other)
|
1023
|
+
code_other = other.to_code
|
1024
|
+
return -1 if self.class != code_other.class
|
1025
|
+
return 0 if raw == code_other.raw
|
1026
|
+
return -1 if raw < code_other.raw
|
1027
|
+
return 1 if raw > code_other.raw
|
1028
|
+
-1
|
1029
|
+
end
|
1021
1030
|
end
|
1022
1031
|
end
|
1023
1032
|
end
|
data/lib/code/object/range.rb
CHANGED
@@ -173,12 +173,12 @@ class Code
|
|
173
173
|
code_element = code_element.code_plus(code_argument)
|
174
174
|
|
175
175
|
if exclude_end?
|
176
|
-
while code_element.
|
176
|
+
while code_element.code_less(code_right).truthy?
|
177
177
|
code_list.code_append(code_element)
|
178
178
|
code_element = code_element.code_plus(code_argument)
|
179
179
|
end
|
180
180
|
else
|
181
|
-
while code_element.
|
181
|
+
while code_element.code_less_or_equal(code_right).truthy?
|
182
182
|
code_list.code_append(code_element)
|
183
183
|
code_element = code_element.code_plus(code_argument)
|
184
184
|
end
|