devise_rpx_connectable 0.1.0 → 0.1.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.
data/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. Devise RPX Connectable
2
2
 
3
- _Devise << RPX_
3
+ _Devise << RPX_ by "Nicolas Blanco":http://github.com/slainer68
4
4
 
5
5
  h2. What is Devise?
6
6
 
@@ -22,6 +22,8 @@ h2. What is Devise RPX Connectable?
22
22
 
23
23
  Devise RPX Connectable is a gem to integrate RPX authentication in a Rails application using Devise.
24
24
 
25
+ Please note that this is an unofficial library. It is neither affiliated with, nor endorsed by RPX/JanRain Inc.
26
+
25
27
  h2. Dependencies
26
28
 
27
29
  Devise RPX Connectable was tested using latest stable Rails and Devise gems.
@@ -107,6 +109,9 @@ Your model needs one attribute/column to store the RPX identifier. By default, t
107
109
 
108
110
  *Views*
109
111
 
112
+ The RPX connection widget can be added in your application using a link or an iframe.
113
+ If you choose to use a link, the connection widget can be displayed in a new page (standard link) or using Javascript in overlay.
114
+
110
115
  I added an easy to use helper to add a link to the RPX connection popup.
111
116
 
112
117
  <pre>
@@ -124,6 +129,12 @@ An helper is also included for this task :
124
129
  </html>
125
130
  </pre>
126
131
 
132
+ If you want to display the connection widget in an iframe inside a page :
133
+
134
+ <pre>
135
+ <%= embed_rpx user_session_url %>
136
+ </pre>
137
+
127
138
  h2. Advanced
128
139
 
129
140
  There is some advanced features that you may use...
@@ -156,9 +167,14 @@ h2. TODO
156
167
  * With Rails 3 (only) I get an invalid auth token in sessions#create action. I have to skip the validation of the auth token. See why?
157
168
  * Handle RPX multiple accounts mapping?
158
169
 
170
+ h2. Contributors
171
+
172
+ * "Paco Benavent":http://github.com/Knack
173
+
159
174
  h2. Thanks
160
175
 
161
176
  The base of this gem was heavily inspired from the "Devise Facebook Connectable gem":http://github.com/grimen/devise_facebook_connectable by "Jonas Grimfelt":http://github.com/grimen and other Devise gems.
177
+ This gem also use the great "rpx_now":http://github.com/grosser/rpx_now by "Michael Grosser":http://github.com/grosser
162
178
 
163
179
  h2. License
164
180
 
@@ -28,9 +28,11 @@ module Devise #:nodoc:
28
28
  if klass.rpx_auto_create_account?
29
29
  user = returning(klass.new) do |u|
30
30
  u.store_rpx_credentials!(rpx_user)
31
+ u.on_before_rpx_connect(rpx_user)
31
32
  end
32
33
  begin
33
34
  user.save(false)
35
+ user.on_after_rpx_connect(rpx_user)
34
36
  success!(user)
35
37
  rescue
36
38
  fail!(:rpx_invalid)
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module RpxConnectable
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.1.1".freeze
4
4
  end
5
5
  end
@@ -24,6 +24,21 @@ module Devise #:nodoc:
24
24
  out.respond_to?(:html_safe) ? out.html_safe : out
25
25
  end
26
26
 
27
+ # Embeds the RPX connection iframe in your page.
28
+ # By default the RPX frame will refer to the RPX application name you defined in the configuration.
29
+ # It may be overriden using :application_name if the options.
30
+ # The first parameter is the return URL, it must be absolute (***_url).
31
+ # You can override default iframe size using :width and :height in the options.
32
+ #
33
+ # Example :
34
+ # <%= embed_rpx user_session_url %>
35
+ #
36
+ def embed_rpx(link_url, options={})
37
+ token_url = build_token_url(link_url)
38
+ out = RPXNow.embed_code(rpx_application_name_from_options(options), token_url, options)
39
+ out.respond_to?(:html_safe) ? out.html_safe : out
40
+ end
41
+
27
42
  # Returns the necessary JS code for the RPX popup.
28
43
  # It is recommended to put this code just before the </body> tag of your layout.
29
44
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_rpx_connectable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Blanco
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-25 00:00:00 +02:00
12
+ date: 2010-04-26 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency