core_ex 0.4.0 → 0.5.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. data/ChangeLog +251 -0
  2. data/NEWS +29 -0
  3. data/README +1 -1
  4. data/SPEC.yml +10 -10
  5. data/lib/core_ex/dependencies_ext/constant_load_path.rb +1 -1
  6. data/lib/core_ex/embedded_tests.rb +1 -1
  7. data/lib/core_ex/enumerable.rb +87 -5
  8. data/lib/core_ex/exception.rb +1 -1
  9. data/lib/core_ex/file_utils.rb +1 -1
  10. data/lib/core_ex/lazy_loading.rb +159 -0
  11. data/lib/core_ex/module/attr_once.rb +1 -1
  12. data/lib/core_ex/module/import.rb +4 -6
  13. data/lib/core_ex/module/in_place.rb +1 -1
  14. data/lib/core_ex/module/mix_in_with_args.rb +1 -1
  15. data/lib/core_ex/numeric.rb +46 -0
  16. data/lib/core_ex/object/instance_eval_with_args.rb +1 -1
  17. data/lib/core_ex/object/singleton_class.rb +1 -1
  18. data/lib/core_ex/object/the_first_time.rb +1 -1
  19. data/lib/core_ex/pathname.rb +17 -11
  20. data/lib/core_ex/proc.rb +80 -1
  21. data/lib/core_ex/rakefile_base.rf +192 -296
  22. data/lib/core_ex/require.rb +1 -1
  23. data/lib/core_ex/string.rb +11 -2
  24. data/lib/core_ex/time.rb +1 -1
  25. data/lib/core_ex/try_dup.rb +1 -1
  26. data/lib/core_ex/yaml.rb +101 -79
  27. data/lib/core_ex.rb +129 -128
  28. data/lib/d_time.rb +225 -53
  29. data/lib/dumpable_proc.rb +1 -10
  30. data/lib/path_list.rb +18 -7
  31. data/lib/temp_path.rb +3 -3
  32. data/lib/test/unit/u_i/yaml/test_runner.rb +1 -1
  33. data/lib/version.rb +309 -69
  34. data/lib/yaml_extension.rb +1 -1
  35. data/test/fixtures/lazy_loading/a_b/a/c.rb +6 -0
  36. data/test/fixtures/lazy_loading/a_b/a.rb +2 -0
  37. data/test/fixtures/lazy_loading/a_b/b/c.rb +4 -0
  38. data/test/fixtures/lazy_loading/a_b/b.rb +2 -0
  39. data/test/fixtures/lazy_loading/double/a/bouhou.rb +2 -0
  40. data/test/fixtures/lazy_loading/double/a/foo_bar.rb +5 -0
  41. data/test/fixtures/lazy_loading/double/a/sub/a/suba.rb +7 -0
  42. data/test/fixtures/lazy_loading/double/b/root/sub/b.rb +6 -0
  43. data/test/fixtures/lazy_loading/double/b/root/sub.rb +4 -0
  44. data/test/fixtures/lazy_loading/double/b/root.rb +2 -0
  45. data/test/fixtures/lazy_loading/foo_bars/foo_bar.rb +4 -0
  46. data/test/fixtures/lazy_loading/foo_bars/mods/mod.rb +6 -0
  47. data/test/fixtures/lazy_loading/foo_bars/mods/sub_mod.rb +6 -0
  48. data/test/fixtures/lazy_loading/foo_bars/mods/sub_sub_mod.rb +7 -0
  49. data/test/fixtures/lazy_loading/foo_bars/mods.rb +4 -0
  50. data/test/fixtures/lazy_loading/foo_bars/sub_foo_bar.rb +5 -0
  51. data/test/fixtures/lazy_loading/foo_bars/titis/tutu.rb +6 -0
  52. data/test/fixtures/lazy_loading/foo_bars/totos.rb +6 -0
  53. data/test/fixtures/lazy_loading/foo_bars.rb +4 -0
  54. data/test/lazy_loading/test_already_present_name_absolute.rb +6 -0
  55. data/test/lazy_loading/test_already_present_name_relative.rb +11 -0
  56. data/test/lazy_loading/test_inside_another_module.rb +5 -0
  57. data/test/lazy_loading/test_lazy_loading.rb +179 -0
  58. data/test/sanity/multiple-requires.yml +22 -4
  59. data/test/unit-suite.yml +5 -4
  60. metadata +119 -80
  61. data/SPEC.dyn.yml +0 -10
  62. data/SPEC.gemspec +0 -13
  63. data/test/test-unit-setup.rb +0 -19
  64. /data/test/{resources → fixtures}/require/test_require +0 -0
  65. /data/test/{resources → fixtures}/require/test_require_rb.rb +0 -0
  66. /data/test/{resources → fixtures}/require/test_require_so.so +0 -0
  67. /data/test/{resources → fixtures}/use-from-gems.rb +0 -0
  68. /data/test/{resources → fixtures}/yaml_testrunner/unit_test.rb +0 -0
