elibri_onix_dict 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. data/.document +5 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +33 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.rdoc +26 -0
  6. data/Rakefile +55 -0
  7. data/lib/elibri_onix_dict.rb +37 -0
  8. data/lib/elibri_onix_dict/onix_3_0/base.rb +43 -0
  9. data/lib/elibri_onix_dict/onix_3_0/serialized/AudienceRangePrecision.yml +15 -0
  10. data/lib/elibri_onix_dict/onix_3_0/serialized/AudienceRangeQualifier.yml +9 -0
  11. data/lib/elibri_onix_dict/onix_3_0/serialized/Availability.yml +15 -0
  12. data/lib/elibri_onix_dict/onix_3_0/serialized/ContributorRole.yml +92 -0
  13. data/lib/elibri_onix_dict/onix_3_0/serialized/DateFormat.yml +20 -0
  14. data/lib/elibri_onix_dict/onix_3_0/serialized/LanguageCode.yml +272 -0
  15. data/lib/elibri_onix_dict/onix_3_0/serialized/LanguageRole.yml +36 -0
  16. data/lib/elibri_onix_dict/onix_3_0/serialized/NotificationType.yml +20 -0
  17. data/lib/elibri_onix_dict/onix_3_0/serialized/OtherTextType.yml +30 -0
  18. data/lib/elibri_onix_dict/onix_3_0/serialized/PricePrintedOnProduct.yml +16 -0
  19. data/lib/elibri_onix_dict/onix_3_0/serialized/PriceTypeCode.yml +15 -0
  20. data/lib/elibri_onix_dict/onix_3_0/serialized/ProductAvailabilityType.yml +15 -0
  21. data/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml +78 -0
  22. data/lib/elibri_onix_dict/onix_3_0/serialized/ProductRelationType.yml +17 -0
  23. data/lib/elibri_onix_dict/onix_3_0/serialized/PublishingStatusCode.yml +43 -0
  24. data/lib/elibri_onix_dict/onix_3_0/serialized/ResourceContentType.yml +51 -0
  25. data/lib/elibri_onix_dict/onix_3_0/serialized/ResourceMode.yml +20 -0
  26. data/lib/elibri_onix_dict/onix_3_0/serialized/SalesRestrictionType.yml +9 -0
  27. data/lib/elibri_onix_dict/onix_3_0/serialized/SupplierRole.yml +26 -0
  28. data/lib/elibri_onix_dict/onix_3_0/serialized/TitleType.yml +20 -0
  29. data/lib/elibri_onix_dict/releases.rb +6 -0
  30. data/lib/elibri_onix_dict/version.rb +14 -0
  31. data/test/elibri_onix_dict_release_3_0_test.rb +20 -0
  32. data/test/elibri_onix_dict_test.rb +10 -0
  33. data/test/helper.rb +19 -0
  34. metadata +173 -0
