Commit da26a7520101fcda1752ffe9567d4d3afb8a0959
1 parent
0fcf86d4
Exists in
master
and in
22 other branches
Rails.root is now a Pathname, not a String
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
config/initializers/image_uploads.rb
| 1 | 1 | if File.writable?(Rails.root) |
| 2 | - misplaced_directories = Dir.glob(Rails.root + '/public/images/[0-9]*') | |
| 2 | + misplaced_directories = Dir.glob(Rails.root.join('public/images/[0-9]*')) | |
| 3 | 3 | unless misplaced_directories.empty? |
| 4 | - new_location = Rails.root + '/public/image_uploads' | |
| 4 | + new_location = Rails.root.join('public/image_uploads') | |
| 5 | 5 | if !File.exists?(new_location) |
| 6 | 6 | FileUtils.mkdir(new_location) |
| 7 | 7 | end | ... | ... |
lib/tasks/gettext.rake
| ... | ... | @@ -22,11 +22,11 @@ task :symlinkmo do |
| 22 | 22 | langmap = { |
| 23 | 23 | 'pt' => 'pt_BR', |
| 24 | 24 | } |
| 25 | - FileUtils.mkdir_p(Rails.root + '/locale') | |
| 26 | - Dir.glob(Rails.root + '/locale/*').each do |dir| | |
| 25 | + mkdir_p(File.join(Rails.root, 'locale')) | |
| 26 | + Dir.glob(File.join(Rails.root, 'locale/*')).each do |dir| | |
| 27 | 27 | lang = File.basename(dir) |
| 28 | 28 | orig_lang = langmap[lang] || lang |
| 29 | - FileUtils.mkdir_p("#{Rails.root}/locale/#{lang}/LC_MESSAGES") | |
| 29 | + mkdir_p("#{Rails.root}/locale/#{lang}/LC_MESSAGES") | |
| 30 | 30 | ['iso_3166', 'rails'].each do |domain| |
| 31 | 31 | origin = "/usr/share/locale/#{orig_lang}/LC_MESSAGES/#{domain}.mo" |
| 32 | 32 | target = "#{Rails.root}/locale/#{lang}/LC_MESSAGES/#{domain}.mo" | ... | ... |