From acbcbc8beb0a1242cdf7247e82311149197d8173 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sun, 11 Nov 2018 07:54:07 +0900 Subject: [PATCH] Format --- Gemfile | 1 + kaminari-actionview/kaminari-actionview.gemspec | 1 + kaminari-actionview/lib/kaminari/actionview.rb | 1 + .../lib/kaminari/actionview/action_view_extension.rb | 1 + kaminari-actionview/lib/kaminari/actionview/version.rb | 1 + kaminari-activerecord/kaminari-activerecord.gemspec | 1 + kaminari-activerecord/lib/kaminari/activerecord.rb | 1 + .../lib/kaminari/activerecord/active_record_extension.rb | 1 + .../lib/kaminari/activerecord/active_record_model_extension.rb | 1 + .../lib/kaminari/activerecord/active_record_relation_methods.rb | 1 + kaminari-activerecord/lib/kaminari/activerecord/version.rb | 1 + kaminari-core/kaminari-core.gemspec | 1 + kaminari-core/lib/generators/kaminari/config_generator.rb | 1 + .../lib/generators/kaminari/templates/kaminari_config.rb | 1 + kaminari-core/lib/generators/kaminari/views_generator.rb | 1 + kaminari-core/lib/kaminari/core.rb | 1 + kaminari-core/lib/kaminari/core/version.rb | 1 + kaminari-core/lib/kaminari/engine.rb | 1 + kaminari-core/lib/kaminari/exceptions.rb | 1 + kaminari-core/lib/kaminari/helpers/paginator.rb | 1 + kaminari-core/lib/kaminari/helpers/tags.rb | 1 + kaminari-core/lib/kaminari/models/array_extension.rb | 1 + kaminari-core/lib/kaminari/models/configuration_methods.rb | 1 + kaminari-core/lib/kaminari/models/page_scope_methods.rb | 1 + kaminari-core/lib/kaminari/railtie.rb | 1 + kaminari-core/test/config/config_test.rb | 1 + kaminari-core/test/fake_app/active_record/models.rb | 1 + kaminari-core/test/fake_app/rails_app.rb | 1 + kaminari-core/test/fake_gem.rb | 1 + kaminari-core/test/generators/views_generator_test.rb | 1 + kaminari-core/test/helpers/action_view_extension_test.rb | 1 + kaminari-core/test/helpers/helpers_test.rb | 1 + kaminari-core/test/helpers/paginator_tags_test.rb | 1 + kaminari-core/test/helpers/tags_test.rb | 1 + .../models/active_record/active_record_relation_methods_test.rb | 1 + kaminari-core/test/models/active_record/inherited_test.rb | 1 + .../test/models/active_record/paginable_without_count_test.rb | 1 + kaminari-core/test/models/active_record/scopes_test.rb | 1 + kaminari-core/test/models/array_test.rb | 1 + kaminari-core/test/models/configuration_methods_test.rb | 1 + kaminari-core/test/requests/navigation_test.rb | 1 + kaminari-core/test/requests/request_format_test.rb | 1 + kaminari.gemspec | 1 + lib/kaminari.rb | 1 + lib/kaminari/version.rb | 1 + test/test_helper.rb | 1 + 46 files changed, 46 insertions(+) diff --git a/Gemfile b/Gemfile index afbebf4..9f9179f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ # frozen_string_literal: true + source 'https://rubygems.org' # Specify your gem's dependencies in kaminari.gemspec diff --git a/kaminari-actionview/kaminari-actionview.gemspec b/kaminari-actionview/kaminari-actionview.gemspec index 60c0fc6..6db789b 100644 --- a/kaminari-actionview/kaminari-actionview.gemspec +++ b/kaminari-actionview/kaminari-actionview.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'kaminari/actionview/version' diff --git a/kaminari-actionview/lib/kaminari/actionview.rb b/kaminari-actionview/lib/kaminari/actionview.rb index 5000ad8..7dad893 100644 --- a/kaminari-actionview/lib/kaminari/actionview.rb +++ b/kaminari-actionview/lib/kaminari/actionview.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "kaminari/actionview/version" require 'active_support/lazy_load_hooks' diff --git a/kaminari-actionview/lib/kaminari/actionview/action_view_extension.rb b/kaminari-actionview/lib/kaminari/actionview/action_view_extension.rb index a85fa39..82eaf1b 100644 --- a/kaminari-actionview/lib/kaminari/actionview/action_view_extension.rb +++ b/kaminari-actionview/lib/kaminari/actionview/action_view_extension.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'action_view' require 'action_view/log_subscriber' require 'action_view/context' diff --git a/kaminari-actionview/lib/kaminari/actionview/version.rb b/kaminari-actionview/lib/kaminari/actionview/version.rb index 147d371..1162b24 100644 --- a/kaminari-actionview/lib/kaminari/actionview/version.rb +++ b/kaminari-actionview/lib/kaminari/actionview/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Actionview VERSION = '1.1.1' diff --git a/kaminari-activerecord/kaminari-activerecord.gemspec b/kaminari-activerecord/kaminari-activerecord.gemspec index 489f813..3cf0068 100644 --- a/kaminari-activerecord/kaminari-activerecord.gemspec +++ b/kaminari-activerecord/kaminari-activerecord.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'kaminari/activerecord/version' diff --git a/kaminari-activerecord/lib/kaminari/activerecord.rb b/kaminari-activerecord/lib/kaminari/activerecord.rb index d67a73f..b9a7835 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "kaminari/activerecord/version" require 'active_support/lazy_load_hooks' diff --git a/kaminari-activerecord/lib/kaminari/activerecord/active_record_extension.rb b/kaminari-activerecord/lib/kaminari/activerecord/active_record_extension.rb index fb09440..e2f6dd4 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord/active_record_extension.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord/active_record_extension.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'kaminari/activerecord/active_record_model_extension' module Kaminari diff --git a/kaminari-activerecord/lib/kaminari/activerecord/active_record_model_extension.rb b/kaminari-activerecord/lib/kaminari/activerecord/active_record_model_extension.rb index 64f1c04..ec017a0 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord/active_record_model_extension.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord/active_record_model_extension.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'kaminari/activerecord/active_record_relation_methods' module Kaminari diff --git a/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb b/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb index fde3eda..648f938 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari # Active Record specific page scope methods implementations module ActiveRecordRelationMethods diff --git a/kaminari-activerecord/lib/kaminari/activerecord/version.rb b/kaminari-activerecord/lib/kaminari/activerecord/version.rb index 9dcd98a..0da7d1b 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord/version.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Activerecord VERSION = '1.1.1' diff --git a/kaminari-core/kaminari-core.gemspec b/kaminari-core/kaminari-core.gemspec index e10bea8..6eb6465 100644 --- a/kaminari-core/kaminari-core.gemspec +++ b/kaminari-core/kaminari-core.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'kaminari/core/version' diff --git a/kaminari-core/lib/generators/kaminari/config_generator.rb b/kaminari-core/lib/generators/kaminari/config_generator.rb index 84ec6e6..263bc35 100644 --- a/kaminari-core/lib/generators/kaminari/config_generator.rb +++ b/kaminari-core/lib/generators/kaminari/config_generator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Generators # rails g kaminari:config diff --git a/kaminari-core/lib/generators/kaminari/templates/kaminari_config.rb b/kaminari-core/lib/generators/kaminari/templates/kaminari_config.rb index c808667..b936633 100644 --- a/kaminari-core/lib/generators/kaminari/templates/kaminari_config.rb +++ b/kaminari-core/lib/generators/kaminari/templates/kaminari_config.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Kaminari.configure do |config| # config.default_per_page = 25 # config.max_per_page = nil diff --git a/kaminari-core/lib/generators/kaminari/views_generator.rb b/kaminari-core/lib/generators/kaminari/views_generator.rb index 9a8bb86..4b0923b 100644 --- a/kaminari-core/lib/generators/kaminari/views_generator.rb +++ b/kaminari-core/lib/generators/kaminari/views_generator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Generators # rails g kaminari:views THEME diff --git a/kaminari-core/lib/kaminari/core.rb b/kaminari-core/lib/kaminari/core.rb index 1b7cc97..0408617 100644 --- a/kaminari-core/lib/kaminari/core.rb +++ b/kaminari-core/lib/kaminari/core.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari end diff --git a/kaminari-core/lib/kaminari/core/version.rb b/kaminari-core/lib/kaminari/core/version.rb index 3a8ef96..6682cac 100644 --- a/kaminari-core/lib/kaminari/core/version.rb +++ b/kaminari-core/lib/kaminari/core/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Core VERSION = '1.1.1' diff --git a/kaminari-core/lib/kaminari/engine.rb b/kaminari-core/lib/kaminari/engine.rb index badc40c..e1dc327 100644 --- a/kaminari-core/lib/kaminari/engine.rb +++ b/kaminari-core/lib/kaminari/engine.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari #:nodoc: class Engine < ::Rails::Engine #:nodoc: end diff --git a/kaminari-core/lib/kaminari/exceptions.rb b/kaminari-core/lib/kaminari/exceptions.rb index 02db120..52247df 100644 --- a/kaminari-core/lib/kaminari/exceptions.rb +++ b/kaminari-core/lib/kaminari/exceptions.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari class ZeroPerPageOperation < ZeroDivisionError; end end diff --git a/kaminari-core/lib/kaminari/helpers/paginator.rb b/kaminari-core/lib/kaminari/helpers/paginator.rb index f7c4cc0..d89cc42 100644 --- a/kaminari-core/lib/kaminari/helpers/paginator.rb +++ b/kaminari-core/lib/kaminari/helpers/paginator.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'active_support/inflector' require 'kaminari/helpers/tags' diff --git a/kaminari-core/lib/kaminari/helpers/tags.rb b/kaminari-core/lib/kaminari/helpers/tags.rb index 3c4c440..99dfebc 100644 --- a/kaminari-core/lib/kaminari/helpers/tags.rb +++ b/kaminari-core/lib/kaminari/helpers/tags.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module Helpers PARAM_KEY_BLACKLIST = [:authenticity_token, :commit, :utf8, :_method, :script_name].freeze diff --git a/kaminari-core/lib/kaminari/models/array_extension.rb b/kaminari-core/lib/kaminari/models/array_extension.rb index d5af70c..5ce2c4d 100644 --- a/kaminari-core/lib/kaminari/models/array_extension.rb +++ b/kaminari-core/lib/kaminari/models/array_extension.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'active_support/core_ext/module' module Kaminari # Kind of Array that can paginate diff --git a/kaminari-core/lib/kaminari/models/configuration_methods.rb b/kaminari-core/lib/kaminari/models/configuration_methods.rb index bbe7440..cb5c9ac 100644 --- a/kaminari-core/lib/kaminari/models/configuration_methods.rb +++ b/kaminari-core/lib/kaminari/models/configuration_methods.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module ConfigurationMethods #:nodoc: extend ActiveSupport::Concern diff --git a/kaminari-core/lib/kaminari/models/page_scope_methods.rb b/kaminari-core/lib/kaminari/models/page_scope_methods.rb index a3e86db..d5ac025 100644 --- a/kaminari-core/lib/kaminari/models/page_scope_methods.rb +++ b/kaminari-core/lib/kaminari/models/page_scope_methods.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module PageScopeMethods # Specify the per_page value for the preceding page scope diff --git a/kaminari-core/lib/kaminari/railtie.rb b/kaminari-core/lib/kaminari/railtie.rb index 793d854..9b83c38 100644 --- a/kaminari-core/lib/kaminari/railtie.rb +++ b/kaminari-core/lib/kaminari/railtie.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari class Railtie < ::Rails::Railtie #:nodoc: # Doesn't actually do anything. Just keeping this hook point, mainly for compatibility diff --git a/kaminari-core/test/config/config_test.rb b/kaminari-core/test/config/config_test.rb index 8806324..753c76b 100644 --- a/kaminari-core/test/config/config_test.rb +++ b/kaminari-core/test/config/config_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class ConfigurationTest < ::Test::Unit::TestCase diff --git a/kaminari-core/test/fake_app/active_record/models.rb b/kaminari-core/test/fake_app/active_record/models.rb index 77cfd03..374ac18 100644 --- a/kaminari-core/test/fake_app/active_record/models.rb +++ b/kaminari-core/test/fake_app/active_record/models.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # models class User < ActiveRecord::Base has_many :authorships diff --git a/kaminari-core/test/fake_app/rails_app.rb b/kaminari-core/test/fake_app/rails_app.rb index 4999fdf..7e42607 100644 --- a/kaminari-core/test/fake_app/rails_app.rb +++ b/kaminari-core/test/fake_app/rails_app.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # require 'rails/all' require 'action_controller/railtie' require 'action_view/railtie' diff --git a/kaminari-core/test/fake_gem.rb b/kaminari-core/test/fake_gem.rb index 03e3010..2fb8362 100644 --- a/kaminari-core/test/fake_gem.rb +++ b/kaminari-core/test/fake_gem.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari module FakeGem extend ActiveSupport::Concern diff --git a/kaminari-core/test/generators/views_generator_test.rb b/kaminari-core/test/generators/views_generator_test.rb index 587c43b..518a80c 100644 --- a/kaminari-core/test/generators/views_generator_test.rb +++ b/kaminari-core/test/generators/views_generator_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined?(::Rails::Railtie) && ENV['GENERATOR_SPEC'] diff --git a/kaminari-core/test/helpers/action_view_extension_test.rb b/kaminari-core/test/helpers/action_view_extension_test.rb index 6160158..a99dc75 100644 --- a/kaminari-core/test/helpers/action_view_extension_test.rb +++ b/kaminari-core/test/helpers/action_view_extension_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined?(::Rails::Railtie) && defined?(::ActionView) diff --git a/kaminari-core/test/helpers/helpers_test.rb b/kaminari-core/test/helpers/helpers_test.rb index adcf966..2cb86a8 100644 --- a/kaminari-core/test/helpers/helpers_test.rb +++ b/kaminari-core/test/helpers/helpers_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class PaginatorHelperTest < ActiveSupport::TestCase diff --git a/kaminari-core/test/helpers/paginator_tags_test.rb b/kaminari-core/test/helpers/paginator_tags_test.rb index 426c962..6bcb7b9 100644 --- a/kaminari-core/test/helpers/paginator_tags_test.rb +++ b/kaminari-core/test/helpers/paginator_tags_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined? ::Kaminari::ActionView diff --git a/kaminari-core/test/helpers/tags_test.rb b/kaminari-core/test/helpers/tags_test.rb index feb8bd9..8445ad9 100644 --- a/kaminari-core/test/helpers/tags_test.rb +++ b/kaminari-core/test/helpers/tags_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined?(::Rails::Railtie) && defined?(ActionView) diff --git a/kaminari-core/test/models/active_record/active_record_relation_methods_test.rb b/kaminari-core/test/models/active_record/active_record_relation_methods_test.rb index d7e2ac2..5a4169c 100644 --- a/kaminari-core/test/models/active_record/active_record_relation_methods_test.rb +++ b/kaminari-core/test/models/active_record/active_record_relation_methods_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined? ActiveRecord diff --git a/kaminari-core/test/models/active_record/inherited_test.rb b/kaminari-core/test/models/active_record/inherited_test.rb index 0eaeee9..ad17f29 100644 --- a/kaminari-core/test/models/active_record/inherited_test.rb +++ b/kaminari-core/test/models/active_record/inherited_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined? ActiveRecord diff --git a/kaminari-core/test/models/active_record/paginable_without_count_test.rb b/kaminari-core/test/models/active_record/paginable_without_count_test.rb index 821bcee..0d0238b 100644 --- a/kaminari-core/test/models/active_record/paginable_without_count_test.rb +++ b/kaminari-core/test/models/active_record/paginable_without_count_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined? ActiveRecord diff --git a/kaminari-core/test/models/active_record/scopes_test.rb b/kaminari-core/test/models/active_record/scopes_test.rb index e519f76..d852844 100644 --- a/kaminari-core/test/models/active_record/scopes_test.rb +++ b/kaminari-core/test/models/active_record/scopes_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' if defined? ActiveRecord diff --git a/kaminari-core/test/models/array_test.rb b/kaminari-core/test/models/array_test.rb index b363df4..dba6da5 100644 --- a/kaminari-core/test/models/array_test.rb +++ b/kaminari-core/test/models/array_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class PaginatableArrayTest < ActiveSupport::TestCase diff --git a/kaminari-core/test/models/configuration_methods_test.rb b/kaminari-core/test/models/configuration_methods_test.rb index 8733d9e..313812c 100644 --- a/kaminari-core/test/models/configuration_methods_test.rb +++ b/kaminari-core/test/models/configuration_methods_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class ConfigurationMethodsTest < ActiveSupport::TestCase diff --git a/kaminari-core/test/requests/navigation_test.rb b/kaminari-core/test/requests/navigation_test.rb index 73a1dbf..f84a341 100644 --- a/kaminari-core/test/requests/navigation_test.rb +++ b/kaminari-core/test/requests/navigation_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class NavigationTest < Test::Unit::TestCase diff --git a/kaminari-core/test/requests/request_format_test.rb b/kaminari-core/test/requests/request_format_test.rb index c5a177b..4c1fe49 100644 --- a/kaminari-core/test/requests/request_format_test.rb +++ b/kaminari-core/test/requests/request_format_test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'test_helper' class RenderingWithFormatOptionTest < Test::Unit::TestCase diff --git a/kaminari.gemspec b/kaminari.gemspec index 277aef6..8952f64 100644 --- a/kaminari.gemspec +++ b/kaminari.gemspec @@ -1,4 +1,5 @@ # frozen_string_literal: true + $:.push File.expand_path("../lib", __FILE__) require "kaminari/version" diff --git a/lib/kaminari.rb b/lib/kaminari.rb index 819aee3..470a0d8 100644 --- a/lib/kaminari.rb +++ b/lib/kaminari.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require 'kaminari/core' require 'kaminari/actionview' require 'kaminari/activerecord' diff --git a/lib/kaminari/version.rb b/lib/kaminari/version.rb index eb0fe1d..231dfe3 100644 --- a/lib/kaminari/version.rb +++ b/lib/kaminari/version.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Kaminari VERSION = '1.1.1' end diff --git a/test/test_helper.rb b/test/test_helper.rb index c82652c..85176ad 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.join(Gem.loaded_specs['kaminari-core'].gem_dir, 'test')) $LOAD_PATH.unshift(File.dirname(__FILE__))