@@ -0,0 +1,20 @@
1
+ require 'helper'
2
+
3
+
4
+
5
+ describe Elibri::ONIX::Dict::Release_3_0 do
6
+
7
+ it "should be able to build classes on the fly from .yml files" do
8
+ assert_equal 11, Elibri::ONIX::Dict::Release_3_0::ProductFormCode::ALL.size
9
+ assert_equal 9, Elibri::ONIX::Dict::Release_3_0::ProductFormCode.all_except('BA', 'EA').size
10
+ assert_equal 9, Elibri::ONIX::Dict::Release_3_0::ProductFormCode.all_except(['BA', 'EA']).size
11
+ assert_equal 'BA', Elibri::ONIX::Dict::Release_3_0::ProductFormCode::BOOK
12
+
13
+ form = Elibri::ONIX::Dict::Release_3_0::ProductFormCode.find_by_onix_code('BA')
14
+ assert_equal 'książka', form.name
15
+ assert_equal 'book', form.name(:en)
16
+ assert_equal 'BA', form.onix_code
17
+ end
18
+
19
+
20
+ end
@@ -0,0 +1,10 @@
1
+ require 'helper'
2
+
3
+
4
+ describe Elibri::ONIX::Dict do
5
+
6
+ it "should be able to establish its version" do
7
+ assert_match /\d+\.\d+\.\d+/, Elibri::ONIX::Dict::Version::STRING
8
+ end
9
+
10
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'minitest/autorun'
12
+ require 'pry'
13
+
14
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
16
+ require 'elibri_onix_dict'
17
+
18
+ class Test::Unit::TestCase
19
+ end
metadata ADDED
@@ -0,0 +1,173 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: elibri_onix_dict
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Marcin Urbanski
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-10-27 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :development
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ name: pry
33
+ version_requirements: *id001
34
+ prerelease: false
35
+ - !ruby/object:Gem::Dependency
36
+ type: :development
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ name: minitest
47
+ version_requirements: *id002
48
+ prerelease: false
49
+ - !ruby/object:Gem::Dependency
50
+ type: :development
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 23
57
+ segments:
58
+ - 1
59
+ - 0
60
+ - 0
61
+ version: 1.0.0
62
+ name: bundler
63
+ version_requirements: *id003
64
+ prerelease: false
65
+ - !ruby/object:Gem::Dependency
66
+ type: :development
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ hash: 11
73
+ segments:
74
+ - 1
75
+ - 6
76
+ - 2
77
+ version: 1.6.2
78
+ name: jeweler
79
+ version_requirements: *id004
80
+ prerelease: false
81
+ - !ruby/object:Gem::Dependency
82
+ type: :development
83
+ requirement: &id005 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ name: rcov
93
+ version_requirements: *id005
94
+ prerelease: false
95
+ description: EDItEUR ONIX format dictionary helpers used in eLibri publication system
96
+ email: marcin@urbanski.vdl.pl
97
+ executables: []
98
+
99
+ extensions: []
100
+
101
+ extra_rdoc_files:
102
+ - LICENSE.txt
103
+ - README.rdoc
104
+ files:
105
+ - .document
106
+ - Gemfile
107
+ - Gemfile.lock
108
+ - LICENSE.txt
109
+ - README.rdoc
110
+ - Rakefile
111
+ - lib/elibri_onix_dict.rb
112
+ - lib/elibri_onix_dict/onix_3_0/base.rb
113
+ - lib/elibri_onix_dict/onix_3_0/serialized/AudienceRangePrecision.yml
114
+ - lib/elibri_onix_dict/onix_3_0/serialized/AudienceRangeQualifier.yml
115
+ - lib/elibri_onix_dict/onix_3_0/serialized/Availability.yml
116
+ - lib/elibri_onix_dict/onix_3_0/serialized/ContributorRole.yml
117
+ - lib/elibri_onix_dict/onix_3_0/serialized/DateFormat.yml
118
+ - lib/elibri_onix_dict/onix_3_0/serialized/LanguageCode.yml
119
+ - lib/elibri_onix_dict/onix_3_0/serialized/LanguageRole.yml
120
+ - lib/elibri_onix_dict/onix_3_0/serialized/NotificationType.yml
121
+ - lib/elibri_onix_dict/onix_3_0/serialized/OtherTextType.yml
122
+ - lib/elibri_onix_dict/onix_3_0/serialized/PricePrintedOnProduct.yml
123
+ - lib/elibri_onix_dict/onix_3_0/serialized/PriceTypeCode.yml
124
+ - lib/elibri_onix_dict/onix_3_0/serialized/ProductAvailabilityType.yml
125
+ - lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml
126
+ - lib/elibri_onix_dict/onix_3_0/serialized/ProductRelationType.yml
127
+ - lib/elibri_onix_dict/onix_3_0/serialized/PublishingStatusCode.yml
128
+ - lib/elibri_onix_dict/onix_3_0/serialized/ResourceContentType.yml
129
+ - lib/elibri_onix_dict/onix_3_0/serialized/ResourceMode.yml
130
+ - lib/elibri_onix_dict/onix_3_0/serialized/SalesRestrictionType.yml
131
+ - lib/elibri_onix_dict/onix_3_0/serialized/SupplierRole.yml
132
+ - lib/elibri_onix_dict/onix_3_0/serialized/TitleType.yml
133
+ - lib/elibri_onix_dict/releases.rb
134
+ - lib/elibri_onix_dict/version.rb
135
+ - test/elibri_onix_dict_release_3_0_test.rb
136
+ - test/elibri_onix_dict_test.rb
137
+ - test/helper.rb
138
+ has_rdoc: true
139
+ homepage: http://github.com/elibri/elibri_onix_dict
140
+ licenses:
141
+ - MIT
142
+ post_install_message:
143
+ rdoc_options: []
144
+
145
+ require_paths:
146
+ - lib
147
+ required_ruby_version: !ruby/object:Gem::Requirement
148
+ none: false
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ hash: 3
153
+ segments:
154
+ - 0
155
+ version: "0"
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ hash: 3
162
+ segments:
163
+ - 0
164
+ version: "0"
165
+ requirements: []
166
+
167
+ rubyforge_project:
168
+ rubygems_version: 1.6.2
169
+ signing_key:
170
+ specification_version: 3
171
+ summary: EDItEUR ONIX format dictionary helpers used in eLibri publication system
172
+ test_files: []
173
+