sixarm_ruby_ramp 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -2
- data/lib/sixarm_ruby_ramp.rb +0 -1
- data/lib/sixarm_ruby_ramp/enumerable.rb +0 -119
- data/lib/sixarm_ruby_ramp/enumerable/each.rb +2 -2
- data/test/sixarm_ruby_ramp_test/enumerable/each_test.rb +1 -1
- metadata +21 -25
- metadata.gz.sig +0 -0
- data/lib/sixarm_ruby_ramp/symbol.rb +0 -29
- data/test/sixarm_ruby_ramp_test/symbol_test.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8377c28e20dd8a37ea6f3a9e03c58e23663f4dd2a2866f2b2269557afc0b164
|
4
|
+
data.tar.gz: be2b8beafb9a9bc5817a56d09d89eec03cb150705e47bc9ce30236974f545bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd7786198c1c85f6b337bb92b899bc397f81721820fd84bf39cd49058e5ff3f9083094124322de9f00faabcecd37c50ee4b47e991d60b2c96c31287e4058442e
|
7
|
+
data.tar.gz: ed7663c2c576374315ac23eb3222bdbcdf41af5e2e8c38deda07f8e3acc21dacdf3a41e2eb2e1bb422bbabe9d1698aab64ff93c8200c3a00b93c1e02d04c58a2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�Ј�toMq"� n�
|
2
|
+
�܄�Jx�F7*�&�*�]b¢\B�ϗq\�?��s��trh�;���]���R�)������aY9G+�=�K�n�b(VB��w��\�OV���g�5��<F�X�Cӳ�C��!PB�<�rDsy��\��PV4q8(n��V(
|
3
|
+
���~�)�2���<�M�岖�#�I�I
|
data/lib/sixarm_ruby_ramp.rb
CHANGED
@@ -96,58 +96,6 @@ module Enumerable
|
|
96
96
|
map{|item| yield(item)}.to_h
|
97
97
|
end
|
98
98
|
|
99
|
-
########################################################################
|
100
|
-
#
|
101
|
-
# select
|
102
|
-
#
|
103
|
-
########################################################################
|
104
|
-
|
105
|
-
# @example
|
106
|
-
# enum.select_while {|obj| block }
|
107
|
-
# => array
|
108
|
-
#
|
109
|
-
# @return [Array<Object>] the leading elements for which block is not false or nil.
|
110
|
-
#
|
111
|
-
def select_while
|
112
|
-
arr = []
|
113
|
-
each{|item| yield(item) ? (arr << item) : break}
|
114
|
-
return arr
|
115
|
-
end
|
116
|
-
|
117
|
-
# @example
|
118
|
-
# enum.select_until {|obj| block }
|
119
|
-
# => array
|
120
|
-
#
|
121
|
-
# @return [Array<Object>] the leading elements for which block is false or nil.
|
122
|
-
#
|
123
|
-
def select_until
|
124
|
-
arr = []
|
125
|
-
each{|item| yield(item) ? break : (arr << item)}
|
126
|
-
return arr
|
127
|
-
end
|
128
|
-
|
129
|
-
# Calls block with two arguments, the item and its index, for each item in enum.
|
130
|
-
#
|
131
|
-
# @example
|
132
|
-
# enum.select_with_index {|obj,i| block }
|
133
|
-
# => array
|
134
|
-
#
|
135
|
-
# @return [Array<Object> the leading elements for which block is not false or nil.
|
136
|
-
#
|
137
|
-
def select_with_index
|
138
|
-
index = 0
|
139
|
-
arr = []
|
140
|
-
each{|item|
|
141
|
-
if yield(item,index)
|
142
|
-
arr << item
|
143
|
-
index+=1
|
144
|
-
else
|
145
|
-
break
|
146
|
-
end
|
147
|
-
}
|
148
|
-
return arr
|
149
|
-
end
|
150
|
-
|
151
99
|
########################################################################
|
152
100
|
#
|
153
101
|
# bisect
|
@@ -199,73 +147,6 @@ module Enumerable
|
|
199
147
|
end
|
200
148
|
|
201
149
|
########################################################################
|
202
|
-
#
|
203
|
-
# nitems
|
204
|
-
#
|
205
|
-
########################################################################
|
206
|
-
|
207
|
-
# @example
|
208
|
-
# enum.nitems?(n) {| obj | block }
|
209
|
-
# => true iff the block is not false or nil num times
|
210
|
-
#
|
211
|
-
# @return [Boolean] true iff the block is not false or nil num times
|
212
|
-
#
|
213
|
-
def nitems?(n)
|
214
|
-
num = 0
|
215
|
-
each{|item|
|
216
|
-
if yield(item)
|
217
|
-
num+=1
|
218
|
-
if num > n then return false end
|
219
|
-
end
|
220
|
-
}
|
221
|
-
return num==n
|
222
|
-
end
|
223
|
-
|
224
|
-
# @example
|
225
|
-
# enum.nitems_while {| obj | block }
|
226
|
-
# => number of items
|
227
|
-
#
|
228
|
-
# @return [Integer] the number of leading elements for which block is not false or nil.
|
229
|
-
#
|
230
|
-
def nitems_while
|
231
|
-
num = 0
|
232
|
-
each{|item| yield(item) ? (num+=1) : break}
|
233
|
-
return num
|
234
|
-
end
|
235
|
-
|
236
|
-
# @example
|
237
|
-
# enum.nitems_until {| obj | block }
|
238
|
-
# => number of items
|
239
|
-
#
|
240
|
-
# @return [Integer] the number of leading elements for which block is false.
|
241
|
-
#
|
242
|
-
def nitems_until
|
243
|
-
num = 0
|
244
|
-
each{|item|
|
245
|
-
if yield(item)
|
246
|
-
break
|
247
|
-
else
|
248
|
-
num+=1
|
249
|
-
end
|
250
|
-
}
|
251
|
-
return num
|
252
|
-
end
|
253
|
-
|
254
|
-
|
255
|
-
# Calls block with two arguments, the item and its index, for each item in enum.
|
256
|
-
#
|
257
|
-
# @example
|
258
|
-
# enum.nitems_with_index {|obj,i| block }
|
259
|
-
# => number of items
|
260
|
-
#
|
261
|
-
# @return [Integer] the number of leading elements for which block is true.
|
262
|
-
#
|
263
|
-
def nitems_with_index
|
264
|
-
index = 0
|
265
|
-
each{|item| yield(item,index) ? (index+=1) : break}
|
266
|
-
return index
|
267
|
-
end
|
268
|
-
|
269
150
|
|
270
151
|
# Shortcut to Array#join to concatenate the items into a string
|
271
152
|
#
|
@@ -63,9 +63,9 @@ module Enumerable
|
|
63
63
|
elsif filter.respond_to?(:include?)
|
64
64
|
# each_at_strategy_with_count(filter)
|
65
65
|
i = 0
|
66
|
-
|
66
|
+
_size = respond_to?(:size) ? size : nil
|
67
67
|
each{|e|
|
68
|
-
yield(e) if (filter.include?(i) || (
|
68
|
+
yield(e) if (filter.include?(i) || (_size && filter.include(i - _size)))
|
69
69
|
i += 1
|
70
70
|
}
|
71
71
|
else
|
@@ -55,7 +55,7 @@ class EnumerableEachTest < Minitest::Test
|
|
55
55
|
assert_equal(expect, actual)
|
56
56
|
end
|
57
57
|
|
58
|
-
def
|
58
|
+
def test_each_at_with_range_positives_ascending
|
59
59
|
filter = 1..2
|
60
60
|
expect = ["b", "c"]
|
61
61
|
actual = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_ramp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SixArm
|
@@ -39,68 +39,68 @@ cert_chain:
|
|
39
39
|
tzpk/VnZXj7Ek/earx+N/Z+Wtnl2xENm5IF8SFPeI1HFa9NH47pqtxF1YKpNIEVc
|
40
40
|
2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
|
41
41
|
-----END CERTIFICATE-----
|
42
|
-
date:
|
42
|
+
date: 2019-01-28 00:00:00.000000000 Z
|
43
43
|
dependencies:
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: sixarm_ruby_rexml
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- - "~>"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '2.1'
|
51
48
|
- - ">="
|
52
49
|
- !ruby/object:Gem::Version
|
53
50
|
version: 2.1.0
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.1'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '2.1'
|
61
58
|
- - ">="
|
62
59
|
- !ruby/object:Gem::Version
|
63
60
|
version: 2.1.0
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '2.1'
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: sixarm_ruby_xml_load
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - "~>"
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version: '2.1'
|
71
68
|
- - ">="
|
72
69
|
- !ruby/object:Gem::Version
|
73
70
|
version: 2.1.0
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '2.1'
|
74
74
|
type: :runtime
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '2.1'
|
81
78
|
- - ">="
|
82
79
|
- !ruby/object:Gem::Version
|
83
80
|
version: 2.1.0
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '2.1'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: sixarm_ruby_xml_strip
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '2.1'
|
91
88
|
- - ">="
|
92
89
|
- !ruby/object:Gem::Version
|
93
90
|
version: 2.1.0
|
91
|
+
- - "~>"
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '2.1'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
97
97
|
requirements:
|
98
|
-
- - "~>"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '2.1'
|
101
98
|
- - ">="
|
102
99
|
- !ruby/object:Gem::Version
|
103
100
|
version: 2.1.0
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.1'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: minitest
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -315,7 +315,6 @@ files:
|
|
315
315
|
- lib/sixarm_ruby_ramp/pairable.rb
|
316
316
|
- lib/sixarm_ruby_ramp/process.rb
|
317
317
|
- lib/sixarm_ruby_ramp/string.rb
|
318
|
-
- lib/sixarm_ruby_ramp/symbol.rb
|
319
318
|
- lib/sixarm_ruby_ramp/time.rb
|
320
319
|
- lib/sixarm_ruby_ramp/yaml.rb
|
321
320
|
- test/sixarm_ruby_ramp_test.rb
|
@@ -345,7 +344,6 @@ files:
|
|
345
344
|
- test/sixarm_ruby_ramp_test/pairable_test.rb
|
346
345
|
- test/sixarm_ruby_ramp_test/process_test.rb
|
347
346
|
- test/sixarm_ruby_ramp_test/string_test.rb
|
348
|
-
- test/sixarm_ruby_ramp_test/symbol_test.rb
|
349
347
|
- test/sixarm_ruby_ramp_test/time_test.rb
|
350
348
|
- test/sixarm_ruby_ramp_test/yaml_test.rb
|
351
349
|
homepage: http://sixarm.com/
|
@@ -372,8 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
372
370
|
- !ruby/object:Gem::Version
|
373
371
|
version: '0'
|
374
372
|
requirements: []
|
375
|
-
|
376
|
-
rubygems_version: 2.7.7
|
373
|
+
rubygems_version: 3.0.2
|
377
374
|
signing_key:
|
378
375
|
specification_version: 4
|
379
376
|
summary: SixArm.com → Ruby → Ramp provides base extensions to ruby classes.
|
@@ -404,7 +401,6 @@ test_files:
|
|
404
401
|
- test/sixarm_ruby_ramp_test/pairable_test.rb
|
405
402
|
- test/sixarm_ruby_ramp_test/process_test.rb
|
406
403
|
- test/sixarm_ruby_ramp_test/string_test.rb
|
407
|
-
- test/sixarm_ruby_ramp_test/symbol_test.rb
|
408
404
|
- test/sixarm_ruby_ramp_test/time_test.rb
|
409
405
|
- test/sixarm_ruby_ramp_test/yaml_test.rb
|
410
406
|
- test/sixarm_ruby_ramp_test/io_test.txt
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
# Symbol extensions
|
4
|
-
|
5
|
-
class Symbol
|
6
|
-
|
7
|
-
# Compare this symbol to another symbol.
|
8
|
-
#
|
9
|
-
# @example Less than
|
10
|
-
# :foo <=> :goo
|
11
|
-
# => -1
|
12
|
-
#
|
13
|
-
# @example Equal
|
14
|
-
# :foo <=> :foo
|
15
|
-
# => 0
|
16
|
-
#
|
17
|
-
# @example Greater than
|
18
|
-
# :foo <=> :bar
|
19
|
-
# => 1
|
20
|
-
#
|
21
|
-
# @return [-1,0,1] -1 if this is < that, 0
|
22
|
-
|
23
|
-
include Comparable
|
24
|
-
def <=>(that)
|
25
|
-
self.to_s<=>that.to_s
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
|