elibri_onix 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,9 +1,11 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (2.3.5)
5
- coderay (0.9.8)
6
- elibri_onix_dict (0.0.5)
4
+ activesupport (3.2.3)
5
+ i18n (~> 0.6)
6
+ multi_json (~> 1.0)
7
+ coderay (1.0.6)
8
+ elibri_onix_dict (0.0.13)
7
9
  git (1.2.5)
8
10
  i18n (0.6.0)
9
11
  jeweler (1.6.4)
@@ -11,26 +13,22 @@ GEM
11
13
  git (>= 1.2.5)
12
14
  rake
13
15
  metaclass (0.0.1)
14
- method_source (0.6.6)
15
- ruby_parser (~> 2.0.5)
16
- minitest (2.6.1)
17
- mocha (0.10.0)
16
+ method_source (0.7.1)
17
+ minitest (3.0.0)
18
+ mocha (0.11.4)
18
19
  metaclass (~> 0.0.1)
19
- nokogiri (1.5.0)
20
- pry (0.9.6.2)
21
- coderay (~> 0.9.8)
22
- method_source (~> 0.6.5)
23
- ruby_parser (~> 2.0.5)
24
- slop (~> 2.1.0)
25
- rake (0.9.2)
26
- rcov (0.9.11)
20
+ multi_json (1.3.4)
21
+ nokogiri (1.5.2)
22
+ pry (0.9.9.4)
23
+ coderay (~> 1.0.5)
24
+ method_source (~> 0.7.1)
25
+ slop (>= 2.4.4, < 3)
26
+ rake (0.9.2.2)
27
+ rcov (1.0.0)
27
28
  roxml (3.1.3)
28
29
  activesupport (>= 2.1.0)
29
30
  nokogiri (>= 1.3.3)
30
- ruby_parser (2.0.6)
31
- sexp_processor (~> 3.0)
32
- sexp_processor (3.0.7)
33
- slop (2.1.0)
31
+ slop (2.4.4)
34
32
 
35
33
  PLATFORMS
36
34
  ruby
data/elibri_onix.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{elibri_onix}
8
- s.version = "0.1.16"
8
+ s.version = "0.1.17"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcin Urbanski"]
12
- s.date = %q{2012-05-09}
12
+ s.date = %q{2012-05-10}
13
13
  s.description = %q{EDItEUR ONIX format subset implementation used in Elibri publication system}
14
14
  s.email = %q{marcin@urbanski.vdl.pl}
