matterhorn_whymper 1.8.7 → 2.0.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 +8 -8
- data/lib/matterhorn/endpoint/event.rb +17 -30
- data/lib/matterhorn_whymper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
MmI0OTRmZTM5ZmQ3NWQ0NTM3M2Y5ZDIzOTJlNjg4NjNjNmUxNjQ3YQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MmVjYzY4ZGVjNjAzYTE2ZWE4MGU0Yjg2NGVjNTk4MDU5Y2VhYmNiNg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
N2JlOTdhOTQxNTJlYTM3MzhkNTllMmU0MWUxNmI5ZWQ4NGNiNTJhMTYxOTRh
|
|
10
|
+
NDBjNjczZjJmMTJkOWJkNTY2MjhkMmQ3YWI1MTM3ODJiZGEwODNmNjM5MWU0
|
|
11
|
+
MjRkMDczYjkwYjgwMDMwZWFjMjcwYTQ5MGQ2NzM0Y2YwYTVmY2Y=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZWVlNTdmMTViNTNmZmFmYzQzNGNlM2VjZmIxOTVlYjk5ZjRmOTBkMmZmMmYy
|
|
14
|
+
MDJmOWJhZjgxNDdmY2MzNzkwMDRlYzEwMmEzYmI5YTg0MWNjM2YwM2ExMDhm
|
|
15
|
+
NDQzNThmODA0OWNmOTk0MThiNDVhMWE5NWMwMjRlZjM3MmNmNmY=
|
|
@@ -17,39 +17,20 @@ class Matterhorn::Endpoint::Event < Matterhorn::Endpoint
|
|
|
17
17
|
|
|
18
18
|
# --------------------------------------------------------------------------------------- read ---
|
|
19
19
|
|
|
20
|
-
def
|
|
21
|
-
|
|
20
|
+
def read(event_id)
|
|
21
|
+
event = nil
|
|
22
22
|
begin
|
|
23
|
-
split_response
|
|
24
|
-
"
|
|
23
|
+
split_response http_api_client.get(
|
|
24
|
+
"api/events/#{event_id}"
|
|
25
25
|
)
|
|
26
|
-
|
|
26
|
+
event = JSON.parse(response_body)
|
|
27
27
|
rescue => ex
|
|
28
|
-
exception_handler('
|
|
29
|
-
404 => "The
|
|
28
|
+
exception_handler('read', ex, {
|
|
29
|
+
404 => "The Event[#{event_id}] could not be found!"
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def read_dublin_core(event_id)
|
|
38
|
-
dublin_core = nil
|
|
39
|
-
begin
|
|
40
|
-
mp = read_media_package(event_id)
|
|
41
|
-
if !mp.nil?
|
|
42
|
-
dc_uri = URI.parse(mp.dc_catalog_url)
|
|
43
|
-
split_response http_endpoint_client.get(dc_uri.request_uri)
|
|
44
|
-
dublin_core = Matterhorn::DublinCore.new(response_body)
|
|
45
|
-
end
|
|
46
|
-
rescue => ex
|
|
47
|
-
exception_handler('read_dublin_core', ex, {
|
|
48
|
-
404 => "The media package of event[#{event_id}] could not be found."
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
end
|
|
52
|
-
dublin_core
|
|
33
|
+
event
|
|
53
34
|
end
|
|
54
35
|
|
|
55
36
|
|
|
@@ -93,12 +74,18 @@ class Matterhorn::Endpoint::Event < Matterhorn::Endpoint
|
|
|
93
74
|
|
|
94
75
|
def delete(event_id)
|
|
95
76
|
begin
|
|
96
|
-
|
|
97
|
-
|
|
77
|
+
done = false
|
|
78
|
+
split_response http_api_client.delete(
|
|
79
|
+
"api/events/#{event_id}"
|
|
98
80
|
)
|
|
81
|
+
done = true
|
|
99
82
|
rescue => ex
|
|
100
|
-
exception_handler('delete', ex, {
|
|
83
|
+
exception_handler('delete', ex, {
|
|
84
|
+
404 => "The Event[#{event_id}] could not be found!"
|
|
85
|
+
}
|
|
86
|
+
)
|
|
101
87
|
end
|
|
88
|
+
done
|
|
102
89
|
end
|
|
103
90
|
|
|
104
91
|
|
|
@@ -5,7 +5,7 @@ module MatterhornWhymper
|
|
|
5
5
|
|
|
6
6
|
# -------------------------------------------------------------------------- const definitions ---
|
|
7
7
|
|
|
8
|
-
VERSION = "
|
|
8
|
+
VERSION = "2.0.0"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
end # -------------------------------------------------------------------- end MatterhornWhymper ---
|