rmtools 1.3.3 → 2.0.0.rc5

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.
metadata CHANGED
@@ -1,32 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmtools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
5
- prerelease:
4
+ version: 2.0.0.rc5
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sergey Baev
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-02 00:00:00.000000000 Z
12
+ date: 2013-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rake
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.8.7
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 0.8.7
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: activesupport
32
16
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +18,7 @@ dependencies:
34
18
  requirements:
35
19
  - - ! '>='
36
20
  - !ruby/object:Gem::Version
37
- version: 2.3.8
21
+ version: '0'
38
22
  type: :runtime
39
23
  prerelease: false
40
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,15 +26,15 @@ dependencies:
42
26
  requirements:
43
27
  - - ! '>='
44
28
  - !ruby/object:Gem::Version
45
- version: 2.3.8
29
+ version: '0'
46
30
  - !ruby/object:Gem::Dependency
47
- name: rdoc
31
+ name: bundler
48
32
  requirement: !ruby/object:Gem::Requirement
49
33
  none: false
50
34
  requirements:
51
35
  - - ~>
52
36
  - !ruby/object:Gem::Version
53
- version: '3.10'
37
+ version: '1.3'
54
38
  type: :development
55
39
  prerelease: false
56
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,137 +42,135 @@ dependencies:
58
42
  requirements:
59
43
  - - ~>
60
44
  - !ruby/object:Gem::Version
61
- version: '3.10'
45
+ version: '1.3'
62
46
  - !ruby/object:Gem::Dependency
63
- name: hoe
47
+ name: rake
64
48
  requirement: !ruby/object:Gem::Requirement
65
49
  none: false
66
50
  requirements:
67
- - - ~>
51
+ - - ! '>='
68
52
  - !ruby/object:Gem::Version
69
- version: '3.0'
53
+ version: '0'
70
54
  type: :development
71
55
  prerelease: false
72
56
  version_requirements: !ruby/object:Gem::Requirement
73
57
  none: false
74
58
  requirements:
75
- - - ~>
59
+ - - ! '>='
76
60
  - !ruby/object:Gem::Version
77
- version: '3.0'
78
- description: Applied library primarily for debug and text/arrays/files processing
79
- purposes.
61
+ version: '0'
62
+ description: RMTools is a collection of helpers for debug, text/array/file processing
63
+ and simply easing a coding process
80
64
  email:
81
65
  - tinbka@gmail.com
82
66
  executables: []
83
67
  extensions:
84
68
  - ext/extconf.rb
85
- extra_rdoc_files:
86
- - Manifest.txt
69
+ extra_rdoc_files: []
87
70
  files:
71
+ - .gitignore
72
+ - Gemfile
73
+ - LICENSE
74
+ - README.md
75
+ - Rakefile
88
76
  - ext/extconf.rb
89
- - ext/rmtools.h
90
77
  - ext/rmtools.cpp
78
+ - ext/rmtools.h
91
79
  - lib/rmtools.rb
92
- - lib/rmtools/db/active_record.rb
93
- - lib/rmtools/fs/io.rb
94
- - lib/rmtools/fs/file.rb
95
- - lib/rmtools/fs/dir.rb
96
- - lib/rmtools/fs/tools.rb
97
- - lib/rmtools/dev/present.rb
98
- - lib/rmtools/dev/blackhole.rb
99
- - lib/rmtools/dev/observing.rb
100
- - lib/rmtools/dev/traceback.rb
101
- - lib/rmtools/dev/binding.rb
102
- - lib/rmtools/dev/logging.rb
103
- - lib/rmtools/dev/trace_format.rb
104
- - lib/rmtools/dev/highlight.rb
105
- - lib/rmtools/dev/timer.rb
106
- - lib/rmtools/dev/code_reader.rb
107
- - lib/rmtools/xml/xpath.rb
108
- - lib/rmtools/xml/string.rb
109
- - lib/rmtools/xml/libxml.rb
110
- - lib/rmtools/xml/finders.rb
111
- - lib/rmtools/xml/node.rb
112
- - lib/rmtools/xml/document.rb
113
- - lib/rmtools/b.rb
80
+ - lib/rmtools/active_record/base.rb
81
+ - lib/rmtools/active_record/declarative.rb
82
+ - lib/rmtools/console.rb
83
+ - lib/rmtools/console/coloring.rb
84
+ - lib/rmtools/console/highlight.rb
85
+ - lib/rmtools/console/printing.rb
86
+ - lib/rmtools/conversions.rb
87
+ - lib/rmtools/conversions/enum.rb
88
+ - lib/rmtools/conversions/int.rb
89
+ - lib/rmtools/conversions/ip.rb
90
+ - lib/rmtools/conversions/json.rb
91
+ - lib/rmtools/conversions/numeric.rb
92
+ - lib/rmtools/conversions/string.rb
93
+ - lib/rmtools/core.rb
94
+ - lib/rmtools/core/aliases.rb
114
95
  - lib/rmtools/core/arguments.rb