data/lib/version.rb CHANGED
@@ -1,127 +1,367 @@
1
1
  # Copyright:: Copyright (c) 2004 Nicolas Despres. All rights reserved.
2
2
  # Author:: Nicolas Despres <polrop@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: version.rb 334 2005-09-04 14:29:40Z ertai $
4
+ # Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/version.rb 22190 2006-02-23T17:21:00.661381Z pouillar $
5
5
 
6
6
 
7
7
  class Version
8
+ yaml_as 'tag:feydakins.org,2006:version'
8
9
  include Comparable
9
10
 
10
- attr_accessor :major, :minor, :build, :revision
11
+ attr_accessor :major, :minor, :tag, :category, :name, :release_name
12
+ # protected :major=, :minor=, :tag=,
13
+ # :category=, :name=, :release_name=
11
14
 
12
- def initialize(major, minor, build, revision)
13
- @major = major
14
- @minor = minor
15
- @build = build
16
- @revision = revision
15
+ def initialize ( major, minor, tag=nil, tag_offset=nil,
16
+ category=nil, name=nil, release_name=nil )
17
+ @major = major
18
+ @minor = minor
19
+ @tag = Tag[tag || :off, tag_offset || 0]
20
+ if @tag.offset.zero?
21
+ case @tag.name
22
+ when :p then raise ArgumentError, 'The patch level tag (p) needs an offset'
23
+ when :r then raise ArgumentError, 'The revision tag (r) needs an offset'
24
+ end
25
+ end
26
+ @category = category || ''
27
+ @name = name || ''
28
+ @release_name = release_name || ''
17
29
  end
18
30
 
