matterhorn_whymper 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
M2I3ZTY1N2YxMTMxMDUwZTQ3MDRlZDZiNWMwNzRlOTU2OGY2MTIzMA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YmIyNzY5OTYxNTg3NWU2NWRlNjg3Mzk5ODRmY2E0NzJmY2M4OWQyZg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NzhjMjU0MGMzMTEwMmFhYWFiZTAwNWE5N2VhYWQ0OGFkOGYyNzJiYjNhMDg1
|
|
10
|
+
NzAyOWMzNWIwNGIzNGJkYzg4ZmE5NDYwYjA5NWMzNjQ3ZWRkMjA4ZjhkYTNm
|
|
11
|
+
ZGE3ZWNmYWE3MzFiYmY5ZDBhNjBkNzJhMjRiZGMwYzg5ODhmMDY=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NjQ5MjhmNGNhMDk3MmQ1NjU3Nzk2NjA0OGUzMzY2YmU2MDdkOGZkM2MzZjNl
|
|
14
|
+
YjA2OTUzMDFmNjJiNzAyMWFhNGU4YjUyYmYxOWJiYmI3NDRmNjJiYjU5ZTRm
|
|
15
|
+
Y2M1OTY4MzBmMTE0YjMyYzY5MTM2OWY1ODRlMDljODNhM2U0MzM=
|
|
@@ -112,10 +112,11 @@ class Matterhorn::Endpoint::Ingest < Matterhorn::Endpoint
|
|
|
112
112
|
# If the source_path to the source folder of uploaded items for that media package is given,
|
|
113
113
|
# then a local media description file 'manifest.xml' will be automaticaly saved in that folder.
|
|
114
114
|
#
|
|
115
|
-
def createMediaPackage(source_path = nil)
|
|
115
|
+
def createMediaPackage(source_path = nil, prefix = nil)
|
|
116
116
|
if @media_pkg_xml_remote then raise(Matterhorn::Error, "A media package is allready created!"); end
|
|
117
117
|
@media_pkg_local = if source_path
|
|
118
|
-
Matterhorn::MediaPackage.new(nil, {:path
|
|
118
|
+
Matterhorn::MediaPackage.new(nil, {:path => source_path,
|
|
119
|
+
:prefix => prefix})
|
|
119
120
|
else
|
|
120
121
|
nil
|
|
121
122
|
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'nokogiri'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# =================================================================== Matterhorn::JavaProperties ===
|
|
5
|
+
|
|
6
|
+
class Matterhorn::JavaProperties
|
|
7
|
+
|
|
8
|
+
# -------------------------------------------------------------------------- const definitions ---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# ----------------------------------------------------------------------------------- methodes ---
|
|
12
|
+
|
|
13
|
+
def self.write(hash, path, options = {})
|
|
14
|
+
File.write(path, generate_xml(hash, options))
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def self.generate_xml(hash, options = {})
|
|
19
|
+
Nokogiri::XML::Builder.new do |xml|
|
|
20
|
+
xml.doc.create_internal_subset('properties', nil, 'http://java.sun.com/dtd/properties.dtd')
|
|
21
|
+
xml.properties do
|
|
22
|
+
xml.comment_(options[:comment]) unless options[:comment].nil?
|
|
23
|
+
hash.each_pair do |key, value|
|
|
24
|
+
if options[:cdata] && options[:cdata].include?(key)
|
|
25
|
+
xml.entry(:key => key) do
|
|
26
|
+
xml.cdata(value)
|
|
27
|
+
end
|
|
28
|
+
else
|
|
29
|
+
xml.entry(value, :key => key)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end.doc.to_xml
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
end # ----------------------------------------------------------- end Matterhorn::JavaProperties ---
|
|
@@ -25,11 +25,17 @@ class Matterhorn::MediaPackage
|
|
|
25
25
|
end
|
|
26
26
|
.doc
|
|
27
27
|
end
|
|
28
|
-
if (path = options[:path])
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
@path = if (path = options[:path])
|
|
29
|
+
path + (path[-1] == '/' ? '' : '/') # guarantee that path ends with a slash
|
|
30
|
+
else
|
|
31
|
+
nil
|
|
32
|
+
end
|
|
33
|
+
@prefix = options[:prefix]
|
|
34
|
+
@filename = if @prefix
|
|
35
|
+
"#{@prefix}_manifest.xml"
|
|
36
|
+
else
|
|
37
|
+
'manifest.xml'
|
|
38
|
+
end
|
|
33
39
|
end
|
|
34
40
|
|
|
35
41
|
|
|
@@ -87,7 +93,7 @@ class Matterhorn::MediaPackage
|
|
|
87
93
|
|
|
88
94
|
|
|
89
95
|
def add_dc_catalog(dublin_core)
|
|
90
|
-
filename = 'dublincore.xml'
|
|
96
|
+
filename = @prefix ? "#{@prefix}_dublincore.xml" : 'dublincore.xml'
|
|
91
97
|
flavor = 'dublincore/episode'
|
|
92
98
|
dc_doc = Nokogiri::XML(dublin_core)
|
|
93
99
|
dc_file = File.join(@path, filename)
|
|
@@ -145,11 +151,11 @@ class Matterhorn::MediaPackage
|
|
|
145
151
|
end
|
|
146
152
|
|
|
147
153
|
|
|
148
|
-
def save(path = @path)
|
|
154
|
+
def save(path = @path, filename = @filename)
|
|
149
155
|
unless path
|
|
150
156
|
raise(Matterhorn::Error, "No path was set, where manifest file should be saved!")
|
|
151
157
|
end
|
|
152
|
-
manifest_file = File.join(path,
|
|
158
|
+
manifest_file = File.join(path, filename)
|
|
153
159
|
File.open(manifest_file, 'w') do |file|
|
|
154
160
|
file.write(to_xml)
|
|
155
161
|
end
|
|
@@ -5,7 +5,7 @@ module MatterhornWhymper
|
|
|
5
5
|
|
|
6
6
|
# -------------------------------------------------------------------------- const definitions ---
|
|
7
7
|
|
|
8
|
-
VERSION = "1.
|
|
8
|
+
VERSION = "1.2.0"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
end # -------------------------------------------------------------------- end MatterhornWhymper ---
|
data/lib/matterhorn_whymper.rb
CHANGED
|
@@ -14,6 +14,7 @@ require 'matterhorn/endpoint/series'
|
|
|
14
14
|
require 'matterhorn/endpoint/workflow'
|
|
15
15
|
require 'matterhorn/error'
|
|
16
16
|
require 'matterhorn/http_client'
|
|
17
|
+
require 'matterhorn/java_properties'
|
|
17
18
|
require 'matterhorn/media_package'
|
|
18
19
|
require 'matterhorn/smil'
|
|
19
20
|
require 'matterhorn/workflow_instance'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: matterhorn_whymper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Fritschi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-07-
|
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multipart-post
|
|
@@ -146,6 +146,7 @@ files:
|
|
|
146
146
|
- lib/matterhorn/endpoint/workflow.rb
|
|
147
147
|
- lib/matterhorn/error.rb
|
|
148
148
|
- lib/matterhorn/http_client.rb
|
|
149
|
+
- lib/matterhorn/java_properties.rb
|
|
149
150
|
- lib/matterhorn/media_package.rb
|
|
150
151
|
- lib/matterhorn/smil.rb
|
|
151
152
|
- lib/matterhorn/workflow_instance.rb
|