115
- - lib/rmtools/core/numeric.rb
96
+ - lib/rmtools/core/b.rb
97
+ - lib/rmtools/core/boolean.rb
98
+ - lib/rmtools/core/class.rb
99
+ - lib/rmtools/core/deprecation.rb
116
100
  - lib/rmtools/core/js.rb
117
- - lib/rmtools/core/string_compliance.rb
118
101
  - lib/rmtools/core/kernel.rb
119
- - lib/rmtools/core/boolean.rb
120
- - lib/rmtools/core/aliases.rb
121
- - lib/rmtools/core/threadify.rb
122
102
  - lib/rmtools/core/module.rb
103
+ - lib/rmtools/core/numeric.rb
123
104
  - lib/rmtools/core/object.rb
124
- - lib/rmtools/core/deprecation.rb
125
- - lib/rmtools/core/regexp.rb
126
- - lib/rmtools/core/class.rb
127
105
  - 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
135
- - lib/rmtools/text/string_simple.rb
136
- - lib/rmtools/text/string_scanner.rb
137
- - lib/rmtools/text/textilize.rb
138
- - lib/rmtools/text/string_rtl.rb
139
- - lib/rmtools/text/string_split.rb
140
- - lib/rmtools/text/string_parse.rb
141
- - lib/rmtools/text/regexp.rb
142
- - lib/rmtools/time/russian.rb
143
- - lib/rmtools/time/global.rb
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
106
+ - lib/rmtools/core/regexp.rb
107
+ - lib/rmtools/core/string_compliance.rb
108
+ - lib/rmtools/core/symbol.rb
109
+ - lib/rmtools/core/threadify.rb
149
110
  - lib/rmtools/db.rb
111
+ - lib/rmtools/dev.rb
112
+ - lib/rmtools/dev/binding.rb
113
+ - lib/rmtools/dev/code_reader.rb
114
+ - lib/rmtools/dev/highlight.rb
115
+ - lib/rmtools/dev/logging.rb
116
+ - lib/rmtools/dev/present.rb
117
+ - lib/rmtools/dev/timer.rb
118
+ - lib/rmtools/dev/trace_format.rb
119
+ - lib/rmtools/dev/void.rb
120
+ - lib/rmtools/enumerable.rb
121
+ - lib/rmtools/enumerable/array.rb
122
+ - lib/rmtools/enumerable/array_iterators.rb
123
+ - lib/rmtools/enumerable/common.rb
124
+ - lib/rmtools/enumerable/hash.rb
125
+ - lib/rmtools/enumerable/object_space.rb
126
+ - lib/rmtools/enumerable/range.rb
127
+ - lib/rmtools/enumerable/traversal.rb
150
128
  - lib/rmtools/fs.rb
151
- - lib/rmtools/ip.rb
152
- - lib/rmtools/lang.rb
129
+ - lib/rmtools/fs/dir.rb
130
+ - lib/rmtools/fs/file.rb
131
+ - lib/rmtools/fs/io.rb
132
+ - lib/rmtools/fs/tools.rb
153
133
  - lib/rmtools/functional.rb
154
- - lib/rmtools/install.rb
155
134
  - lib/rmtools/functional/decorate.rb