19
- def <=>(other)
20
- if @major == other.major
21
- if @minor == other.minor
22
- if @build == other.build
23
- @revision <=> other.revision
24
- else
25
- @build <=> other.build
26
- end
27
- else
28
- @minor <=> other.minor
29
- end
30
- else
31
- @major <=> other.major
31
+ def self.parse ( str )
32
+ re_cat_name = /([\w-]+\/)?([\w-]+)/
33
+ re_tag = /_(r|alpha|beta|pre|rc|off|p)(\d*)/
34
+ unless str =~ /^(#{re_cat_name}-)?([\d.]+)(#{re_tag})?(#.*)?$/
35
+ raise ArgumentError, "Cannot parse your version: #{str}"
32
36
  end
37
+ category, name, head, _, tag, offset, release_name = Regexp.last_match[2..8]
38
+ parts = head.split('.').map { |x| x.to_i }
39
+ raise ArgumentError, "Too many parts: #{head}" if parts.size > 2
40
+ major, minor = parts
41
+
42
+ # Remove now useless chars (/, #)
43
+ category[-1] = '' if category
44
+ release_name[0] = '' if release_name
45
+
46
+ tag = (tag.nil?)? :off : tag.to_sym
47
+ new(major || 0, minor || 0, tag, offset.to_i,
48
+ category || '', name || '', release_name || '')
33
49
  end
34
50
 
35
- def pp
36
- "#{to_s} (Revision: #@revision)"
51
+ def self.yaml_new( klass, tag, val )
52
+ parse val
53
+ end
54
+
55
+ def <=>(other)
56
+ category_cmp = @category <=> other.category
57
+ return category_cmp unless category_cmp.zero?
58
+
59
+ name_cmp = @name <=> other.name
60
+ return name_cmp unless name_cmp.zero?
61
+
62
+ major_cmp = @major <=> other.major
63
+ return major_cmp unless major_cmp.zero?
64
+
65
+ minor_cmp = @minor <=> other.minor
66
+ return minor_cmp unless minor_cmp.zero?
67
+
68
+ @tag <=> other.tag
69
+ end
70
+
71
+ def official?
72
+ @tag.name == :off
73
+ end
74
+
75
+ def major_minor
76
+ "#@major.#@minor"
77
+ end
78
+
79
+ def tag_string
80
+ (official?)? '' : "_#{@tag.name}#{(@tag.offset.zero?)? '' : @tag.offset}"
81
+ end
82
+
83
+ def category_and_name
84
+ (@name.empty?)? '' : ((@category.empty?)? "#@name-" : "#@category/#@name-")
37
85
  end
38
86
 
39
87
  def to_s
40
- "#@major.#@minor.#@build"
88
+ s = category_and_name + major_minor + tag_string
89
+ s << '#' << @release_name unless @release_name.empty?
90
+ s
91
+ end
92
+
93
+ def short_string
94
+ s = ''
95
+ s << @name << '-' unless @name.empty?
96
+ s << major_minor << tag_string
41
97
  end
42
98
 
43
99
  def inspect
44
- "#@major.#@minor.#@build-r#@revision"
100
+ "#<Version: #{to_s}>"
101
+ end
102
+
103
+ def to_rubygems_version_string
104
+ to_positive_integers.join '.'
105
+ end
106
+
107
+ def to_yaml ( opts={} )
108
+ YAML::quick_emit nil, opts do |out|
109
+ out.scalar taguri, to_s, :plain
110
+ end
111
+ end
112
+
113
+ def pp
114
+ more = ''
115
+ more << " #@release_name" unless @release_name.empty?
116
+ "#{@tag.pp}: #{major_minor}#{more}"
45
117
  end
46
118
 
47
119
  def to_a
48
- [ @major, @minor, @build, @revision ]
120
+ [ @major, @minor, @tag.name, @tag.offset ]
121
+ end
122
+
123
+ def to_positive_integers
124
+ [@major, @minor, @tag.rank + 5, @tag.offset]
49
125
  end
50
126
 
51
127
  def major_release
52
- @major += 1
53
- @minor = 0
54
- @build = 0
55
- @revision += 1
56
- self
128
+ release do |r|
129
+ r.major += 1
130
+ r.minor = 0
131
+ r.tag = Tag[:alpha, 0]
132
+ end
57
133
  end
58
134
 
59
135
  def minor_release
60
- @minor += 1
61
- @build = 0
62
- @revision += 1
63
- self
136
+ release do |r|
137
+ r.minor += 1
138
+ r.tag = Tag[:alpha, 0]
139
+ end
64
140
  end
65
141
 
66
- def build_release
67
- @build += 1
68
- @revision += 1
69
- self
142
+ def new_tag_release ( new_tag )
143
+ release do |r|
144
+ r.tag = Tag[new_tag, (new_tag == :p)? 1 : 0]
145
+ end
70
146
  end
147
+ private :new_tag_release
71
148
 
72
- end # class Version
149
+ def incr_tag_release
150
+ raise ArgumentError, "Impossible it's an official release" if official?
151
+ release do |r|
152
+ r.tag.offset += 1
153
+ end
154
+ end
155
+ private :incr_tag_release
73
156
 
157
+ def tag_release ( tag )
158
+ return incr_tag_release if @tag.name == tag
74
159
 
75
- test_section __FILE__ do
160
+ dest = new_tag_release tag
161
+ off = new_tag_release :off
162
+ if self < dest and dest <= off
163
+ dest
164
+ elsif off <= self and self < dest
165
+ dest
166
+ elsif self < off and off < dest
167
+ raise ArgumentError,
168
+ "You need to be at least on an official release (not #{self}) to go on #{dest}"
169
+ elsif dest < self
170
+ raise ArgumentError, "You cannot downgrade (#{self} to #{dest})"
171
+ else
172
+ raise ArgumentError, "Unhandled case: self=#{self}, dest=#{dest}, off=#{off}"
173
+ end
174
+ end
175
+
176
+ def patch_level_release
177
+ tag_release :p
178
+ end
179
+
180
+ def official_release
181
+ tag_release :off
182
+ end
76
183
 
184
+ def release_candidate
185
+ tag_release :rc
186
+ end
187
+
188
+ def pre_release
189
+ tag_release :pre
190
+ end
191
+
192
+ def beta_release
193
+ tag_release :beta
194
+ end
195
+
196
+ def alpha_release
197
+ tag_release :alpha
198
+ end
199
+
200
+ def release ( &block )
201
+ x = dup
202
+ x.instance_eval { block[self] }
203
+ x
204
+ end
205
+
206
+ class Tag
207
+ attr_accessor :name, :descr, :rank, :offset
208
+
209
+ def initialize ( name, descr, rank, offset )
210
+ @name, @descr, @rank, @offset = name, descr, rank, offset
211
+ end
212
+
213
+ def pp
214
+ (offset.zero?)? descr : "#{descr} ##{offset}"
215
+ end
216
+
217
+ def <=> ( other )
218
+ cmp = @rank <=> other.rank
219
+ return cmp unless cmp.zero?
220
+ @offset <=> other.offset
221
+ end
222
+
223
+ class << self
224
+ @@tags = {}
225
+ def [] ( name, offset )
226
+ f = @@tags[name]
227
+ raise ArgumentError, "Unknown tag ``#{name}''" if f.nil?
228
+ f[offset]
229
+ end
230
+ def tag ( name, descr, rank )
231
+ @@tags[name] = lambda { |offset| Tag.new(name, descr, rank, offset) }
232
+ end
233
+ end
234
+
235
+ tag :r, 'Revision', -5
236
+ tag :alpha, 'Alpha Release', -4
237
+ tag :beta, 'Beta Release', -3
238
+ tag :pre, 'Pre Release', -2
239
+ tag :rc, 'Release Candidate', -1
240
+ tag :off, 'Official Release', 0
241
+ tag :p, 'Official Release Patch Level', 1 # should always be followed by an int
242
+ end
243
+
244
+ module ShortCut
245
+ def ` ( arg )
246
+ Version.parse arg
247
+ end
248
+ end
249
+ end # class Version
250
+
251
+ test_section __FILE__ do
77
252
 
78
253
  class VersionTest < Test::Unit::TestCase
79
254
 
255
+
256
+ include Version::ShortCut
257
+
80
258
  def setup
81
- @a = Version.new(0, 1, 2, 3)
82
- @b = Version.new(2, 1, 0, 10)
83
- @c = Version.new(0, 0, 0, 0)
259
+ @a = Version.new(0, 1)
260
+ @b = Version.new(2, 0)
261
+ @c = Version.new(0, 0)
262
+ @a_rc2 = Version.new(0, 1, :rc, 2)
263
+ @b_p3 = Version.new(2, 0, :p, 3)
264
+ @a_alpha = Version.new(0, 1, :alpha)
265
+ @a_pre4 = Version.new(0, 1, :pre, 4)
266
+ @a_beta2 = Version.new(0, 1, :beta, 2)
267
+ @a_r463 = Version.new(0, 1, :r, 463)
84
268
  end
85
269
 
86
-
87
- def test_simple
88
- assert(Version.new(0, 1, 2, 3) < Version.new(0, 1, 2, 4))
89
- assert(Version.new(0, 1, 2, 4) > Version.new(0, 1, 2, 3))
90
- assert(Version.new(0, 1, 2, 3) == Version.new(0, 1, 2, 3))
91
- assert(Version.new(0, 1, 3, 3) > Version.new(0, 1, 2, 3))
92
- assert(Version.new(0, 1, 2, 3) < Version.new(0, 1, 3, 3))
93
- assert(Version.new(3, 2, 2, 3) > Version.new(3, 1, 2, 3))
94
- assert(Version.new(0, 1, 2, 3) < Version.new(0, 2, 2, 3))
95
- assert(Version.new(0, 3, 3, 3) < Version.new(1, 2, 2, 10))
270
+ def test_parse
271
+ assert_equal @a, Version.parse('0.1')
272
+ assert_equal @a_r463, Version.parse('0.1_r463')
273
+ assert_raise(ArgumentError) { Version.parse('0.1.2') }
274
+ assert_raise(ArgumentError) { Version.parse('0.1-r2') }
275
+ assert_raise(ArgumentError) { Version.parse('0.1.r2') }
276
+ assert_raise(ArgumentError) { Version.parse('0.1.3-r2') }
277
+ assert_raise(ArgumentError) { Version.parse('0.1.3.4') }
278
+ assert_equal @b, Version.parse('2.0')
279
+ assert_equal @c, Version.parse('0.0')
280
+ assert_equal @c, Version.parse('0')
281
+ assert_equal @a_rc2, Version.parse('0.1_rc2')
282
+ assert_equal @a_alpha, Version.parse('0.1_alpha')
283
+ assert_equal @a_alpha, Version.parse('0.1_alpha0')
284
+ assert_equal @b_p3, Version.parse('2.0_p3')
285
+ assert_equal @a_pre4, Version.parse('0.1_pre4')
286
+ assert_equal @a_beta2, Version.parse('0.1_beta2')
287
+ foo_bar = Version.new(1, 3, :r, 42144, 'dev-util', 'foo', 'bar')
288
+ assert_equal foo_bar, `dev-util/foo-1.3_r42144#bar`
289
+ foo_bar = Version.new(1, 3, :pre, 4, 'dev-util', 'foo', 'bar')
290
+ assert_equal foo_bar, `dev-util/foo-1.3_pre4#bar`
291
+ foo_bar = Version.new(1, 2, :pre, 4, '', 'foo', 'bar')
292
+ assert_equal foo_bar, `foo-1.2_pre4#bar`
293
+ foo = Version.new(1, 2, :pre, 4, '', 'foo')
294
+ assert_equal foo_bar, `foo-1.2_pre4#bar`
96
295
  end
97
296
 
98
- def checker ( my, meth, *ref )
99
- assert_equal(Version.new(*ref), my.send(meth), meth)
100
- assert_equal(Version.new(*ref), my, meth)
297
+ def test_comparison
298
+ assert `2.3` < `2.4`
299
+ assert `2.4` > `2.3`
300
+ assert `2.3` == `2.3`
301
+ assert `3.3` > `2.3`
302
+ assert `2.3` < `3.3`
303
+ assert `1.2_rc` < `1.2`
304
+ assert `1.2_p1` > `1.2`
305
+ assert `1.2_alpha` < `1.2_beta`
306
+ assert `1.2_pre` != `1.2`
307
+ assert `1.2_rc` == `1.2_rc0`
308
+ assert `1.3_pre` > `1.2_p12`
309
+ assert `1.3_alpha` > `1.2`
310
+ assert `3.2` > `2.12_p42`
311
+ assert `1.2_pre4` != `dev-util/foo-1.2_pre4#bar`
312
+ assert `dev-util/foo-1.2_pre4` == `dev-util/foo-1.2_pre4#bar`
101
313
  end
102
314
 
103
315
  def test_major_release
104
- checker(@a, :major_release, 1, 0, 0, 4)
105
- checker(@b, :major_release, 3, 0, 0, 11)
106
- checker(@c, :major_release, 1, 0, 0, 1)
316
+ assert_equal `1.0_alpha`, @a.major_release
317
+ assert_equal `3.0_alpha`, @b.major_release
318
+ assert_equal `1.0_alpha`, @c.major_release
319
+ assert_equal `1.0_alpha`, @a_rc2.major_release
320
+ assert_equal `3.0_alpha`, @b_p3.major_release
321
+ assert_equal `1.0_alpha`, @a_alpha.major_release
322
+ assert_equal `1.0_alpha`, @a_beta2.major_release
107
323
  end
108
324
 
109
325
  def test_minor_release
110
- checker(@a, :minor_release, 0, 2, 0, 4)
111
- checker(@b, :minor_release, 2, 2, 0, 11)
112
- checker(@c, :minor_release, 0, 1, 0, 1)
326
+ assert_equal `0.2_alpha`, @a.minor_release
327
+ assert_equal `2.1_alpha`, @b.minor_release
328
+ assert_equal `0.1_alpha`, @c.minor_release
329
+ assert_equal `0.2_alpha`, @a_rc2.minor_release
113
330
  end
114
331
 
115
- def test_build_release
116
- checker(@a, :build_release, 0, 1, 3, 4)
117
- checker(@b, :build_release, 2, 1, 1, 11)
118
- checker(@c, :build_release, 0, 0, 1, 1)
332
+ def test_tag_releases
333
+ assert_equal `0.2_p2`, `0.1`.minor_release.alpha_release.beta_release.
334
+ beta_release.pre_release.release_candidate.release_candidate.
335
+ official_release.patch_level_release.patch_level_release
336
+ assert_equal `0.2`, `0.1`.minor_release.official_release
337
+ assert_raise ArgumentError do
338
+ `0.1`.minor_release.official_release.official_release
339
+ end
340
+ assert_equal `1.0_rc1`, `0.9_p42`.major_release.alpha_release.
341
+ beta_release.release_candidate.release_candidate
342
+ assert_equal `1.0_alpha2`, `1.0_alpha1`.alpha_release
119
343
  end
120
344
 
121
345
  def test_pp
122
- assert_equal('0.1.2 (Revision: 3)', @a.pp)
123
- assert_equal('2.1.0 (Revision: 10)', @b.pp)
124
- assert_equal('0.0.0 (Revision: 0)', @c.pp)
346
+ assert_equal 'Revision #462: 0.1', `0.1_r462`.pp
347
+ assert_equal 'Official Release: 0.1', @a.pp
348
+ assert_equal 'Official Release: 2.0', @b.pp
349
+ assert_equal 'Official Release: 0.0', @c.pp
350
+ assert_equal 'Alpha Release: 0.1', @a_alpha.pp
351
+ assert_equal 'Official Release Patch Level #3: 2.0', @b_p3.pp
352
+ assert_equal 'Pre Release #4: 1.2 bar', `dev-util/foo-1.2_pre4#bar`.pp
353
+ end
354
+
355
+ def test_to_s
356
+ assert_equal '1.2_r3', `1.2_r3`.to_s
357
+ assert_equal '1.0_p5', `1_p5`.to_s
358
+ assert_equal 'dev-util/foo-1.2_pre4#bar', `dev-util/foo-1.2_pre4#bar`.to_s
359
+ end
360
+
361
+ def test_short_string
362
+ assert_equal '1.0', `1`.short_string
363
+ assert_equal '1.0_p5', `1_p5`.short_string
364
+ assert_equal 'foo-1.2_pre4', `dev-util/foo-1.2_pre4#bar`.short_string
125
365
  end
126
366
 
127
367
  end # class VersionTest
@@ -1,7 +1,7 @@
1
1
  # Copyright:: Copyright (c) 2005 Nicolas Pouillard. All rights reserved.
2
2
  # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>.
3
3
  # License:: Gnu General Public License.
4
- # Revision:: $Id: yaml_extension.rb 383 2005-10-02 16:48:09Z ertai $
4
+ # Revision:: $Id: /w/fey/ruby_ex/trunk/core_ex/lib/yaml_extension.rb 7988 2005-10-02T16:48:09.029068Z ertai $
5
5
 
6
6
  require 'yaml'
7
7
 
@@ -0,0 +1,6 @@
1
+ class A
2
+ class B
3
+ class C
4
+ end # class C
5
+ end # class B
6
+ end # class A
@@ -0,0 +1,2 @@
1
+ class A
2
+ end # class A
@@ -0,0 +1,4 @@
1
+ class B
2
+ class C
3
+ end # class C
4
+ end # class B
@@ -0,0 +1,2 @@
1
+ class B
2
+ end # class B
@@ -0,0 +1,2 @@
1
+ class Bouhou
2
+ end
@@ -0,0 +1,5 @@
1
+ class FooBar
2
+ def self.name
3
+ 'FooBar in double/a'
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Sub
2
+ module A
3
+ class Suba
4
+ end # class Suba
5
+ end # module A
6
+ end # module Sub
7
+
@@ -0,0 +1,6 @@
1
+ module Root
2
+ class Sub
3
+ module B
4
+ end # module B
5
+ end # class Sub
6
+ end # module Root
@@ -0,0 +1,4 @@
1
+ module Root
2
+ class Sub
3
+ end # module Sub
4
+ end # module Root
@@ -0,0 +1,2 @@
1
+ module Root
2
+ end # module Root
@@ -0,0 +1,4 @@
1
+ module FooBars
2
+ class FooBar
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module FooBars
2
+ module Mods
3
+ class Mod
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module FooBars
2
+ module Mods
3
+ class SubMod < Mod
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ module FooBars
2
+ module Mods
3
+ class SubSubMod < SubMod
4
+ end
5
+ end
6
+ end
7
+
@@ -0,0 +1,4 @@
1
+ module FooBars
2
+ module Mods
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module FooBars
2
+ class SubFooBar < FooBar
3
+ FOO = 42
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module FooBars
2
+ module Titis
3
+ class Tutu
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module FooBars
2
+ module Totos
3
+ class Tata
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module FooBars
2
+ NAME = 'foo'
3
+ # p NAME
4
+ end
@@ -0,0 +1,6 @@
1
+ class FooBar
2
+ end
3
+ module FooBars
4
+ class Boo < ::FooBars::FooBar
5
+ end
6
+ end
@@ -0,0 +1,11 @@
1
+ # This test does not load FooBars::FooBar, its a limitation.
2
+ class A
3
+ end
4
+ class FooBar
5
+ end
6
+ module FooBars
7
+ class B < A
8
+ end
9
+ class Boo < FooBar
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module FooBars
2
+ module Youhou
3
+ X = SubFooBar
4
+ end
5
+ end