Skip to content

Commit f450139

Browse files
author
Mehdi Lahmam
committed
Remove UTF-8 magic comments from all the Ruby files
Ruby 2 made UTF-8 the default encoding, which make magic comments omissible.
1 parent 4362fbf commit f450139

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14
-160
lines changed

Diff for: Rakefile

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: UTF-8
21
require 'rubygems'
32
begin
43
require 'bundler/setup'

Diff for: features/step_definitions/activerecord_steps.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
Given /^an activerecord class that uses the '([^\']*)' table$/ do |name|
42
@mountee_klass = Class.new(ActiveRecord::Base)
53
@mountee_klass.table_name = name
@@ -19,4 +17,4 @@
1917

2018
When /^I delete the active record$/ do
2119
@instance.destroy
22-
end
20+
end

Diff for: features/step_definitions/caching_steps.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
Given /^the file '(.*?)' is cached file at '(.*?)'$/ do |file, cached|
42
FileUtils.mkdir_p(File.dirname(file_path(cached)))
53
FileUtils.cp(file_path(file), file_path(cached))
@@ -11,4 +9,4 @@
119

1210
When /^I retrieve the cache name '(.*?)' from the cache$/ do |name|
1311
@uploader.retrieve_from_cache!(name)
14-
end
12+
end

Diff for: features/step_definitions/datamapper_steps.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
Given /^a datamapper class that has a '([^\']*)' column$/ do |column|
42
@mountee_klass = Class.new do
53
include DataMapper::Resource

Diff for: features/step_definitions/file_steps.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
###
42
# EXISTENCE
53

Diff for: features/step_definitions/general_steps.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
Given /^an uploader class that uses the '(.*?)' storage$/ do |kind|
42
@klass = Class.new(CarrierWave::Uploader::Base)
53
@klass.storage = kind.to_sym

Diff for: features/step_definitions/mount_steps.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
When /^I assign the file '([^\']*)' to the '([^\']*)' column$/ do |path, column|
42
@instance.send("#{column}=", File.open(file_path(path)))
53
end

Diff for: features/step_definitions/store_steps.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
Given /^the file '(.*?)' is stored at '(.*?)'$/ do |file, stored|
42
FileUtils.mkdir_p(File.dirname(file_path(stored)))
53
FileUtils.cp(file_path(file), file_path(stored))

Diff for: features/support/activerecord.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'carrierwave/mount'
42
require File.join(File.dirname(__FILE__), '..', '..', 'spec', 'support', 'activerecord')
53

Diff for: features/support/env.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
$:.unshift File.expand_path(File.join('..', '..', 'lib'), File.dirname(__FILE__))
42

53
require File.join(File.dirname(__FILE__), 'activerecord')

Diff for: lib/carrierwave.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'fileutils'
42
require 'active_support/core_ext/object/blank'
53
require 'active_support/core_ext/object/try'

Diff for: lib/carrierwave/compatibility/paperclip.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Compatibility
53

Diff for: lib/carrierwave/mount.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42