156
135
  - lib/rmtools/functional/fold.rb
157
136
  - lib/rmtools/functional/unfold.rb
137
+ - lib/rmtools/install.rb
138
+ - lib/rmtools/lang.rb
139
+ - lib/rmtools/lang/ansi.rb
140
+ - lib/rmtools/lang/cyrillic.rb
141
+ - lib/rmtools/lang/regexp.rb
142
+ - lib/rmtools/rand.rb
143
+ - lib/rmtools/rand/array.rb
144
+ - lib/rmtools/rand/enum.rb
145
+ - lib/rmtools/rand/range.rb
146
+ - lib/rmtools/rand/string.rb
147
+ - lib/rmtools/require.rb
158
148
  - lib/rmtools/text.rb
159
- - lib/rmtools/console.rb
149
+ - lib/rmtools/text/regexp.rb
150
+ - lib/rmtools/text/string_parse.rb
151
+ - lib/rmtools/text/string_rtl.rb
152
+ - lib/rmtools/text/string_scanner.rb
153
+ - lib/rmtools/text/string_simple.rb
154
+ - lib/rmtools/text/string_split.rb
155
+ - lib/rmtools/text/textilize.rb
160
156
  - lib/rmtools/time.rb
161
- - lib/rmtools/dev.rb
162
- - lib/rmtools/enumerable/common.rb
163
- - lib/rmtools/enumerable/range.rb
164
- - lib/rmtools/enumerable/hash.rb
165
- - lib/rmtools/enumerable/array.rb
166
- - lib/rmtools/enumerable/object_space.rb
167
- - lib/rmtools/enumerable/traversal.rb
168
- - lib/rmtools/enumerable/array_iterators.rb
169
- - lib/rmtools/require.rb
157
+ - lib/rmtools/time/helpers.rb
158
+ - lib/rmtools/time/russian.rb
159
+ - lib/rmtools/version.rb
170
160
  - 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
161
+ - lib/rmtools/xml/document.rb
162
+ - lib/rmtools/xml/finders.rb
163
+ - lib/rmtools/xml/libxml.rb
164
+ - lib/rmtools/xml/node.rb
165
+ - lib/rmtools/xml/string.rb
166
+ - lib/rmtools/xml/xpath.rb
181
167
  - lib/rmtools_dev.rb
182
- - LICENSE
183
- - README.md
184
- - Rakefile
185
- - Manifest.txt
168
+ - rmtools.gemspec
186
169
  homepage: https://github.com/tinbka/rmtools
187
- licenses: []
170
+ licenses:
171
+ - MIT
188
172
  post_install_message:
189
- rdoc_options:
190
- - --main
191
- - README.md
173
+ rdoc_options: []
192
174
  require_paths:
193
175
  - lib
194
176
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -200,13 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
182
  required_rubygems_version: !ruby/object:Gem::Requirement
201
183
  none: false
202
184
  requirements:
203
- - - ! '>='
185
+ - - ! '>'
204
186
  - !ruby/object:Gem::Version
205
- version: '0'
187
+ version: 1.3.1
206
188
  requirements: []
207
- rubyforge_project: rmtools
189
+ rubyforge_project:
208
190
  rubygems_version: 1.8.24
209
191
  signing_key:
210
192
  specification_version: 3
211
- summary: ''
193
+ summary: Collection of helpers for debug, text/array/file processing and simply easing
194
+ a coding process
212
195
  test_files: []
