rpx_now 0.6.19 → 0.6.20

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/.gitignore CHANGED
@@ -2,4 +2,5 @@ Manifest
2
2
  pkg
3
3
  .*.swp
4
4
  .*.swo
5
- *.autotest
5
+ *.autotest
6
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # not used, just for hardcore-bundlers
2
+ source :gemcutter
3
+
4
+ gem "rake"
5
+ gem "json"
6
+ gem "jeweler"
7
+
8
+ group :test do
9
+ gem "rspec"
10
+ end
data/README.markdown CHANGED
@@ -37,6 +37,7 @@ View
37
37
  `:language=>'en'` rpx tries to detect the users language, but you may overwrite it [possible languages](https://rpxnow.com/docs#sign-in_localization)
38
38
  `:default_provider=>'google'` [possible default providers](https://rpxnow.com/docs#sign-in_default_provider)
39
39
  `:flags=>'show_provider_list'` [possible flags](https://rpxnow.com/docs#sign-in_interface)
40
+ `:html => {:id => 'xxx'}` is added to the popup link (popup_code only)
40
41
 
41
42
  ###Unobtrusive / JS-last
42
43
  `popup_code` can also be called with `:unobtrusive=>true` ( --> just link without javascript include).
@@ -142,7 +143,8 @@ __[rpx_now_gem mailing list](http://groups.google.com/group/rpx_now_gem)__
142
143
  - [Mick Staugaard (staugaard)](http://mick.staugaard.com/)
143
144
  - [Kasper Weibel](http://github.com/weibel)
144
145
  - [Nicolas Alpi](http://www.notgeeklycorrect.com)
146
+ - [Ladislav Martincik](http://martincik.com)
145
147
 
146
148
  [Michael Grosser](http://pragmatig.wordpress.com)
147
149
  grosser.michael@gmail.com
148
- Hereby placed under public domain, do what you want, just do not hold me accountable...
150
+ Hereby placed under public domain, do what you want, just do not hold me accountable...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.19
1
+ 0.6.20
data/lib/rpx_now.rb CHANGED
@@ -83,7 +83,7 @@ module RPXNow
83
83
  end
84
84
 
85
85
  # popup window for rpx login
86
- # options: :language, :flags, :unobtrusive, :api_version, :default_provider
86
+ # options: :language, :flags, :unobtrusive, :api_version, :default_provider, :html
87
87
  def popup_code(text, subdomain, url, options = {})
88
88
  if options[:unobtrusive]
89
89
  unobtrusive_popup_code(text, subdomain, url, options)
@@ -159,7 +159,13 @@ module RPXNow
159
159
  end
160
160
 
161
161
  def unobtrusive_popup_code(text, subdomain, url, options={})
162
- %Q(<a class="rpxnow" href="#{popup_url(subdomain, url, options)}">#{text}</a>)
162
+ options = options.dup
163
+ html_options = options.delete(:html) || {}
164
+ html_options[:class] = "rpxnow #{html_options[:class]}".strip
165
+ html_options[:href] ||= popup_url(subdomain, url, options)
166
+ html_options = html_options.map{|k,v| %{#{k}="#{v}"}}
167
+
168
+ %{<a #{html_options.join(' ')}>#{text}</a>}
163
169
  end
164
170
 
165
171
  def obtrusive_popup_code(text, subdomain, url, options = {})
data/rpx_now.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rpx_now}
8
- s.version = "0.6.19"
8
+ s.version = "0.6.20"
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{2010-04-11}
12
+ s.date = %q{2010-04-27}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.files = [
18
18
  ".gitignore",
19
19
  "CHANGELOG",
20
+ "Gemfile",
20
21
  "MIGRATION",
21
22
  "README.markdown",
22
23
  "Rakefile",
data/spec/rpx_now_spec.rb CHANGED
@@ -112,6 +112,16 @@ describe RPXNow do
112
112
  options.should == {:xxx => 1}
113
113
  end
114
114
 
115
+ it "adds html params to link" do
116
+ options = {:html => {:id => "xxxx"}}
117
+ RPXNow.popup_code('a','b','c', options).should =~ /id="xxxx"/
118
+ end
119
+
120
+ it "adds rpxnow to given html class" do
121
+ options = {:html => {:class => "c1 c2"}}
122
+ RPXNow.popup_code('a','b','c', options).should =~ /class="rpxnow c1 c2"/
123
+ end
124
+
115
125
  describe 'obstrusive' do
116
126
  it "does not encode token_url for popup" do
117
127
  expected = %Q(RPXNOW.token_url = 'http://fake.domain.com/')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 19
9
- version: 0.6.19
8
+ - 20
9
+ version: 0.6.20
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-11 00:00:00 +02:00
17
+ date: 2010-04-27 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -40,6 +40,7 @@ extra_rdoc_files:
40
40
  files:
41
41
  - .gitignore
42
42
  - CHANGELOG
43
+ - Gemfile
43
44
  - MIGRATION
44
45
  - README.markdown
45
46
  - Rakefile