code-ruby 1.6.10 → 1.6.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdae56ab2a8131adde0250872f81b39da931f4f93a9ccd93ae1b86a3d63aa295
4
- data.tar.gz: f71ce983de47ef6225934531bd84d55ca30bcea0a95f813f3d023fa1839c3482
3
+ metadata.gz: 6a80b276ea3ad2c3a639d7adf3148cf4a4b869c6457340a36efa6a9668a492d6
4
+ data.tar.gz: 23195c8b97452a3cf65a7596f8ee15375634b8c10ed89cc821df884bb2f8eb4f
5
5
  SHA512:
6
- metadata.gz: fcddbc545c4f6e72d88c2df056765cf4d6eed5e2facc1433314a75d94fc70779cb01fa741305364a96b822f99e020f9d58988b667e5532788f755db60e8cdda3
7
- data.tar.gz: dcf9f22574c9a95b43ae5fb16158f8f31be8c0c99eb737b8bd6ca079f07044495cee9b9f6bbce3621c5286ec00caa3c35faa63e7e568529e96b30931e6777bf7
6
+ metadata.gz: ea6b229dad0cdadf095bc8e1bde1f6c8e186e675943a8202aef1f2fc51dc35ee1cbe16a6c08d93f7f21fe98b4d321e4d5d5733821d72727eed446394541ebb37
7
+ data.tar.gz: ef8bb15a9ecb542e1300a5db2aef35788ff2e7975700748dede4190713f3851f921bb3844f09edd243b59394d0e705e70a55f43ee6befbc837dac9b358a84693
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (1.6.10)
4
+ code-ruby (1.6.12)
5
5
  activesupport
6
6
  base64
7
7
  bigdecimal
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.10
1
+ 1.6.12
@@ -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
- [raw, self.class] <=> [code_other.raw, code_other.class]
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
- [raw, self.class] == [code_other.raw, code_other.class]
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
- [raw, self.class].eql?([code_other.raw, code_other.class])
181
+ raw.eql?(code_other.raw)
179
182
  end
180
183
 
181
184
  def code_and(other)
@@ -205,7 +208,7 @@ class Code
205
208
  def code_greater(other)
206
209
  code_other = other.to_code
207
210
 
208
- Object::Boolean.new((self <=> code_other) > 0)
211
+ Object::Boolean.new((self <=> code_other).positive?)
209
212
  end
210
213
 
211
214
  def code_greater_or_equal(other)
@@ -217,7 +220,7 @@ class Code
217
220
  def code_less(other)
218
221
  code_other = other.to_code
219
222
 
220
- Object::Boolean.new((self <=> code_other) < 0)
223
+ Object::Boolean.new((self <=> code_other).negative?)
221
224
  end
222
225
 
223
226
  def code_less_or_equal(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
@@ -955,11 +955,10 @@ class Code
955
955
  List.new(
956
956
  raw.sort_by.with_index do |code_element, index|
957
957
  if code_argument.is_a?(Function)
958
- code_argument
959
- .call(
960
- arguments: List.new([code_element, Integer.new(index), self]),
961
- **globals
962
- )
958
+ code_argument.call(
959
+ arguments: List.new([code_element, Integer.new(index), self]),
960
+ **globals
961
+ )
963
962
  else
964
963
  code_element
965
964
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.10
4
+ version: 1.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié