diff --git a/lib/web-console.rb b/lib/web-console.rb index 9edf0081..09c95e48 100644 --- a/lib/web-console.rb +++ b/lib/web-console.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require 'web_console' diff --git a/lib/web_console.rb b/lib/web_console.rb index 279c6bcc..823330cc 100644 --- a/lib/web_console.rb +++ b/lib/web_console.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/dependencies/autoload' require 'active_support/logger' diff --git a/lib/web_console/context.rb b/lib/web_console/context.rb index 4d9650fc..f9e57c0b 100644 --- a/lib/web_console/context.rb +++ b/lib/web_console/context.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # A context lets you get object names related to the current session binding. class Context diff --git a/lib/web_console/errors.rb b/lib/web_console/errors.rb index 66c80cbc..d523393d 100644 --- a/lib/web_console/errors.rb +++ b/lib/web_console/errors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # The base class for every Web Console related error. Error = Class.new(StandardError) diff --git a/lib/web_console/evaluator.rb b/lib/web_console/evaluator.rb index d60f76c4..e8a9fea4 100644 --- a/lib/web_console/evaluator.rb +++ b/lib/web_console/evaluator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # Simple Ruby code evaluator. # diff --git a/lib/web_console/exception_mapper.rb b/lib/web_console/exception_mapper.rb index 5cbcf830..959af2cc 100644 --- a/lib/web_console/exception_mapper.rb +++ b/lib/web_console/exception_mapper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class ExceptionMapper def initialize(exception) diff --git a/lib/web_console/extensions.rb b/lib/web_console/extensions.rb index 0e831ced..fa79de25 100644 --- a/lib/web_console/extensions.rb +++ b/lib/web_console/extensions.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Kernel module_function diff --git a/lib/web_console/middleware.rb b/lib/web_console/middleware.rb index a25cd655..a09dd13b 100644 --- a/lib/web_console/middleware.rb +++ b/lib/web_console/middleware.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'active_support/core_ext/string/strip' module WebConsole diff --git a/lib/web_console/railtie.rb b/lib/web_console/railtie.rb index 9f3d0a40..f7063785 100644 --- a/lib/web_console/railtie.rb +++ b/lib/web_console/railtie.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails/railtie' module WebConsole diff --git a/lib/web_console/request.rb b/lib/web_console/request.rb index 53d1f8b4..18280c8d 100644 --- a/lib/web_console/request.rb +++ b/lib/web_console/request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # Web Console tailored request object. class Request < ActionDispatch::Request diff --git a/lib/web_console/response.rb b/lib/web_console/response.rb index 0fc3d947..2c8c0b03 100644 --- a/lib/web_console/response.rb +++ b/lib/web_console/response.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # A response object that writes content before the closing tag, if # possible. diff --git a/lib/web_console/session.rb b/lib/web_console/session.rb index f6accd80..9da4753e 100644 --- a/lib/web_console/session.rb +++ b/lib/web_console/session.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # A session lets you persist an +Evaluator+ instance in memory associated # with multiple bindings. diff --git a/lib/web_console/tasks/extensions.rake b/lib/web_console/tasks/extensions.rake index 2035b841..9565cbfd 100644 --- a/lib/web_console/tasks/extensions.rake +++ b/lib/web_console/tasks/extensions.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :ext do rootdir = Pathname('extensions') diff --git a/lib/web_console/tasks/templates.rake b/lib/web_console/tasks/templates.rake index bf0fe14e..6526d30a 100644 --- a/lib/web_console/tasks/templates.rake +++ b/lib/web_console/tasks/templates.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + namespace :templates do desc 'Run tests for templates' task test: [ :daemonize, :npm, :rackup, :wait, :mocha, :kill, :exit ] diff --git a/lib/web_console/template.rb b/lib/web_console/template.rb index 8ff19b30..3f60342c 100644 --- a/lib/web_console/template.rb +++ b/lib/web_console/template.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # A facade that handles template rendering and composition. # diff --git a/lib/web_console/testing/erb_precompiler.rb b/lib/web_console/testing/erb_precompiler.rb index 29cd050a..8e156bb0 100644 --- a/lib/web_console/testing/erb_precompiler.rb +++ b/lib/web_console/testing/erb_precompiler.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'web_console/testing/helper' require 'web_console/testing/fake_middleware' diff --git a/lib/web_console/testing/fake_middleware.rb b/lib/web_console/testing/fake_middleware.rb index b58731a6..4dcf2d39 100644 --- a/lib/web_console/testing/fake_middleware.rb +++ b/lib/web_console/testing/fake_middleware.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'action_view' require 'web_console' require 'web_console/testing/helper' diff --git a/lib/web_console/testing/helper.rb b/lib/web_console/testing/helper.rb index 00a7fa66..ba6f57c9 100644 --- a/lib/web_console/testing/helper.rb +++ b/lib/web_console/testing/helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole module Testing module Helper diff --git a/lib/web_console/version.rb b/lib/web_console/version.rb index fe667298..a7a628cd 100644 --- a/lib/web_console/version.rb +++ b/lib/web_console/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole VERSION = '3.5.1' end diff --git a/lib/web_console/view.rb b/lib/web_console/view.rb index 7e28725d..96e6ddd0 100644 --- a/lib/web_console/view.rb +++ b/lib/web_console/view.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class View < ActionView::Base # Execute a block only on error pages. diff --git a/lib/web_console/whiny_request.rb b/lib/web_console/whiny_request.rb index c70f5138..1ef33a52 100644 --- a/lib/web_console/whiny_request.rb +++ b/lib/web_console/whiny_request.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole # Noisy wrapper around +Request+. # diff --git a/lib/web_console/whitelist.rb b/lib/web_console/whitelist.rb index 80511cef..f14b228f 100644 --- a/lib/web_console/whitelist.rb +++ b/lib/web_console/whitelist.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'ipaddr' module WebConsole diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb index d83690e1..1ff0944d 100644 --- a/test/dummy/app/controllers/application_controller.rb +++ b/test/dummy/app/controllers/application_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. diff --git a/test/dummy/app/controllers/controller_helper_test_controller.rb b/test/dummy/app/controllers/controller_helper_test_controller.rb index 8d5ed7b4..6fc68e9c 100644 --- a/test/dummy/app/controllers/controller_helper_test_controller.rb +++ b/test/dummy/app/controllers/controller_helper_test_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ControllerHelperTestController < ApplicationController def index @instance_variable = "Helper Test" diff --git a/test/dummy/app/controllers/exception_test_controller.rb b/test/dummy/app/controllers/exception_test_controller.rb index d1d2340a..d3591b03 100644 --- a/test/dummy/app/controllers/exception_test_controller.rb +++ b/test/dummy/app/controllers/exception_test_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ExceptionTestController < ApplicationController def index test = "Test" diff --git a/test/dummy/app/controllers/helper_error_controller.rb b/test/dummy/app/controllers/helper_error_controller.rb index d41f82e9..2b1e9e56 100644 --- a/test/dummy/app/controllers/helper_error_controller.rb +++ b/test/dummy/app/controllers/helper_error_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HelperErrorController < ApplicationController def index end diff --git a/test/dummy/app/controllers/helper_test_controller.rb b/test/dummy/app/controllers/helper_test_controller.rb index 2e2b655f..d7aeb82b 100644 --- a/test/dummy/app/controllers/helper_test_controller.rb +++ b/test/dummy/app/controllers/helper_test_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class HelperTestController < ApplicationController def index @helper_test = "Helper Test" diff --git a/test/dummy/app/controllers/model_test_controller.rb b/test/dummy/app/controllers/model_test_controller.rb index 6d891191..76850ace 100644 --- a/test/dummy/app/controllers/model_test_controller.rb +++ b/test/dummy/app/controllers/model_test_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ModelTestController < ApplicationController def index LocalModel.new.work diff --git a/test/dummy/app/controllers/tests_controller.rb b/test/dummy/app/controllers/tests_controller.rb index de36b38c..acd1f3ab 100644 --- a/test/dummy/app/controllers/tests_controller.rb +++ b/test/dummy/app/controllers/tests_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class TestsController < ApplicationController def render_console_ontop_of_text render text: '

