plataforma_social 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
data/lib/plataforma_social.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module PlataformaSocial
|
2
2
|
class Configuration
|
3
|
-
attr_accessor :api_key, :secret, :facebook_app_secret, :facebook_app_id, :facebook_app_namespace, :facebook_scope, :facebook_callback_url, :admin_controller_name
|
3
|
+
attr_accessor :api_key, :secret, :facebook_app_secret, :facebook_app_id, :facebook_app_namespace, :facebook_scope, :facebook_callback_url, :admin_controller_name, :environment
|
4
4
|
end
|
5
5
|
end
|
@@ -94,30 +94,28 @@ module PlataformaSocial
|
|
94
94
|
params.present? && params[:controller].present? && params[:controller].index(PlataformaSocial.admin_controller_name) == 0
|
95
95
|
end
|
96
96
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
97
|
+
def link_to_facebook *args, &block
|
98
|
+
if block_given?
|
99
|
+
href = capture(&block)
|
100
|
+
|
101
|
+
args.unshift(href)
|
102
|
+
|
103
|
+
link_to_facebook *args
|
102
104
|
else
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
args[2][:target] = '_top'
|
115
|
-
else
|
116
|
-
super
|
117
|
-
end
|
105
|
+
args[2] ||= {}
|
106
|
+
|
107
|
+
server_domain = request.env['HTTP_HOST']
|
108
|
+
url = 'apps.facebook.com/' + PlataformaSocial.facebook_app_namespace
|
109
|
+
|
110
|
+
if args[1].include? server_domain
|
111
|
+
args[1].gsub! server_domain, url
|
112
|
+
else
|
113
|
+
args[1] = request.protocol + url + args[1]
|
118
114
|
end
|
115
|
+
|
116
|
+
args[2][:target] = '_top'
|
119
117
|
|
120
|
-
|
118
|
+
return link_to *args
|
121
119
|
end
|
122
120
|
end
|
123
121
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plataforma_social
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.27
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|