ie_iframe_cookies 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +78 -19
- data/Rakefile +9 -1
- data/VERSION +1 -1
- data/ie_iframe_cookies.gemspec +2 -2
- data/lib/ie_iframe_cookies.rb +24 -15
- data/test/ie_iframe_cookies_test.rb +1 -1
- data/test/test_helper.rb +37 -5
- metadata +4 -4
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,37 +1,96 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
actionmailer (
|
5
|
-
actionpack (=
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
actionmailer (3.1.2)
|
5
|
+
actionpack (= 3.1.2)
|
6
|
+
mail (~> 2.3.0)
|
7
|
+
actionpack (3.1.2)
|
8
|
+
activemodel (= 3.1.2)
|
9
|
+
activesupport (= 3.1.2)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
i18n (~> 0.6)
|
13
|
+
rack (~> 1.3.5)
|
14
|
+
rack-cache (~> 1.1)
|
15
|
+
rack-mount (~> 0.8.2)
|
16
|
+
rack-test (~> 0.6.1)
|
17
|
+
sprockets (~> 2.1.0)
|
18
|
+
activemodel (3.1.2)
|
19
|
+
activesupport (= 3.1.2)
|
20
|
+
builder (~> 3.0.0)
|
21
|
+
i18n (~> 0.6)
|
22
|
+
activerecord (3.1.2)
|
23
|
+
activemodel (= 3.1.2)
|
24
|
+
activesupport (= 3.1.2)
|
25
|
+
arel (~> 2.2.1)
|
26
|
+
tzinfo (~> 0.3.29)
|
27
|
+
activeresource (3.1.2)
|
28
|
+
activemodel (= 3.1.2)
|
29
|
+
activesupport (= 3.1.2)
|
30
|
+
activesupport (3.1.2)
|
31
|
+
multi_json (~> 1.0)
|
32
|
+
arel (2.2.1)
|
33
|
+
builder (3.0.0)
|
34
|
+
erubis (2.7.0)
|
14
35
|
git (1.2.5)
|
36
|
+
hike (1.2.1)
|
37
|
+
i18n (0.6.0)
|
15
38
|
jeweler (1.6.4)
|
16
39
|
bundler (~> 1.0)
|
17
40
|
git (>= 1.2.5)
|
18
41
|
rake
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
42
|
+
json (1.6.1)
|
43
|
+
mail (2.3.0)
|
44
|
+
i18n (>= 0.4.0)
|
45
|
+
mime-types (~> 1.16)
|
46
|
+
treetop (~> 1.4.8)
|
47
|
+
mime-types (1.17.2)
|
48
|
+
multi_json (1.0.3)
|
49
|
+
polyglot (0.3.3)
|
50
|
+
rack (1.3.5)
|
51
|
+
rack-cache (1.1)
|
52
|
+
rack (>= 0.4)
|
53
|
+
rack-mount (0.8.3)
|
54
|
+
rack (>= 1.0.0)
|
55
|
+
rack-ssl (1.3.2)
|
56
|
+
rack
|
57
|
+
rack-test (0.6.1)
|
58
|
+
rack (>= 1.0)
|
59
|
+
rails (3.1.2)
|
60
|
+
actionmailer (= 3.1.2)
|
61
|
+
actionpack (= 3.1.2)
|
62
|
+
activerecord (= 3.1.2)
|
63
|
+
activeresource (= 3.1.2)
|
64
|
+
activesupport (= 3.1.2)
|
65
|
+
bundler (~> 1.0)
|
66
|
+
railties (= 3.1.2)
|
67
|
+
railties (3.1.2)
|
68
|
+
actionpack (= 3.1.2)
|
69
|
+
activesupport (= 3.1.2)
|
70
|
+
rack-ssl (~> 1.3.2)
|
71
|
+
rake (>= 0.8.7)
|
72
|
+
rdoc (~> 3.4)
|
73
|
+
thor (~> 0.14.6)
|
27
74
|
rake (0.9.2)
|
75
|
+
rdoc (3.11)
|
76
|
+
json (~> 1.4)
|
28
77
|
redgreen (1.2.2)
|
78
|
+
sprockets (2.1.1)
|
79
|
+
hike (~> 1.2)
|
80
|
+
rack (~> 1.0)
|
81
|
+
tilt (~> 1.1, != 1.3.0)
|
82
|
+
thor (0.14.6)
|
83
|
+
tilt (1.3.3)
|
84
|
+
treetop (1.4.10)
|
85
|
+
polyglot
|
86
|
+
polyglot (>= 0.3.1)
|
87
|
+
tzinfo (0.3.31)
|
29
88
|
|
30
89
|
PLATFORMS
|
31
90
|
ruby
|
32
91
|
|
33
92
|
DEPENDENCIES
|
34
93
|
jeweler
|
35
|
-
rails
|
94
|
+
rails
|
36
95
|
rake
|
37
96
|
redgreen
|
data/Rakefile
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
require 'rake/testtask'
|
2
|
-
Rake::TestTask.new(:
|
2
|
+
Rake::TestTask.new(:test) do |test|
|
3
3
|
test.libs << 'lib'
|
4
4
|
test.pattern = 'test/**/*_test.rb'
|
5
5
|
test.verbose = true
|
6
6
|
end
|
7
7
|
|
8
|
+
task :default do
|
9
|
+
sh "RAILS=2.3.12 && (bundle || bundle install) && bundle exec rake test"
|
10
|
+
sh "RAILS=3.0.10 && (bundle || bundle install) && exec rake test"
|
11
|
+
sh "RAILS=3.1.2 && (bundle || bundle install) && exec rake test"
|
12
|
+
sh "git checkout Gemfile.lock"
|
13
|
+
end
|
14
|
+
|
15
|
+
|
8
16
|
begin
|
9
17
|
require 'jeweler'
|
10
18
|
Jeweler::Tasks.new do |gem|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/ie_iframe_cookies.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ie_iframe_cookies}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-11-18}
|
13
13
|
s.email = %q{michael@grosser.it}
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
data/lib/ie_iframe_cookies.rb
CHANGED
@@ -2,6 +2,7 @@ class IEIframeCookies
|
|
2
2
|
VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
|
3
3
|
end
|
4
4
|
|
5
|
+
|
5
6
|
module ActionController
|
6
7
|
class Base
|
7
8
|
before_filter :normal_cookies_for_ie_in_iframes
|
@@ -17,24 +18,32 @@ module ActionController
|
|
17
18
|
headers['P3P'] = 'CP="ALL DSP COR CURa ADMa DEVa OUR IND COM NAV"' if request.normal_cookies_for_ie_in_iframes? or options[:force]
|
18
19
|
end
|
19
20
|
end
|
21
|
+
end
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
if ActionPack::VERSION::MAJOR > 2
|
24
|
+
request = ActionDispatch::Http::Cache::Request
|
25
|
+
method = :module_eval
|
26
|
+
else
|
27
|
+
request = ActionController::Request
|
28
|
+
method = :class_eval
|
29
|
+
end
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
request.send(method) do
|
32
|
+
def ie_iframe_cookies_browser_is_ie?
|
33
|
+
(env['HTTP_USER_AGENT'] || "").include?("MSIE")
|
34
|
+
end
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
36
|
+
def normal_cookies_for_ie_in_iframes?
|
37
|
+
ie_iframe_cookies_browser_is_ie? and cookies["using_iframes_in_ie"]
|
38
|
+
end
|
34
39
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
alias_method :etag_matches_without_ie_iframe_cookies?, :etag_matches?
|
41
|
+
def etag_matches?(*args)
|
42
|
+
not normal_cookies_for_ie_in_iframes? and etag_matches_without_ie_iframe_cookies?(*args)
|
43
|
+
end
|
44
|
+
|
45
|
+
alias_method :not_modified_without_ie_iframe_cookies?, :not_modified?
|
46
|
+
def not_modified?(*args)
|
47
|
+
not normal_cookies_for_ie_in_iframes? and not_modified_without_ie_iframe_cookies?(*args)
|
39
48
|
end
|
40
49
|
end
|
@@ -65,7 +65,7 @@ class IEIFrameCookiesTest < ActionController::TestCase
|
|
65
65
|
set_ie
|
66
66
|
get :activate
|
67
67
|
is_ok!
|
68
|
-
assert_equal "true", cookies['using_iframes_in_ie']
|
68
|
+
assert_equal "true", cookies['using_iframes_in_ie'].to_s
|
69
69
|
end
|
70
70
|
|
71
71
|
test "does not set tracking cookie for nice users" do
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,43 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'action_pack'
|
3
2
|
require 'action_controller'
|
4
|
-
|
3
|
+
|
4
|
+
if ActionPack::VERSION::MAJOR > 2
|
5
|
+
require 'action_dispatch/testing/test_process'
|
6
|
+
|
7
|
+
ROUTES = ActionDispatch::Routing::RouteSet.new
|
8
|
+
ROUTES.draw do
|
9
|
+
match ':controller(/:action(/:id(.:format)))'
|
10
|
+
end
|
11
|
+
ROUTES.finalize!
|
12
|
+
|
13
|
+
# funky patch to get @routes working, in 'setup' did not work
|
14
|
+
module ActionController::TestCase::Behavior
|
15
|
+
def process_with_routes(*args)
|
16
|
+
@routes = ROUTES
|
17
|
+
process_without_routes(*args)
|
18
|
+
end
|
19
|
+
alias_method_chain :process, :routes
|
20
|
+
end
|
21
|
+
|
22
|
+
class ActionController::Base
|
23
|
+
self.view_paths = 'test/views'
|
24
|
+
|
25
|
+
def self._routes
|
26
|
+
ROUTES
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class ActionController::TestRequest
|
31
|
+
def cookie_jar
|
32
|
+
cookies
|
33
|
+
end
|
34
|
+
end
|
35
|
+
else
|
36
|
+
require 'action_controller/test_process'
|
37
|
+
ActionController::Routing::Routes.reload rescue nil
|
38
|
+
end
|
39
|
+
|
5
40
|
require 'test/unit'
|
6
|
-
require 'redgreen' rescue nil
|
7
41
|
|
8
42
|
$LOAD_PATH << 'lib'
|
9
43
|
|
@@ -11,6 +45,4 @@ $LOAD_PATH << 'lib'
|
|
11
45
|
# when Rails is defined, backtrace_cleaner is used, when assert fails
|
12
46
|
RAILS_ENV='development'
|
13
47
|
|
14
|
-
ActionController::Routing::Routes.reload
|
15
|
-
|
16
48
|
require "init"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ie_iframe_cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-18 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|