facets 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +14 -6
- data/MANIFEST +35 -18
- data/NOTES +5 -15
- data/README +1 -11
- data/doc/{History.txt → history.rdoc} +0 -0
- data/doc/html/api/core/created.rid +1 -1
- data/doc/html/api/core/files/CHANGES.html +20 -4
- data/doc/html/api/core/files/NOTES.html +44 -15
- data/doc/html/api/more/created.rid +1 -1
- data/doc/html/api/more/files/CHANGES.html +20 -4
- data/doc/html/api/more/files/NOTES.html +46 -15
- data/doc/html/changes.html +19 -3
- data/doc/html/notes.html +43 -14
- data/doc/notes.rdoc +9 -0
- data/lib/facets/basex.rb +37 -0
- data/lib/facets/basicobject.rb +2 -2
- data/lib/facets/date.rb +16 -4
- data/lib/facets/exception.rb +1 -0
- data/lib/facets/exception/suppress.rb +21 -0
- data/lib/facets/hash/argumentize.rb +2 -1
- data/lib/facets/kernel.rb +9 -2
- data/lib/facets/kernel/__class__.rb +9 -0
- data/lib/facets/kernel/__get__.rb +10 -0
- data/lib/facets/kernel/__set__.rb +1 -0
- data/lib/facets/kernel/instance_assign.rb +41 -0
- data/lib/facets/kernel/instance_class.rb +24 -0
- data/lib/facets/kernel/instance_send.rb +7 -0
- data/lib/facets/kernel/instance_variables.rb +99 -0
- data/lib/facets/kernel/object_class.rb +10 -0
- data/lib/facets/kernel/object_hexid.rb +12 -0
- data/lib/facets/kernel/{object.rb → object_send.rb} +0 -21
- data/lib/facets/kernel/silence.rb +25 -19
- data/lib/facets/kernel/suppress.rb +18 -0
- data/lib/facets/module.rb +3 -0
- data/lib/facets/module/basename.rb +31 -0
- data/lib/facets/module/modspace.rb +22 -0
- data/lib/facets/module/nesting.rb +0 -66
- data/lib/facets/module/spacename.rb +25 -0
- data/lib/facets/net/smtp_tls.rb +5 -8
- data/lib/facets/openhash.rb +1 -0
- data/lib/facets/openobject.rb +2 -1
- data/lib/facets/paramix.rb +187 -0
- data/lib/facets/platform.rb +192 -0
- data/lib/facets/recorder.rb +1 -1
- data/lib/facets/string.rb +12 -0
- data/lib/facets/string/to_time.rb +1 -23
- data/lib/facets/style.rb +145 -64
- data/lib/facets/time.rb +5 -0
- data/lib/facets/time/to_time.rb +14 -0
- data/log/{Changelog-0.txt → changelog-0.rdoc} +0 -0
- data/log/{Changelog-1.txt → changelog-1.rdoc} +0 -0
- data/log/{Changelog.txt → changelog.rdoc} +18 -0
- data/log/{Fixme.txt → fixme.rdoc} +3 -3
- data/log/testlog.txt +645 -0
- data/log/{Todo.txt → todo.rdoc} +80 -89
- data/meta/project.yaml +14 -10
- data/meta/version +1 -1
- data/script/conflicts +28 -3
- data/script/methods +32 -43
- data/test/kernel/{test_instance.rb → test_instance_assign.rb} +2 -10
- data/test/kernel/test_instance_class.rb +12 -0
- data/test/kernel/{test_object.rb → test_object_class.rb} +2 -9
- data/test/kernel/test_object_hexid.rb +12 -0
- data/test/module/test_basename.rb +11 -0
- data/test/module/test_modspace.rb +13 -0
- data/test/module/test_nesting.rb +0 -17
- data/test/module/test_spacename.rb +14 -0
- data/test/test_date.rb +12 -0
- data/test/test_style.rb +1 -1
- data/test/{string → time}/test_to_time.rb +1 -9
- metadata +46 -26
- data/lib/facets/behavior.rb +0 -104
- data/lib/facets/kernel/instance.rb +0 -73
- data/lib/facets/string/stylize.rb +0 -73
- data/lib/facets/string/underscore.rb +0 -28
- data/log/Testlog.txt +0 -205
- data/meta/corelibs +0 -49
- data/test/string/test_stylize.rb +0 -52
- data/test/string/test_underscore.rb +0 -13
data/log/{Todo.txt → todo.rdoc}
RENAMED
@@ -1,37 +1,30 @@
|
|
1
1
|
|
2
2
|
= TODO
|
3
3
|
|
4
|
-
file://lib/facets/1stclassmethod.rb
|
4
|
+
== file://lib/facets/1stclassmethod.rb
|
5
5
|
* TODO Should there be a #this! ? (102)
|
6
6
|
|
7
|
-
file://lib/facets/annotations.rb
|
7
|
+
== file://lib/facets/annotations.rb
|
8
8
|
* TODO Should attribute alias be kept? (279)
|
9
9
|
|
10
|
-
file://lib/facets/array/indexable.rb
|
10
|
+
== file://lib/facets/array/indexable.rb
|
11
11
|
* TODO Probably not best to overide store and fetch operators. Rename? (36)
|
12
12
|
|
13
|
-
file://lib/facets/attr.rb
|
13
|
+
== file://lib/facets/attr.rb
|
14
14
|
* TODO Perhaps need to make a check against overriding annotated version. (33)
|
15
15
|
|
16
|
-
file://lib/facets/basicobject.rb
|
16
|
+
== file://lib/facets/basicobject.rb
|
17
17
|
* TODO In the future it might be nice to allow some selectability
|
18
18
|
in these via a factory method. (166)
|
19
19
|
|
20
|
-
file://lib/facets/
|
21
|
-
* TODO: This behavior library needs improvement. If we can
|
22
|
-
refine it enough and it proves solid, this would
|
23
|
-
make a good candidate for core. (35)
|
24
|
-
|
25
|
-
file://lib/facets/binreadable.rb
|
20
|
+
== file://lib/facets/binreadable.rb
|
26
21
|
* TODO Would like to get the core functionality this provides into the
|
27
22
|
System module and then change BinaryReader to depend on that instead. (35)
|
28
23
|
|
29
|
-
file://lib/facets/buildable.rb
|
24
|
+
== file://lib/facets/buildable.rb
|
30
25
|
* TODO: There may be other methods that need to be in this exception list. (219)
|
31
26
|
|
32
|
-
file://lib/facets/capsule.rb
|
33
|
-
* TODO Need to add load_path lookup. (140)
|
34
|
-
* TODO Is autoimport bets name for this? (215)
|
27
|
+
== file://lib/facets/capsule.rb
|
35
28
|
* TODO In order to load/require at the instance level.
|
36
29
|
This needs to be in a separate namespace however
|
37
30
|
b/c it can interfere with what is expected.
|
@@ -39,208 +32,206 @@ b/c it can interfere with what is expected.
|
|
39
32
|
m = method(meth)
|
40
33
|
define_method(meth) do |*args| m.call(*args) end
|
41
34
|
} (102)
|
35
|
+
* TODO Need to add load_path lookup. (140)
|
36
|
+
* TODO Is autoimport bets name for this? (215)
|
42
37
|
|
43
|
-
file://lib/facets/class/prepend.rb
|
38
|
+
== file://lib/facets/class/prepend.rb
|
44
39
|
* TODO: Perhaps rename this to preallocate, b/c of
|
45
40
|
the way it works. It is not really a clean
|
46
41
|
prepend, like that of Module#prepend. (27)
|
47
42
|
|
48
|
-
file://lib/facets/command.rb
|
43
|
+
== file://lib/facets/command.rb
|
49
44
|
* TODO Add support for __options. (368)
|
50
45
|
|
51
|
-
file://lib/facets/consoleutils.rb
|
46
|
+
== file://lib/facets/consoleutils.rb
|
52
47
|
* TODO: Don't know how portable #screen_width is. (64)
|
53
48
|
|
54
|
-
file://lib/facets/cssfilter.rb
|
49
|
+
== file://lib/facets/cssfilter.rb
|
55
50
|
* TODO: Not complete, does not work with "@xxx foo;" for example. (156)
|
56
51
|
* TODO: So far this does absolutely nothing! (176)
|
57
52
|
* TODO: allowed_urls (119)
|
58
53
|
|
59
|
-
file://lib/facets/dictionary.rb
|
54
|
+
== file://lib/facets/dictionary.rb
|
60
55
|
* TODO is this needed? Doesn't the super class do this? (125)
|
61
56
|
|
62
|
-
file://lib/facets/dir/ascend.rb
|
57
|
+
== file://lib/facets/dir/ascend.rb
|
63
58
|
* TODO: Make instance method versions ? (3)
|
64
59
|
|
65
|
-
file://lib/facets/dir/parent.rb
|
66
|
-
* TODO: Needs improvement. (5)
|
60
|
+
== file://lib/facets/dir/parent.rb
|
67
61
|
* TODO: Instance version? (6)
|
62
|
+
* TODO: Needs improvement. (5)
|
68
63
|
|
69
|
-
file://lib/facets/duration.rb
|
64
|
+
== file://lib/facets/duration.rb
|
70
65
|
* TODO: IF WE WANT TO DO THIS IT NEEDS TO BE ADDED TO times.rb ??? (486)
|
71
66
|
|
72
|
-
file://lib/facets/enumerablepass.rb
|
67
|
+
== file://lib/facets/enumerablepass.rb
|
73
68
|
* TODO (212)
|
74
69
|
|
75
|
-
file://lib/facets/expirable.rb
|
70
|
+
== file://lib/facets/expirable.rb
|
76
71
|
* TODO (69)
|
77
72
|
|
78
|
-
file://lib/facets/file/rewrite.rb
|
73
|
+
== file://lib/facets/file/rewrite.rb
|
79
74
|
* TODO Should it be in-place modification like this? Or would it be better
|
80
75
|
if whatever the block returns is written to the file instead? (24)
|
81
76
|
|
82
|
-
file://lib/facets/filelist.rb
|
77
|
+
== file://lib/facets/filelist.rb
|
83
78
|
* TODO: check for pending (184)
|
84
79
|
* TODO This test needs a mock File class. (473)
|
85
80
|
|
86
|
-
file://lib/facets/fileutils/slice.rb
|
81
|
+
== file://lib/facets/fileutils/slice.rb
|
87
82
|
* TODO This test have been remarked out until such time
|
88
83
|
as a mock FileSystem can be used to test it against. (55)
|
89
84
|
|
90
|
-
file://lib/facets/fileutils/wc.rb
|
85
|
+
== file://lib/facets/fileutils/wc.rb
|
91
86
|
* TODO FileUtils#wc test needs needs a Mock File. (64)
|
92
87
|
|
93
|
-
file://lib/facets/fileutils/which.rb
|
88
|
+
== file://lib/facets/fileutils/which.rb
|
94
89
|
* TODO FileUtils#which This test needs a mock File. (59)
|
95
90
|
|
96
|
-
file://lib/facets/hash/alias.rb
|
91
|
+
== file://lib/facets/hash/alias.rb
|
97
92
|
* TODO: Rename to #aliaskey or something else. (23)
|
98
93
|
|
99
|
-
file://lib/facets/hash/insert.rb
|
94
|
+
== file://lib/facets/hash/insert.rb
|
100
95
|
* TODO: Would #store? be a better name? (6)
|
101
96
|
|
102
|
-
file://lib/facets/hash/to_struct.rb
|
97
|
+
== file://lib/facets/hash/to_struct.rb
|
103
98
|
* TODO: Is this robust enough considerd hashes aren't ordered? (8)
|
104
99
|
|
105
|
-
file://lib/facets/hash/traverse.rb
|
100
|
+
== file://lib/facets/hash/traverse.rb
|
106
101
|
* TODO: Contrast these to recursibely --we may not need both. (11)
|
107
102
|
* TODO: Testing value to see if it is a Hash also catches subclasses of Hash.
|
108
103
|
This is probably not the right thing to do and should catch Hashes only (?) (13)
|
109
104
|
|
110
|
-
file://lib/facets/indexable.rb
|
105
|
+
== file://lib/facets/indexable.rb
|
111
106
|
* TODO Maybe #range could use a little error catch code (todo). (225)
|
112
107
|
* TODO: Remove Array#index_of when Ruby 1.9 adds block to #index. (217)
|
113
108
|
|
114
|
-
file://lib/facets/inheritor.rb
|
109
|
+
== file://lib/facets/inheritor.rb
|
115
110
|
* TODO This is an issue if you try to include a module
|
116
111
|
into Module or Class itself. How to fix? (107)
|
117
112
|
|
118
|
-
file://lib/facets/interval.rb
|
113
|
+
== file://lib/facets/interval.rb
|
119
114
|
* TODO: Add +n+ parameter to count segmentations like those produced by #each. (174)
|
120
115
|
|
121
|
-
file://lib/facets/ioredirect.rb
|
116
|
+
== file://lib/facets/ioredirect.rb
|
122
117
|
* TODO (121)
|
123
118
|
|
124
|
-
file://lib/facets/kernel/as.rb
|
119
|
+
== file://lib/facets/kernel/as.rb
|
125
120
|
* TODO: Deprecate this and use Functor (HigherOrderMessage) instead. (85)
|
126
121
|
* TODO: Does this have the proper scope for #send? (34)
|
127
122
|
|
128
|
-
file://lib/facets/kernel/d.rb
|
123
|
+
== file://lib/facets/kernel/d.rb
|
129
124
|
* TODO: This is borderline "prime". Keep here?
|
130
125
|
Another copy of it exits in dtools.rb (16)
|
131
126
|
|
132
|
-
file://lib/facets/kernel/demo.rb
|
127
|
+
== file://lib/facets/kernel/demo.rb
|
133
128
|
* TODO: Is there a way to do this without the eval string in block?
|
134
129
|
Preferably just a block and no string. (16)
|
135
130
|
|
136
|
-
file://lib/facets/kernel/
|
137
|
-
* TODO:
|
138
|
-
* TODO: Should is also accept class variables? (eg. @@a) (54)
|
131
|
+
== file://lib/facets/kernel/object_send.rb
|
132
|
+
* TODO: object_send needs to change for 1.9. (13)
|
139
133
|
|
140
|
-
file://lib/facets/kernel/
|
141
|
-
* TODO: object_send needs to change for 1.9. (25)
|
142
|
-
|
143
|
-
file://lib/facets/kernel/populate.rb
|
134
|
+
== file://lib/facets/kernel/populate.rb
|
144
135
|
* TODO: Better name, #set_with ? (23)
|
145
136
|
* TODO: pepulate_from(obj) ? (52)
|
146
137
|
|
147
|
-
file://lib/facets/kernel/resc.rb
|
138
|
+
== file://lib/facets/kernel/resc.rb
|
148
139
|
* TODO: Should this be deprecated in favor of String#to_re/to_rx ? (7)
|
149
140
|
|
150
|
-
file://lib/facets/
|
141
|
+
== file://lib/facets/kernel/suppress.rb
|
142
|
+
* TODO: This will be deprecatd in favor or Exception#suppress. (5)
|
143
|
+
|
144
|
+
== file://lib/facets/logger.rb
|
151
145
|
* TODO: What's all this about then? (54)
|
152
146
|
|
153
|
-
file://lib/facets/module/conflict.rb
|
147
|
+
== file://lib/facets/module/conflict.rb
|
154
148
|
* TODO: All instance methods, or just public? (16)
|
155
149
|
|
156
|
-
file://lib/facets/module/instance_methods.rb
|
150
|
+
== file://lib/facets/module/instance_methods.rb
|
157
151
|
* TODO: Better name for #all_instance_methods? (9)
|
158
152
|
|
159
|
-
file://lib/facets/module/op.rb
|
153
|
+
== file://lib/facets/module/op.rb
|
160
154
|
* TODO: Should this use all instance_methods, not just public? (46)
|
161
155
|
|
162
|
-
file://lib/facets/module/revise.rb
|
156
|
+
== file://lib/facets/module/revise.rb
|
163
157
|
* TODO: Are these aliases really desitrable? (133)
|
164
158
|
|
165
|
-
file://lib/facets/multiton.rb
|
159
|
+
== file://lib/facets/multiton.rb
|
166
160
|
* TODO Convert this into a real test and/or benchmark. (278)
|
167
161
|
|
168
|
-
file://lib/facets/nullclass.rb
|
169
|
-
* TODO (71)
|
162
|
+
== file://lib/facets/nullclass.rb
|
170
163
|
* TODO: Perhaps NullClass and NackClass should be one and the same? (32)
|
164
|
+
* TODO (71)
|
171
165
|
|
172
|
-
file://lib/facets/openobject.rb
|
173
|
-
* TODO
|
174
|
-
* TODO
|
166
|
+
== file://lib/facets/openobject.rb
|
167
|
+
* TODO Not so sure about #as_hash!. For starters if it doesn't return a hash it will fail. (162)
|
168
|
+
* TODO Replace by using #as(Hash). Perhaps as_hash and as_object shortcuts? Why? (163)
|
175
169
|
|
176
|
-
file://lib/facets/pool.rb
|
170
|
+
== file://lib/facets/pool.rb
|
177
171
|
* TODO (87)
|
178
172
|
|
179
|
-
file://lib/facets/proc/curry.rb
|
173
|
+
== file://lib/facets/proc/curry.rb
|
180
174
|
* TODO: Utilize Ruby 1.9's #curry method. (5)
|
181
175
|
|
182
|
-
file://lib/facets/proc/partial.rb
|
176
|
+
== file://lib/facets/proc/partial.rb
|
183
177
|
* TODO: Parhaps ArgumentError would suffice, and we don't need MissingArgument? (25)
|
184
178
|
|
185
|
-
file://lib/facets/range/combine.rb
|
179
|
+
== file://lib/facets/range/combine.rb
|
186
180
|
* TODO: Incorporate end-sentinal inclusion vs. exclusion. (8)
|
187
181
|
|
188
|
-
file://lib/facets/reference.rb
|
182
|
+
== file://lib/facets/reference.rb
|
189
183
|
* TODO (97)
|
190
184
|
|
191
|
-
file://lib/facets/ruby.rb
|
192
|
-
* TODO: This will be deprecated as of Ruby 1.9, since it will become standard Ruby. (414)
|
185
|
+
== file://lib/facets/ruby.rb
|
193
186
|
* TODO: Make this work more like a simple character dial? (434)
|
187
|
+
* TODO: This will be deprecated as of Ruby 1.9, since it will become standard Ruby. (414)
|
194
188
|
|
195
|
-
file://lib/facets/semaphore.rb
|
189
|
+
== file://lib/facets/semaphore.rb
|
196
190
|
* TODO (86)
|
197
191
|
|
198
|
-
file://lib/facets/settings.rb
|
192
|
+
== file://lib/facets/settings.rb
|
199
193
|
* TODO: find a better name. (53)
|
200
194
|
|
201
|
-
file://lib/facets/stackable.rb
|
195
|
+
== file://lib/facets/stackable.rb
|
202
196
|
* TODO: Better name (besides unshift)? (67)
|
203
197
|
|
204
|
-
file://lib/facets/string/natcmp.rb
|
198
|
+
== file://lib/facets/string/natcmp.rb
|
205
199
|
* TODO: Invert case flag? (13)
|
206
200
|
|
207
|
-
file://lib/facets/string/range.rb
|
208
|
-
* TODO: Culd probably be defined for Indexable in general too. (64)
|
201
|
+
== file://lib/facets/string/range.rb
|
209
202
|
* TODO: Add offset, perhaps ? (20)
|
203
|
+
* TODO: Culd probably be defined for Indexable in general too. (64)
|
210
204
|
|
211
|
-
file://lib/facets/string/
|
212
|
-
* TODO: Best definition of String#underscore and it's inverse? (3)
|
213
|
-
|
214
|
-
file://lib/facets/string/words.rb
|
205
|
+
== file://lib/facets/string/words.rb
|
215
206
|
* TODO: This is alternateive from glue: worth providing? (68)
|
216
207
|
|
217
|
-
file://lib/facets/string/xor.rb
|
208
|
+
== file://lib/facets/string/xor.rb
|
218
209
|
* TODO: This is used by crypt.rb, it needs to be documented. (5)
|
219
210
|
|
220
|
-
file://lib/facets/style.rb
|
211
|
+
== file://lib/facets/style.rb
|
212
|
+
* TODO: With #pathize, is downcasing really needed? After all paths can have capitalize letters ;p (28)
|
213
|
+
* TODO: With #methodize, is downcasing any but the first letter really needed? Desipite Matz prefernce methods can have capitalized letters. (29)
|
221
214
|
* TODO:
|
222
215
|
* Make sure that all scenarios return a valid unix path
|
223
|
-
* Make sure it is revertible (
|
224
|
-
* TODO: Make sure methodize is reversable (?) (215)
|
225
|
-
* TODO: Make sure moduleize that all scenarios return a valid ruby class name (227)
|
216
|
+
* Make sure it is revertible (100)
|
226
217
|
|
227
|
-
file://lib/facets/symbol/generate.rb
|
218
|
+
== file://lib/facets/symbol/generate.rb
|
228
219
|
* TODO: Is the generated symbol format acceptable? (11)
|
229
220
|
|
230
|
-
file://lib/facets/tracepoint.rb
|
221
|
+
== file://lib/facets/tracepoint.rb
|
231
222
|
* TODO (193)
|
232
223
|
|
233
|
-
file://lib/facets/tuple.rb
|
224
|
+
== file://lib/facets/tuple.rb
|
234
225
|
* TODO This needs to take into account the default
|
235
226
|
and maybe the divider too. (217)
|
236
227
|
|
237
|
-
file://lib/facets/uri.rb
|
228
|
+
== file://lib/facets/uri.rb
|
238
229
|
* TODO: optimize (186)
|
230
|
+
* TODO: How does this compare to URI.escape? (107)
|
239
231
|
* TODO: find a better name.
|
240
232
|
Gets the request uri, injects extra parameters in the query string
|
241
233
|
and returns a new uri. The request object is not modified.
|
242
234
|
There is always a qs string so an extra test is skipped. (203)
|
243
|
-
* TODO: How does this compare to URI.escape? (107)
|
244
235
|
|
245
|
-
file://lib/facets/ziputils.rb
|
236
|
+
== file://lib/facets/ziputils.rb
|
246
237
|
* TODO Write internalized untar_gzip function. (96)
|
data/meta/project.yaml
CHANGED
@@ -7,14 +7,9 @@ summary :
|
|
7
7
|
Premium Core Extensions and Standard Additions
|
8
8
|
|
9
9
|
description :
|
10
|
-
Facets is a
|
11
|
-
and standard additions for the Ruby programming
|
12
|
-
|
13
|
-
Methods are stored in small, tightly related collections,
|
14
|
-
allowing for highly granular control of requirements.
|
15
|
-
The modules include a variety of useful classes, mixins
|
16
|
-
and microframeworks, from the Functor to a complete
|
17
|
-
Annotations system.
|
10
|
+
Facets is a single largest collection of core extension methods
|
11
|
+
and standard class additions available for the Ruby programming
|
12
|
+
language.
|
18
13
|
|
19
14
|
project : facets
|
20
15
|
author : Thomas Sawyer <transfire@gmail.com>
|
@@ -22,6 +17,15 @@ email : facets-universal@rubyforge.org
|
|
22
17
|
homepage : 'http://facets.rubyforge.org'
|
23
18
|
download : 'http://rubyforge.org/projects/facets'
|
24
19
|
|
25
|
-
exclude : [ work, pkg, site, task ]
|
26
|
-
|
20
|
+
exclude : [ work, pkg, site, task, temp ]
|
21
|
+
|
22
|
+
hosts:
|
23
|
+
rubyforge:
|
24
|
+
type: rubyforge
|
25
|
+
groupid : 804
|
26
|
+
rubytalk:
|
27
|
+
type: rubytalk
|
28
|
+
personal:
|
29
|
+
type: mailinglist
|
30
|
+
mailto: transfire@gmail.com
|
27
31
|
|
data/meta/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.4.
|
1
|
+
2.4.1 stable (2008-04-03)
|
data/script/conflicts
CHANGED
@@ -1,11 +1,28 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'enumerator'
|
4
|
+
|
3
5
|
$: << 'lib'
|
6
|
+
#$: << 'lib'
|
4
7
|
|
5
|
-
|
8
|
+
libs = ARGV #(ENV['LIBS'] || "").split(/[;:]/)
|
9
|
+
|
10
|
+
# We add time b/c both that's built-in but not loaded by Ruby.
|
11
|
+
original = `script/methods time.rb yaml.rb`.split(/\s/)
|
12
|
+
facets = `script/methods lib/facets`.split(/\s/)
|
13
|
+
other = `script/methods #{libs.join(' ')}`.split(/\s/)
|
14
|
+
|
15
|
+
facets = facets - original
|
16
|
+
other = other - original
|
17
|
+
clash = facets & other
|
18
|
+
|
19
|
+
puts clash.sort.join("\n")
|
20
|
+
puts " #{clash.size} Clashes"
|
6
21
|
|
7
|
-
|
8
|
-
|
22
|
+
|
23
|
+
=begin
|
24
|
+
|
25
|
+
# Return a hash for each defined class containing a array class and method.
|
9
26
|
def methods_by_class
|
10
27
|
Module.
|
11
28
|
constants.
|
@@ -26,6 +43,12 @@ ARGV.each{|a| require a }
|
|
26
43
|
|
27
44
|
after = methods_by_class
|
28
45
|
|
46
|
+
delta = after - before
|
47
|
+
|
48
|
+
puts delta.join("\n")
|
49
|
+
|
50
|
+
exit
|
51
|
+
|
29
52
|
# Print the difference between the before and after method lists:
|
30
53
|
before.keys.sort_by{|k| k.to_s}.each{|k|
|
31
54
|
class_diff = after[k][0]-before[k][0]
|
@@ -36,3 +59,5 @@ before.keys.sort_by{|k| k.to_s}.each{|k|
|
|
36
59
|
)*"\n")
|
37
60
|
}
|
38
61
|
|
62
|
+
=end
|
63
|
+
|
data/script/methods
CHANGED
@@ -1,60 +1,49 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
#!/usr/bin/env ruby
|
5
|
-
|
6
3
|
require 'enumerator'
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
#$: << 'lib'
|
12
|
-
|
13
|
-
libs = (ENV['LIBS'] || "").split(/[;:]/)
|
14
|
-
|
15
|
-
original = `task/method_dump`.split(' ')
|
16
|
-
facets = `task/method_dump lib/facets`.split(' ')
|
17
|
-
other = `task/method_dump #{libs.join(' ')}`.split(' ')
|
18
|
-
|
19
|
-
facets = facets - original
|
20
|
-
other = other - original
|
21
|
-
|
22
|
-
puts (facets & other).sort.join("\n")
|
23
|
-
end
|
5
|
+
def method_list
|
6
|
+
list = []
|
24
7
|
|
8
|
+
ObjectSpace.each_object(Module) do |klass|
|
9
|
+
insta_methods = klass.public_instance_methods(true) +
|
10
|
+
klass.private_instance_methods(true) +
|
11
|
+
klass.protected_instance_methods(true)
|
25
12
|
|
13
|
+
class_methods = klass.public_methods(true) +
|
14
|
+
klass.private_methods(true) +
|
15
|
+
klass.protected_methods(true)
|
26
16
|
|
17
|
+
klass.ancestors[1..-1].each do |ancestor|
|
18
|
+
#next unless ancestor.is_a?(Module)
|
27
19
|
|
28
|
-
|
29
|
-
|
30
|
-
|
20
|
+
if ancestor.is_a?(Class)
|
21
|
+
insta_methods -= ancestor.public_instance_methods(true) +
|
22
|
+
ancestor.private_instance_methods(true) +
|
23
|
+
ancestor.protected_instance_methods(true)
|
31
24
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
class_methods -= ancestor.public_methods(true) +
|
26
|
+
ancestor.private_methods(true) +
|
27
|
+
ancestor.protected_methods(true)
|
28
|
+
end
|
29
|
+
end
|
36
30
|
|
31
|
+
class_methods -= Kernel.public_methods(true) +
|
32
|
+
Kernel.private_methods(true) +
|
33
|
+
Kernel.protected_methods(true)
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
klass.protected_methods(false)
|
35
|
+
class_methods.map!{|c| "#{klass}." + c}
|
36
|
+
insta_methods.map!{|c| "#{klass}#" + c}
|
41
37
|
|
42
|
-
|
43
|
-
insta_methods
|
44
|
-
|
45
|
-
klass.superclass.protected_instance_methods
|
38
|
+
list.concat(class_methods)
|
39
|
+
list.concat(insta_methods)
|
40
|
+
end
|
46
41
|
|
47
|
-
|
48
|
-
|
49
|
-
klass.superclass.protected_methods
|
50
|
-
end
|
42
|
+
return list
|
43
|
+
end
|
51
44
|
|
52
|
-
|
53
|
-
insta_methods.map!{|c| "#{klass}#" + c}
|
45
|
+
ARGV.each{ |lib| require lib }
|
54
46
|
|
55
|
-
|
56
|
-
total_method_list.concat(insta_methods)
|
57
|
-
end
|
47
|
+
puts method_list.sort.join("\n")
|
58
48
|
|
59
|
-
puts total_method_list.join(" ")
|
60
49
|
|