sixarm_ruby_ramp 2.1.0 → 2.1.3
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.
- data.tar.gz.sig +1 -1
- data/CHANGELOG.txt +2 -0
- data/LICENSE.txt +18 -5
- data/README.rdoc +3 -47
- data/VERSION +1 -1
- data/lib/sixarm_ruby_ramp/array.rb +8 -48
- metadata +42 -29
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
P�cS�zF�*�C;���?J?�M~�^�&7o1����si$��#pB��Cz=9Bݖ'FDϰ�?c�?V|���m���7*�V��(v���^i�N<�%#��U���mR��;ڰ
|
data/CHANGELOG.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
2.1.3 Remove dependency on sixarm_ruby_array_slice
|
2
|
+
2.1.2 Refactor Array#slices and #divvy to sixarm_ruby_array_slice gem with better method names.
|
1
3
|
2.1.0 Spring cleaning for Ruby 1.9.3 with better README, new CHANGELOG, less YAML, etc.
|
2
4
|
2.0.9 Remove Hash#to_yaml_sort and replace its functionality with Hash#sort_by_keys
|
3
5
|
2.0.8 Add Numeric#percent
|
data/LICENSE.txt
CHANGED
@@ -1,12 +1,25 @@
|
|
1
1
|
LICENSE
|
2
2
|
|
3
|
-
You may choose any of these licenses:
|
3
|
+
You may choose any of these open source licenses:
|
4
4
|
|
5
|
+
- Apache License
|
6
|
+
- BSD License
|
5
7
|
- CreativeCommons License, Non-commercial Share Alike
|
6
|
-
-
|
8
|
+
- GNU General Public License Version 2 (GPL 2)
|
9
|
+
- GNU Lesser General Public License (LGPL)
|
7
10
|
- MIT License
|
11
|
+
- Perl Artistic License
|
8
12
|
- Ruby License
|
9
13
|
|
10
|
-
|
11
|
-
|
12
|
-
|
14
|
+
The software is provided "as is", without warranty of any kind,
|
15
|
+
express or implied, including but not limited to the warranties of
|
16
|
+
merchantability, fitness for a particular purpose and noninfringement.
|
17
|
+
|
18
|
+
In no event shall the authors or copyright holders be liable for any
|
19
|
+
claim, damages or other liability, whether in an action of contract,
|
20
|
+
tort or otherwise, arising from, out of or in connection with the
|
21
|
+
software or the use or other dealings in the software.
|
22
|
+
|
23
|
+
This license is for the included software that is created by SixArm;
|
24
|
+
some of the included software may have its own licenses, copyrights,
|
25
|
+
authors, etc. and these do take precedence over the SixArm license.
|
data/README.rdoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= SixArm.com » Ruby » Ramp gem is a toolkit of Ruby base class extensions
|
2
2
|
|
3
3
|
Author:: Joel Parker Henderson, joel@joelparkerhenderson.com
|
4
|
-
Copyright:: Copyright (c) 2006-
|
4
|
+
Copyright:: Copyright (c) 2006-2012 Joel Parker Henderson
|
5
5
|
License:: See LICENSE.txt file
|
6
6
|
|
7
7
|
Ramp is a library of extensions to Ruby base classes, including Array, Date, Enumerable, Hash, Kernel, Numeric, Object, Process, String, Time, and YAML.
|
@@ -17,14 +17,14 @@ Testing:
|
|
17
17
|
* car, cdr: aka first, rest (see shifted)
|
18
18
|
* choice, choices: one or more random elements from an array
|
19
19
|
* cross: return the cross pairings of an array with another array
|
20
|
-
* divvy: divides an array, like a pie, into a specified number of slices
|
20
|
+
* divvy: divides an array, like a pie, into a specified number of slices (deprecated - see method rdoc)
|
21
21
|
* join: same as Array#join with some improvments
|
22
22
|
* onto: return a hash that maps an array's keys on to another array's values
|
23
23
|
* rotate: moves the first element of an array to the end
|
24
24
|
* rest: return the rest of the items of the array (aka cdr, aka shifted)
|
25
25
|
* shifted, shifted!: return an array with the first n items shifted (aka cdr, aka rest)
|
26
26
|
* shuffle, shuffle!: randomly sort an array efficiently; each of these methods are loaded only if needed (Ruby 1.8.7+ already defines shuffle)
|
27
|
-
* slices: divide an array into specified number of equal size sub-arrays (
|
27
|
+
* slices: divide an array into specified number of equal size sub-arrays (deprecated - see method rdoc)
|
28
28
|
* to_csv: join a multidimensional array into a string in CSV (Comma Separated Values), with each subarray becoming one 'line' in the output; typically for viewing in a spreadsheet such as Excel.
|
29
29
|
* to_tdf: join a multidimensional array into a string in TDF (Tab Delimited Format); this is an alias for #to_tsv
|
30
30
|
* to_tsv: join a multidimensional array into a string in TSV (Tab Separated Values), with each subarray becoming one 'line' in the output; typically for viewing in a spreadsheet such as Excel.
|
@@ -194,47 +194,3 @@ Extensions that help debug Ruby programs.
|
|
194
194
|
* (class) load_dir_pairs: specify directory patterns and pass each YAML file in the matching directories to a block to process key/value pairs.
|
195
195
|
|
196
196
|
|
197
|
-
== Changes
|
198
|
-
|
199
|
-
- 1.8.2 Refactored Numeric metric names into their own methods
|
200
|
-
- 1.8.0 100% rcov coverage
|
201
|
-
- 1.7.8 Add rcov testing
|
202
|
-
- 1.7.4 Add Class#publicize_methods, Integer#even?, Integer#odd?
|
203
|
-
- 1.7.3 Refactor Rails classes to their own gem, add README, LICENSE
|
204
|
-
- 1.7.2 Gemcutter update
|
205
|
-
- 1.7.1.8 Add Enumerable#map_with_index
|
206
|
-
- 1.7.1.6 Add ActiveRecord::SaveExtensions#save_false_then_reload!
|
207
|
-
- 1.7.1.3 Add XML#strip_xxx
|
208
|
-
- 1.7.1.2 Update gems: Gemcutter, Ruby 1.9.1, JRuby sqlite3
|
209
|
-
- 1.7.1.0 Add XML attributes methods #
|
210
|
-
- 1.7.0.9 Add Enumerable #hash_by, #index_by
|
211
|
-
- 1.7.0.7 Add Array#to_tsv, String#split_tsv, improve Array#to_csv
|
212
|
-
- 1.7.0.6 Add Array#shuffle, Array#shuffle!
|
213
|
-
- 1.7.0.5 Add Array#shifted, Array#rest, Array#car, Array#cdr
|
214
|
-
- 1.7.0.4 Upgrade IO#readrows and #readrow to use options
|
215
|
-
- 1.7.0.2 Add Array#to_tdf
|
216
|
-
- 1.7.0.1 Remove sqlite3 testing dependency
|
217
|
-
- 1.6.9.6 Add Symbol with comparable and <=>
|
218
|
-
- 1.6.9.5 Add ActiveRecord testing with sqlite3
|
219
|
-
- 1.6.9.4 JRuby install and test successful
|
220
|
-
- 1.6.9.3 Array#join add infix, prefix, suffix
|
221
|
-
- 1.6.9.2 Improve ri docs
|
222
|
-
- 1.6.9.1 Add Array#onto, Enumerable#intersect?
|
223
|
-
- 1.6.9.0 Add IO, File, ActiveRecord#seed
|
224
|
-
- 1.6.8.9 Add Enumerable#to_h, Array#hash, Hash#each_key!, Hash#each_pair, Hash#each_value!
|
225
|
-
- 1.6.8.8 Add Hash#map_pair, Hash#size?, Hash#pivot
|
226
|
-
- 1.6.8.7 Add Math
|
227
|
-
- 1.6.8.6 Add ActiveRecord SchemaStatements
|
228
|
-
- 1.6.8.5 Add Integer#maps, String#ACCENTS
|
229
|
-
- 1.6.8.4 Add XML
|
230
|
-
- 1.6.8.3 Add ActiveRecord
|
231
|
-
- 1.6.8.2 Add String#lowcase
|
232
|
-
- 1.6.8 Add map_to_xxx methods
|
233
|
-
- 1.6.7 Add CSV
|
234
|
-
- 1.6.6 Add Array#to_csv, Integer, String#lorem, etc., improve tests
|
235
|
-
- 1.6.4 Bug fixes: String characters and YAML test files
|
236
|
-
- 1.6.2 Improve organizaiton of class files to lib/ramp
|
237
|
-
- 1.6.0 Upgraded to work with Ruby 1.9.1
|
238
|
-
- 1.5.0 Combined all Ruby extension files into one gem
|
239
|
-
- 1.0.0 Original
|
240
|
-
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.3
|
@@ -127,58 +127,18 @@ class Array
|
|
127
127
|
#
|
128
128
|
##############################################################
|
129
129
|
|
130
|
+
# Slice the array by size-- REMOVED.
|
131
|
+
# Change to sixarm_ruby_array_slice gem Array#slice_by_size method.
|
130
132
|
|
131
|
-
|
132
|
-
|
133
|
-
# @return [Array<Array<Object>>] items in groups of _n_ items (aka slices)
|
134
|
-
#
|
135
|
-
# @example
|
136
|
-
# [1,2,3,4,5,6,7,8].slices(2) => [[1,2],[3,4],[5,6],[7,8]]
|
137
|
-
# [1,2,3,4,5,6,7,8].slices(4) => [[1,2,3,4],[5,6,7,8]]
|
138
|
-
#
|
139
|
-
# If the slices don't divide evenly, then the last is smaller.
|
140
|
-
#
|
141
|
-
# @example
|
142
|
-
# [1,2,3,4,5,6,7,8].slices(3) => [[1,2,3],[4,5,6],[7,8]]
|
143
|
-
# [1,2,3,4,5,6,7,8].slices(5) => [[1,2,3,4,5],[6,7,8]]
|
144
|
-
|
145
|
-
def slices(slice_length)
|
146
|
-
(slice_length.is_a? Integer) or (raise ArgumentError, "slice_length must be an integer")
|
147
|
-
(slice_length > 0) or (raise ArgumentError, "slice_length must be > 0")
|
148
|
-
arr=[]
|
149
|
-
index=0
|
150
|
-
while index<length
|
151
|
-
arr.push self[index...(index+slice_length)]
|
152
|
-
index+=slice_length
|
153
|
-
end
|
154
|
-
return arr
|
133
|
+
def slices
|
134
|
+
raise "Change to sixarm_ruby_array_slice gem Array#slice_by_size method."
|
155
135
|
end
|
156
136
|
|
137
|
+
# Divvy the array-- REMOVED.
|
138
|
+
# Change to sixarm_ruby_array_slice gem Array#slice_by_share method.
|
157
139
|
|
158
|
-
|
159
|
-
|
160
|
-
# @return [Array<Array<Object>>] items grouped into _n_ slices
|
161
|
-
#
|
162
|
-
# If the array divides evenly, then each slice has size/n items.
|
163
|
-
#
|
164
|
-
# Otherwise, divvy makes a best attempt by rounding up to give
|
165
|
-
# earlier slices one more item, which makes the last slice smaller:
|
166
|
-
#
|
167
|
-
# @example
|
168
|
-
# [1,2,3,4,5].divvy(2) => [[1,2,3],[4,5]]
|
169
|
-
# [1,2,3,4,5,6,7].divvy(3) => [[1,2,3],[4,5,6],[7]]
|
170
|
-
#
|
171
|
-
# If the array size so small compared to _n_ that there is
|
172
|
-
# no mathematical way to _n_ slices, then divvy will return
|
173
|
-
# as many slices as it can.
|
174
|
-
#
|
175
|
-
# @example
|
176
|
-
# [1,2,3,4,5,6].divvy(4) => [[1,2],[3,4],[5,6]]
|
177
|
-
|
178
|
-
def divvy(number_of_slices)
|
179
|
-
(number_of_slices.is_a? Integer) or (raise ArgumentError, "number_of_slices must be an integer")
|
180
|
-
(number_of_slices > 0) or (raise ArgumentError, "number_of_slices must be > 0")
|
181
|
-
return slices((length.to_f/number_of_slices.to_f).ceil)
|
140
|
+
def divvy
|
141
|
+
raise "Change to sixarm_ruby_array_slice gem Array#slice_by_share method."
|
182
142
|
end
|
183
143
|
|
184
144
|
|
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: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,33 +9,46 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
|
-
- !
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
12
|
+
- ! '-----BEGIN CERTIFICATE-----
|
13
|
+
|
14
|
+
MIIDBDCCAm2gAwIBAgIJAKPwEETU5bHoMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
|
15
|
+
|
16
|
+
BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
|
17
|
+
|
18
|
+
c2NvMQ8wDQYDVQQKEwZTaXhBcm0xEzARBgNVBAMTCnNpeGFybS5jb20wHhcNMTAx
|
19
|
+
|
20
|
+
MjEzMjMyNzEzWhcNMTMwOTA4MjMyNzEzWjBgMQswCQYDVQQGEwJVUzETMBEGA1UE
|
21
|
+
|
22
|
+
CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEPMA0GA1UEChMG
|
23
|
+
|
24
|
+
U2l4QXJtMRMwEQYDVQQDEwpzaXhhcm0uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GN
|
25
|
+
|
26
|
+
ADCBiQKBgQC94mD9JDwBsunsOI0VR3CXXbOWg9cWaWciwFyJNFiM7A9I8KPLfXUw
|
27
|
+
|
28
|
+
QC4czUe5ZuG4WHvinrWhkrCK+1dWBqoEClxdF/FoKO5a+tonGCjjmfy81JmFjjyx
|
29
|
+
|
30
|
+
eTsjsHyvw+Qik9kpf9aj6+pnkNrVswgNHVea2o9yabbEiS6VSeJWoQIDAQABo4HF
|
31
|
+
|
32
|
+
MIHCMB0GA1UdDgQWBBQzPJtqmSgc53eDN7aSzDQwr9TALDCBkgYDVR0jBIGKMIGH
|
33
|
+
|
34
|
+
gBQzPJtqmSgc53eDN7aSzDQwr9TALKFkpGIwYDELMAkGA1UEBhMCVVMxEzARBgNV
|
35
|
+
|
36
|
+
BAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xDzANBgNVBAoT
|
37
|
+
|
38
|
+
BlNpeEFybTETMBEGA1UEAxMKc2l4YXJtLmNvbYIJAKPwEETU5bHoMAwGA1UdEwQF
|
39
|
+
|
40
|
+
MAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAooEexP/oPam1TP71SyuhxMb+uTrZbSQe
|
41
|
+
|
42
|
+
jVB+ExRwWadGwaNPUA56d39qwavwP+iu+3JpeonNMVvbWXF5naCX/dNFIeREHzER
|
43
|
+
|
44
|
+
ZDRQYMqru9TEMna6HD9zpcstF7vwThGovlOQ+3Y6plQ4nMzipXcZ9THqs65PIL0q
|
45
|
+
|
46
|
+
eabwpCbAopo=
|
47
|
+
|
48
|
+
-----END CERTIFICATE-----
|
49
|
+
|
50
|
+
'
|
51
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
39
52
|
dependencies: []
|
40
53
|
description:
|
41
54
|
email: sixarm@sixarm.com
|
@@ -98,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
111
|
version: '0'
|
99
112
|
requirements: []
|
100
113
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.8.
|
114
|
+
rubygems_version: 1.8.11
|
102
115
|
signing_key:
|
103
116
|
specification_version: 3
|
104
117
|
summary: SixArm.com » Ruby » Ramp gem provides base extensions to ruby classes and
|
metadata.gz.sig
CHANGED
Binary file
|