Project

trufflepig

0.0
No commit activity in last 3 years
No release in over 3 years
Detects Web platform feature usage in source files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8.3
 Project Readme

Build Status

Scans files and directories for scrummy truffles. And by truffles, we mean shiny new features of HTML5, JavaScript APIs, CSS3, and friends. Obviously.

Truffle pigs

Usage

gem 'trufflepig', :require => 'trufflepig'

Send the truffle pig on its way:

search = Trufflepig::Search.new "path/to/file/or/directory"
search.perform

Then look what it found:

search.results

The results will consist of an array of feature objects, formatted exactly like the caniuse.com/html5please.com source data, containing a description of the feature as well as browser compatibility tables, and links to more info.

Adding or updating detection patterns

Add or update patterns with the correct caniuse.com key to data/patterns.json by running:

rake featurelist:fetch

The build task will merge that list with the source JSON and create data/features.json which will be used by the search:

rake featurelist:build

For convenience there is also a task that combines the two previous ones:

rake featurelist:update

To do

  • Respect filetypes when scanning for features (e.g. don't look for CSS features in HTML code)
  • Command line interface
  • ...

Contributing

We love pull requests. If you want to submit a patch:

  • Fork the project.
  • Make your feature addition or bug fix.
  • Write specs for it. This is important so nobody breaks it in a future version unintentionally.
  • Push to your fork and send a pull request.

License

This gem is licensed under the MIT license. The feature data is originally from caniuse.com and published under the CC BY-NC 3.0 license.