53
##
@@ -182,7 +180,7 @@ def write_#{column}_identifier
182180
def #{column}_identifier
183181
_mounter(:#{column}).read_identifiers[0]
184182
end
185-
183+
186184
def store_previous_changes_for_#{column}
187185
@_previous_changes_for_#{column} = changes[_mounter(:#{column}).serialization_column]
188186
end
@@ -332,7 +330,7 @@ def write_#{column}_identifier
332330
def #{column}_identifiers
333331
_mounter(:#{column}).read_identifiers
334332
end
335-
333+
336334
def store_previous_changes_for_#{column}
337335
@_previous_changes_for_#{column} = changes[_mounter(:#{column}).serialization_column]
338336
end

Diff for: lib/carrierwave/orm/activerecord.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'active_record'
42
require 'carrierwave/validations/active_model'
53

Diff for: lib/carrierwave/processing/magic_mime_types.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
##
53
# This module simplifies the use of ruby-filemagic gem to intelligently
6-
# and correctly guess and set the content-type of a file. If you want
4+
# and correctly guess and set the content-type of a file. If you want
75
# to use this, you'll need to require this file:
86
#
97
# require 'carrierwave/processing/magic_mime_types'

Diff for: lib/carrierwave/processing/mini_magick.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42

53
##

Diff for: lib/carrierwave/processing/rmagick.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42

53
##

Diff for: lib/carrierwave/sanitized_file.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'pathname'
42
require 'active_support/core_ext/string/multibyte'
53

Diff for: lib/carrierwave/storage/abstract.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Storage
53

Diff for: lib/carrierwave/storage/file.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Storage
53

Diff for: lib/carrierwave/storage/fog.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Storage
53

Diff for: lib/carrierwave/test/matchers.rb

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Test
53

@@ -394,4 +392,3 @@ def initialize(filename)
394392
end # Matchers
395393
end # Test
396394
end # CarrierWave
397-

Diff for: lib/carrierwave/uploader.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require "carrierwave/uploader/configuration"
42
require "carrierwave/uploader/callbacks"
53
require "carrierwave/uploader/proxy"

Diff for: lib/carrierwave/uploader/cache.rb

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42

53
class FormNotMultipart < UploadError
64
def message
75
"You tried to assign a String or a Pathname to an uploader, for security reasons, this is not allowed.\n\n If this is a file upload, please check that your upload form is multipart encoded."
86
end
97
end
10-
8+
119
class CacheCounter
1210
@@counter = 0
1311

1412
def self.increment
1513
@@counter += 1
16-
end
14+
end
1715
end
1816

1917
##
@@ -25,8 +23,8 @@ def self.increment
2523
#
2624
def self.generate_cache_id
2725
[Time.now.utc.to_i,
28-
Process.pid,
29-
'%04d' % (CarrierWave::CacheCounter.increment % 1000),
26+
Process.pid,
27+
'%04d' % (CarrierWave::CacheCounter.increment % 1000),
3028
'%04d' % rand(9999)
3129
].map(&:to_s).join('-')
3230
end

Diff for: lib/carrierwave/uploader/callbacks.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Callbacks

Diff for: lib/carrierwave/uploader/default_url.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module DefaultUrl

Diff for: lib/carrierwave/uploader/download.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'open-uri'
42

53
module CarrierWave

Diff for: lib/carrierwave/uploader/extension_whitelist.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module ExtensionWhitelist

Diff for: lib/carrierwave/uploader/file_size.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module FileSize

Diff for: lib/carrierwave/uploader/magic_mime_blacklist.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53

Diff for: lib/carrierwave/uploader/magic_mime_whitelist.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53

Diff for: lib/carrierwave/uploader/mountable.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Mountable

Diff for: lib/carrierwave/uploader/processing.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Processing

Diff for: lib/carrierwave/uploader/proxy.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Proxy

Diff for: lib/carrierwave/uploader/remove.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Remove

Diff for: lib/carrierwave/uploader/serialization.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require "json"
42
require "active_support/core_ext/hash"
53

Diff for: lib/carrierwave/uploader/store.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Store

Diff for: lib/carrierwave/uploader/url.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Url

Diff for: lib/carrierwave/uploader/versions.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Uploader
53
module Versions

Diff for: lib/carrierwave/utilities.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'carrierwave/utilities/uri'
42

53
module CarrierWave

Diff for: lib/carrierwave/utilities/uri.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
module CarrierWave
42
module Utilities
53
module Uri

Diff for: lib/carrierwave/validations/active_model.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'active_model/validator'
42
require 'active_support/concern'
53

Diff for: lib/generators/templates/uploader.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
class <%= class_name %>Uploader < CarrierWave::Uploader::Base
42
53
# Include RMagick or MiniMagick support:

Diff for: spec/compatibility/paperclip_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
require 'carrierwave/orm/activerecord'

Diff for: spec/mount_multiple_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
describe CarrierWave::Mount do

Diff for: spec/mount_single_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
describe CarrierWave::Mount do

Diff for: spec/orm/activerecord_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42
require 'support/activerecord'
53

Diff for: spec/processing/magic_mime_types_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
describe CarrierWave::MagicMimeTypes, :filemagic => true do

Diff for: spec/processing/mini_magick_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
describe CarrierWave::MiniMagick do

Diff for: spec/processing/rmagick_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
describe CarrierWave::RMagick, :rmagick => true do

Diff for: spec/sanitized_file_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42

53
begin

Diff for: spec/spec_helper.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'rubygems'
42
require 'bundler/setup'
53

Diff for: spec/storage/file_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42
require 'support/file_utils_helper'
53
require 'tempfile'

Diff for: spec/storage/fog_spec.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# encoding: utf-8
2-
31
require 'spec_helper'
42
require 'fog'
53
require 'carrierwave/storage/fog'

0 commit comments

Comments
 (0)