trufflepig 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Sebastian Kippe
1
+ Copyright (c) 2012 Appcache Ltd
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,7 +1,53 @@
1
1
  [![Build Status](https://secure.travis-ci.org/5apps/trufflepig.png?branch=master)](http://travis-ci.org/5apps/trufflepig)
2
2
 
3
- Scans files and directories for scrummy truffles. And by truffles, we mean shiny new features of HTML5, JavaScript APIs, CSS3, and friends. Obviously.
3
+ Scans files and directories for scrummy truffles. And by truffles, we mean
4
+ shiny new features of HTML5, JavaScript APIs, CSS3, and friends. Obviously.
5
+
6
+ ![Truffle pigs](http://5apps-assets.s3.amazonaws.com/trufflepig/trufflepig.png)
7
+
8
+ ## Usage
9
+
10
+ ```ruby
11
+ gem 'trufflepig', :require => 'trufflepig'
12
+ ```
13
+
14
+ Send the truffle pig on its way:
15
+
16
+ ```ruby
17
+ search = Trufflepig::Search.new "path/to/file/or/directory"
18
+ search.perform
19
+ ```
20
+
21
+ Then look what it found:
22
+
23
+ ```ruby
24
+ search.results
25
+ ```
26
+
27
+ The results will consist of an array of feature objects, formatted exactly like
28
+ the caniuse.com/html5please.com source data, containing a description of the
29
+ feature as well as browser compatibility tables, and links to more info.
30
+
31
+ ## Adding or updating detection patterns
32
+
33
+ Add or update patterns with the correct caniuse.com key to
34
+ [data/patterns.json](https://github.com/5apps/trufflepig/blob/master/data/patterns.json).
35
+ The build task will merge that list with the source JSON and create
36
+ data/features.json which will be used by the search:
37
+
38
+ ```
39
+ rake featurelist:build
40
+ ```
41
+
42
+ ## To do
43
+
44
+ * Respect filetypes when scanning for features (e.g. don't look for CSS
45
+ features in HTML code)
46
+ * Command line interface
47
+ * ...
4
48
 
5
49
  ## License
6
50
 
7
- This gem is licensed under the MIT license. The feature data is originally from [caniuse.com](http://caniuse.com) and published under the [CC BY-NC 3.0 license](http://creativecommons.org/licenses/by-nc/3.0/).
51
+ This gem is licensed under the MIT license. The feature data is originally from
52
+ [caniuse.com](http://caniuse.com) and published under the [CC BY-NC 3.0
53
+ license](http://creativecommons.org/licenses/by-nc/3.0/).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -2,7 +2,10 @@ module Trufflepig
2
2
  class Search
3
3
  attr_accessor :results, :path
4
4
 
5
- EXCLUDED_FILENAMES = /jquery|prototype|yui|dojo|extjs|raphael|zepto|enyo|ember/
5
+ EXCLUDED_FILENAMES = /#{%w{
6
+ jquery prototype yui dojo extjs raphael zepto enyo ember modernizr
7
+ bootstrap foundation
8
+ }.join('|')}/
6
9
 
7
10
  def initialize(path)
8
11
  @results = []
@@ -34,7 +34,7 @@ describe Trufflepig::Search do
34
34
  end
35
35
  end
36
36
 
37
- describe "a well-known JS lib file" do
37
+ describe "a well-known JS or CSS lib file" do
38
38
  before do
39
39
  @search = Trufflepig::Search.new "#{dummy_app_path}/js/jquery.js"
40
40
  @search.perform
data/trufflepig.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "trufflepig"
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sebastian Kippe", "Garret Alfert"]
12
- s.date = "2012-04-04"
12
+ s.date = "2012-04-05"
13
13
  s.description = "Detects Web platform feature usage in source files"
14
14
  s.email = "rubygems@5apps.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trufflepig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-04 00:00:00.000000000 Z
13
+ date: 2012-04-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: purdytest
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  segments:
110
110
  - 0
111
- hash: 1419909812854099826
111
+ hash: 3974065047902269502
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements: