Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Check rubygem files for common mistakes and errors

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 gem_lint.gemspec
README.rdoc

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

Something went wrong with that request. Please try again.