padrino-core 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.5
1
+ 0.4.6
@@ -6,7 +6,8 @@ module Padrino
6
6
  @_called_from = first_caller
7
7
  load_required_gems # load bundler gems
8
8
  require_dependencies("#{root}/config/apps.rb", "#{root}/config/database.rb") # load configuration
9
- require_dependencies("#{root}/lib/**/*.rb", "#{root}/models/*.rb") # load root app dependencies
9
+ load_apps_models # load all models of our apps
10
+ require_dependencies("#{root}/lib/**/*.rb", "#{root}/models/**/*.rb") # load root app models
10
11
  Stat.reload! # We need to fill our Stat::CACHE but we do that only for development
11
12
  Thread.current[:padrino_loaded] = true
12
13
  end
@@ -57,30 +58,34 @@ module Padrino
57
58
  alias :load_dependency :load_dependencies
58
59
 
59
60
  protected
61
+ # Loads the vendored gems or system wide gems through Gemfile
62
+ def load_required_gems
63
+ require root('vendor', 'gems', 'environment')
64
+ Bundler.require_env(Padrino.env)
65
+ say! "=> Loaded bundled gems for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
66
+ rescue LoadError
67
+ require 'bundler'
68
+ if File.exist?(root("Gemfile"))
69
+ Bundler::Bundle.load(root("Gemfile")).environment.require_env(Padrino.env)
70
+ say! "=> Located Gemfile for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
71
+ else
72
+ say! "=> Gemfile for #{Padrino.env} not found!"
73
+ end
74
+ end
60
75
 
61
- # Loads the vendored gems or system wide gems through Gemfile
62
- def load_required_gems
63
- require root('vendor', 'gems', 'environment')
64
- Bundler.require_env(Padrino.env)
65
- say! "=> Loaded bundled gems for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
66
- rescue LoadError
67
- require 'bundler'
68
- if File.exist?(root("Gemfile"))
69
- Bundler::Dsl.load_gemfile(root("Gemfile")).require_env(Padrino.env)
70
- say! "=> Located Gemfile for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
71
- else
72
- say! "=> Gemfile for #{Padrino.env} not found!"
76
+ # Loads for each mounted applications their models
77
+ def load_apps_models
78
+ Padrino.mounted_apps.each { |mounted_app| load_dependencies("#{mounted_app.app_root}/models/**/*.rb") }
73
79
  end
74
- end
75
80
 
76
- # Prints out a message to the stdout if not in test environment
77
- def say(text)
78
- print text if Padrino.env != :test
79
- end
81
+ # Prints out a message to the stdout if not in test environment
82
+ def say(text)
83
+ print text if Padrino.env != :test
84
+ end
80
85
 
81
- # Puts out a message to the stdout if not in test environment
82
- def say!(text)
83
- puts text if Padrino.env != :test
84
- end
86
+ # Puts out a message to the stdout if not in test environment
87
+ def say!(text)
88
+ puts text if Padrino.env != :test
89
+ end
85
90
  end
86
91
  end
@@ -10,7 +10,7 @@ module Padrino
10
10
  @name = name.downcase
11
11
  @app_class = options[:app_class] || name.classify
12
12
  @app_file = options[:app_file] || locate_app_file
13
- @app_root = options[:app_root]
13
+ @app_root = options[:app_root] || File.dirname(@app_file)
14
14
  @app_obj = self.app_object
15
15
  end
16
16
 
data/padrino-core.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-core}
8
- s.version = "0.4.5"
8
+ s.version = "0.4.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
12
- s.date = %q{2010-01-06}
12
+ s.date = %q{2010-01-07}
13
13
  s.default_executable = %q{padrino}
14
14
  s.description = %q{The Padrino core gem required for use of this framework}
15
15
  s.email = %q{nesquena@gmail.com}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2010-01-06 00:00:00 +01:00
15
+ date: 2010-01-07 00:00:00 +01:00
16
16
  default_executable: padrino
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency