Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename 'base_url' to 'base_path'.

  • Loading branch information...
commit f0d31a90d7cd64de36500f8ac7985c687a014704 1 parent 2870718
@noniq noniq authored
View
4 lib/carrierwave.rb
@@ -15,7 +15,7 @@
module CarrierWave
class << self
- attr_accessor :root, :base_url
+ attr_accessor :root, :base_path
def configure(&block)
CarrierWave::Uploader::Base.configure(&block)
@@ -92,7 +92,7 @@ module CarrierWave
class Railtie < Rails::Railtie
initializer "carrierwave.setup_paths" do
CarrierWave.root = Rails.root.join(Rails.public_path).to_s
- CarrierWave.base_url = ENV['RAILS_RELATIVE_URL_ROOT']
+ CarrierWave.base_path = ENV['RAILS_RELATIVE_URL_ROOT']
end
initializer "carrierwave.active_record" do
View
4 lib/carrierwave/uploader/configuration.rb
@@ -8,7 +8,7 @@ module Configuration
class_attribute :_storage, :instance_writer => false
add_config :root
- add_config :base_url
+ add_config :base_path
add_config :permissions
add_config :storage_engines
add_config :s3_access_policy
@@ -151,7 +151,7 @@ def reset_config
config.validate_integrity = true
config.validate_processing = true
config.root = CarrierWave.root
- config.base_url = CarrierWave.base_url
+ config.base_path = CarrierWave.base_path
config.enable_processing = true
config.ensure_multipart_form = true
end
View
2  lib/carrierwave/uploader/url.rb
@@ -15,7 +15,7 @@ def url
if file.respond_to?(:url) and not file.url.blank?
file.url
elsif current_path
- (base_url || "") + File.expand_path(current_path).gsub(File.expand_path(root), '')
+ (base_path || "") + File.expand_path(current_path).gsub(File.expand_path(root), '')
end
end
View
6 spec/uploader/url_spec.rb
@@ -51,13 +51,13 @@
@uploader.url(:thumb, :mini).should == '/uploads/tmp/20071201-1234-345-2255/thumb_mini_test.jpg'
end
- it "should prepend the config option 'base_url', if set" do
+ it "should prepend the config option 'base_path', if set" do
@uploader_class.version(:thumb)
@uploader.class.configure do |config|
- config.base_url = "/base_url"
+ config.base_path = "/base_path"
end
@uploader.cache!(File.open(file_path('test.jpg')))
- @uploader.url(:thumb).should == '/base_url/uploads/tmp/20071201-1234-345-2255/thumb_test.jpg'
+ @uploader.url(:thumb).should == '/base_path/uploads/tmp/20071201-1234-345-2255/thumb_test.jpg'
end
it "should return file#url if available" do
Please sign in to comment.
Something went wrong with that request. Please try again.