trufflepig 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +1 -1
- data/README.md +48 -2
- data/VERSION +1 -1
- data/lib/trufflepig/search.rb +4 -1
- data/spec/trufflepig/search_spec.rb +1 -1
- data/trufflepig.gemspec +2 -2
- metadata +3 -3
data/LICENSE.txt
CHANGED
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
|
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
|
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.
|
1
|
+
0.2.6
|
data/lib/trufflepig/search.rb
CHANGED
@@ -2,7 +2,10 @@ module Trufflepig
|
|
2
2
|
class Search
|
3
3
|
attr_accessor :results, :path
|
4
4
|
|
5
|
-
EXCLUDED_FILENAMES =
|
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 = []
|
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.
|
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-
|
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.
|
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-
|
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:
|
111
|
+
hash: 3974065047902269502
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
none: false
|
114
114
|
requirements:
|