oasis 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,25 @@ module Oasis
44
44
 
45
45
  end
46
46
 
47
+
47
48
  module ::ActiveSupport::Dependencies #:nodoc:
48
49
  extend Oasis::Dependencies
50
+ end
51
+
52
+ class Object
53
+ # shortcut for requiring models from rails engines.
54
+ def require_model_from(app_name, constant_name)
55
+ require_from(app_name,"app/models/#{constant_name}")
56
+ end
57
+
58
+ # this can be used to require something deep within a rails engine so that it
59
+ # can be reopened properly. for instance, model files could now define
60
+ # require_from :plugin_name, "app/models/foobar"
61
+ # class Foobar
62
+ #
63
+ # def some_added_method ...
64
+ def require_from(app_name, path)
65
+ raise "#{app_name} has not been registered with Oasis." unless Oasis.apps[app_name]
66
+ eval(%Q{require "#{Oasis.apps[app_name].directory}/#{path}"})
67
+ end
49
68
  end
@@ -1,3 +1,3 @@
1
1
  module Oasis
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{oasis}
8
- s.version = "0.3.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Derek Perez", "Chris Eppstein"]
12
- s.date = %q{2009-12-29}
12
+ s.date = %q{2010-01-08}
13
13
  s.description = %q{a collection of enhancements for rails engines. Designed to work with Rails 2.3.}
14
14
  s.email = %q{derek@derekperez.com}
15
15
  s.extra_rdoc_files = [
@@ -22,15 +22,16 @@ Gem::Specification.new do |s|
22
22
  "LICENSE",
23
23
  "README.rdoc",
24
24
  "Rakefile",
25
- "VERSION",
26
25
  "lib/oasis.rb",
27
26
  "lib/oasis/app/list.rb",
28
27
  "lib/oasis/app/loader.rb",
29
28
  "lib/oasis/debug.rb",
30
29
  "lib/oasis/dependencies.rb",
30
+ "lib/oasis/development.rb",
31
31
  "lib/oasis/layout.rb",
32
32
  "lib/oasis/loader.rb",
33
33
  "lib/oasis/routes.rb",
34
+ "lib/oasis/version.rb",
34
35
  "oasis.gemspec",
35
36
  "test/fixtures/layout_tests/views/layouts/default_layout.html.erb",
36
37
  "test/fixtures/layout_tests/views/layouts/fancy_products.html.erb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Perez
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-12-30 00:00:00 -08:00
13
+ date: 2010-01-08 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency