rmtools 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Manifest.txt +1 -0
- data/README.txt +2 -2
- data/Rakefile +2 -2
- data/lib/rmtools.rb +4 -2
- data/lib/rmtools/b.rb +1 -0
- data/lib/rmtools/console.rb +2 -1
- data/lib/rmtools/console/coloring.rb +4 -3
- data/lib/rmtools/console/highlight.rb +2 -1
- data/lib/rmtools/console/printing.rb +1 -0
- data/lib/rmtools/conversions.rb +2 -1
- data/lib/rmtools/conversions/enum.rb +1 -0
- data/lib/rmtools/conversions/int.rb +1 -0
- data/lib/rmtools/conversions/string.rb +1 -0
- data/lib/rmtools/core.rb +2 -1
- data/lib/rmtools/core/aliases.rb +1 -0
- data/lib/rmtools/core/arguments.rb +1 -0
- data/lib/rmtools/core/class.rb +1 -0
- data/lib/rmtools/core/deprecation.rb +1 -0
- data/lib/rmtools/core/js.rb +13 -13
- data/lib/rmtools/core/kernel.rb +1 -0
- data/lib/rmtools/core/module.rb +15 -10
- data/lib/rmtools/core/proc.rb +4 -0
- data/lib/rmtools/core/regexp.rb +1 -0
- data/lib/rmtools/core/string_compliance.rb +36 -8
- data/lib/rmtools/db.rb +2 -1
- data/lib/rmtools/db/active_record.rb +1 -0
- data/lib/rmtools/debug.rb +2 -1
- data/lib/rmtools/debug/binding.rb +7 -6
- data/lib/rmtools/debug/highlight.rb +3 -2
- data/lib/rmtools/debug/logging.rb +3 -3
- data/lib/rmtools/debug/observing.rb +6 -1
- data/lib/rmtools/debug/timer.rb +2 -1
- data/lib/rmtools/debug/traceback.rb +3 -2
- data/lib/rmtools/debug_notrace.rb +2 -1
- data/lib/rmtools/enumerable.rb +2 -1
- data/lib/rmtools/enumerable/array.rb +1 -1
- data/lib/rmtools/enumerable/array_iterators.rb +2 -1
- data/lib/rmtools/enumerable/common.rb +1 -0
- data/lib/rmtools/enumerable/hash.rb +1 -0
- data/lib/rmtools/enumerable/object_space.rb +2 -1
- data/lib/rmtools/experimental.rb +2 -1
- data/lib/rmtools/experimental/blackhole.rb +1 -0
- data/lib/rmtools/experimental/dumps.rb +1 -0
- data/lib/rmtools/experimental/numeric.rb +1 -0
- data/lib/rmtools/experimental/rails_backtrace.rb +1 -0
- data/lib/rmtools/experimental/tree.rb +1 -0
- data/lib/rmtools/fs.rb +2 -1
- data/lib/rmtools/fs/dir.rb +2 -1
- data/lib/rmtools/fs/file.rb +2 -1
- data/lib/rmtools/fs/io.rb +9 -11
- data/lib/rmtools/fs/tools.rb +2 -1
- data/lib/rmtools/functional.rb +2 -1
- data/lib/rmtools/functional/fold.rb +1 -0
- data/lib/rmtools/functional/string_to_proc.rb +1 -0
- data/lib/rmtools/functional/unfold.rb +1 -0
- data/lib/rmtools/install.rb +1 -1
- data/lib/rmtools/ip.rb +2 -1
- data/lib/rmtools/ip/numeric.rb +1 -0
- data/lib/rmtools/ip/string.rb +1 -0
- data/lib/rmtools/lang.rb +2 -1
- data/lib/rmtools/lang/ansi.rb +1 -0
- data/lib/rmtools/lang/cyrillic.rb +2 -1
- data/lib/rmtools/lang/regexp.rb +2 -1
- data/lib/rmtools/lang/shortcuts.rb +2 -1
- data/lib/rmtools/load.rb +3 -2
- data/lib/rmtools/rand.rb +2 -1
- data/lib/rmtools/rand/array.rb +2 -1
- data/lib/rmtools/rand/enum.rb +1 -0
- data/lib/rmtools/rand/range.rb +2 -1
- data/lib/rmtools/rand/string.rb +1 -1
- data/lib/rmtools/require.rb +7 -6
- data/lib/rmtools/text.rb +2 -1
- data/lib/rmtools/text/string_parse.rb +4 -3
- data/lib/rmtools/text/string_simple.rb +1 -0
- data/lib/rmtools/text/string_split.rb +3 -2
- data/lib/rmtools/text/textilize.rb +1 -0
- data/lib/rmtools/time.rb +2 -1
- data/lib/rmtools/time/global.rb +1 -0
- data/lib/rmtools/time/russian.rb +1 -0
- data/lib/rmtools/xml.rb +2 -1
- data/lib/rmtools/xml/document.rb +1 -0
- data/lib/rmtools/xml/finders.rb +2 -1
- data/lib/rmtools/xml/libxml.rb +3 -2
- data/lib/rmtools/xml/node.rb +1 -0
- data/lib/rmtools/xml/string.rb +2 -1
- data/lib/rmtools/xml/xpath.rb +1 -0
- data/lib/rmtools_no_b.rb +2 -0
- data/lib/rmtools_nodebug.rb +3 -1
- data/lib/rmtools_notrace.rb +4 -2
- metadata +6 -5
data/History.txt
CHANGED
@@ -7,3 +7,12 @@
|
|
7
7
|
* Fixed some bugs
|
8
8
|
* Divided by semantics
|
9
9
|
* Compatible with ruby 1.8.7 (2010-08-16 patchlevel 302)
|
10
|
+
|
11
|
+
=== Version 1.1.6
|
12
|
+
|
13
|
+
* Rewrited few functions
|
14
|
+
* Fixed bug with RDoc and RI
|
15
|
+
* Compatible with 1.9
|
16
|
+
* Binding#start_interaction and RMTools::Observer for debugging purposes
|
17
|
+
* To require any file from lib/rmtools now RMTools::require is used
|
18
|
+
* In order to not overload Rails apps initialization tracing is lightened and gem now may be also required as "rmtools_nodebug" and "rmtools_notrace"
|
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -2,11 +2,11 @@ require 'rake'
|
|
2
2
|
require 'lib/rmtools/install'
|
3
3
|
compile_manifest
|
4
4
|
|
5
|
-
RMTOOLS_VERSION = '1.1.
|
5
|
+
RMTOOLS_VERSION = '1.1.6'
|
6
6
|
begin
|
7
7
|
require 'hoe'
|
8
8
|
config = Hoe.spec 'rmtools' do |h|
|
9
|
-
h.developer("Shinku
|
9
|
+
h.developer("Shinku", "tinbka@gmail.com")
|
10
10
|
|
11
11
|
h.summary = 'Yet another Ruby applied framework'
|
12
12
|
h.description = h.paragraphs_of('README.txt', 2..3).join("\n\n")
|
data/lib/rmtools.rb
CHANGED
data/lib/rmtools/b.rb
CHANGED
data/lib/rmtools/console.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'enumerable/hash'
|
2
3
|
|
3
4
|
module RMTools
|
4
5
|
|
@@ -58,12 +59,12 @@ module RMTools
|
|
58
59
|
Painter = Coloring.new
|
59
60
|
['sub', 'gsub', 'sub!', 'gsub!'].each {|m|
|
60
61
|
Coloring.module_eval "
|
61
|
-
def #{m.sub
|
62
|
+
def #{m.sub('sub') {'hl'}} str, pattern, color=:red_bold
|
62
63
|
str.#{m}(pattern) {|word| send color, word}
|
63
64
|
end
|
64
65
|
"
|
65
66
|
module_eval "
|
66
|
-
def #{m.sub
|
67
|
+
def #{m.sub('sub') {'hl'}} str, pattern, color=:red_bold
|
67
68
|
str.#{m}(pattern) {|word| Painter.send color, word}
|
68
69
|
end
|
69
70
|
"
|
data/lib/rmtools/conversions.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/core.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/core/aliases.rb
CHANGED
data/lib/rmtools/core/class.rb
CHANGED
data/lib/rmtools/core/js.rb
CHANGED
@@ -26,20 +26,20 @@ end
|
|
26
26
|
class String
|
27
27
|
if !method_defined? :plus
|
28
28
|
alias :plus :+
|
29
|
-
end
|
30
|
-
|
31
|
-
# immutable:
|
32
|
-
# '123' + 95 # => '12395'
|
33
|
-
# '123'.plus 95 # => raise TypeError
|
34
|
-
# mutable:
|
35
|
-
# '123' << 95 # => '12395'
|
36
|
-
# '123'.concat 95 # => '123_'
|
37
|
-
def +(str)
|
38
|
-
plus str.to_s
|
39
|
-
end
|
40
29
|
|
41
|
-
|
42
|
-
|
30
|
+
# immutable:
|
31
|
+
# '123' + 95 # => '12395'
|
32
|
+
# '123'.plus 95 # => raise TypeError
|
33
|
+
# mutable:
|
34
|
+
# '123' << 95 # => '12395'
|
35
|
+
# '123'.concat 95 # => '123_'
|
36
|
+
def +(str)
|
37
|
+
plus str.to_s
|
38
|
+
end
|
39
|
+
|
40
|
+
def <<(str)
|
41
|
+
concat str.to_s
|
42
|
+
end
|
43
43
|
end
|
44
44
|
|
45
45
|
end
|
data/lib/rmtools/core/kernel.rb
CHANGED
data/lib/rmtools/core/module.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'active_support/core_ext/module/remove_method'
|
2
3
|
|
3
4
|
class Module
|
@@ -47,11 +48,13 @@ private
|
|
47
48
|
# end
|
48
49
|
def decorate f1, f2
|
49
50
|
f1_clone = f1.to_s.dup
|
50
|
-
f1_clone.bump! '_' while
|
51
|
-
class_eval
|
52
|
-
alias
|
53
|
-
|
54
|
-
|
51
|
+
f1_clone.bump! '_' while private_method_defined? f1_clone.to_sym
|
52
|
+
class_eval(<<-EVAL, __FILE__, __LINE__+1
|
53
|
+
alias #{f1_clone} #{f1}
|
54
|
+
private :#{f1_clone}
|
55
|
+
def #{f1}(*args) #{f2}(*args, &method(:#{f1_clone})) end
|
56
|
+
EVAL
|
57
|
+
)
|
55
58
|
end
|
56
59
|
|
57
60
|
# some FP, example:
|
@@ -71,11 +74,13 @@ private
|
|
71
74
|
# end
|
72
75
|
def decorated_fof f1, f2
|
73
76
|
f1_clone = f1.to_s.dup
|
74
|
-
f1_clone.bump! '_' while
|
75
|
-
class_eval
|
76
|
-
alias
|
77
|
-
|
78
|
-
|
77
|
+
f1_clone.bump! '_' while private_method_defined? f1_clone
|
78
|
+
class_eval(<<-EVAL, __FILE__, __LINE__+1
|
79
|
+
alias #{f1_clone} #{f1}
|
80
|
+
private :#{f1_clone}
|
81
|
+
def #{f1}() #{f2}(&method(:#{f1_clone})) end
|
82
|
+
EVAL
|
83
|
+
)
|
79
84
|
end
|
80
85
|
|
81
86
|
end
|
data/lib/rmtools/core/proc.rb
CHANGED
data/lib/rmtools/core/regexp.rb
CHANGED
@@ -1,31 +1,59 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
class String
|
2
3
|
|
3
4
|
if RUBY_VERSION < "1.9"
|
4
5
|
def ord; self[0] end
|
6
|
+
|
7
|
+
# TODO?
|
8
|
+
# [g]sub[!] in ruby 1.8 takes the second arg which can operate \1, \2 etc keys as if it were MatchData parts
|
9
|
+
# Though, in ruby 1.9 it ignores (without exception) the second arg and only pay attention to block. I can emulate ruby 1.8 second-arg-behaviour but
|
10
|
+
# block passed to old method must be of the same context as that method's caller
|
11
|
+
# in order to $~, $1 and such variables to work (and blocks with them are actualy used i.e. in Readline).
|
12
|
+
# So now I'm afraid it useless to redefine these methods for 1.9 but I'll try some to hack it in C-ext
|
13
|
+
=begin
|
5
14
|
else
|
6
|
-
# BUGFIX?
|
7
15
|
alias :sub19 :sub
|
8
16
|
alias :sub19! :sub!
|
9
17
|
alias :gsub19 :gsub
|
10
18
|
alias :gsub19! :gsub!
|
11
19
|
|
20
|
+
def sub a,b=nil,&c
|
21
|
+
if b
|
22
|
+
if b=~/\\\d/
|
23
|
+
b = b.gsub19(/\\\d/) {|m| "\#$#{m[1]}"}
|
24
|
+
sub19(a) {eval "\"#{b}\""}
|
25
|
+
else sub19(a) {b} end
|
26
|
+
else gsub19(a, &c) end
|
27
|
+
end
|
28
|
+
|
12
29
|
def sub! a,b=nil,&c
|
13
30
|
if b
|
14
31
|
if b=~/\\\d/
|
15
|
-
b = b.
|
32
|
+
b = b.gsub19(/\\\d/) {|m| "\#$#{m[1]}"}
|
16
33
|
sub19!(a) {eval "\"#{b}\""}
|
17
34
|
else sub19!(a) {b} end
|
18
|
-
else sub19!
|
35
|
+
else sub19!(a, &c) end
|
19
36
|
end
|
20
37
|
|
21
|
-
def
|
38
|
+
def gsub a,b=nil,&c
|
22
39
|
if b
|
23
40
|
if b=~/\\\d/
|
24
|
-
b = b.
|
25
|
-
|
26
|
-
else
|
27
|
-
else
|
41
|
+
b = b.gsub19(/\\\d/) {|m| "\#$#{m[1]}"}
|
42
|
+
gsub19(a) {eval "\"#{b}\""}
|
43
|
+
else gsub19(a) {b} end
|
44
|
+
else gsub19(a, &c) end
|
45
|
+
end
|
46
|
+
|
47
|
+
def gsub! a,b=nil,&c
|
48
|
+
if b
|
49
|
+
if b=~/\\\d/
|
50
|
+
b = b.gsub19(/\\\d/) {|m| "\#$#{m[1]}"}
|
51
|
+
p a
|
52
|
+
gsub19!(a) {p "\"#{b}\""; p $~; p eval "\"#{b}\""; p eval "\"#{b}\""}
|
53
|
+
else gsub19!(a) {b} end
|
54
|
+
else gsub19!(a, &c) end
|
28
55
|
end
|
56
|
+
=end
|
29
57
|
end
|
30
58
|
|
31
59
|
end
|
data/lib/rmtools/db.rb
CHANGED
data/lib/rmtools/debug.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'debug/logging'
|
3
|
+
RMTools::require 'debug/present'
|
3
4
|
|
4
5
|
class Binding
|
5
6
|
|
@@ -41,16 +42,16 @@ class Binding
|
|
41
42
|
# end
|
42
43
|
def start_interaction(sandbox=true)
|
43
44
|
$__env__ = inspect_env
|
45
|
+
puts "Caller trace:"
|
44
46
|
Kernel.puts RMTools.format_trace(caller(2)).join("\n")
|
47
|
+
puts "Environment:"
|
45
48
|
$__env__.present
|
46
49
|
$__binding__ = self
|
47
|
-
if defined? SCRIPT_LINES__
|
48
|
-
SCRIPT_LINES__[
|
50
|
+
if defined? SCRIPT_LINES__ and (file = caller(0)[0].parse(:caller).file) =~ /^\(irb/
|
51
|
+
SCRIPT_LINES__["(#{file[1..-2].next_version '#'})"] = []
|
49
52
|
end
|
50
53
|
|
51
|
-
$log << "entering irb"
|
52
54
|
$__MAIN__.irb$__binding__
|
53
|
-
$log << "exiting irb"
|
54
55
|
|
55
56
|
if sandbox
|
56
57
|
self.eval($__env__.keys.map {|k, v| "#{k} = $__env__[#{k.inspect}]" if k != 'self'} * '; ')
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'console/coloring'
|
2
3
|
|
3
4
|
module RMTools
|
4
5
|
|
@@ -17,7 +18,7 @@ end
|
|
17
18
|
class Proc
|
18
19
|
|
19
20
|
def inspect
|
20
|
-
"#{str=to_s}: #{@string ? Painter.green(@string) : "\n"+RMTools.highlighted_line(*
|
21
|
+
"#{str=to_s}: #{@string ? Painter.green(@string) : "\n"+RMTools.highlighted_line(*source_location)}"
|
21
22
|
end
|
22
23
|
|
23
24
|
end
|
@@ -1,7 +1,12 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'debug/binding'
|
2
3
|
require 'active_support/core_ext/class'
|
3
4
|
|
4
5
|
module RMTools
|
6
|
+
|
7
|
+
# Makes binding stack as well as caller stack,
|
8
|
+
# which can be used to catch errors and directly operate within context
|
9
|
+
# in which error has been occured.
|
5
10
|
class Observer
|
6
11
|
cattr_reader :ignore_path, :ignore_gems, :ignore_names, :ignore_all_gems
|
7
12
|
cattr_accessor :keep_binding_stack
|
data/lib/rmtools/debug/timer.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'debug', '{binding,logging,present,timer}'
|
data/lib/rmtools/enumerable.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/experimental.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/fs.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/fs/dir.rb
CHANGED
data/lib/rmtools/fs/file.rb
CHANGED
data/lib/rmtools/fs/io.rb
CHANGED
@@ -15,22 +15,20 @@ module RMTools
|
|
15
15
|
|
16
16
|
def rw(df, value=nil)
|
17
17
|
return false if value.nil?
|
18
|
-
df.
|
18
|
+
df = df.tr '\\', '/'
|
19
19
|
path = File.dirname(df)
|
20
20
|
FileUtils.mkpath(path) if !File.directory?(path)
|
21
|
-
|
22
|
-
File.open(df, mode) {|f| f << value}
|
21
|
+
File.open(df, File::CREAT|File::WRONLY|File::TRUNC) {|f| f << value}
|
23
22
|
value.size
|
24
23
|
end
|
25
24
|
|
26
25
|
def write(df, value='', pos=0)
|
27
26
|
return false if value.nil?
|
28
|
-
df.
|
27
|
+
df = df.tr '\\', '/'
|
29
28
|
path = File.dirname(df)
|
30
29
|
FileUtils.mkpath(path) if !File.directory?(path)
|
31
30
|
if pos == 0
|
32
|
-
|
33
|
-
File.open(df, mode) {|f| f << value}
|
31
|
+
File.open(df, File::CREAT|File::WRONLY|File::APPEND) {|f| f << value}
|
34
32
|
else
|
35
33
|
if pos < 0
|
36
34
|
if !File.file?(df)
|
@@ -40,17 +38,17 @@ module RMTools
|
|
40
38
|
end
|
41
39
|
pos = size - pos
|
42
40
|
end
|
43
|
-
File.open(df,
|
41
|
+
File.open(df, File::CREAT|File::WRONLY) {|f| f.pos = pos; f << value}
|
44
42
|
end
|
45
43
|
value.size
|
46
44
|
end
|
47
45
|
|
48
|
-
def read(df
|
49
|
-
df.
|
46
|
+
def read(df)
|
47
|
+
df = df.tr '\\', '/'
|
50
48
|
if File.file?(df)
|
51
|
-
File.open(df,
|
49
|
+
File.open(df, File::RDONLY) {|f| f.read}
|
52
50
|
else
|
53
|
-
STDERR.puts "#{df}
|
51
|
+
STDERR.puts "couldn't read from #{df.inspect}; file missed"
|
54
52
|
end
|
55
53
|
end
|
56
54
|
|
data/lib/rmtools/fs/tools.rb
CHANGED
data/lib/rmtools/functional.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/install.rb
CHANGED
data/lib/rmtools/ip.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/ip/numeric.rb
CHANGED
data/lib/rmtools/ip/string.rb
CHANGED
data/lib/rmtools/lang.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/lang/ansi.rb
CHANGED
data/lib/rmtools/lang/regexp.rb
CHANGED
data/lib/rmtools/load.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'active_support'
|
2
3
|
|
3
4
|
module RMTools
|
@@ -5,11 +6,11 @@ module RMTools
|
|
5
6
|
VERSION = IO.read(File.join dir, '..', '..', 'Rakefile').match(/RMTOOLS_VERSION = '(.+?)'/)[1]
|
6
7
|
|
7
8
|
require File.expand_path('require', dir)
|
8
|
-
[ 'core', 'enumerable', 'text', '
|
9
|
+
[ 'core', 'enumerable', 'text', 'time', 'functional',
|
9
10
|
'conversions', 'ip', 'lang', 'rand',
|
10
11
|
'fs', 'db', 'xml',
|
11
12
|
'../rmtools.so'
|
12
|
-
].each {|file|
|
13
|
+
].each {|file| RMTools::require file}
|
13
14
|
end
|
14
15
|
|
15
16
|
# Comment out in case of any method conflicts
|
data/lib/rmtools/rand.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/rand/array.rb
CHANGED
data/lib/rmtools/rand/enum.rb
CHANGED
data/lib/rmtools/rand/range.rb
CHANGED
data/lib/rmtools/rand/string.rb
CHANGED
data/lib/rmtools/require.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# `
|
4
|
-
# `
|
5
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
module RMTools
|
3
|
+
# ` RMTools::require __FILE__, "*" ' requires all ruby files from dir named as file
|
4
|
+
# ` RMTools::require "folder", "file" ' requires file.rb from dir `folder' in working directory
|
5
|
+
# `RMTools::require "file" ' requires 'file.rb' from working directory
|
6
|
+
def self.require(location, mask=nil)
|
6
7
|
if !mask
|
7
8
|
location, mask = File.dirname(__FILE__), location # /path/to/gems/rmtools
|
8
9
|
end
|
9
10
|
mask += '.rb' unless mask['.']
|
10
11
|
location = File.expand_path(location).chomp('.rb')
|
11
|
-
Dir.glob(File.join location, mask) {|file| require file}
|
12
|
+
Dir.glob(File.join location, mask) {|file| Kernel.require file}
|
12
13
|
end
|
13
14
|
end
|
data/lib/rmtools/text.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require 'conversions/string'
|
2
3
|
|
3
4
|
class String
|
4
5
|
CALLER_RE = %r{^(.*?([^/\\]+?))#{ # ( path ( file ) )
|
@@ -48,12 +49,12 @@ class String
|
|
48
49
|
end
|
49
50
|
|
50
51
|
def parseuri
|
51
|
-
|
52
|
+
deprecate_method "Use String#parse(:uri) instead."
|
52
53
|
parse :uri
|
53
54
|
end
|
54
55
|
|
55
56
|
def parseip(range=nil)
|
56
|
-
|
57
|
+
deprecate_method "Use String#parse(:ip#{'_range' if range}) instead."
|
57
58
|
parse :"ip#{'_range' if range}"
|
58
59
|
end
|
59
60
|
|
data/lib/rmtools/time.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
RMTools::require __FILE__, '*'
|
data/lib/rmtools/time/global.rb
CHANGED
data/lib/rmtools/time/russian.rb
CHANGED
data/lib/rmtools/xml.rb
CHANGED
data/lib/rmtools/xml/document.rb
CHANGED
data/lib/rmtools/xml/finders.rb
CHANGED
data/lib/rmtools/xml/libxml.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'xml'
|
2
|
-
|
3
|
-
|
3
|
+
RMTools::require 'xml/{xpath,finders,node,document,string}'
|
4
|
+
RMTools::require 'enumerable/common'
|
4
5
|
|
5
6
|
module LibXML::XML
|
6
7
|
Error.reset_handler
|
data/lib/rmtools/xml/node.rb
CHANGED
data/lib/rmtools/xml/string.rb
CHANGED
data/lib/rmtools/xml/xpath.rb
CHANGED
data/lib/rmtools_no_b.rb
ADDED
data/lib/rmtools_nodebug.rb
CHANGED
data/lib/rmtools_notrace.rb
CHANGED
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmtools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 6
|
10
|
+
version: 1.1.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
- Shinku
|
13
|
+
- Shinku
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-24 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/rmtools/enumerable.rb
|
178
178
|
- lib/rmtools_notrace.rb
|
179
179
|
- lib/rmtools_nodebug.rb
|
180
|
+
- lib/rmtools_no_b.rb
|
180
181
|
- ./Rakefile
|
181
182
|
- ./Manifest.txt
|
182
183
|
- ./License.txt
|