diff --git a/.gitignore b/.gitignore index c0eff9cc..3cefa2d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .bundle/ +vendor/bundle/ log/*.log pkg/ coverage diff --git a/.rubocop.yml b/.rubocop.yml index abd4c7b7..c72061a9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,4 @@ -require: +plugins: - rubocop-rails - rubocop-rspec - rubocop-rspec_rails @@ -11,7 +11,7 @@ Rails: AllCops: NewCops: enable - TargetRubyVersion: 2.6 + TargetRubyVersion: 3.1 Layout/MultilineMethodCallIndentation: EnforcedStyle: indented @@ -58,7 +58,7 @@ Metrics/BlockLength: - lib/tasks/apipie.rake - lib/apipie/swagger_generator.rb -Naming/PredicateName: +Naming/PredicatePrefix: AllowedMethods: - have_field? diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4d2c2087..d4f9623b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by -# `rubocop --auto-gen-config --exclude-limit 180` -# on 2024-07-10 23:53:15 UTC using RuboCop version 1.65.0. +# `rubocop --auto-gen-config --exclude-limit 250 --no-auto-gen-timestamp` +# using RuboCop version 1.81.7. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -8,47 +8,41 @@ # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec +# Configuration parameters: Severity. Gemspec/DeprecatedAttributeAssignment: Exclude: - 'apipie-rails.gemspec' # Offense count: 12 -# Configuration parameters: EnforcedStyle, AllowedGems, Include. +# Configuration parameters: EnforcedStyle, AllowedGems. # SupportedStyles: Gemfile, gems.rb, gemspec -# Include: **/*.gemspec, **/Gemfile, **/gems.rb Gemspec/DevelopmentDependencies: Exclude: - 'apipie-rails.gemspec' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. -# Include: **/*.gemspec +# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation. Gemspec/OrderedDependencies: Exclude: - 'apipie-rails.gemspec' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec +# Configuration parameters: Severity. Gemspec/RequireMFA: Exclude: - 'apipie-rails.gemspec' - 'spec/dummy/components/test_engine/test_engine.gemspec' # Offense count: 1 -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec +# Configuration parameters: Severity. Gemspec/RequiredRubyVersion: Exclude: - 'spec/dummy/components/test_engine/test_engine.gemspec' # Offense count: 1 -# Configuration parameters: Severity, Include. -# Include: **/*.gemspec +# Configuration parameters: Severity. Gemspec/RubyVersionGlobalsUsage: Exclude: - 'apipie-rails.gemspec' @@ -125,7 +119,7 @@ Layout/ElseAlignment: - 'lib/apipie/param_description.rb' - 'lib/apipie/resource_description.rb' -# Offense count: 59 +# Offense count: 60 # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLineAfterGuardClause: Exclude: @@ -161,7 +155,7 @@ Layout/EmptyLineBetweenDefs: - 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb' - 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb' -# Offense count: 54 +# Offense count: 55 # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLines: Exclude: @@ -258,7 +252,7 @@ Layout/EmptyLinesAroundClassBody: - 'spec/dummy/app/controllers/users_controller.rb' - 'spec/dummy/config/initializers/apipie.rb' -# Offense count: 6 +# Offense count: 7 # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLinesAroundMethodBody: Exclude: @@ -385,7 +379,7 @@ Layout/IndentationWidth: # Offense count: 15 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment, AllowRBSInlineAnnotation, AllowSteepAnnotation. Layout/LeadingCommentSpace: Exclude: - 'lib/apipie/dsl_definition.rb' @@ -572,7 +566,7 @@ Layout/SpaceInsideParens: - 'spec/lib/apipie/method_description/apis_service_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' -# Offense count: 14 +# Offense count: 13 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: final_newline, final_blank_line @@ -586,7 +580,6 @@ Layout/TrailingEmptyLines: - 'spec/dummy/app/controllers/pets_controller.rb' - 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb' - 'spec/dummy/app/controllers/tagged_dogs_controller.rb' - - 'spec/dummy/config/boot.rb' - 'spec/dummy/config/environments/development.rb' - 'spec/dummy/config/initializers/secret_token.rb' - 'spec/lib/apipie/generator/swagger/operation_id_spec.rb' @@ -663,6 +656,13 @@ Lint/ParenthesesAsGroupedExpression: Exclude: - 'lib/apipie/param_description.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/RedundantDirGlobSort: + Exclude: + - 'lib/apipie/application.rb' + - 'spec/spec_helper.rb' + # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). Lint/RedundantStringCoercion: @@ -678,12 +678,6 @@ Lint/SendWithMixinArgument: - 'lib/apipie/routing.rb' - 'spec/dummy/config/application.rb' -# Offense count: 2 -Lint/ShadowingOuterLocalVariable: - Exclude: - - 'lib/apipie/extractor/writer.rb' - - 'lib/apipie/swagger_generator.rb' - # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). Lint/ToJSON: @@ -702,7 +696,7 @@ Lint/UnderscorePrefixedVariableName: # Offense count: 22 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Exclude: - 'lib/apipie/configuration.rb' @@ -717,7 +711,8 @@ Lint/UnusedBlockArgument: # Offense count: 24 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions. +# NotImplementedExceptions: NotImplementedError Lint/UnusedMethodArgument: Exclude: - 'lib/apipie/dsl_definition.rb' @@ -727,8 +722,7 @@ Lint/UnusedMethodArgument: - 'spec/support/custom_bool_validator.rb' # Offense count: 5 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AutoCorrect. +# This cop supports safe autocorrection (--autocorrect). Lint/UselessAssignment: Exclude: - 'lib/apipie/application.rb' @@ -736,16 +730,9 @@ Lint/UselessAssignment: - 'lib/apipie/method_description.rb' - 'spec/controllers/api/v1/architectures_controller_spec.rb' -# Offense count: 2 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AutoCorrect. -Lint/UselessMethodDefinition: - Exclude: - - 'spec/dummy/app/controllers/overridden_concerns_controller.rb' - # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects. +# Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'spec/controllers/users_controller_spec.rb' @@ -756,15 +743,10 @@ Lint/Void: Metrics/AbcSize: Max: 96 -# Offense count: 1 -# Configuration parameters: CountBlocks, CountModifierForms. -Metrics/BlockNesting: - Max: 4 - # Offense count: 25 # Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: - Max: 24 + Max: 22 # Offense count: 79 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. @@ -774,7 +756,7 @@ Metrics/MethodLength: # Offense count: 1 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 119 + Max: 117 # Offense count: 5 # Configuration parameters: CountKeywordArgs. @@ -835,13 +817,27 @@ Naming/MethodParameterName: - 'lib/apipie/method_description.rb' - 'spec/controllers/users_controller_spec.rb' +# Offense count: 15 +# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates. +# AllowedMethods: call +# WaywardPredicates: nonzero? +Naming/PredicateMethod: + Exclude: + - 'app/controllers/apipie/apipies_controller.rb' + - 'lib/apipie/response_description.rb' + - 'lib/apipie/static_dispatcher.rb' + - 'lib/apipie/validator.rb' + - 'spec/dummy/config/initializers/apipie.rb' + - 'spec/spec_helper.rb' + - 'spec/support/custom_bool_validator.rb' + # Offense count: 7 -# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. -# NamePrefix: is_, has_, have_ -# ForbiddenPrefixes: is_, has_, have_ +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs. +# NamePrefix: is_, has_, have_, does_ +# ForbiddenPrefixes: is_, has_, have_, does_ # AllowedMethods: is_a? # MethodDefinitionMacros: define_method, define_singleton_method -Naming/PredicateName: +Naming/PredicatePrefix: Exclude: - 'lib/apipie/param_description.rb' - 'lib/apipie/response_description.rb' @@ -851,11 +847,17 @@ Naming/PredicateName: # Offense count: 1 # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 +# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 Naming/VariableNumber: Exclude: - 'spec/dummy/app/controllers/users_controller.rb' +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Performance/BindCall: + Exclude: + - 'lib/apipie/dsl_definition.rb' + # Offense count: 4 # Configuration parameters: MinSize. Performance/CollectionLiteralInLoop: @@ -877,6 +879,15 @@ Performance/Detect: Exclude: - 'spec/lib/swagger/rake_swagger_spec.rb' +# Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/MapCompact: + Exclude: + - 'lib/apipie/application.rb' + - 'lib/apipie/param_description.rb' + - 'lib/apipie/response_description.rb' + - 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Performance/RedundantBlockCall: @@ -941,7 +952,7 @@ RSpec/BeforeAfterAll: Exclude: - 'spec/controllers/users_controller_spec.rb' -# Offense count: 54 +# Offense count: 57 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: @@ -991,7 +1002,6 @@ RSpec/DescribedClass: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AutoCorrect. RSpec/EmptyExampleGroup: Exclude: - 'spec/lib/apipie/generator/swagger/param_description/composite_spec.rb' @@ -1041,7 +1051,6 @@ RSpec/HookArgument: # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect. RSpec/HooksBeforeExamples: Exclude: - 'spec/controllers/users_controller_spec.rb' @@ -1088,12 +1097,12 @@ RSpec/MessageSpies: RSpec/MultipleExpectations: Max: 19 -# Offense count: 170 +# Offense count: 176 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: Max: 15 -# Offense count: 85 +# Offense count: 89 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: @@ -1113,7 +1122,7 @@ RSpec/NamedSubject: - 'spec/lib/swagger/rake_swagger_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' -# Offense count: 99 +# Offense count: 105 # Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 6 @@ -1182,6 +1191,16 @@ RSpec/VoidExpect: Exclude: - 'spec/lib/apipie/extractor/writer_spec.rb' +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: ExpectedOrder. +# ExpectedOrder: index, show, new, edit, create, update, destroy +Rails/ActionOrder: + Exclude: + - 'spec/dummy/app/controllers/overridden_concerns_controller.rb' + - 'spec/dummy/app/controllers/twitter_example_controller.rb' + - 'spec/dummy/app/controllers/users_controller.rb' + # Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationController: @@ -1198,14 +1217,13 @@ Rails/Delegate: Exclude: - 'lib/apipie/response_description_adapter.rb' -# Offense count: 25 +# Offense count: 24 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: Exclude: - 'lib/apipie/configuration.rb' - - 'lib/apipie/dsl_definition.rb' - 'lib/tasks/apipie.rake' - 'spec/dummy/config/initializers/apipie.rb' - 'spec/lib/apipie/apipies_controller_spec.rb' @@ -1233,15 +1251,14 @@ Rails/NegateInclude: - 'lib/apipie/extractor/writer.rb' - 'spec/spec_helper.rb' -# Offense count: 6 +# Offense count: 24 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include. -# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb Rails/Output: Exclude: - 'lib/apipie/apipie_module.rb' - 'lib/apipie/extractor.rb' - 'lib/apipie/rspec/response_validation_helper.rb' + - 'spec/lib/swagger/swagger_dsl_spec.rb' # Offense count: 2 Rails/OutputSafety: @@ -1268,8 +1285,6 @@ Rails/Present: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include. -# Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: Exclude: - 'lib/tasks/apipie.rake' @@ -1311,6 +1326,17 @@ Style/AndOr: Exclude: - 'lib/apipie/param_description.rb' +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames. +# RedundantRestArgumentNames: args, arguments +# RedundantKeywordRestArgumentNames: kwargs, options, opts +# RedundantBlockArgumentNames: blk, block, proc +Style/ArgumentsForwarding: + Exclude: + - 'lib/apipie/apipie_module.rb' + - 'lib/apipie/dsl_definition.rb' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowOnConstant, AllowOnSelfClass. @@ -1320,8 +1346,10 @@ Style/CaseEquality: # Offense count: 43 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. +# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules. # SupportedStyles: nested, compact +# SupportedStylesForClasses: ~, nested, compact +# SupportedStylesForModules: ~, nested, compact Style/ClassAndModuleChildren: Exclude: - 'lib/apipie/core_ext/route.rb' @@ -1382,6 +1410,13 @@ Style/ClassEqualityComparison: - 'lib/apipie/application.rb' - 'lib/apipie/validator.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/CollectionQuerying: + Exclude: + - 'lib/apipie/generator/swagger/warning_writer.rb' + - 'lib/apipie/see_description.rb' + # Offense count: 19 # This cop supports safe autocorrection (--autocorrect). Style/ColonMethodCall: @@ -1402,7 +1437,7 @@ Style/CommentAnnotation: - 'spec/lib/swagger/rake_swagger_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' -# Offense count: 17 +# Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: @@ -1444,7 +1479,7 @@ Style/EmptyCaseCondition: # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, EnforcedStyle, AllowComments. +# Configuration parameters: EnforcedStyle, AllowComments. # SupportedStyles: empty, nil, both Style/EmptyElse: Exclude: @@ -1454,7 +1489,7 @@ Style/EmptyElse: # Offense count: 27 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, EnforcedStyle. +# Configuration parameters: EnforcedStyle. # SupportedStyles: compact, expanded Style/EmptyMethod: Exclude: @@ -1478,7 +1513,7 @@ Style/Encoding: # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedVars. +# Configuration parameters: AllowedVars, DefaultToNil. Style/FetchEnvVar: Exclude: - 'lib/tasks/apipie.rake' @@ -1505,7 +1540,7 @@ Style/For: # Offense count: 7 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns. # SupportedStyles: annotated, template, unannotated # AllowedMethods: redirect Style/FormatStringToken: @@ -1702,6 +1737,8 @@ Style/RedundantAssignment: # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods. +# AllowedMethods: nonzero? Style/RedundantCondition: Exclude: - 'lib/apipie/response_description.rb' @@ -1720,11 +1757,14 @@ Style/RedundantInterpolation: - 'lib/tasks/apipie.rake' - 'spec/lib/swagger/rake_swagger_spec.rb' -# Offense count: 1 +# Offense count: 4 # This cop supports safe autocorrection (--autocorrect). Style/RedundantParentheses: Exclude: - 'lib/apipie/extractor/collector.rb' + - 'lib/apipie/param_description.rb' + - 'lib/tasks/apipie.rake' + - 'spec/lib/swagger/rake_swagger_spec.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). @@ -1927,7 +1967,7 @@ Style/SymbolArray: # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma +# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma Style/TrailingCommaInArrayLiteral: Exclude: - 'spec/controllers/users_controller_spec.rb' @@ -1936,7 +1976,7 @@ Style/TrailingCommaInArrayLiteral: # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma +# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma Style/TrailingCommaInHashLiteral: Exclude: - 'lib/apipie/generator/swagger/param_description.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e770558..70d93200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ Changelog =========== +## [v1.6.0](https://github.com/Apipie/apipie-rails/tree/v1.6.0) (TBD) +[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.5.0...v1.6.0) +* **BREAKING**: Drop support for Ruby < 3.1 and Rails < 7.0 +* Fix Rails 8.1 router keyword args deprecation warning +* Update rubocop configuration to use plugins instead of require +* Remove conditional code for Rails 5.x and 6.x + ## [v1.5.0](https://github.com/Apipie/apipie-rails/tree/v1.5.0) (2025-08-19) [Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.4.2...v1.5.0) * Don't collect records without an action (Evgeni Golov) diff --git a/apipie-rails.gemspec b/apipie-rails.gemspec index 6063dc63..96dbb43d 100644 --- a/apipie-rails.gemspec +++ b/apipie-rails.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |s| s.homepage = "https://github.com/Apipie/apipie-rails" s.summary = %q{Rails REST API documentation tool} s.description = %q{Rails REST API documentation tool} - s.required_ruby_version = '>= 2.6.0' + s.required_ruby_version = '>= 3.1.0' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") @@ -23,8 +23,8 @@ Gem::Specification.new do |s| "source_code_uri" => "https://github.com/Apipie/apipie-rails" } - s.add_dependency "actionpack", ">= 5.0" - s.add_dependency "activesupport", ">= 5.0" + s.add_dependency "actionpack", ">= 7.0" + s.add_dependency "activesupport", ">= 7.0" # Optional dependencies s.add_development_dependency "maruku" # for Markdown support @@ -38,7 +38,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'rubocop-rails' s.add_development_dependency 'rubocop-rspec' s.add_development_dependency 'rubocop-performance' - s.add_development_dependency 'rubocop-rspec_rails' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7") + s.add_development_dependency 'rubocop-rspec_rails' s.add_development_dependency "simplecov" s.add_development_dependency "sqlite3" end diff --git a/lib/apipie/routing.rb b/lib/apipie/routing.rb index e7d1fc7d..2a03251a 100644 --- a/lib/apipie/routing.rb +++ b/lib/apipie/routing.rb @@ -7,7 +7,7 @@ def apipie(options = {}) constraints(:version => %r{[^/]+}, :resource => %r{[^/]+}, :method => %r{[^/]+}) do get_args = options.reverse_merge("(:version)/(:resource)/(:method)" => "apipies#index", :as => :apipie) - Rails.version >= "5.2" ? get(**get_args) : get(get_args) + get(**get_args) end end end diff --git a/lib/apipie/version.rb b/lib/apipie/version.rb index d32f7829..cc1655fe 100644 --- a/lib/apipie/version.rb +++ b/lib/apipie/version.rb @@ -1,3 +1,3 @@ module Apipie - VERSION = "1.5.0".freeze + VERSION = "1.6.0".freeze end