iqvoc_inflectionals 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +14 -0
  3. data/Gemfile.lock +122 -0
  4. data/README.md +13 -0
  5. data/Rakefile +11 -0
  6. data/app/models/inflectional/base.rb +345 -0
  7. data/app/models/inflectional/label_extension.rb +58 -0
  8. data/app/views/partials/inflectional/_base.html.erb +22 -0
  9. data/app/views/partials/inflectional/_edit_base.html.erb +7 -0
  10. data/app/views/partials/inflectional/_search_result.html.erb +13 -0
  11. data/config/application.rb +56 -0
  12. data/config/boot.rb +13 -0
  13. data/config/database.template.yml +30 -0
  14. data/config/engine.rb +13 -0
  15. data/config/environment.rb +5 -0
  16. data/config/environments/development.rb +55 -0
  17. data/config/environments/production.rb +64 -0
  18. data/config/environments/test.rb +46 -0
  19. data/config/initializers/engine_extensions.rb +6 -0
  20. data/config/initializers/iqvoc.rb +11 -0
  21. data/config/initializers/secret_token.rb.template +16 -0
  22. data/config/initializers/session_store.rb +11 -0
  23. data/config/locales/activerecord.de.yml +6 -0
  24. data/config/locales/activerecord.en.yml +6 -0
  25. data/config/routes.rb +2 -0
  26. data/config.ru +4 -0
  27. data/db/migrate/20120109143704_create_inflectionals.rb +25 -0
  28. data/db/schema.rb +158 -0
  29. data/db/seeds.rb +0 -0
  30. data/iqvoc_inflectionals.gemspec +26 -0
  31. data/lib/engine_tasks/db.rake +19 -0
  32. data/lib/iqvoc/inflectionals/label_extensions.rb +23 -0
  33. data/lib/iqvoc/inflectionals/version.rb +5 -0
  34. data/lib/iqvoc_inflectionals.rb +15 -0
  35. data/public/.gitkeep +0 -0
  36. data/script/rails +6 -0
  37. data/test/test_helper.rb +10 -0
  38. data/test/unit/inflectional_test.rb +33 -0
  39. metadata +120 -0
@@ -0,0 +1,10 @@
1
+ require 'spork'
2
+
3
+ Spork.prefork do
4
+ ENV["RAILS_ENV"] = "test"
5
+ require File.expand_path('../../config/environment', __FILE__)
6
+ require 'rails/test_help'
7
+ end
8
+
9
+ Spork.each_run do
10
+ end
@@ -0,0 +1,33 @@
1
+ # encoding: UTF-8
2
+
3
+ require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')
4
+
5
+ class InflectionalTest < ActiveSupport::TestCase
6
+
7
+ setup do
8
+ @words = %w(Lorem ipsum dolor sit amet consectetur adipisicing elit sed do)
9
+ end
10
+
11
+ test "instance creation" do
12
+ label = Label::SKOSXL::Base.create!(:value => "foo",
13
+ :origin => OriginMapping.merge("foo"))
14
+ label.inflectionals.create!(:value => "bar")
15
+
16
+ assert_equal 2, Inflectional::Base.count
17
+ assert_equal ["foo", "bar"], Inflectional::Base.all.map(&:value)
18
+ end
19
+
20
+ test "hashing of values within the label callback" do
21
+ @words.each do |word|
22
+ Label::SKOSXL::Base.create!(:value => word,
23
+ :origin => OriginMapping.merge(word))
24
+ end
25
+
26
+ assert_equal @words.count, Inflectional::Base.count
27
+ Inflectional::Base.all.each do |inflectional|
28
+ normalized = Inflectional::Base.normalize(inflectional.value)
29
+ assert_equal normalized, inflectional.normal_hash
30
+ end
31
+ end
32
+
33
+ end
metadata ADDED
@@ -0,0 +1,120 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: iqvoc_inflectionals
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Robert Glaser
9
+ - Till Schulte-Coerne
10
+ - Frederik Dohr
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2012-01-16 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rails
18
+ requirement: &70113691097300 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 3.1.3
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *70113691097300
27
+ - !ruby/object:Gem::Dependency
28
+ name: iqvoc
29
+ requirement: &70113691096880 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *70113691096880
38
+ - !ruby/object:Gem::Dependency
39
+ name: iqvoc_skosxl
40
+ requirement: &70113691093340 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: *70113691093340
49
+ description: ''
50
+ email:
51
+ - robert.glaser@innoq.com
52
+ executables: []
53
+ extensions: []
54
+ extra_rdoc_files: []
55
+ files:
56
+ - .gitignore
57
+ - Gemfile
58
+ - Gemfile.lock
59
+ - README.md
60
+ - Rakefile
61
+ - app/models/inflectional/base.rb
62
+ - app/models/inflectional/label_extension.rb
63
+ - app/views/partials/inflectional/_base.html.erb
64
+ - app/views/partials/inflectional/_edit_base.html.erb
65
+ - app/views/partials/inflectional/_search_result.html.erb
66
+ - config.ru
67
+ - config/application.rb
68
+ - config/boot.rb
69
+ - config/database.template.yml
70
+ - config/engine.rb
71
+ - config/environment.rb
72
+ - config/environments/development.rb
73
+ - config/environments/production.rb
74
+ - config/environments/test.rb
75
+ - config/initializers/engine_extensions.rb
76
+ - config/initializers/iqvoc.rb
77
+ - config/initializers/secret_token.rb.template
78
+ - config/initializers/session_store.rb
79
+ - config/locales/activerecord.de.yml
80
+ - config/locales/activerecord.en.yml
81
+ - config/routes.rb
82
+ - db/migrate/20120109143704_create_inflectionals.rb
83
+ - db/schema.rb
84
+ - db/seeds.rb
85
+ - iqvoc_inflectionals.gemspec
86
+ - lib/engine_tasks/db.rake
87
+ - lib/iqvoc/inflectionals/label_extensions.rb
88
+ - lib/iqvoc/inflectionals/version.rb
89
+ - lib/iqvoc_inflectionals.rb
90
+ - public/.gitkeep
91
+ - script/rails
92
+ - test/test_helper.rb
93
+ - test/unit/inflectional_test.rb
94
+ homepage: ''
95
+ licenses: []
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ none: false
102
+ requirements:
103
+ - - ! '>='
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project: iqvoc_inflectionals
114
+ rubygems_version: 1.8.10
115
+ signing_key:
116
+ specification_version: 3
117
+ summary: ''
118
+ test_files:
119
+ - test/test_helper.rb
120
+ - test/unit/inflectional_test.rb