tag_options 1.0.0 → 1.1.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: 900cd0b42ae1f34b69b7cf227cb4f6bc91cb560f3b04424cdf3e2fd41e5d3f61
4
- data.tar.gz: b4af6738e8d551d795bab1ef057bb47f49de8d73ba32068c839d04bf50e78a43
3
+ metadata.gz: 5802916aaa57253843bc9fa02aed005828d4ffa30a8ccf514b9949c5c0859d2d
4
+ data.tar.gz: 80ee0b00682ee8d94595039cd1569c0152d0dedb225a78672986416118bec6fe
5
5
  SHA512:
6
- metadata.gz: 3322cbce916927b777b7e915e181102cdbc7497c42095edc0e11f009d9a6a3884e8649ce6826d0199ba0ac3e9fe1a8c039bc5bd8c490a6db027714f08e6d88c4
7
- data.tar.gz: 0d1ebc95b92d489d19c49b33acead9abe88a9fc5932865941454100e11bb877db6baacf7380a85f0495c3d47d3807d02e6d8bbfe08d654dbfb6b17a2940c8393
6
+ metadata.gz: f498f2aa015310a8b4d3800dcb435c5b946665f5f53bf54630a80666e3c56f05c54b75788ea84b2d57829d2369404408621a4b2b7adeec1c5668fad2e61ac37a
7
+ data.tar.gz: 9e04caa1298cec89d34af81daa7c11b51c18020c3bb013aaf7b104de5f1e5c80d545aeaae334929d3c2796d5fa00f31aafb59028b588bf9aefd218278e56bb9c
data/CHANGELOG.md CHANGED
@@ -2,10 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.1.0] - 2023-03-01
6
+
7
+ - Switched to inheriting from ActiveSupport::HashWithIndifferentAccess.
8
+ - Added before/after/around initialize callback support.
9
+
5
10
  ## [1.0.0] - 2022-06-14
6
11
 
7
12
  - Rewrote and simplified TagOptions::Hash and supporting classes.
8
- - BREAKING CHANGES, read documentation for updated usage before updating
13
+ - BREAKING CHANGES, read documentation for updated usage before updating.
9
14
 
10
15
  ## [0.9.3] - 2021-11-11
11
16
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Tag Options
2
2
 
3
+ [![Test](https://github.com/wamonroe/tag_options/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/wamonroe/tag_options/actions/workflows/test.yml)
4
+
3
5
  Simple library for manipulating options passed to the Rails `tag`,
4
6
  `content_tag`, and other tag helpers.
5
7
 
@@ -33,16 +35,17 @@ Would render:
33
35
 
34
36
  ## Table of Contents
35
37
 
36
- - [Installation](#installation)
37
- - [General Usage](#general-usage)
38
- - [combine!](#combine)
39
- - [set!](#set)
40
- - [Conditional Usage](#conditional-usage)
41
- - [Property Resolvers](#property-resolvers)
42
- - [Development](#development)
43
- - [Contributing](#contributing)
44
- - [To Do](#to-do)
45
- - [License](#license)
38
+ - [Tag Options](#tag-options)
39
+ - [Table of Contents](#table-of-contents)
40
+ - [Installation](#installation)
41
+ - [General Usage](#general-usage)
42
+ - [combine!](#combine)
43
+ - [set!](#set)
44
+ - [Conditional Usage](#conditional-usage)
45
+ - [Custom Property Resolvers](#custom-property-resolvers)
46
+ - [Development](#development)
47
+ - [Contributing](#contributing)
48
+ - [License](#license)
46
49
 
47
50
  ## Installation
48
51
 
@@ -185,7 +188,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
185
188
  - `bin/console` for an interactive prompt that will allow you to experiment
186
189
  - `bin/rubocop` to run RuboCop to check the code style and formatting
187
190
 
188
- To install this gem onto your local machine, run `bundle exec rake install`. To
191
+ To build this gem on your local machine, run `bundle exec rake build`. To
189
192
  release a new version, update the version number in `version.rb`, and then run
190
193
  `bundle exec rake release`, which will create a git tag for the version, push
191
194
  git commits and the created tag, and push the `.gem` file to
@@ -1,11 +1,18 @@
1
+ require "active_support/callbacks"
2
+ require "active_support/core_ext/hash/indifferent_access"
1
3
  require "tag_options/hash_at"
2
4
  require "tag_options/errors/not_hash_error"
3
5
 
4
6
  module TagOptions
5
- class Hash < ::Hash
7
+ class Hash < ActiveSupport::HashWithIndifferentAccess
8
+ include ActiveSupport::Callbacks
9
+ define_callbacks :initialize
10
+
6
11
  def initialize(hash = {})
7
- hash.each do |key, value|
8
- self[key] = value.is_a?(::Hash) ? TagOptions::Hash.new(value) : value
12
+ run_callbacks :initialize do
13
+ hash.each do |key, value|
14
+ self[key] = value.is_a?(::Hash) ? self.class.new(value) : value
15
+ end
9
16
  end
10
17
  end
11
18
 
@@ -1,3 +1,3 @@
1
1
  module TagOptions
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tag_options
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Monroe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rspec
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
82
  - !ruby/object:Gem::Version
69
83
  version: '0'
70
84
  requirements: []
71
- rubygems_version: 3.3.7
85
+ rubygems_version: 3.4.6
72
86
  signing_key:
73
87
  specification_version: 4
74
88
  summary: Simple library for manipulating options passed to various Rails tag helpers.