prooflink_connect 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,14 +27,15 @@ module ProoflinkConnect
27
27
  options = {
28
28
  :subdomain => config.subdomain,
29
29
  :token_url => 'https://example.com/auth/callbacks',
30
- :forced_connect => '0',
31
- :embed_forms => '0',
30
+ :forced_connect => false,
31
+ :embed_forms => false,
32
+ :split_screen => false,
32
33
  :width => '520px',
33
34
  :height => '250px'}.merge(options)
34
35
 
35
36
  domain_part = [options[:subdomain], config.provider_endpoint].compact.join(".")
36
37
  path_part = [options[:locale], 'authentications', 'embedded'].compact.join("/")
37
- query_part = "token_url=#{options[:token_url]}&forced_connect=#{options[:forced_connect]}&embed_forms=#{options[:embed_forms]}"
38
+ query_part = "token_url=#{options[:token_url]}&forced_connect=#{options[:forced_connect] ? 1 : 0}&embed_forms=#{options[:embed_forms] ? 1 : 0}&split_screen=#{options[:split_screen] ? 1 : 0}"
38
39
  frame_url = "#{config.protocol}://#{domain_part}/#{path_part}?#{query_part}"
39
40
  html = "<iframe src='#{frame_url}' style='width: #{options[:width]}; height: #{options[:height]}; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
40
41
  html.respond_to?(:html_safe) ? html.html_safe : html
@@ -1,3 +1,3 @@
1
1
  module ProoflinkConnect
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -2,27 +2,37 @@ require 'spec_helper'
2
2
 
3
3
  describe ProoflinkConnect do
4
4
  it "returns iframe html with defaults" do
5
- result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0' style='width: 520px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
5
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0&split_screen=0' style='width: 520px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
6
6
  ProoflinkConnect.embedded.should == result
7
7
  end
8
8
 
9
9
  it "allows pixels or percentage for width" do
10
- result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0' style='width: 100%; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
10
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0&split_screen=0' style='width: 100%; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
11
11
  ProoflinkConnect.embedded({:width => "100%"}).should == result
12
12
  end
13
13
 
14
14
  it "adds px to width if not given" do
15
- result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0' style='width: 100px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
15
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0&split_screen=0' style='width: 100px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
16
16
  ProoflinkConnect.embedded({:width => "100"}).should == result
17
17
  end
18
18
 
19
19
  it "allows pixels or percentage for height" do
20
- result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0' style='width: 520px; height: 100%; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
20
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0&split_screen=0' style='width: 520px; height: 100%; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
21
21
  ProoflinkConnect.embedded({:height => "100%"}).should == result
22
22
  end
23
23
 
24
24
  it "adds px to height if not given" do
25
- result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0' style='width: 520px; height: 100px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
25
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=0&split_screen=0' style='width: 520px; height: 100px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
26
26
  ProoflinkConnect.embedded({:height => "100"}).should == result
27
27
  end
28
+
29
+ it "accept boolean options as boolean" do
30
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=1&split_screen=1' style='width: 520px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
31
+ ProoflinkConnect.embedded(:split_screen => true, :embed_forms => true).should == result
32
+ end
33
+
34
+ it "accept boolean options as strings" do
35
+ result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&forced_connect=0&embed_forms=1&split_screen=1' style='width: 520px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
36
+ ProoflinkConnect.embedded(:split_screen => '1', :embed_forms => '1').should == result
37
+ end
28
38
  end
metadata CHANGED
@@ -1,121 +1,91 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: prooflink_connect
3
- version: !ruby/object:Gem::Version
4
- hash: 61
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.18
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 17
10
- version: 0.0.17
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Chiel Wester
14
9
  - Jeroen Bulters
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-09-20 00:00:00 +02:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2011-10-31 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: json
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70302915729800 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
34
23
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: httparty
38
24
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70302915729800
26
+ - !ruby/object:Gem::Dependency
27
+ name: httparty
28
+ requirement: &70302915729340 !ruby/object:Gem::Requirement
40
29
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
48
34
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: activesupport
52
35
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *70302915729340
37
+ - !ruby/object:Gem::Dependency
38
+ name: activesupport
39
+ requirement: &70302915728920 !ruby/object:Gem::Requirement
54
40
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
62
45
  type: :runtime
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: bundler
66
46
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *70302915728920
48
+ - !ruby/object:Gem::Dependency
49
+ name: bundler
50
+ requirement: &70302915728420 !ruby/object:Gem::Requirement
68
51
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 23
73
- segments:
74
- - 1
75
- - 0
76
- - 0
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
77
55
  version: 1.0.0
78
56
  type: :development
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: rspec
82
57
  prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *70302915728420
59
+ - !ruby/object:Gem::Dependency
60
+ name: rspec
61
+ requirement: &70302915727860 !ruby/object:Gem::Requirement
84
62
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
92
67
  type: :development
93
- version_requirements: *id005
94
- - !ruby/object:Gem::Dependency
95
- name: webmock
96
68
  prerelease: false
97
- requirement: &id006 !ruby/object:Gem::Requirement
69
+ version_requirements: *70302915727860
70
+ - !ruby/object:Gem::Dependency
71
+ name: webmock
72
+ requirement: &70302915727320 !ruby/object:Gem::Requirement
98
73
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
106
78
  type: :development
107
- version_requirements: *id006
79
+ prerelease: false
80
+ version_requirements: *70302915727320
108
81
  description: Make a connection to the prooflink connect api for single sign on authentication
109
- email:
82
+ email:
110
83
  - chiel.wester@holder.nl
111
84
  - jeroen@bulte.rs
112
85
  executables: []
113
-
114
86
  extensions: []
115
-
116
87
  extra_rdoc_files: []
117
-
118
- files:
88
+ files:
119
89
  - .gitignore
120
90
  - .rspec
121
91
  - .travis.yml
@@ -139,41 +109,28 @@ files:
139
109
  - spec/prooflink_connect/share_spec.rb
140
110
  - spec/prooflink_connect_spec.rb
141
111
  - spec/spec_helper.rb
142
- has_rdoc: true
143
112
  homepage: https://github.com/prooflink/prooflink_connect
144
113
  licenses: []
145
-
146
114
  post_install_message:
147
115
  rdoc_options: []
148
-
149
- require_paths:
116
+ require_paths:
150
117
  - lib
151
- required_ruby_version: !ruby/object:Gem::Requirement
118
+ required_ruby_version: !ruby/object:Gem::Requirement
152
119
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 3
157
- segments:
158
- - 0
159
- version: "0"
160
- required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
125
  none: false
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- hash: 23
166
- segments:
167
- - 1
168
- - 3
169
- - 6
126
+ requirements:
127
+ - - ! '>='
128
+ - !ruby/object:Gem::Version
170
129
  version: 1.3.6
171
130
  requirements: []
172
-
173
131
  rubyforge_project: prooflink_connect
174
- rubygems_version: 1.4.1
132
+ rubygems_version: 1.8.10
175
133
  signing_key:
176
134
  specification_version: 3
177
135
  summary: Make a connection to the prooflink connect api
178
136
  test_files: []
179
-