predictionio 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae1559308d2d39ef840543d0314af25680bb8af8
4
- data.tar.gz: 26a21e3e749272d571e2a3ea537ed5df14497268
3
+ metadata.gz: cc76e93ff1fab8a8b64c20b829a9e69cfd7012ce
4
+ data.tar.gz: 5beeca9b2a0c237bacaa31459cae35c91984dcdb
5
5
  SHA512:
6
- metadata.gz: 84f015137fc1abd14dbec10a956e8db25f6fbeeff2fe8642919ced1f689f07b97c25b0789c68defced6497951ef79e8faea6a642b377703d701112d82642478e
7
- data.tar.gz: dafeed5306ec6b5fdba79175762ca47a4b6bd175bc5b87ac8386b8e9d361f6a32a0cadf24ab4e441c45bb2262388135e9b06deb43951f4bd4e283870b3ddd344
6
+ metadata.gz: a8658f74d556d39a6784c5d8b5e17adec7bcf572122929ec042a92f8a7311cb0498cd020a3db19f3a753321eead44e72aed5b78ac30f82e0476e9d3e8a14f438
7
+ data.tar.gz: c3ece6c9ce8303abf3247a7e879792ebb68720409630b045af82bddb0cc6afba3d56e48e3d950707b8949871237cbfc9b7631a19570c1a4a0ef635268f7820bf
@@ -22,8 +22,7 @@ module PredictionIO
22
22
  threads.times do
23
23
  Thread.new do
24
24
  begin
25
- Net::HTTP.start(uri.host, uri.port,
26
- :use_ssl => uri.scheme == 'https') do |http|
25
+ Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
27
26
  @counter_lock.synchronize do
28
27
  @connections += 1
29
28
  end
@@ -46,7 +45,7 @@ module PredictionIO
46
45
  http_req = Net::HTTP::Post.new("#{uri.path}#{request.path}")
47
46
  http_req.set_form_data(request.params)
48
47
  else
49
- http_req = Net::HTTP::Post.new("#{uri.path}#{request.path}", initheader = {'Content-Type' => 'application/json'})
48
+ http_req = Net::HTTP::Post.new("#{uri.path}#{request.path}", initheader = { 'Content-Type' => 'application/json' })
50
49
  http_req.body = request.params
51
50
  end
52
51
  begin
@@ -93,9 +92,7 @@ module PredictionIO
93
92
  # Create an asynchronous request and response package, put it in the pending queue, and return the response object.
94
93
  def request(method, request)
95
94
  response = AsyncResponse.new(request)
96
- @packages.push(:method => method,
97
- :request => request,
98
- :response => response)
95
+ @packages.push(method: method, request: request, response: response)
99
96
  response
100
97
  end
101
98
 
@@ -51,8 +51,7 @@ module PredictionIO
51
51
  # - 1 concurrent HTTP(S) connections (threads)
52
52
  # - API entry point at http://localhost:8000 (apiurl)
53
53
  # - a 60-second timeout for each HTTP(S) connection (thread_timeout)
54
- def initialize(apiurl = 'http://localhost:8000', threads = 1,
55
- thread_timeout = 60)
54
+ def initialize(apiurl = 'http://localhost:8000', threads = 1, thread_timeout = 60)
56
55
  @http = PredictionIO::Connection.new(URI(apiurl), threads, thread_timeout)
57
56
  end
58
57
 
@@ -108,8 +107,7 @@ module PredictionIO
108
107
  #
109
108
  # See also #send_query.
110
109
  def asend_query(query)
111
- @http.apost(PredictionIO::AsyncRequest.new('/queries.json',
112
- query.to_json))
110
+ @http.apost(PredictionIO::AsyncRequest.new('/queries.json', query.to_json))
113
111
  end
114
112
 
115
113
  # :category: Synchronous Methods
@@ -72,7 +72,7 @@ module PredictionIO
72
72
  # begin
73
73
  # result = client.record_user_action_on_item('rate', 'foouser',
74
74
  # 'baritem',
75
- # 'pio_rating' => 4)
75
+ # 'rating' => 4)
76
76
  # rescue PredictionIO::EventClient::NotCreatedError => e
77
77
  # ...
78
78
  # end
@@ -84,8 +84,7 @@ module PredictionIO
84
84
  # - 1 concurrent HTTP(S) connections (threads)
85
85
  # - API entry point at http://localhost:7070 (apiurl)
86
86
  # - a 60-second timeout for each HTTP(S) connection (thread_timeout)
