iqvoc_inflectionals 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -4
- data/Gemfile.lock +39 -37
- data/app/views/partials/inflectional/_base.html.erb +1 -5
- data/config/initializers/origin_filters.rb +3 -0
- data/lib/iqvoc/inflectionals/base_form_sanitizer.rb +13 -0
- data/lib/iqvoc/inflectionals/label_extensions.rb +2 -2
- data/lib/iqvoc/inflectionals/version.rb +1 -1
- data/test/unit/inflectional_test.rb +6 -2
- metadata +10 -8
data/Gemfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails',
|
4
|
-
gem 'iqvoc',
|
5
|
-
gem 'iqvoc_skosxl', '~> 1.2.0'
|
3
|
+
gem 'rails', '~> 3.2.1'
|
4
|
+
gem 'iqvoc', '~> 3.5.1'#, :path => '../iqvoc'
|
5
|
+
gem 'iqvoc_skosxl', '~> 1.2.0'#, :path => '../iqvoc_skosxl'
|
6
6
|
|
7
7
|
group :development, :test do
|
8
8
|
gem 'sqlite3'
|
@@ -10,6 +10,6 @@ end
|
|
10
10
|
|
11
11
|
group :test do
|
12
12
|
gem 'test-unit'
|
13
|
-
gem 'spork'
|
13
|
+
gem 'spork'
|
14
14
|
gem 'spork-testunit'
|
15
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (3.2.
|
5
|
-
actionpack (= 3.2.
|
4
|
+
actionmailer (3.2.2)
|
5
|
+
actionpack (= 3.2.2)
|
6
6
|
mail (~> 2.4.0)
|
7
|
-
actionpack (3.2.
|
8
|
-
activemodel (= 3.2.
|
9
|
-
activesupport (= 3.2.
|
7
|
+
actionpack (3.2.2)
|
8
|
+
activemodel (= 3.2.2)
|
9
|
+
activesupport (= 3.2.2)
|
10
10
|
builder (~> 3.0.0)
|
11
11
|
erubis (~> 2.7.0)
|
12
12
|
journey (~> 1.0.1)
|
@@ -14,77 +14,79 @@ GEM
|
|
14
14
|
rack-cache (~> 1.1)
|
15
15
|
rack-test (~> 0.6.1)
|
16
16
|
sprockets (~> 2.1.2)
|
17
|
-
activemodel (3.2.
|
18
|
-
activesupport (= 3.2.
|
17
|
+
activemodel (3.2.2)
|
18
|
+
activesupport (= 3.2.2)
|
19
19
|
builder (~> 3.0.0)
|
20
|
-
activerecord (3.2.
|
21
|
-
activemodel (= 3.2.
|
22
|
-
activesupport (= 3.2.
|
23
|
-
arel (~> 3.0.
|
20
|
+
activerecord (3.2.2)
|
21
|
+
activemodel (= 3.2.2)
|
22
|
+
activesupport (= 3.2.2)
|
23
|
+
arel (~> 3.0.2)
|
24
24
|
tzinfo (~> 0.3.29)
|
25
|
-
activeresource (3.2.
|
26
|
-
activemodel (= 3.2.
|
27
|
-
activesupport (= 3.2.
|
28
|
-
activesupport (3.2.
|
25
|
+
activeresource (3.2.2)
|
26
|
+
activemodel (= 3.2.2)
|
27
|
+
activesupport (= 3.2.2)
|
28
|
+
activesupport (3.2.2)
|
29
29
|
i18n (~> 0.6)
|
30
30
|
multi_json (~> 1.0)
|
31
|
-
arel (3.0.
|
31
|
+
arel (3.0.2)
|
32
32
|
authlogic (3.1.0)
|
33
33
|
activerecord (>= 3.0.7)
|
34
34
|
activerecord (>= 3.0.7)
|
35
35
|
builder (3.0.0)
|
36
36
|
cancan (1.6.7)
|
37
37
|
erubis (2.7.0)
|
38
|
+
fastercsv (1.5.4)
|
38
39
|
hike (1.2.1)
|
39
40
|
i18n (0.6.0)
|
40
|
-
iq_rdf (0.1.
|
41
|
+
iq_rdf (0.1.5)
|
41
42
|
builder
|
42
43
|
bundler
|
43
|
-
iqvoc (3.5.
|
44
|
+
iqvoc (3.5.6)
|
44
45
|
authlogic
|
45
46
|
bundler
|
46
47
|
cancan
|
48
|
+
fastercsv
|
47
49
|
iq_rdf (~> 0.1.2)
|
48
50
|
json
|
49
51
|
kaminari
|
50
52
|
rails (~> 3.2.1)
|
51
53
|
rails_autolink
|
52
|
-
iqvoc_skosxl (1.2.
|
54
|
+
iqvoc_skosxl (1.2.3)
|
53
55
|
bundler
|
54
56
|
iqvoc (~> 3.5.1)
|
55
|
-
journey (1.0.
|
57
|
+
journey (1.0.3)
|
56
58
|
json (1.6.5)
|
57
59
|
kaminari (0.13.0)
|
58
60
|
actionpack (>= 3.0.0)
|
59
61
|
activesupport (>= 3.0.0)
|
60
62
|
railties (>= 3.0.0)
|
61
|
-
mail (2.4.
|
63
|
+
mail (2.4.3)
|
62
64
|
i18n (>= 0.4.0)
|
63
65
|
mime-types (~> 1.16)
|
64
66
|
treetop (~> 1.4.8)
|
65
67
|
mime-types (1.17.2)
|
66
|
-
multi_json (1.0
|
68
|
+
multi_json (1.1.0)
|
67
69
|
polyglot (0.3.3)
|
68
70
|
rack (1.4.1)
|
69
|
-
rack-cache (1.
|
71
|
+
rack-cache (1.2)
|
70
72
|
rack (>= 0.4)
|
71
73
|
rack-ssl (1.3.2)
|
72
74
|
rack
|
73
75
|
rack-test (0.6.1)
|
74
76
|
rack (>= 1.0)
|
75
|
-
rails (3.2.
|
76
|
-
actionmailer (= 3.2.
|
77
|
-
actionpack (= 3.2.
|
78
|
-
activerecord (= 3.2.
|
79
|
-
activeresource (= 3.2.
|
80
|
-
activesupport (= 3.2.
|
77
|
+
rails (3.2.2)
|
78
|
+
actionmailer (= 3.2.2)
|
79
|
+
actionpack (= 3.2.2)
|
80
|
+
activerecord (= 3.2.2)
|
81
|
+
activeresource (= 3.2.2)
|
82
|
+
activesupport (= 3.2.2)
|
81
83
|
bundler (~> 1.0)
|
82
|
-
railties (= 3.2.
|
84
|
+
railties (= 3.2.2)
|
83
85
|
rails_autolink (1.0.5)
|
84
86
|
rails (~> 3.1)
|
85
|
-
railties (3.2.
|
86
|
-
actionpack (= 3.2.
|
87
|
-
activesupport (= 3.2.
|
87
|
+
railties (3.2.2)
|
88
|
+
actionpack (= 3.2.2)
|
89
|
+
activesupport (= 3.2.2)
|
88
90
|
rack-ssl (~> 1.3.2)
|
89
91
|
rake (>= 0.8.7)
|
90
92
|
rdoc (~> 3.4)
|
@@ -93,20 +95,20 @@ GEM
|
|
93
95
|
rdoc (3.12)
|
94
96
|
json (~> 1.4)
|
95
97
|
spork (0.9.0)
|
96
|
-
spork-testunit (0.0.
|
98
|
+
spork-testunit (0.0.8)
|
97
99
|
spork (>= 0.6.0)
|
98
100
|
sprockets (2.1.2)
|
99
101
|
hike (~> 1.2)
|
100
102
|
rack (~> 1.0)
|
101
103
|
tilt (~> 1.1, != 1.3.0)
|
102
104
|
sqlite3 (1.3.5)
|
103
|
-
test-unit (2.4.
|
105
|
+
test-unit (2.4.8)
|
104
106
|
thor (0.14.6)
|
105
107
|
tilt (1.3.3)
|
106
108
|
treetop (1.4.10)
|
107
109
|
polyglot
|
108
110
|
polyglot (>= 0.3.1)
|
109
|
-
tzinfo (0.3.
|
111
|
+
tzinfo (0.3.32)
|
110
112
|
|
111
113
|
PLATFORMS
|
112
114
|
ruby
|
@@ -115,7 +117,7 @@ DEPENDENCIES
|
|
115
117
|
iqvoc (~> 3.5.1)
|
116
118
|
iqvoc_skosxl (~> 1.2.0)
|
117
119
|
rails (~> 3.2.1)
|
118
|
-
spork
|
120
|
+
spork
|
119
121
|
spork-testunit
|
120
122
|
sqlite3
|
121
123
|
test-unit
|
@@ -11,11 +11,7 @@
|
|
11
11
|
<p><%= t("txt.views.labels.inflectionals_used_in") %></p>
|
12
12
|
<ul>
|
13
13
|
<% inflectionals_labels.each do |inf| %>
|
14
|
-
|
15
|
-
<li><%= link_to inf.value, label_path(:id => inf) %></li>
|
16
|
-
<% else %>
|
17
|
-
<li><%= link_to inf.value, versioned_label_path(:id => inf) %></li>
|
18
|
-
<% end %>
|
14
|
+
<li><%= link_to inf.value, label_path(:published => inf.published? ? nil : 0, :id => inf) %></li>
|
19
15
|
<% end %>
|
20
16
|
</ul>
|
21
17
|
<% end %>
|
@@ -31,9 +31,9 @@ module Iqvoc
|
|
31
31
|
def generate_inflectionals!
|
32
32
|
return send(Inflectional::Base.name.to_relation_name) if base_form.blank?
|
33
33
|
|
34
|
-
converted_literal_form =
|
34
|
+
converted_literal_form = Iqvoc::Origin.new(value).replace_umlauts.to_s
|
35
35
|
|
36
|
-
diff =
|
36
|
+
diff = Iqvoc::Origin.new(converted_literal_form).sanitize_base_form.to_s.size - base_form.size
|
37
37
|
|
38
38
|
unless base_form.blank?
|
39
39
|
new_base_form = converted_literal_form[0..(base_form.length-1)]
|
@@ -10,7 +10,7 @@ class InflectionalTest < ActiveSupport::TestCase
|
|
10
10
|
|
11
11
|
test "instance creation" do
|
12
12
|
label = Label::SKOSXL::Base.create!(:value => "foo",
|
13
|
-
:origin =>
|
13
|
+
:origin => Iqvoc::Origin.new("foo").to_s)
|
14
14
|
label.inflectionals.create!(:value => "bar")
|
15
15
|
|
16
16
|
assert_equal 2, Inflectional::Base.count
|
@@ -20,7 +20,7 @@ class InflectionalTest < ActiveSupport::TestCase
|
|
20
20
|
test "hashing of values within the label callback" do
|
21
21
|
@words.each do |word|
|
22
22
|
Label::SKOSXL::Base.create!(:value => word,
|
23
|
-
:origin =>
|
23
|
+
:origin => Iqvoc::Origin.new(word).to_s)
|
24
24
|
end
|
25
25
|
|
26
26
|
assert_equal @words.count, Inflectional::Base.count
|
@@ -30,4 +30,8 @@ class InflectionalTest < ActiveSupport::TestCase
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
test "base form sanitizer extension for origin generator" do
|
34
|
+
assert_equal "commaslashdotbracketbracket", Iqvoc::Origin.new("comma,slash/dot.bracket[bracket]").sanitize_base_form.to_s
|
35
|
+
end
|
36
|
+
|
33
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iqvoc_inflectionals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-03-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
|
-
requirement: &
|
18
|
+
requirement: &70116973005100 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 3.2.1
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70116973005100
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: iqvoc
|
29
|
-
requirement: &
|
29
|
+
requirement: &70116973003740 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 3.5.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70116973003740
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: iqvoc_skosxl
|
40
|
-
requirement: &
|
40
|
+
requirement: &70116973003060 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: 1.2.0
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70116973003060
|
49
49
|
description: ''
|
50
50
|
email:
|
51
51
|
- robert.glaser@innoq.com
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- config/environments/test.rb
|
74
74
|
- config/initializers/iqvoc.rb
|
75
75
|
- config/initializers/label_extensions.rb
|
76
|
+
- config/initializers/origin_filters.rb
|
76
77
|
- config/initializers/secret_token.rb.template
|
77
78
|
- config/initializers/session_store.rb
|
78
79
|
- config/locales/activerecord.de.yml
|
@@ -83,6 +84,7 @@ files:
|
|
83
84
|
- db/seeds.rb
|
84
85
|
- iqvoc_inflectionals.gemspec
|
85
86
|
- lib/engine_tasks/db.rake
|
87
|
+
- lib/iqvoc/inflectionals/base_form_sanitizer.rb
|
86
88
|
- lib/iqvoc/inflectionals/label_extensions.rb
|
87
89
|
- lib/iqvoc/inflectionals/version.rb
|
88
90
|
- lib/iqvoc_inflectionals.rb
|