rmtools 1.3.0 → 1.3.1
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/Manifest.txt +76 -79
- data/README.md +7 -0
- data/Rakefile +1 -1
- data/lib/rmtools/{ip/string.rb → conversions/ip.rb} +36 -0
- data/lib/rmtools/conversions/json.rb +12 -1
- data/lib/rmtools/{ip → conversions}/numeric.rb +0 -0
- data/lib/rmtools/core/class.rb +20 -19
- data/lib/rmtools/enumerable/array.rb +32 -10
- data/lib/rmtools/enumerable/common.rb +4 -0
- data/lib/rmtools/enumerable/range.rb +28 -4
- metadata +81 -86
- data/License.txt +0 -16
- data/README.txt +0 -103
- data/lib/rmtools.so +0 -0
data/Manifest.txt
CHANGED
|
@@ -1,101 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
lib/rmtools.
|
|
5
|
-
lib/rmtools/
|
|
6
|
-
lib/rmtools/
|
|
7
|
-
lib/rmtools/core/string_compliance.rb
|
|
8
|
-
lib/rmtools/core/kernel.rb
|
|
9
|
-
lib/rmtools/core/arguments.rb
|
|
10
|
-
lib/rmtools/core/object.rb
|
|
11
|
-
lib/rmtools/core/deprecation.rb
|
|
12
|
-
lib/rmtools/core/aliases.rb
|
|
13
|
-
lib/rmtools/core/proc.rb
|
|
14
|
-
lib/rmtools/core/class.rb
|
|
15
|
-
lib/rmtools/core/numeric.rb
|
|
16
|
-
lib/rmtools/core/boolean.rb
|
|
17
|
-
lib/rmtools/core/regexp.rb
|
|
18
|
-
lib/rmtools/core/threadify.rb
|
|
19
|
-
lib/rmtools/rand/range.rb
|
|
20
|
-
lib/rmtools/rand/string.rb
|
|
21
|
-
lib/rmtools/rand/array.rb
|
|
22
|
-
lib/rmtools/rand/enum.rb
|
|
23
|
-
lib/rmtools/db.rb
|
|
24
|
-
lib/rmtools/install.rb
|
|
25
|
-
lib/rmtools/conversions.rb
|
|
26
|
-
lib/rmtools/functional.rb
|
|
27
|
-
lib/rmtools/require.rb
|
|
28
|
-
lib/rmtools/lang.rb
|
|
29
|
-
lib/rmtools/time.rb
|
|
30
|
-
lib/rmtools/fs.rb
|
|
31
|
-
lib/rmtools/fs/dir.rb
|
|
1
|
+
ext/extconf.rb
|
|
2
|
+
ext/rmtools.h
|
|
3
|
+
ext/rmtools.cpp
|
|
4
|
+
lib/rmtools.rb
|
|
5
|
+
lib/rmtools/db/active_record.rb
|
|
6
|
+
lib/rmtools/fs/io.rb
|
|
32
7
|
lib/rmtools/fs/file.rb
|
|
8
|
+
lib/rmtools/fs/dir.rb
|
|
33
9
|
lib/rmtools/fs/tools.rb
|
|
34
|
-
lib/rmtools/
|
|
10
|
+
lib/rmtools/dev/present.rb
|
|
11
|
+
lib/rmtools/dev/blackhole.rb
|
|
12
|
+
lib/rmtools/dev/observing.rb
|
|
35
13
|
lib/rmtools/dev/traceback.rb
|
|
36
|
-
lib/rmtools/dev/logging.rb
|
|
37
14
|
lib/rmtools/dev/binding.rb
|
|
38
|
-
lib/rmtools/dev/
|
|
39
|
-
lib/rmtools/dev/blackhole.rb
|
|
40
|
-
lib/rmtools/dev/code_reader.rb
|
|
15
|
+
lib/rmtools/dev/logging.rb
|
|
41
16
|
lib/rmtools/dev/trace_format.rb
|
|
42
17
|
lib/rmtools/dev/highlight.rb
|
|
43
|
-
lib/rmtools/dev/
|
|
44
|
-
lib/rmtools/dev/
|
|
45
|
-
lib/rmtools/
|
|
46
|
-
lib/rmtools/init.rb
|
|
47
|
-
lib/rmtools/text.rb
|
|
18
|
+
lib/rmtools/dev/timer.rb
|
|
19
|
+
lib/rmtools/dev/code_reader.rb
|
|
20
|
+
lib/rmtools/xml/xpath.rb
|
|
48
21
|
lib/rmtools/xml/string.rb
|
|
22
|
+
lib/rmtools/xml/libxml.rb
|
|
23
|
+
lib/rmtools/xml/finders.rb
|
|
49
24
|
lib/rmtools/xml/node.rb
|
|
50
|
-
lib/rmtools/xml/xpath.rb
|
|
51
25
|
lib/rmtools/xml/document.rb
|
|
52
|
-
lib/rmtools/
|
|
53
|
-
lib/rmtools/
|
|
54
|
-
lib/rmtools/
|
|
55
|
-
lib/rmtools/
|
|
56
|
-
lib/rmtools/
|
|
57
|
-
lib/rmtools/
|
|
58
|
-
lib/rmtools/core.rb
|
|
59
|
-
lib/rmtools/
|
|
26
|
+
lib/rmtools/b.rb
|
|
27
|
+
lib/rmtools/core/arguments.rb
|
|
28
|
+
lib/rmtools/core/numeric.rb
|
|
29
|
+
lib/rmtools/core/js.rb
|
|
30
|
+
lib/rmtools/core/string_compliance.rb
|
|
31
|
+
lib/rmtools/core/kernel.rb
|
|
32
|
+
lib/rmtools/core/boolean.rb
|
|
33
|
+
lib/rmtools/core/aliases.rb
|
|
34
|
+
lib/rmtools/core/threadify.rb
|
|
35
|
+
lib/rmtools/core/module.rb
|
|
36
|
+
lib/rmtools/core/object.rb
|
|
37
|
+
lib/rmtools/core/deprecation.rb
|
|
38
|
+
lib/rmtools/core/regexp.rb
|
|
39
|
+
lib/rmtools/core/class.rb
|
|
40
|
+
lib/rmtools/core/proc.rb
|
|
41
|
+
lib/rmtools/lang/ansi.rb
|
|
42
|
+
lib/rmtools/lang/regexp.rb
|
|
43
|
+
lib/rmtools/lang/cyrillic.rb
|
|
44
|
+
lib/rmtools/rand/string.rb
|
|
45
|
+
lib/rmtools/rand/enum.rb
|
|
46
|
+
lib/rmtools/rand/range.rb
|
|
47
|
+
lib/rmtools/rand/array.rb
|
|
60
48
|
lib/rmtools/text/string_simple.rb
|
|
61
|
-
lib/rmtools/text/string_split.rb
|
|
62
49
|
lib/rmtools/text/string_scanner.rb
|
|
63
50
|
lib/rmtools/text/textilize.rb
|
|
64
51
|
lib/rmtools/text/string_rtl.rb
|
|
65
|
-
lib/rmtools/text/
|
|
52
|
+
lib/rmtools/text/string_split.rb
|
|
66
53
|
lib/rmtools/text/string_parse.rb
|
|
67
|
-
lib/rmtools/
|
|
68
|
-
lib/rmtools/lang/ansi.rb
|
|
69
|
-
lib/rmtools/lang/regexp.rb
|
|
70
|
-
lib/rmtools/conversions/string.rb
|
|
71
|
-
lib/rmtools/conversions/json.rb
|
|
72
|
-
lib/rmtools/conversions/enum.rb
|
|
73
|
-
lib/rmtools/conversions/int.rb
|
|
54
|
+
lib/rmtools/text/regexp.rb
|
|
74
55
|
lib/rmtools/time/russian.rb
|
|
75
56
|
lib/rmtools/time/global.rb
|
|
76
|
-
lib/rmtools/
|
|
77
|
-
lib/rmtools/
|
|
78
|
-
lib/rmtools/
|
|
79
|
-
lib/rmtools/
|
|
80
|
-
lib/rmtools/
|
|
81
|
-
lib/rmtools/
|
|
57
|
+
lib/rmtools/rand.rb
|
|
58
|
+
lib/rmtools/console/coloring.rb
|
|
59
|
+
lib/rmtools/console/printing.rb
|
|
60
|
+
lib/rmtools/console/highlight.rb
|
|
61
|
+
lib/rmtools/core.rb
|
|
62
|
+
lib/rmtools/db.rb
|
|
63
|
+
lib/rmtools/fs.rb
|
|
64
|
+
lib/rmtools/ip.rb
|
|
65
|
+
lib/rmtools/lang.rb
|
|
66
|
+
lib/rmtools/functional.rb
|
|
67
|
+
lib/rmtools/install.rb
|
|
82
68
|
lib/rmtools/functional/decorate.rb
|
|
69
|
+
lib/rmtools/functional/fold.rb
|
|
83
70
|
lib/rmtools/functional/unfold.rb
|
|
84
|
-
lib/rmtools/
|
|
85
|
-
lib/rmtools/
|
|
71
|
+
lib/rmtools/text.rb
|
|
72
|
+
lib/rmtools/console.rb
|
|
73
|
+
lib/rmtools/time.rb
|
|
74
|
+
lib/rmtools/dev.rb
|
|
86
75
|
lib/rmtools/enumerable/common.rb
|
|
76
|
+
lib/rmtools/enumerable/range.rb
|
|
77
|
+
lib/rmtools/enumerable/hash.rb
|
|
78
|
+
lib/rmtools/enumerable/array.rb
|
|
87
79
|
lib/rmtools/enumerable/object_space.rb
|
|
80
|
+
lib/rmtools/enumerable/traversal.rb
|
|
88
81
|
lib/rmtools/enumerable/array_iterators.rb
|
|
89
|
-
lib/rmtools/
|
|
90
|
-
lib/rmtools/
|
|
91
|
-
lib/rmtools/
|
|
92
|
-
lib/rmtools/
|
|
93
|
-
lib/rmtools/
|
|
94
|
-
lib/rmtools.rb
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
82
|
+
lib/rmtools/require.rb
|
|
83
|
+
lib/rmtools/xml.rb
|
|
84
|
+
lib/rmtools/conversions.rb
|
|
85
|
+
lib/rmtools/conversions/numeric.rb
|
|
86
|
+
lib/rmtools/conversions/json.rb
|
|
87
|
+
lib/rmtools/conversions/string.rb
|
|
88
|
+
lib/rmtools/conversions/ip.rb
|
|
89
|
+
lib/rmtools/conversions/enum.rb
|
|
90
|
+
lib/rmtools/conversions/int.rb
|
|
91
|
+
lib/rmtools/enumerable.rb
|
|
92
|
+
lib/rmtools/init.rb
|
|
93
|
+
lib/rmtools/dev_min.rb
|
|
94
|
+
lib/rmtools_dev.rb
|
|
100
95
|
LICENSE
|
|
101
|
-
|
|
96
|
+
README.md
|
|
97
|
+
Rakefile
|
|
98
|
+
Manifest.txt
|
data/README.md
CHANGED
|
@@ -23,6 +23,13 @@ It's still randomly documented since it's just my working tool.
|
|
|
23
23
|
|
|
24
24
|
### CHANGES
|
|
25
25
|
|
|
26
|
+
##### Version 1.3.1
|
|
27
|
+
|
|
28
|
+
* Added to Array: #sort_along_by, #indices_map, #each_two
|
|
29
|
+
* Enumerable#map_hash
|
|
30
|
+
* Fixed Range#x? for neighbor digits, aliased as :intersects? and added XRange#intersects?
|
|
31
|
+
* Class#__init__ accepts block, auto__init__ed Thread and Proc
|
|
32
|
+
|
|
26
33
|
##### Version 1.3.0
|
|
27
34
|
|
|
28
35
|
* Added ::ValueTraversal and ::KeyValueTraversal modules for treeish dir/enumerable search
|
data/Rakefile
CHANGED
|
@@ -43,4 +43,40 @@ class String
|
|
|
43
43
|
scan_ip
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class Integer
|
|
49
|
+
|
|
50
|
+
def from_ip
|
|
51
|
+
self
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def to_ip
|
|
55
|
+
"#{(self >> 24) & 0xff}.#{(self >> 16) & 0xff}.#{(self >> 8) & 0xff}.#{self & 0xff}"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def mask_ip(val)
|
|
59
|
+
if val < 0
|
|
60
|
+
maskv = 32+val
|
|
61
|
+
else
|
|
62
|
+
maskv = val
|
|
63
|
+
val = 32 - val
|
|
64
|
+
end
|
|
65
|
+
self - (self & 2**val - 1)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class Range
|
|
71
|
+
|
|
72
|
+
def mask_ip
|
|
73
|
+
i = nil
|
|
74
|
+
31.downto(12) {|i|
|
|
75
|
+
lm = last.mask_ip(i)
|
|
76
|
+
break if first.mask_ip(i) == lm and (last+1).mask_ip(i) != lm
|
|
77
|
+
i = nil
|
|
78
|
+
}
|
|
79
|
+
i || 32
|
|
80
|
+
end
|
|
81
|
+
|
|
46
82
|
end
|
|
@@ -16,7 +16,18 @@ begin
|
|
|
16
16
|
def from_json(options={}) # :symbolize_keys
|
|
17
17
|
Yajl::Parser.parse self, options
|
|
18
18
|
end
|
|
19
|
-
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# it may not be needed at all, though I've seen one gem that trying to use these methods
|
|
22
|
+
module Yajl
|
|
23
|
+
def self.parse(*args)
|
|
24
|
+
Parser.parse(*args)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.encode(*args)
|
|
28
|
+
Encoder.encode(*args)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
20
31
|
|
|
21
32
|
rescue LoadError
|
|
22
33
|
if defined? JSON
|
|
File without changes
|
data/lib/rmtools/core/class.rb
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
class Class
|
|
3
3
|
|
|
4
|
-
# define python-style initializer
|
|
5
|
-
# p = Post()
|
|
6
|
-
# p = Post user_id: 10
|
|
7
|
-
def __init__
|
|
8
|
-
path = name.split('::')
|
|
9
|
-
classname = path[-1]
|
|
10
|
-
mod = '::'.in(name) ? eval(path[0..-2]*'::') : RMTools
|
|
11
|
-
if mod.is Module
|
|
12
|
-
mod.module_eval "def #{classname} *args; #{name}.new *args end
|
|
13
|
-
module_function :#{classname}"
|
|
14
|
-
if mod != RMTools
|
|
15
|
-
mod.each_child {|c| c.class_eval "include #{mod}; extend #{mod}" if !c.in c.children}
|
|
16
|
-
end
|
|
17
|
-
else
|
|
18
|
-
mod.class_eval "def #{classname} *args; #{name}.new *args end"
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
4
|
def method_proxy *vars
|
|
23
5
|
buffered_missing = instance_methods.grep(/method_missing/).sort.last || 'method_missing'
|
|
24
6
|
# next arg overrides previous
|
|
@@ -50,7 +32,26 @@ class Class
|
|
|
50
32
|
superclass ? superclass.unfold(lambda {|c|!c}) {|c| [c.superclass, c]} : []
|
|
51
33
|
end
|
|
52
34
|
|
|
35
|
+
private
|
|
36
|
+
# define python-style initializer
|
|
37
|
+
# p = Post()
|
|
38
|
+
# p = Post user_id: 10
|
|
39
|
+
def __init__
|
|
40
|
+
path = name.split('::')
|
|
41
|
+
classname = path[-1]
|
|
42
|
+
mod = '::'.in(name) ? eval(path[0..-2]*'::') : RMTools
|
|
43
|
+
if mod.is Module
|
|
44
|
+
mod.module_eval "def #{classname} *args, █ #{name}.new *args, &block end
|
|
45
|
+
module_function :#{classname}"
|
|
46
|
+
if mod != RMTools
|
|
47
|
+
mod.each_child {|c| c.class_eval "include #{mod}; extend #{mod}" if !c.in c.children}
|
|
48
|
+
end
|
|
49
|
+
else
|
|
50
|
+
mod.class_eval "def #{classname} *args, █ #{name}.new *args, &block end"
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
require 'set'
|
|
56
|
-
[Hash, Set, Regexp, File, Dir, Range, Class, Module].each {|klass| klass.__init__}
|
|
57
|
+
[Hash, Set, Regexp, File, Dir, Range, Class, Module, Thread, Proc].each {|klass| klass.class_eval {__init__}}
|
|
@@ -135,11 +135,7 @@ class Array
|
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
|
|
138
|
-
# selectors
|
|
139
|
-
def sorted_uniq_by(&block)
|
|
140
|
-
uniq_by(&block).sort_by(&block)
|
|
141
|
-
end
|
|
142
|
-
|
|
138
|
+
# selectors
|
|
143
139
|
def odds
|
|
144
140
|
values_at(*(0...size).odds)
|
|
145
141
|
end
|
|
@@ -173,10 +169,32 @@ class Array
|
|
|
173
169
|
reject {|e| e.__send__(key) == value}
|
|
174
170
|
end
|
|
175
171
|
|
|
172
|
+
# sort / group
|
|
173
|
+
def sorted_uniq_by(&block)
|
|
174
|
+
uniq_by(&block).sort_by(&block)
|
|
175
|
+
end
|
|
176
|
+
|
|
176
177
|
def arrange_by(*args, &block)
|
|
177
178
|
arrange(*args, &block)
|
|
178
179
|
end
|
|
179
180
|
|
|
181
|
+
def indices_map
|
|
182
|
+
addresses = {}
|
|
183
|
+
(size-1).downto(0) {|i| addresses[self[i]] = i}
|
|
184
|
+
addresses
|
|
185
|
+
end
|
|
186
|
+
alias :addresses :indices_map
|
|
187
|
+
|
|
188
|
+
def sort_along_by(ary)
|
|
189
|
+
# Condition is relevant for ruby 1.9, I haven't tested it on 1.8 yet
|
|
190
|
+
if size*ary.size > 400
|
|
191
|
+
addresses = ary.indices_map
|
|
192
|
+
sort_by {|e| addresses[yield(e)]}
|
|
193
|
+
else
|
|
194
|
+
sort_by {|e| ary.index yield e}
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
180
198
|
# concatenation
|
|
181
199
|
# analogue to String#>>
|
|
182
200
|
def >>(ary)
|
|
@@ -203,15 +221,19 @@ class Array
|
|
|
203
221
|
|
|
204
222
|
|
|
205
223
|
|
|
206
|
-
|
|
207
|
-
def map_hash(&b)
|
|
208
|
-
Hash[map(&b)]
|
|
209
|
-
end
|
|
210
|
-
|
|
224
|
+
# enumerating
|
|
211
225
|
def map_with_index(&block)
|
|
212
226
|
each_with_index.map(&block)
|
|
213
227
|
end
|
|
214
228
|
|
|
229
|
+
def each_two
|
|
230
|
+
_end = size-1
|
|
231
|
+
self[0..-2].each_with_index {|u, i|
|
|
232
|
+
(i+1.._end).each {|j|
|
|
233
|
+
yield u, self[j]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
end
|
|
215
237
|
|
|
216
238
|
|
|
217
239
|
|
|
@@ -34,14 +34,24 @@ class Range
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
def x?(range)
|
|
37
|
+
return range.x? self if range.is XRange
|
|
37
38
|
range_end = range.include_end.end
|
|
38
39
|
self_end = self.include_end.end
|
|
39
40
|
if self_end < range_end
|
|
40
|
-
|
|
41
|
+
if self_end.kinda Integer and range.begin.kinda Integer
|
|
42
|
+
self_end >= range.begin
|
|
43
|
+
else
|
|
44
|
+
self_end > range.begin
|
|
45
|
+
end
|
|
41
46
|
else
|
|
42
|
-
|
|
47
|
+
if self.begin.kinda Integer and range_end.kinda Integer
|
|
48
|
+
range_end >= self.begin
|
|
49
|
+
else
|
|
50
|
+
range_end > self.begin
|
|
51
|
+
end
|
|
43
52
|
end
|
|
44
53
|
end
|
|
54
|
+
alias :intersects? :x?
|
|
45
55
|
|
|
46
56
|
def <=>(range)
|
|
47
57
|
(self.begin <=> range.begin).b || self.include_end.end <=> range.include_end.end
|
|
@@ -60,7 +70,12 @@ class Range
|
|
|
60
70
|
end
|
|
61
71
|
|
|
62
72
|
def size
|
|
63
|
-
last - first + (!exclude_end?).to_i
|
|
73
|
+
Math.abs(last - first) + (!exclude_end?).to_i
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Irrespective of include_end to be able to determne ranges created in any way
|
|
77
|
+
def b
|
|
78
|
+
self.begin != self.end && self
|
|
64
79
|
end
|
|
65
80
|
|
|
66
81
|
def div(n)
|
|
@@ -179,6 +194,11 @@ class XRange
|
|
|
179
194
|
self - common | range - common
|
|
180
195
|
end
|
|
181
196
|
|
|
197
|
+
def x?(range)
|
|
198
|
+
@ranges.any? {|r| range.x? r}
|
|
199
|
+
end
|
|
200
|
+
alias :intersects? :x?
|
|
201
|
+
|
|
182
202
|
private
|
|
183
203
|
|
|
184
204
|
def intersect(range)
|
|
@@ -218,7 +238,11 @@ public
|
|
|
218
238
|
end
|
|
219
239
|
|
|
220
240
|
def size
|
|
221
|
-
@ranges.
|
|
241
|
+
@ranges.sum {|r| r.size}
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
def b
|
|
245
|
+
size != 0 && self
|
|
222
246
|
end
|
|
223
247
|
|
|
224
248
|
def div(n)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rmtools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.1
|
|
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: 2013-
|
|
12
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
requirements:
|
|
67
67
|
- - ~>
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '3.
|
|
69
|
+
version: '3.0'
|
|
70
70
|
type: :development
|
|
71
71
|
prerelease: false
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -74,7 +74,7 @@ dependencies:
|
|
|
74
74
|
requirements:
|
|
75
75
|
- - ~>
|
|
76
76
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: '3.
|
|
77
|
+
version: '3.0'
|
|
78
78
|
description: Applied library primarily for debug and text/arrays/files processing
|
|
79
79
|
purposes.
|
|
80
80
|
email:
|
|
@@ -83,117 +83,112 @@ executables: []
|
|
|
83
83
|
extensions:
|
|
84
84
|
- ext/extconf.rb
|
|
85
85
|
extra_rdoc_files:
|
|
86
|
-
- License.txt
|
|
87
|
-
- README.txt
|
|
88
86
|
- Manifest.txt
|
|
89
87
|
files:
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
- lib/rmtools.
|
|
94
|
-
- lib/rmtools/
|
|
95
|
-
- lib/rmtools/
|
|
96
|
-
- lib/rmtools/core/string_compliance.rb
|
|
97
|
-
- lib/rmtools/core/kernel.rb
|
|
98
|
-
- lib/rmtools/core/arguments.rb
|
|
99
|
-
- lib/rmtools/core/object.rb
|
|
100
|
-
- lib/rmtools/core/deprecation.rb
|
|
101
|
-
- lib/rmtools/core/aliases.rb
|
|
102
|
-
- lib/rmtools/core/proc.rb
|
|
103
|
-
- lib/rmtools/core/class.rb
|
|
104
|
-
- lib/rmtools/core/numeric.rb
|
|
105
|
-
- lib/rmtools/core/boolean.rb
|
|
106
|
-
- lib/rmtools/core/regexp.rb
|
|
107
|
-
- lib/rmtools/core/threadify.rb
|
|
108
|
-
- lib/rmtools/rand/range.rb
|
|
109
|
-
- lib/rmtools/rand/string.rb
|
|
110
|
-
- lib/rmtools/rand/array.rb
|
|
111
|
-
- lib/rmtools/rand/enum.rb
|
|
112
|
-
- lib/rmtools/db.rb
|
|
113
|
-
- lib/rmtools/install.rb
|
|
114
|
-
- lib/rmtools/conversions.rb
|
|
115
|
-
- lib/rmtools/functional.rb
|
|
116
|
-
- lib/rmtools/require.rb
|
|
117
|
-
- lib/rmtools/lang.rb
|
|
118
|
-
- lib/rmtools/time.rb
|
|
119
|
-
- lib/rmtools/fs.rb
|
|
120
|
-
- lib/rmtools/fs/dir.rb
|
|
88
|
+
- ext/extconf.rb
|
|
89
|
+
- ext/rmtools.h
|
|
90
|
+
- ext/rmtools.cpp
|
|
91
|
+
- lib/rmtools.rb
|
|
92
|
+
- lib/rmtools/db/active_record.rb
|
|
93
|
+
- lib/rmtools/fs/io.rb
|
|
121
94
|
- lib/rmtools/fs/file.rb
|
|
95
|
+
- lib/rmtools/fs/dir.rb
|
|
122
96
|
- lib/rmtools/fs/tools.rb
|
|
123
|
-
- lib/rmtools/
|
|
97
|
+
- lib/rmtools/dev/present.rb
|
|
98
|
+
- lib/rmtools/dev/blackhole.rb
|
|
99
|
+
- lib/rmtools/dev/observing.rb
|
|
124
100
|
- lib/rmtools/dev/traceback.rb
|
|
125
|
-
- lib/rmtools/dev/logging.rb
|
|
126
101
|
- lib/rmtools/dev/binding.rb
|
|
127
|
-
- lib/rmtools/dev/
|
|
128
|
-
- lib/rmtools/dev/blackhole.rb
|
|
129
|
-
- lib/rmtools/dev/code_reader.rb
|
|
102
|
+
- lib/rmtools/dev/logging.rb
|
|
130
103
|
- lib/rmtools/dev/trace_format.rb
|
|
131
104
|
- lib/rmtools/dev/highlight.rb
|
|
132
|
-
- lib/rmtools/dev/
|
|
133
|
-
- lib/rmtools/dev/
|
|
134
|
-
- lib/rmtools/
|
|
135
|
-
- lib/rmtools/init.rb
|
|
136
|
-
- lib/rmtools/text.rb
|
|
105
|
+
- lib/rmtools/dev/timer.rb
|
|
106
|
+
- lib/rmtools/dev/code_reader.rb
|
|
107
|
+
- lib/rmtools/xml/xpath.rb
|
|
137
108
|
- lib/rmtools/xml/string.rb
|
|
109
|
+
- lib/rmtools/xml/libxml.rb
|
|
110
|
+
- lib/rmtools/xml/finders.rb
|
|
138
111
|
- lib/rmtools/xml/node.rb
|
|
139
|
-
- lib/rmtools/xml/xpath.rb
|
|
140
112
|
- lib/rmtools/xml/document.rb
|
|
141
|
-
- lib/rmtools/
|
|
142
|
-
- lib/rmtools/
|
|
143
|
-
- lib/rmtools/
|
|
144
|
-
- lib/rmtools/
|
|
145
|
-
- lib/rmtools/
|
|
146
|
-
- lib/rmtools/
|
|
147
|
-
- lib/rmtools/core.rb
|
|
148
|
-
- lib/rmtools/
|
|
113
|
+
- lib/rmtools/b.rb
|
|
114
|
+
- lib/rmtools/core/arguments.rb
|
|
115
|
+
- lib/rmtools/core/numeric.rb
|
|
116
|
+
- lib/rmtools/core/js.rb
|
|
117
|
+
- lib/rmtools/core/string_compliance.rb
|
|
118
|
+
- lib/rmtools/core/kernel.rb
|
|
119
|
+
- lib/rmtools/core/boolean.rb
|
|
120
|
+
- lib/rmtools/core/aliases.rb
|
|
121
|
+
- lib/rmtools/core/threadify.rb
|
|
122
|
+
- lib/rmtools/core/module.rb
|
|
123
|
+
- lib/rmtools/core/object.rb
|
|
124
|
+
- lib/rmtools/core/deprecation.rb
|
|
125
|
+
- lib/rmtools/core/regexp.rb
|
|
126
|
+
- lib/rmtools/core/class.rb
|
|
127
|
+
- lib/rmtools/core/proc.rb
|
|
128
|
+
- lib/rmtools/lang/ansi.rb
|
|
129
|
+
- lib/rmtools/lang/regexp.rb
|
|
130
|
+
- lib/rmtools/lang/cyrillic.rb
|
|
131
|
+
- lib/rmtools/rand/string.rb
|
|
132
|
+
- lib/rmtools/rand/enum.rb
|
|
133
|
+
- lib/rmtools/rand/range.rb
|
|
134
|
+
- lib/rmtools/rand/array.rb
|
|
149
135
|
- lib/rmtools/text/string_simple.rb
|
|
150
|
-
- lib/rmtools/text/string_split.rb
|
|
151
136
|
- lib/rmtools/text/string_scanner.rb
|
|
152
137
|
- lib/rmtools/text/textilize.rb
|
|
153
138
|
- lib/rmtools/text/string_rtl.rb
|
|
154
|
-
- lib/rmtools/text/
|
|
139
|
+
- lib/rmtools/text/string_split.rb
|
|
155
140
|
- lib/rmtools/text/string_parse.rb
|
|
156
|
-
- lib/rmtools/
|
|
157
|
-
- lib/rmtools/lang/ansi.rb
|
|
158
|
-
- lib/rmtools/lang/regexp.rb
|
|
159
|
-
- lib/rmtools/conversions/string.rb
|
|
160
|
-
- lib/rmtools/conversions/json.rb
|
|
161
|
-
- lib/rmtools/conversions/enum.rb
|
|
162
|
-
- lib/rmtools/conversions/int.rb
|
|
141
|
+
- lib/rmtools/text/regexp.rb
|
|
163
142
|
- lib/rmtools/time/russian.rb
|
|
164
143
|
- lib/rmtools/time/global.rb
|
|
165
|
-
- lib/rmtools/
|
|
166
|
-
- lib/rmtools/
|
|
167
|
-
- lib/rmtools/
|
|
168
|
-
- lib/rmtools/
|
|
169
|
-
- lib/rmtools/
|
|
170
|
-
- lib/rmtools/
|
|
144
|
+
- lib/rmtools/rand.rb
|
|
145
|
+
- lib/rmtools/console/coloring.rb
|
|
146
|
+
- lib/rmtools/console/printing.rb
|
|
147
|
+
- lib/rmtools/console/highlight.rb
|
|
148
|
+
- lib/rmtools/core.rb
|
|
149
|
+
- lib/rmtools/db.rb
|
|
150
|
+
- lib/rmtools/fs.rb
|
|
151
|
+
- lib/rmtools/ip.rb
|
|
152
|
+
- lib/rmtools/lang.rb
|
|
153
|
+
- lib/rmtools/functional.rb
|
|
154
|
+
- lib/rmtools/install.rb
|
|
171
155
|
- lib/rmtools/functional/decorate.rb
|
|
156
|
+
- lib/rmtools/functional/fold.rb
|
|
172
157
|
- lib/rmtools/functional/unfold.rb
|
|
173
|
-
- lib/rmtools/
|
|
174
|
-
- lib/rmtools/
|
|
158
|
+
- lib/rmtools/text.rb
|
|
159
|
+
- lib/rmtools/console.rb
|
|
160
|
+
- lib/rmtools/time.rb
|
|
161
|
+
- lib/rmtools/dev.rb
|
|
175
162
|
- lib/rmtools/enumerable/common.rb
|
|
163
|
+
- lib/rmtools/enumerable/range.rb
|
|
164
|
+
- lib/rmtools/enumerable/hash.rb
|
|
165
|
+
- lib/rmtools/enumerable/array.rb
|
|
176
166
|
- lib/rmtools/enumerable/object_space.rb
|
|
167
|
+
- lib/rmtools/enumerable/traversal.rb
|
|
177
168
|
- lib/rmtools/enumerable/array_iterators.rb
|
|
178
|
-
- lib/rmtools/
|
|
179
|
-
- lib/rmtools/
|
|
180
|
-
- lib/rmtools/
|
|
181
|
-
- lib/rmtools/
|
|
182
|
-
- lib/rmtools/
|
|
183
|
-
- lib/rmtools.rb
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
169
|
+
- lib/rmtools/require.rb
|
|
170
|
+
- lib/rmtools/xml.rb
|
|
171
|
+
- lib/rmtools/conversions.rb
|
|
172
|
+
- lib/rmtools/conversions/numeric.rb
|
|
173
|
+
- lib/rmtools/conversions/json.rb
|
|
174
|
+
- lib/rmtools/conversions/string.rb
|
|
175
|
+
- lib/rmtools/conversions/ip.rb
|
|
176
|
+
- lib/rmtools/conversions/enum.rb
|
|
177
|
+
- lib/rmtools/conversions/int.rb
|
|
178
|
+
- lib/rmtools/enumerable.rb
|
|
179
|
+
- lib/rmtools/init.rb
|
|
180
|
+
- lib/rmtools/dev_min.rb
|
|
181
|
+
- lib/rmtools_dev.rb
|
|
189
182
|
- LICENSE
|
|
183
|
+
- README.md
|
|
190
184
|
- Rakefile
|
|
185
|
+
- Manifest.txt
|
|
191
186
|
homepage: https://github.com/tinbka/rmtools
|
|
192
187
|
licenses: []
|
|
193
188
|
post_install_message:
|
|
194
189
|
rdoc_options:
|
|
195
190
|
- --main
|
|
196
|
-
- README.
|
|
191
|
+
- README.md
|
|
197
192
|
require_paths:
|
|
198
193
|
- lib
|
|
199
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -210,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
210
205
|
version: '0'
|
|
211
206
|
requirements: []
|
|
212
207
|
rubyforge_project: rmtools
|
|
213
|
-
rubygems_version: 1.8.
|
|
208
|
+
rubygems_version: 1.8.24
|
|
214
209
|
signing_key:
|
|
215
210
|
specification_version: 3
|
|
216
211
|
summary: ''
|
data/License.txt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2010-2013
|
|
2
|
-
Sergey Baev <tinbka@gmail.com>
|
|
3
|
-
|
|
4
|
-
This work is licensed under the same license as Ruby language.
|
|
5
|
-
|
|
6
|
-
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
7
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
8
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
9
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
10
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
11
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
12
|
-
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
13
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
14
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
15
|
-
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
16
|
-
SUCH DAMAGE.
|
data/README.txt
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2010-2013
|
|
2
|
-
Sergey Baev <tinbka@gmail.com>
|
|
3
|
-
|
|
4
|
-
This work is licensed under the same license as Ruby language.
|
|
5
|
-
|
|
6
|
-
== RMTools
|
|
7
|
-
https://github.com/tinbka/rmtools
|
|
8
|
-
Methods for basic classes addon collection.
|
|
9
|
-
|
|
10
|
-
== CHANGES
|
|
11
|
-
|
|
12
|
-
== Version 1.2.14
|
|
13
|
-
|
|
14
|
-
* Smartified Array bicycles: #index_where, #indices_where, #set_where, #set_all_where, #del_where, #del_all_where
|
|
15
|
-
* Added #arrange_by to Array enumerators
|
|
16
|
-
* Updated detecting of xml charset encoding for ruby 1.9
|
|
17
|
-
* Fixed bug with empty trace formatting and Array#get_args with non-equalable argument
|
|
18
|
-
|
|
19
|
-
== Version 1.2.11
|
|
20
|
-
|
|
21
|
-
* Added Array#select_by and #reject_by pattern-iterators
|
|
22
|
-
* Fixed ActiveRecord::Base.select_rand
|
|
23
|
-
* Restricted RMTools.format_trace to use with Rails because of hard slowdown
|
|
24
|
-
* Updated Proc constants for ruby 1.9
|
|
25
|
-
|
|
26
|
-
== Version 1.2.10
|
|
27
|
-
|
|
28
|
-
* Update String#parse:caller to parse ruby 1.9 "block level". Now block level processes in RMLogger and RMTools.format_trace
|
|
29
|
-
* lib/dev/traceback.rb now applies to ruby > 1.9 as well
|
|
30
|
-
* Support of Yajl or (if not installed) JSON for #to_json and #from_json. Overwrites ActiveSupport's ::encode and ::decode since they're so damn slow.
|
|
31
|
-
|
|
32
|
-
== Version 1.2.8
|
|
33
|
-
|
|
34
|
-
* StringScanner#each changed to compare `cbs' keys with @matched by number in ruby 1.8 and by first character in ruby 1.9, since ?x in 1.9 returns string instead of a charcode
|
|
35
|
-
* Updated LibXML::XML::XPath to search elements with multiple classes
|
|
36
|
-
|
|
37
|
-
== Version 1.2.7
|
|
38
|
-
|
|
39
|
-
* String#hl and #ghl: console-highlight pattern in string
|
|
40
|
-
* True#call and False#call in order to pass boolean values as callable argument
|
|
41
|
-
* ActiveRecord::Relation#any? and #empty?, ActiveRecord::Base.insert_unless_exist (using execute) and .select_rand
|
|
42
|
-
* Added couple of handlers into Array#method_missing
|
|
43
|
-
* File.modify now can process files by glob-patterns and correctly use multiple gsub! inside passed block
|
|
44
|
-
* RMTools.read now can read from list of files in order
|
|
45
|
-
* Upped RMTools.timer accuracy
|
|
46
|
-
* Optimized Array#-, #+, #& and #| for when one of arrays is empty; added Array#diff
|
|
47
|
-
* Optimized Object#to_json and String#from_json: use JSON stdlib for ruby 1.9. Object#to_json_safe: timeout'ed conversion
|
|
48
|
-
* String#cut_line and #split_to_lines optimized for use in Ruby 1.9
|
|
49
|
-
* Removed String#bytes because it duplicate ruby 1.9 method
|
|
50
|
-
* static VALUE rb_ary_count_items moved from Array#count to Array#arrange
|
|
51
|
-
* Fixed Module#self_name
|
|
52
|
-
* RMTools::CodeReader is still unstable though
|
|
53
|
-
|
|
54
|
-
== Version 1.2.0
|
|
55
|
-
|
|
56
|
-
* Renamed debug/ to dev/, slightly restructured lib/rmtools/ and require handlers: requrie 'rmtools' for common applications and 'rmtools_dev' for irb and maybe dev environment
|
|
57
|
-
* Slightly extended StringScanner
|
|
58
|
-
* Proof of concept: Regexp reverse (wonder if someone did it earlier in Ruby)
|
|
59
|
-
* Kernel#whose? to find classes and/or modules knowing some method
|
|
60
|
-
* Method code lookup over all loaded libs (it can't handle evals yet), see dev/code_reading.rb
|
|
61
|
-
* Coloring is now made by singleton `Painter' and have option for transparent coloring
|
|
62
|
-
|
|
63
|
-
=== Version 1.1.14
|
|
64
|
-
|
|
65
|
-
* Added caller level option (:caller => <int>) for Logger
|
|
66
|
-
* Fixed trace formatting (for sure for this time)
|
|
67
|
-
* Array iterator #sum_<method> now takes argument for #sum as first argument
|
|
68
|
-
* Completed Binding#inspect_env components
|
|
69
|
-
|
|
70
|
-
=== Version 1.1.11
|
|
71
|
-
|
|
72
|
-
* Fixed Hash#unify_keys for 1.9.2
|
|
73
|
-
* Speeded Array#uniq_by up
|
|
74
|
-
* Added some shortcut methods for ActiveRecord::Base
|
|
75
|
-
|
|
76
|
-
=== Version 1.1.10
|
|
77
|
-
|
|
78
|
-
* Deleted String#to_proc. It's anyway inconsistent and causes bug in ActiveRecord 3.0.5 Base#interpolate_and_sanitize_sql and potentially somewhere else
|
|
79
|
-
* Solved problem with String#sub methods in 1.9: that's associated with String#to_hash in some mystic way. #to_hash is now #to_params
|
|
80
|
-
* Some bugfixes for previous updates
|
|
81
|
-
|
|
82
|
-
=== Version 1.1.7
|
|
83
|
-
|
|
84
|
-
* Cosmetic fixes for txts here
|
|
85
|
-
|
|
86
|
-
=== Version 1.1.6
|
|
87
|
-
|
|
88
|
-
* Rewrited few functions
|
|
89
|
-
* Fixed bug with RDoc and RI
|
|
90
|
-
* Compatible with 1.9
|
|
91
|
-
* Binding#start_interaction and RMTools::Observer for debugging purposes
|
|
92
|
-
* To require any file from lib/rmtools now RMTools::require is used
|
|
93
|
-
* In order to not overload Rails apps initialization tracing is lightened and gem now may be also required as "rmtools_nodebug" and "rmtools_notrace"
|
|
94
|
-
|
|
95
|
-
=== Version 1.1.0
|
|
96
|
-
|
|
97
|
-
* Fixed some bugs
|
|
98
|
-
* Divided by semantics
|
|
99
|
-
* Compatible with ruby 1.8.7 (2010-08-16 patchlevel 302)
|
|
100
|
-
|
|
101
|
-
=== Version 1.0.0
|
|
102
|
-
|
|
103
|
-
* Divided by classes and packed as gem
|
data/lib/rmtools.so
DELETED
|
Binary file
|