raml-rb 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c44a61b3f805693e8bc4994c6771ca252c61a09
4
- data.tar.gz: 7200d3ec09326ea04ce66a7fe6b9fbe7a3ba7d86
3
+ metadata.gz: 6b89803dbf18a158ddc7f781c03b1b5b8b266f89
4
+ data.tar.gz: 3f97e128ffddc9f7f6db4cad8b741115619876ea
5
5
  SHA512:
6
- metadata.gz: 321e25ebe08ddd874f3f0609e2e5cf1dccc8ad040c637e8d23c436ccecb6777e91dd442c73f890111512f31bdf5b9dc79bb10ece296a8057411136fb9f0158ac
7
- data.tar.gz: 1d85ab83f1914cf92abca3226edfa1dbdc9442571823b551f220355a7175f32338212d5fe46a7d4bc34f6c40c5cd29c5f2d92e1640247c78d7f84bafb2b75a76
6
+ metadata.gz: 1f55464b58630ad4e0e50bbfcdf7ed2b4cce179eb29b8a7a87d7b373dc174dac0398227ef16b48027b31bfa78852f65d20bd88816688fa8e2ad7476ff55371b7
7
+ data.tar.gz: 1c796472b8a9cbe85c1442d6662e36d9ed4809c38c3619e80637577865cbcd5244ae5c75f3fe3c02fef49621f49341ee13870c2045ad41f7fb8b0905b3bbf443
data/.travis.yml CHANGED
@@ -5,4 +5,7 @@ rvm:
5
5
  - 2.1.8
6
6
  - 2.2.0
7
7
  - 2.3.0
8
+ branches:
9
+ only:
10
+ - master
8
11
 
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # raml-rb
2
2
 
3
- [![Build Status](https://travis-ci.org/jpb/raml-rb.svg?branch=master)](https://travis-ci.org/jpb/raml-rb) [![Coverage Status](https://coveralls.io/repos/github/jpb/raml-rb/badge.svg?branch=master)](https://coveralls.io/github/jpb/raml-rb?branch=master)
3
+ [![Gem Version](https://badge.fury.io/rb/raml-rb.svg)](https://badge.fury.io/rb/raml-rb) [![Build Status](https://travis-ci.org/jpb/raml-rb.svg?branch=master)](https://travis-ci.org/jpb/raml-rb) [![Coverage Status](https://coveralls.io/repos/github/jpb/raml-rb/badge.svg?branch=master)](https://coveralls.io/github/jpb/raml-rb?branch=master) [![Code Climate](https://codeclimate.com/github/jpb/raml-rb/badges/gpa.svg)](https://codeclimate.com/github/jpb/raml-rb)
4
4
 
5
5
  A RAML parser, implemented in Ruby.
6
6
 
7
- [![Code Climate](https://codeclimate.com/github/jpb/raml-rb/badges/gpa.svg)](https://codeclimate.com/github/jpb/raml-rb)
8
-
9
7
  ## Installation
10
8
 
11
9
  ```
@@ -9,7 +9,7 @@ module Raml
9
9
  class Root
10
10
  include Raml::Parser::Util
11
11
 
12
- BASIC_ATTRIBUTES = %w[title base_uri version]
12
+ BASIC_ATTRIBUTES = %w[title base_uri version base_uri_parameters media_type]
13
13
 
14
14
  attr_accessor :root, :traits, :resource_types, :attributes
15
15
 
data/lib/raml/root.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  module Raml
2
2
  class Root
3
- attr_accessor :title, :base_uri, :version, :resources, :documentation
3
+ attr_accessor :title, :base_uri, :version, :resources, :documentation,
4
+ :base_uri_parameters, :media_type
4
5
 
5
6
  def initialize
6
7
  @resources = []
data/lib/raml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Raml
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -1,8 +1,13 @@
1
1
  #%RAML 0.8
2
2
 
3
3
  title: World Music API
4
- baseUri: http://example.api.com/{version}
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: |
@@ -1,8 +1,13 @@
1
1
  #%RAML 0.8
2
2
 
3
3
  title: World Music API
4
- baseUri: http://example.api.com/{version}
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://example.api.com/{version}' }
12
- its(:uri) { should == 'http://example.api.com/v1' }
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 }
@@ -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.5
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-04-13 00:00:00.000000000 Z
11
+ date: 2016-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler