Skip to content

Commit

Permalink
Merge pull request #30046 from kamipo/fix_string_literals_violations_…
Browse files Browse the repository at this point in the history
…for_active_storage

Fix `Style/StringLiterals` violations for Active Storage
  • Loading branch information
rafaelfranca committed Aug 2, 2017
2 parents c697422 + 815d1ab commit 5aeac57
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ group :storage do
gem "google-cloud-storage", "~> 1.3", require: false

# Contains fix to be able to test using StringIO
gem 'azure-core', git: "https://github.com/dixpac/azure-ruby-asm-core.git"
gem 'azure-storage', require: false
gem "azure-core", git: "https://github.com/dixpac/azure-ruby-asm-core.git"
gem "azure-storage", require: false

gem "mini_magick"
end
Expand Down
1 change: 0 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ DEPENDENCIES
libxml-ruby
listen (>= 3.0.5, < 3.2)
mini_magick
minitest (< 5.3.4)
minitest-bisect
mocha (~> 0.14)
mysql2 (>= 0.4.4)
Expand Down
2 changes: 1 addition & 1 deletion activestorage/test/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
require_relative 'config/application'
require_relative "config/application"

Rails.application.load_tasks
4 changes: 2 additions & 2 deletions activestorage/test/dummy/bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
load Gem.bin_path("bundler", "bundle")
6 changes: 3 additions & 3 deletions activestorage/test/dummy/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
4 changes: 2 additions & 2 deletions activestorage/test/dummy/bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
require_relative "../config/boot"
require "rake"
Rake.application.run
2 changes: 1 addition & 1 deletion activestorage/test/dummy/bin/yarn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
VENDOR_PATH = File.expand_path('..', __dir__)
VENDOR_PATH = File.expand_path("..", __dir__)
Dir.chdir(VENDOR_PATH) do
begin
exec "yarnpkg #{ARGV.join(" ")}"
Expand Down
2 changes: 1 addition & 1 deletion activestorage/test/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is used by Rack-based servers to start the application.

require_relative 'config/environment'
require_relative "config/environment"

run Rails.application
2 changes: 1 addition & 1 deletion activestorage/test/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative 'boot'
require_relative "boot"

require "rails"
require "active_model/railtie"
Expand Down
6 changes: 3 additions & 3 deletions activestorage/test/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)

require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
2 changes: 1 addition & 1 deletion activestorage/test/dummy/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Load the Rails application.
require_relative 'application'
require_relative "application"

# Initialize the Rails application.
Rails.application.initialize!
4 changes: 2 additions & 2 deletions activestorage/test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp/caching-dev.txt').exist?
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
"Cache-Control" => "public, max-age=#{2.days.seconds.to_i}"
}
else
config.action_controller.perform_caching = false
Expand Down
2 changes: 1 addition & 1 deletion activestorage/test/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand Down
2 changes: 1 addition & 1 deletion activestorage/test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
"Cache-Control" => "public, max-age=#{1.hour.seconds.to_i}"
}

# Show full error reports and disable caching.
Expand Down
4 changes: 2 additions & 2 deletions activestorage/test/dummy/config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.version = "1.0"

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')
Rails.application.config.assets.paths << Rails.root.join("node_modules")

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
Expand Down
4 changes: 2 additions & 2 deletions activestorage/test/service/gcs_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class ActiveStorage::Service::GCSServiceTest < ActiveSupport::TestCase
uri = URI.parse url
request = Net::HTTP::Put.new uri.request_uri
request.body = data
request.add_field 'Content-Type', 'text/plain'
request.add_field 'Content-MD5', checksum
request.add_field "Content-Type", "text/plain"
request.add_field "Content-MD5", checksum
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request request
end
Expand Down
4 changes: 2 additions & 2 deletions activestorage/test/service/s3_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class ActiveStorage::Service::S3ServiceTest < ActiveSupport::TestCase
uri = URI.parse url
request = Net::HTTP::Put.new uri.request_uri
request.body = data
request.add_field 'Content-Type', 'text/plain'
request.add_field 'Content-MD5', checksum
request.add_field "Content-Type", "text/plain"
request.add_field "Content-MD5", checksum
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request request
end
Expand Down

0 comments on commit 5aeac57

Please sign in to comment.