radiant 1.1.0.beta → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTORS.md +6 -0
- data/Gemfile +6 -5
- data/Gemfile.lock +2 -2
- data/GemfileRails3 +37 -0
- data/app/controllers/site_controller.rb +31 -7
- data/app/helpers/application_helper.rb +4 -4
- data/app/models/deprecated_tags.rb +8 -1
- data/app/models/page.rb +21 -9
- data/app/models/radiant/page_response_cache_director.rb +43 -0
- data/app/models/standard_tags.rb +34 -32
- data/app/views/admin/pages/_fields.html.haml +1 -1
- data/app/views/admin/pages/_node.html.haml +1 -1
- data/config/compass.config +0 -3
- data/config/initializers/tmp.rb +2 -0
- data/config/preinitializer.rb +15 -16
- data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +1 -1
- data/lib/generators/instance/templates/instance_gemfile +9 -5
- data/lib/radiant.rb +1 -1
- data/lib/radiant/engine.rb +10 -0
- data/lib/radiant/extension.rb +1 -10
- data/lib/radiant/initializer.rb +1 -0
- data/lib/radiant/task_support.rb +66 -0
- data/lib/tasks/framework.rake +1 -1
- data/lib/tasks/radiant_config.rake +3 -3
- data/lib/tasks/release.rake +1 -1
- data/public/javascripts/admin/page_preview.js +1 -1
- data/public/javascripts/admin/pagefield.js +1 -1
- data/public/javascripts/admin/shortcuts.js +7 -1
- data/radiant.gemspec +2 -1
- data/rails/init.rb +1 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/dummy/log/test.log +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +202 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/fixtures/example_extension/example_extension.rb +0 -4
- data/spec/lib/radiant/extension_spec.rb +0 -8
- data/spec/lib/task_support_spec.rb +13 -13
- data/spec/models/deprecated_tags_spec.rb +8 -1
- data/spec/models/radiant/page_response_cache_director_spec.rb +83 -0
- data/spec/models/standard_tags_spec.rb +10 -7
- data/spec/spec_helper_rails_3.rb +15 -0
- metadata +105 -53
- data/config/initializers/compass.rb +0 -6
- data/lib/plugins/extension_patches/init.rb +0 -1
- data/lib/plugins/extension_patches/lib/routing_extension.rb +0 -31
- data/lib/task_support.rb +0 -64
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Edge
|
4
4
|
|
5
|
+
* Allow loading of snippets from the file system [Jim Gay]
|
6
|
+
* Moved to compass-rails [Jim Gay]
|
7
|
+
* Fixed avatar tags for HTTP and HTTPS [Sam Whited]
|
8
|
+
* Updated r:date and deprecated r:rfc1123_date [Sam Whited]
|
9
|
+
* Address UTF-8 params encoding in 1.9 [Johannes Fahrenkrug]
|
10
|
+
|
11
|
+
## 1.0.1 (March 6, 2012)
|
12
|
+
|
5
13
|
* Ruby 1.9.3 compatibility [Jim Gay]
|
6
14
|
* Allow page menus to be overridden by additional modules [Jim Gay]
|
7
15
|
* Add migration to not crop page part content > 64kB in MySql and MSSQL [Benny Degezelle]
|
data/CONTRIBUTORS.md
CHANGED
data/Gemfile
CHANGED
@@ -8,7 +8,7 @@ source :rubygems
|
|
8
8
|
# dependency mentioned in radiant.gemspec.
|
9
9
|
|
10
10
|
gem "rails", "2.3.14"
|
11
|
-
gem "sqlite3", "1.3.
|
11
|
+
gem "sqlite3", "1.3.5", :group => [:development, :test], :platform => :ruby
|
12
12
|
|
13
13
|
# When radiant is installed as a gem you can run all of
|
14
14
|
# its tests and specs from an instance. If you're working
|
@@ -17,16 +17,17 @@ gem "sqlite3", "1.3.4", :group => [:development, :test], :platform => :ruby
|
|
17
17
|
# run `bundle install`.
|
18
18
|
|
19
19
|
# gemspec
|
20
|
+
# gem "compass-rails", "~> 1.0.3"
|
21
|
+
|
20
22
|
# gem "radiant-archive-extension", "~> 1.0.7"
|
21
|
-
# gem "radiant-clipped-extension", "~> 1.0
|
23
|
+
# gem "radiant-clipped-extension", "~> 1.1.0"
|
22
24
|
# gem "radiant-debug-extension", "~> 1.0.2"
|
23
25
|
# gem "radiant-exporter-extension", "~> 1.1.0"
|
24
26
|
# gem "radiant-markdown_filter-extension", "~> 1.0.2"
|
25
|
-
# gem "radiant-sheets-extension", "~> 1.0.
|
26
|
-
# gem "radiant-snippets-extension", "~> 1.0.
|
27
|
+
# gem "radiant-sheets-extension", "~> 1.1.0.alpha"
|
28
|
+
# gem "radiant-snippets-extension", "~> 1.1.0.alpha"
|
27
29
|
# gem "radiant-site_templates-extension", "~> 1.0.4"
|
28
30
|
# gem "radiant-smarty_pants_filter-extension", "~> 1.0.2"
|
29
|
-
# gem "radiant-snippets-extension", "~> 1.0.0"
|
30
31
|
# gem "radiant-textile_filter-extension", "~> 1.0.4"
|
31
32
|
|
32
33
|
if ENV['TRAVIS']
|
data/Gemfile.lock
CHANGED
data/GemfileRails3
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
# This is the minimum of dependency required to run
|
4
|
+
# the radiant instance generator, which is (normally)
|
5
|
+
# the only time the radiant gem functions as an
|
6
|
+
# application. The instance has its own Gemfile, which
|
7
|
+
# requires radiant and therefore pulls in every
|
8
|
+
# dependency mentioned in radiant.gemspec.
|
9
|
+
|
10
|
+
gem "rails", "3.2.8"
|
11
|
+
gem "sqlite3", "1.3.5", :group => [:development, :test], :platform => :ruby
|
12
|
+
|
13
|
+
# When radiant is installed as a gem you can run all of
|
14
|
+
# its tests and specs from an instance. If you're working
|
15
|
+
# on radiant itself and you want to run specs from the
|
16
|
+
# radiant root directory, uncomment the lines below and
|
17
|
+
# run `bundle install`.
|
18
|
+
|
19
|
+
gemspec
|
20
|
+
# gem "compass-rails", "~> 1.0.3"
|
21
|
+
|
22
|
+
# gem "radiant-archive-extension", "~> 1.0.7"
|
23
|
+
# gem "radiant-clipped-extension", "~> 1.1.0"
|
24
|
+
# gem "radiant-debug-extension", "~> 1.0.2"
|
25
|
+
# gem "radiant-exporter-extension", "~> 1.1.0"
|
26
|
+
# gem "radiant-markdown_filter-extension", "~> 1.0.2"
|
27
|
+
# gem "radiant-sheets-extension", "~> 1.1.0.alpha"
|
28
|
+
# gem "radiant-snippets-extension", "~> 1.1.0.alpha"
|
29
|
+
# gem "radiant-site_templates-extension", "~> 1.0.4"
|
30
|
+
# gem "radiant-smarty_pants_filter-extension", "~> 1.0.2"
|
31
|
+
# gem "radiant-textile_filter-extension", "~> 1.0.4"
|
32
|
+
|
33
|
+
if ENV['TRAVIS']
|
34
|
+
gemspec :development_group => :test
|
35
|
+
gem "mysql"
|
36
|
+
gem "pg"
|
37
|
+
end
|
@@ -3,10 +3,12 @@ class SiteController < ApplicationController
|
|
3
3
|
|
4
4
|
skip_before_filter :verify_authenticity_token
|
5
5
|
no_login_required
|
6
|
-
cattr_writer :cache_timeout
|
7
6
|
|
7
|
+
def self.cache_timeout=(val)
|
8
|
+
Radiant::PageResponseCacheDirector.cache_timeout=(val)
|
9
|
+
end
|
8
10
|
def self.cache_timeout
|
9
|
-
|
11
|
+
Radiant::PageResponseCacheDirector.cache_timeout
|
10
12
|
end
|
11
13
|
|
12
14
|
def show_page
|
@@ -28,6 +30,21 @@ class SiteController < ApplicationController
|
|
28
30
|
redirect_to welcome_url
|
29
31
|
end
|
30
32
|
|
33
|
+
def cacheable_request?
|
34
|
+
(request.head? || request.get?) && live?
|
35
|
+
end
|
36
|
+
hide_action :cacheable_request?
|
37
|
+
|
38
|
+
def set_expiry(time, options={})
|
39
|
+
expires_in time, options
|
40
|
+
end
|
41
|
+
hide_action :set_expiry
|
42
|
+
|
43
|
+
def set_etag(val)
|
44
|
+
headers['ETag'] = val
|
45
|
+
end
|
46
|
+
hide_action :set_expiry
|
47
|
+
|
31
48
|
private
|
32
49
|
def batch_page_status_refresh
|
33
50
|
@changed_pages = []
|
@@ -44,12 +61,19 @@ class SiteController < ApplicationController
|
|
44
61
|
end
|
45
62
|
|
46
63
|
def set_cache_control
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
64
|
+
response_cache_director(@page).set_cache_control
|
65
|
+
end
|
66
|
+
|
67
|
+
def response_cache_director(page)
|
68
|
+
klass_name = "Radiant::#{page.class}ResponseCacheDirector"
|
69
|
+
begin
|
70
|
+
klass = klass_name.constantize
|
71
|
+
rescue NameError, LoadError
|
72
|
+
director_klass = "Radiant::PageResponseCacheDirector"
|
73
|
+
eval(%Q{class #{klass_name} < #{director_klass}; end}, TOPLEVEL_BINDING)
|
74
|
+
klass = director_klass.constantize
|
52
75
|
end
|
76
|
+
klass.new(page, self)
|
53
77
|
end
|
54
78
|
|
55
79
|
def find_page(url)
|
@@ -186,14 +186,14 @@ module ApplicationHelper
|
|
186
186
|
|
187
187
|
# Default image url to be used when no gravatar is found
|
188
188
|
# or when an image exceeds the rating parameter.
|
189
|
-
default_avatar_url = "#{request.protocol}#{request.host_with_port}/images/admin/avatar_#{([options[:size].to_i] * 2).join('x')}.png"
|
189
|
+
default_avatar_url = "#{request.protocol}#{request.host_with_port}#{ActionController::Base.relative_url_root}/images/admin/avatar_#{([options[:size].to_i] * 2).join('x')}.png"
|
190
190
|
options[:default] ||= default_avatar_url
|
191
191
|
|
192
192
|
unless email.blank?
|
193
193
|
# Build the Gravatar url.
|
194
|
-
url = '
|
195
|
-
url << "
|
196
|
-
url << "
|
194
|
+
url = '//gravatar.com/avatar/'
|
195
|
+
url << "#{Digest::MD5.new.update(email)}?"
|
196
|
+
url << "rating=#{options[:rating]}" if options[:rating]
|
197
197
|
url << "&size=#{options[:size]}" if options[:size]
|
198
198
|
url << "&default=#{options[:default]}" if options[:default]
|
199
199
|
url
|
@@ -30,5 +30,12 @@ module DeprecatedTags
|
|
30
30
|
keywords
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
deprecated_tag "rfc1123_date", :deadline => '2.0' do |tag|
|
35
|
+
page = tag.locals.page
|
36
|
+
if date = page.published_at || page.created_at
|
37
|
+
CGI.rfc1123_date(date.to_time)
|
38
|
+
end
|
39
|
+
end
|
33
40
|
|
34
|
-
end
|
41
|
+
end
|
data/app/models/page.rb
CHANGED
@@ -69,11 +69,6 @@ class Page < ActiveRecord::Base
|
|
69
69
|
end
|
70
70
|
alias_method :child_url, :child_path
|
71
71
|
|
72
|
-
def headers
|
73
|
-
# Return a blank hash that child classes can override or merge
|
74
|
-
{ }
|
75
|
-
end
|
76
|
-
|
77
72
|
def part(name)
|
78
73
|
if new_record? or parts.to_a.any?(&:new_record?)
|
79
74
|
parts.to_a.find {|p| p.name == name.to_s }
|
@@ -129,14 +124,31 @@ class Page < ActiveRecord::Base
|
|
129
124
|
|
130
125
|
def process(request, response)
|
131
126
|
@request, @response = request, response
|
127
|
+
set_response_headers(@response)
|
128
|
+
@response.body = render
|
129
|
+
@response.status = response_code
|
130
|
+
end
|
131
|
+
|
132
|
+
def headers
|
133
|
+
# Return a blank hash that child classes can override or merge
|
134
|
+
{ }
|
135
|
+
end
|
136
|
+
|
137
|
+
def set_response_headers(response)
|
138
|
+
set_content_type(response)
|
139
|
+
headers.each { |k,v| response.headers[k] = v }
|
140
|
+
end
|
141
|
+
private :set_response_headers
|
142
|
+
|
143
|
+
def set_content_type(response)
|
132
144
|
if layout
|
133
145
|
content_type = layout.content_type.to_s.strip
|
134
|
-
|
146
|
+
if content_type.present?
|
147
|
+
response.headers['Content-Type'] = content_type
|
148
|
+
end
|
135
149
|
end
|
136
|
-
headers.each { |k,v| @response.headers[k] = v }
|
137
|
-
@response.body = render
|
138
|
-
@response.status = response_code
|
139
150
|
end
|
151
|
+
private :set_content_type
|
140
152
|
|
141
153
|
def response_code
|
142
154
|
200
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Radiant
|
2
|
+
class PageResponseCacheDirector
|
3
|
+
def initialize(page, listener)
|
4
|
+
@page = page
|
5
|
+
@listener = listener
|
6
|
+
end
|
7
|
+
|
8
|
+
def set_cache_control
|
9
|
+
cacheable? ? cacheable_response : non_cacheable_response
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def cache_timeout
|
14
|
+
@cache_timeout ||= 5.minutes
|
15
|
+
end
|
16
|
+
|
17
|
+
def cache_timeout=(val)
|
18
|
+
@cache_timeout = val
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def non_cacheable_response
|
25
|
+
@listener.set_expiry nil, :private => true, "no-cache" => true
|
26
|
+
@listener.set_etag('')
|
27
|
+
end
|
28
|
+
|
29
|
+
def cacheable_response
|
30
|
+
timeout = self.class.cache_timeout
|
31
|
+
if @page.respond_to?(:cache_timeout)
|
32
|
+
timeout = @page.cache_timeout
|
33
|
+
end
|
34
|
+
|
35
|
+
@listener.set_expiry timeout, :public => true, :private => false
|
36
|
+
end
|
37
|
+
|
38
|
+
def cacheable?
|
39
|
+
@listener.cacheable_request? && @page.cache?
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
data/app/models/standard_tags.rb
CHANGED
@@ -734,9 +734,9 @@ module StandardTags
|
|
734
734
|
email = User.find_by_name(name).email
|
735
735
|
default = "#{request.protocol}#{request.host_with_port}/images/admin/avatar_#{([size.to_i] * 2).join('x')}.png"
|
736
736
|
unless email.blank?
|
737
|
-
url = '
|
738
|
-
url << "
|
739
|
-
url << "
|
737
|
+
url = '//gravatar.com/avatar/'
|
738
|
+
url << "#{Digest::MD5.new.update(email)}?"
|
739
|
+
url << "rating=#{rating}"
|
740
740
|
url << "&size=#{size.to_i}"
|
741
741
|
url << "&default=#{default}"
|
742
742
|
url
|
@@ -747,10 +747,11 @@ module StandardTags
|
|
747
747
|
|
748
748
|
desc %{
|
749
749
|
Renders the date based on the current page (by default when it was published or created).
|
750
|
-
The format attribute uses the same formating codes used by the Ruby @strftime@ function.
|
751
|
-
default it's set to @%A, %B %d, %Y@.
|
752
|
-
|
753
|
-
|
750
|
+
The format attribute uses the same formating codes used by the Ruby @strftime@ function.
|
751
|
+
By default it's set to @%A, %B %d, %Y@. You may also use the string @rfc1123@ as a shortcut
|
752
|
+
for @%a, %d %b %Y %H:%M:%S GMT@ (non-localized). The @for@ attribute selects which date to
|
753
|
+
render. Valid options are @published_at@, @created_at@, @updated_at@, and @now@. @now@ will
|
754
|
+
render the current date/time, regardless of the page.
|
754
755
|
|
755
756
|
*Usage:*
|
756
757
|
|
@@ -772,9 +773,14 @@ module StandardTags
|
|
772
773
|
else
|
773
774
|
page.published_at || page.created_at
|
774
775
|
end
|
775
|
-
|
776
|
+
case format
|
777
|
+
when 'rfc1123'
|
778
|
+
CGI.rfc1123_date(date.to_time)
|
779
|
+
else
|
780
|
+
@i18n_date_format_keys ||= (I18n.config.backend.send(:translations)[I18n.locale][:date][:formats].keys rescue [])
|
776
781
|
format = @i18n_date_format_keys.include?(format.to_sym) ? format.to_sym : format
|
777
|
-
|
782
|
+
I18n.l date, :format => format
|
783
|
+
end
|
778
784
|
end
|
779
785
|
|
780
786
|
desc %{
|
@@ -896,20 +902,6 @@ module StandardTags
|
|
896
902
|
CGI.escapeHTML(tag.expand)
|
897
903
|
end
|
898
904
|
|
899
|
-
desc %{
|
900
|
-
Outputs the published date using the format mandated by RFC 1123. (Ideal for RSS feeds.)
|
901
|
-
|
902
|
-
*Usage:*
|
903
|
-
|
904
|
-
<pre><code><r:rfc1123_date /></code></pre>
|
905
|
-
}
|
906
|
-
tag "rfc1123_date" do |tag|
|
907
|
-
page = tag.locals.page
|
908
|
-
if date = page.published_at || page.created_at
|
909
|
-
CGI.rfc1123_date(date.to_time)
|
910
|
-
end
|
911
|
-
end
|
912
|
-
|
913
905
|
desc %{
|
914
906
|
Renders a list of links specified in the @paths@ attribute according to three
|
915
907
|
states:
|
@@ -1127,15 +1119,25 @@ module StandardTags
|
|
1127
1119
|
tag 'site' do |tag|
|
1128
1120
|
tag.expand
|
1129
1121
|
end
|
1130
|
-
%
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1122
|
+
desc %{
|
1123
|
+
Returns Radiant::Config['site.title'] as configured under the Settings tab.
|
1124
|
+
}
|
1125
|
+
tag "site:title" do |tag|
|
1126
|
+
Radiant::Config["site.title"]
|
1127
|
+
end
|
1128
|
+
desc %{
|
1129
|
+
Returns Radiant::Config['site.host'] as configured under the Settings tab.
|
1130
|
+
}
|
1131
|
+
tag "site:host" do |tag|
|
1132
|
+
Radiant::Config["site.host"]
|
1133
|
+
end
|
1134
|
+
desc %{
|
1135
|
+
Returns Radiant::Config['dev.host'] as configured under the Settings tab.
|
1136
|
+
}
|
1137
|
+
tag "site:dev_host" do |tag|
|
1138
|
+
Radiant::Config["dev.host"]
|
1139
|
+
end
|
1140
|
+
|
1139
1141
|
private
|
1140
1142
|
def render_children_with_pagination(tag, opts={})
|
1141
1143
|
if opts[:aggregate]
|
@@ -60,7 +60,7 @@
|
|
60
60
|
= t('or')
|
61
61
|
= link_to t('cancel'), admin_pages_url
|
62
62
|
#preview_panel.fullcover.grey_out{:style => 'display: none;'}
|
63
|
-
%iframe{:id => 'page-preview', :class => 'fullcover', :name => 'page-preview', :src => '/loading-iframe.html', :frameborder => 0, :scrolling => "auto"}
|
63
|
+
%iframe{:id => 'page-preview', :class => 'fullcover', :name => 'page-preview', :src => ActionController::Base.relative_url_root.to_s + '/loading-iframe.html', :frameborder => 0, :scrolling => "auto"}
|
64
64
|
.preview_tools
|
65
65
|
=submit_tag(t('buttons.save_changes'), :class => 'big save_changes')
|
66
66
|
=submit_tag(t('buttons.save_and_continue'), :class => 'big save_and_continue', :name => 'continue')
|
@@ -7,7 +7,7 @@
|
|
7
7
|
= icon
|
8
8
|
= node_title
|
9
9
|
- else
|
10
|
-
= expander(level) + link_to("#{icon} #{node_title}", edit_admin_page_url(page), :title => page.
|
10
|
+
= expander(level) + link_to("#{icon} #{node_title}", edit_admin_page_url(page), :title => page.path)
|
11
11
|
= page_type
|
12
12
|
= spinner
|
13
13
|
- node.status_column do
|
data/config/compass.config
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
project_type = :rails
|
2
|
-
project_path = Compass::AppIntegration::Rails.root
|
3
2
|
|
4
3
|
http_path = "/"
|
5
4
|
http_stylesheets_path = "/stylesheets"
|
@@ -11,8 +10,6 @@ css_dir = "public/stylesheets"
|
|
11
10
|
images_dir = "public/images"
|
12
11
|
javascripts_dir = "public/javascripts"
|
13
12
|
|
14
|
-
environment = Compass::AppIntegration::Rails.env
|
15
|
-
|
16
13
|
relative_assets = true
|
17
14
|
|
18
15
|
output_style = :compressed
|
data/config/preinitializer.rb
CHANGED
@@ -1,19 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
rescue LoadError
|
5
|
-
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
6
|
-
end
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
2
|
+
# Lessens Debians need to edit.
|
3
|
+
require "rubygems" rescue nil
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
# Since Bundler is not really a 'must have' for Rails development just send off
|
6
|
+
# a warning and see if the sytem continues to load, the user can optionally use
|
7
|
+
# RADIANT_NOWARNINGS to disable it.
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
if File.file?(ENV['BUNDLE_GEMFILE'])
|
10
|
+
begin
|
11
|
+
require 'bundler/setup'
|
12
|
+
rescue LoadError
|
13
|
+
unless ENV['RADIANT_NOWARNINGS'] == true
|
14
|
+
$stderr.puts 'WARNING: It seems you do not have Bundler installed.'
|
15
|
+
$stderr.puts 'WARNING: You can install it by doing `gem install bundler`'
|
16
|
+
end
|
17
|
+
end
|
19
18
|
end
|