summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-02-20 19:53:50 -0600
committerHombreLaser <sebastian-440@live.com>2023-02-20 19:53:50 -0600
commit78644d412df7274072e3a3d4ad0873437554781b (patch)
treed73f29f19790f7dde2023974e47610f8c4f07f7a
parent9aa71bb4bfa345da9514bf6bb251985af0b8758e (diff)
Añade unsafe autocorrects de rubocop
-rw-r--r--Gemfile2
-rw-r--r--Rakefile2
-rw-r--r--app/channels/application_cable/channel.rb2
-rw-r--r--app/channels/application_cable/connection.rb2
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/jobs/application_job.rb2
-rw-r--r--app/mailers/application_mailer.rb2
-rw-r--r--app/models/application_record.rb2
-rwxr-xr-xbin/bundle2
-rwxr-xr-xbin/rails2
-rwxr-xr-xbin/rake2
-rwxr-xr-xbin/setup2
-rw-r--r--config.ru2
-rw-r--r--config/application.rb2
-rw-r--r--config/boot.rb2
-rw-r--r--config/environment.rb2
-rw-r--r--config/environments/development.rb2
-rw-r--r--config/environments/production.rb4
-rw-r--r--config/environments/test.rb2
-rw-r--r--config/initializers/cors.rb1
-rw-r--r--config/initializers/filter_parameter_logging.rb2
-rw-r--r--config/initializers/inflections.rb1
-rw-r--r--config/puma.rb10
-rw-r--r--config/routes.rb2
-rw-r--r--db/seeds.rb1
-rw-r--r--test/channels/application_cable/connection_test.rb20
-rw-r--r--test/test_helper.rb16
27 files changed, 73 insertions, 20 deletions
diff --git a/Gemfile b/Gemfile
index 8cdb633..b649dd3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
diff --git a/Rakefile b/Rakefile
index e85f913..488c551 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,3 +1,5 @@
+# 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.
diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb
index d672697..9aec230 100644
--- a/app/channels/application_cable/channel.rb
+++ b/app/channels/application_cable/channel.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb
index 0ff5442..8d6c2a1 100644
--- a/app/channels/application_cable/connection.rb
+++ b/app/channels/application_cable/connection.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 4ac8823..13c271f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
class ApplicationController < ActionController::API
end
diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb
index d394c3d..bef3959 100644
--- a/app/jobs/application_job.rb
+++ b/app/jobs/application_job.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index 286b223..d84cb6e 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
index b63caeb..08dc537 100644
--- a/app/models/application_record.rb
+++ b/app/models/application_record.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end
diff --git a/bin/bundle b/bin/bundle
index 22995af..3cb2676 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -14,7 +14,7 @@ m = Module.new do
module_function
def invoked_as_script?
- File.expand_path($0) == File.expand_path(__FILE__)
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
end
def env_var_version
diff --git a/bin/rails b/bin/rails
index 0739660..a31728a 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
diff --git a/bin/rake b/bin/rake
index 1724048..c199955 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
require_relative '../config/boot'
require 'rake'
Rake.application.run
diff --git a/bin/setup b/bin/setup
index d6e019a..516b651 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
require 'fileutils'
# path to your application root.
diff --git a/config.ru b/config.ru
index ad1fbf2..6dc8321 100644
--- a/config.ru
+++ b/config.ru
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# This file is used by Rack-based servers to start the application.
require_relative 'config/environment'
diff --git a/config/application.rb b/config/application.rb
index 6350e4a..c040bf4 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'boot'
require 'rails/all'
diff --git a/config/boot.rb b/config/boot.rb
index b9e460c..c04863f 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
diff --git a/config/environment.rb b/config/environment.rb
index 426333b..d5abe55 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Load the Rails application.
require_relative 'application'
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 51fe51d..2ee6f75 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'active_support/core_ext/integer/time'
Rails.application.configure do
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 4eaf901..db0c605 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'active_support/core_ext/integer/time'
Rails.application.configure do
@@ -76,7 +78,7 @@ Rails.application.configure do
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
if ENV['RAILS_LOG_TO_STDOUT'].present?
- logger = ActiveSupport::Logger.new(STDOUT)
+ logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 5f6cef4..8f3f63c 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'active_support/core_ext/integer/time'
# The test environment is used exclusively to run your application's
diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb
index e5a82f1..38d411f 100644
--- a/config/initializers/cors.rb
+++ b/config/initializers/cors.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Avoid CORS issues when API is called from the frontend app.
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 166997c..3df77c5 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index 3860f65..6c78420 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
diff --git a/config/puma.rb b/config/puma.rb
index e9dc159..1713441 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
-max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
+max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
@@ -15,14 +17,14 @@ worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
-port ENV.fetch('PORT') { 3000 }
+port ENV.fetch('PORT', 3000)
# Specifies the `environment` that Puma will run in.
#
-environment ENV.fetch('RAILS_ENV') { 'development' }
+environment ENV.fetch('RAILS_ENV', 'development')
# Specifies the `pidfile` that Puma will use.
-pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
+pidfile ENV.fetch('PIDFILE', 'tmp/pids/server.pid')
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
diff --git a/config/routes.rb b/config/routes.rb
index 262ffd5..7b329f5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Rails.application.routes.draw do
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
diff --git a/db/seeds.rb b/db/seeds.rb
index bc25fce..0664d1b 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb
index d05dbd2..4aee9b3 100644
--- a/test/channels/application_cable/connection_test.rb
+++ b/test/channels/application_cable/connection_test.rb
@@ -1,11 +1,15 @@
+# frozen_string_literal: true
+
require 'test_helper'
-class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
- # test "connects with cookies" do
- # cookies.signed[:user_id] = 42
- #
- # connect
- #
- # assert_equal connection.user_id, "42"
- # end
+module ApplicationCable
+ class ConnectionTest < ActionCable::Connection::TestCase
+ # test "connects with cookies" do
+ # cookies.signed[:user_id] = 42
+ #
+ # connect
+ #
+ # assert_equal connection.user_id, "42"
+ # end
+ end
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index d5300f8..0c92e8e 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,13 +1,17 @@
+# frozen_string_literal: true
+
ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
-class ActiveSupport::TestCase
- # Run tests in parallel with specified workers
- parallelize(workers: :number_of_processors)
+module ActiveSupport
+ class TestCase
+ # Run tests in parallel with specified workers
+ parallelize(workers: :number_of_processors)
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- fixtures :all
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
+ fixtures :all
- # Add more helper methods to be used by all tests here...
+ # Add more helper methods to be used by all tests here...
+ end
end