From 53844af8dc4d1da5d2d027dce43597549b01a5ad Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 25 Apr 2014 10:55:36 -0700 Subject: [PATCH] Merge branch 'ruby-2.1' This reverts commit 616aef439496044861840fff546bb2306ce19c46. --- .rbenv-version | 2 +- Gemfile | 3 +++ app/models/upload.rb | 4 ++-- config/application.rb | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.rbenv-version b/.rbenv-version index 546d4d8a9..7c3272873 100644 --- a/.rbenv-version +++ b/.rbenv-version @@ -1 +1 @@ -1.9.3-p327 \ No newline at end of file +2.1.1 \ No newline at end of file diff --git a/Gemfile b/Gemfile index 8a5305ccb..0c2618362 100644 --- a/Gemfile +++ b/Gemfile @@ -63,3 +63,6 @@ group :development do # gem 'sql-logging' end +group :development, :test do + gem 'pry' +end diff --git a/app/models/upload.rb b/app/models/upload.rb index c7d14232f..01c38bc4a 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -304,13 +304,13 @@ class Upload < ActiveRecord::Base def file_header_to_content_type(source_path) case File.read(source_path, 10) - when /^\xff\xd8/ + when /^\xff\xd8/n "image/jpeg" when /^GIF87a/, /^GIF89a/ "image/gif" - when /^\x89PNG\r\n\x1a\n/ + when /^\x89PNG\r\n\x1a\n/n "image/png" when /^CWS/, /^FWS/, /^ZWS/ diff --git a/config/application.rb b/config/application.rb index 18dbab17f..b78818874 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,4 +21,6 @@ module Danbooru config.action_mailer.perform_deliveries = true config.log_tags = [lambda {|req| "PID:#{Process.pid}"}] end + + I18n.enforce_available_locales = false end