padrino-core 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
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
1
+ 0.6.2
@@ -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'
@@ -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
@@ -30,7 +30,7 @@ module Padrino
30
30
 
31
31
  # A safe Kernel::load, issuing the hooks depending on the results
32
32
  def safe_load(file, mtime)
33
- Padrino.say! "=> Reloading #{file}"
33
+ logger.debug "Reloading #{file}"
34
34
  load(file)
35
35
  file
36
36
  rescue LoadError, SyntaxError => ex
@@ -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.1"
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"]
@@ -21,7 +21,7 @@ Complex1Demo.controllers do
21
21
  end
22
22
 
23
23
  Complex2Demo.controllers do
24
- get("(/)"){ "The magick number is: 53!" } # Change only the number!!!
24
+ get("(/)"){ "The magick number is: 78!" } # Change only the number!!!
25
25
  end
26
26
 
27
27
  Padrino.load!
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  SimpleDemo.controllers do
13
13
  get "/" do
14
- 'The magick number is: 43!' # Change only the number!!!
14
+ 'The magick number is: 45!' # Change only the number!!!
15
15
  end
16
16
  end
17
17
 
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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team