rails_dictionary 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/Gemfile +5 -4
- data/Gemfile.lock +202 -152
- data/Rakefile +1 -1
- data/lib/rails_dictionary/acts_as_dict_slave.rb +4 -7
- data/lib/rails_dictionary/acts_as_dict_type.rb +3 -7
- data/lib/rails_dictionary/acts_as_dictionary.rb +10 -14
- data/lib/rails_dictionary/version.rb +1 -1
- data/rails_dictionary.gemspec +3 -1
- data/spec/fake_app.rb +0 -12
- data/spec/init_models.rb +12 -0
- data/spec/rails_dictionary_spec.rb +2 -1
- data/spec/spec_helper.rb +2 -3
- metadata +8 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e27935b9a8076fd9e421737cef55f78c675c9636e76958112f3b84272582e3e
|
4
|
+
data.tar.gz: 15f5c22f8e6bcdc2eadd0e615046f56b5acfd50c23244e06dc95a3863bc678f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e82e3e03f11b1f14bda0daf15b5b681149ac5329532906e15e2b82367295fd6e80e16a669beace59efd7a979dfc04d4da9022455a8339642a96edb0e75d078a
|
7
|
+
data.tar.gz: da3dd2458660eb485fe50d52d0a29f686d023ed7a378d1da3a3e4b90a0837b76279fd84859716f4457419042a24e4fa2adba6f9d747055559609a4812075d3d2
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
source "
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
ruby '> 3.3'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in rails_dictionary.gemspec
|
4
6
|
gemspec
|
5
7
|
|
6
8
|
group :development,:test do
|
7
|
-
gem 'rails', '
|
8
|
-
gem
|
9
|
-
gem "rspec-rails", '5.1.0'
|
9
|
+
gem 'rails', '< 8.0'
|
10
|
+
gem "rspec-rails", '< 8'
|
10
11
|
gem 'sqlite3'
|
11
12
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,193 +1,243 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_dictionary (0.2.
|
5
|
-
rails (
|
4
|
+
rails_dictionary (0.2.6)
|
5
|
+
rails (< 8)
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (7.
|
11
|
-
actionpack (= 7.
|
12
|
-
activesupport (= 7.
|
10
|
+
actioncable (7.2.1.2)
|
11
|
+
actionpack (= 7.2.1.2)
|
12
|
+
activesupport (= 7.2.1.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
activesupport (= 7.0.2.2)
|
38
|
-
rack (~> 2.0, >= 2.2.0)
|
15
|
+
zeitwerk (~> 2.6)
|
16
|
+
actionmailbox (7.2.1.2)
|
17
|
+
actionpack (= 7.2.1.2)
|
18
|
+
activejob (= 7.2.1.2)
|
19
|
+
activerecord (= 7.2.1.2)
|
20
|
+
activestorage (= 7.2.1.2)
|
21
|
+
activesupport (= 7.2.1.2)
|
22
|
+
mail (>= 2.8.0)
|
23
|
+
actionmailer (7.2.1.2)
|
24
|
+
actionpack (= 7.2.1.2)
|
25
|
+
actionview (= 7.2.1.2)
|
26
|
+
activejob (= 7.2.1.2)
|
27
|
+
activesupport (= 7.2.1.2)
|
28
|
+
mail (>= 2.8.0)
|
29
|
+
rails-dom-testing (~> 2.2)
|
30
|
+
actionpack (7.2.1.2)
|
31
|
+
actionview (= 7.2.1.2)
|
32
|
+
activesupport (= 7.2.1.2)
|
33
|
+
nokogiri (>= 1.8.5)
|
34
|
+
racc
|
35
|
+
rack (>= 2.2.4, < 3.2)
|
36
|
+
rack-session (>= 1.0.1)
|
39
37
|
rack-test (>= 0.6.3)
|
40
|
-
rails-dom-testing (~> 2.
|
41
|
-
rails-html-sanitizer (~> 1.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
rails-dom-testing (~> 2.2)
|
39
|
+
rails-html-sanitizer (~> 1.6)
|
40
|
+
useragent (~> 0.16)
|
41
|
+
actiontext (7.2.1.2)
|
42
|
+
actionpack (= 7.2.1.2)
|
43
|
+
activerecord (= 7.2.1.2)
|
44
|
+
activestorage (= 7.2.1.2)
|
45
|
+
activesupport (= 7.2.1.2)
|
47
46
|
globalid (>= 0.6.0)
|
48
47
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (7.
|
50
|
-
activesupport (= 7.
|
48
|
+
actionview (7.2.1.2)
|
49
|
+
activesupport (= 7.2.1.2)
|
51
50
|
builder (~> 3.1)
|
52
|
-
erubi (~> 1.
|
53
|
-
rails-dom-testing (~> 2.
|
54
|
-
rails-html-sanitizer (~> 1.
|
55
|
-
activejob (7.
|
56
|
-
activesupport (= 7.
|
51
|
+
erubi (~> 1.11)
|
52
|
+
rails-dom-testing (~> 2.2)
|
53
|
+
rails-html-sanitizer (~> 1.6)
|
54
|
+
activejob (7.2.1.2)
|
55
|
+
activesupport (= 7.2.1.2)
|
57
56
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (7.
|
59
|
-
activesupport (= 7.
|
60
|
-
activerecord (7.
|
61
|
-
activemodel (= 7.
|
62
|
-
activesupport (= 7.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
activemodel (7.2.1.2)
|
58
|
+
activesupport (= 7.2.1.2)
|
59
|
+
activerecord (7.2.1.2)
|
60
|
+
activemodel (= 7.2.1.2)
|
61
|
+
activesupport (= 7.2.1.2)
|
62
|
+
timeout (>= 0.4.0)
|
63
|
+
activestorage (7.2.1.2)
|
64
|
+
actionpack (= 7.2.1.2)
|
65
|
+
activejob (= 7.2.1.2)
|
66
|
+
activerecord (= 7.2.1.2)
|
67
|
+
activesupport (= 7.2.1.2)
|
68
68
|
marcel (~> 1.0)
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
activesupport (7.2.1.2)
|
70
|
+
base64
|
71
|
+
bigdecimal
|
72
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
73
|
+
connection_pool (>= 2.2.5)
|
74
|
+
drb
|
72
75
|
i18n (>= 1.6, < 2)
|
76
|
+
logger (>= 1.4.2)
|
73
77
|
minitest (>= 5.1)
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
78
|
+
securerandom (>= 0.3)
|
79
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
80
|
+
base64 (0.2.0)
|
81
|
+
bigdecimal (3.1.8)
|
82
|
+
builder (3.3.0)
|
83
|
+
concurrent-ruby (1.3.4)
|
84
|
+
connection_pool (2.4.1)
|
79
85
|
crass (1.0.6)
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
+
date (3.3.4)
|
87
|
+
diff-lcs (1.5.1)
|
88
|
+
drb (2.2.1)
|
89
|
+
erubi (1.13.0)
|
90
|
+
globalid (1.2.1)
|
91
|
+
activesupport (>= 6.1)
|
92
|
+
i18n (1.14.6)
|
86
93
|
concurrent-ruby (~> 1.0)
|
87
|
-
io-
|
88
|
-
|
94
|
+
io-console (0.7.2)
|
95
|
+
irb (1.14.1)
|
96
|
+
rdoc (>= 4.0.0)
|
97
|
+
reline (>= 0.4.2)
|
98
|
+
logger (1.6.1)
|
99
|
+
loofah (2.23.1)
|
89
100
|
crass (~> 1.0.2)
|
90
|
-
nokogiri (>= 1.
|
91
|
-
mail (2.
|
101
|
+
nokogiri (>= 1.12.0)
|
102
|
+
mail (2.8.1)
|
92
103
|
mini_mime (>= 0.1.1)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
104
|
+
net-imap
|
105
|
+
net-pop
|
106
|
+
net-smtp
|
107
|
+
marcel (1.0.4)
|
108
|
+
mini_mime (1.1.5)
|
109
|
+
minitest (5.25.1)
|
110
|
+
net-imap (0.5.0)
|
111
|
+
date
|
100
112
|
net-protocol
|
101
|
-
|
102
|
-
net-pop (0.1.1)
|
103
|
-
digest
|
113
|
+
net-pop (0.1.2)
|
104
114
|
net-protocol
|
115
|
+
net-protocol (0.2.2)
|
105
116
|
timeout
|
106
|
-
net-
|
107
|
-
io-wait
|
108
|
-
timeout
|
109
|
-
net-smtp (0.3.1)
|
110
|
-
digest
|
117
|
+
net-smtp (0.5.0)
|
111
118
|
net-protocol
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
119
|
+
nio4r (2.7.3)
|
120
|
+
nokogiri (1.16.7-aarch64-linux)
|
121
|
+
racc (~> 1.4)
|
122
|
+
nokogiri (1.16.7-arm-linux)
|
123
|
+
racc (~> 1.4)
|
124
|
+
nokogiri (1.16.7-arm64-darwin)
|
116
125
|
racc (~> 1.4)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
126
|
+
nokogiri (1.16.7-x86-linux)
|
127
|
+
racc (~> 1.4)
|
128
|
+
nokogiri (1.16.7-x86_64-darwin)
|
129
|
+
racc (~> 1.4)
|
130
|
+
nokogiri (1.16.7-x86_64-linux)
|
131
|
+
racc (~> 1.4)
|
132
|
+
psych (5.1.2)
|
133
|
+
stringio
|
134
|
+
racc (1.8.1)
|
135
|
+
rack (3.1.8)
|
136
|
+
rack-session (2.0.0)
|
137
|
+
rack (>= 3.0.0)
|
138
|
+
rack-test (2.1.0)
|
139
|
+
rack (>= 1.3)
|
140
|
+
rackup (2.1.0)
|
141
|
+
rack (>= 3)
|
142
|
+
webrick (~> 1.8)
|
143
|
+
rails (7.2.1.2)
|
144
|
+
actioncable (= 7.2.1.2)
|
145
|
+
actionmailbox (= 7.2.1.2)
|
146
|
+
actionmailer (= 7.2.1.2)
|
147
|
+
actionpack (= 7.2.1.2)
|
148
|
+
actiontext (= 7.2.1.2)
|
149
|
+
actionview (= 7.2.1.2)
|
150
|
+
activejob (= 7.2.1.2)
|
151
|
+
activemodel (= 7.2.1.2)
|
152
|
+
activerecord (= 7.2.1.2)
|
153
|
+
activestorage (= 7.2.1.2)
|
154
|
+
activesupport (= 7.2.1.2)
|
139
155
|
bundler (>= 1.15.0)
|
140
|
-
railties (= 7.
|
141
|
-
rails-dom-testing (2.0
|
142
|
-
activesupport (>=
|
156
|
+
railties (= 7.2.1.2)
|
157
|
+
rails-dom-testing (2.2.0)
|
158
|
+
activesupport (>= 5.0.0)
|
159
|
+
minitest
|
143
160
|
nokogiri (>= 1.6)
|
144
|
-
rails-html-sanitizer (1.
|
145
|
-
loofah (~> 2.
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
161
|
+
rails-html-sanitizer (1.6.0)
|
162
|
+
loofah (~> 2.21)
|
163
|
+
nokogiri (~> 1.14)
|
164
|
+
railties (7.2.1.2)
|
165
|
+
actionpack (= 7.2.1.2)
|
166
|
+
activesupport (= 7.2.1.2)
|
167
|
+
irb (~> 1.13)
|
168
|
+
rackup (>= 1.0.0)
|
150
169
|
rake (>= 12.2)
|
151
|
-
thor (~> 1.0)
|
152
|
-
zeitwerk (~> 2.
|
153
|
-
rake (13.
|
154
|
-
|
155
|
-
|
156
|
-
|
170
|
+
thor (~> 1.0, >= 1.2.2)
|
171
|
+
zeitwerk (~> 2.6)
|
172
|
+
rake (13.2.1)
|
173
|
+
rdoc (6.7.0)
|
174
|
+
psych (>= 4.0.0)
|
175
|
+
reline (0.5.10)
|
176
|
+
io-console (~> 0.5)
|
177
|
+
rspec-core (3.13.2)
|
178
|
+
rspec-support (~> 3.13.0)
|
179
|
+
rspec-expectations (3.13.3)
|
157
180
|
diff-lcs (>= 1.2.0, < 2.0)
|
158
|
-
rspec-support (~> 3.
|
159
|
-
rspec-mocks (3.
|
181
|
+
rspec-support (~> 3.13.0)
|
182
|
+
rspec-mocks (3.13.2)
|
160
183
|
diff-lcs (>= 1.2.0, < 2.0)
|
161
|
-
rspec-support (~> 3.
|
162
|
-
rspec-rails (
|
163
|
-
actionpack (>=
|
164
|
-
activesupport (>=
|
165
|
-
railties (>=
|
166
|
-
rspec-core (~> 3.
|
167
|
-
rspec-expectations (~> 3.
|
168
|
-
rspec-mocks (~> 3.
|
169
|
-
rspec-support (~> 3.
|
170
|
-
rspec-support (3.
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
184
|
+
rspec-support (~> 3.13.0)
|
185
|
+
rspec-rails (7.0.1)
|
186
|
+
actionpack (>= 7.0)
|
187
|
+
activesupport (>= 7.0)
|
188
|
+
railties (>= 7.0)
|
189
|
+
rspec-core (~> 3.13)
|
190
|
+
rspec-expectations (~> 3.13)
|
191
|
+
rspec-mocks (~> 3.13)
|
192
|
+
rspec-support (~> 3.13)
|
193
|
+
rspec-support (3.13.1)
|
194
|
+
securerandom (0.3.1)
|
195
|
+
sqlite3 (2.1.1-aarch64-linux-gnu)
|
196
|
+
sqlite3 (2.1.1-aarch64-linux-musl)
|
197
|
+
sqlite3 (2.1.1-arm-linux-gnu)
|
198
|
+
sqlite3 (2.1.1-arm-linux-musl)
|
199
|
+
sqlite3 (2.1.1-arm64-darwin)
|
200
|
+
sqlite3 (2.1.1-x86-linux-gnu)
|
201
|
+
sqlite3 (2.1.1-x86-linux-musl)
|
202
|
+
sqlite3 (2.1.1-x86_64-darwin)
|
203
|
+
sqlite3 (2.1.1-x86_64-linux-gnu)
|
204
|
+
sqlite3 (2.1.1-x86_64-linux-musl)
|
205
|
+
stringio (3.1.1)
|
206
|
+
thor (1.3.2)
|
207
|
+
timeout (0.4.1)
|
208
|
+
tzinfo (2.0.6)
|
176
209
|
concurrent-ruby (~> 1.0)
|
177
|
-
|
210
|
+
useragent (0.16.10)
|
211
|
+
webrick (1.8.2)
|
212
|
+
websocket-driver (0.7.6)
|
178
213
|
websocket-extensions (>= 0.1.0)
|
179
214
|
websocket-extensions (0.1.5)
|
180
|
-
zeitwerk (2.
|
215
|
+
zeitwerk (2.7.1)
|
181
216
|
|
182
217
|
PLATFORMS
|
183
|
-
|
218
|
+
aarch64-linux
|
219
|
+
aarch64-linux-gnu
|
220
|
+
aarch64-linux-musl
|
221
|
+
arm-linux
|
222
|
+
arm-linux-gnu
|
223
|
+
arm-linux-musl
|
224
|
+
arm64-darwin
|
225
|
+
x86-linux
|
226
|
+
x86-linux-gnu
|
227
|
+
x86-linux-musl
|
228
|
+
x86_64-darwin
|
229
|
+
x86_64-linux
|
230
|
+
x86_64-linux-gnu
|
231
|
+
x86_64-linux-musl
|
184
232
|
|
185
233
|
DEPENDENCIES
|
186
|
-
|
187
|
-
rails (~> 7.0)
|
234
|
+
rails (< 8.0)
|
188
235
|
rails_dictionary!
|
189
|
-
rspec-rails (
|
236
|
+
rspec-rails (< 8)
|
190
237
|
sqlite3
|
191
238
|
|
239
|
+
RUBY VERSION
|
240
|
+
ruby 3.3.5p100
|
241
|
+
|
192
242
|
BUNDLED WITH
|
193
|
-
2.
|
243
|
+
2.5.17
|
data/Rakefile
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
module RailsDictionary
|
2
2
|
module ActsAsDictSlave
|
3
|
-
|
4
|
-
base.extend(ClassMethods)
|
5
|
-
end
|
6
|
-
|
7
|
-
module ClassMethods
|
3
|
+
extend ActiveSupport::Concern
|
8
4
|
|
5
|
+
class_methods do
|
9
6
|
# return columns that exist in DictType#tab_and_column
|
10
7
|
def columns_in_dict_type
|
11
8
|
if ActiveRecord::VERSION::STRING < '3.1'
|
12
9
|
DictType.tab_and_column[self.name.underscore.to_sym]
|
13
|
-
elsif DictType.table_exists?
|
10
|
+
elsif ::DictType.table_exists?
|
14
11
|
DictType.tab_and_column[self.name.underscore.to_sym]
|
15
12
|
else
|
16
13
|
[]
|
@@ -82,7 +79,7 @@ module RailsDictionary
|
|
82
79
|
end
|
83
80
|
end
|
84
81
|
|
85
|
-
end # END
|
82
|
+
end # END class_methods
|
86
83
|
|
87
84
|
end
|
88
85
|
end
|
@@ -2,7 +2,6 @@ module RailsDictionary
|
|
2
2
|
module ActsAsDictType
|
3
3
|
def self.included(base)
|
4
4
|
base.extend(ClassMethods)
|
5
|
-
base.send :include, InstanceMethods
|
6
5
|
base.mattr_accessor :whole_types
|
7
6
|
end
|
8
7
|
|
@@ -45,12 +44,9 @@ module RailsDictionary
|
|
45
44
|
end
|
46
45
|
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
return true
|
52
|
-
end
|
47
|
+
def delete_all_caches
|
48
|
+
self.whole_types = nil
|
49
|
+
return true
|
53
50
|
end
|
54
|
-
|
55
51
|
end
|
56
52
|
end
|
@@ -1,11 +1,10 @@
|
|
1
|
+
require "active_support/concern"
|
2
|
+
|
1
3
|
module RailsDictionary
|
2
4
|
module ActsAsDictionary
|
3
|
-
|
4
|
-
base.extend(ClassMethods)
|
5
|
-
base.send :include,InstanceMethods
|
6
|
-
end
|
5
|
+
extend ActiveSupport::Concern
|
7
6
|
|
8
|
-
|
7
|
+
class_methods do
|
9
8
|
|
10
9
|
# For rails3
|
11
10
|
# I thought it would be better to define a method in method_missing, Not just generate cache.
|
@@ -72,15 +71,12 @@ module RailsDictionary
|
|
72
71
|
end
|
73
72
|
end
|
74
73
|
|
75
|
-
end # End
|
76
|
-
|
77
|
-
module InstanceMethods
|
78
|
-
def delete_dicts_cache
|
79
|
-
method_name = ::DictType.revert(self.dict_type_id)
|
80
|
-
Rails.cache.delete("Dictionary.#{method_name}")
|
81
|
-
return true
|
82
|
-
end
|
83
|
-
end # End InstanceMethods
|
74
|
+
end # End class_method
|
84
75
|
|
76
|
+
def delete_dicts_cache
|
77
|
+
method_name = ::DictType.revert(self.dict_type_id)
|
78
|
+
Rails.cache.delete("Dictionary.#{method_name}")
|
79
|
+
return true
|
80
|
+
end
|
85
81
|
end
|
86
82
|
end
|
data/rails_dictionary.gemspec
CHANGED
@@ -12,10 +12,12 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{dictionary data for web application}
|
13
13
|
s.description = %q{Rails plugin for mapping static data of web application to Dictionary class}
|
14
14
|
|
15
|
-
|
15
|
+
|
16
|
+
s.add_runtime_dependency 'rails', '< 8'
|
16
17
|
|
17
18
|
s.files = `git ls-files`.split("\n")
|
18
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
21
|
s.require_paths = ["lib"]
|
22
|
+
s.required_ruby_version = '>= 2.7.0'
|
21
23
|
end
|
data/spec/fake_app.rb
CHANGED
@@ -13,18 +13,6 @@ app.config.active_support.deprecation = :log
|
|
13
13
|
app.config.eager_load = false
|
14
14
|
app.initialize!
|
15
15
|
|
16
|
-
# models
|
17
|
-
class DictType < ActiveRecord::Base
|
18
|
-
acts_as_dict_type
|
19
|
-
end
|
20
|
-
|
21
|
-
class Dictionary < ActiveRecord::Base
|
22
|
-
acts_as_dictionary
|
23
|
-
end
|
24
|
-
|
25
|
-
class Student < ActiveRecord::Base
|
26
|
-
end
|
27
|
-
|
28
16
|
#migrations
|
29
17
|
class CreateAllTables < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
|
30
18
|
def self.up
|
data/spec/init_models.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class Dictionary < ActiveRecord::Base
|
2
|
+
acts_as_dictionary
|
3
|
+
end
|
4
|
+
|
5
|
+
class DictType < ActiveRecord::Base
|
6
|
+
acts_as_dict_type
|
7
|
+
end
|
8
|
+
|
9
|
+
# TODO: Here is a serious code loading issue. Student can't be load before DictType and Dictionary
|
10
|
+
class Student < ActiveRecord::Base
|
11
|
+
acts_as_dict_slave
|
12
|
+
end
|
@@ -69,6 +69,7 @@ describe RailsDictionary do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
describe Student do
|
72
|
+
# Run it because dict type value has cached at runtime but data inserted after cache created
|
72
73
|
before :each do
|
73
74
|
Student.acts_as_dict_slave
|
74
75
|
end
|
@@ -105,7 +106,7 @@ describe RailsDictionary do
|
|
105
106
|
end
|
106
107
|
|
107
108
|
it "override default locale" do
|
108
|
-
Student.
|
109
|
+
Student.acts_as_dict_consumer :locale => :fr
|
109
110
|
stu_beijing.named_city.should == "Pékin"
|
110
111
|
end
|
111
112
|
|
data/spec/spec_helper.rb
CHANGED
@@ -12,12 +12,11 @@ require File.join(File.dirname(__FILE__), 'fake_app')
|
|
12
12
|
|
13
13
|
require 'rspec/rails'
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
# $stdout = StringIO.new # remove the noise output. It can also disable pry debugger. Weird
|
15
|
+
# $stdout = StringIO.new # remove the noise outputo
|
18
16
|
|
19
17
|
RSpec.configure do |config|
|
20
18
|
config.use_transactional_fixtures = true
|
21
19
|
config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
|
22
20
|
CreateAllTables.up unless ActiveRecord::Base.connection.table_exists? 'dict_types'
|
21
|
+
require File.join(File.dirname(__FILE__), 'init_models')
|
23
22
|
end
|
metadata
CHANGED
@@ -1,35 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_dictionary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raykin Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ">"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '6.0'
|
20
17
|
- - "<"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '8'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - ">"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '6.0'
|
30
24
|
- - "<"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '8'
|
33
27
|
description: Rails plugin for mapping static data of web application to Dictionary
|
34
28
|
class
|
35
29
|
email:
|
@@ -56,6 +50,7 @@ files:
|
|
56
50
|
- pkg/rails_dictionary-0.2.3.gem
|
57
51
|
- rails_dictionary.gemspec
|
58
52
|
- spec/fake_app.rb
|
53
|
+
- spec/init_models.rb
|
59
54
|
- spec/rails_dictionary_spec.rb
|
60
55
|
- spec/spec_helper.rb
|
61
56
|
homepage: https://github.com/raykin/rails_dictionary
|
@@ -70,18 +65,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
65
|
requirements:
|
71
66
|
- - ">="
|
72
67
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
68
|
+
version: 2.7.0
|
74
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
70
|
requirements:
|
76
71
|
- - ">="
|
77
72
|
- !ruby/object:Gem::Version
|
78
73
|
version: '0'
|
79
74
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.5.16
|
81
76
|
signing_key:
|
82
77
|
specification_version: 4
|
83
78
|
summary: dictionary data for web application
|
84
79
|
test_files:
|
85
80
|
- spec/fake_app.rb
|
81
|
+
- spec/init_models.rb
|
86
82
|
- spec/rails_dictionary_spec.rb
|
87
83
|
- spec/spec_helper.rb
|