87
- def initialize(access_key, apiurl = 'http://localhost:7070', threads = 1,
88
- thread_timeout = 60)
87
+ def initialize(access_key, apiurl = 'http://localhost:7070', threads = 1, thread_timeout = 60)
89
88
  @access_key = access_key
90
89
  @http = PredictionIO::Connection.new(URI(apiurl), threads, thread_timeout)
91
90
  end
@@ -164,7 +163,7 @@ module PredictionIO
164
163
  #
165
164
  # See also #set_user.
166
165
  def aset_user(uid, optional = {})
167
- acreate_event('$set', 'pio_user', uid, optional)
166
+ acreate_event('$set', 'user', uid, optional)
168
167
  end
169
168
 
170
169
  # :category: Synchronous Methods
@@ -194,7 +193,7 @@ module PredictionIO
194
193
  fail(ArgumentError, 'properties must be present when event is $unset')
195
194
  optional['properties'].empty? &&
196
195
  fail(ArgumentError, 'properties cannot be empty when event is $unset')
197
- acreate_event('$unset', 'pio_user', uid, optional)
196
+ acreate_event('$unset', 'user', uid, optional)
198
197
  end
199
198
 
200
199
  # :category: Synchronous Methods
@@ -218,7 +217,7 @@ module PredictionIO
218
217
  #
219
218
  # See also #delete_user.
220
219
  def adelete_user(uid)
221
- acreate_event('$delete', 'pio_user', uid)
220
+ acreate_event('$delete', 'user', uid)
222
221
  end
223
222
 
224
223
  # :category: Synchronous Methods
@@ -242,7 +241,7 @@ module PredictionIO
242
241
  #
243
242
  # See also #set_item.
244
243
  def aset_item(iid, optional = {})
245
- acreate_event('$set', 'pio_item', iid, optional)
244
+ acreate_event('$set', 'item', iid, optional)
246
245
  end
247
246
 
248
247
  # :category: Synchronous Methods
@@ -272,7 +271,7 @@ module PredictionIO
272
271
  fail(ArgumentError, 'properties must be present when event is $unset')
273
272
  optional['properties'].empty? &&
274
273
  fail(ArgumentError, 'properties cannot be empty when event is $unset')
275
- acreate_event('$unset', 'pio_item', iid, optional)
274
+ acreate_event('$unset', 'item', iid, optional)
276
275
  end
277
276
 
278
277
  # :category: Synchronous Methods
@@ -296,7 +295,7 @@ module PredictionIO
296
295
  #
297
296
  # See also #delete_item.
298
297
  def adelete_item(uid)
299
- acreate_event('$delete', 'pio_item', uid)
298
+ acreate_event('$delete', 'item', uid)
300
299
  end
301
300
 
302
301
  # :category: Synchronous Methods
@@ -320,9 +319,9 @@ module PredictionIO
320
319
  #
321
320
  # See also #record_user_action_on_item.
322
321
  def arecord_user_action_on_item(action, uid, iid, optional = {})
323
- optional['targetEntityType'] = 'pio_item'
322
+ optional['targetEntityType'] = 'item'
324
323
  optional['targetEntityId'] = iid
325
- acreate_event(action, 'pio_user', uid, optional)
324
+ acreate_event(action, 'user', uid, optional)
326
325
  end
327
326
 
328
327
  # :category: Synchronous Methods
@@ -0,0 +1,3 @@
1
+ module PredictionIO
2
+ VERSION = '0.8.3'
3
+ end
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: predictionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The PredictionIO Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-22 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  PredictionIO is a prediction server for building smart applications. This gem
15
15
  provides convenient access of the PredictionIO API to Ruby programmers so that
16
- they can focus on their application logic.
16
+ they can focus on application logic.
17
17
  email: support@prediction.io
18
18
  executables: []
19
19
  extensions: []
@@ -25,6 +25,7 @@ files:
25
25
  - lib/predictionio/connection.rb
26
26
  - lib/predictionio/engine_client.rb
27
27
  - lib/predictionio/event_client.rb
28
+ - lib/predictionio/version.rb
28
29
  homepage: http://prediction.io
29
30
  licenses:
30
31
  - Apache-2.0
@@ -35,12 +36,12 @@ require_paths:
35
36
  - lib
36
37
  required_ruby_version: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - ">="
39
+ - - '>='
39
40
  - !ruby/object:Gem::Version
40
41
  version: '1.9'
41
42
  required_rubygems_version: !ruby/object:Gem::Requirement
42
43
  requirements:
43
- - - ">="
44
+ - - '>='
44
45
  - !ruby/object:Gem::Version
45
46
  version: '0'
46
47
  requirements: []