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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b5bb2b3c4d347fda84546c76dc176011e64b90b
4
- data.tar.gz: 5c4048f64356f461664192401d3ee7cf41cdf180
3
+ metadata.gz: 8fb497c26c555cb4c32f7228fc0720bfa867d116
4
+ data.tar.gz: 9b7a484afa92be7e62c15bb991cfe17c767b104f
5
5
  SHA512:
6
- metadata.gz: 1f02917b16c18d2f865660c2692af11bcc331f83611e93a467a26f0d17110f429e921c81ab195547f5a88a15484e07ba737295b5c4b07708aeac4857276f353d
7
- data.tar.gz: 7d4717ad27cc92d660275e8201008b1af29613adbc1b92120010714930f66e47fb6301746757c79f521336c6753f79d64821f98906db24456cbcc00511e353cf
6
+ metadata.gz: 215bfc952f9d7fdfda7a49b12767d2344e4ac2f30eac70f27f1d079cd111074306cbd669d55914b89b407829a47b16f4756fa22b507d91d245dcce11dce85947
7
+ data.tar.gz: ad3b8db1d56c15e80dea8af77760922c3cc41123c3269aaa0b0eb35a71ae36c0d6e467cac41be88d45e5e814ed104798beba44e9d58c4e89500db8fa876e3a30
@@ -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
@@ -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
@@ -14,7 +14,7 @@ module Ohmage
14
14
 
15
15
  # @return [Integer]
16
16
  def patch
17
- 28
17
+ 29
18
18
  end
19
19
 
20
20
  # @return [Integer, NilClass]
@@ -28,7 +28,7 @@ module Ohmage
28
28
  major: major,
29
29
  minor: minor,
30
30
  patch: patch,
31
- pre: pre,
31
+ pre: pre
32
32
  }
33
33
  end
34
34
 
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.28
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-02-07 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable