padrino-core 0.6.1 → 0.6.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.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/lib/padrino-core/cli.rb +0 -2
- data/lib/padrino-core/loader.rb +1 -26
- data/lib/padrino-core/stat.rb +1 -1
- data/lib/padrino-core/support_lite.rb +2 -0
- data/lib/padrino-core.rb +23 -2
- data/padrino-core.gemspec +1 -1
- data/test/fixtures/apps/complex.rb +1 -1
- data/test/fixtures/apps/simple.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= padrino-core
|
1
|
+
= Padrino (padrino-core)
|
2
2
|
|
3
3
|
Padrino is the godfather of Sinatra.
|
4
4
|
|
@@ -417,4 +417,4 @@ Using these commands can simplify common tasks making development that much smoo
|
|
417
417
|
|
418
418
|
== Copyright
|
419
419
|
|
420
|
-
Copyright (c) 2010 Padrino. See LICENSE for details.
|
420
|
+
Copyright (c) 2010 Padrino. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/lib/padrino-core/cli.rb
CHANGED
@@ -41,8 +41,6 @@ module Padrino
|
|
41
41
|
method_option :environment, :type => :string, :aliases => "-e", :required => true, :default => :development
|
42
42
|
method_option :task_list, :type => :string, :aliases => "-T" # Only for accept rake
|
43
43
|
def rake(task="")
|
44
|
-
require 'padrino-core/support_lite'
|
45
|
-
require 'padrino-core/tasks'
|
46
44
|
boot = check_boot
|
47
45
|
return unless boot
|
48
46
|
require 'rake'
|
data/lib/padrino-core/loader.rb
CHANGED
@@ -4,7 +4,7 @@ module Padrino
|
|
4
4
|
def load!
|
5
5
|
return false if loaded?
|
6
6
|
@_called_from = first_caller
|
7
|
-
load_required_gems # load bundler gems
|
7
|
+
# load_required_gems # load bundler gems
|
8
8
|
require_dependencies("#{root}/lib/**/*.rb", "#{root}/models/**/*.rb") # load root app models
|
9
9
|
require_dependencies("#{root}/config/database.rb", "#{root}/config/apps.rb") # load configuration
|
10
10
|
Stat.reload! # We need to fill our Stat::CACHE but we do that only for development
|
@@ -56,30 +56,5 @@ module Padrino
|
|
56
56
|
end
|
57
57
|
alias :load_dependency :load_dependencies
|
58
58
|
|
59
|
-
protected
|
60
|
-
# Loads the vendored gems or system wide gems through Gemfile
|
61
|
-
def load_required_gems
|
62
|
-
require root('vendor', 'gems', 'environment')
|
63
|
-
Bundler.require_env(Padrino.env)
|
64
|
-
say! "=> Loaded bundled gems for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
|
65
|
-
rescue LoadError
|
66
|
-
require 'bundler'
|
67
|
-
if File.exist?(root("Gemfile"))
|
68
|
-
Bundler::Bundle.load(root("Gemfile")).environment.require_env(Padrino.env)
|
69
|
-
say! "=> Located Gemfile for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
|
70
|
-
else
|
71
|
-
say! "=> Gemfile for #{Padrino.env} not found!"
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
# Prints out a message to the stdout if not in test environment
|
76
|
-
def say(text)
|
77
|
-
print text if Padrino.env != :test
|
78
|
-
end
|
79
|
-
|
80
|
-
# Puts out a message to the stdout if not in test environment
|
81
|
-
def say!(text)
|
82
|
-
puts text if Padrino.env != :test
|
83
|
-
end
|
84
59
|
end
|
85
60
|
end
|
data/lib/padrino-core/stat.rb
CHANGED
@@ -19,6 +19,7 @@ Required for Padrino to run:
|
|
19
19
|
|
20
20
|
=end
|
21
21
|
require 'i18n'
|
22
|
+
|
22
23
|
# Load our locales
|
23
24
|
I18n.load_path += Dir["#{File.dirname(__FILE__)}/locale/*.yml"]
|
24
25
|
|
@@ -28,6 +29,7 @@ module Padrino
|
|
28
29
|
def self.support
|
29
30
|
@_padrino_support
|
30
31
|
end
|
32
|
+
|
31
33
|
end
|
32
34
|
|
33
35
|
if defined?(Extlib) # load if already using extlib
|
data/lib/padrino-core.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
require 'usher'
|
2
2
|
require 'sinatra/base'
|
3
3
|
|
4
|
-
Dir[File.dirname(__FILE__) + '/padrino-core/*.rb'].each {|file| require file }
|
5
|
-
|
6
4
|
# Defines our PADRINO_ENV
|
7
5
|
PADRINO_ENV = ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= "development" unless defined?(PADRINO_ENV)
|
8
6
|
|
@@ -30,4 +28,27 @@ module Padrino
|
|
30
28
|
self.mounted_apps.each { |app| app.map_onto(builder) }
|
31
29
|
builder
|
32
30
|
end
|
31
|
+
|
32
|
+
# Method used for require dependencies and correct support_lite
|
33
|
+
def self.require_dependencies!
|
34
|
+
require root('vendor', 'gems', 'environment')
|
35
|
+
Bundler.require_env(Padrino.env)
|
36
|
+
Dir[File.dirname(__FILE__) + '/padrino-core/*.rb'].each {|file| require file }
|
37
|
+
puts "=> Loaded bundled gems for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
|
38
|
+
rescue LoadError
|
39
|
+
require 'bundler'
|
40
|
+
if File.exist?(root("Gemfile"))
|
41
|
+
Bundler::Bundle.load(root("Gemfile")).environment.require_env(Padrino.env)
|
42
|
+
Dir[File.dirname(__FILE__) + '/padrino-core/*.rb'].each {|file| require file }
|
43
|
+
puts "=> Located Gemfile for #{Padrino.env} with #{Padrino.support.to_s.humanize}"
|
44
|
+
else
|
45
|
+
Dir[File.dirname(__FILE__) + '/padrino-core/*.rb'].each {|file| require file }
|
46
|
+
end
|
47
|
+
end
|
33
48
|
end
|
49
|
+
|
50
|
+
# When we require this file is necessary check if we have a gemfile o bundled gems,
|
51
|
+
# this because we load ExtLib or ActiveSupport if some of our dependencies
|
52
|
+
# just require them. This prevent for example to load ActiveSupport
|
53
|
+
# when we require only 'dm-core'.
|
54
|
+
Padrino.require_dependencies!
|
data/padrino-core.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{padrino-core}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.2"
|
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"]
|