tag_options 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +14 -11
- data/lib/tag_options/hash.rb +10 -3
- data/lib/tag_options/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5802916aaa57253843bc9fa02aed005828d4ffa30a8ccf514b9949c5c0859d2d
|
4
|
+
data.tar.gz: 80ee0b00682ee8d94595039cd1569c0152d0dedb225a78672986416118bec6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
- [
|
37
|
-
- [
|
38
|
-
- [
|
39
|
-
- [
|
40
|
-
- [
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
44
|
-
- [
|
45
|
-
- [
|
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
|
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
|
data/lib/tag_options/hash.rb
CHANGED
@@ -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 < ::
|
7
|
+
class Hash < ActiveSupport::HashWithIndifferentAccess
|
8
|
+
include ActiveSupport::Callbacks
|
9
|
+
define_callbacks :initialize
|
10
|
+
|
6
11
|
def initialize(hash = {})
|
7
|
-
|
8
|
-
|
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
|
|
data/lib/tag_options/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|