pbcore 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pbcore-2.1.xsd +1902 -0
  3. data/lib/pbcore.rb +17 -0
  4. data/lib/pbcore/annotation.rb +1 -1
  5. data/lib/pbcore/asset_date.rb +1 -1
  6. data/lib/pbcore/asset_type.rb +1 -1
  7. data/lib/pbcore/audience_level.rb +1 -1
  8. data/lib/pbcore/audience_rating.rb +1 -1
  9. data/lib/pbcore/content_element.rb +11 -0
  10. data/lib/pbcore/contributor/contributor.rb +1 -1
  11. data/lib/pbcore/contributor/role.rb +1 -1
  12. data/lib/pbcore/coverage/coverage.rb +1 -1
  13. data/lib/pbcore/creator/creator.rb +1 -1
  14. data/lib/pbcore/creator/role.rb +1 -1
  15. data/lib/pbcore/description.rb +1 -1
  16. data/lib/pbcore/element.rb +17 -61
  17. data/lib/pbcore/extension.rb +11 -2
  18. data/lib/pbcore/extension/embedded.rb +14 -7
  19. data/lib/pbcore/factories.rb +2 -4
  20. data/lib/pbcore/genre.rb +1 -1
  21. data/lib/pbcore/identifier.rb +1 -1
  22. data/lib/pbcore/instantiation.rb +2 -2
  23. data/lib/pbcore/instantiation/alternative_modes.rb +1 -1
  24. data/lib/pbcore/instantiation/annotation.rb +1 -1
  25. data/lib/pbcore/instantiation/channel_configuration.rb +1 -1
  26. data/lib/pbcore/instantiation/colors.rb +1 -1
  27. data/lib/pbcore/instantiation/data_rate.rb +1 -1
  28. data/lib/pbcore/instantiation/date.rb +1 -1
  29. data/lib/pbcore/instantiation/digital.rb +1 -1
  30. data/lib/pbcore/instantiation/dimensions.rb +1 -1
  31. data/lib/pbcore/instantiation/duration.rb +1 -1
  32. data/lib/pbcore/instantiation/essence_track/annotation.rb +1 -1
  33. data/lib/pbcore/instantiation/essence_track/aspect_ratio.rb +1 -1
  34. data/lib/pbcore/instantiation/essence_track/bit_depth.rb +1 -1
  35. data/lib/pbcore/instantiation/essence_track/data_rate.rb +1 -1
  36. data/lib/pbcore/instantiation/essence_track/duration.rb +1 -1
  37. data/lib/pbcore/instantiation/essence_track/encoding.rb +1 -1
  38. data/lib/pbcore/instantiation/essence_track/frame_rate.rb +1 -1
  39. data/lib/pbcore/instantiation/essence_track/frame_size.rb +1 -1
  40. data/lib/pbcore/instantiation/essence_track/identifier.rb +1 -1
  41. data/lib/pbcore/instantiation/essence_track/language.rb +1 -1
  42. data/lib/pbcore/instantiation/essence_track/playback_speed.rb +1 -1
  43. data/lib/pbcore/instantiation/essence_track/sampling_rate.rb +1 -1
  44. data/lib/pbcore/instantiation/essence_track/standard.rb +1 -1
  45. data/lib/pbcore/instantiation/essence_track/time_start.rb +1 -1
  46. data/lib/pbcore/instantiation/essence_track/type.rb +1 -1
  47. data/lib/pbcore/instantiation/extension.rb +16 -7
  48. data/lib/pbcore/instantiation/file_size.rb +1 -1
  49. data/lib/pbcore/instantiation/generations.rb +1 -1
  50. data/lib/pbcore/instantiation/identifier.rb +1 -1
  51. data/lib/pbcore/instantiation/language.rb +1 -1
  52. data/lib/pbcore/instantiation/location.rb +1 -1
  53. data/lib/pbcore/instantiation/media_type.rb +1 -1
  54. data/lib/pbcore/instantiation/physical.rb +1 -1
  55. data/lib/pbcore/instantiation/relation/identifier.rb +1 -1
  56. data/lib/pbcore/instantiation/relation/type.rb +1 -1
  57. data/lib/pbcore/instantiation/rights.rb +0 -1
  58. data/lib/pbcore/instantiation/rights/link.rb +1 -1
  59. data/lib/pbcore/instantiation/rights/summary.rb +1 -1
  60. data/lib/pbcore/instantiation/standard.rb +1 -1
  61. data/lib/pbcore/instantiation/time_start.rb +1 -1
  62. data/lib/pbcore/instantiation/tracks.rb +1 -1
  63. data/lib/pbcore/instantiation_document.rb +2 -2
  64. data/lib/pbcore/publisher/publisher.rb +1 -1
  65. data/lib/pbcore/publisher/role.rb +1 -1
  66. data/lib/pbcore/relation/identifier.rb +1 -1
  67. data/lib/pbcore/relation/type.rb +1 -1
  68. data/lib/pbcore/rights_summary/link.rb +1 -1
  69. data/lib/pbcore/rights_summary/summary.rb +1 -1
  70. data/lib/pbcore/subject.rb +1 -1
  71. data/lib/pbcore/title.rb +1 -1
  72. data/lib/pbcore/version.rb +1 -1
  73. data/lib/pbcore/vocab.rb +6 -0
  74. metadata +5 -4
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Dimensions < Element
4
+ class Instantiation::Dimensions < ContentElement
5
5
  element :instantiationDimensions, as: :value
