everythingrb 0.8.0 → 0.8.1

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: 0b3c80f8891826722af0d521a4dad5ba31e90540ad46cc31e25d6fc0ed34cd52
4
- data.tar.gz: 8e7f1daa4a9db4e31b2c4c3f58d3573ed36d833ab98e51d2daa997839f28eefd
3
+ metadata.gz: 690fd1806244edcbfb5eb400b41c03f469395dd60b4aae710525f0deaee74987
4
+ data.tar.gz: eb30c2bf26c9a760d44a5615c7469ee3217b077129e4d703d12072ed5518772c
5
5
  SHA512:
6
- metadata.gz: 9bc88ea3c150c7e6cb6b55364d78f2eb863ec368c39b40f1f7d855dbaa43a3f3c7cde240971e649ca2b0eeded6c639179614d472446f37a5a89ae59cd026616d
7
- data.tar.gz: 0327b5ae60b07e38ac81a292ca34639b6295beb23dab45410e0420350c3451e14745d1660e08520bcda2c92bc74a796bfdd12ecea1036414f01f1375218de1f1
6
+ metadata.gz: a3b3fd079bceec53d996894600edf5cedd3160eb2ae3e6936b1ee7d0912f44b1f49fd17365bc718f994c9a741a5c343cddafdb6a0d26eec48ab72025ceb4e8d6
7
+ data.tar.gz: 57cf9aa688a17360d4f77be95a225c94df7cfbb5acb39efa060abaf8b4d02a96f3315d9e0a4f5273cbc92e0eb7931cf4a28f453e0491ac4f7db146882ae13e17
data/CHANGELOG.md CHANGED
@@ -15,13 +15,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
  ### Removed
16
16
  -->
17
17
 
18
- ## [Unreleased]
18
+ ## [0.8.1] - 12025-05-21
19
19
 
20
20
  ### Added
21
21
 
22
- ### Changed
22
+ - Added configuration option for Rails for granular control
23
+ ```ruby
24
+ # In config/initializers/everythingrb.rb
25
+ Rails.application.configure do
26
+ config.everythingrb.extensions = [:array, :string, :hash]
27
+ end
28
+ ```
23
29
 
24
- ### Removed
30
+ ### Fixed
31
+
32
+ - Fixed Rails compatibility with a Railtie to resolve a crash caused by load order
25
33
 
26
34
  ## [0.8.0] - 12025-05-11
27
35
 
@@ -283,7 +291,8 @@ This change aligns our method signatures with Ruby's conventions and matches our
283
291
 
284
292
  - Added alias `each` to `each_pair` in OpenStruct for better enumerable compatibility
285
293
 
286
- [unreleased]: https://github.com/itsthedevman/everythingrb/compare/v0.8.0...HEAD
294
+ [unreleased]: https://github.com/itsthedevman/everythingrb/compare/v0.8.1...HEAD
295
+ [0.8.1]: https://github.com/itsthedevman/everythingrb/compare/v0.8.0...v0.8.1
287
296
  [0.8.0]: https://github.com/itsthedevman/everythingrb/compare/v0.7.0...v0.8.0
288
297
  [0.7.0]: https://github.com/itsthedevman/everythingrb/compare/v0.6.1...v0.7.0
289
298
  [0.6.1]: https://github.com/itsthedevman/everythingrb/compare/v0.6.0...v0.6.1
data/README.md CHANGED
@@ -45,7 +45,9 @@ gem install everythingrb
45
45
 
46
46
  There are two ways to use EverythingRB:
47
47
 
48
- ### Load Everything (Default)
48
+ ### Standard Ruby Projects
49
+
50
+ #### Load Everything (Default)
49
51
 
50
52
  The simplest approach - just require and go:
51
53
 
@@ -60,7 +62,7 @@ config = {server: {port: 443}}.to_ostruct
60
62
  config.server.port # => 443
61
63
  ```
62
64
 
63
- ### Cherry-Pick Extensions
65
+ #### Cherry-Pick Extensions
64
66
 
65
67
  If you only need specific extensions (or you're a minimalist at heart):
66
68
 
@@ -96,6 +98,21 @@ Available modules:
96
98
  - `symbol`: Symbol extensions (with_quotes)
97
99
  - `time`: Time extensions (in_quotes)
98
100
 
101
+ ### Rails Applications
102
+
103
+ EverythingRB works out of the box with Rails! Just add it to your Gemfile and you're all set.
104
+
105
+ If you only want specific extensions, configure them in an initializer:
106
+
107
+ ```ruby
108
+ # In config/initializers/everythingrb.rb
109
+ Rails.application.configure do
110
+ config.everythingrb.extensions = [:array, :string, :hash]
111
+ end
112
+ ```
113
+
114
+ By default (when `config.everythingrb.extensions` is not set), all extensions are loaded. Setting this to an empty array would effectively disable the gem.
115
+
99
116
  ## What's Included
100
117
 
101
118
  ### Data Structure Conversions
@@ -7,5 +7,5 @@
7
7
  #
8
8
  module Everythingrb
9
9
  # Current version of the everythingrb gem
10
- VERSION = "0.8.0"
10
+ VERSION = "0.8.1"
11
11
  end
data/lib/everythingrb.rb CHANGED
@@ -1,4 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "everythingrb/prelude"
4
- require_relative "everythingrb/all"
4
+
5
+ if defined?(Rails::Railtie)
6
+ require_relative "railtie"
7
+ else
8
+ require_relative "everythingrb/all"
9
+ end
data/lib/railtie.rb ADDED
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Everythingrb
4
+ #
5
+ # Rails integration for EverythingRB
6
+ #
7
+ # This Railtie handles proper loading of EverythingRB extensions in a Rails environment,
8
+ # ensuring that everything works correctly with ActiveSupport and other Rails components.
9
+ #
10
+ # @example Configure which extensions to load in an initializer
11
+ # # config/initializers/everythingrb.rb
12
+ # Rails.application.configure do
13
+ # config.everythingrb.extensions = [:array, :string, :hash]
14
+ # end
15
+ #
16
+ # @note By default, all extensions are loaded. Setting `extensions` to an empty array
17
+ # effectively disables the gem.
18
+ #
19
+ class Railtie < Rails::Railtie
20
+ config.everythingrb = ActiveSupport::OrderedOptions.new
21
+ config.everythingrb.extensions = nil # Default to loading all
22
+
23
+ initializer "everythingrb.initialize" do
24
+ # I learned that, whereas ActiveSupport is defined at this point, the core_ext files are
25
+ # required later down the line.
26
+ ActiveSupport.on_load(:active_record) do
27
+ extensions = Rails.configuration.everythingrb.extensions
28
+
29
+ if extensions.is_a?(Array)
30
+ # Allow selective loading
31
+ extensions.each { |ext| require_relative "everythingrb/#{ext}" }
32
+ else
33
+ require_relative "everythingrb/all"
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everythingrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-11 00:00:00.000000000 Z
11
+ date: 2025-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ostruct
@@ -79,6 +79,7 @@ files:
79
79
  - lib/everythingrb/symbol.rb
80
80
  - lib/everythingrb/time.rb
81
81
  - lib/everythingrb/version.rb
82
+ - lib/railtie.rb
82
83
  homepage: https://github.com/itsthedevman/everythingrb
83
84
  licenses:
84
85
  - MIT