RubyCriticSmallBadge

Gem Version Build Status Depfu Coverage RubyCritic

RubyCriticCovBadge is a gem that can be added to the Gemfile and will produce a file called rubycritic_badge_score.svg in the badges directory. It could be looking as follows dependent on how it is configured.

Coverage

The idea is to created a badge for RubyCritic to create a persistable image that shows the score as a badge.

Installation

The badge creation is dependent on the RepoSmallBadge gem. It can be installed in your Ruby library or rails app as part of the Gemfile as follows.

# In your gemfile
gem 'rubycritic-small-badge', :require => false

This gem is an alternative and inspired by the great work in the other gem simplecov-badge which does a similar badge but looks different and cannot easily made small. So it's mostly an optical alternative.

Usage

Whereever you are integrating Rubycritic you can have to integrate as a Raketask. The default integration could looks as follows:

require 'rubycritic_small_badge'
require 'rubycritic/rake_task'
RubyCriticSmallBadge.configure do |config|
  config.minimum_score = 90
end
RubyCritic::RakeTask.new do |task|
  task.options = %(--formatter RubyCriticSmallBadge::Report
--minimum-score #{RubyCriticSmallBadge.config.minimum_score})
end

Integration into Travis-CI via github-pages

This process is split into two steps.

  1. You need to create an access token for you github repository that can be configured to travis to allow password-less pushing. This is described in Github Help - Authenticating to GitHub / Creating a personal access token for the command line

  2. Configure travis to push the result to github-pages inspired from the Travis description and configuration to be found in .travis.yml

  3. Integrate your badge into the README.md as follows ![Coverage](https://marcgrimme.github.io/simplecov-small-badge/badges/coverage_badge_total.png)

Configuration Options

The behaviour of RubyCriticmallBadge can be influenced by configuration options as defined in the configuration class.

Development

After checking out the repo, run bundle update to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

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 to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/marcgrimme/rubycritic-small-badge/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request