diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0d6775c..daca142 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-12-11 04:03:08 UTC using RuboCop version 1.58.0. +# on 2023-12-16 21:20:23 UTC using RuboCop version 1.59.0. # 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 @@ -37,6 +37,14 @@ Metrics/AbcSize: Metrics/MethodLength: Max: 11 +# Offense count: 1 +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# CheckDefinitionPathHierarchyRoots: lib, spec, test, src +# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS +Naming/FileName: + Exclude: + - 'lib/cloudflare-rails.rb' + # Offense count: 2 # Configuration parameters: ForbiddenDelimiters. # ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ec8f68..a8a44a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.0.1] - 2023-12-16 +- Fix `zeitwerk` loading issue (https://github.com/modosc/cloudflare-rails/pull/105) + ## [5.0.0] - 2023-12-15 ### Breaking Changes - Change namespace from `Cloudflare::Rails` to `CloudflareRails`. This avoids issues with the [cloudflare](https://github.com/socketry/cloudflare) gem as well as the global `Rails` namespace. diff --git a/lib/cloudflare-rails.rb b/lib/cloudflare-rails.rb new file mode 100644 index 0000000..ee45fca --- /dev/null +++ b/lib/cloudflare-rails.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require 'cloudflare_rails' diff --git a/lib/cloudflare_rails.rb b/lib/cloudflare_rails.rb index db29bbe..a785a77 100644 --- a/lib/cloudflare_rails.rb +++ b/lib/cloudflare_rails.rb @@ -1,7 +1,9 @@ require 'zeitwerk' loader = Zeitwerk::Loader.for_gem +loader.ignore("#{__dir__}/cloudflare-rails.rb") loader.setup -loader.eager_load module CloudflareRails end + +loader.eager_load diff --git a/lib/cloudflare_rails/version.rb b/lib/cloudflare_rails/version.rb index ab29bc0..269c7cc 100644 --- a/lib/cloudflare_rails/version.rb +++ b/lib/cloudflare_rails/version.rb @@ -1,3 +1,3 @@ module CloudflareRails - VERSION = '5.0.0'.freeze + VERSION = '5.0.1'.freeze end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cf49493..97aa0f6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,12 +1,6 @@ -# copied from https://codingdaily.wordpress.com/2011/01/14/test-a-gem-with-the-rails-3-stack/ -$LOAD_PATH.unshift File.expand_path('../lib', __dir__) - ENV['RAILS_ENV'] ||= 'test' require 'bundler/setup' -Bundler.setup - -require 'rubygems' require 'pry' # Only the parts of rails we want to use @@ -24,7 +18,7 @@ require 'rack/attack' end -require 'cloudflare_rails' +require 'cloudflare-rails' if ENV['RACK_ATTACK'] == 'last' # pull in rack/attack last to make sure patches work with it