browser 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0373ece943efe30b86eea58744eaa628c2a682c9
4
- data.tar.gz: 29276aa59fd5d2a8f7ef066fcd14ed911d8bbea2
3
+ metadata.gz: 1376f80279d81e3c05481520af650c371bf08fb4
4
+ data.tar.gz: 0e395d31bdfe73b696b4b6a414946d93efca202d
5
5
  SHA512:
6
- metadata.gz: 470c3d3f2e2f521adf0734c6f4e9ee28da7ff29ceb946d0d513c0c818eab4d04b6c85758078d246b5a9c9d47923f6d71fc60e96a797d329b0e6edacf99ddd5a4
7
- data.tar.gz: 48bf2e3967f5304d090c017b74732eba63fcc1e5bbd4796e7a1ede411f38f0d315e64d700f923fe2040374b8ea731f666ee692e1db50ba3b3c35980c629382c1
6
+ metadata.gz: 128e49d7d296d6bdd2fa6ab3ea250637dd3b570d4feb9585c8632b6a41c71e8e411e179d24354e228b5584842dbd685a4a9a75510f05831e2bbf6ca773c376d6
7
+ data.tar.gz: ce47534aba74621bc089c9d30f6aaf7611cf996ed4cfef04570eb2582c84e3e99bd7b0129dae9a928fe01f704227392f3a482c1bff27dcfa17b9fe09bf5fd19d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- browser (0.3.1)
4
+ browser (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- browser (0.3.1)
4
+ browser (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,6 +2,9 @@ require "uri"
2
2
 
3
3
  class Browser
4
4
  class Middleware
5
+ # Detect the most common assets.
6
+ ASSETS_REGEX = %r[\.(css|png|jpe?g|gif|js|svg|ico|flv|mov|m4v|ogg|swf)\z]i
7
+
5
8
  def initialize(app, &block)
6
9
  raise ArgumentError, "Browser::Middleware requires a block" unless block
7
10
 
@@ -46,6 +49,7 @@ class Browser
46
49
  end
47
50
 
48
51
  def html?(request)
52
+ return if request.path.match(ASSETS_REGEX)
49
53
  request.env["HTTP_ACCEPT"].to_s.include?("text/html")
50
54
  end
51
55
  end
@@ -2,7 +2,7 @@ class Browser
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 1
5
+ PATCH = 2
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira