opencomponents 0.4.0 → 0.5.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,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8cb2071582cb7e8e3dd5afcb6c21338760c34d2a
|
|
4
|
+
data.tar.gz: 658ee06c9abebcb99a0e4fe9322d80475e83b85c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e36060f46374f70f27f0ce8a1892249977819c400b96b5732f578448697c4fcf103f7bf41ffc76d7cc1a224ee36f228b0a0cdd22ab2cb642854da462f588cb48
|
|
7
|
+
data.tar.gz: d03fa3b9147c56c57b821fc4f558f57c74b049a33a6e972078745c44914006813a4d112279fde106177be28db915f335f938fa19c4f42ee4a91e07cd8285f63a
|
data/README.md
CHANGED
|
@@ -52,18 +52,18 @@ component = OpenComponents::RenderedComponent.new(
|
|
|
52
52
|
)
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
## Getting
|
|
56
|
-
If you'd like to perform the component rendering yourself, you can request
|
|
57
|
-
|
|
55
|
+
## Getting Unrendered Components
|
|
56
|
+
If you'd like to perform the component rendering yourself, you can request an
|
|
57
|
+
unrendered component from a registry using a `UnrenderedComponent` object.
|
|
58
58
|
```ruby
|
|
59
|
-
component = OpenComponents::
|
|
59
|
+
component = OpenComponents::UnrenderedComponent.new('my-awesome-component')
|
|
60
60
|
component.load
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
You can use the same optional `params`, `version`, and `headers` arguments as
|
|
64
64
|
`RenderedComponent`s.
|
|
65
65
|
|
|
66
|
-
**Note**: `
|
|
66
|
+
**Note**: `UnrenderedComponent`s will only fetch component data for you - they
|
|
67
67
|
do not provide an interface for rendering them. At the moment, it's up to you to
|
|
68
68
|
determine the best way to render the template.
|
|
69
69
|
|
data/lib/opencomponents.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require 'rest-client'
|
|
2
2
|
|
|
3
3
|
require 'opencomponents/component'
|
|
4
|
-
require 'opencomponents/prerendered_component'
|
|
5
4
|
require 'opencomponents/rendered_component'
|
|
6
5
|
require 'opencomponents/renderer'
|
|
6
|
+
require 'opencomponents/unrendered_component'
|
|
7
7
|
require 'opencomponents/version'
|
|
8
8
|
|
|
9
9
|
module OpenComponents
|
|
@@ -25,7 +25,7 @@ module OpenComponents
|
|
|
25
25
|
# registry - String for the registry host.
|
|
26
26
|
Configuration = Struct.new(:registry, :timeout)
|
|
27
27
|
|
|
28
|
-
# Internal: Wrapper object for
|
|
28
|
+
# Internal: Wrapper object for unrendered OC templates.
|
|
29
29
|
#
|
|
30
30
|
# src - String for the template URL.
|
|
31
31
|
# type - String for template engine type.
|
|
@@ -25,7 +25,7 @@ module OpenComponents
|
|
|
25
25
|
attr_reader :type
|
|
26
26
|
|
|
27
27
|
# Public: Returns the String render mode of the component as served by the
|
|
28
|
-
# registry. Generally either `rendered` or `
|
|
28
|
+
# registry. Generally either `rendered` or `unrendered`.
|
|
29
29
|
attr_reader :render_mode
|
|
30
30
|
|
|
31
31
|
# Public: Initializes a new Component subclass.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module OpenComponents
|
|
2
|
-
# Wrapper object for components using the `
|
|
3
|
-
class
|
|
2
|
+
# Wrapper object for components using the `unrendered` rendering mode.
|
|
3
|
+
class UnrenderedComponent < Component
|
|
4
4
|
# Internal: Default HTTP headers to send when requesting a component.
|
|
5
|
-
DEFAULT_HEADERS = {accept: 'application/vnd.oc.
|
|
5
|
+
DEFAULT_HEADERS = {accept: 'application/vnd.oc.unrendered+json'}
|
|
6
6
|
|
|
7
7
|
# Public: Returns a Hash of data to use when rendering the component.
|
|
8
8
|
attr_reader :data
|
|
@@ -10,7 +10,7 @@ module OpenComponents
|
|
|
10
10
|
# Public: Returns a Template with data for rendering the raw component.
|
|
11
11
|
attr_reader :template
|
|
12
12
|
|
|
13
|
-
# Public: Initializes a new
|
|
13
|
+
# Public: Initializes a new UnrenderedComponent.
|
|
14
14
|
#
|
|
15
15
|
# name - The String name of the component to request.
|
|
16
16
|
# opts - A Hash of options to use when requesting the component
|
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.5.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-
|
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -49,9 +49,9 @@ files:
|
|
|
49
49
|
- README.md
|
|
50
50
|
- lib/opencomponents.rb
|
|
51
51
|
- lib/opencomponents/component.rb
|
|
52
|
-
- lib/opencomponents/prerendered_component.rb
|
|
53
52
|
- lib/opencomponents/rendered_component.rb
|
|
54
53
|
- lib/opencomponents/renderer.rb
|
|
54
|
+
- lib/opencomponents/unrendered_component.rb
|
|
55
55
|
- lib/opencomponents/version.rb
|
|
56
56
|
- opencomponents.gemspec
|
|
57
57
|
homepage: https://github.com/opentable/ruby-oc
|
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
75
75
|
version: '0'
|
|
76
76
|
requirements: []
|
|
77
77
|
rubyforge_project:
|
|
78
|
-
rubygems_version: 2.
|
|
78
|
+
rubygems_version: 2.4.5.1
|
|
79
79
|
signing_key:
|
|
80
80
|
specification_version: 4
|
|
81
81
|
summary: Consume OpenComponents in Ruby
|