raml_parser 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +39 -0
  8. data/Rakefile +7 -0
  9. data/lib/raml_parser.rb +270 -0
  10. data/lib/raml_parser/model.rb +146 -0
  11. data/lib/raml_parser/version.rb +3 -0
  12. data/lib/raml_parser/yaml_helper.rb +122 -0
  13. data/raml_parser.gemspec +26 -0
  14. data/spec/examples/raml/documentation.raml +11 -0
  15. data/spec/examples/raml/external/box.raml +8473 -0
  16. data/spec/examples/raml/external/bug.raml +12 -0
  17. data/spec/examples/raml/external/github.raml +21650 -0
  18. data/spec/examples/raml/external/groups_and_nesting.raml +22 -0
  19. data/spec/examples/raml/external/instagram.yml +3369 -0
  20. data/spec/examples/raml/external/json_schema.json +18 -0
  21. data/spec/examples/raml/external/jukebox-api.raml +191 -0
  22. data/spec/examples/raml/external/jukebox-include-album-new.sample +8 -0
  23. data/spec/examples/raml/external/jukebox-include-album-retrieve.sample +30 -0
  24. data/spec/examples/raml/external/jukebox-include-album-songs.sample +14 -0
  25. data/spec/examples/raml/external/jukebox-include-album.schema +36 -0
  26. data/spec/examples/raml/external/jukebox-include-albums.sample +32 -0
  27. data/spec/examples/raml/external/jukebox-include-artist-albums.sample +42 -0
  28. data/spec/examples/raml/external/jukebox-include-artist-new.sample +5 -0
  29. data/spec/examples/raml/external/jukebox-include-artist-retrieve.sample +52 -0
  30. data/spec/examples/raml/external/jukebox-include-artist.schema +20 -0
  31. data/spec/examples/raml/external/jukebox-include-artists.sample +32 -0
  32. data/spec/examples/raml/external/jukebox-include-song-new.sample +5 -0
  33. data/spec/examples/raml/external/jukebox-include-song-retrieve.sample +15 -0
  34. data/spec/examples/raml/external/jukebox-include-song.schema +24 -0
  35. data/spec/examples/raml/external/jukebox-include-songs.sample +14 -0
  36. data/spec/examples/raml/external/linkedin-v1-single.yml +2671 -0
  37. data/spec/examples/raml/external/mule_sales_enablement.raml +148 -0
  38. data/spec/examples/raml/external/multiple-methods.raml +11 -0
  39. data/spec/examples/raml/external/named_parameters.raml +85 -0
  40. data/spec/examples/raml/external/requests-responses.raml +47 -0
  41. data/spec/examples/raml/external/resource_summary_spacing.raml +42 -0
  42. data/spec/examples/raml/external/simple.raml +233 -0
  43. data/spec/examples/raml/external/stripe.raml +12226 -0
  44. data/spec/examples/raml/external/test.raml +11 -0
  45. data/spec/examples/raml/external/twitter.raml +34284 -0
  46. data/spec/examples/raml/external/xml_example.xml +25 -0
  47. data/spec/examples/raml/external/xml_schema.xsd +50 -0
  48. data/spec/examples/raml/formparameters.raml +23 -0
  49. data/spec/examples/raml/headers.raml +15 -0
  50. data/spec/examples/raml/issue2.raml +51 -0
  51. data/spec/examples/raml/methods.raml +9 -0
  52. data/spec/examples/raml/parameters.raml +21 -0
  53. data/spec/examples/raml/parametersinflection.raml +21 -0
  54. data/spec/examples/raml/queryparameters.raml +14 -0
  55. data/spec/examples/raml/requestbodies.raml +21 -0
  56. data/spec/examples/raml/resources.raml +15 -0
  57. data/spec/examples/raml/resourcetypes.raml +16 -0
  58. data/spec/examples/raml/responses.raml +25 -0
  59. data/spec/examples/raml/securedby1.raml +20 -0
  60. data/spec/examples/raml/securedby2.raml +21 -0
  61. data/spec/examples/raml/securityschemes.raml +47 -0
  62. data/spec/examples/raml/simple.raml +6 -0
  63. data/spec/examples/raml/traits.raml +34 -0
  64. data/spec/examples/raml/uriparameters.raml +16 -0
  65. data/spec/examples/yaml/include1.yml +2 -0
  66. data/spec/examples/yaml/include2.yml +1 -0
  67. data/spec/examples/yaml/simple.yml +2 -0
  68. data/spec/examples/yaml/traversing.yml +11 -0
  69. data/spec/lib/raml_parser/yaml_parser_spec.rb +38 -0
  70. data/spec/lib/raml_parser_spec.rb +196 -0
  71. data/spec/spec_helper.rb +91 -0
  72. metadata +229 -0
