Project | Ataru |
---|---|
CI | |
Gem Version |
Ataru
Ataru is a gem that provides a command line tool for testing code samples in the documentation files. You can also integrate ataru in your continuous integration process on Travis CI.
Ataru will check if your documentation is still in sync with the application it was written for. The output of the results has the MiniTest style.
What can ataru check
Ataru can read files written in Github Flavoured Markdown, as it uses Kramdown with Github Flavoured Markdown Parser.
Ataru is currently able to test the Ruby code only.
Requirements
The dependencies of your gem have to be in the range of the latest major versions of:
- minitest (~> 5)
- kramdown (~> 1)
- thor (~> 0)
You need to create the setup file (for more info read Setup section).
Usage as command line tool
Add ataru to your project Gemfile.
From the top level of your project execute:
$ bundle install
To create the setup file (for more info read Setup section) execute:
$ bundle exec ataru setup
Finally, execute:
- in case you want to check all the markdown files from your project:
$ bundle exec ataru check
- in case you want to check only specific markdown files from your project:
$ bundle exec ataru check PROJECT_ROOT/foo/bar/filename_1.md PROJECT_ROOT/foo/bar/filename_2.md
Check the results.
Workflow with Travis CI
Add ataru to your project Gemfile.
From the top level of your project execute:
$ bundle install
- To create the setup file (for more info read Setup section) execute:
$ bundle exec ataru setup
In your .travis.yml file add:
- in case you want to check all the markdown files from your project:
script: - bundle exec rake build - bundle exec rake ataru check
- in case you want to check only specific markdown files from your project:
script: - bundle exec rake build - bundle exec ataru check PROJECT_ROOT/foo/bar/filename_1.md PROJECT_ROOT/foo/bar/filename_2.md
Now you can commit and push the changes to github.
Check the results of your build.
Setup
The setup file has to be created in order to enable ataru to read your project source code and use it for its checks. Ataru comes with an easy to use generator for creating that file. When the generator process is finished, the created setup file is automatically passed to ataru.
To create the setup file execute:
$ bundle exec ataru setup
Open created file in your text editor and write:
require "your_project_name"
Save the file.
Contributing
- Fork it ( http://github.com/
/ataru/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 new Pull Request`