Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: 5apps/trufflepig
base: df1e8124d1
...
head fork: 5apps/trufflepig
compare: 9863b00e53
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  Rakefile
@@ -14,7 +14,7 @@ require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "trufflepig"
- gem.homepage = "http://github.com/skddc/trufflepig"
+ gem.homepage = "http://github.com/5apps/trufflepig"
gem.license = "MIT"
gem.summary = %Q{Detects Web platform feature usage in source files}
gem.description = %Q{Detects Web platform feature usage in source files}
View
2  data/features.json
1 addition, 1 deletion not shown
View
5 data/patterns.json
@@ -10,13 +10,18 @@
"css-transitions": "transition(-(property|duration|timing-function|delay))?\\:",
"css3-boxsizing": "box-sizing\\:",
"deviceorientation": "deviceorientation|devicemotion|compassneedscalibration",
+ "eventsource": "new EventSource",
"fileapi": "new FileReader",
"fullscreen": "[rR]equestFull[sS]creen|[cC]ancelFullScreen|exitFullscreen|fullscreeneventchange",
"geolocation": "navigator\\.geolocation",
+ "history": "history\\.(back|forward|go|pushState|replaceState)",
"indexeddb": "IndexedDB|IDB(Cursor|Database|Environment|Factory|Index|KeyRange|ObjectStore|OpenDBRequest|Request|Transaction|VersionChangeEvent)",
+ "namevalue-storage": "localStorage|sessionStorage",
"offline-apps": "<html.*\\smanifest=.*>",
+ "progressmeter": "<progress.*>.*<\\/prograss>|<meter.*><\\/meter>",
"requestanimationframe": "(cancel|request)AnimationFrame",
"stream": "getUserMedia",
+ "text-overflow": "text-overflow\\:",
"touch": "touch(start|end|move|cancel)|createTouch(List)?",
"video": "<video.*>.*<\\/video>",
"websockets": "new WebSocket\\s*(.*)",
View
0  spec/trufflepig/feature_list.rb
No changes.
View
34 spec/trufflepig/feature_list_spec.rb
@@ -0,0 +1,34 @@
+require 'helper'
+
+describe Trufflepig::FeatureList do
+ describe "load" do
+ before do
+ @features = Trufflepig::FeatureList.load
+ end
+
+ it "returns a list of features" do
+ @features.keys.must_include "video"
+ @features.keys.must_include "audio"
+ @features.keys.must_include "canvas"
+
+ feature = @features.values_at("video").first
+ feature["categories"].must_equal ["HTML5"]
+ feature["title"].must_equal "Video element"
+ end
+ end
+
+ describe "build" do
+ before do
+ Trufflepig::FeatureList.build
+ @features = Trufflepig::FeatureList.load
+ end
+
+ it "adds detection patterns to the features" do
+ feature = @features.values_at("video").first
+ feature["detection_pattern"].must_equal "<video.*>.*<\\/video>"
+
+ feature = @features.values_at("offline-apps").first
+ feature["detection_pattern"].must_equal "<html.*\\smanifest=.*>"
+ end
+ end
+end

No commit comments for this range

Something went wrong with that request. Please try again.