innowhite 0.1.4 → 0.1.5
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/innowhite.gemspec +2 -2
- data/lib/innowhite.rb +28 -15
- metadata +8 -9
data/innowhite.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{innowhite}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{bainur}]
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.require_paths = [%q{lib}]
|
17
17
|
s.rubyforge_project = %q{innowhite}
|
18
18
|
s.rubygems_version = %q{1.8.6}
|
19
|
-
s.summary = %q{Innowhite Api}
|
19
|
+
s.summary = %q{Gem for Innowhite Api}
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
s.specification_version = 3
|
data/lib/innowhite.rb
CHANGED
@@ -41,10 +41,11 @@ class Innowhite
|
|
41
41
|
user = params[:user]
|
42
42
|
tags = params[:tags]
|
43
43
|
desc = params[:desc]
|
44
|
-
parent_org = params[:parentOrg]
|
44
|
+
#parent_org = params[:parentOrg]
|
45
|
+
@org_name = @parent_org if @org_name.nil?
|
45
46
|
room_id = set_room_id
|
46
47
|
address = join_room_helper(@server_address,@org_name, room_id, user,true)
|
47
|
-
res = create_room_info(room_id,user,tags,desc,
|
48
|
+
res = create_room_info(room_id,user,tags,desc, @org_name,address)
|
48
49
|
res = res.include?("Missing")
|
49
50
|
if res == true
|
50
51
|
return "Failed to fetch, maybe you have entered wrong username / organization name .."
|
@@ -54,9 +55,14 @@ class Innowhite
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def create_room_info(room_id,user,tags,desc, parent_org,address)
|
58
|
+
checksum_tmp = "parentOrg=#{parent_org}&orgName=#{parent_org}"
|
59
|
+
checksum = generating_checksum(URI.escape(checksum_tmp))
|
60
|
+
|
57
61
|
res = RestClient.post("#{@api_address}create_room_info",
|
58
62
|
{:roomId => room_id, :user => user, :tags => tags,:desc => desc,
|
59
|
-
:parentOrg => parent_org, :address => address, :orgName => parent_org
|
63
|
+
:parentOrg => parent_org, :address => address, :orgName => parent_org,
|
64
|
+
:checksum => checksum
|
65
|
+
}
|
60
66
|
)
|
61
67
|
return res
|
62
68
|
end
|
@@ -89,7 +95,7 @@ class Innowhite
|
|
89
95
|
end
|
90
96
|
address = join_room_helper(@server_address,@org_name, room_id, user, false)
|
91
97
|
if missing
|
92
|
-
|
98
|
+
raise "Room is not exist / Expired"
|
93
99
|
else
|
94
100
|
return address
|
95
101
|
end
|
@@ -143,9 +149,10 @@ class Innowhite
|
|
143
149
|
descs = []
|
144
150
|
res = []
|
145
151
|
tmp = "parentOrg=#{parent_org}&orgName=#{org_name1}&user=#{user}&tags=#{tags}"
|
146
|
-
|
147
|
-
|
148
|
-
|
152
|
+
checksum_tmp = "parentOrg=#{parent_org}&orgName=#{org_name1}"
|
153
|
+
checksum = generating_checksum(URI.escape(checksum_tmp))
|
154
|
+
# pp "#{@api_address}list_sessions?#{tmp}&cheksum=#{checksum}"
|
155
|
+
url = URI.escape("#{@api_address}past_sessions?#{tmp}&checksum=#{checksum}")
|
149
156
|
|
150
157
|
x = Nokogiri::XML(open(url))
|
151
158
|
x.xpath('//web-session/session-id').each{|m| ids << m.text}
|
@@ -156,23 +163,29 @@ class Innowhite
|
|
156
163
|
end
|
157
164
|
return res
|
158
165
|
rescue => e
|
159
|
-
return "Error fetching sessions
|
166
|
+
return "Error fetching sessions check the organization and private key .."
|
160
167
|
end
|
161
168
|
end
|
162
169
|
def get_sessions(params = {})
|
163
170
|
begin
|
164
171
|
params[:parentOrg] ||= @parent_org
|
165
|
-
|
172
|
+
if params[:orgName].nil?
|
173
|
+
org_name1 = params[:parentOrg]
|
174
|
+
else
|
175
|
+
org_name1 = params[:orgName]
|
176
|
+
end
|
166
177
|
ids = []
|
167
178
|
parent_org = params[:parentOrg]
|
179
|
+
org_name1 = parent_org if org_name1.blank?
|
168
180
|
user = params[:user]
|
169
181
|
tags = params[:tags]
|
170
182
|
descs = []
|
171
183
|
res = []
|
184
|
+
checksum_tmp = "parentOrg=#{parent_org}&orgName=#{org_name1}"
|
172
185
|
tmp = "parentOrg=#{parent_org}&orgName=#{org_name1}&user=#{user}&tags=#{tags}"
|
173
|
-
checksum = generating_checksum(URI.escape(
|
174
|
-
pp "#{@api_address}list_sessions?#{tmp}&cheksum=#{checksum}"
|
175
|
-
url = URI.escape("#{@api_address}list_sessions?#{tmp}&
|
186
|
+
checksum = generating_checksum(URI.escape(checksum_tmp))
|
187
|
+
#pp "#{@api_address}list_sessions?#{tmp}&cheksum=#{checksum}"
|
188
|
+
url = URI.escape("#{@api_address}list_sessions?#{tmp}&checksum=#{checksum}")
|
176
189
|
|
177
190
|
x = Nokogiri::XML(open(url))
|
178
191
|
x.xpath('//web-session/session-id').each{|m| ids << m.text}
|
@@ -183,7 +196,7 @@ class Innowhite
|
|
183
196
|
end
|
184
197
|
return res
|
185
198
|
rescue => e
|
186
|
-
return "Error fetching sessions
|
199
|
+
return "Error fetching sessions check the organization and private key .."
|
187
200
|
end
|
188
201
|
end
|
189
202
|
|
@@ -196,8 +209,8 @@ class Innowhite
|
|
196
209
|
return "#{action}#{address}&checksum=#{generating_checksum(checksum)}"
|
197
210
|
end
|
198
211
|
|
199
|
-
def generating_checksum(params)
|
200
|
-
Digest::SHA1.hexdigest(params)
|
212
|
+
def generating_checksum(params)
|
213
|
+
Digest::SHA1.hexdigest(params+@private_key)
|
201
214
|
end
|
202
215
|
|
203
216
|
def generate_checksum(parent_org, org_name,user_name)
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: innowhite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- bainur
|
@@ -15,7 +14,8 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2011-08-11 00:00:00
|
17
|
+
date: 2011-08-11 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Innowhite Api
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- lib/innowhite.rb
|
34
34
|
- Manifest
|
35
35
|
- innowhite.gemspec
|
36
|
+
has_rdoc: true
|
36
37
|
homepage: http://github.com/bainur/innowhite
|
37
38
|
licenses: []
|
38
39
|
|
@@ -51,7 +52,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
52
|
requirements:
|
52
53
|
- - ">="
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
hash: 3
|
55
55
|
segments:
|
56
56
|
- 0
|
57
57
|
version: "0"
|
@@ -60,7 +60,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
hash: 11
|
64
63
|
segments:
|
65
64
|
- 1
|
66
65
|
- 2
|
@@ -68,9 +67,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
67
|
requirements: []
|
69
68
|
|
70
69
|
rubyforge_project: innowhite
|
71
|
-
rubygems_version: 1.
|
70
|
+
rubygems_version: 1.3.7
|
72
71
|
signing_key:
|
73
72
|
specification_version: 3
|
74
|
-
summary: Innowhite Api
|
73
|
+
summary: Gem for Innowhite Api
|
75
74
|
test_files: []
|
76
75
|
|