nebula_ruby 0.2.1 → 0.2.2

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: 58222cdc0243001cbde7c0b8739899fbf4e7332d
4
- data.tar.gz: 6e83cd561ff2dfdd3054423769f2b623a78bc2d1
3
+ metadata.gz: d04bf7843cd93dd2d1166db278831e65fc8fff71
4
+ data.tar.gz: 9532c2d906b4effc3d646f980509dd8de74fe528
5
5
  SHA512:
6
- metadata.gz: 70dec32a9d4649e0517d9c7a027d4cda7ca4ee1e949a5654b1491a20bf49a6edba0ad59f079a4399e443d1964f8d41881bcf23d9316621aee7949b8d39a70f67
7
- data.tar.gz: 81f85d08faccddce5e7a1032dc47f377b86ce7e3b3a15773ed29609c0d85712c401632e2c588a07b2a5fd8dc5fafb2a9531ae631697dc5c934975d082e4c9ddb
6
+ metadata.gz: 25e9d8f355a2c0af3268ddd2f46a917a10fb8a386a792f494046c7c7476779b1917135b3408032e2d492f3114e2e6715c84d8249b593b42c9621b99d95fd7610
7
+ data.tar.gz: 9e110b979dc62c3c0c369077fa1d7128a07c173e21d57eb17213befb5be25a0981624fbfb8b5f688945e5e4346c62da9c49627194f2ff9a8439ae60f3e5d6881
data/README.md CHANGED
@@ -25,7 +25,7 @@ to make authenticated calls.
25
25
  ```ruby
26
26
  require 'nebula'
27
27
 
28
- client = Nebula::Client.new(token: '<redacted>', url: '<redacted>')
28
+ client = Nebula::Client.new(token: '<redacted>', url: '<redacted>', base_path: '<redacted>')
29
29
  ```
30
30
 
31
31
  ### Tokens
data/lib/nebula/client.rb CHANGED
@@ -8,11 +8,12 @@ module Nebula
8
8
  def initialize(options={})
9
9
  @token = options[:token]
10
10
  @url = options[:url]
11
+ @base_path = options[:base_path]
11
12
  end
12
13
 
13
14
  def request(type, path, params={})
14
15
  block = Proc.new do |request|
15
- request.url path
16
+ request.url "#{base_path}#{path}"
16
17
  request.headers['Authorization'] = "Token #{token}"
17
18
  request.headers['Content-Type'] = 'application/json'
18
19
  end
@@ -53,6 +54,10 @@ module Nebula
53
54
  @url
54
55
  end
55
56
 
57
+ def base_path
58
+ @base_path
59
+ end
60
+
56
61
  def connection
57
62
  @connection ||= Faraday.new(url: url) do |b|
58
63
  b.adapter Faraday.default_adapter
@@ -1,3 +1,3 @@
1
1
  module Nebula
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nebula_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amed Rodriguez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-20 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler