require-me 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/require-dsl.rb +12 -0
- data/spec/require-dsl_spec.rb +12 -1
- metadata +1 -1
data/lib/require-dsl.rb
CHANGED
@@ -12,6 +12,18 @@ module Folder
|
|
12
12
|
end
|
13
13
|
m.exit
|
14
14
|
end
|
15
|
+
|
16
|
+
def self.require_all(*folders)
|
17
|
+
return Magic.new.all.dup.extend(MagicList).do_require if folders.empty?
|
18
|
+
folders.each do |folder|
|
19
|
+
enter folder do |f|
|
20
|
+
f.all.dup.extend(MagicList).do_require
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
|
15
27
|
|
16
28
|
module MagicList
|
17
29
|
attr_accessor :base_path
|
data/spec/require-dsl_spec.rb
CHANGED
@@ -28,10 +28,21 @@ describe "RequireMagic" do
|
|
28
28
|
|
29
29
|
it "works with require_all " do
|
30
30
|
Folder.enter('fixtures/game') do |folder|
|
31
|
-
puts "Current 1:" + folder.current_path
|
31
|
+
puts "Current 1:" + folder.current_path
|
32
32
|
folder.require_all 'graphics', 'network', 'sound'
|
33
33
|
end
|
34
34
|
end
|
35
|
+
|
36
|
+
it "works with require_all " do
|
37
|
+
Folder.enter 'fixtures' do |f|
|
38
|
+
f.require_all
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "works with require_all " do
|
43
|
+
Folder.require_all 'fixtures'
|
44
|
+
end
|
45
|
+
|
35
46
|
|
36
47
|
it "works with base folder " do
|
37
48
|
Folder.enter 'fixtures' do |folder|
|