raml-rb 0.0.5 → 0.0.6
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/.travis.yml +3 -0
- data/README.md +1 -3
- data/lib/raml/parser/root.rb +1 -1
- data/lib/raml/root.rb +2 -1
- data/lib/raml/version.rb +1 -1
- data/spec/fixtures/all-the-things.raml +6 -1
- data/spec/fixtures/basic.raml +6 -1
- data/spec/lib/raml/parser/root_spec.rb +6 -2
- data/spec/lib/raml/root_spec.rb +13 -0
- 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: 6b89803dbf18a158ddc7f781c03b1b5b8b266f89
|
4
|
+
data.tar.gz: 3f97e128ffddc9f7f6db4cad8b741115619876ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f55464b58630ad4e0e50bbfcdf7ed2b4cce179eb29b8a7a87d7b373dc174dac0398227ef16b48027b31bfa78852f65d20bd88816688fa8e2ad7476ff55371b7
|
7
|
+
data.tar.gz: 1c796472b8a9cbe85c1442d6662e36d9ed4809c38c3619e80637577865cbcd5244ae5c75f3fe3c02fef49621f49341ee13870c2045ad41f7fb8b0905b3bbf443
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# raml-rb
|
2
2
|
|
3
|
-
[](https://travis-ci.org/jpb/raml-rb) [](https://coveralls.io/github/jpb/raml-rb?branch=master)
|
3
|
+
[](https://badge.fury.io/rb/raml-rb) [](https://travis-ci.org/jpb/raml-rb) [](https://coveralls.io/github/jpb/raml-rb?branch=master) [](https://codeclimate.com/github/jpb/raml-rb)
|
4
4
|
|
5
5
|
A RAML parser, implemented in Ruby.
|
6
6
|
|
7
|
-
[](https://codeclimate.com/github/jpb/raml-rb)
|
8
|
-
|
9
7
|
## Installation
|
10
8
|
|
11
9
|
```
|
data/lib/raml/parser/root.rb
CHANGED
data/lib/raml/root.rb
CHANGED
data/lib/raml/version.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
#%RAML 0.8
|
2
2
|
|
3
3
|
title: World Music API
|
4
|
-
baseUri: http://
|
4
|
+
baseUri: http://{environment}.api.com/{version}
|
5
|
+
baseUriParameters:
|
6
|
+
environment:
|
7
|
+
description: The deployed environment
|
8
|
+
type: String
|
5
9
|
version: v1
|
10
|
+
mediaType: application/json
|
6
11
|
documentation:
|
7
12
|
- title: RAML Baml
|
8
13
|
content: |
|
data/spec/fixtures/basic.raml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
#%RAML 0.8
|
2
2
|
|
3
3
|
title: World Music API
|
4
|
-
baseUri: http://
|
4
|
+
baseUri: http://{environment}.api.com/{version}
|
5
|
+
baseUriParameters:
|
6
|
+
environment:
|
7
|
+
description: The deployed environment
|
8
|
+
type: String
|
5
9
|
version: v1
|
10
|
+
mediaType: application/json
|
6
11
|
traits:
|
7
12
|
- paged:
|
8
13
|
queryParameters:
|
@@ -8,9 +8,13 @@ describe Raml::Parser::Root do
|
|
8
8
|
subject { Raml::Parser::Root.new.parse(raml) }
|
9
9
|
|
10
10
|
it { is_expected.to be_kind_of Raml::Root }
|
11
|
-
its(:base_uri) { should == 'http://
|
12
|
-
its(:uri) { should == 'http://
|
11
|
+
its(:base_uri) { should == 'http://{environment}.api.com/{version}' }
|
12
|
+
its(:uri) { should == 'http://{environment}.api.com/v1' }
|
13
13
|
its(:version) { should == 'v1' }
|
14
|
+
its(:base_uri_parameters) do
|
15
|
+
should == {"environment" => { "description"=>"The deployed environment", "type"=>"String" }}
|
16
|
+
end
|
17
|
+
its(:media_type) { should == "application/json" }
|
14
18
|
its('resources.count') { should == 1 }
|
15
19
|
its('resources.first.methods.count') { should == 2 }
|
16
20
|
its('resources.first.methods.first.responses.count') { should == 0 }
|
data/spec/lib/raml/root_spec.rb
CHANGED
@@ -33,4 +33,17 @@ describe Raml::Root do
|
|
33
33
|
it { is_expected.to eq('1.0') }
|
34
34
|
end
|
35
35
|
|
36
|
+
describe '#base_uri_parameters' do
|
37
|
+
let(:root) { Raml::Root.new }
|
38
|
+
before { root.base_uri_parameters = '' }
|
39
|
+
subject { root.base_uri_parameters }
|
40
|
+
it { is_expected.to eq('') }
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#media_type' do
|
44
|
+
let(:root) { Raml::Root.new }
|
45
|
+
before { root.media_type = 'application/json' }
|
46
|
+
subject { root.media_type }
|
47
|
+
it { is_expected.to eq('application/json') }
|
48
|
+
end
|
36
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raml-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Brennan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|