auto 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/gemspec.rb +1 -1
- data/lib/auto/plugins.rb +6 -1
- data/lib/auto/runner.rb +13 -8
- data/spec/auto/plugins_spec.rb +1 -1
- data/spec/auto/runner_spec.rb +1 -1
- metadata +1 -1
data/gemspec.rb
CHANGED
data/lib/auto/plugins.rb
CHANGED
@@ -14,8 +14,13 @@ module Auto
|
|
14
14
|
|
15
15
|
class <<self
|
16
16
|
|
17
|
-
# Add a
|
17
|
+
# Add a plugin base directory
|
18
18
|
def add(path)
|
19
|
+
Runner.require! Plugin.new(path)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Add a directory to the plugin load paths.
|
23
|
+
def add_directory(path)
|
19
24
|
@@directories = [] if $testing
|
20
25
|
@@directories << path
|
21
26
|
@@directories.uniq!
|
data/lib/auto/runner.rb
CHANGED
@@ -21,15 +21,20 @@ module Auto
|
|
21
21
|
|
22
22
|
class <<self
|
23
23
|
|
24
|
-
def require!
|
24
|
+
def require!(plugin=nil)
|
25
|
+
require_all! and return unless plugin
|
26
|
+
if plugin.library
|
27
|
+
require plugin.library
|
28
|
+
end
|
29
|
+
begin
|
30
|
+
include eval(plugin.module)
|
31
|
+
rescue
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def require_all!
|
25
36
|
Plugins.plugins.each do |plugin|
|
26
|
-
|
27
|
-
require plugin.library
|
28
|
-
end
|
29
|
-
begin
|
30
|
-
include eval(plugin.module)
|
31
|
-
rescue
|
32
|
-
end
|
37
|
+
require! plugin
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
data/spec/auto/plugins_spec.rb
CHANGED
data/spec/auto/runner_spec.rb
CHANGED