ohmage 0.0.28 → 0.0.29
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.
- checksums.yaml +4 -4
- data/lib/ohmage/error.rb +2 -2
- data/lib/ohmage/user.rb +16 -1
- data/lib/ohmage/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fb497c26c555cb4c32f7228fc0720bfa867d116
|
4
|
+
data.tar.gz: 9b7a484afa92be7e62c15bb991cfe17c767b104f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 215bfc952f9d7fdfda7a49b12767d2344e4ac2f30eac70f27f1d079cd111074306cbd669d55914b89b407829a47b16f4756fa22b507d91d245dcce11dce85947
|
7
|
+
data.tar.gz: ad3b8db1d56c15e80dea8af77760922c3cc41123c3269aaa0b0eb35a71ae36c0d6e467cac41be88d45e5e814ed104798beba44e9d58c4e89500db8fa876e3a30
|
data/lib/ohmage/error.rb
CHANGED
@@ -31,7 +31,7 @@ module Ohmage
|
|
31
31
|
500 => Ohmage::Error::InternalServerError,
|
32
32
|
502 => Ohmage::Error::BadGateway,
|
33
33
|
503 => Ohmage::Error::ServiceUnavailable,
|
34
|
-
504 => Ohmage::Error::GatewayTimeout
|
34
|
+
504 => Ohmage::Error::GatewayTimeout
|
35
35
|
}
|
36
36
|
# How ugly is this??
|
37
37
|
STRING_ERRORS = {
|
@@ -41,7 +41,7 @@ module Ohmage
|
|
41
41
|
'0200' => Ohmage::Error::Unauthorized,
|
42
42
|
'0201' => Ohmage::Error::Unauthorized,
|
43
43
|
'0202' => Ohmage::Error::Unauthorized,
|
44
|
-
'0203' => Ohmage::Error::InvalidToken
|
44
|
+
'0203' => Ohmage::Error::InvalidToken
|
45
45
|
}
|
46
46
|
('0300'..'0399').to_a.each do |e|
|
47
47
|
STRING_ERRORS[e] = Ohmage::Error::InvalidParameter
|
data/lib/ohmage/user.rb
CHANGED
@@ -63,7 +63,7 @@ module Ohmage
|
|
63
63
|
#
|
64
64
|
# ohmage user/setup call
|
65
65
|
# @see https://github.com/ohmage/server/wiki/User-Manipulation#userSetup
|
66
|
-
# @returns
|
66
|
+
# @returns Hash with username and password param.
|
67
67
|
#
|
68
68
|
def user_setup(params = {})
|
69
69
|
# server bug returns empty page if user setup disabled.
|
@@ -71,6 +71,21 @@ module Ohmage
|
|
71
71
|
request = Ohmage::Request.new(self, :post, 'user/setup', params)
|
72
72
|
request.perform
|
73
73
|
end
|
74
|
+
|
75
|
+
#
|
76
|
+
# ohmage user/search call. Admin only api
|
77
|
+
# @see https://github.com/ohmage/server/wiki/User-Manipulation#userSetup
|
78
|
+
# @returns Array of Ohmage::User objects.
|
79
|
+
#
|
80
|
+
def user_search(params = {})
|
81
|
+
request = Ohmage::Request.new(self, :post, 'user/search', params)
|
82
|
+
# TODO: make a utility to abstract creation of array of base objects
|
83
|
+
t = []
|
84
|
+
request.perform[:data].each do |k, v|
|
85
|
+
t << Ohmage::User.new(k => v)
|
86
|
+
end
|
87
|
+
t
|
88
|
+
end
|
74
89
|
end
|
75
90
|
end
|
76
91
|
end
|
data/lib/ohmage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohmage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Nolen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|