openlab_ruby 0.0.2 → 0.0.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: 6cdd18b2d90443fba160bcef6380a93f2454fc2b
4
- data.tar.gz: 3b0577ce3736c1f1f991d74667e040235d923a0e
3
+ metadata.gz: 01f46949a9efc791744e7195f9f61b1008d17543
4
+ data.tar.gz: e8f0100ecb74268688a9802802efde4c6ba69062
5
5
  SHA512:
6
- metadata.gz: 89ebb87139c20ea27858c0deba536ff1613a0f21d5d9cb023d54010df17d64821cd2d26fd66cb55755d522ca4a900d7a787fb5c8273ac267b7b4617c764cf1bb
7
- data.tar.gz: f80071259acd700eadcb9578177827c02f53e256f7567a9001898d88917c76cc7e086d4b211bc68645e24991702b7ddb47482fd376a7bd8543d0758dde8796a6
6
+ metadata.gz: 242a3f0ae99fcd2410bfc2d38ede634b1cb9afcb2c1021c1e6186e1b7bd997f2279ee0f1cddfe07e86c88bf2362b6d3ecdbd356d03dd0c006b994484e39ad8eb
7
+ data.tar.gz: f6614858391c7f04eaf86595d79b860cd447d47675bb7a7898c79ce65faba8636752a5a2717e27bf2f2deda78dd674f3ea40b65f75824d5222cad5e42a2c3b07
@@ -3,6 +3,7 @@ require 'httparty'
3
3
  module Openlab
4
4
  class Client
5
5
  include HTTParty
6
+ default_timeout 5
6
7
  attr_reader :app_secret
7
8
  format :json
8
9
 
@@ -9,19 +9,24 @@ module Openlab
9
9
  end
10
10
 
11
11
  def search(q, opts = {})
12
- client.get(PROJECTS_PATH, query: { q: q }.merge(opts))
12
+ client.get(path, query: { q: q }.merge(opts))
13
13
  end
14
14
 
15
15
  def create(attributes)
16
- client.post(PROJECTS_PATH, body: { project: attributes })
16
+ client.post(path, body: { project: attributes })
17
17
  end
18
18
 
19
19
  def update(id, attributes)
20
- client.patch("#{PROJECTS_PATH}/#{id}", body: { project: attributes })
20
+ client.patch("#{path}/#{id}", body: { project: attributes })
21
21
  end
22
22
 
23
23
  def destroy(id)
24
- client.delete("#{PROJECTS_PATH}/#{id}")
24
+ client.delete("#{path}/#{id}")
25
25
  end
26
+
27
+ private
28
+ def path
29
+ "#{Openlab.config.api_version_path}#{PROJECTS_PATH}"
30
+ end
26
31
  end
27
32
  end
@@ -1,3 +1,3 @@
1
1
  module Openlab
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/openlab_ruby.rb CHANGED
@@ -17,9 +17,11 @@ module Openlab
17
17
 
18
18
  class Config
19
19
  attr_accessor :app_secret, :base_uri
20
+ attr_reader :api_version_path
20
21
 
21
22
  def initialize
22
23
  @base_uri = nil # have to be defined !
24
+ @api_version_path = '/api/v1'
23
25
  end
24
26
  end
25
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openlab_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Florentin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty