carrot-facebook 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ module Carrot
2
+ module Facebook
3
+ module Controller
4
+ include ActiveSupport::Concerns
5
+
6
+ def top_redirect_to(*args)
7
+ @redirect_url = url_for(*args)
8
+ render :layout => false, :inline => <<-HTML
9
+ <html><head>
10
+ <script type="text/javascript">
11
+ window.top.location.href = <%= @redirect_url.to_json -%>;
12
+ </script>
13
+ <noscript>
14
+ <meta http-equiv="refresh" content="0;url=<%=h @redirect_url %>" />
15
+ <meta http-equiv="window-target" content="_top" />
16
+ </noscript>
17
+ </head></html>
18
+ HTML
19
+ end
20
+ end
21
+ end
22
+ end
@@ -11,6 +11,12 @@ module Carrot
11
11
  initializer "carrot.facebook.view_helpers" do
12
12
  ActionView::Base.send :include, ViewHelpers
13
13
  end
14
+
15
+ initializer "carrot.facebook.controller" do
16
+ ActiveSupport.on_load(:action_controller) do
17
+ include Controller
18
+ end
19
+ end
14
20
  end
15
21
  end
16
22
  end
@@ -1,5 +1,5 @@
1
1
  module Carrot
2
2
  module Facebook
3
- VERSION = "0.9.6"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
@@ -3,15 +3,6 @@ include ActionView::Helpers::TagHelper
3
3
  module Carrot
4
4
  module Facebook
5
5
  module ViewHelpers
6
- def redirect_to_top *args
7
- #if request_is_facebook_iframe?
8
- @redirect_url = url_for(*args)
9
- render :layout => false, :inline => "<html><head>\n<script type=\"text/javascript\">\nwindow.top.location.href = <%= @redirect_url.to_json -%>;\n</script>\n<noscript>\n<meta http-equiv=\"refresh\" content=\"0;url=<%=h @redirect_url %>\" />\n<meta http-equiv=\"window-target\" content=\"_top\" />\n</noscript>\n</head></html>\n"
10
- #else
11
- # redirect_to(*args)
12
- #end
13
- end
14
-
15
6
  #extend ActionView::Helpers::AssetTagHelper
16
7
  # Public: Generates a user's Facebook avatar.
17
8
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrot-facebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2013-02-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yajl-ruby
17
- requirement: &70099139693920 !ruby/object:Gem::Requirement
17
+ requirement: &70249257788660 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70099139693920
25
+ version_requirements: *70249257788660
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: p3p
28
- requirement: &70099139690740 !ruby/object:Gem::Requirement
28
+ requirement: &70249257785580 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70099139690740
36
+ version_requirements: *70249257785580
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rails
39
- requirement: &70099139715480 !ruby/object:Gem::Requirement
39
+ requirement: &70249257810500 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70099139715480
47
+ version_requirements: *70249257810500
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- requirement: &70099139714680 !ruby/object:Gem::Requirement
50
+ requirement: &70249257809700 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *70099139714680
58
+ version_requirements: *70249257809700
59
59
  description: Facebook view helpers and signed request handling.
60
60
  email:
61
61
  - tmilewski@gmail.com
@@ -71,6 +71,7 @@ files:
71
71
  - Rakefile
72
72
  - carrot-facebook.gemspec
73
73
  - lib/carrot-facebook.rb
74
+ - lib/carrot-facebook/controller.rb
74
75
  - lib/carrot-facebook/middleware.rb
75
76
  - lib/carrot-facebook/railtie.rb
76
77
  - lib/carrot-facebook/version.rb