Permalink
Browse files

Looking for plugins in lib/auto/* instead of lib/*

  • Loading branch information...
1 parent 5000c15 commit c058c954685264c4725226f46309f13cb2873677 @winton committed Nov 15, 2009
View
4 README.markdown
@@ -82,7 +82,7 @@ Authoring Plugins
Plugins have a lib directory just like any other gem. Here is how the lib file for the Foo plugin might look:
<pre>
-# lib/foo.rb
+# lib/auto/foo.rb
module Auto
module Foo
@@ -102,7 +102,7 @@ module Auto
end
</pre>
-Auto uses the gem name (<code>auto-foo</code>) to find <code>lib/foo.rb</code> and include <code>Auto::Foo</code> into the environment. Now you can call the <code>foo</code> method in any of your Auto scripts.
+Auto uses the gem name (<code>auto-foo</code>) to find <code>lib/auto/foo.rb</code> and include <code>Auto::Foo</code> into the environment. Now you can call the <code>foo</code> method in any of your Auto scripts.
Auto plugins must have gem names with <code>auto-</code> as a prefix to be automatically required.
View
4 gemspec.rb
@@ -7,13 +7,13 @@
s.homepage = "http://github.com/winton/#{GEM_NAME}"
s.summary = "Automate everything!"
# == CONFIGURE ==
+ s.add_dependency('auto-question', '=0.0.1')
s.add_dependency('auto-terminal', '=0.0.1')
- s.executables << GEM_NAME
s.extra_rdoc_files = [ "README.markdown" ]
s.files = GEM_FILES.to_a
s.has_rdoc = false
s.name = GEM_NAME
s.platform = Gem::Platform::RUBY
s.require_path = "lib"
- s.version = "0.1.1"
+ s.version = "0.1.2"
end
View
2 lib/auto/plugins.rb
@@ -84,7 +84,7 @@ def initialize(directory)
@name = name[name.index('auto') + 1]
# ~/.auto/auto-plugin/lib/plugin.rb
- @library = "#{directory}/lib/#{@name}.rb"
+ @library = "#{directory}/lib/auto/#{@name}.rb"
@library = nil unless File.exists?(@library)
# Auto::Plugin
View
4 spec/auto/plugins_spec.rb
@@ -15,8 +15,8 @@ module Auto
it "should provide an array of plugin library files" do
@libraries.should == [
- "#{@fixtures}/auto-plugin-0.0.0/lib/plugin.rb",
- "#{@fixtures}/auto-plugin2/lib/plugin2.rb"
+ "#{@fixtures}/auto-plugin-0.0.0/lib/auto/plugin.rb",
+ "#{@fixtures}/auto-plugin2/lib/auto/plugin2.rb"
]
end
View
4 spec/auto/runner_spec.rb
@@ -9,8 +9,8 @@ module Auto
end
it 'should require plugin library files' do
- $".include?("#{@fixtures}/auto-plugin-0.0.0/lib/plugin.rb").should == true
- $".include?("#{@fixtures}/auto-plugin2/lib/plugin2.rb").should == true
+ $".include?("#{@fixtures}/auto-plugin-0.0.0/lib/auto/plugin.rb").should == true
+ $".include?("#{@fixtures}/auto-plugin2/lib/auto/plugin2.rb").should == true
end
it 'should include all plugin library modules' do
View
0 spec/plugins/auto-plugin-0.0.0/lib/plugin.rb → ...gins/auto-plugin-0.0.0/lib/auto/plugin.rb
File renamed without changes.
View
0 spec/plugins/auto-plugin2/lib/plugin2.rb → .../plugins/auto-plugin2/lib/auto/plugin2.rb
File renamed without changes.

0 comments on commit c058c95

Please sign in to comment.