Skip to content

Commit 44fcf40

Browse files
authored
Merge pull request #91 from blocknotes/switch-to-double-quotes-for-strings
Switch to double quotes for strings
2 parents 85f0c3d + 76b2816 commit 44fcf40

File tree

12 files changed

+84
-80
lines changed

12 files changed

+84
-80
lines changed

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ Style/NegatedIfElseCondition:
6464
Style/NumericLiterals:
6565
Exclude:
6666
- spec/dummy/db/**/schema*.rb
67+
68+
Style/StringLiterals:
69+
Enabled: true
70+
EnforcedStyle: double_quotes

Gemfile

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
11
# frozen_string_literal: true
22

3-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
if ENV['DEVEL'] == '1'
7-
gem 'active_storage_db', path: './'
6+
if ENV["DEVEL"] == "1"
7+
gem "active_storage_db", path: "./"
88
else
99
gemspec
1010
end
1111

12-
ruby_ver = ENV.fetch('RUBY_VERSION', '')
13-
rails_ver = ENV.fetch('RAILS_VERSION', '')
12+
ruby_ver = ENV.fetch("RUBY_VERSION", "")
13+
rails_ver = ENV.fetch("RAILS_VERSION", "")
1414

1515
rails =
1616
if rails_ver.empty?
17-
['rails']
18-
elsif rails_ver.count('.') < 2
19-
['rails', "~> #{rails_ver}"]
17+
["rails"]
18+
elsif rails_ver.count(".") < 2
19+
["rails", "~> #{rails_ver}"]
2020
else
21-
['rails', rails_ver]
21+
["rails", rails_ver]
2222
end
2323
gem(*rails)
2424

25-
ruby32 = ruby_ver.empty? || Gem::Version.new(ruby_ver) >= Gem::Version.new('3.2')
26-
gem 'zeitwerk', '~> 2.6.18' unless ruby32
25+
ruby32 = ruby_ver.empty? || Gem::Version.new(ruby_ver) >= Gem::Version.new("3.2")
26+
gem "zeitwerk", "~> 2.6.18" unless ruby32
2727

2828
# DB driver
29-
case ENV.fetch('DB_TEST', nil)
30-
when 'mssql'
31-
gem 'activerecord-sqlserver-adapter'
32-
gem 'tiny_tds'
33-
when 'mysql'
34-
gem 'mysql2'
35-
when 'postgres'
36-
gem 'pg'
29+
case ENV.fetch("DB_TEST", nil)
30+
when "mssql"
31+
gem "activerecord-sqlserver-adapter"
32+
gem "tiny_tds"
33+
when "mysql"
34+
gem "mysql2"
35+
when "postgres"
36+
gem "pg"
3737
else
38-
rails72 = rails_ver.empty? || Gem::Version.new(rails_ver) >= Gem::Version.new('7.2')
39-
sqlite3 = ruby32 && rails72 ? ['sqlite3'] : ['sqlite3', '~> 1.4']
38+
rails72 = rails_ver.empty? || Gem::Version.new(rails_ver) >= Gem::Version.new("7.2")
39+
sqlite3 = ruby32 && rails72 ? ["sqlite3"] : ["sqlite3", "~> 1.4"]
4040
gem(*sqlite3)
4141
end
4242

4343
# NOTE: to avoid error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
44-
gem 'concurrent-ruby', '1.3.4'
44+
gem "concurrent-ruby", "1.3.4"
4545

46-
gem 'bigdecimal'
47-
gem 'bullet'
48-
gem 'image_processing', '>= 1.2'
49-
gem 'mutex_m'
50-
gem 'puma'
51-
gem 'sprockets-rails'
46+
gem "bigdecimal"
47+
gem "bullet"
48+
gem "image_processing", ">= 1.2"
49+
gem "mutex_m"
50+
gem "puma"
51+
gem "sprockets-rails"
5252

5353
# Testing
54-
gem 'capybara'
55-
gem 'factory_bot_rails'
56-
gem 'rspec_junit_formatter'
57-
gem 'rspec-rails'
58-
gem 'selenium-webdriver'
59-
gem 'simplecov'
60-
gem 'simplecov-lcov'
54+
gem "capybara"
55+
gem "factory_bot_rails"
56+
gem "rspec_junit_formatter"
57+
gem "rspec-rails"
58+
gem "selenium-webdriver"
59+
gem "simplecov"
60+
gem "simplecov-lcov"
6161

6262
# Linters
63-
gem 'brakeman'
64-
gem 'fasterer'
65-
gem 'rubocop'
66-
gem 'rubocop-packaging'
67-
gem 'rubocop-performance'
68-
gem 'rubocop-rails'
69-
gem 'rubocop-rspec'
63+
gem "brakeman"
64+
gem "fasterer"
65+
gem "rubocop"
66+
gem "rubocop-packaging"
67+
gem "rubocop-performance"
68+
gem "rubocop-rails"
69+
gem "rubocop-rspec"
7070