6
6
 
7
7
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Duration < Element
4
+ class Instantiation::Duration < ContentElement
5
5
  element :instantiationDuration, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Annotation < Element
2
+ class Instantiation::EssenceTrack::Annotation < ContentElement
3
3
  element :essenceTrackAnnotation, as: :value
4
4
 
5
5
  attribute :annotationType, as: :type
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::AspectRatio < Element
2
+ class Instantiation::EssenceTrack::AspectRatio < ContentElement
3
3
  element :essenceTrackAspectRatio, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::BitDepth < Element
2
+ class Instantiation::EssenceTrack::BitDepth < ContentElement
3
3
  element :essenceTrackBitDepth, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::DataRate < Element
2
+ class Instantiation::EssenceTrack::DataRate < ContentElement
3
3
  element :essenceTrackDataRate, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Duration < Element
2
+ class Instantiation::EssenceTrack::Duration < ContentElement
3
3
  element :essenceTrackDuration, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Encoding < Element
2
+ class Instantiation::EssenceTrack::Encoding < ContentElement
3
3
  element :essenceTrackEncoding, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::FrameRate < Element
2
+ class Instantiation::EssenceTrack::FrameRate < ContentElement
3
3
  element :essenceTrackFrameRate, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::FrameSize < Element
2
+ class Instantiation::EssenceTrack::FrameSize < ContentElement
3
3
  element :essenceTrackFrameSize, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Identifier < Element
2
+ class Instantiation::EssenceTrack::Identifier < ContentElement
3
3
  element :essenceTrackIdentifier, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Language < Element
2
+ class Instantiation::EssenceTrack::Language < ContentElement
3
3
  element :essenceTrackLanguage, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::PlaybackSpeed < Element
2
+ class Instantiation::EssenceTrack::PlaybackSpeed < ContentElement
3
3
  element :essenceTrackPlaybackSpeed, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::SamplingRate < Element
2
+ class Instantiation::EssenceTrack::SamplingRate < ContentElement
3
3
  element :essenceTrackSamplingRate, as: :value
4
4
 
5
5
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Standard < Element
2
+ class Instantiation::EssenceTrack::Standard < ContentElement
3
3
  element :essenceTrackStandard, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::TimeStart < Element
2
+ class Instantiation::EssenceTrack::TimeStart < ContentElement
3
3
  element :essenceTrackTimeStart, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::EssenceTrack::Type < Element
2
+ class Instantiation::EssenceTrack::Type < ContentElement
3
3
  element :essenceTrackType, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -2,20 +2,29 @@ require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
4
  class Instantiation::Extension < Element
5
- autoload :Wrap, 'pbcore/instantiation/extension/wrap'
6
- autoload :Embedded, 'pbcore/instantiation/extension/embedded'
5
+ autoload :Wrap, 'pbcore/extension/wrap'
6
+ autoload :Embedded, 'pbcore/extension/embedded'
7
7
 