data/Manifest.txt DELETED
@@ -1,98 +0,0 @@
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
7
- lib/rmtools/fs/file.rb
8
- lib/rmtools/fs/dir.rb
9
- lib/rmtools/fs/tools.rb
10
- lib/rmtools/dev/present.rb
11
- lib/rmtools/dev/blackhole.rb
12
- lib/rmtools/dev/observing.rb
13
- lib/rmtools/dev/traceback.rb
14
- lib/rmtools/dev/binding.rb
15
- lib/rmtools/dev/logging.rb
16
- lib/rmtools/dev/trace_format.rb
17
- lib/rmtools/dev/highlight.rb
18
- lib/rmtools/dev/timer.rb
19
- lib/rmtools/dev/code_reader.rb
20
- lib/rmtools/xml/xpath.rb
21
- lib/rmtools/xml/string.rb
22
- lib/rmtools/xml/libxml.rb
23
- lib/rmtools/xml/finders.rb
24
- lib/rmtools/xml/node.rb
25
- lib/rmtools/xml/document.rb
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
48
- lib/rmtools/text/string_simple.rb
49
- lib/rmtools/text/string_scanner.rb
50
- lib/rmtools/text/textilize.rb
51
- lib/rmtools/text/string_rtl.rb
52
- lib/rmtools/text/string_split.rb
53
- lib/rmtools/text/string_parse.rb
54
- lib/rmtools/text/regexp.rb
55
- lib/rmtools/time/russian.rb
56
- lib/rmtools/time/global.rb
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
68
- lib/rmtools/functional/decorate.rb
69
- lib/rmtools/functional/fold.rb
70
- lib/rmtools/functional/unfold.rb
71
- lib/rmtools/text.rb
72
- lib/rmtools/console.rb
73
- lib/rmtools/time.rb
74
- lib/rmtools/dev.rb
75
- lib/rmtools/enumerable/common.rb
76
- lib/rmtools/enumerable/range.rb
77
- lib/rmtools/enumerable/hash.rb
78
- lib/rmtools/enumerable/array.rb
79
- lib/rmtools/enumerable/object_space.rb
80
- lib/rmtools/enumerable/traversal.rb
81
- lib/rmtools/enumerable/array_iterators.rb
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
95
- LICENSE
96
- README.md
97
- Rakefile
98
- Manifest.txt
@@ -1,115 +0,0 @@
1
- # encoding: utf-8
2
- # Don't use it, it's slow as fuck
3
- RMTools::require 'dev/binding'
4
- require 'active_support/core_ext/class'
5
-
6
- module RMTools
7
-
8
- # Makes binding stack as well as caller stack,
9
- # which can be used to catch errors and directly operate within context
10
- # in which error has been occured.
11
- class Observer
12
- cattr_reader :ignore_path, :ignore_gems, :ignore_names, :ignore_all_gems
13
- cattr_accessor :keep_binding_stack
14
-
15
- @@ignore_names = %w{irbrc.rb}
16
- @@ignore_all_gems = true
17
-
18
- @@binding_stack = []
19
- DefaultRescue = lambda {|e|
20
- stop
21
- @@binding_stack.inspect_envs.present
22
- require 'irb'
23
- IRB.start('/usr/bin/irb18')
24
- @@binding_stack.last.start_interaction
25
- raise e
26
- }
27
-
28
- def self.ignore_names=ary
29
- @@ignore_names =ary
30
- update_ignore
31
- end
32
- def self.ignore_gems=ary
33
- @@ignore_gems =ary
34
- update_ignore
35
- end
36
- def self.ignore_all_gems=boolean
37
- @@ignore_all_gems = boolean
38
- update_ignore
39
- end
40
-
41
- def self.update_ignore
42
- @@ignore_path = %r{^(/usr/lib/ruby/(1.8/|gems/1.8/(bundler/)?gems/#{
43
- "(#{@@ignore_gems*'|'})" if !@@ignore_all_gems and @@ignore_gems
44
- })#{
45
- "|(#{@@ignore_names*'|'})" if @@ignore_names.b
46
- })}
47
- end
48
-
49
- def self.start
50
- @@binding_stack.clear
51
- @@keep_binding_stack = false
52
- set_trace_func proc {|event, file, line, id, binding_here, classname|
53
- if file !~ @@ignore_path
54
- if event == 'call'
55
- @@binding_stack << binding_here
56
- elsif !@@keep_binding_stack and event == 'return'
57
- @@binding_stack.pop
58
- elsif event == 'raise'
59
- @@binding_stack << binding_here
60
- @@keep_binding_stack = true
61
- end
62
- $log.debug {"#{event} by #{caller[2]} -> #{classname}##{id} <#{file}>; stack size = #{@@binding_stack.size}" if event.in %w{raise call return}}
63
- end
64
- }
65
- end
66
-
67
- def self.catch(rescue_proc=DefaultRescue)
68
- update_ignore
69
- start
70
- begin yield
71
- rescue => e
72
- @@keep_binding_stack = false
73
- begin
74
- rescue_proc[e]
75
- ensure
76
- @@binding_stack.clear
77
- end
78
- end
79
- stop
80
- end
81
-
82
- def self.stop
83
- set_trace_func nil
84
- end
85
-
86
- def self.trace_calls(out='log/calltrace.log')
87
- logger = RMLogger.new :out => out, :format => '[%time]: %text'
88
- offset, last_logline, quo, quos = 0, nil, 1, ''
89
- set_trace_func lambda {|event, file, line, id, binding, classname|
90
- if event == 'call' or event == 'c-call' or event == 'raise'
91
- logline = "#{quos}\n#{' '*([offset, 0].max)}#{classname}##{id} < #{file} > #{event=='c-call' ? '[CC]' : event == 'raise' ? '[RAISE]' : ''}"
92
- if last_logline != logline
93
- logger.log(last_logline = logline, RMLogger::INLINE)
94
- quo = 1
95
- quos = ''
96
- else
97
- quo += 1
98
- quos = " x#{q}"
99
- end
100
- end
101
- if event == 'call' or event == 'c-call'
102
- offset += 1
103
- elsif event == 'return' or event == 'c-return'
104
- offset -= 1
105
- end
106
- }
107
- begin yield
108
- rescue Exception
109
- nil
110
- ensure set_trace_func nil
111
- end
112
- end
113
-
114
- end
115
- end
@@ -1,41 +0,0 @@
1
- # encoding: utf-8
2
- RMTools::require 'dev/trace_format'
3
- require 'active_support/core_ext/class/attribute'
4
-
5
- # As for rmtools-1.1.0, 1.9.1 may hung up processing IO while generating traceback
6
- # As for 1.2.10 with 1.9.3 with readline support it isn't hung up anymore
7
- # Still it's not suitable for Rails, too many raises inside the engine slow all the wor in 5-10 times.
8
- # I need a way to format backtrace only in case it is actually about to be printed onto log or console/
9
- unless ENV['RAILS_ENV']
10
- class Exception
11
- alias :set_bt :set_backtrace
12
- class_attribute :__trace_format
13
-
14
- # If you also set (e.g. in irbrc file)
15
- # module Readline
16
- # alias :orig_readline :readline
17
- # def readline(*args)
18
- # ln = orig_readline(*args)
19
- # SCRIPT_LINES__['(irb)'] << "#{ln}\n"
20
- # ln
21
- # end
22
- # end
23
- # it will be possible to get the lines entered in IRB
24
- # else it reads only ordinal require'd files
25
- def set_backtrace src
26
- #message.hl! self.class
27
- if format = self.class.__trace_format
28
- src = RMTools.__send__ format, src
29
- end
30
- set_bt src
31
- end
32
- end
33
-
34
- class StandardError
35
- trace_format :format_trace
36
- end
37
-
38
- class SystemStackError
39
- trace_format false
40
- end
41
- end
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- RMTools::require 'dev/{observing,timer,trace_format,blackhole}'
data/lib/rmtools/init.rb DELETED
@@ -1,13 +0,0 @@
1
- # encoding: utf-8
2
- require 'active_support'
3
- module RMTools
4
- dir = File.dirname __FILE__
5
- VERSION = IO.read(File.join dir, '..', '..', 'Rakefile').match(/RMTOOLS_VERSION = '(.+?)'/)[1]
6
-
7
- require File.expand_path('require', dir)
8
- %w[core enumerable text time functional
9
- conversions ip lang rand console b
10
- fs db xml
11
- ../rmtools.so
12
- ].each {|file| RMTools::require file}
13
- end
data/lib/rmtools/ip.rb DELETED
@@ -1,2 +0,0 @@
1
- # encoding: utf-8
2
- RMTools::require __FILE__, '*'