Project

morecane

0.0
No commit activity in last 3 years
No release in over 3 years
A set of common checks that I use with cane across my projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.5

Runtime

>= 2.1.0
 Project Readme

Morecane¶ ↑

What?¶ ↑

The cane gem provides a great framework for running quality checks over your ruby project as part of continuous integration build. It comes with a few checks out of the box, but also provides an API for loading custom checks.

This gem provides a set of additional checks that I use across my projects. Maybe you’ll find the useful as well.

How?¶ ↑

Install this project like any rubygem:

gem install morecane

Or add it to your Gemfile:

gem 'morecane'

Then create a new rake task and load in the checks you require

require 'cane/rake_task'
require 'morecane'

desc "Run cane to check quality metrics"
Cane::RakeTask.new(:quality) do |cane|
  cane.use Morecane::EncodingCheck, encoding_glob: "{app,lib,spec}/**/*.rb"
end

Checks¶ ↑

Here is a list of the checks available in this gem and the options they take.

Morecane::EncodingCheck¶ ↑

Ensure files have a ruby encoding marker in the first two lines.

  • encoding_glob - a string to specify the files to check. You probably want something list “{app,lib,spec}/*/.rb”

Morecane::MustMatchCheck¶ ↑

Ensure files match a given regular expression.

  • must_match_glob - a string to specify the files to check. You probably want something list “{app,lib}/*/.rb”

  • must_match_regexp - a regular expression to check each file against

Morecane::MustNotMatchCheck¶ ↑

Ensure files do not match a given regular expression.

  • must_not_match_glob - a string to specify the files to check. You probably want something list “{app,lib}/*/.rb”

  • must_not_match_regexp - a regular expression to check each file against

Who?¶ ↑

This gem is written and maintained by James Healy <james@yob.id.au>

More?¶ ↑

For more information on cane, check out it’s comprehensive README

https://github.com/square/cane