Skip to content

Commit

Permalink
Avoid mutable string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
exoego committed Sep 12, 2022
1 parent 464db2d commit 5625d87
Show file tree
Hide file tree
Showing 56 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'

# Specify your gem's dependencies in rspec-openapi.gemspec
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"

Expand Down
1 change: 1 addition & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "rspec/openapi"
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rspec/openapi/version'
require 'rspec/openapi/hooks' if ENV['OPENAPI']

Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/components_updater.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'hash_helper'

class << RSpec::OpenAPI::ComponentsUpdater = Object.new
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/default_schema.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class << RSpec::OpenAPI::DefaultSchema = Object.new
def build(title)
{
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/hash_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class << RSpec::OpenAPI::HashHelper = Object.new
def paths_to_all_fields(obj)
case obj
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/hooks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'rspec'
require 'rspec/openapi/components_updater'
require 'rspec/openapi/default_schema'
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
RSpec::OpenAPI::Record = Struct.new(
:http_method, # @param [String] - "GET"
:path, # @param [String] - "/v1/status/:id"
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/record_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'action_dispatch'
require 'rspec/openapi/record'

Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/schema_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class << RSpec::OpenAPI::SchemaBuilder = Object.new
# @param [RSpec::OpenAPI::Record] record
# @return [Hash]
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/schema_cleaner.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# For Ruby 3.0+
require 'set'

Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/schema_file.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'fileutils'
require 'yaml'
require 'json'
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/schema_merger.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class << RSpec::OpenAPI::SchemaMerger = Object.new
# @param [Hash] base
# @param [Hash] spec
Expand Down
1 change: 1 addition & 0 deletions lib/rspec/openapi/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module RSpec
module OpenAPI
VERSION = '0.7.0'
Expand Down
1 change: 1 addition & 0 deletions rspec-openapi.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'lib/rspec/openapi/version'

Gem::Specification.new do |spec|
Expand Down
1 change: 1 addition & 0 deletions spec/rails/Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 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.

Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
NotFoundError = Class.new(StandardError)

Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/controllers/images_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ImagesController < ApplicationController
def show
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjP
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/controllers/tables_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class TablesController < ApplicationController
APIKEY = 'k0kubun'

Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# frozen_string_literal: true
module ApplicationHelper
end
1 change: 1 addition & 0 deletions spec/rails/app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
Expand Down
1 change: 1 addition & 0 deletions spec/rails/app/models/application_record.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
1 change: 1 addition & 0 deletions spec/rails/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
1 change: 1 addition & 0 deletions spec/rails/bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../config/boot'
require 'rake'
Rake.application.run
1 change: 1 addition & 0 deletions spec/rails/bin/setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'fileutils'

# path to your application root.
Expand Down
1 change: 1 addition & 0 deletions spec/rails/bin/yarn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
begin
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# This file is used by Rack-based servers to start the application.

require_relative 'config/environment'
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'boot'

require "rails"
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
1 change: 1 addition & 0 deletions spec/rails/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Load the Rails application.
require_relative 'application'

Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/environments/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# ActiveSupport::Reloader.to_prepare do
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/backtrace_silencers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Define an application-wide content security policy
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Specify a serializer for the signed and encrypted cookie jars.
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/filter_parameter_logging.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Configure sensitive parameters which will be filtered from the log file.
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/inflections.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/mime_types.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# Add new mime types for use in respond_to blocks:
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/initializers/wrap_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.

# This file contains settings for ActionController::ParamsWrapper which
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 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
Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.routes.draw do
mount ::MyEngine::Engine => '/my_engine'

Expand Down
1 change: 1 addition & 0 deletions spec/rails/config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
Spring.watch(
".ruby-version",
".rbenv-vars",
Expand Down
1 change: 1 addition & 0 deletions spec/rails/db/seeds.rb
Original file line number Diff line number Diff line change
@@ -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 rails db:seed command (or created alongside the database with db:setup).
#
Expand Down
1 change: 1 addition & 0 deletions spec/requests/rails_smart_merge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['TZ'] ||= 'UTC'
ENV['RAILS_ENV'] ||= 'test'
ENV['OPENAPI_OUTPUT'] ||= 'json'
Expand Down
1 change: 1 addition & 0 deletions spec/requests/rails_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['TZ'] ||= 'UTC'
ENV['RAILS_ENV'] ||= 'test'
ENV['OPENAPI_OUTPUT'] ||= 'yaml'
Expand Down
1 change: 1 addition & 0 deletions spec/requests/roda_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative '../roda/roda_app'
require 'json'
require 'rack/test'
Expand Down
1 change: 1 addition & 0 deletions spec/roda/roda_app.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'roda'

class RodaApp < Roda
Expand Down
1 change: 1 addition & 0 deletions spec/rspec/rack_test_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
require 'fileutils'
require 'yaml'
Expand Down
1 change: 1 addition & 0 deletions spec/rspec/rails_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
require 'yaml'
require 'json'
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'open3'
require 'super_diff/rspec'

Expand Down

0 comments on commit 5625d87

Please sign in to comment.