userinfuser 0.9.0 → 0.9.2
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/lib/userinfuser.rb +7 -2
- data/test/ts_userinfuser.rb +2 -2
- metadata +4 -4
data/lib/userinfuser.rb
CHANGED
@@ -16,6 +16,7 @@ Copyright (C) 2011 CloudCaptive
|
|
16
16
|
=end
|
17
17
|
|
18
18
|
# Programmer: Chris Bunch
|
19
|
+
# Navraj Chohan
|
19
20
|
|
20
21
|
require 'rubygems'
|
21
22
|
require 'json'
|
@@ -46,6 +47,7 @@ class UserInfuser
|
|
46
47
|
WIDGET_PATH = "getwidget"
|
47
48
|
CREATE_BADGE_PATH= "createbadge"
|
48
49
|
RAISE_EXCEPTIONS = false
|
50
|
+
UI_ANONYMOUS = "__ui__anonymous__"
|
49
51
|
|
50
52
|
def initialize(account, api_key, debug=false, local=false, encrypt=true, sync_all=false)
|
51
53
|
@ui_url = UI_PATH
|
@@ -232,13 +234,16 @@ class UserInfuser
|
|
232
234
|
|
233
235
|
def get_widget(user_id, widget_type, height=500, width=300)
|
234
236
|
raise UserInfuserUnknownWidget unless VALID_WIDGETS.include?(widget_type)
|
237
|
+
|
238
|
+
user_id = UI_ANONYMOUS if user_id.nil?
|
239
|
+
user_id = UI_ANONYMOUS if user_id.empty?
|
240
|
+
|
235
241
|
userhash = Digest::SHA1.hexdigest(@account + '---' + user_id)
|
236
242
|
prefetch_widget(widget_type, user_id)
|
237
|
-
|
238
243
|
if widget_type == "notifier"
|
239
244
|
return "<div style='z-index:9999; overflow: hidden; position: fixed; bottom: 0px; right: 10px;'><iframe style='border:none;' allowtransparency='true' height='#{height}px' width='#{width}px' scrolling='no' src='#{@widget_path}?widget=#{widget_type}&u=#{userhash}&height=#{height}&width=#{width}'>Sorry your browser does not support iframes!</iframe></div>"
|
240
245
|
else
|
241
|
-
return "<iframe border='0' z-index:9999; frameborder='0' height='#{height}px' width='#{width}px' scrolling='no' src='#{@widget_path}?widget=#{widget_type}&u=#{userhash}&height=#{height}&width=#{width}'>Sorry your browser does not support iframes!</iframe>"
|
246
|
+
return "<iframe border='0' z-index:9999; frameborder='0' height='#{height}px' width='#{width}px' allowtransparency='true' scrolling='no' src='#{@widget_path}?widget=#{widget_type}&u=#{userhash}&height=#{height}&width=#{width}'>Sorry your browser does not support iframes!</iframe>"
|
242
247
|
end
|
243
248
|
end
|
244
249
|
|
data/test/ts_userinfuser.rb
CHANGED
@@ -70,11 +70,11 @@ PARAMS = {
|
|
70
70
|
REASON = "just because"
|
71
71
|
|
72
72
|
def get_good_ui(sync)
|
73
|
-
return UserInfuser.new(ACCOUNT, API_KEY, DEFAULT_DEBUG,
|
73
|
+
return UserInfuser.new(ACCOUNT, API_KEY, DEFAULT_DEBUG, IS_REMOTE, NO_ENCRYPT, sync)
|
74
74
|
end
|
75
75
|
|
76
76
|
def get_bad_ui(sync)
|
77
|
-
return UserInfuser.new(ACCOUNT, API_KEY + "x", DEFAULT_DEBUG,
|
77
|
+
return UserInfuser.new(ACCOUNT, API_KEY + "x", DEFAULT_DEBUG, IS_REMOTE, NO_ENCRYPT, sync)
|
78
78
|
end
|
79
79
|
|
80
80
|
require 'tc_users'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: userinfuser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 2
|
10
|
+
version: 0.9.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Bunch
|
@@ -15,7 +15,7 @@ autorequire: userinfuser
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-01 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|