countless 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a713ecaff32d04b28d10f95940be65cdc3c040b118fcdf842b92d044c10f2797
4
- data.tar.gz: 3c6e382a39a84ffe35cdfa21f0b53d40bd17dbc9b5f85ca1cfb5ddb9ed4884c2
3
+ metadata.gz: 85b2c0713648dcae4e4c58a61e2fc036d09f72ede97a272455160575d857706c
4
+ data.tar.gz: ad4d183c8f45052db876ce47de0284cd4ecc6cb990fbfe001f367faa311ecdbe
5
5
  SHA512:
6
- metadata.gz: bf0e605819c6cc9bc3373c059f0e2c1a6d8aa54cb9a30b8a6ba9aba25e9e4662de5aef81f663c0aed16910217b9638fa5cff175f229d35936f6eda1bc54c90f9
7
- data.tar.gz: a23aa5c83dcfeac17405ecf7f1476f99a0776668a1a3a562d72630432919b1f88477b04391078150a151e553c5cfdef513acbea1e141d8e55c6c04e31f54093f
6
+ metadata.gz: 67bef49fba2d75074da94c9c2a0e9d41d1e802c8811a5d7c4beb5c6413e86453b88cb372a45b08ee84d3a0aca516c85066c06abecfaa92f4e59a590d8d741c08
7
+ data.tar.gz: 9278d34dccec7e2ec980e6fa073f18fea6768318da9e5884e40291a42df3aa9b854449221ba28c874e1b2e678b5ff3667aa6e05a1b49bb8e8834626a1a45de78
@@ -19,7 +19,7 @@ jobs:
19
19
  fail-fast: false
20
20
  matrix:
21
21
  ruby: ['3.2', '3.3', '3.4']
22
- rails: ['7.1', '7.2', '8.0']
22
+ rails: ['7.1', '7.2', '8.0', '8.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
data/Appraisals CHANGED
@@ -17,3 +17,9 @@ appraise 'rails-8.0' do
17
17
  gem 'activerecord', '~> 8.0.0'
18
18
  gem 'activesupport', '~> 8.0.0'
19
19
  end
20
+
21
+ appraise 'rails-8.1' do
22
+ gem 'activejob', '~> 8.1.0'
23
+ gem 'activerecord', '~> 8.1.0'
24
+ gem 'activesupport', '~> 8.1.0'
25
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 2.2.0 (23 October 2025)
6
+
7
+ * Added support for Rails 8.1 ([#14](https://github.com/hausgold/countless/pull/14))
8
+ * Switched from `ActiveSupport::Configurable` to a custom implementation based
9
+ on `ActiveSupport::OrderedOptions` ([#15](https://github.com/hausgold/countless/pull/15))
10
+
5
11
  ### 2.1.0 (17 October 2025)
6
12
 
7
13
  * Removed the require of `rspec/core/rake_task` on our Rake tasks file, as it's
@@ -0,0 +1,21 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.4"
6
+ gem "benchmark-ips", "~> 2.10"
7
+ gem "bundler", "~> 2.6"
8
+ gem "guard-rspec", "~> 4.7"
9
+ gem "irb", "~> 1.2"
10
+ gem "rspec", "~> 3.12"
11
+ gem "rubocop"
12
+ gem "rubocop-rails"
13
+ gem "rubocop-rspec"
14
+ gem "simplecov", ">= 0.22"
15
+ gem "yard", ">= 0.9.28"
16
+ gem "yard-activesupport-concern", ">= 0.0.1"
17
+ gem "activejob", "~> 8.1.0"
18
+ gem "activerecord", "~> 8.1.0"
19
+ gem "activesupport", "~> 8.1.0"
20
+
21
+ gemspec path: "../"
@@ -5,8 +5,46 @@ module Countless
5
5
  #
6
6
  # rubocop:disable Metrics/ClassLength -- because of the various defaults
7
7
  # rubocop:disable Metrics/BlockLength -- ditto
8
- class Configuration
9
- include ActiveSupport::Configurable
8
+ class Configuration < ActiveSupport::OrderedOptions
9
+ # Track our configurations settings (+Symbol+ keys) and their defaults as
10
+ # lazy-loaded +Proc+'s values
11
+ class_attribute :defaults,
12
+ instance_reader: true,
13
+ instance_writer: false,
14
+ instance_predicate: false,
15
+ default: {}
16
+
17
+ # Create a new +Configuration+ instance with all settings populated with
18
+ # their respective defaults.
19
+ #
20
+ # @param args [Hash{Symbol => Mixed}] additional settings which
21
+ # overwrite the defaults
22
+ # @return [Configuration] the new configuration instance
23
+ def initialize(**args)
24
+ super()
25
+ defaults.each { |key, default| self[key] = instance_exec(&default) }
26
+ merge!(**args)
27
+ end
28
+
29
+ # A simple DSL method to define new configuration accessors/settings with
30
+ # their defaults. The defaults can be retrieved with
31
+ # +Configuration.defaults+ or +Configuration.new.defaults+.
32
+ #
33
+ # @param name [Symbol, String] the name of the configuration
34
+ # accessor/setting
35
+ # @param default [Mixed, nil] a non-lazy-loaded static value, serving as a
36
+ # default value for the setting
37
+ # @param block [Proc] when given, the default value will be lazy-loaded
38
+ # (result of the Proc)
39
+ def self.config_accessor(name, default = nil, &block)
40
+ # Save the given configuration accessor default value
41
+ defaults[name.to_sym] = block || -> { default }
42
+
43
+ # Compile reader/writer methods so we don't have to go through
44
+ # +ActiveSupport::OrderedOptions#method_missing+.
45
+ define_method(name) { self[name] }
46
+ define_method("#{name}=") { |value| self[name] = value }
47
+ end
10
48
 
11
49
  # The base/root path of the project to work on. This path is used as a
12
50
  # prefix to all relative path/file configurations.
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Countless
5
5
  # The version of the +countless+ gem
6
- VERSION = '2.1.0'
6
+ VERSION = '2.2.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/countless.rb CHANGED
@@ -4,6 +4,8 @@ require 'zeitwerk'
4
4
  require 'logger'
5
5
  require 'active_support'
6
6
  require 'active_support/concern'
7
+ require 'active_support/ordered_options'
8
+ require 'active_support/core_ext/class/attribute'
7
9
  require 'active_support/core_ext/module/delegation'
8
10
  require 'active_support/core_ext/hash/except'
9
11
  require 'active_support/core_ext/hash/keys'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: countless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -77,6 +77,7 @@ files:
77
77
  - gemfiles/rails_7.1.gemfile
78
78
  - gemfiles/rails_7.2.gemfile
79
79
  - gemfiles/rails_8.0.gemfile
80
+ - gemfiles/rails_8.1.gemfile
80
81
  - lib/countless.rb
81
82
  - lib/countless/annotations.rb
82
83
  - lib/countless/cloc.rb