Add some frozen_string_literal

This commit is contained in:
Eugene Burmakin 2022-10-30 18:42:06 +01:00
parent ee07f71a98
commit ade3681219
5 changed files with 26 additions and 16 deletions

18
Gemfile
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)`

View file

@ -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