super_tools 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +64 -56
- data/lib/super_tools.rb +2 -0
- data/lib/super_tools/version.rb +1 -1
- data/lib/super_value/base.rb +39 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d443bafc6745fef2db08921770d63a6f26e9a635
|
4
|
+
data.tar.gz: b65a9f068b176d23dab5e66826f74fa270d58a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c110a2136900c69371e368b8e67ed065f024eb61bf503591c4621ed73fda104699aacc898d603ac622f27b6385f0e708227d9cf3762f479eb6478bb4da5c799b
|
7
|
+
data.tar.gz: 0c6cb619ccd948e8def86bac5600060a10d56062fa2e951e5666dea81db9f61d26960d4e33169707939f76b4e8a7a0e2f1b8bfa0b26523d6f8e3d352b450c702
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
super_tools (0.0.
|
4
|
+
super_tools (0.0.8)
|
5
5
|
dry-logic (~> 0.4.2)
|
6
6
|
dry-types (~> 0.13.2)
|
7
7
|
fast_excel
|
8
8
|
forwardable
|
9
9
|
iconv
|
10
10
|
nokogiri (>= 1.6, <= 1.9.1)
|
11
|
-
rails (>= 4
|
11
|
+
rails (>= 4)
|
12
12
|
reform (~> 2.2.4)
|
13
13
|
reform-rails
|
14
14
|
roo
|
@@ -21,44 +21,48 @@ PATH
|
|
21
21
|
GEM
|
22
22
|
remote: https://rubygems.org/
|
23
23
|
specs:
|
24
|
-
actioncable (5.
|
25
|
-
actionpack (= 5.
|
26
|
-
nio4r (~>
|
27
|
-
websocket-driver (
|
28
|
-
actionmailer (5.
|
29
|
-
actionpack (= 5.
|
30
|
-
actionview (= 5.
|
31
|
-
activejob (= 5.
|
24
|
+
actioncable (5.2.3)
|
25
|
+
actionpack (= 5.2.3)
|
26
|
+
nio4r (~> 2.0)
|
27
|
+
websocket-driver (>= 0.6.1)
|
28
|
+
actionmailer (5.2.3)
|
29
|
+
actionpack (= 5.2.3)
|
30
|
+
actionview (= 5.2.3)
|
31
|
+
activejob (= 5.2.3)
|
32
32
|
mail (~> 2.5, >= 2.5.4)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
|
-
actionpack (5.
|
35
|
-
actionview (= 5.
|
36
|
-
activesupport (= 5.
|
34
|
+
actionpack (5.2.3)
|
35
|
+
actionview (= 5.2.3)
|
36
|
+
activesupport (= 5.2.3)
|
37
37
|
rack (~> 2.0)
|
38
|
-
rack-test (
|
38
|
+
rack-test (>= 0.6.3)
|
39
39
|
rails-dom-testing (~> 2.0)
|
40
40
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
41
|
-
actionview (5.
|
42
|
-
activesupport (= 5.
|
41
|
+
actionview (5.2.3)
|
42
|
+
activesupport (= 5.2.3)
|
43
43
|
builder (~> 3.1)
|
44
|
-
|
44
|
+
erubi (~> 1.4)
|
45
45
|
rails-dom-testing (~> 2.0)
|
46
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
47
|
-
activejob (5.
|
48
|
-
activesupport (= 5.
|
46
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
47
|
+
activejob (5.2.3)
|
48
|
+
activesupport (= 5.2.3)
|
49
49
|
globalid (>= 0.3.6)
|
50
|
-
activemodel (5.
|
51
|
-
activesupport (= 5.
|
52
|
-
activerecord (5.
|
53
|
-
activemodel (= 5.
|
54
|
-
activesupport (= 5.
|
55
|
-
arel (
|
56
|
-
|
50
|
+
activemodel (5.2.3)
|
51
|
+
activesupport (= 5.2.3)
|
52
|
+
activerecord (5.2.3)
|
53
|
+
activemodel (= 5.2.3)
|
54
|
+
activesupport (= 5.2.3)
|
55
|
+
arel (>= 9.0)
|
56
|
+
activestorage (5.2.3)
|
57
|
+
actionpack (= 5.2.3)
|
58
|
+
activerecord (= 5.2.3)
|
59
|
+
marcel (~> 0.3.1)
|
60
|
+
activesupport (5.2.3)
|
57
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
58
|
-
i18n (
|
62
|
+
i18n (>= 0.7, < 2)
|
59
63
|
minitest (~> 5.1)
|
60
64
|
tzinfo (~> 1.1)
|
61
|
-
arel (
|
65
|
+
arel (9.0.0)
|
62
66
|
axiom-types (0.1.1)
|
63
67
|
descendants_tracker (~> 0.0.4)
|
64
68
|
ice_nine (~> 0.11.0)
|
@@ -74,7 +78,7 @@ GEM
|
|
74
78
|
declarative-option (0.1.0)
|
75
79
|
descendants_tracker (0.0.4)
|
76
80
|
thread_safe (~> 0.3, >= 0.3.1)
|
77
|
-
disposable (0.4.
|
81
|
+
disposable (0.4.5)
|
78
82
|
declarative (>= 0.0.9, < 1.0.0)
|
79
83
|
declarative-builder (< 0.2.0)
|
80
84
|
declarative-option (< 0.2.0)
|
@@ -100,16 +104,16 @@ GEM
|
|
100
104
|
dry-equalizer (~> 0.2)
|
101
105
|
dry-inflector (~> 0.1, >= 0.1.2)
|
102
106
|
dry-logic (~> 0.4, >= 0.4.2)
|
103
|
-
elasticsearch (
|
104
|
-
elasticsearch-api (=
|
105
|
-
elasticsearch-transport (=
|
106
|
-
elasticsearch-api (
|
107
|
+
elasticsearch (7.0.0)
|
108
|
+
elasticsearch-api (= 7.0.0)
|
109
|
+
elasticsearch-transport (= 7.0.0)
|
110
|
+
elasticsearch-api (7.0.0)
|
107
111
|
multi_json
|
108
|
-
elasticsearch-transport (
|
112
|
+
elasticsearch-transport (7.0.0)
|
109
113
|
faraday
|
110
114
|
multi_json
|
111
115
|
equalizer (0.0.11)
|
112
|
-
|
116
|
+
erubi (1.8.0)
|
113
117
|
faraday (0.15.4)
|
114
118
|
multipart-post (>= 1.2, < 3)
|
115
119
|
fast_excel (0.2.6)
|
@@ -119,7 +123,7 @@ GEM
|
|
119
123
|
globalid (0.4.2)
|
120
124
|
activesupport (>= 4.2.0)
|
121
125
|
hashie (3.6.0)
|
122
|
-
i18n (
|
126
|
+
i18n (1.5.1)
|
123
127
|
concurrent-ruby (~> 1.0)
|
124
128
|
ice_nine (0.11.2)
|
125
129
|
iconv (1.0.8)
|
@@ -128,41 +132,45 @@ GEM
|
|
128
132
|
nokogiri (>= 1.5.9)
|
129
133
|
mail (2.7.1)
|
130
134
|
mini_mime (>= 0.1.1)
|
135
|
+
marcel (0.3.3)
|
136
|
+
mimemagic (~> 0.3.2)
|
131
137
|
method_source (0.9.2)
|
138
|
+
mimemagic (0.3.3)
|
132
139
|
mini_mime (1.0.1)
|
133
140
|
mini_portile2 (2.4.0)
|
134
141
|
minitest (5.11.3)
|
135
142
|
multi_json (1.13.1)
|
136
143
|
multipart-post (2.0.0)
|
137
|
-
nio4r (
|
144
|
+
nio4r (2.3.1)
|
138
145
|
nokogiri (1.9.1)
|
139
146
|
mini_portile2 (~> 2.4.0)
|
140
147
|
rack (2.0.7)
|
141
|
-
rack-test (
|
142
|
-
rack (>= 1.0)
|
143
|
-
rails (5.
|
144
|
-
actioncable (= 5.
|
145
|
-
actionmailer (= 5.
|
146
|
-
actionpack (= 5.
|
147
|
-
actionview (= 5.
|
148
|
-
activejob (= 5.
|
149
|
-
activemodel (= 5.
|
150
|
-
activerecord (= 5.
|
151
|
-
|
152
|
-
|
153
|
-
|
148
|
+
rack-test (1.1.0)
|
149
|
+
rack (>= 1.0, < 3)
|
150
|
+
rails (5.2.3)
|
151
|
+
actioncable (= 5.2.3)
|
152
|
+
actionmailer (= 5.2.3)
|
153
|
+
actionpack (= 5.2.3)
|
154
|
+
actionview (= 5.2.3)
|
155
|
+
activejob (= 5.2.3)
|
156
|
+
activemodel (= 5.2.3)
|
157
|
+
activerecord (= 5.2.3)
|
158
|
+
activestorage (= 5.2.3)
|
159
|
+
activesupport (= 5.2.3)
|
160
|
+
bundler (>= 1.3.0)
|
161
|
+
railties (= 5.2.3)
|
154
162
|
sprockets-rails (>= 2.0.0)
|
155
163
|
rails-dom-testing (2.0.3)
|
156
164
|
activesupport (>= 4.2.0)
|
157
165
|
nokogiri (>= 1.6)
|
158
166
|
rails-html-sanitizer (1.0.4)
|
159
167
|
loofah (~> 2.2, >= 2.2.2)
|
160
|
-
railties (5.
|
161
|
-
actionpack (= 5.
|
162
|
-
activesupport (= 5.
|
168
|
+
railties (5.2.3)
|
169
|
+
actionpack (= 5.2.3)
|
170
|
+
activesupport (= 5.2.3)
|
163
171
|
method_source
|
164
172
|
rake (>= 0.8.7)
|
165
|
-
thor (>= 0.
|
173
|
+
thor (>= 0.19.0, < 2.0)
|
166
174
|
rake (10.5.0)
|
167
175
|
reform (2.2.4)
|
168
176
|
disposable (>= 0.4.1)
|
@@ -209,7 +217,7 @@ GEM
|
|
209
217
|
equalizer (~> 0.0, >= 0.0.9)
|
210
218
|
warehouse_items (0.3.0)
|
211
219
|
activesupport
|
212
|
-
websocket-driver (0.
|
220
|
+
websocket-driver (0.7.0)
|
213
221
|
websocket-extensions (>= 0.1.0)
|
214
222
|
websocket-extensions (0.1.3)
|
215
223
|
|
data/lib/super_tools.rb
CHANGED
data/lib/super_tools/version.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
module SuperValue
|
2
|
+
class Base
|
3
|
+
include ActiveSupport::Callbacks
|
4
|
+
cattr_accessor :model_name
|
5
|
+
define_callbacks :init
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def init(model_name)
|
9
|
+
self.model_name = model_name
|
10
|
+
self.send(:attr_accessor, model_name)
|
11
|
+
define_method :initialize do |model|
|
12
|
+
run_callbacks :init do
|
13
|
+
self.send("#{model_name}=", model)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def property(method_name)
|
19
|
+
delegate method_name, to: model_name
|
20
|
+
end
|
21
|
+
|
22
|
+
def before_init(method_name=nil, &block)
|
23
|
+
if block_given?
|
24
|
+
set_callback :init, :before, &block
|
25
|
+
else
|
26
|
+
set_callback :init, :before, method_name
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def after_init(method_name=nil, &block)
|
31
|
+
if block_given?
|
32
|
+
set_callback :init, :after, &block
|
33
|
+
else
|
34
|
+
set_callback :init, :after, method_name
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eddie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -329,6 +329,7 @@ files:
|
|
329
329
|
- lib/super_table/view_helpers.rb
|
330
330
|
- lib/super_tools.rb
|
331
331
|
- lib/super_tools/version.rb
|
332
|
+
- lib/super_value/base.rb
|
332
333
|
- lib/super_zipcode/taiwan.rb
|
333
334
|
- super_tools.gemspec
|
334
335
|
homepage: https://github.com/superlanding/super_tools
|