array_attribute_handler 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +29 -1
- data/Gemfile.lock +3 -1
- data/lib/array_attribute_handler/version.rb +1 -1
- data/lib/array_attribute_handler.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 907dbfdd07139a1c83b29aa8b5087fac4e6fc6462b247438cef1b722d3d68ce8
|
4
|
+
data.tar.gz: 45270412b4c5a2ba426dd343c01185f9032c15ddef7092b3938abf2531ce8a16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1b69dee7d06e79bd48d6a7d632590b672ff10ac6e665b8bdbd70fdc63f8805a3ed160bb7f0978cecdabdbd9771bff36adbd1574cffa33a6743fb555a06599e
|
7
|
+
data.tar.gz: 0a17bb42247425b0e934ebbf37aa90f502f6861cc09f86fef82d66f896eed52b2e035dfd47b7f856392cb622df963c07f9c988f49e37f4b51403834e30e0d73a
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
1
8
|
## [Unreleased]
|
2
9
|
|
10
|
+
## [1.0.2] - 2023-08-13
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Resolve Rubocop offences preventing Github CI from processing.
|
15
|
+
|
16
|
+
## [1.0.1] - 2023-08-13
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Added support for x86_64-linux.
|
21
|
+
|
22
|
+
## [1.0.0] - 2023-08-13
|
23
|
+
|
24
|
+
### Added
|
25
|
+
|
26
|
+
- First release pushed to RubyGems.
|
27
|
+
- General functionality included.
|
28
|
+
|
3
29
|
## [0.1.0] - 2023-08-13
|
4
30
|
|
5
|
-
|
31
|
+
### Added
|
32
|
+
|
33
|
+
- Initial release.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
array_attribute_handler (1.0.
|
4
|
+
array_attribute_handler (1.0.2)
|
5
5
|
activerecord (>= 6.0, < 7)
|
6
6
|
activesupport (>= 6.0, < 7)
|
7
7
|
|
@@ -66,6 +66,7 @@ GEM
|
|
66
66
|
parser (>= 3.2.1.0)
|
67
67
|
ruby-progressbar (1.13.0)
|
68
68
|
sqlite3 (1.6.3-arm64-darwin)
|
69
|
+
sqlite3 (1.6.3-x86_64-linux)
|
69
70
|
tzinfo (2.0.6)
|
70
71
|
concurrent-ruby (~> 1.0)
|
71
72
|
unicode-display_width (2.4.2)
|
@@ -73,6 +74,7 @@ GEM
|
|
73
74
|
|
74
75
|
PLATFORMS
|
75
76
|
arm64-darwin-22
|
77
|
+
x86_64-linux
|
76
78
|
|
77
79
|
DEPENDENCIES
|
78
80
|
array_attribute_handler!
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative "array_attribute_handler/version"
|
4
4
|
require "active_support/concern"
|
5
5
|
|
6
|
+
# Public: ArrayAttributeHandler is a module for handling array attributes.
|
6
7
|
module ArrayAttributeHandler
|
7
8
|
extend ActiveSupport::Concern
|
8
9
|
|
@@ -17,7 +18,6 @@ module ArrayAttributeHandler
|
|
17
18
|
# Defaults to false.
|
18
19
|
def handle_array_attribute(attribute_name, options = {})
|
19
20
|
separator = options.fetch(:separator, "\n")
|
20
|
-
combinator = separator + (options.fetch(:spaced_join, false) ? " " : "")
|
21
21
|
|
22
22
|
# Public: Setter for the attribute.
|
23
23
|
define_method("#{attribute_name}=") do |value|
|
@@ -26,7 +26,7 @@ module ArrayAttributeHandler
|
|
26
26
|
|
27
27
|
# Public: Getter for the text representation of the attribute.
|
28
28
|
define_method("#{attribute_name}_text") do
|
29
|
-
send(attribute_name).join(
|
29
|
+
send(attribute_name).join(separator + (options.fetch(:spaced_join, false) ? " " : ""))
|
30
30
|
end
|
31
31
|
|
32
32
|
# Public: Setter for the text representation of the attribute.
|