hypertext_application_language 0.0.1 → 0.1.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: aa1223d9680f63a20aff6aa6e81531aa15ffa7a1
|
4
|
+
data.tar.gz: 2fa204aff2bfe0ef84684162f677fd52766fa4b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c62cbd202051513cc94f22cd273a10702e791f2bb103a6ad9ff30de7707332892ef078cf48695e9fd00cd3ff2055c0dc4e734a6d252abc907a21333d5450d50
|
7
|
+
data.tar.gz: e7ed8f0ea49e75d50868189bef88a65d71c3b871eb1e0af7186e5f2ff1f4eac46470a7308bbaa0b51cba3f8b11393cec2208433260381532742ec9506d9ca5a7
|
data/.gitignore
CHANGED
@@ -8,7 +8,11 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'hypertext_application_language'
|
9
9
|
spec.version = HypertextApplicationLanguage::VERSION
|
10
10
|
spec.summary = %q{Hypertext Application Language}
|
11
|
-
spec.description =
|
11
|
+
spec.description = <<-DESCRIPTION.gsub(/\s+/, ' ').strip
|
12
|
+
Suite of Ruby classes for rendering and parsing HAL resource representations,
|
13
|
+
including their links, properties and nested representations of embedded
|
14
|
+
resources.
|
15
|
+
DESCRIPTION
|
12
16
|
spec.homepage = 'http://stateless.co/hal_specification.html'
|
13
17
|
spec.authors = ['Roy Ratcliffe']
|
14
18
|
spec.email = ['roy@pioneeringsoftware.co.uk']
|
@@ -16,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
16
20
|
spec.license = 'MIT'
|
17
21
|
|
18
22
|
spec.add_development_dependency 'bundler'
|
19
|
-
spec.add_development_dependency 'rspec'
|
20
23
|
spec.add_development_dependency 'rake'
|
24
|
+
spec.add_development_dependency 'rspec'
|
21
25
|
spec.add_development_dependency 'simplecov'
|
22
26
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
describe HypertextApplicationLanguage::HashRepresentationRenderer do
|
2
|
+
let(:renderer) { described_class.new }
|
3
|
+
|
4
|
+
it 'renders a representation' do
|
5
|
+
representation = HypertextApplicationLanguage::Representation.new
|
6
|
+
representation.with_namespace('ns', 'http://localhost:9292/{rel}')
|
7
|
+
representation.with_link(HypertextApplicationLanguage::Link::SELF_REL, 'http://localhost:9292/self')
|
8
|
+
representation.with_property('value', 123)
|
9
|
+
representation.with_property('array', [1, 2, 3])
|
10
|
+
embedded = HypertextApplicationLanguage::Representation.new
|
11
|
+
embedded.with_property('hello', 'world')
|
12
|
+
embedded.with_link(HypertextApplicationLanguage::Link::SELF_REL, 'http://localhost:9292/sub')
|
13
|
+
representation.with_representation('sub', embedded)
|
14
|
+
expect(renderer.render(representation)).to eq(JSON.parse(<<-EXPECTED))
|
15
|
+
{
|
16
|
+
"_links": {
|
17
|
+
"curies": {
|
18
|
+
"href": "http://localhost:9292/{rel}",
|
19
|
+
"name": "ns"
|
20
|
+
},
|
21
|
+
"self": {
|
22
|
+
"href": "http://localhost:9292/self"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"value": 123,
|
26
|
+
"array": [
|
27
|
+
1,
|
28
|
+
2,
|
29
|
+
3
|
30
|
+
],
|
31
|
+
"_embedded": {
|
32
|
+
"sub": {
|
33
|
+
"_links": {
|
34
|
+
"self": {
|
35
|
+
"href": "http://localhost:9292/sub"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"hello": "world"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
EXPECTED
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hypertext_application_language
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roy Ratcliffe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '0'
|
33
|
-
name:
|
33
|
+
name: rake
|
34
34
|
prerelease: false
|
35
35
|
type: :development
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
|
-
name:
|
47
|
+
name: rspec
|
48
48
|
prerelease: false
|
49
49
|
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: Suite of Ruby classes for rendering and parsing HAL resource representations, including their links, properties and nested representations of embedded resources.
|
70
70
|
email:
|
71
71
|
- roy@pioneeringsoftware.co.uk
|
72
72
|
executables: []
|
@@ -78,7 +78,6 @@ files:
|
|
78
78
|
- ".yardopts"
|
79
79
|
- ChangeLog.md
|
80
80
|
- Gemfile
|
81
|
-
- Gemfile.lock
|
82
81
|
- MIT-LICENSE.txt
|
83
82
|
- README.md
|
84
83
|
- Rakefile
|
@@ -90,6 +89,7 @@ files:
|
|
90
89
|
- lib/hypertext_application_language/namespace_manager.rb
|
91
90
|
- lib/hypertext_application_language/representation.rb
|
92
91
|
- lib/hypertext_application_language/version.rb
|
92
|
+
- spec/hypertext_application_language/hash_representation_renderer_spec.rb
|
93
93
|
- spec/hypertext_application_language/link_spec.rb
|
94
94
|
- spec/hypertext_application_language/namespace_manager_spec.rb
|
95
95
|
- spec/hypertext_application_language/representation_spec.rb
|
data/Gemfile.lock
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
hypertext_application_language (0.0.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.2.5)
|
10
|
-
docile (1.1.5)
|
11
|
-
json (1.8.3)
|
12
|
-
json (1.8.3-java)
|
13
|
-
rake (10.4.2)
|
14
|
-
rspec (3.3.0)
|
15
|
-
rspec-core (~> 3.3.0)
|
16
|
-
rspec-expectations (~> 3.3.0)
|
17
|
-
rspec-mocks (~> 3.3.0)
|
18
|
-
rspec-core (3.3.2)
|
19
|
-
rspec-support (~> 3.3.0)
|
20
|
-
rspec-expectations (3.3.1)
|
21
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.3.0)
|
23
|
-
rspec-mocks (3.3.2)
|
24
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
25
|
-
rspec-support (~> 3.3.0)
|
26
|
-
rspec-support (3.3.0)
|
27
|
-
simplecov (0.10.0)
|
28
|
-
docile (~> 1.1.0)
|
29
|
-
json (~> 1.8)
|
30
|
-
simplecov-html (~> 0.10.0)
|
31
|
-
simplecov-html (0.10.0)
|
32
|
-
|
33
|
-
PLATFORMS
|
34
|
-
java
|
35
|
-
ruby
|
36
|
-
|
37
|
-
DEPENDENCIES
|
38
|
-
bundler
|
39
|
-
hypertext_application_language!
|
40
|
-
rake
|
41
|
-
rspec
|
42
|
-
simplecov
|
43
|
-
|
44
|
-
BUNDLED WITH
|
45
|
-
1.10.6
|