iqvoc_compound_forms 2.5.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -4
- data/Gemfile +7 -4
- data/Gemfile.lock +241 -173
- data/app/assets/javascripts/iqvoc_compound_forms/compound_forms.js +10 -4
- data/app/models/compound_form/base.rb +1 -1
- data/{lib/iqvoc/compound_forms/label_extensions.rb → app/models/concerns/compound_forms_label_extensions.rb} +32 -8
- data/app/views/partials/compound_form/_base.html.erb +12 -5
- data/app/views/partials/compound_form/_compound_form.html.erb +1 -1
- data/app/views/partials/compound_form/content/_base.html.erb +8 -3
- data/bin/rails +0 -4
- data/bin/rake +0 -4
- data/config/initializers/engine_extensions.rb +1 -4
- data/config/initializers/iqvoc.rb +1 -1
- data/config/locales/de.yml +3 -1
- data/config/locales/en.yml +3 -1
- data/db/migrate/20150108153131_add_fk_constraints_iqvoc_compound_forms.rb +7 -0
- data/iqvoc_compound_forms.gemspec +2 -2
- data/lib/iqvoc/compound_forms/version.rb +1 -1
- data/test/integration/compound_form_ui_test.rb +114 -0
- data/test/integration_test_helper.rb +29 -0
- data/test/models/compound_form_test.rb +1 -15
- data/test/models/import_test.rb +2 -3
- data/test/test_helper.rb +19 -0
- metadata +13 -9
- data/bin/spring +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dd457acc436663cd292db46223e25c36081eb48
|
4
|
+
data.tar.gz: c1ff944d394273519fa9d9c52081a206e246e51b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aae89d7decf3955aa617267cf5b0f9f994b239b3e1ead4e7030c3e6fe4dec8f16952e39e76516d90609591d40e764d6c9ebddb95f5abd8f2b9b36e2933af1e5
|
7
|
+
data.tar.gz: 8e34db5b2c6f4cddc610934601ed6ac205ed0adeb36cf1952289f693aa8fd900e8d6af1fee1456f96ea051ac4e00ff6636b52d5e25b28a3265655d3acad425af
|
data/.travis.yml
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
+
bundler_args: "--without production --retry 3"
|
3
4
|
bundler_args:
|
4
5
|
rvm:
|
5
|
-
- 1.9.3
|
6
|
+
# - 1.9.3
|
6
7
|
- 2.0
|
7
|
-
- 2.
|
8
|
-
-
|
8
|
+
- 2.2
|
9
|
+
- ruby-head
|
10
|
+
# - jruby-19mode
|
11
|
+
# - jruby-head
|
9
12
|
env:
|
10
13
|
- DB=sqlite
|
11
14
|
- DB=mysql
|
12
|
-
before_install:
|
15
|
+
before_install:
|
16
|
+
- cp config/database.$DB.yml config/database.yml
|
17
|
+
- gem update bundler
|
13
18
|
before_script:
|
14
19
|
- bundle exec rake db:drop RAILS_ENV=test
|
15
20
|
- bundle exec rake db:create RAILS_ENV=test
|
data/Gemfile
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'iqvoc', '~> 4.
|
4
|
-
gem 'iqvoc_skosxl', '~> 2.
|
3
|
+
gem 'iqvoc', '~> 4.10.0', :github => 'innoq/iqvoc', branch: 'master'
|
4
|
+
gem 'iqvoc_skosxl', '~> 2.8.0', :github => 'innoq/iqvoc_skosxl', branch: 'master'
|
5
5
|
|
6
6
|
group :development, :test do
|
7
|
-
gem 'spring'
|
8
7
|
gem 'pry-rails'
|
9
|
-
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem 'capybara', '~> 2.2.1'
|
11
|
+
gem 'poltergeist', '~> 1.5.0'
|
12
|
+
end
|
10
13
|
|
11
14
|
platforms :ruby do
|
12
15
|
gem 'mysql2'
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/innoq/iqvoc.git
|
3
|
-
revision:
|
3
|
+
revision: 872456feda103f7f3df4e771ab1ba608a985cac6
|
4
|
+
branch: master
|
4
5
|
specs:
|
5
|
-
iqvoc (4.
|
6
|
-
apipie-rails
|
6
|
+
iqvoc (4.10.0)
|
7
|
+
apipie-rails (~> 0.3.5)
|
7
8
|
authlogic (~> 3.4.2)
|
8
|
-
|
9
|
-
|
9
|
+
autoprefixer-rails (~> 5.1.8)
|
10
|
+
bootstrap-sass (~> 3.3.1.0)
|
11
|
+
bootstrap_form (~> 2.2.0)
|
10
12
|
bundler
|
11
13
|
cancancan
|
12
14
|
carrierwave
|
13
15
|
database_cleaner
|
14
16
|
delayed_job_active_record (~> 4.0.1)
|
15
|
-
faraday
|
17
|
+
faraday (= 0.9.0)
|
16
18
|
faraday_middleware
|
17
|
-
font-awesome-rails
|
19
|
+
font-awesome-rails (~> 4.2.0)
|
18
20
|
iq_rdf (>= 0.1.15)
|
19
21
|
iq_triplestorage
|
20
22
|
json
|
@@ -23,265 +25,328 @@ GIT
|
|
23
25
|
linkeddata
|
24
26
|
maruku
|
25
27
|
nokogiri
|
26
|
-
rails (~> 4.
|
28
|
+
rails (~> 4.2.0)
|
27
29
|
rails_autolink
|
28
|
-
sass-rails (~>
|
30
|
+
sass-rails (~> 5.0.0)
|
29
31
|
uglifier (>= 1.3.0)
|
30
32
|
|
31
33
|
GIT
|
32
34
|
remote: git://github.com/innoq/iqvoc_skosxl.git
|
33
|
-
revision:
|
35
|
+
revision: 76b2f925be425d8236379d7487023a7053629ad2
|
36
|
+
branch: master
|
34
37
|
specs:
|
35
|
-
iqvoc_skosxl (2.
|
36
|
-
iqvoc (~> 4.
|
38
|
+
iqvoc_skosxl (2.8.0)
|
39
|
+
iqvoc (~> 4.10.0)
|
37
40
|
|
38
41
|
GEM
|
39
42
|
remote: https://rubygems.org/
|
40
43
|
specs:
|
41
|
-
actionmailer (4.1
|
42
|
-
actionpack (= 4.1
|
43
|
-
actionview (= 4.1
|
44
|
+
actionmailer (4.2.1)
|
45
|
+
actionpack (= 4.2.1)
|
46
|
+
actionview (= 4.2.1)
|
47
|
+
activejob (= 4.2.1)
|
44
48
|
mail (~> 2.5, >= 2.5.4)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
50
|
+
actionpack (4.2.1)
|
51
|
+
actionview (= 4.2.1)
|
52
|
+
activesupport (= 4.2.1)
|
53
|
+
rack (~> 1.6)
|
49
54
|
rack-test (~> 0.6.2)
|
50
|
-
|
51
|
-
|
55
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
56
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
57
|
+
actionview (4.2.1)
|
58
|
+
activesupport (= 4.2.1)
|
52
59
|
builder (~> 3.1)
|
53
60
|
erubis (~> 2.7.0)
|
54
|
-
|
55
|
-
|
61
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
62
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
63
|
+
activejob (4.2.1)
|
64
|
+
activesupport (= 4.2.1)
|
65
|
+
globalid (>= 0.3.0)
|
66
|
+
activemodel (4.2.1)
|
67
|
+
activesupport (= 4.2.1)
|
56
68
|
builder (~> 3.1)
|
57
|
-
activerecord (4.1
|
58
|
-
activemodel (= 4.1
|
59
|
-
activesupport (= 4.1
|
60
|
-
arel (~>
|
61
|
-
activerecord-jdbc-adapter (1.3.
|
69
|
+
activerecord (4.2.1)
|
70
|
+
activemodel (= 4.2.1)
|
71
|
+
activesupport (= 4.2.1)
|
72
|
+
arel (~> 6.0)
|
73
|
+
activerecord-jdbc-adapter (1.3.14)
|
62
74
|
activerecord (>= 2.2)
|
63
|
-
activerecord-jdbcmysql-adapter (1.3.
|
64
|
-
activerecord-jdbc-adapter (~> 1.3.
|
75
|
+
activerecord-jdbcmysql-adapter (1.3.14)
|
76
|
+
activerecord-jdbc-adapter (~> 1.3.14)
|
65
77
|
jdbc-mysql (>= 5.1.22)
|
66
|
-
activerecord-jdbcsqlite3-adapter (1.3.
|
67
|
-
activerecord-jdbc-adapter (~> 1.3.
|
68
|
-
jdbc-sqlite3 (
|
69
|
-
activesupport (4.1
|
70
|
-
i18n (~> 0.
|
78
|
+
activerecord-jdbcsqlite3-adapter (1.3.14)
|
79
|
+
activerecord-jdbc-adapter (~> 1.3.14)
|
80
|
+
jdbc-sqlite3 (>= 3.7.2, < 3.9)
|
81
|
+
activesupport (4.2.1)
|
82
|
+
i18n (~> 0.7)
|
71
83
|
json (~> 1.7, >= 1.7.7)
|
72
84
|
minitest (~> 5.1)
|
73
|
-
thread_safe (~> 0.
|
85
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
74
86
|
tzinfo (~> 1.1)
|
75
|
-
|
87
|
+
addressable (2.4.0)
|
88
|
+
apipie-rails (0.3.5)
|
76
89
|
json
|
77
|
-
arel (
|
78
|
-
authlogic (3.4.
|
90
|
+
arel (6.0.0)
|
91
|
+
authlogic (3.4.6)
|
79
92
|
activerecord (>= 3.2)
|
80
93
|
activesupport (>= 3.2)
|
81
94
|
request_store (~> 1.0)
|
82
|
-
scrypt (
|
83
|
-
|
84
|
-
|
95
|
+
scrypt (>= 1.2, < 3.0)
|
96
|
+
autoprefixer-rails (5.1.11)
|
97
|
+
execjs
|
98
|
+
json
|
99
|
+
bcp47 (0.3.3)
|
100
|
+
i18n
|
101
|
+
bootstrap-sass (3.3.1.0)
|
85
102
|
sass (~> 3.2)
|
86
|
-
bootstrap_form (2.
|
103
|
+
bootstrap_form (2.2.0)
|
87
104
|
builder (3.2.2)
|
88
|
-
cancancan (1.
|
105
|
+
cancancan (1.13.1)
|
106
|
+
capybara (2.2.1)
|
107
|
+
mime-types (>= 1.16)
|
108
|
+
nokogiri (>= 1.3.3)
|
109
|
+
rack (>= 1.0.0)
|
110
|
+
rack-test (>= 0.5.4)
|
111
|
+
xpath (~> 2.0)
|
89
112
|
carrierwave (0.10.0)
|
90
113
|
activemodel (>= 3.2.0)
|
91
114
|
activesupport (>= 3.2.0)
|
92
115
|
json (>= 1.7)
|
93
116
|
mime-types (>= 1.16)
|
117
|
+
cliver (0.3.2)
|
94
118
|
coderay (1.1.0)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
119
|
+
concurrent-ruby (1.0.0)
|
120
|
+
database_cleaner (1.5.1)
|
121
|
+
delayed_job (4.0.6)
|
122
|
+
activesupport (>= 3.0, < 5.0)
|
123
|
+
delayed_job_active_record (4.0.3)
|
124
|
+
activerecord (>= 3.0, < 5.0)
|
100
125
|
delayed_job (>= 3.0, < 4.1)
|
101
|
-
ebnf (0.
|
102
|
-
haml (~> 4.0)
|
126
|
+
ebnf (1.0.0)
|
103
127
|
rdf (~> 1.1)
|
104
128
|
sxp (~> 0.1, >= 0.1.3)
|
105
|
-
equivalent-xml (0.
|
129
|
+
equivalent-xml (0.6.0)
|
106
130
|
nokogiri (>= 1.4.3)
|
107
131
|
erubis (2.7.0)
|
108
|
-
execjs (2.
|
132
|
+
execjs (2.6.0)
|
109
133
|
faraday (0.9.0)
|
110
134
|
multipart-post (>= 1.2, < 3)
|
111
|
-
faraday_middleware (0.
|
135
|
+
faraday_middleware (0.10.0)
|
112
136
|
faraday (>= 0.7.4, < 0.10)
|
113
|
-
ffi (1.9.
|
114
|
-
ffi (1.9.
|
137
|
+
ffi (1.9.8)
|
138
|
+
ffi (1.9.8-java)
|
115
139
|
ffi-compiler (0.1.3)
|
116
140
|
ffi (>= 1.0.0)
|
117
141
|
rake
|
118
142
|
font-awesome-rails (4.2.0.0)
|
119
143
|
railties (>= 3.2, < 5.0)
|
120
|
-
|
144
|
+
globalid (0.3.6)
|
145
|
+
activesupport (>= 4.1.0)
|
146
|
+
haml (4.0.7)
|
121
147
|
tilt
|
122
|
-
|
123
|
-
|
124
|
-
i18n (0.6.11)
|
148
|
+
htmlentities (4.3.4)
|
149
|
+
i18n (0.7.0)
|
125
150
|
iq_rdf (0.1.15)
|
126
151
|
activesupport
|
127
152
|
builder
|
128
153
|
bundler
|
129
154
|
iq_triplestorage (0.2.2)
|
130
|
-
jdbc-mysql (5.1.
|
131
|
-
jdbc-sqlite3 (3.7
|
132
|
-
json (1.8.
|
133
|
-
json (1.8.
|
134
|
-
json-ld (1.
|
135
|
-
|
136
|
-
|
155
|
+
jdbc-mysql (5.1.33)
|
156
|
+
jdbc-sqlite3 (3.8.7)
|
157
|
+
json (1.8.2)
|
158
|
+
json (1.8.2-java)
|
159
|
+
json-ld (1.99.0)
|
160
|
+
multi_json (~> 1.11)
|
161
|
+
rdf (~> 1.99)
|
162
|
+
kaminari (0.16.3)
|
137
163
|
actionpack (>= 3.0.0)
|
138
164
|
activesupport (>= 3.0.0)
|
139
165
|
kaminari-bootstrap (3.0.1)
|
140
166
|
kaminari (>= 0.13.0)
|
141
167
|
rails
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
rdf
|
148
|
-
rdf-
|
149
|
-
rdf-
|
150
|
-
rdf-
|
151
|
-
rdf-
|
152
|
-
rdf-
|
153
|
-
rdf-
|
154
|
-
rdf-
|
155
|
-
rdf-
|
156
|
-
rdf-
|
157
|
-
|
158
|
-
|
159
|
-
|
168
|
+
link_header (0.0.8)
|
169
|
+
linkeddata (1.99.0)
|
170
|
+
equivalent-xml (~> 0.6)
|
171
|
+
json-ld (~> 1.99)
|
172
|
+
nokogiri (~> 1.6)
|
173
|
+
rdf (~> 1.99)
|
174
|
+
rdf-aggregate-repo (~> 1.99)
|
175
|
+
rdf-isomorphic (~> 1.99)
|
176
|
+
rdf-json (~> 1.1, >= 1.1.2)
|
177
|
+
rdf-microdata (~> 2.0, >= 2.0.2)
|
178
|
+
rdf-n3 (~> 1.99)
|
179
|
+
rdf-rdfa (~> 1.99)
|
180
|
+
rdf-rdfxml (~> 1.1, >= 1.1.5)
|
181
|
+
rdf-reasoner (~> 0.3)
|
182
|
+
rdf-tabular (~> 0.3)
|
183
|
+
rdf-trig (~> 1.99, >= 1.99.0.1)
|
184
|
+
rdf-trix (~> 1.99)
|
185
|
+
rdf-turtle (~> 1.99)
|
186
|
+
rdf-vocab (~> 0.8, >= 0.8.6)
|
187
|
+
rdf-xsd (~> 1.1, >= 1.1.5)
|
188
|
+
sparql (~> 1.99)
|
189
|
+
sparql-client (~> 1.99)
|
190
|
+
loofah (2.0.3)
|
191
|
+
nokogiri (>= 1.5.9)
|
192
|
+
mail (2.6.3)
|
160
193
|
mime-types (>= 1.16, < 3)
|
161
194
|
maruku (0.7.2)
|
162
195
|
method_source (0.8.2)
|
163
|
-
mime-types (2.
|
164
|
-
mini_portile (0.6.
|
165
|
-
minitest (5.
|
166
|
-
multi_json (1.
|
196
|
+
mime-types (2.99.1)
|
197
|
+
mini_portile (0.6.2)
|
198
|
+
minitest (5.6.1)
|
199
|
+
multi_json (1.11.2)
|
167
200
|
multipart-post (2.0.0)
|
168
|
-
mysql2 (0.3.
|
201
|
+
mysql2 (0.3.17)
|
169
202
|
net-http-persistent (2.9.4)
|
170
|
-
nokogiri (1.6.
|
171
|
-
mini_portile (
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
203
|
+
nokogiri (1.6.6.2)
|
204
|
+
mini_portile (~> 0.6.0)
|
205
|
+
poltergeist (1.5.1)
|
206
|
+
capybara (~> 2.1)
|
207
|
+
cliver (~> 0.3.1)
|
208
|
+
multi_json (~> 1.0)
|
209
|
+
websocket-driver (>= 0.2.0)
|
210
|
+
pry (0.10.1)
|
211
|
+
coderay (~> 1.1.0)
|
212
|
+
method_source (~> 0.8.1)
|
176
213
|
slop (~> 3.4)
|
177
|
-
pry (0.
|
178
|
-
coderay (~> 1.0)
|
179
|
-
method_source (~> 0.8)
|
214
|
+
pry (0.10.1-java)
|
215
|
+
coderay (~> 1.1.0)
|
216
|
+
method_source (~> 0.8.1)
|
180
217
|
slop (~> 3.4)
|
181
218
|
spoon (~> 0.0)
|
182
|
-
pry-rails (0.3.
|
219
|
+
pry-rails (0.3.3)
|
183
220
|
pry (>= 0.9.10)
|
184
|
-
rack (1.
|
185
|
-
rack-test (0.6.
|
221
|
+
rack (1.6.4)
|
222
|
+
rack-test (0.6.3)
|
186
223
|
rack (>= 1.0)
|
187
|
-
rails (4.1
|
188
|
-
actionmailer (= 4.1
|
189
|
-
actionpack (= 4.1
|
190
|
-
actionview (= 4.1
|
191
|
-
|
192
|
-
|
193
|
-
|
224
|
+
rails (4.2.1)
|
225
|
+
actionmailer (= 4.2.1)
|
226
|
+
actionpack (= 4.2.1)
|
227
|
+
actionview (= 4.2.1)
|
228
|
+
activejob (= 4.2.1)
|
229
|
+
activemodel (= 4.2.1)
|
230
|
+
activerecord (= 4.2.1)
|
231
|
+
activesupport (= 4.2.1)
|
194
232
|
bundler (>= 1.3.0, < 2.0)
|
195
|
-
railties (= 4.1
|
196
|
-
sprockets-rails
|
233
|
+
railties (= 4.2.1)
|
234
|
+
sprockets-rails
|
235
|
+
rails-deprecated_sanitizer (1.0.3)
|
236
|
+
activesupport (>= 4.2.0.alpha)
|
237
|
+
rails-dom-testing (1.0.7)
|
238
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
239
|
+
nokogiri (~> 1.6.0)
|
240
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
241
|
+
rails-html-sanitizer (1.0.3)
|
242
|
+
loofah (~> 2.0)
|
197
243
|
rails_autolink (1.1.6)
|
198
244
|
rails (> 3.1)
|
199
|
-
railties (4.1
|
200
|
-
actionpack (= 4.1
|
201
|
-
activesupport (= 4.1
|
245
|
+
railties (4.2.1)
|
246
|
+
actionpack (= 4.2.1)
|
247
|
+
activesupport (= 4.2.1)
|
202
248
|
rake (>= 0.8.7)
|
203
249
|
thor (>= 0.18.1, < 2.0)
|
204
|
-
rake (
|
205
|
-
rdf (1.1
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
250
|
+
rake (11.1.2)
|
251
|
+
rdf (1.99.1)
|
252
|
+
link_header (~> 0.0, >= 0.0.8)
|
253
|
+
rdf-aggregate-repo (1.99.0)
|
254
|
+
rdf (~> 1.99)
|
255
|
+
rdf-isomorphic (1.99.0)
|
256
|
+
rdf (~> 1.99)
|
257
|
+
rdf-json (1.99.0)
|
258
|
+
rdf (~> 1.99)
|
259
|
+
rdf-microdata (2.0.2)
|
213
260
|
htmlentities (~> 4.3)
|
214
261
|
nokogiri (~> 1.6)
|
215
262
|
rdf (~> 1.1)
|
216
263
|
rdf-xsd (~> 1.1)
|
217
|
-
rdf-n3 (1.
|
218
|
-
rdf (~> 1.
|
219
|
-
rdf-rdfa (1.
|
264
|
+
rdf-n3 (1.99.0)
|
265
|
+
rdf (~> 1.99)
|
266
|
+
rdf-rdfa (1.99.0)
|
220
267
|
haml (~> 4.0)
|
221
268
|
htmlentities (~> 4.3)
|
222
|
-
rdf (~> 1.
|
269
|
+
rdf (~> 1.99)
|
270
|
+
rdf-aggregate-repo (~> 1.1)
|
223
271
|
rdf-xsd (~> 1.1)
|
224
|
-
rdf-rdfxml (1.
|
272
|
+
rdf-rdfxml (1.99.0)
|
225
273
|
htmlentities (~> 4.3)
|
226
|
-
rdf (~> 1.
|
227
|
-
rdf-rdfa (~> 1.
|
274
|
+
rdf (~> 1.99)
|
275
|
+
rdf-rdfa (~> 1.99)
|
276
|
+
rdf-xsd (~> 1.99)
|
277
|
+
rdf-reasoner (0.3.0)
|
278
|
+
rdf (~> 1.1, >= 1.1.4.2)
|
279
|
+
rdf-turtle (~> 1.1)
|
280
|
+
rdf-vocab (~> 0.8)
|
228
281
|
rdf-xsd (~> 1.1)
|
229
|
-
rdf-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
rdf (
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
282
|
+
rdf-tabular (0.3.0)
|
283
|
+
addressable (~> 2.3)
|
284
|
+
bcp47 (~> 0.3, >= 0.3.3)
|
285
|
+
json-ld (~> 1.1)
|
286
|
+
rdf (~> 1.1, >= 1.1.7)
|
287
|
+
rdf-vocab (~> 0.8)
|
288
|
+
rdf-xsd (~> 1.1)
|
289
|
+
rdf-trig (1.99.0.1)
|
290
|
+
ebnf (~> 1.0)
|
291
|
+
rdf (~> 1.99)
|
292
|
+
rdf-turtle (~> 1.99)
|
293
|
+
rdf-trix (1.99.0)
|
239
294
|
rdf (~> 1.1)
|
240
|
-
|
241
|
-
|
242
|
-
|
295
|
+
rdf-turtle (1.99.0)
|
296
|
+
ebnf (~> 1.0)
|
297
|
+
rdf (~> 1.99)
|
298
|
+
rdf-vocab (0.8.7.1)
|
299
|
+
rdf (~> 1.1, >= 1.1.10)
|
300
|
+
rdf-xsd (1.99.0)
|
301
|
+
rdf (~> 1.99)
|
302
|
+
request_store (1.3.1)
|
303
|
+
sass (3.4.21)
|
304
|
+
sass-rails (5.0.4)
|
243
305
|
railties (>= 4.0.0, < 5.0)
|
244
|
-
sass (~> 3.
|
245
|
-
sprockets (
|
246
|
-
sprockets-rails (
|
247
|
-
|
306
|
+
sass (~> 3.1)
|
307
|
+
sprockets (>= 2.8, < 4.0)
|
308
|
+
sprockets-rails (>= 2.0, < 4.0)
|
309
|
+
tilt (>= 1.1, < 3)
|
310
|
+
scrypt (2.0.2)
|
248
311
|
ffi-compiler (>= 0.0.2)
|
249
312
|
rake
|
250
|
-
slop (3.
|
251
|
-
sparql (1.
|
252
|
-
builder (~> 3.
|
253
|
-
ebnf (~>
|
254
|
-
rdf (~> 1.
|
255
|
-
rdf-aggregate-repo (~> 1.
|
313
|
+
slop (3.6.0)
|
314
|
+
sparql (1.99.0)
|
315
|
+
builder (~> 3.2)
|
316
|
+
ebnf (~> 1.0)
|
317
|
+
rdf (~> 1.99)
|
318
|
+
rdf-aggregate-repo (~> 1.99)
|
256
319
|
rdf-xsd (~> 1.1)
|
257
320
|
sparql-client (~> 1.1)
|
258
321
|
sxp (~> 0.1)
|
259
|
-
sparql-client (1.
|
322
|
+
sparql-client (1.99.0)
|
260
323
|
net-http-persistent (~> 2.9)
|
261
324
|
rdf (~> 1.1)
|
262
325
|
spoon (0.0.4)
|
263
326
|
ffi
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
activesupport (>= 3.0)
|
273
|
-
sprockets (>= 2.8, < 4.0)
|
274
|
-
sqlite3 (1.3.9)
|
327
|
+
sprockets (3.5.2)
|
328
|
+
concurrent-ruby (~> 1.0)
|
329
|
+
rack (> 1, < 3)
|
330
|
+
sprockets-rails (3.0.1)
|
331
|
+
actionpack (>= 4.0)
|
332
|
+
activesupport (>= 4.0)
|
333
|
+
sprockets (>= 3.0.0)
|
334
|
+
sqlite3 (1.3.10)
|
275
335
|
sxp (0.1.5)
|
276
336
|
thor (0.19.1)
|
277
|
-
thread_safe (0.3.
|
278
|
-
thread_safe (0.3.
|
279
|
-
tilt (
|
337
|
+
thread_safe (0.3.5)
|
338
|
+
thread_safe (0.3.5-java)
|
339
|
+
tilt (2.0.2)
|
280
340
|
tzinfo (1.2.2)
|
281
341
|
thread_safe (~> 0.1)
|
282
|
-
uglifier (2.
|
342
|
+
uglifier (2.7.2)
|
283
343
|
execjs (>= 0.3.0)
|
284
344
|
json (>= 1.8.0)
|
345
|
+
websocket-driver (0.6.3)
|
346
|
+
websocket-extensions (>= 0.1.0)
|
347
|
+
websocket-extensions (0.1.2)
|
348
|
+
xpath (2.0.0)
|
349
|
+
nokogiri (~> 1.3)
|
285
350
|
|
286
351
|
PLATFORMS
|
287
352
|
java
|
@@ -290,10 +355,13 @@ PLATFORMS
|
|
290
355
|
DEPENDENCIES
|
291
356
|
activerecord-jdbcmysql-adapter
|
292
357
|
activerecord-jdbcsqlite3-adapter
|
293
|
-
|
294
|
-
iqvoc (~> 4.
|
295
|
-
iqvoc_skosxl (~> 2.
|
358
|
+
capybara (~> 2.2.1)
|
359
|
+
iqvoc (~> 4.10.0)!
|
360
|
+
iqvoc_skosxl (~> 2.8.0)!
|
296
361
|
mysql2
|
362
|
+
poltergeist (~> 1.5.0)
|
297
363
|
pry-rails
|
298
|
-
spring
|
299
364
|
sqlite3
|
365
|
+
|
366
|
+
BUNDLED WITH
|
367
|
+
1.12.4
|
@@ -4,19 +4,25 @@
|
|
4
4
|
jQuery(document).ready(function($) {
|
5
5
|
"use strict";
|
6
6
|
|
7
|
-
$("input[type=button].add-compound-form").
|
7
|
+
$("input[type=button].add-compound-form").on("click", function(ev) {
|
8
8
|
var original = $(this).closest(".compound-form");
|
9
|
-
var clone = original.clone();
|
9
|
+
var clone = original.clone(true);
|
10
10
|
var container = $("div.entity_select", clone);
|
11
11
|
var el = $("input.entity_select", clone).
|
12
12
|
attr("data-entities", "").val("").insertBefore(container);
|
13
13
|
container.remove();
|
14
14
|
clone.insertAfter(original);
|
15
15
|
new IQVOC.EntitySelector(el[0]);
|
16
|
+
|
17
|
+
$("ul.entity_list", clone).html("");
|
16
18
|
});
|
17
19
|
|
18
20
|
$("input[type=button].rm-compound-form").click(function(ev) {
|
19
|
-
//
|
20
|
-
$(this).parent().
|
21
|
+
// clear compound form values
|
22
|
+
$(this).parent().find('input.entity_select').val("");
|
23
|
+
|
24
|
+
// hide the <li> that contains the widget
|
25
|
+
// don't drop it to keep cleared form inputs
|
26
|
+
$(this).parent().parent().hide();
|
21
27
|
});
|
22
28
|
});
|
@@ -47,7 +47,7 @@ class CompoundForm::Base < ActiveRecord::Base
|
|
47
47
|
raise "#{self.name}#build_from_rdf: Subject (#{rdf_subject}) must be a 'Label::SKOSXL::Base'"
|
48
48
|
end
|
49
49
|
|
50
|
-
target_class =
|
50
|
+
target_class = RDFAPI::PREDICATE_DICTIONARY[rdf_predicate] || self
|
51
51
|
|
52
52
|
ActiveRecord::Base.transaction do
|
53
53
|
begin
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "active_support/concern"
|
4
4
|
|
5
|
-
module
|
5
|
+
module CompoundFormsLabelExtensions
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
@@ -10,10 +10,10 @@ module Iqvoc::CompoundForms::LabelExtensions
|
|
10
10
|
# Compound forms
|
11
11
|
# Only handle compound form creation if there are submitted widget values
|
12
12
|
# Otherwise compound_forms would be destroyed on every save (e.g. in the branching process)!
|
13
|
-
if inline_compound_form_origins
|
13
|
+
if @inline_compound_form_origins
|
14
14
|
transaction do
|
15
15
|
compound_forms.destroy_all
|
16
|
-
inline_compound_form_origins.each do |origin_collection|
|
16
|
+
@inline_compound_form_origins.each do |origin_collection|
|
17
17
|
compound_form_contents = []
|
18
18
|
origin_collection.each_with_index do |origin, index|
|
19
19
|
if label = Iqvoc::XLLabel.base_class.editor_selectable.by_origin(origin).last
|
@@ -39,12 +39,15 @@ module Iqvoc::CompoundForms::LabelExtensions
|
|
39
39
|
:dependent => :destroy
|
40
40
|
|
41
41
|
validate :compound_form_contents_size
|
42
|
+
validate :compound_form_contents_languages
|
43
|
+
validate :compound_form_contents_self_reference
|
42
44
|
end
|
43
45
|
|
44
46
|
def compound_in
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
# FIXME: sort with database function
|
48
|
+
CompoundForm::Base.joins(:compound_form_contents)
|
49
|
+
.where(:compound_form_contents => { :label_id => id })
|
50
|
+
.includes(:domain).map(&:domain).sort_by(&:value)
|
48
51
|
end
|
49
52
|
|
50
53
|
# Serialized setters and getters (\r\n or , separated)
|
@@ -57,7 +60,7 @@ module Iqvoc::CompoundForms::LabelExtensions
|
|
57
60
|
@inline_compound_form_origins ||= []
|
58
61
|
|
59
62
|
value_collection.reject(&:blank?).each do |value|
|
60
|
-
@inline_compound_form_origins << value.split(/\r\n|, */).map(&:strip).
|
63
|
+
@inline_compound_form_origins << value.split(/\r\n|, */).map(&:strip).
|
61
64
|
reject(&:blank?).uniq
|
62
65
|
end
|
63
66
|
end
|
@@ -66,10 +69,31 @@ module Iqvoc::CompoundForms::LabelExtensions
|
|
66
69
|
if validatable_for_publishing?
|
67
70
|
compound_forms.each do |cf|
|
68
71
|
if cf.compound_form_contents.count < 2
|
69
|
-
errors.add :base, I18n.t("txt.models.label.
|
72
|
+
errors.add :base, I18n.t("txt.models.label.compound_form_contents_size_error")
|
70
73
|
end
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
74
77
|
|
78
|
+
def compound_form_contents_languages
|
79
|
+
if validatable_for_publishing?
|
80
|
+
compound_form_contents.each do |cfc|
|
81
|
+
if cfc.label.language != language
|
82
|
+
errors.add :base, I18n.t("txt.models.label.compound_form_contents_language_error")
|
83
|
+
break
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def compound_form_contents_self_reference
|
90
|
+
if validatable_for_publishing?
|
91
|
+
cfc_label_ids = compound_form_contents.map {|cfc| cfc.label_id }
|
92
|
+
if cfc_label_ids.include? published_version_id
|
93
|
+
errors.add :base, I18n.t("txt.models.label.compound_form_contents_self_reference_error")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
|
75
99
|
end
|
@@ -1,10 +1,17 @@
|
|
1
1
|
<div class="relation panel">
|
2
2
|
<h2><%= t("txt.views.labels.compound_from") %></h2>
|
3
3
|
<div class="relation-body">
|
4
|
-
<% label.
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
<% compound_form_bases = label.compound_form_bases %>
|
5
|
+
<% if compound_form_bases.any? %>
|
6
|
+
<ol>
|
7
|
+
<% compound_form_bases.each do |cfb| %>
|
8
|
+
<li>
|
9
|
+
<%= raw cfb.compound_form_contents.label_published.map { |cfc|
|
10
|
+
link_to(cfc.label.value, label_path(:id => cfc.label))
|
11
|
+
}.join(', ') %>
|
12
|
+
</li>
|
13
|
+
<% end %>
|
14
|
+
</ol>
|
8
15
|
<% end %>
|
9
16
|
</div>
|
10
|
-
</div>
|
17
|
+
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
map { |cfc| cfc.label.origin }).load %>
|
5
5
|
<% fieldname = "label[inline_compound_form_origins][]" %>
|
6
6
|
<%= f.form_group nil, :label => { :text => t('txt.common.type_to_search') } do %>
|
7
|
-
<%= text_field_tag fieldname, items.join(
|
7
|
+
<%= text_field_tag fieldname, items.map(&:origin).join(InlineDataHelper::JOINER),
|
8
8
|
:class => "entity_select",
|
9
9
|
:"data-query-url" => labels_path(:format => :json),
|
10
10
|
:"data-entity-uri" => label_path("{id}"),
|
@@ -1,8 +1,13 @@
|
|
1
1
|
<div class="relation panel">
|
2
2
|
<h2><%= t("txt.views.labels.compound_in") %></h2>
|
3
3
|
<div class="relation-body">
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
<% compound_in = label.compound_in %>
|
5
|
+
<% if compound_in.any? %>
|
6
|
+
<ol>
|
7
|
+
<% compound_in.each do |label| %>
|
8
|
+
<li><%= link_to(label.value, label_path(:id => label)) %></li>
|
9
|
+
<% end %>
|
10
|
+
</ol>
|
11
|
+
<% end %>
|
7
12
|
</div>
|
8
13
|
</div>
|
data/bin/rails
CHANGED
@@ -1,8 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
begin
|
3
|
-
load File.expand_path("../spring", __FILE__)
|
4
|
-
rescue LoadError
|
5
|
-
end
|
6
2
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
7
3
|
|
8
4
|
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
data/bin/rake
CHANGED
@@ -13,5 +13,5 @@ Iqvoc::XLLabel.additional_association_class_names.
|
|
13
13
|
Iqvoc::XLLabel.view_sections += ["compound_forms"]
|
14
14
|
|
15
15
|
ActiveSupport.on_load :skos_importer do
|
16
|
-
|
16
|
+
SkosImporter.second_level_object_classes.delete(CompoundForm::Content::Base)
|
17
17
|
end
|
data/config/locales/de.yml
CHANGED
@@ -2,7 +2,9 @@ de:
|
|
2
2
|
txt:
|
3
3
|
models:
|
4
4
|
label:
|
5
|
-
|
5
|
+
compound_form_contents_size_error: Eine Zusammensetzung muss aus min. 2 Labels bestehen.
|
6
|
+
compound_form_contents_language_error: Zusammensetzungen müssen die Sprache des Haupt-Labels besitzen.
|
7
|
+
compound_form_contents_self_reference_error: Eine Zusammensetzung darf nicht auf das Haupt-Label verweisen.
|
6
8
|
views:
|
7
9
|
labels:
|
8
10
|
compound_from: Zusammengesetzt aus
|
data/config/locales/en.yml
CHANGED
@@ -2,7 +2,9 @@ en:
|
|
2
2
|
txt:
|
3
3
|
models:
|
4
4
|
label:
|
5
|
-
|
5
|
+
compound_form_contents_size_error: Each composition must have at least two components.
|
6
|
+
compound_form_contents_language_error: Each composition must have the same language as the main label.
|
7
|
+
compound_form_contents_self_reference_error: A composition must not refer the main label.
|
6
8
|
views:
|
7
9
|
labels:
|
8
10
|
compound_from: Compound from
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class AddFkConstraintsIqvocCompoundForms < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_foreign_key :compound_forms, :labels, column: 'domain_id', on_update: :cascade, on_delete: :cascade
|
4
|
+
add_foreign_key :compound_form_contents, :compound_forms, column: 'compound_form_id', on_update: :cascade, on_delete: :cascade
|
5
|
+
add_foreign_key :compound_form_contents, :labels, column: 'label_id', on_update: :cascade, on_delete: :cascade
|
6
|
+
end
|
7
|
+
end
|
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.rubyforge_project = "iqvoc_compound_forms"
|
17
17
|
|
18
|
-
s.add_dependency "iqvoc", ">= 4.5.0", "~> 4.
|
19
|
-
s.add_dependency "iqvoc_skosxl", "~> 2.
|
18
|
+
s.add_dependency "iqvoc", ">= 4.5.0", "~> 4.10"
|
19
|
+
s.add_dependency "iqvoc_skosxl", "~> 2.8.0"
|
20
20
|
|
21
21
|
s.files = `git ls-files`.split("\n")
|
22
22
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011-2016 innoQ Deutschland GmbH
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '../integration_test_helper')
|
18
|
+
|
19
|
+
class CompoundFormUITest < ActionDispatch::IntegrationTest
|
20
|
+
setup do
|
21
|
+
login 'administrator'
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
test 'compound form ui existence' do
|
26
|
+
create_compound_form_label(
|
27
|
+
'Luftreinhaltungskosten' => %w(Luft Reinhaltung Kosten)
|
28
|
+
)
|
29
|
+
|
30
|
+
label = Iqvoc::XLLabel.base_class.find_by(value: 'Luftreinhaltungskosten')
|
31
|
+
visit label_path(label, lang: 'en', format: 'html')
|
32
|
+
|
33
|
+
assert page.has_content? 'Luftreinhaltungskosten'
|
34
|
+
|
35
|
+
within('#compound_forms') do |ref|
|
36
|
+
assert page.has_content? 'Compound from'
|
37
|
+
assert page.has_content? 'Luft, Reinhaltung, Kosten'
|
38
|
+
|
39
|
+
click_link 'Reinhaltung'
|
40
|
+
end
|
41
|
+
|
42
|
+
within('#compound_forms') do |ref|
|
43
|
+
assert page.has_content? 'Compound from'
|
44
|
+
assert page.has_content? 'Luftreinhaltungskosten'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
test 'compound form ui removement' do
|
49
|
+
create_compound_form_label(
|
50
|
+
'Abtrennung und Transmutation radioaktiven Abfalls' => %w(Abtrennung Transmutation radioaktiv Abfall)
|
51
|
+
)
|
52
|
+
|
53
|
+
label = Iqvoc::XLLabel.base_class.find_by(value: 'Abtrennung und Transmutation radioaktiven Abfalls')
|
54
|
+
visit label_path(label, lang: 'en', format: 'html')
|
55
|
+
|
56
|
+
assert page.has_content? 'Abtrennung und Transmutation radioaktiven Abfalls'
|
57
|
+
|
58
|
+
within('#compound_forms') do |ref|
|
59
|
+
assert page.has_content? 'Compound from'
|
60
|
+
assert page.has_content? 'Abtrennung, Transmutation, radioaktiv, Abfall'
|
61
|
+
end
|
62
|
+
|
63
|
+
click_link_or_button 'Create new version'
|
64
|
+
assert page.has_content? 'Instance copy has been created and locked.'
|
65
|
+
|
66
|
+
# remove last component (fill in first 3)
|
67
|
+
compound_form_origins = label.compound_form_contents.map {|cfc| cfc.label.origin}
|
68
|
+
first_three_origins = compound_form_origins[0..2]
|
69
|
+
fill_in 'label_inline_compound_form_origins_', with: first_three_origins.join(', ')
|
70
|
+
|
71
|
+
# save changes
|
72
|
+
click_link_or_button 'Save'
|
73
|
+
|
74
|
+
assert page.has_content? 'Label has been successfully modified.'
|
75
|
+
|
76
|
+
within('#compound_forms') do |ref|
|
77
|
+
assert page.has_content? 'Compound from'
|
78
|
+
assert page.has_content? 'Abtrennung, Transmutation, radioaktiv' # without 'Abfall'
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
test 'remove compound form completely from ui' do
|
84
|
+
create_compound_form_label(
|
85
|
+
'Hausmüllähnlicher Gewerbeabfall' => %w(Abfall hausmüllähnlich Gewerbe)
|
86
|
+
)
|
87
|
+
|
88
|
+
label = Iqvoc::XLLabel.base_class.find_by(value: 'Hausmüllähnlicher Gewerbeabfall')
|
89
|
+
visit label_path(label, lang: 'en', format: 'html')
|
90
|
+
|
91
|
+
assert page.has_content? 'Hausmüllähnlicher Gewerbeabfall'
|
92
|
+
|
93
|
+
within('#compound_forms') do |ref|
|
94
|
+
assert page.has_content? 'Compound from'
|
95
|
+
assert page.has_content? 'Abfall, hausmüllähnlich, Gewerbe'
|
96
|
+
end
|
97
|
+
|
98
|
+
click_link_or_button 'Create new version'
|
99
|
+
assert page.has_content? 'Instance copy has been created and locked.'
|
100
|
+
|
101
|
+
# clear compound forms completely
|
102
|
+
fill_in 'label_inline_compound_form_origins_', with: ''
|
103
|
+
|
104
|
+
# save changes
|
105
|
+
click_link_or_button 'Save'
|
106
|
+
|
107
|
+
assert page.has_content? 'Label has been successfully modified.'
|
108
|
+
|
109
|
+
within('#compound_forms') do |ref|
|
110
|
+
assert page.has_content? 'Compound from'
|
111
|
+
refute page.has_content? 'Abfall, hausmüllähnlich, Gewerbe'
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2011-2016 innoQ Deutschland GmbH
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
require File.expand_path('test_helper', File.dirname(__FILE__))
|
17
|
+
require 'capybara/rails'
|
18
|
+
require 'capybara/dsl'
|
19
|
+
require 'capybara/poltergeist'
|
20
|
+
require Iqvoc.root.join('test', 'authentication')
|
21
|
+
|
22
|
+
Capybara.javascript_driver = :poltergeist
|
23
|
+
|
24
|
+
module ActionDispatch
|
25
|
+
class IntegrationTest
|
26
|
+
include Capybara::DSL
|
27
|
+
include Authentication
|
28
|
+
end
|
29
|
+
end
|
@@ -25,20 +25,7 @@ class CompoundFormTest < ActiveSupport::TestCase
|
|
25
25
|
end
|
26
26
|
|
27
27
|
test "instance creation" do
|
28
|
-
@compounds
|
29
|
-
label = Iqvoc::XLLabel.base_class.create!(:value => term,
|
30
|
-
"origin" => Iqvoc::Origin.new(term).to_s,
|
31
|
-
"language" => Iqvoc::Concept.pref_labeling_languages.first,
|
32
|
-
"published_at" => 2.days.ago)
|
33
|
-
label.compound_forms.create!(:compound_form_contents => components.
|
34
|
-
each_with_index.map { |cterm, i|
|
35
|
-
clabel = Iqvoc::XLLabel.base_class.create!(:value => cterm,
|
36
|
-
"origin" => Iqvoc::Origin.new(cterm).to_s,
|
37
|
-
"language" => Iqvoc::Concept.pref_labeling_languages.first,
|
38
|
-
"published_at" => 2.days.ago)
|
39
|
-
CompoundForm::Content::Base.new(:label => clabel, :order => i)
|
40
|
-
})
|
41
|
-
end
|
28
|
+
create_compound_form_label(@compounds)
|
42
29
|
|
43
30
|
assert_equal 4, Label::Base.count
|
44
31
|
assert_equal 1, CompoundForm::Base.count
|
@@ -62,7 +49,6 @@ class CompoundFormTest < ActiveSupport::TestCase
|
|
62
49
|
}.flatten
|
63
50
|
labels = terms.map { |term|
|
64
51
|
Iqvoc::XLLabel.base_class.create!(:value => term,
|
65
|
-
"origin" => Iqvoc::Origin.new(term).to_s,
|
66
52
|
"language" => Iqvoc::Concept.pref_labeling_languages.first,
|
67
53
|
"published_at" => 2.days.ago)
|
68
54
|
}
|
data/test/models/import_test.rb
CHANGED
@@ -15,13 +15,12 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
17
|
require File.expand_path('../../test_helper', __FILE__)
|
18
|
-
require 'iqvoc/skos_importer'
|
19
18
|
|
20
19
|
class SkosImporterTest < ActiveSupport::TestCase
|
21
20
|
|
22
21
|
test 'compound forms import' do
|
23
22
|
test_data = File.open(File.expand_path('../../fixtures/hobbies.nt', __FILE__))
|
24
|
-
@importer =
|
23
|
+
@importer = SkosImporter.new(test_data, 'http://hobbies.com/')
|
25
24
|
|
26
25
|
assert_equal 0, CompoundForm::Base.count
|
27
26
|
assert_equal 0, CompoundForm::Content::Base.count
|
@@ -61,7 +60,7 @@ class SkosImporterTest < ActiveSupport::TestCase
|
|
61
60
|
DATA
|
62
61
|
).split("\n")
|
63
62
|
|
64
|
-
@importer =
|
63
|
+
@importer = SkosImporter.new(test_data, 'http://hobbies.com/')
|
65
64
|
assert_equal 0, CompoundForm::Base.count
|
66
65
|
assert_equal 0, CompoundForm::Content::Base.count
|
67
66
|
|
data/test/test_helper.rb
CHANGED
@@ -1,3 +1,22 @@
|
|
1
1
|
ENV["RAILS_ENV"] = "test"
|
2
2
|
require File.expand_path('../../config/environment', __FILE__)
|
3
3
|
require 'rails/test_help'
|
4
|
+
|
5
|
+
# compound_label_hash = {
|
6
|
+
# "Weltraumkampfpilot" => %w(Weltraum Kampf Pilot)
|
7
|
+
# }
|
8
|
+
def create_compound_form_label(compound_label_hash)
|
9
|
+
compound_label_hash.each do |term, components|
|
10
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
11
|
+
value: term,
|
12
|
+
language: Iqvoc::Concept.pref_labeling_languages.first,
|
13
|
+
published_at: 2.days.ago)
|
14
|
+
|
15
|
+
label.compound_forms.create!(compound_form_contents: components.each_with_index.map { |cterm, i|
|
16
|
+
clabel = Iqvoc::XLLabel.base_class.create!(value: cterm,
|
17
|
+
language: Iqvoc::Concept.pref_labeling_languages.first,
|
18
|
+
published_at: 2.days.ago)
|
19
|
+
CompoundForm::Content::Base.new(:label => clabel, :order => i)
|
20
|
+
})
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iqvoc_compound_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Glaser
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: iqvoc
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 4.5.0
|
22
22
|
- - "~>"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '4.
|
24
|
+
version: '4.10'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -31,21 +31,21 @@ dependencies:
|
|
31
31
|
version: 4.5.0
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '4.
|
34
|
+
version: '4.10'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: iqvoc_skosxl
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 2.
|
41
|
+
version: 2.8.0
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 2.
|
48
|
+
version: 2.8.0
|
49
49
|
description: ''
|
50
50
|
email:
|
51
51
|
- robert.glaser@innoq.com
|
@@ -64,13 +64,13 @@ files:
|
|
64
64
|
- app/assets/javascripts/manifest.js
|
65
65
|
- app/models/compound_form/base.rb
|
66
66
|
- app/models/compound_form/content/base.rb
|
67
|
+
- app/models/concerns/compound_forms_label_extensions.rb
|
67
68
|
- app/views/partials/compound_form/_base.html.erb
|
68
69
|
- app/views/partials/compound_form/_compound_form.html.erb
|
69
70
|
- app/views/partials/compound_form/_edit_base.html.erb
|
70
71
|
- app/views/partials/compound_form/content/_base.html.erb
|
71
72
|
- bin/rails
|
72
73
|
- bin/rake
|
73
|
-
- bin/spring
|
74
74
|
- config.ru
|
75
75
|
- config/application.rb
|
76
76
|
- config/boot.rb
|
@@ -92,15 +92,17 @@ files:
|
|
92
92
|
- config/routes.rb
|
93
93
|
- config/secrets.yml
|
94
94
|
- db/migrate/20120112100000_create_compound_forms.rb
|
95
|
+
- db/migrate/20150108153131_add_fk_constraints_iqvoc_compound_forms.rb
|
95
96
|
- db/seeds.rb
|
96
97
|
- iqvoc_compound_forms.gemspec
|
97
98
|
- lib/engine_tasks/db.rake
|
98
|
-
- lib/iqvoc/compound_forms/label_extensions.rb
|
99
99
|
- lib/iqvoc/compound_forms/version.rb
|
100
100
|
- lib/iqvoc_compound_forms.rb
|
101
101
|
- public/.gitkeep
|
102
102
|
- script/rails
|
103
103
|
- test/fixtures/hobbies.nt
|
104
|
+
- test/integration/compound_form_ui_test.rb
|
105
|
+
- test/integration_test_helper.rb
|
104
106
|
- test/models/compound_form_test.rb
|
105
107
|
- test/models/import_test.rb
|
106
108
|
- test/test_helper.rb
|
@@ -123,12 +125,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
125
|
version: '0'
|
124
126
|
requirements: []
|
125
127
|
rubyforge_project: iqvoc_compound_forms
|
126
|
-
rubygems_version: 2.4.
|
128
|
+
rubygems_version: 2.4.5.1
|
127
129
|
signing_key:
|
128
130
|
specification_version: 4
|
129
131
|
summary: ''
|
130
132
|
test_files:
|
131
133
|
- test/fixtures/hobbies.nt
|
134
|
+
- test/integration/compound_form_ui_test.rb
|
135
|
+
- test/integration_test_helper.rb
|
132
136
|
- test/models/compound_form_test.rb
|
133
137
|
- test/models/import_test.rb
|
134
138
|
- test/test_helper.rb
|
data/bin/spring
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# This file loads spring without using Bundler, in order to be fast
|
4
|
-
# It gets overwritten when you run the `spring binstub` command
|
5
|
-
|
6
|
-
unless defined?(Spring)
|
7
|
-
require "rubygems"
|
8
|
-
require "bundler"
|
9
|
-
|
10
|
-
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
|
11
|
-
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
12
|
-
ENV["GEM_HOME"] = ""
|
13
|
-
Gem.paths = ENV
|
14
|
-
|
15
|
-
gem "spring", match[1]
|
16
|
-
require "spring/binstub"
|
17
|
-
end
|
18
|
-
end
|