enum_ext 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +40 -37
- data/enum_ext.gemspec +1 -0
- data/lib/enum_ext/version.rb +1 -1
- data/lib/enum_ext.rb +11 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa096cf9f003cabf942dc6b30f2e172c5e3c4b3be881be0d487c0b34ec866b7a
|
4
|
+
data.tar.gz: b855d89b03d51c9554f4aa1d48fce352edba462a3866d5bfafc8196b1fd06c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bc5e06d1cdc9bdb2713659d2d5027b2c4807bad9f96d4e7378a1e4166cc2e14de1b7cc19391f8f42caf9a2392b4d16577c3274b77e0eb230fa92b75aeaf9cdd
|
7
|
+
data.tar.gz: c63f0b0557d1645e9ad267099291c75aab6dada2bae50555e8920786af885526ea8d98b8cc7d6e3125b5ebf855461d2f364600a855241792f06c2309d5502f08
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
# 0.4.
|
1
|
+
# 0.4.6
|
2
|
+
* allows enum to enable simple helpers directly at enum definition. Ex:
|
3
|
+
```
|
4
|
+
enum test_type: [:value], ext: [:enum_i, :mass_assign_enum]
|
5
|
+
```
|
6
|
+
|
7
|
+
# 0.4.5
|
2
8
|
* ext_enum_sets will add class method: ext_enum_pluralised, containing all extended enum sets as a single Hash
|
3
9
|
|
4
10
|
# 0.4.4
|
data/Gemfile.lock
CHANGED
@@ -1,75 +1,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
enum_ext (0.4.
|
4
|
+
enum_ext (0.4.5)
|
5
5
|
activerecord (>= 5.2.4.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (6.
|
11
|
-
actionview (= 6.
|
12
|
-
activesupport (= 6.
|
13
|
-
rack (~> 2.0, >= 2.0.
|
10
|
+
actionpack (6.1.7)
|
11
|
+
actionview (= 6.1.7)
|
12
|
+
activesupport (= 6.1.7)
|
13
|
+
rack (~> 2.0, >= 2.0.9)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (6.
|
18
|
-
activesupport (= 6.
|
17
|
+
actionview (6.1.7)
|
18
|
+
activesupport (= 6.1.7)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activemodel (6.
|
24
|
-
activesupport (= 6.
|
25
|
-
activerecord (6.
|
26
|
-
activemodel (= 6.
|
27
|
-
activesupport (= 6.
|
28
|
-
activesupport (6.
|
23
|
+
activemodel (6.1.7)
|
24
|
+
activesupport (= 6.1.7)
|
25
|
+
activerecord (6.1.7)
|
26
|
+
activemodel (= 6.1.7)
|
27
|
+
activesupport (= 6.1.7)
|
28
|
+
activesupport (6.1.7)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
|
-
i18n (>=
|
31
|
-
minitest (
|
32
|
-
tzinfo (~>
|
33
|
-
zeitwerk (~> 2.
|
30
|
+
i18n (>= 1.6, < 2)
|
31
|
+
minitest (>= 5.1)
|
32
|
+
tzinfo (~> 2.0)
|
33
|
+
zeitwerk (~> 2.3)
|
34
34
|
builder (3.2.4)
|
35
35
|
byebug (11.1.3)
|
36
|
-
concurrent-ruby (1.1.
|
36
|
+
concurrent-ruby (1.1.10)
|
37
37
|
crass (1.0.6)
|
38
38
|
erubi (1.10.0)
|
39
|
-
i18n (1.
|
39
|
+
i18n (1.12.0)
|
40
40
|
concurrent-ruby (~> 1.0)
|
41
|
-
loofah (2.
|
41
|
+
loofah (2.19.1)
|
42
42
|
crass (~> 1.0.2)
|
43
43
|
nokogiri (>= 1.5.9)
|
44
44
|
method_source (1.0.0)
|
45
|
-
mini_portile2 (2.
|
45
|
+
mini_portile2 (2.8.0)
|
46
46
|
minitest (5.14.2)
|
47
|
-
nokogiri (1.
|
48
|
-
mini_portile2 (~> 2.
|
49
|
-
|
47
|
+
nokogiri (1.13.10)
|
48
|
+
mini_portile2 (~> 2.8.0)
|
49
|
+
racc (~> 1.4)
|
50
|
+
racc (1.6.1)
|
51
|
+
rack (2.2.4)
|
50
52
|
rack-test (1.1.0)
|
51
53
|
rack (>= 1.0, < 3)
|
52
54
|
rails-dom-testing (2.0.3)
|
53
55
|
activesupport (>= 4.2.0)
|
54
56
|
nokogiri (>= 1.6)
|
55
|
-
rails-html-sanitizer (1.
|
56
|
-
loofah (~> 2.
|
57
|
-
rails-i18n (
|
57
|
+
rails-html-sanitizer (1.4.4)
|
58
|
+
loofah (~> 2.19, >= 2.19.1)
|
59
|
+
rails-i18n (7.0.6)
|
58
60
|
i18n (>= 0.7, < 2)
|
59
|
-
railties (>= 6.0.0, <
|
60
|
-
railties (6.
|
61
|
-
actionpack (= 6.
|
62
|
-
activesupport (= 6.
|
61
|
+
railties (>= 6.0.0, < 8)
|
62
|
+
railties (6.1.7)
|
63
|
+
actionpack (= 6.1.7)
|
64
|
+
activesupport (= 6.1.7)
|
63
65
|
method_source
|
64
|
-
rake (>=
|
65
|
-
thor (
|
66
|
+
rake (>= 12.2)
|
67
|
+
thor (~> 1.0)
|
66
68
|
rake (13.0.1)
|
67
69
|
sqlite3 (1.4.2)
|
70
|
+
stubberry (0.3.0)
|
68
71
|
thor (1.0.1)
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
zeitwerk (2.4.2)
|
72
|
+
tzinfo (2.0.5)
|
73
|
+
concurrent-ruby (~> 1.0)
|
74
|
+
zeitwerk (2.6.6)
|
73
75
|
|
74
76
|
PLATFORMS
|
75
77
|
ruby
|
@@ -82,6 +84,7 @@ DEPENDENCIES
|
|
82
84
|
rails-i18n (>= 4)
|
83
85
|
rake (>= 10.0)
|
84
86
|
sqlite3
|
87
|
+
stubberry
|
85
88
|
|
86
89
|
BUNDLED WITH
|
87
90
|
2.1.4
|
data/enum_ext.gemspec
CHANGED
data/lib/enum_ext/version.rb
CHANGED
data/lib/enum_ext.rb
CHANGED
@@ -13,6 +13,17 @@ require 'enum_ext/version'
|
|
13
13
|
#
|
14
14
|
module EnumExt
|
15
15
|
|
16
|
+
# extending enum with inplace settings
|
17
|
+
# enum status: {}, ext: [:enum_i, :mass_assign_enum]
|
18
|
+
# enum_i and mass_assign_enum ara
|
19
|
+
def enum(definitions)
|
20
|
+
extensions = definitions.delete(:ext)
|
21
|
+
super(definitions)
|
22
|
+
definitions.each do |name,|
|
23
|
+
[*extensions].each{|ext_method| send(ext_method, name) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
16
27
|
# defines shortcut for getting integer value of enum.
|
17
28
|
# for enum named 'status' will generate:
|
18
29
|
# instance.status_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enum_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alekseyl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: stubberry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: Enum extension, ads enum sets, mass-assign, localization, and some sugar
|
112
126
|
helpers.
|
113
127
|
email:
|