Project

gem_lint

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Adds a 'lint' command rubygems that will print a list of possible errors in a gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 2.0
 Project Readme

GemLint¶ ↑

Sanity check your rubygems for common issues. Missing readmes, bundled pkg directories, encoding issues in the gemspec, etc.

Each test is classified as an error or warning. Errors are issues that (by my reading) violate the documented gem specs. Warnings are either best practices recommended by members of the community or arbitrary things that annoy me personally.

Usage¶ ↑

gem install gem-lint
gem lint somefile-0.0.1.gem
gem lint somefile-0.0.1.gem --detailed

API¶ ↑

To check a gem programmatically:

require "gem_lint"

runner = GemLint::Runner.new("widgets-1.0.gem")
puts runner.name
puts runner.version
puts runner.email
puts runner.tags

Status¶ ↑

This a spike. It has few tests and is a proof of concept. Most of it was written at a Railscamp and therefore is probably of suspect quality.

Compatability¶ ↑

Rubygems 1.3.2 or greater is required, otherwise it’s pure ruby should run on most ruby VMs.

Developing¶ ↑

To add new checks, create a new strategy in lib/gem_lint/strategies with a matching spec in spec/strategies.

View other strategies for an idea of the required contract. There are existing specs to ensure all strategies confirm to the contract, so keep the full spec suit (using “rake”) green.

Full source is on github at github.com/yob/gem-lint

Ideas for new checks¶ ↑

  • improved handling of compiled extensions

  • files entry in spec not matching actual files in data

  • contains compiled .o files for wrong arch (check glib2 0.90.6 for example)

Further Reading¶ ↑