8
8
  element :instantiationExtension, as: :value
9
- # NOTE: the classes used for extensionWrap and extensionEmbedded elements
10
- # here are the same as those used for PBCore::Extension, since everything
11
- # inside has the same schema.
9
+ # NOTE: the classes used for <extensionWrap> and >extensionEmbedded>
10
+ # elements here are the same as those used for PBCore::Extension, since
11
+ # everything inside has the same schema.
12
12
  element :extensionWrap, as: :wrap, class: PBCore::Extension::Wrap
13
13
  element :extensionEmbedded, as: :embedded, class: PBCore::Extension::Embedded
14
14
 
15
15
  build_xml do |xml|
16
16
  xml.instantiationExtension(xml_attributes.compact) do |xml|
17
- wrap.build(xml) if wrap
18
- embedded.build(xml) if embedded
17
+ # <extensionWrap> and <extensionEmbedded> are mutually exclusive. Wrap
18
+ # takes precedence, so if you want to output <extensionEmbedded> make
19
+ # sure #wrap is set to nil.
20
+ # NOTE: Using #embedded will not produce round-trippable XML (i.e. XML
21
+ # that can be reparsed by the pbcore gem models.
22
+ # (See lib/pbcore/extension/embedded.rb)
23
+ if wrap
24
+ wrap.build(xml)
25
+ elsif embedded
26
+ embedded.build(xml)
27
+ end
19
28
  end
20
29
  end
21
30
  end
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::FileSize < Element
4
+ class Instantiation::FileSize < ContentElement
5
5
  element :instantiationFileSize, as: :value
6
6
 
7
7
  attribute :unitsOfMeasure, as: :units_of_measure
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Generations < Element
4
+ class Instantiation::Generations < ContentElement
5
5
  element :instantiationGenerations, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Identifier < Element
4
+ class Instantiation::Identifier < ContentElement
5
5
  element :instantiationIdentifier, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Language < Element
4
+ class Instantiation::Language < ContentElement
5
5
  element :instantiationLanguage, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Location < Element
4
+ class Instantiation::Location < ContentElement
5
5
  element :instantiationLocation, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::MediaType < Element
4
+ class Instantiation::MediaType < ContentElement
5
5
  element :instantiationMediaType, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Physical < Element
4
+ class Instantiation::Physical < ContentElement
5
5
  element :instantiationPhysical, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::Relation::Identifier < Element
2
+ class Instantiation::Relation::Identifier < ContentElement
3
3
  element :instantiationRelationIdentifier, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -1,5 +1,5 @@
1
1
  module PBCore
2
- class Instantiation::Relation::Type < Element
2
+ class Instantiation::Relation::Type < ContentElement
3
3
  element :instantiationRelationType, as: :value
4
4
 
5
5
  build_xml do |xml|
@@ -9,7 +9,6 @@ module PBCore
9
9
  element :rightsSummary, as: :summary, class: PBCore::Instantiation::Rights::Summary
10
10
  element :rightsLink, as: :link, class: PBCore::Instantiation::Rights::Link
11
11
 
12
- # has_time_attributes_on :instantiationRights
13
12
  include PBCore::Attributes::TimeInterval
14
13
 
15
14
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Rights::Link < Element
4
+ class Instantiation::Rights::Link < ContentElement
5
5
  element :rightsLink, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Rights::Summary < Element
4
+ class Instantiation::Rights::Summary < ContentElement
5
5
  element :rightsSummary, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Standard < Element
4
+ class Instantiation::Standard < ContentElement
5
5
  element :instantiationStandard, as: :value
6
6
 
7
7
  attribute :profile, as: :profile
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::TimeStart < Element
4
+ class Instantiation::TimeStart < ContentElement
5
5
  element :instantiationTimeStart, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Instantiation::Tracks < Element
4
+ class Instantiation::Tracks < ContentElement
5
5
  element :instantiationTracks, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -36,7 +36,7 @@ module PBCore
36
36
  element :instantiationLocation, as: :location, class: PBCore::Instantiation::Location
37
37
  element :instantiationMediaType, as: :media_type, class: PBCore::Instantiation::MediaType
38
38
  elements :instantiationGenerations, as: :generations, class: PBCore::Instantiation::Generations