Hello World

' diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb index de6be794..15b06f0f 100644 --- a/test/dummy/app/helpers/application_helper.rb +++ b/test/dummy/app/helpers/application_helper.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + module ApplicationHelper end diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 83eab38e..a885ff3c 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require File.expand_path('../boot', __FILE__) require "active_model/railtie" diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb index 6266cfc5..18536532 100644 --- a/test/dummy/config/boot.rb +++ b/test/dummy/config/boot.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb index 82be82d5..d1dc305a 100644 --- a/test/dummy/config/environment.rb +++ b/test/dummy/config/environment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Load the rails application. require File.expand_path('../application', __FILE__) diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb index b16dd2fb..64c57665 100644 --- a/test/dummy/config/environments/development.rb +++ b/test/dummy/config/environments/development.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb index dc33932f..aa6bfef9 100644 --- a/test/dummy/config/environments/production.rb +++ b/test/dummy/config/environments/production.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 897205ee..458b81f1 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb index 59385cdf..4b63f289 100644 --- a/test/dummy/config/initializers/backtrace_silencers.rb +++ b/test/dummy/config/initializers/backtrace_silencers.rb @@ -1,3 +1,5 @@ +# 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. diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb index 4a994e1e..7a4f47b4 100644 --- a/test/dummy/config/initializers/filter_parameter_logging.rb +++ b/test/dummy/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 sensitive parameters which will be filtered from the log file. diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb index ac033bf9..dc847422 100644 --- a/test/dummy/config/initializers/inflections.rb +++ b/test/dummy/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# 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/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb index 72aca7e4..df5ec138 100644 --- a/test/dummy/config/initializers/mime_types.rb +++ b/test/dummy/config/initializers/mime_types.rb @@ -1,3 +1,5 @@ +# 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: diff --git a/test/dummy/config/initializers/secret_token.rb b/test/dummy/config/initializers/secret_token.rb index 8283e678..35005673 100644 --- a/test/dummy/config/initializers/secret_token.rb +++ b/test/dummy/config/initializers/secret_token.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Your secret key is used for verifying the integrity of signed cookies. diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb index 155f7b02..ba27628a 100644 --- a/test/dummy/config/initializers/session_store.rb +++ b/test/dummy/config/initializers/session_store.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb index 33725e95..246168a4 100644 --- a/test/dummy/config/initializers/wrap_parameters.rb +++ b/test/dummy/config/initializers/wrap_parameters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb index 0bad8550..7857fb5b 100644 --- a/test/dummy/config/routes.rb +++ b/test/dummy/config/routes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Rails.application.routes.draw do root to: "exception_test#index" diff --git a/test/support/scenarios/bad_custom_error_scenario.rb b/test/support/scenarios/bad_custom_error_scenario.rb index 3ab47ca3..624f7a15 100644 --- a/test/support/scenarios/bad_custom_error_scenario.rb +++ b/test/support/scenarios/bad_custom_error_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class BadCustomErrorScenario class Error < StandardError diff --git a/test/support/scenarios/basic_nested_scenario.rb b/test/support/scenarios/basic_nested_scenario.rb index cac7c5ae..e8f718d2 100644 --- a/test/support/scenarios/basic_nested_scenario.rb +++ b/test/support/scenarios/basic_nested_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class BasicNestedScenario def call diff --git a/test/support/scenarios/custom_error_scenario.rb b/test/support/scenarios/custom_error_scenario.rb index 2307b3dc..bd6e7037 100644 --- a/test/support/scenarios/custom_error_scenario.rb +++ b/test/support/scenarios/custom_error_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class CustomErrorScenario Error = Class.new(StandardError) diff --git a/test/support/scenarios/eval_nested_scenario.rb b/test/support/scenarios/eval_nested_scenario.rb index d203752a..2ab0485d 100644 --- a/test/support/scenarios/eval_nested_scenario.rb +++ b/test/support/scenarios/eval_nested_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class EvalNestedScenario def call diff --git a/test/support/scenarios/flat_scenario.rb b/test/support/scenarios/flat_scenario.rb index cb1c5372..13fd26f1 100644 --- a/test/support/scenarios/flat_scenario.rb +++ b/test/support/scenarios/flat_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class FlatScenario def call diff --git a/test/support/scenarios/reraised_scenario.rb b/test/support/scenarios/reraised_scenario.rb index 27e3d31c..41defaf7 100644 --- a/test/support/scenarios/reraised_scenario.rb +++ b/test/support/scenarios/reraised_scenario.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module WebConsole class ReraisedScenario def call diff --git a/test/test_helper.rb b/test/test_helper.rb index e6395947..32c5d43c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + case RUBY_ENGINE when 'ruby', 'rbx' require 'simplecov' diff --git a/test/web_console/context_test.rb b/test/web_console/context_test.rb index d124f60a..8e60037c 100644 --- a/test/web_console/context_test.rb +++ b/test/web_console/context_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/evaluator_test.rb b/test/web_console/evaluator_test.rb index d2ea9b95..17161d48 100644 --- a/test/web_console/evaluator_test.rb +++ b/test/web_console/evaluator_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/exception_mapper_test.rb b/test/web_console/exception_mapper_test.rb index a3a4fcd1..5f0aec61 100644 --- a/test/web_console/exception_mapper_test.rb +++ b/test/web_console/exception_mapper_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/extensions_test.rb b/test/web_console/extensions_test.rb index 08a33223..3425555d 100644 --- a/test/web_console/extensions_test.rb +++ b/test/web_console/extensions_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' require 'web_console/extensions' diff --git a/test/web_console/helper_test.rb b/test/web_console/helper_test.rb index ce17400d..e6007d57 100644 --- a/test/web_console/helper_test.rb +++ b/test/web_console/helper_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/integration_test.rb b/test/web_console/integration_test.rb index 284bb6e9..9ad553a6 100644 --- a/test/web_console/integration_test.rb +++ b/test/web_console/integration_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole @@ -5,37 +7,37 @@ class IntegrationTest < ActiveSupport::TestCase test 'Exception#bindings returns all the bindings of where the error originated' do exc = FlatScenario.new.call - assert_equal 4, exc.bindings.first.eval('__LINE__') + assert_equal 6, exc.bindings.first.eval('__LINE__') end test 'Exception#bindings returns all the bindings for a custom error' do exc = CustomErrorScenario.new.call - assert_equal 6, exc.bindings.first.eval('__LINE__') + assert_equal 8, exc.bindings.first.eval('__LINE__') end test 'Exception#bindings returns all the bindings for a bad custom error' do exc = BadCustomErrorScenario.new.call - assert_equal 11, exc.bindings.first.eval('__LINE__') + assert_equal 13, exc.bindings.first.eval('__LINE__') end test 'Exception#bindings goes down the stack' do exc = BasicNestedScenario.new.call - assert_equal 12, exc.bindings.first.eval('__LINE__') + assert_equal 14, exc.bindings.first.eval('__LINE__') end test 'Exception#bindings inside of an eval' do exc = EvalNestedScenario.new.call - assert_equal 12, exc.bindings.first.eval('__LINE__') + assert_equal 14, exc.bindings.first.eval('__LINE__') end test "re-raising doesn't lose Exception#bindings information" do exc = ReraisedScenario.new.call - assert_equal 4, exc.bindings.first.eval('__LINE__') + assert_equal 6, exc.bindings.first.eval('__LINE__') end test 'Exception#bindings is empty when exception is still not raised' do diff --git a/test/web_console/middleware_test.rb b/test/web_console/middleware_test.rb index fdd69190..f4d8b2b3 100644 --- a/test/web_console/middleware_test.rb +++ b/test/web_console/middleware_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/railtie_test.rb b/test/web_console/railtie_test.rb index 406543bb..c04083e1 100644 --- a/test/web_console/railtie_test.rb +++ b/test/web_console/railtie_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/request_test.rb b/test/web_console/request_test.rb index 01aa04db..e3ea2198 100644 --- a/test/web_console/request_test.rb +++ b/test/web_console/request_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/session_test.rb b/test/web_console/session_test.rb index 7ddab51a..30e41671 100644 --- a/test/web_console/session_test.rb +++ b/test/web_console/session_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/whiny_request_test.rb b/test/web_console/whiny_request_test.rb index f993b66c..513a81f1 100644 --- a/test/web_console/whiny_request_test.rb +++ b/test/web_console/whiny_request_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole diff --git a/test/web_console/whitelist_test.rb b/test/web_console/whitelist_test.rb index bdbde275..b04e0194 100644 --- a/test/web_console/whitelist_test.rb +++ b/test/web_console/whitelist_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' module WebConsole