plz_plz_ie 9.0.0 → 9.0.1
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +27 -1
- data/lib/.DS_Store +0 -0
- data/lib/plz_plz_ie/.DS_Store +0 -0
- data/lib/plz_plz_ie/middleware.rb +25 -0
- data/lib/plz_plz_ie/templates/plz_plz_ie.html +71 -0
- data/lib/plz_plz_ie/version.rb +3 -0
- data/lib/plz_plz_ie.rb +2 -0
- data/plz_plz_ie.gemspec +22 -0
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9c0994fe042c0d69e26f9d1939ed91629ef164f
|
4
|
+
data.tar.gz: 38da115bd68a87736c22b4b756da271226d20609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b63a702dce05b16759e68b84e73ff3435dce0be25a802082a7c14ec3ab2c68a28b25321f0bc3e5c9872f51cb471e6705fa79be599c566fde995fee58e886286a
|
7
|
+
data.tar.gz: 9c98b1f79b7fb701eeca078677a198a51b71941d2dc804d93fde3259fd58f0096a6b16b5db1d38dde98bf1966848d0ab971ea93f6ce1b4a947630a7feb828ab1
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,30 @@
|
|
1
1
|
plz_plz_ie
|
2
2
|
==========
|
3
3
|
|
4
|
-
|
4
|
+
Just a middleware,make for fun.Never use to production plz.
|
5
|
+
|
6
|
+
###USAGE
|
7
|
+
Gemfile
|
8
|
+
```
|
9
|
+
gem 'plz_plz_ie'
|
10
|
+
```
|
11
|
+
|
12
|
+
Rails,in `application.rb`:
|
13
|
+
```
|
14
|
+
class Application < Rails::Application
|
15
|
+
...
|
16
|
+
config.middleware.insert_before ActionDispatch::Static,PlzPlzIE::Middleware
|
17
|
+
...
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
###Sinatra & others:
|
22
|
+
```
|
23
|
+
require 'plz_plz_ie/plz_plz_ie'
|
24
|
+
use PlzPlzIE::Middleware
|
25
|
+
```
|
26
|
+
|
27
|
+
###THEN
|
28
|
+
Render http://pokka.github.io/plz_plz_ie/
|
29
|
+
|
30
|
+
####MIT
|
data/lib/.DS_Store
ADDED
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module PlzPlzIE
|
2
|
+
class Middleware
|
3
|
+
IEVR = /(?:MSIE)[\/ ]?([0-9.]+)/i
|
4
|
+
|
5
|
+
def initialize(app,options)
|
6
|
+
@app = app
|
7
|
+
@lastest = options[:lastest] || 9
|
8
|
+
@template = options[:path] || File.expand_path("../templates/plz_plz_ie.html", __FILE__)
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
ua = env['HTTP_USER_AGENT'].to_s
|
13
|
+
if has_seat?(ua)
|
14
|
+
@app.call env
|
15
|
+
else
|
16
|
+
[500,{ "Content-Type" => "text/html; charset=utf-8" },[File.read(@template)]]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
def has_seat? ua
|
22
|
+
!ua.empty? && (ua.match(IEVR).nil? || $1.split('.').first.to_i >= @lastest)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
+
<title>下载改变你生活的现代浏览器</title>
|
6
|
+
<style>
|
7
|
+
h3{font-size:32px;color:gray;}
|
8
|
+
h2{font-size:48px;}
|
9
|
+
h1{font-size:200px;font-weight: bold;}
|
10
|
+
.container { width:100%;zoom:1;margin:0; }
|
11
|
+
div.left { width:80%;float:left;}
|
12
|
+
div.right { height:300px;width:15%;float:right;}
|
13
|
+
.end{width:100%;}
|
14
|
+
div.end-title div{
|
15
|
+
height:25px;width:2%;float:left;
|
16
|
+
}
|
17
|
+
div.end ul { width:100%;display:block;padding:0;margin:0;margin-top:20px; }
|
18
|
+
div.end ul li{ display:block;float:left;padding-left: 20px;margin-left: 10px; }
|
19
|
+
a.browser { font-size:50px;font-weight: bold;color:#ddd;text-decoration: none;line-height: 40px; }
|
20
|
+
a.browser img { height: 40px; }
|
21
|
+
</style>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
<div class='container'>
|
25
|
+
<div class="left">
|
26
|
+
<p><h3>老版本的IE浏览器可能曾经为互联网作出了或多或少的贡献</h3></p>
|
27
|
+
<p><h2>但在这个新世界里已经没有他们的</h2></P>
|
28
|
+
<p><h1><b>位置</b></h1></P>
|
29
|
+
</div>
|
30
|
+
<div class="right">
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div style='clear:both' ></div>
|
34
|
+
<div class='end'>
|
35
|
+
<div class='end-title'>
|
36
|
+
<span style='display:block;float:left;color:#5191FD;font-weight:bold;height:25px;'>下载现代浏览器,进入互联网新世界</span>
|
37
|
+
<div style='background-color:#5191FD'></div>
|
38
|
+
<div style='background-color:#1647E9'></div>
|
39
|
+
<div style='background-color:#1C54F5'></div>
|
40
|
+
<div style='background-color:#E82A37'></div>
|
41
|
+
<div style='background-color:#0DA921'></div>
|
42
|
+
<div style='background-color:#74A82A'></div>
|
43
|
+
<div style='background-color:#D55511'></div>
|
44
|
+
<div style='background-color:#3565A1'></div>
|
45
|
+
<div style='background-color:#339BE6'></div>
|
46
|
+
<div style='background-color:#3B5998'></div>
|
47
|
+
<div style='background-color:#4C67A1'></div>
|
48
|
+
<div style='background-color:#5B74A9'></div>
|
49
|
+
<div style='background-color:#B0AD8F'></div>
|
50
|
+
<div style='background-color:#5F4925'></div>
|
51
|
+
<div style='background-color:#503819'></div>
|
52
|
+
<div style='background-color:#AA1520'></div>
|
53
|
+
<div style='background-color:#D32128'></div>
|
54
|
+
<div style='background-color:#E4B2B6'></div>
|
55
|
+
<div style='background-color:#fff'></div>
|
56
|
+
</div>
|
57
|
+
<div style='clear:both;'></div>
|
58
|
+
<ul>
|
59
|
+
<li><a href='http://www.firefox.com' class='browser' target='_blank'><img src="http://mozorg.cdn.mozilla.net/media/img/firefox/new/header-firefox.png" alt="Firefox"></a></li>
|
60
|
+
|
61
|
+
<li><a href='http://chrome.google.com' class='browser' target='_blank'><img src="https://www.google.com/intl/zh-CN/chrome/assets/common/images/chrome_logo_2x.png" alt="Chrome"></a></li>
|
62
|
+
|
63
|
+
<li><a href='http://www.opera.com' class='browser' target='_blank'><img src="http://d2jc9zwbrclgz3.cloudfront.net/extension/opera/design/opera/static/css/images/logo.png" alt="Opera">PERA</a></li>
|
64
|
+
|
65
|
+
<li><a href="http://windows.microsoft.com/zh-cn/internet-explorer/download-ie" class='browser' target='_blank' style='color:#00CCFF;'>
|
66
|
+
<img src="http://res1.windows.microsoft.com/resbox/en/windows/main/e9979a8b-c439-452a-a09f-d3b32df0e5b1_13.png" alt="IE">IE 9+
|
67
|
+
</a></li>
|
68
|
+
</ul>
|
69
|
+
</div>
|
70
|
+
</body>
|
71
|
+
</html>
|
data/lib/plz_plz_ie.rb
ADDED
data/plz_plz_ie.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#coding:utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'plz_plz_ie/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "plz_plz_ie"
|
8
|
+
s.version = PlzPlzIE::VERSION
|
9
|
+
s.authors = ["pokka"]
|
10
|
+
s.email = ["ifunafu@gmail.com"]
|
11
|
+
s.description = %q{render a page to the old IE browser}
|
12
|
+
s.summary = %q{render a page to the old IE browser}
|
13
|
+
s.homepage = "https://github.com/pokka/plz_plz_ie"
|
14
|
+
s.license = "MIT"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split($/)
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.required_ruby_version = ">= 1.9.2"
|
20
|
+
|
21
|
+
# s.add_dependency "erubis", ">= 2.6.6"
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plz_plz_ie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.0.
|
4
|
+
version: 9.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pokka
|
@@ -19,6 +19,13 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- .gitignore
|
21
21
|
- README.md
|
22
|
+
- lib/.DS_Store
|
23
|
+
- lib/plz_plz_ie.rb
|
24
|
+
- lib/plz_plz_ie/.DS_Store
|
25
|
+
- lib/plz_plz_ie/middleware.rb
|
26
|
+
- lib/plz_plz_ie/templates/plz_plz_ie.html
|
27
|
+
- lib/plz_plz_ie/version.rb
|
28
|
+
- plz_plz_ie.gemspec
|
22
29
|
homepage: https://github.com/pokka/plz_plz_ie
|
23
30
|
licenses:
|
24
31
|
- MIT
|