From ade3681219a6a3e40db1a6103881898a9ff4d1a5 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 30 Oct 2022 18:42:06 +0100 Subject: [PATCH] Add some frozen_string_literal --- Gemfile | 18 ++++++++++-------- Rakefile | 4 +++- config.ru | 4 +++- rename_app.rb | 6 ++++-- spec/requests/home_spec.rb | 10 ++++++---- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 40ef98de..3a25ecc2 100644 --- a/Gemfile +++ b/Gemfile @@ -1,28 +1,30 @@ +# frozen_string_literal: true + source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.1.0' -gem 'rails', '7.0.4' +gem 'bootsnap', require: false +gem 'devise', '4.8.1' gem 'pg', '~> 1.1' gem 'puma', '~> 5.0' -gem 'tzinfo-data', platforms: %i[ mingw mswin x64_mingw jruby ] -gem 'bootsnap', require: false +gem 'rails', '7.0.4' gem 'sprockets-rails' -gem 'turbo-rails' gem 'stimulus-rails' gem 'tailwindcss-rails' -gem 'devise', '4.8.1' +gem 'turbo-rails' +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] group :development, :test do - gem 'debug', platforms: %i[ mri mingw x64_mingw ] - gem 'rspec-rails', '~> 5.1.0' + gem 'debug', platforms: %i[mri mingw x64_mingw] gem 'factory_bot_rails' gem 'ffaker', '2.20.0' + gem 'rspec-rails', '~> 5.1.0' end group :test do - gem 'simplecov', '~> 0.21' gem 'shoulda-matchers', '~> 5.1' + gem 'simplecov', '~> 0.21' end group :development do diff --git a/Rakefile b/Rakefile index 9a5ea738..488c551f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,8 @@ +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require_relative "config/application" +require_relative 'config/application' Rails.application.load_tasks diff --git a/config.ru b/config.ru index 4a3c09a6..6dc83218 100644 --- a/config.ru +++ b/config.ru @@ -1,6 +1,8 @@ +# frozen_string_literal: true + # This file is used by Rack-based servers to start the application. -require_relative "config/environment" +require_relative 'config/environment' run Rails.application Rails.application.load_server diff --git a/rename_app.rb b/rename_app.rb index 76869d40..06303f4c 100644 --- a/rename_app.rb +++ b/rename_app.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + old_snake_case_name = ARGV[0] -old_camel_case_name = "#{ARGV[0]}".split('_').collect(&:capitalize).join +old_camel_case_name = ARGV[0].to_s.split('_').collect(&:capitalize).join new_snake_case_name = ARGV[1] -new_camel_case_name = "#{ARGV[1]}".split('_').collect(&:capitalize).join +new_camel_case_name = ARGV[1].to_s.split('_').collect(&:capitalize).join `sed -i '' -e 's/#{old_snake_case_name}/#{new_snake_case_name}/g' $(find . -type f)` `sed -i '' -e 's/#{old_camel_case_name}/#{new_camel_case_name}/g' $(find . -type f)` diff --git a/spec/requests/home_spec.rb b/spec/requests/home_spec.rb index 384e51bf..dfb27278 100644 --- a/spec/requests/home_spec.rb +++ b/spec/requests/home_spec.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require 'rails_helper' -RSpec.describe "Homes", type: :request do - describe "GET /index" do - it "returns http success" do - get "/home/index" +RSpec.describe 'Homes', type: :request do + describe 'GET /index' do + it 'returns http success' do + get '/home/index' expect(response).to have_http_status(:success) end end