15
15
  s.extra_rdoc_files = [
@@ -8,6 +8,12 @@ module Elibri
8
8
  include Inspector
9
9
 
10
10
  xml_name 'AudienceRange'
11
+
12
+ ATTRIBUTES = [
13
+ :qualifier, :precision, :value
14
+ ]
15
+
16
+ RELATIONS = []
11
17
 
12
18
  xml_accessor :qualifier, :from => 'AudienceRangeQualifier'
13
19
  xml_accessor :precision, :from => 'AudienceRangePrecision'
@@ -8,6 +8,14 @@ module Elibri
8
8
  include Inspector
9
9
 
10
10
  xml_name 'Collection'
11
+
12
+ ATTRIBUTES = [
13
+ :type, :title_detail, :full_title, :type_name
14
+ ]
15
+
16
+ RELATIONS = [
17
+ :elements, :inspect_include_fields
18
+ ]
11
19
 
12
20
  xml_accessor :type, :from => 'CollectionType'
13
21
  xml_accessor :elements, :as => [TitleElement]
@@ -8,6 +8,17 @@ module Elibri
8
8
  include Inspector
9
9
  include ExternalId
10
10
  include ExternalTimestamp
11
+
12
+ ATTRIBUTES =
13
+ [
14
+ :number, :role, :person_name, :from_language, :titles_before_names, :names_before_key, :prefix_to_key,
15
+ :key_names, :names_after_key, :biographical_note, :unnamed_persons, :role_name
16
+ ]
17
+
18
+ RELATIONS =
19
+ [
20
+ :inspect_include_fields
21
+ ]
11
22
 
12
23
  xml_name 'Contributor'
13
24
 
@@ -12,6 +12,14 @@ module Elibri
12
12
  xml_accessor :type, :from => 'ExtentType'
13
13
  xml_accessor :value, :from => 'ExtentValue', :as => Fixnum
14
14
  xml_accessor :unit, :from => 'ExtentUnit'
15
+
16
+ ATTRIBUTES = [
17
+ :type, :value, :unit, :type_name, :unit_name
18
+ ]
19
+
20
+ RELATIONS = [
21
+ :inspect_include_fields
22
+ ]
15
23
 
16
24
  def id
17
25
  type.to_i
@@ -12,6 +12,13 @@ module Elibri
12
12
  xml_accessor :sent_date_time, :as => Date, :from => 'SentDateTime'
13
13
 
14
14
  xml_accessor :sender, :as => Sender
15
+
16
+ ATTRIBUTES = [
17
+ :sent_date_time, :sender
18
+ ]
19
+
20
+ RELATIONS = []
21
+
15
22
  end
16
23
 
17
24
  end
@@ -9,6 +9,12 @@ module Elibri
9
9
  include Inspector
10
10
 
11
11
  xml_name 'Imprint'
12
+
13
+ ATTRIBUTES = [
14
+ :name
15
+ ]
16
+
17
+ RELATIONS = []
12
18
 
13
19
  xml_accessor :name, :from => 'ImprintName'
14
20
 
@@ -11,6 +11,14 @@ module Elibri
11
11
 
12
12
  xml_accessor :role, :from => 'LanguageRole'
13
13
  xml_accessor :code, :from => 'LanguageCode'
14
+
15
+ ATTRIBUTES = [
16
+ :role, :code, :role_name, :language
17
+ ]
18
+
19
+ RELATIONS = [
20
+ :inspect_include_fields
21
+ ]
14
22
 
15
23
  def role_name
16
24
  Elibri::ONIX::Dict::Release_3_0::LanguageRole.find_by_onix_code(self.role).const_name.downcase
@@ -12,6 +12,14 @@ module Elibri
12
12
  xml_accessor :type, :from => 'MeasureType'
13
13
  xml_accessor :measurement, :from => 'Measurement', :as => Fixnum
14
14
  xml_accessor :unit, :from => 'MeasureUnitCode'
15
+
16
+ ATTRIBUTES = [
17
+ :type, :from, :measurement, :unit, :type_name
18
+ ]
19
+
20
+ RELATIONS = [
21
+ :inspect_include_fields
22
+ ]
15
23
 
16
24
  def type_name
17
25
  Elibri::ONIX::Dict::Release_3_0::MeasureType.find_by_onix_code(type).const_name.downcase
@@ -14,7 +14,13 @@ module Elibri
14
14
  xml_accessor :products, :as => [Product]
15
15
  xml_accessor :header, :as => Header
16
16
 
17
-
17
+ ATTRIBUTES = [
18
+ :release, :elibri_dialect, :header
19
+ ]
20
+
21
+ RELATIONS = [
22
+ :products
23
+ ]
18
24
 
19
25
  def self.from_xml(data, *initialization_args)
20
26
  xml = XML::Node.from(data)
@@ -11,6 +11,13 @@ module Elibri
11
11
  include Inspector
12
12
 
13
13
  xml_name 'Price'
14
+
15
+ ATTRIBUTES = [
16
+ :type, :minimum_order_quantity, :amount, :currency_code, :printed_on_product,
17
+ :position_on_product, :tax_type, :tax_rate_percent, :vat
18
+ ]
19
+
20
+ RELATIONS = []
14
21
 
15
22
  xml_accessor :type, :from => 'PriceType', :as => Fixnum
16
23
  xml_accessor :minimum_order_quantity, :from => 'MinimumOrderQuantity', :as => Fixnum
@@ -4,8 +4,38 @@ module Elibri
4
4
  module Release_3_0
5
5
 
6
6
  class Product
7
+
8
+
9
+ ATTRIBUTES =
10
+ [
11
+ :elibri_dialect, :height, :width, :thickness, :weight, :ean, :isbn13, :number_of_pages, :duration,
12
+ :file_size, :publisher_name, :publisher_id, :imprint_name, :current_state, :reading_age_from, :reading_age_to,
13
+ :table_of_contents, :description, :reviews, :excerpts, :series, :title, :subtitle, :collection_title,
14
+ :collection_part, :full_title, :original_title, :trade_title, :parsed_publishing_date, :record_reference,
15
+ :deletion_text, :cover_type, :cover_price, :vat, :pkwiu, :product_composition, :product_form, :imprint,
16
+ :publisher, :product_form, :no_contributor, :edition_statement, :number_of_illustrations, :publishing_status,
17
+ :publishing_date, :premiere, :front_cover, :series_names,
18
+ :elibri_product_category1_id, :elibri_product_category2_id, :preview_exists, :short_description
19
+ ]
20
+
21
+
22
+ RELATIONS =
23
+ [
24
+ :contributors, #IMPORTANT
25
+ :related_products, :languages, :measures, :supply_details, :measures, :title_details,
26
+ :collections, :extents, :subjects, :audience_ranges,
27
+ :text_contents, #IMPORTANT
28
+ :supporting_resources, #for example: cover
29
+ :sales_restrictions, :authors,
30
+ :ghostwriters, :scenarists, :originators, :illustrators, :photographers, :author_of_prefaces, :drawers,
31
+ :cover_designers, :inked_or_colored_bys, :editors, :revisors, :translators, :editor_in_chiefs, :read_bys
32
+ ]
33
+
34
+
7
35
  include ROXML
8
36
 
37
+
38
+
9
39
  attr_accessor :elibri_dialect, :height, :width, :thickness, :weight, :ean, :isbn13, :number_of_pages, :duration,
10
40
  :file_size, :publisher_name, :publisher_id, :imprint_name, :current_state, :reading_age_from, :reading_age_to,
11
41
  :table_of_contents, :description, :reviews, :excerpts, :series, :title, :subtitle, :collection_title,
@@ -153,7 +183,7 @@ module Elibri
153
183
  end
154
184
 
155
185
 
156
- private
186
+ private
157
187
 
158
188
  def find_title(code)
159
189
  title_details.find {|title_detail| title_detail.type == code}
@@ -11,6 +11,14 @@ module Elibri
11
11
  xml_accessor :type, :from => 'ProductIDType'
12
12
  xml_accessor :type_name, :from => 'IDTypeName'
13
13
  xml_accessor :value, :from => 'IDValue'
14
+
15
+ ATTRIBUTES = [
16
+ :type, :type_name, :value, :identifier_type
17
+ ]
18
+
19
+ RELATIONS = [
20
+ :inspect_include_fields
21
+ ]
14
22
 
15
23
  def identifier_type
16
24
  Elibri::ONIX::Dict::Release_3_0::ProductIDType.find_by_onix_code(type).const_name.downcase
@@ -10,6 +10,12 @@ module Elibri
10
10
  include Inspector
11
11
 
12
12
  xml_name 'Publisher'
13
+
14
+ ATTRIBUTES = [
15
+ :role, :name, :id
16
+ ]
17
+
18
+ RELATIONS = []
13
19
 
14
20
  #występuje w tej chwili tylko 01 - główny wydawca
15
21
  xml_accessor :role, :from => 'PublishingRole'
@@ -14,6 +14,12 @@ module Elibri
14
14
  xml_accessor :role, :from => 'PublishingDateRole'
15
15
  xml_accessor :format, :from => 'DateFormat'
16
16
  xml_accessor :date, :from => 'Date'
17
+
18
+ ATTRIBUTES = [
19
+ :role, :format, :date, :parsed
20
+ ]
21
+
22
+ RELATIONS = []
17
23
 
18
24
  def parsed
19
25
  case format
@@ -14,6 +14,15 @@ module Elibri
14
14
 
15
15
  xml_accessor :relation_code, :from => 'ProductRelationCode', :as => Fixnum
16
16
  xml_accessor :identifiers, :as => [ProductIdentifier]
17
+
18
+ ATTRIBUTES = [
19
+ :relation_code, :isbn13, :proprietary_identifiers
20
+ ]
21
+
22
+ RELATIONS = [
23
+ :identifiers
24
+ ]
25
+
17
26
 
18
27
 
19
28
  def isbn13
@@ -14,6 +14,12 @@ module Elibri
14
14
  xml_accessor :type, :from => 'SalesRestrictionType', :as => Fixnum
15
15
  xml_accessor :outlet_name, :from => 'SalesOutletName', :in => 'SalesOutlet'
16
16
  xml_accessor :end_date, :from => 'EndDate', :as => Date
17
+
18
+ ATTRIBUTES = [
19
+ :type, :outlet_name, :end_date
20
+ ]
21
+
22
+ RELATIONS = []
17
23
 
18
24
  end
19
25
 
@@ -12,6 +12,13 @@ module Elibri
12
12
  xml_accessor :sender_name, :from => 'SenderName'
13
13
  xml_accessor :contact_name, :from => 'ContactName'
14
14
  xml_accessor :email_address, :from => 'EmailAddress'
15
+
16
+ ATTRIBUTES = [
17
+ :sender_name, :contact_name, :email_address
18
+ ]
19
+
20
+ RELATIONS = []
21
+
15
22
  end
16
23
 
17
24
  end
@@ -15,6 +15,12 @@ module Elibri
15
15
  xml_accessor :code_type, :from => 'StockQuantityCodeType', :as => Fixnum
16
16
  xml_accessor :code, :from => 'StockQuantityCode'
17
17
 
18
+ ATTRIBUTES = [
19
+ :code_type, :code
20
+ ]
21
+
22
+ RELATIONS = []
23
+
18
24
  end
19
25
 
20
26
  end
@@ -16,7 +16,12 @@ module Elibri
16
16
  xml_accessor :heading_text, :from => 'SubjectHeadingText'
17
17
 
18
18
  xml_accessor :main_subject, :from => 'MainSubject'
19
-
19
+
20
+ ATTRIBUTES = [
21
+ :scheme_identifier, :scheme_name, :scheme_version, :code, :heading_text, :main_subject
22
+ ]
23
+
24
+ RELATIONS = []
20
25
 
21
26
  def main_subject?
22
27
  main_subject == ''
@@ -18,6 +18,13 @@ module Elibri
18
18
  xml_accessor :email_address, :from => 'EmailAddress'
19
19
  xml_accessor :website, :from => 'WebsiteLink', :in => 'Website'
20
20
 
21
+ ATTRIBUTES = [
22
+ :role, :name, :telephone_number, :email_address, :website, :nip
23
+ ]
24
+
25
+ RELATIONS = [
26
+ :identifiers
27
+ ]
21
28
 
22
29
  def nip
23
30
  identifiers.find {|identifier| (identifier.type == 2) && (identifier.type_name == 'NIP')}.try(:value)
@@ -16,6 +16,11 @@ module Elibri
16
16
  xml_accessor :type_name, :from => 'IDTypeName'
17
17
  xml_accessor :value, :from => 'IDValue'
18
18
 
19
+ ATTRIBUTES = [
20
+ :type, :type_name, :value
21
+ ]
22
+
23
+ RELATIONS = []
19
24
 
20
25
  end
21
26
  end
@@ -21,6 +21,11 @@ module Elibri
21
21
  xml_accessor :on_hand, :in => 'Stock', :from => 'OnHand', :as => Fixnum
22
22
  xml_accessor :quantity_coded, :in => 'Stock', :as => StockQuantityCoded
23
23
 
24
+ ATTRIBUTES = [
25
+ :relation_code, :supplier, :product_availability, :pack_quantity, :price, :on_hand, :quantity_coded, :quantity_code
26
+ ]
27
+
28
+ RELATIONS = []
24
29
 
25
30
  def quantity_code
26
31
  quantity_coded.try(:code)
@@ -19,6 +19,14 @@ module Elibri
19
19
 
20
20
  xml_accessor :form, :in => 'ResourceVersion', :from => 'ResourceForm'
21
21
  xml_accessor :link, :in => 'ResourceVersion', :from => 'ResourceLink'
22
+
23
+ ATTRIBUTES = [
24
+ :content_type, :mode, :form, :link, :content_type_name, :mode_name, :form_name
25
+ ]
26
+
27
+ RELATIONS = [
28
+ :inspect_include_fields
29
+ ]
22
30
 
23
31
  def content_type_name
24
32
  Elibri::ONIX::Dict::Release_3_0::ResourceContentType.find_by_onix_code(content_type).const_name.downcase
@@ -18,6 +18,14 @@ module Elibri
18
18
 
19
19
  xml_accessor :text, :from => 'Text', :cdata => true
20
20
  xml_accessor :source_url, :from => '@sourcename', :in => 'Text'
21
+
22
+ ATTRIBUTES = [
23
+ :type, :author, :source_title, :text, :source_url, :type_name
24
+ ]
25
+
26
+ RELATIONS = [
27
+ :inspect_include_fields
28
+ ]
21
29
 
22
30
  def type_name
23
31
  Elibri::ONIX::Dict::Release_3_0::OtherTextType.find_by_onix_code(type).const_name.downcase
@@ -12,6 +12,15 @@ module Elibri
12
12
 
13
13
  xml_accessor :type, :from => 'TitleType'
14
14
  xml_accessor :elements, :as => [TitleElement]
15
+
16
+ ATTRIBUTES = [
17
+ :type, :type_name, :full_title, :product_level_title, :product_level, :collection_level_title,
18
+ :collection_level
19
+ ]
20
+
21
+ RELATIONS = [
22
+ :elements, :inspect_include_fields
23
+ ]
15
24
 
16
25
  def id
17
26
  type.to_i
@@ -14,6 +14,11 @@ module Elibri
14
14
  xml_accessor :title, :from => 'TitleText'
15
15
  xml_accessor :subtitle, :from => 'Subtitle'
16
16
 
17
+ ATTRIBUTES = [
18
+ :level, :part_number, :title, :subtitle, :full_title
19
+ ]
20
+
21
+ RELATIONS = []
17
22
 
18
23
  def full_title
19
24
  String.new(self.title.to_s.strip).tap do |_full_title|
@@ -4,7 +4,7 @@ module Elibri
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- PATCH = 16
7
+ PATCH = 17
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 16
10
- version: 0.1.16
9
+ - 17
10
+ version: 0.1.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Urbanski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-09 00:00:00 +02:00
18
+ date: 2012-05-10 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency