A parser for the RAML API modeling language.
Add this line to your application's Gemfile:
source 'https://rubygems.org'
gem 'raml_parser'
or for bleeding edge:
gem 'raml_parser', :git => 'https://github.com/ePages-de/raml_parser.git', :branch => 'develop'
And then execute:
$ bundle
require 'raml_parser'
raml = RamlParser::Parser.parse_file('path/to/api.raml')
# generate some markdown out of it
for res in raml.resources
puts '# Resource ' + res.absolute_uri + "\n\n"
for name, meth in res.methods
puts '## Method ' + meth.method + "\n\n"
unless meth.description.nil?
puts meth.description + "\n\n"
else
puts "(TODO)\n\n"
end
end
end
These are features of the RAML 0.8 specification that are not fully handled yet. This list should be complete, i.e. everything not listed here should work.
- Fork it ( https://github.com/ePages-de/raml_parser/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request