progne_tapera 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile.lock +44 -44
- data/README.md +14 -0
- data/ROADMAP.md +3 -0
- data/lib/progne_tapera/enum_config.rb +7 -2
- data/lib/progne_tapera/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20bbffd40c23bd5976b19f8fc18ec3f8cae4136
|
4
|
+
data.tar.gz: 7b40a0025a790f752ba33ca1bef881ece2097e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d532bae2f9263f10a6eebfe7c52435be88d510ead89d470286e2d612a0a238d83816c85db171ffc1bb7c847302047146924e9fba4ebfcb86b93729e206f0e14
|
7
|
+
data.tar.gz: 249e257751bcc5fb4f703f395072b5cd436623ae54a356ed9a6c09354083d2c759ef9e6be9c7463b6337aae464aa085ddbf5cf06b2f865cb16acf9ef9f8cd1aa
|
data/CHANGELOG.md
CHANGED
@@ -22,4 +22,7 @@
|
|
22
22
|
1. Improved the Enum Config concern to be able to be extended by lambda
|
23
23
|
|
24
24
|
## v0.5.1
|
25
|
-
1.
|
25
|
+
1. Improved the Enum config concern for the Item Methods module
|
26
|
+
|
27
|
+
## v0.5.2
|
28
|
+
1. Improve the Enum Config concern for the Item Methods module
|
data/Gemfile.lock
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
progne_tapera (0.5)
|
4
|
+
progne_tapera (0.5.2)
|
5
5
|
rails (>= 4.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.0.
|
11
|
-
actionpack (= 5.0.
|
10
|
+
actioncable (5.0.1)
|
11
|
+
actionpack (= 5.0.1)
|
12
12
|
nio4r (~> 1.2)
|
13
13
|
websocket-driver (~> 0.6.1)
|
14
|
-
actionmailer (5.0.
|
15
|
-
actionpack (= 5.0.
|
16
|
-
actionview (= 5.0.
|
17
|
-
activejob (= 5.0.
|
14
|
+
actionmailer (5.0.1)
|
15
|
+
actionpack (= 5.0.1)
|
16
|
+
actionview (= 5.0.1)
|
17
|
+
activejob (= 5.0.1)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.0.
|
21
|
-
actionview (= 5.0.
|
22
|
-
activesupport (= 5.0.
|
20
|
+
actionpack (5.0.1)
|
21
|
+
actionview (= 5.0.1)
|
22
|
+
activesupport (= 5.0.1)
|
23
23
|
rack (~> 2.0)
|
24
24
|
rack-test (~> 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.0.
|
28
|
-
activesupport (= 5.0.
|
27
|
+
actionview (5.0.1)
|
28
|
+
activesupport (= 5.0.1)
|
29
29
|
builder (~> 3.1)
|
30
30
|
erubis (~> 2.7.0)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
33
|
-
activejob (5.0.
|
34
|
-
activesupport (= 5.0.
|
33
|
+
activejob (5.0.1)
|
34
|
+
activesupport (= 5.0.1)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.0.
|
37
|
-
activesupport (= 5.0.
|
38
|
-
activerecord (5.0.
|
39
|
-
activemodel (= 5.0.
|
40
|
-
activesupport (= 5.0.
|
36
|
+
activemodel (5.0.1)
|
37
|
+
activesupport (= 5.0.1)
|
38
|
+
activerecord (5.0.1)
|
39
|
+
activemodel (= 5.0.1)
|
40
|
+
activesupport (= 5.0.1)
|
41
41
|
arel (~> 7.0)
|
42
|
-
activesupport (5.0.
|
42
|
+
activesupport (5.0.1)
|
43
43
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
44
|
i18n (~> 0.7)
|
45
45
|
minitest (~> 5.1)
|
46
46
|
tzinfo (~> 1.1)
|
47
47
|
arel (7.1.4)
|
48
|
-
builder (3.2.
|
49
|
-
concurrent-ruby (1.0.
|
50
|
-
diff-lcs (1.
|
48
|
+
builder (3.2.3)
|
49
|
+
concurrent-ruby (1.0.4)
|
50
|
+
diff-lcs (1.3)
|
51
51
|
erubis (2.7.0)
|
52
52
|
globalid (0.3.7)
|
53
53
|
activesupport (>= 4.1.0)
|
54
|
-
i18n (0.
|
54
|
+
i18n (0.8.0)
|
55
55
|
loofah (2.0.3)
|
56
56
|
nokogiri (>= 1.5.9)
|
57
57
|
mail (2.6.4)
|
@@ -63,31 +63,31 @@ GEM
|
|
63
63
|
mini_portile2 (2.1.0)
|
64
64
|
minitest (5.10.1)
|
65
65
|
nio4r (1.2.1)
|
66
|
-
nokogiri (1.
|
66
|
+
nokogiri (1.7.0.1)
|
67
67
|
mini_portile2 (~> 2.1.0)
|
68
68
|
rack (2.0.1)
|
69
69
|
rack-test (0.6.3)
|
70
70
|
rack (>= 1.0)
|
71
|
-
rails (5.0.
|
72
|
-
actioncable (= 5.0.
|
73
|
-
actionmailer (= 5.0.
|
74
|
-
actionpack (= 5.0.
|
75
|
-
actionview (= 5.0.
|
76
|
-
activejob (= 5.0.
|
77
|
-
activemodel (= 5.0.
|
78
|
-
activerecord (= 5.0.
|
79
|
-
activesupport (= 5.0.
|
71
|
+
rails (5.0.1)
|
72
|
+
actioncable (= 5.0.1)
|
73
|
+
actionmailer (= 5.0.1)
|
74
|
+
actionpack (= 5.0.1)
|
75
|
+
actionview (= 5.0.1)
|
76
|
+
activejob (= 5.0.1)
|
77
|
+
activemodel (= 5.0.1)
|
78
|
+
activerecord (= 5.0.1)
|
79
|
+
activesupport (= 5.0.1)
|
80
80
|
bundler (>= 1.3.0, < 2.0)
|
81
|
-
railties (= 5.0.
|
81
|
+
railties (= 5.0.1)
|
82
82
|
sprockets-rails (>= 2.0.0)
|
83
|
-
rails-dom-testing (2.0.
|
83
|
+
rails-dom-testing (2.0.2)
|
84
84
|
activesupport (>= 4.2.0, < 6.0)
|
85
|
-
nokogiri (~> 1.6
|
85
|
+
nokogiri (~> 1.6)
|
86
86
|
rails-html-sanitizer (1.0.3)
|
87
87
|
loofah (~> 2.0)
|
88
|
-
railties (5.0.
|
89
|
-
actionpack (= 5.0.
|
90
|
-
activesupport (= 5.0.
|
88
|
+
railties (5.0.1)
|
89
|
+
actionpack (= 5.0.1)
|
90
|
+
activesupport (= 5.0.1)
|
91
91
|
method_source
|
92
92
|
rake (>= 0.8.7)
|
93
93
|
thor (>= 0.18.1, < 2.0)
|
@@ -96,7 +96,7 @@ GEM
|
|
96
96
|
rspec-core (~> 3.5.0)
|
97
97
|
rspec-expectations (~> 3.5.0)
|
98
98
|
rspec-mocks (~> 3.5.0)
|
99
|
-
rspec-core (3.5.
|
99
|
+
rspec-core (3.5.4)
|
100
100
|
rspec-support (~> 3.5.0)
|
101
101
|
rspec-expectations (3.5.0)
|
102
102
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
106
106
|
rspec-support (~> 3.5.0)
|
107
107
|
rspec-support (3.5.0)
|
108
|
-
sprockets (3.7.
|
108
|
+
sprockets (3.7.1)
|
109
109
|
concurrent-ruby (~> 1.0)
|
110
110
|
rack (> 1, < 3)
|
111
111
|
sprockets-rails (3.2.0)
|
@@ -116,7 +116,7 @@ GEM
|
|
116
116
|
thread_safe (0.3.5)
|
117
117
|
tzinfo (1.2.2)
|
118
118
|
thread_safe (~> 0.1)
|
119
|
-
websocket-driver (0.6.
|
119
|
+
websocket-driver (0.6.5)
|
120
120
|
websocket-extensions (>= 0.1.0)
|
121
121
|
websocket-extensions (0.1.2)
|
122
122
|
|
@@ -130,4 +130,4 @@ DEPENDENCIES
|
|
130
130
|
rspec (~> 3.5)
|
131
131
|
|
132
132
|
BUNDLED WITH
|
133
|
-
1.
|
133
|
+
1.13.6
|
data/README.md
CHANGED
@@ -180,17 +180,29 @@ include ProgneTapera::EnumCode
|
|
180
180
|
|
181
181
|
The Enum List concern do the following tasks for the includer automatically:
|
182
182
|
1. Include the Enumerable module
|
183
|
+
|
183
184
|
2. Define the .enum_name method as: ``enum_name(name = nil)``
|
185
|
+
|
184
186
|
3. Define the .item_defined? method as: ``item_defined?(item)``
|
187
|
+
|
185
188
|
4. Define the .add_item method as: ``add_item(item)``
|
189
|
+
|
186
190
|
5. Define the .safe_add_item method as: ``safe_add_item(item)``
|
191
|
+
|
187
192
|
6. Define the .enum_constants method as: ``enum_constants``
|
193
|
+
|
188
194
|
7. Define the .all method as: ``all``
|
195
|
+
|
189
196
|
8. Define the .selected method as: ``selected(&block)``
|
197
|
+
|
190
198
|
9. Define the .each method as: ``each(&block)``
|
199
|
+
|
191
200
|
10. Define the .lookup method as: ``lookup(code)``
|
201
|
+
|
192
202
|
11. Define the .form_options method as: ``form_options(&block)``
|
203
|
+
|
193
204
|
12. Define the .deserialize method as: ``deserialize(value)``
|
205
|
+
|
194
206
|
13. Define the .serialize method as: ``serialize(value)``
|
195
207
|
|
196
208
|
```ruby
|
@@ -205,7 +217,9 @@ Gender.form_options # { '男' => '1', '女' => '2', '未指定' => '9' }
|
|
205
217
|
|
206
218
|
The Enum Config concern do the following tasks for the includer automatically:
|
207
219
|
1. Include the Enum List concern
|
220
|
+
|
208
221
|
2. Define the .enum method as: ``enum(name = nil, localized_name = name, &block)``
|
222
|
+
|
209
223
|
3. Define the .overload_enum_i18n method as: ``overload_enum_i18n(localized_name = nil)``
|
210
224
|
|
211
225
|
config/locales/enum.zh-CN.yml
|
data/ROADMAP.md
CHANGED
@@ -24,5 +24,8 @@
|
|
24
24
|
## v0.5.1
|
25
25
|
1. Improve the Enum config concern for the Item Methods module
|
26
26
|
|
27
|
+
## v0.5.2
|
28
|
+
1. Improve the Enum Config concern for the Item Methods module
|
29
|
+
|
27
30
|
## v0.6
|
28
31
|
1. Improve the Enum Config concern to make the enum items be able to be updated or destroyable through the #enum method
|
@@ -34,10 +34,15 @@ module ProgneTapera::EnumConfig
|
|
34
34
|
code = options.delete :code
|
35
35
|
options[:localized_name] = I18n.t "enum.#{localized_name||name}.#{key}"
|
36
36
|
item = ProgneTapera::EnumItem.new code, key, options
|
37
|
-
|
38
|
-
|
37
|
+
|
38
|
+
item_method_module = "#{self.name}::ItemMethods".safe_constantize
|
39
|
+
item.class_eval do
|
39
40
|
include item_method_module if item_method_module.present?
|
40
41
|
end
|
42
|
+
#class << item
|
43
|
+
# include item_method_module if item_method_module.present?
|
44
|
+
#end
|
45
|
+
|
41
46
|
safe_add_item item
|
42
47
|
end
|
43
48
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: progne_tapera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|