ivey-merb_has_rails_plugins 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/LICENSE +20 -0
  2. data/README +24 -0
  3. data/Rakefile +16 -0
  4. data/TODO +0 -0
  5. data/lib/merb_has_rails_plugins.rb +36 -0
  6. metadata +65 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2007 Michael D. Ivey
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,24 @@
1
+ merb_has_rails_plugins
2
+ =================
3
+
4
+ A plugin for the Merb framework that provides autoloading of Rails
5
+ plugins from plugins/ dir.
6
+
7
+ Please send bug reports to Michael Ivey directly for the time being:
8
+ ivey@gweezlebur.com or ivey on #merb
9
+
10
+
11
+ Configuration
12
+ =============
13
+
14
+ Merb::Plugins.config[:merb_has_rails_plugins]
15
+ :rails_env - Rails environment - probably want to leave this as the default: Merb.env
16
+ :rails_root - Path to your rails root (you may want to set this if your running a merb app within a rails app)
17
+ :plugins_root - Path to your rails plugins directory. Defaults to Merb.root / 'plugins'
18
+ :only - Optional array of the subset of plugins you want to load i.e. ['acts_as_hasselhoff', 'foo_fu']
19
+
20
+
21
+ Contributors
22
+ ============
23
+ Shay Arnett
24
+ James Bebbington
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ require 'rubygems'
2
+ require 'rake/gempackagetask'
3
+
4
+ spec = eval(File.read('merb_has_rails_plugins.gemspec'))
5
+
6
+ Rake::GemPackageTask.new(spec) do |pkg|
7
+ pkg.gem_spec = spec
8
+ end
9
+
10
+ task :install => [:package] do
11
+ sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
12
+ end
13
+
14
+ task :release => :package do
15
+ sh %{rubyforge add_release merb-plugins #{PLUGIN} #{VERSION} pkg/#{NAME}-#{VERSION}.gem}
16
+ end
data/TODO ADDED
File without changes
@@ -0,0 +1,36 @@
1
+ # make sure we're running inside Merb
2
+ if defined?(Merb::Plugins)
3
+
4
+ # :rails_env - Rails environment - probably want to leave this as the default: Merb.env
5
+ # :rails_root - Path to your rails root (you may want to set this if your running a merb app within a rails app)
6
+ # :plugins_root - Path to your rails plugins directory. Defaults to Merb.root / 'plugins'
7
+ # :only - Optional array of the subset of plugins you want to load i.e. ['acts_as_hasselhoff', 'foo_fu']
8
+ defaults = {
9
+ :rails_env => Merb.env,
10
+ :rails_root => nil,
11
+ :plugins_root => Merb.root / 'plugins',
12
+ :only => nil,
13
+ }
14
+ config = Merb::Plugins.config[:merb_has_rails_plugins]
15
+ config = defaults.merge(config)
16
+
17
+ RAILS_ENV = config[:rails_env] unless defined?(RAILS_ENV)
18
+ RAILS_ROOT = config[:rails_root] if config[:rails_root] && !defined?(RAILS_ROOT)
19
+
20
+ Merb.logger.info "loading rails plugins from '#{config[:plugins_root]}' ..."
21
+ Dir[config[:plugins_root] / '*'].each do |dir|
22
+ plugin = dir.split(File::SEPARATOR).last
23
+ if config[:only].blank? || config[:only].include?(plugin)
24
+ Merb.logger.info "loading rails plugin '#{plugin}' ..."
25
+ plugin_init, plugin_lib = dir / 'init.rb', dir / 'lib'
26
+ if File.directory?(plugin_lib)
27
+ if defined?(ActiveSupport)
28
+ Dependencies.load_paths << plugin_lib
29
+ Dependencies.load_once_paths << plugin_lib
30
+ end
31
+ $LOAD_PATH << plugin_lib
32
+ end
33
+ require plugin_init if File.exist?(plugin_init)
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ivey-merb_has_rails_plugins
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Michael D. Ivey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-06-30 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: merb-core
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">"
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.0
23
+ version:
24
+ description: Merb plugin that provides autoloading of Rails plugins from plugins/ dir
25
+ email: ivey@gweezlebur.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - LICENSE
34
+ - Rakefile
35
+ - README
36
+ - TODO
37
+ - lib/merb_has_rails_plugins.rb
38
+ has_rdoc: false
39
+ homepage: http://github.com/ivey/merb_has_rails_plugins
40
+ post_install_message:
41
+ rdoc_options: []
42
+
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ requirements: []
58
+
59
+ rubyforge_project:
60
+ rubygems_version: 1.2.0
61
+ signing_key:
62
+ specification_version: 2
63
+ summary: Merb plugin that provides autoloading of Rails plugins from plugins/ dir
64
+ test_files: []
65
+