7171
# Tools
72-
gem 'pry-rails'
72+
gem "pry-rails"

Rakefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
# frozen_string_literal: true
22

33
begin
4-
require 'bundler/setup'
4+
require "bundler/setup"
55
rescue LoadError
6-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
77
end
88

9-
require 'rdoc/task'
9+
require "rdoc/task"
1010

1111
RDoc::Task.new(:rdoc) do |rdoc|
12-
rdoc.rdoc_dir = 'rdoc'
13-
rdoc.title = 'ActiveStorageDB'
14-
rdoc.options << '--line-numbers'
15-
rdoc.rdoc_files.include('README.md')
16-
rdoc.rdoc_files.include('lib/**/*.rb')
12+
rdoc.rdoc_dir = "rdoc"
13+
rdoc.title = "ActiveStorageDB"
14+
rdoc.options << "--line-numbers"
15+
rdoc.rdoc_files.include("README.md")
16+
rdoc.rdoc_files.include("lib/**/*.rb")
1717
end
1818

1919
APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
20-
load 'rails/tasks/engine.rake'
20+
load "rails/tasks/engine.rake"
2121

22-
load 'rails/tasks/statistics.rake'
22+
load "rails/tasks/statistics.rake"
2323

24-
require 'bundler/gem_tasks'
24+
require "bundler/gem_tasks"
2525

2626
begin
27-
require 'rspec/core/rake_task'
27+
require "rspec/core/rake_task"
2828

2929
RSpec::Core::RakeTask.new(:spec) do |t|
3030
# t.ruby_opts = %w[-w]
31-
t.rspec_opts = ['--color', '--format documentation']
31+
t.rspec_opts = ["--color", "--format documentation"]
3232
end
3333

3434
task default: :spec
3535
rescue LoadError
36-
puts '! LoadError: no RSpec available'
36+
puts "! LoadError: no RSpec available"
3737
end

config/initializers/inflections.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
ActiveSupport::Inflector.inflections(:en) do |inflect|
4-
inflect.acronym 'DB'
4+
inflect.acronym "DB"
55
end

config/routes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

33
ActiveStorageDB::Engine.routes.draw do
4-
get '/files/:encoded_key/*filename', to: 'files#show', as: :service
5-
put '/files/:encoded_token', to: 'files#update', as: :update_service
4+
get "/files/:encoded_key/*filename", to: "files#show", as: :service
5+
put "/files/:encoded_token", to: "files#update", as: :update_service
66
end

lib/active_storage_db.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

3-
require 'active_storage_db/engine'
4-
require 'active_storage/service/db_service'
3+
require "active_storage_db/engine"
4+
require "active_storage/service/db_service"
55

66
module ActiveStorageDB
77
end

lib/active_storage_db/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module ActiveStorageDB
4-
VERSION = '1.6.0'
4+
VERSION = "1.6.0"
55
end

spec/dummy/config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Application < Rails::Application
2424
# config.time_zone = "Central Time (US & Canada)"
2525
# config.eager_load_paths << Rails.root.join("extras")
2626

27-
config.hosts << 'test.example.com'
27+
config.hosts << "test.example.com"
2828

2929
config.before_initialize do
3030
FactoryBot.definition_file_paths << Rails.root.join("../factories") if defined?(FactoryBot)

spec/dummy/config/routes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# frozen_string_literal: true
22

33
Rails.application.routes.draw do
4-
mount ActiveStorageDB::Engine => '/active_storage_db'
4+
mount ActiveStorageDB::Engine => "/active_storage_db"
55

66
resources :posts
77

8-
root 'posts#index'
8+
root "posts#index"
99
end

spec/factories/active_storage_db_files.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

33
FactoryBot.define do
4-
factory :active_storage_db_file, class: 'ActiveStorageDB::File' do
5-
ref { ('a'..'z').to_a.sample(32).join }
4+
factory :active_storage_db_file, class: "ActiveStorageDB::File" do
5+
ref { ("a".."z").to_a.sample(32).join }
66

77
data do
88
(+"\211PNG\r\n\032\n\000\000\000\rIHDR\000\000\000\020\000\000\000\020\001\003\000\000\000%=m\"\000\000\000\006PLTE\000\000\000\377\377\377\245\331\237\335\000\000\0003IDATx\234c\370\377\237\341\377_\206\377\237\031\016\2603\334?\314p\1772\303\315\315\f7\215\031\356\024\203\320\275\317\f\367\201R\314\f\017\300\350\377\177\000Q\206\027(\316]\233P\000\000\000\000IEND\256B`\202").force_encoding(Encoding::BINARY)

0 commit comments

Comments
 (0)