Permalink
Browse files

removed deprecated calls to RAILS_ROOT

  • Loading branch information...
1 parent fa08cb0 commit 69fac2606a03d7a111fdff54faae255cfd845453 @earnold committed May 14, 2011
View
2 lib/technoweenie/attachment_fu.rb
@@ -1,7 +1,7 @@
module Technoweenie # :nodoc:
module AttachmentFu # :nodoc:
@@default_processors = %w(ImageScience Rmagick MiniMagick Gd2 CoreImage)
- @@tempfile_path = File.join(RAILS_ROOT, 'tmp', 'attachment_fu')
+ @@tempfile_path = Rails.root.join('tmp', 'attachment_fu')
@@content_types = [
'image/jpeg',
'image/pjpeg',
View
2 lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb
@@ -116,7 +116,7 @@ def self.included(base) #:nodoc:
end
begin
- @@cloudfiles_config_path = base.attachment_options[:cloudfiles_config_path] || (RAILS_ROOT + '/config/rackspace_cloudfiles.yml')
+ @@cloudfiles_config_path = base.attachment_options[:cloudfiles_config_path] || Rails.root.join('config', 'rackspace_cloudfiles.yml')
@@cloudfiles_config = @@cloudfiles_config = YAML.load(ERB.new(File.read(@@cloudfiles_config_path)).result)[RAILS_ENV].symbolize_keys
rescue
#raise ConfigFileNotFoundError.new('File %s not found' % @@cloudfiles_config_path)
View
4 lib/technoweenie/attachment_fu/backends/file_system_backend.rb
@@ -20,12 +20,12 @@ def self.included(base) #:nodoc:
# The optional thumbnail argument will output the thumbnail's filename.
def full_filename(thumbnail = nil)
file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
- File.join(RAILS_ROOT, file_system_path, *partitioned_path(thumbnail_name_for(thumbnail)))
+ Rails.root.join(file_system_path, *partitioned_path(thumbnail_name_for(thumbnail)))
end
# Used as the base path that #public_filename strips off full_filename to create the public path
def base_path
- @base_path ||= File.join(RAILS_ROOT, 'public')
+ @base_path ||= Rails.root.join('public')
end
# The attachment ID used in the full path of a file
View
2 lib/technoweenie/attachment_fu/backends/s3_backend.rb
@@ -183,7 +183,7 @@ def self.included(base) #:nodoc:
end
begin
- @@s3_config_path = base.attachment_options[:s3_config_path] || (RAILS_ROOT + '/config/amazon_s3.yml')
+ @@s3_config_path = base.attachment_options[:s3_config_path] || Rails.root.join('config', 'amazon_s3.yml')
@@s3_config = @@s3_config = YAML.load(ERB.new(File.read(@@s3_config_path)).result)[RAILS_ENV].symbolize_keys
#rescue
# raise ConfigFileNotFoundError.new('File %s not found' % @@s3_config_path)

0 comments on commit 69fac26

Please sign in to comment.