@@ -0,0 +1,16 @@
1
+ #%RAML 0.8
2
+ ---
3
+ title: Example API
4
+ baseUri: http://localhost:3000
5
+ /a:
6
+ /b/{first}:
7
+ /{second}:
8
+ uriParameters:
9
+ second:
10
+ displayName: This is the second uri parameter
11
+ type: integer
12
+ /c/{third}:
13
+ uriParameters:
14
+ third:
15
+ displayName: This is the third uri parameter
16
+
@@ -0,0 +1,2 @@
1
+ foo: bar
2
+ inner: !include include2.yml
@@ -0,0 +1 @@
1
+ apple: pie
@@ -0,0 +1,2 @@
1
+ foo: bar
2
+ empty:
@@ -0,0 +1,11 @@
1
+ string: 'foobar'
2
+ integer: 10
3
+ hash:
4
+ apple: pie
5
+ array:
6
+ - foo
7
+ - bar
8
+ array_complex:
9
+ - foo:
10
+ - bar:
11
+ sub: 'element'
@@ -0,0 +1,38 @@
1
+ require 'raml_parser/yaml_helper'
2
+
3
+ RSpec.describe RamlParser::YamlHelper do
4
+ it 'reads simple YAML file' do
5
+ yml = RamlParser::YamlHelper.read_yaml('spec/examples/yaml/simple.yml')
6
+ expect(yml['foo']).to eq 'bar'
7
+ end
8
+
9
+ it 'works with include tags' do
10
+ yml = RamlParser::YamlHelper.read_yaml('spec/examples/yaml/include1.yml')
11
+ expect(yml['foo']).to eq 'bar'
12
+ expect(yml['inner']['apple']).to eq 'pie'
13
+ end
14
+ end
15
+
16
+ RSpec.describe RamlParser::YamlNode do
17
+ it 'has a working array/array_map method' do
18
+ yml = RamlParser::YamlHelper.read_yaml('spec/examples/yaml/traversing.yml')
19
+ root = RamlParser::YamlNode.new(nil, 'root', yml)
20
+ expect(root.hash('array').array(0).value).to eq 'foo'
21
+ expect(root.hash('array').array_map { |n| n.key }).to eq ['[0]', '[1]']
22
+ end
23
+
24
+ it 'has a working hash/hash_map method' do
25
+ yml = RamlParser::YamlHelper.read_yaml('spec/examples/yaml/traversing.yml')
26
+ root = RamlParser::YamlNode.new(nil, 'root', yml)
27
+ expect(root.hash('integer').value).to eq 10
28
+ expect(root.hash_map { |n| 0 }).to eq ({'string'=>0, 'integer'=>0, 'hash'=>0, 'array'=>0, 'array_complex'=>0})
29
+ end
30
+
31
+ it 'has a working arrayhash/arrayhash_map method' do
32
+ yml = RamlParser::YamlHelper.read_yaml('spec/examples/yaml/traversing.yml')
33
+ root = RamlParser::YamlNode.new(nil, 'root', yml)
34
+ expect(root.hash('array_complex').arrayhash(0).key).to eq 'foo'
35
+ expect(root.hash('array_complex').arrayhash(0).value).to eq nil
36
+ expect(root.hash('array_complex').arrayhash_map { |n| n.value }).to eq ({'foo'=>nil, 'bar'=>{'sub'=>'element'}})
37
+ end
38
+ end
@@ -0,0 +1,196 @@
1
+ require 'raml_parser'
2
+
3
+ RSpec.describe RamlParser::Parser do
4
+ it 'finds all resources' do
5
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/resources.raml')
6
+ expect(raml.resources.map { |r| r.absolute_uri }).to eq [
7
+ 'http://localhost:3000/first',
8
+ 'http://localhost:3000/first/second',
9
+ 'http://localhost:3000/third',
10
+ 'http://localhost:3000/with',
11
+ 'http://localhost:3000/with/{uri}',
12
+ 'http://localhost:3000/with/{uri}/{params}'
13
+ ]
14
+ end
15
+
16
+ it 'parses basic globals' do
17
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/simple.raml')
18
+ expect(raml.title).to eq 'Example API'
19
+ expect(raml.base_uri).to eq 'http://localhost:3000'
20
+ expect(raml.version).to eq 'v123'
21
+ expect(raml.media_type).to eq 'application/json'
22
+ end
23
+
24
+ it 'parses URI parameters' do
25
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/uriparameters.raml')
26
+ expect(raml.resources[0].uri_parameters.map { |_,param| param.name }).to eq []
27
+ expect(raml.resources[1].uri_parameters.map { |_,param| param.name }).to eq ['first']
28
+ expect(raml.resources[2].uri_parameters.map { |_,param| param.name }).to eq ['second', 'first']
29
+ expect(raml.resources[3].uri_parameters.map { |_,param| param.name }).to eq ['third']
30
+ expect(raml.resources[2].uri_parameters['first'].display_name).to eq 'first'
31
+ expect(raml.resources[2].uri_parameters['first'].type).to eq 'string'
32
+ expect(raml.resources[2].uri_parameters['second'].display_name).to eq 'This is the second uri parameter'
33
+ expect(raml.resources[2].uri_parameters['second'].type).to eq 'integer'
34
+ end
35
+
36
+ it 'parses query parameters' do
37
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/queryparameters.raml')
38
+ expect(raml.resources[0].methods['get'].query_parameters.map { |name,_| name }).to eq ['q1']
39
+ expect(raml.resources[0].methods['get'].query_parameters.map { |_,param| param.name }).to eq ['q1']
40
+ expect(raml.resources[1].methods['get'].query_parameters.map { |name,_| name }).to eq ['q2']
41
+ expect(raml.resources[1].methods['get'].query_parameters.map { |_,param| param.name }).to eq ['q2']
42
+ expect(raml.resources[0].methods['get'].query_parameters['q1'].display_name).to eq 'q1'
43
+ expect(raml.resources[0].methods['get'].query_parameters['q1'].type).to eq 'string'
44
+ expect(raml.resources[1].methods['get'].query_parameters['q2'].display_name).to eq 'This is the second query parameter'
45
+ expect(raml.resources[1].methods['get'].query_parameters['q2'].type).to eq 'integer'
46
+ end
47
+
48
+ it 'parses methods' do
49
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/methods.raml')
50
+ expect(raml.resources[0].methods['get'].method).to eq 'GET'
51
+ expect(raml.resources[0].methods['get'].display_name).to eq 'GET /a'
52
+ expect(raml.resources[1].methods['get'].method).to eq 'GET'
53
+ expect(raml.resources[1].methods['get'].display_name).to eq 'This is /a/b'
54
+ end
55
+
56
+ it 'parses responses' do
57
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/responses.raml')
58
+ expect(raml.resources[0].methods['get'].responses.map { |code,_| code }).to eq [200, 404]
59
+ expect(raml.resources[0].methods['get'].responses.map { |_,res| res.status_code }).to eq [200, 404]
60
+ end
61
+
62
+ it 'parses bodies' do
63
+ raml1 = RamlParser::Parser.parse_file('spec/examples/raml/responses.raml')
64
+ expect(raml1.resources[0].methods['get'].responses[200].bodies.map { |type,_| type }).to eq ['application/json', 'text/xml']
65
+ expect(raml1.resources[0].methods['get'].responses[200].bodies['application/json'].example).to_not eq nil
66
+
67
+ raml2 = RamlParser::Parser.parse_file('spec/examples/raml/requestbodies.raml')
68
+ expect(raml2.resources[0].methods['post'].bodies.map { |type,_| type }).to eq ['application/json', 'text/xml']
69
+ expect(raml2.resources[0].methods['put'].bodies['application/json'].example).to_not eq nil
70
+ end
71
+
72
+ it 'parses headers' do
73
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/headers.raml')
74
+ expect(raml.resources[0].methods['get'].headers['X-Foobar-Ping'].description).to eq 'Ping'
75
+ expect(raml.resources[0].methods['get'].responses[200].headers['X-Foobar-Pong'].description).to eq 'Pong'
76
+ end
77
+
78
+ it 'parses form parameters' do
79
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/formparameters.raml')
80
+ expect(raml.resources[0].methods['post'].bodies['application/x-www-form-urlencoded'].form_parameters['from'].description).to eq 'FROM1'
81
+ expect(raml.resources[0].methods['post'].bodies['application/x-www-form-urlencoded'].form_parameters['to'].description).to eq 'TO1'
82
+ expect(raml.resources[1].methods['post'].bodies['multipart/form-data'].form_parameters['from'].description).to eq 'FROM2'
83
+ expect(raml.resources[1].methods['post'].bodies['multipart/form-data'].form_parameters['to'].description).to eq 'TO2'
84
+ end
85
+
86
+ it 'parses security schemes' do
87
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/securityschemes.raml')
88
+ expect(raml.security_schemes.keys).to eq ['oauth_2_0', 'oauth_1_0', 'customHeader']
89
+ expect(raml.security_schemes['oauth_2_0'].type).to eq 'OAuth 2.0'
90
+ expect(raml.security_schemes['oauth_1_0'].type).to eq 'OAuth 1.0'
91
+ expect(raml.security_schemes['customHeader'].type).to eq nil
92
+ end
93
+
94
+ it 'parses documentation' do
95
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/documentation.raml')
96
+ expect(raml.documentation[0].title).to eq 'Home'
97
+ expect(raml.documentation[1].title).to eq 'FAQ'
98
+ end
99
+
100
+ it 'handle secured by' do
101
+ raml1 = RamlParser::Parser.parse_file('spec/examples/raml/securedby1.raml')
102
+ expect(raml1.resources[0].methods['get'].secured_by).to eq ['oauth_1_0']
103
+ expect(raml1.resources[0].methods['post'].secured_by).to eq ['oauth_2_0']
104
+ expect(raml1.resources[1].methods['get'].secured_by).to eq ['oauth_1_0', nil, 'oauth_2_0']
105
+ expect(raml1.resources[1].methods['post'].secured_by).to eq ['oauth_1_0', 'oauth_2_0']
106
+
107
+ raml2 = RamlParser::Parser.parse_file('spec/examples/raml/securedby2.raml')
108
+ expect(raml2.resources[0].methods['get'].secured_by).to eq ['oauth_2_0', 'oauth_1_0']
109
+ expect(raml2.resources[0].methods['post'].secured_by).to eq ['oauth_2_0']
110
+ expect(raml2.resources[1].methods['get'].secured_by).to eq ['oauth_2_0', 'oauth_1_0', nil]
111
+ expect(raml2.resources[1].methods['post'].secured_by).to eq ['oauth_2_0', 'oauth_1_0']
112
+ end
113
+
114
+ it 'mixes in traits' do
115
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/traits.raml')
116
+ expect(raml.resources[0].methods['get'].query_parameters.map { |name,_| name }).to eq ['q', 'key', 'order']
117
+ expect(raml.resources[0].methods['get'].display_name).to eq 'Foo'
118
+ expect(raml.resources[0].methods['get'].description).to eq 'This is sortable'
119
+ expect(raml.resources[1].methods['get'].query_parameters.map { |name,_| name }).to eq ['q', 'key', 'order', 'sort']
120
+ expect(raml.resources[1].methods['get'].display_name).to eq '/a/b'
121
+ expect(raml.resources[1].methods['get'].description).to eq 'This is resource /a/b'
122
+ expect(raml.resources[2].methods['get'].query_parameters.map { |name,_| name }).to eq ['key', 'order']
123
+ expect(raml.resources[3].methods['get'].query_parameters.map { |name,_| name }).to eq ['key', 'order', 'q']
124
+ end
125
+
126
+ it 'mixes in resource types' do
127
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/resourcetypes.raml')
128
+ expect(raml.resources[0].methods.keys).to eq ['get', 'post', 'put']
129
+ expect(raml.resources[0].methods['get'].description).to eq 'Get all items'
130
+ expect(raml.resources[0].methods['post'].description).to eq 'Overriden'
131
+ expect(raml.resources[0].methods['put'].description).to eq nil
132
+ end
133
+
134
+ it 'falls back to default display name' do
135
+ raml1 = RamlParser::Parser.parse_file('spec/examples/raml/resources.raml')
136
+ expect(raml1.resources[1].display_name).to eq '/first/second'
137
+ expect(raml1.resources[2].display_name).to eq 'This is the third'
138
+
139
+ raml2 = RamlParser::Parser.parse_file('spec/examples/raml/resources.raml')
140
+ expect(raml2.resources[5].uri_parameters['uri'].display_name).to eq 'uri'
141
+ expect(raml2.resources[5].uri_parameters['params'].display_name).to eq 'This are the params'
142
+
143
+ raml3 = RamlParser::Parser.parse_file('spec/examples/raml/queryparameters.raml')
144
+ expect(raml3.resources[0].methods['get'].query_parameters['q1'].display_name).to eq 'q1'
145
+ expect(raml3.resources[1].methods['get'].query_parameters['q2'].display_name).to eq 'This is the second query parameter'
146
+
147
+ raml4 = RamlParser::Parser.parse_file('spec/examples/raml/methods.raml')
148
+ expect(raml4.resources[0].methods['get'].display_name).to eq 'GET /a'
149
+ expect(raml4.resources[1].methods['get'].display_name).to eq 'This is /a/b'
150
+
151
+ raml5 = RamlParser::Parser.parse_file('spec/examples/raml/headers.raml')
152
+ expect(raml5.resources[0].methods['get'].headers['X-Foobar-Ping'].display_name).to eq 'X-Foobar-Ping'
153
+ expect(raml5.resources[0].methods['get'].responses[200].headers['X-Foobar-Pong'].display_name).to eq 'PingPong'
154
+ end
155
+
156
+ it 'fixed issue #2' do
157
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/issue2.raml')
158
+ expect(raml.resources[0].methods.keys).to eq ['post', 'get']
159
+ expect(raml.resources[0].methods['get'].method).to eq 'GET'
160
+ expect(raml.resources[0].methods['post'].method).to eq 'POST'
161
+ end
162
+
163
+ it 'handles parametrization of traits and resource types' do
164
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/parameters.raml')
165
+ expect(raml.resources[0].methods['get'].description).to eq '/first and first and get and Hello'
166
+ expect(raml.resources[0].methods['get'].query_parameters['get'].description).to eq 'Applepie'
167
+ expect(raml.resources[1].description).to eq '/second and second and World'
168
+ expect(raml.resources[3].description).to eq '/third/fourth and fourth and Finish'
169
+ end
170
+
171
+ it 'handles singularization/pluralization of parametrization' do
172
+ raml = RamlParser::Parser.parse_file('spec/examples/raml/parametersinflection.raml')
173
+
174
+ expect(raml.resources[0].methods['get'].description).to eq 'Keep userName'
175
+ expect(raml.resources[0].methods['post'].description).to eq 'Plu userNames'
176
+ expect(raml.resources[1].methods['get'].description).to eq 'Keep passwords'
177
+ expect(raml.resources[1].methods['post'].description).to eq 'Sing password'
178
+ end
179
+
180
+ it 'does not fail on any example RAML file' do
181
+ files = Dir.glob('spec/examples/raml/**/*.raml')
182
+ files.each { |f|
183
+ known_unused = %w()
184
+ known_unsupported = %w(root.schemas .describedBy .someMultipartFormParamWithMultipleTypes)
185
+
186
+ result = RamlParser::Parser.parse_file_with_marks(f)
187
+ unused = result[:marks].select { |_,m| m == :unused }
188
+ unsupported = result[:marks].select { |_,m| m == :unsupported }
189
+ unknown = result[:marks].select { |_,m| not [:used, :unused, :unsupported].include? m }
190
+
191
+ expect(unused.select { |p,_| not known_unused.any? { |k| p.include? k} }).to eq ({})
192
+ expect(unsupported.select { |p,_| not known_unsupported.any? { |k| p.include? k} }).to eq ({})
193
+ expect(unknown).to eq ({})
194
+ }
195
+ end
196
+ end
@@ -0,0 +1,91 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Limits the available syntax to the non-monkey patched syntax that is
54
+ # recommended. For more details, see:
55
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
56
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
57
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
58
+ config.disable_monkey_patching!
59
+
60
+ # This setting enables warnings. It's recommended, but in some cases may
61
+ # be too noisy due to issues in dependencies.
62
+ config.warnings = true
63
+
64
+ # Many RSpec users commonly either run the entire suite or an individual
65
+ # file, and it's useful to allow more verbose output when running an
66
+ # individual spec file.
67
+ if config.files_to_run.one?
68
+ # Use the documentation formatter for detailed output,
69
+ # unless a formatter has already been configured
70
+ # (e.g. via a command-line flag).
71
+ config.default_formatter = 'doc'
72
+ end
73
+
74
+ # Print the 10 slowest examples and example groups at the
75
+ # end of the spec run, to help surface which specs are running
76
+ # particularly slow.
77
+ config.profile_examples = 10
78
+
79
+ # Run specs in random order to surface order dependencies. If you find an
80
+ # order dependency and want to debug it, you can fix the order by providing
81
+ # the seed, which is printed after each run.
82
+ # --seed 1234
83
+ config.order = :random
84
+
85
+ # Seed global randomization in this process using the `--seed` CLI option.
86
+ # Setting this allows you to use `--seed` to deterministically reproduce
87
+ # test failures related to randomization by passing the same `--seed` value
88
+ # as the one that triggered the failure.
89
+ Kernel.srand config.seed
90
+ =end
91
+ end
metadata ADDED
@@ -0,0 +1,229 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raml_parser
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Christian Hoffmeister
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 4.0.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 4.0.0
69
+ description: ''
70
+ email:
71
+ - mail@choffmeister.de
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - .travis.yml
79
+ - Gemfile
80
+ - Gemfile.lock
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - lib/raml_parser.rb
85
+ - lib/raml_parser/model.rb
86
+ - lib/raml_parser/version.rb
87
+ - lib/raml_parser/yaml_helper.rb
88
+ - raml_parser.gemspec
89
+ - spec/examples/raml/documentation.raml
90
+ - spec/examples/raml/external/box.raml
91
+ - spec/examples/raml/external/bug.raml
92
+ - spec/examples/raml/external/github.raml
93
+ - spec/examples/raml/external/groups_and_nesting.raml
94
+ - spec/examples/raml/external/instagram.yml
95
+ - spec/examples/raml/external/json_schema.json
96
+ - spec/examples/raml/external/jukebox-api.raml
97
+ - spec/examples/raml/external/jukebox-include-album-new.sample
98
+ - spec/examples/raml/external/jukebox-include-album-retrieve.sample
99
+ - spec/examples/raml/external/jukebox-include-album-songs.sample
100
+ - spec/examples/raml/external/jukebox-include-album.schema
101
+ - spec/examples/raml/external/jukebox-include-albums.sample
102
+ - spec/examples/raml/external/jukebox-include-artist-albums.sample
103
+ - spec/examples/raml/external/jukebox-include-artist-new.sample
104
+ - spec/examples/raml/external/jukebox-include-artist-retrieve.sample
105
+ - spec/examples/raml/external/jukebox-include-artist.schema
106
+ - spec/examples/raml/external/jukebox-include-artists.sample
107
+ - spec/examples/raml/external/jukebox-include-song-new.sample
108
+ - spec/examples/raml/external/jukebox-include-song-retrieve.sample
109
+ - spec/examples/raml/external/jukebox-include-song.schema
110
+ - spec/examples/raml/external/jukebox-include-songs.sample
111
+ - spec/examples/raml/external/linkedin-v1-single.yml
112
+ - spec/examples/raml/external/mule_sales_enablement.raml
113
+ - spec/examples/raml/external/multiple-methods.raml
114
+ - spec/examples/raml/external/named_parameters.raml
115
+ - spec/examples/raml/external/requests-responses.raml
116
+ - spec/examples/raml/external/resource_summary_spacing.raml
117
+ - spec/examples/raml/external/simple.raml
118
+ - spec/examples/raml/external/stripe.raml
119
+ - spec/examples/raml/external/test.raml
120
+ - spec/examples/raml/external/twitter.raml
121
+ - spec/examples/raml/external/xml_example.xml
122
+ - spec/examples/raml/external/xml_schema.xsd
123
+ - spec/examples/raml/formparameters.raml
124
+ - spec/examples/raml/headers.raml
125
+ - spec/examples/raml/issue2.raml
126
+ - spec/examples/raml/methods.raml
127
+ - spec/examples/raml/parameters.raml
128
+ - spec/examples/raml/parametersinflection.raml
129
+ - spec/examples/raml/queryparameters.raml
130
+ - spec/examples/raml/requestbodies.raml
131
+ - spec/examples/raml/resources.raml
132
+ - spec/examples/raml/resourcetypes.raml
133
+ - spec/examples/raml/responses.raml
134
+ - spec/examples/raml/securedby1.raml
135
+ - spec/examples/raml/securedby2.raml
136
+ - spec/examples/raml/securityschemes.raml
137
+ - spec/examples/raml/simple.raml
138
+ - spec/examples/raml/traits.raml
139
+ - spec/examples/raml/uriparameters.raml
140
+ - spec/examples/yaml/include1.yml
141
+ - spec/examples/yaml/include2.yml
142
+ - spec/examples/yaml/simple.yml
143
+ - spec/examples/yaml/traversing.yml
144
+ - spec/lib/raml_parser/yaml_parser_spec.rb
145
+ - spec/lib/raml_parser_spec.rb
146
+ - spec/spec_helper.rb
147
+ homepage: https://github.com/ePages-de/raml_parser
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 2.0.14
168
+ signing_key:
169
+ specification_version: 4
170
+ summary: A parser for the RAML API modeling language.
171
+ test_files:
172
+ - spec/examples/raml/documentation.raml
173
+ - spec/examples/raml/external/box.raml
174
+ - spec/examples/raml/external/bug.raml
175
+ - spec/examples/raml/external/github.raml
176
+ - spec/examples/raml/external/groups_and_nesting.raml
177
+ - spec/examples/raml/external/instagram.yml
178
+ - spec/examples/raml/external/json_schema.json
179
+ - spec/examples/raml/external/jukebox-api.raml
180
+ - spec/examples/raml/external/jukebox-include-album-new.sample
181
+ - spec/examples/raml/external/jukebox-include-album-retrieve.sample
182
+ - spec/examples/raml/external/jukebox-include-album-songs.sample
183
+ - spec/examples/raml/external/jukebox-include-album.schema
184
+ - spec/examples/raml/external/jukebox-include-albums.sample
185
+ - spec/examples/raml/external/jukebox-include-artist-albums.sample
186
+ - spec/examples/raml/external/jukebox-include-artist-new.sample
187
+ - spec/examples/raml/external/jukebox-include-artist-retrieve.sample
188
+ - spec/examples/raml/external/jukebox-include-artist.schema
189
+ - spec/examples/raml/external/jukebox-include-artists.sample
190
+ - spec/examples/raml/external/jukebox-include-song-new.sample
191
+ - spec/examples/raml/external/jukebox-include-song-retrieve.sample
192
+ - spec/examples/raml/external/jukebox-include-song.schema
193
+ - spec/examples/raml/external/jukebox-include-songs.sample
194
+ - spec/examples/raml/external/linkedin-v1-single.yml
195
+ - spec/examples/raml/external/mule_sales_enablement.raml
196
+ - spec/examples/raml/external/multiple-methods.raml
197
+ - spec/examples/raml/external/named_parameters.raml
198
+ - spec/examples/raml/external/requests-responses.raml
199
+ - spec/examples/raml/external/resource_summary_spacing.raml
200
+ - spec/examples/raml/external/simple.raml
201
+ - spec/examples/raml/external/stripe.raml
202
+ - spec/examples/raml/external/test.raml
203
+ - spec/examples/raml/external/twitter.raml
204
+ - spec/examples/raml/external/xml_example.xml
205
+ - spec/examples/raml/external/xml_schema.xsd
206
+ - spec/examples/raml/formparameters.raml
207
+ - spec/examples/raml/headers.raml
208
+ - spec/examples/raml/issue2.raml
209
+ - spec/examples/raml/methods.raml
210
+ - spec/examples/raml/parameters.raml
211
+ - spec/examples/raml/parametersinflection.raml
212
+ - spec/examples/raml/queryparameters.raml
213
+ - spec/examples/raml/requestbodies.raml
214
+ - spec/examples/raml/resources.raml
215
+ - spec/examples/raml/resourcetypes.raml
216
+ - spec/examples/raml/responses.raml
217
+ - spec/examples/raml/securedby1.raml
218
+ - spec/examples/raml/securedby2.raml
219
+ - spec/examples/raml/securityschemes.raml
220
+ - spec/examples/raml/simple.raml
221
+ - spec/examples/raml/traits.raml
222
+ - spec/examples/raml/uriparameters.raml
223
+ - spec/examples/yaml/include1.yml
224
+ - spec/examples/yaml/include2.yml
225
+ - spec/examples/yaml/simple.yml
226
+ - spec/examples/yaml/traversing.yml
227
+ - spec/lib/raml_parser/yaml_parser_spec.rb
228
+ - spec/lib/raml_parser_spec.rb
229
+ - spec/spec_helper.rb