39
- elements :instantiationTimeStart, as: :time_starts, class: PBCore::Instantiation::TimeStart
39
+ element :instantiationTimeStart, as: :time_start, class: PBCore::Instantiation::TimeStart
40
40
  element :instantiationFileSize, as: :file_size, class: PBCore::Instantiation::FileSize
41
41
  element :instantiationDuration, as: :duration, class: PBCore::Instantiation::Duration
42
42
  element :instantiationDataRate, as: :data_rate, class: PBCore::Instantiation::DataRate
@@ -65,7 +65,7 @@ module PBCore
65
65
  location.build(xml) if location
66
66
  media_type.build(xml) if media_type
67
67
  generations.each { |generations_element| generations_element.build(xml) }
68
- time_starts.each { |time_start| time_start.build(xml) }
68
+ time_start.build(xml) if time_start
69
69
  file_size.build(xml) if file_size
70
70
  duration.build(xml) if duration
71
71
  data_rate.build(xml) if data_rate
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Publisher::Publisher < Element
4
+ class Publisher::Publisher < ContentElement
5
5
  element :publisher, as: :value
6
6
 
7
7
  attribute :affiliation, as: :affiliation
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Publisher::Role < Element
4
+ class Publisher::Role < ContentElement
5
5
  element :publisherRole, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Relation::Identifier < Element
4
+ class Relation::Identifier < ContentElement
5
5
  element :pbcoreRelationIdentifier, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Relation::Type < Element
4
+ class Relation::Type < ContentElement
5
5
  element :pbcoreRelationType, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class RightsSummary::Link < Element
4
+ class RightsSummary::Link < ContentElement
5
5
  element :rightsLink, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class RightsSummary::Summary < Element
4
+ class RightsSummary::Summary < ContentElement
5
5
  element :rightsSummary, as: :value
6
6
 
7
7
  build_xml do |xml|
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Subject < Element
4
+ class Subject < ContentElement
5
5
  element :pbcoreSubject, as: :value
6
6
  attribute :subjectType, as: :type
7
7
  attribute :subjectTypeRef, as: :type_ref
@@ -1,7 +1,7 @@
1
1
  require 'pbcore/element'
2
2
 
3
3
  module PBCore
4
- class Title < Element
4
+ class Title < ContentElement
5
5
  element :pbcoreTitle, as: :value
6
6
  attribute :titleType, as: :type
7
7
  attribute :titleTypeSource, as: :type_source
@@ -1,3 +1,3 @@
1
1
  module PBCore
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,6 +1,12 @@
1
1
  module PBCore
2
2
  module Vocab
3
3
  class << self
4
+ def asset_types
5
+ [ "Album", "Animation", "Clip", "Collection", "Compilation", "Episode",
6
+ "Miniseries", "Program", "Promo", "Raw Footage", "Segment", "Series",
7
+ "Season", "Subseries" ]
8
+ end
9
+
4
10
  def date_types
5
11
  [ "accepted", "available", "available end", "available start",
6
12
  "broadcast", "captured", "created", "copyright", "deletion",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Myers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-09 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -181,6 +181,7 @@ files:
181
181
  - Rakefile
182
182
  - bin/console
183
183
  - bin/setup
184
+ - lib/pbcore-2.1.xsd
184
185
  - lib/pbcore.rb
185
186
  - lib/pbcore/annotation.rb
186
187
  - lib/pbcore/asset_date.rb
@@ -190,6 +191,7 @@ files:
190
191
  - lib/pbcore/attributes/time_interval.rb
191
192
  - lib/pbcore/audience_level.rb
192
193
  - lib/pbcore/audience_rating.rb
194
+ - lib/pbcore/content_element.rb
193
195
  - lib/pbcore/contributor.rb
194
196
  - lib/pbcore/contributor/contributor.rb
195
197
  - lib/pbcore/contributor/role.rb
@@ -289,8 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
291
  - !ruby/object:Gem::Version
290
292
  version: '0'
291
293
  requirements: []
292
- rubyforge_project:
293
- rubygems_version: 2.7.6
294
+ rubygems_version: 3.1.4
294
295
  signing_key:
295
296
  specification_version: 4
296
297
  summary: PBCore models and factories for Ruby