diff --git a/README.md b/README.md index cecdca6..9fc5d7d 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,61 @@ # SimpleCov::Formatter::Inline -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/simplecov/inline`. To experiment with that code, run `bin/console` for an interactive prompt. +A SimpleCov formatter that outputs missing line and branch coverage inline. -TODO: Delete this and the text above, and describe your gem +Can be configured to filter to certain files and skip output as needed. + +Comes with a rails+rspec integration that: + +* filters to only the rspec file and the file of the module being tested. +* skips output if any examples fail +* skips output if no examples were run +* skips output if not all examples within a spec file are run ## Installation Install the gem and add to the application's Gemfile by executing: - $ bundle add simplecov-inline + $ bundle add simplecov-inline --github="appbot/simplecov-inline" + +## Usage -If bundler is not being used to manage dependencies, install the gem by executing: +### Plug the formatter in - $ gem install simplecov-inline +``` ruby +SimpleCov.formatter = SimpleCov::Formatter::Inline +``` -## Usage +### Configure rails and rspec + +``` ruby +SimpleCov::Inline::Integration.configure_rspec_rails +``` -TODO: Write usage instructions here +### Manually Filter Files + +If you are not using rspec and rails you can manually filter to a set of files. + +``` ruby +SimpleCov::Formatter::Inline.config do |config| + config.files = ['/path/to/your/file.rb'] +end +``` + +### Manually Supress Output + +If you are not using rspec and rails you can turn off the formatter with a reason. + +``` ruby +SimpleCov::Formatter::Inline.config do |config| + config.no_output!(reason: 'your reason here') +end +``` ## Development -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +After checking out the repo, run `rake` to run the tests and rubocop. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +If would like to use docker, you can run `docker/rake` to save yourself having to install ruby locally. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).