countless 2.0.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 +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +6 -0
- data/CHANGELOG.md +11 -0
- data/gemfiles/rails_8.1.gemfile +21 -0
- data/lib/countless/configuration.rb +40 -2
- data/lib/countless/rake_tasks.rake +0 -2
- data/lib/countless/version.rb +1 -1
- data/lib/countless.rb +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85b2c0713648dcae4e4c58a61e2fc036d09f72ede97a272455160575d857706c
|
|
4
|
+
data.tar.gz: ad4d183c8f45052db876ce47de0284cd4ecc6cb990fbfe001f367faa311ecdbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67bef49fba2d75074da94c9c2a0e9d41d1e802c8811a5d7c4beb5c6413e86453b88cb372a45b08ee84d3a0aca516c85066c06abecfaa92f4e59a590d8d741c08
|
|
7
|
+
data.tar.gz: 9278d34dccec7e2ec980e6fa073f18fea6768318da9e5884e40291a42df3aa9b854449221ba28c874e1b2e678b5ff3667aa6e05a1b49bb8e8834626a1a45de78
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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
|
+
|
|
11
|
+
### 2.1.0 (17 October 2025)
|
|
12
|
+
|
|
13
|
+
* Removed the require of `rspec/core/rake_task` on our Rake tasks file, as it's
|
|
14
|
+
no runtime dependency ([#13](https://github.com/hausgold/countless/pull/13))
|
|
15
|
+
|
|
5
16
|
### 2.0.0 (28 June 2025)
|
|
6
17
|
|
|
7
18
|
* Corrected some RuboCop glitches ([#11](https://github.com/hausgold/countless/pull/11))
|
|
@@ -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
|
-
|
|
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.
|
data/lib/countless/version.rb
CHANGED
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.
|
|
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
|