opencomponents 0.2.0 → 0.3.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 +4 -4
- data/README.md +1 -1
- data/lib/opencomponents.rb +5 -0
- data/lib/opencomponents/component.rb +3 -2
- data/lib/opencomponents/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49bcd287db933a16b2e5fde5d71968a7d57daab3
|
4
|
+
data.tar.gz: 658e8983ff495b5de3d63c1fe321e5f25f71d53d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f8b148199b29ece56ac71c906645294b2fb9ff1bd89621f2d108522d032f6e6cdab79edd5d64d29ac471bbdba615917a1d6ad6f0020c1d3be64fa1fed827a95
|
7
|
+
data.tar.gz: 5b100c9b7ada42b05dde7c278da5986fe9ba265fb7d30bc62781c3602e49ee7f614b7895af4a092a9aae3f09dc367654248f7956ca794f0743f0cfff8c070119
|
data/README.md
CHANGED
data/lib/opencomponents.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
|
1
3
|
require 'opencomponents/component'
|
2
4
|
require 'opencomponents/prerendered_component'
|
3
5
|
require 'opencomponents/rendered_component'
|
@@ -12,6 +14,9 @@ module OpenComponents
|
|
12
14
|
# found in the registry.
|
13
15
|
ComponentNotFound = Class.new(RuntimeError)
|
14
16
|
|
17
|
+
# Internal: Custom exception class to raise for response timeouts.
|
18
|
+
RegistryTimeout = Class.new(RestClient::RequestTimeout)
|
19
|
+
|
15
20
|
# Internal: Stores configuration data.
|
16
21
|
#
|
17
22
|
# registry - String for the registry host.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'rest-client'
|
2
|
-
|
3
1
|
module OpenComponents
|
4
2
|
# Wrapper object for a component fetched from an OC registry.
|
5
3
|
class Component
|
@@ -113,6 +111,7 @@ module OpenComponents
|
|
113
111
|
# Returns a response body String.
|
114
112
|
# Raises OpenComponents::ComponentNotFound if the registry responds with a
|
115
113
|
# 404.
|
114
|
+
# Raises OpenComponents::RegistryTimeout if the request times out.
|
116
115
|
def response
|
117
116
|
request_headers = headers.merge(params: params)
|
118
117
|
|
@@ -124,6 +123,8 @@ module OpenComponents
|
|
124
123
|
)
|
125
124
|
rescue RestClient::ResourceNotFound => e
|
126
125
|
fail ComponentNotFound, e.message
|
126
|
+
rescue RestClient::RequestTimeout => e
|
127
|
+
fail RegistryTimeout, e.message
|
127
128
|
end
|
128
129
|
|
129
130
|
# Internal: Helper method for converting and memoizing registry response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opencomponents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Bealmear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|