require-me 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/folder/folder.rb +4 -0
- data/lib/folder/magic.rb +7 -2
- data/spec/dsl/blup.rb +1 -0
- data/spec/dsl/require-dsl_spec.rb +2 -0
- metadata +4 -2
data/lib/folder/folder.rb
CHANGED
@@ -71,6 +71,10 @@ module Folder
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
def self.require_all_here(file_name)
|
75
|
+
require_all File.dirname(file_name)
|
76
|
+
end
|
77
|
+
|
74
78
|
def self.show_require_all(*folders)
|
75
79
|
return Magic.new.all.dup.extend(MagicList).show_require if folders.empty?
|
76
80
|
folders.each do |folder|
|
data/lib/folder/magic.rb
CHANGED
@@ -51,7 +51,8 @@ module Folder
|
|
51
51
|
magic_list(list)
|
52
52
|
end
|
53
53
|
|
54
|
-
def require_all(*folders)
|
54
|
+
def require_all(*folders)
|
55
|
+
return require_all_here(folders[0]) if folders.size == 1 && folders[0] =~ '.rb'
|
55
56
|
relative = {:relative_to => relative_path || ''}
|
56
57
|
relative = folders.pop if folders && !folders.empty? && folders.last.kind_of?(Hash)
|
57
58
|
|
@@ -78,8 +79,12 @@ module Folder
|
|
78
79
|
file.do_require(relative_path)
|
79
80
|
end
|
80
81
|
|
81
|
-
|
82
|
+
def require_all_here(file_name)
|
83
|
+
require_all File.dirname(file_name)
|
84
|
+
end
|
82
85
|
|
86
|
+
protected
|
87
|
+
|
83
88
|
def relative_to(folder, relative)
|
84
89
|
# puts "relative_to: #{relative.inspect}"
|
85
90
|
# puts "relative_to: #{relative[:relative_to]}"
|
data/spec/dsl/blup.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
puts "Blup included"
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
8
|
+
- 4
|
9
|
+
version: 0.7.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- README.markdown
|
69
69
|
- spec/blip.rb
|
70
70
|
- spec/dsl/blap.rb
|
71
|
+
- spec/dsl/blup.rb
|
71
72
|
- spec/dsl/require-dsl_spec.rb
|
72
73
|
- spec/require_more_spec.rb
|
73
74
|
- spec/spec_helper.rb
|
@@ -110,6 +111,7 @@ summary: Facilitates requiring select ruby files in folders
|
|
110
111
|
test_files:
|
111
112
|
- spec/blip.rb
|
112
113
|
- spec/dsl/blap.rb
|
114
|
+
- spec/dsl/blup.rb
|
113
115
|
- spec/dsl/require-dsl_spec.rb
|
114
116
|
- spec/require_more_spec.rb
|
115
117
|
- spec/spec_helper.rb
|