exvo_warez 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -2
- data/VERSION +1 -1
- data/exvo_warez.gemspec +5 -8
- data/lib/exvo_warez.rb +11 -15
- data/lib/rack/exvo/seo.rb +8 -1
- data/lib/rack/exvo/templates/links.erb +15 -1
- metadata +12 -28
data/Rakefile
CHANGED
@@ -22,9 +22,8 @@ begin
|
|
22
22
|
gemspec.homepage = "http://github.com/defkode/rack-useragent"
|
23
23
|
gemspec.summary = "ExvoWarez"
|
24
24
|
gemspec.add_dependency("rack-useragent-filter", "0.1.8")
|
25
|
-
gemspec.add_dependency("rack-google-analytics", "0.9.2")
|
26
25
|
gemspec.add_dependency("rack_referral", "0.0.1")
|
27
|
-
gemspec.add_dependency("exvo-auth", "
|
26
|
+
gemspec.add_dependency("exvo-auth", "0.9.6")
|
28
27
|
end
|
29
28
|
Jeweler::GemcutterTasks.new
|
30
29
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/exvo_warez.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{exvo_warez}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tomasz Mazur"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-29}
|
13
13
|
s.email = %q{defkode@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -44,20 +44,17 @@ Gem::Specification.new do |s|
|
|
44
44
|
|
45
45
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
46
46
|
s.add_runtime_dependency(%q<rack-useragent-filter>, ["= 0.1.8"])
|
47
|
-
s.add_runtime_dependency(%q<rack-google-analytics>, ["= 0.9.2"])
|
48
47
|
s.add_runtime_dependency(%q<rack_referral>, ["= 0.0.1"])
|
49
|
-
s.add_runtime_dependency(%q<exvo-auth>, ["
|
48
|
+
s.add_runtime_dependency(%q<exvo-auth>, ["= 0.9.6"])
|
50
49
|
else
|
51
50
|
s.add_dependency(%q<rack-useragent-filter>, ["= 0.1.8"])
|
52
|
-
s.add_dependency(%q<rack-google-analytics>, ["= 0.9.2"])
|
53
51
|
s.add_dependency(%q<rack_referral>, ["= 0.0.1"])
|
54
|
-
s.add_dependency(%q<exvo-auth>, ["
|
52
|
+
s.add_dependency(%q<exvo-auth>, ["= 0.9.6"])
|
55
53
|
end
|
56
54
|
else
|
57
55
|
s.add_dependency(%q<rack-useragent-filter>, ["= 0.1.8"])
|
58
|
-
s.add_dependency(%q<rack-google-analytics>, ["= 0.9.2"])
|
59
56
|
s.add_dependency(%q<rack_referral>, ["= 0.0.1"])
|
60
|
-
s.add_dependency(%q<exvo-auth>, ["
|
57
|
+
s.add_dependency(%q<exvo-auth>, ["= 0.9.6"])
|
61
58
|
end
|
62
59
|
end
|
63
60
|
|
data/lib/exvo_warez.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "rack/exvo/seo"
|
2
|
-
require "rack/google-analytics"
|
3
2
|
require "rack/useragent/filter"
|
4
3
|
require "rack_referral"
|
5
4
|
require 'exvo-auth'
|
@@ -13,18 +12,21 @@ module Rack
|
|
13
12
|
end
|
14
13
|
|
15
14
|
def apply_middlewares
|
16
|
-
|
15
|
+
if env == "development"
|
16
|
+
#
|
17
|
+
end
|
18
|
+
|
19
|
+
if env == "staging"
|
17
20
|
apply_referral
|
18
|
-
|
21
|
+
apply_useragent_filter
|
19
22
|
end
|
20
23
|
|
21
|
-
if env == "production"
|
22
|
-
|
24
|
+
if env == "production"ss
|
25
|
+
apply_referral
|
26
|
+
apply_useragent_filter
|
27
|
+
apply_seo if ExvoAuth::Config.client_id
|
23
28
|
end
|
24
29
|
|
25
|
-
if ExvoAuth::Config.client_id
|
26
|
-
apply_seo
|
27
|
-
end
|
28
30
|
end
|
29
31
|
|
30
32
|
def call(env)
|
@@ -45,9 +47,7 @@ module Rack
|
|
45
47
|
required_products = [
|
46
48
|
["Internet Explorer", "8.0"],
|
47
49
|
["Opera", "10.0"],
|
48
|
-
["Firefox", "3.0"]
|
49
|
-
["Safari", "4.0"],
|
50
|
-
["Chrome", "4"]
|
50
|
+
["Firefox", "3.0"]
|
51
51
|
]
|
52
52
|
|
53
53
|
@app = Rack::UserAgent::Filter.new(@app, required_products, :force_with_cookie => "deprecated_browser")
|
@@ -61,10 +61,6 @@ module Rack
|
|
61
61
|
def apply_referral
|
62
62
|
@app = Rack::Referral.new(@app, :url => "#{auth_host}/referrals/<REF>?return_to=<RETURN_TO>")
|
63
63
|
end
|
64
|
-
|
65
|
-
def apply_analytics
|
66
|
-
@app = Rack::GoogleAnalytics.new(@app, :tracker => 'UA-2491324-1', :multiple => true, :domain => ".exvo.com")
|
67
|
-
end
|
68
64
|
|
69
65
|
end
|
70
66
|
end
|
data/lib/rack/exvo/seo.rb
CHANGED
@@ -8,7 +8,14 @@ module Rack
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def call(env)
|
11
|
+
request = Rack::Request.new(env)
|
12
|
+
|
11
13
|
status, headers, @body = @app.call(env)
|
14
|
+
|
15
|
+
if request.xhr?
|
16
|
+
return [status, headers, @body]
|
17
|
+
end
|
18
|
+
|
12
19
|
if html?(headers)
|
13
20
|
if cl = headers["Content-Length"]
|
14
21
|
headers["Content-Length"] = (cl.to_i + @payload.length).to_s
|
@@ -35,7 +42,7 @@ module Rack
|
|
35
42
|
end
|
36
43
|
|
37
44
|
def html?(headers)
|
38
|
-
|
45
|
+
headers['Content-Type'] == "text/html"
|
39
46
|
end
|
40
47
|
|
41
48
|
def end_of_body?(chunk)
|
@@ -2,4 +2,18 @@
|
|
2
2
|
<% @apps.each do |app| %>
|
3
3
|
<a href="<%= app["url"] %>"><%= app["name"] %></a>
|
4
4
|
<% end %>
|
5
|
-
</footer>
|
5
|
+
</footer>
|
6
|
+
<script type='text/javascript'>
|
7
|
+
//<![CDATA[
|
8
|
+
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
9
|
+
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
10
|
+
//]]>
|
11
|
+
</script>
|
12
|
+
<script type='text/javascript'>
|
13
|
+
//<![CDATA[
|
14
|
+
try {
|
15
|
+
var pageTracker = _gat._getTracker("UA-2491324-1");
|
16
|
+
pageTracker._trackPageview();
|
17
|
+
} catch(err) {}
|
18
|
+
//]]>
|
19
|
+
</script>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exvo_warez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tomasz Mazur
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -34,26 +34,10 @@ dependencies:
|
|
34
34
|
version: 0.1.8
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rack-google-analytics
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - "="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 63
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 9
|
49
|
-
- 2
|
50
|
-
version: 0.9.2
|
51
|
-
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
37
|
- !ruby/object:Gem::Dependency
|
54
38
|
name: rack_referral
|
55
39
|
prerelease: false
|
56
|
-
requirement: &
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
57
41
|
none: false
|
58
42
|
requirements:
|
59
43
|
- - "="
|
@@ -65,23 +49,23 @@ dependencies:
|
|
65
49
|
- 1
|
66
50
|
version: 0.0.1
|
67
51
|
type: :runtime
|
68
|
-
version_requirements: *
|
52
|
+
version_requirements: *id002
|
69
53
|
- !ruby/object:Gem::Dependency
|
70
54
|
name: exvo-auth
|
71
55
|
prerelease: false
|
72
|
-
requirement: &
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
73
57
|
none: false
|
74
58
|
requirements:
|
75
|
-
- -
|
59
|
+
- - "="
|
76
60
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
61
|
+
hash: 55
|
78
62
|
segments:
|
79
63
|
- 0
|
80
64
|
- 9
|
81
|
-
-
|
82
|
-
version: 0.9.
|
65
|
+
- 6
|
66
|
+
version: 0.9.6
|
83
67
|
type: :runtime
|
84
|
-
version_requirements: *
|
68
|
+
version_requirements: *id003
|
85
69
|
description:
|
86
70
|
email: defkode@gmail.com
|
87
71
|
executables: []
|