govdelivery-tms 0.8.8 → 0.8.9

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: 7e500b483edcb3bebee7007ab8ba92e407927e06
4
- data.tar.gz: d51c9c6aa4f0856eb9365f93a1f4f7d8c7716826
3
+ metadata.gz: beaa9bf643b1ed8a2db0bebfcc0c303e1a9eec63
4
+ data.tar.gz: fa153c967d58070a3ee1cdc9a1d0777b8f7f2990
5
5
  SHA512:
6
- metadata.gz: eee2ae6f12a996d5ab439049b91238fb8e193bcc606ef05c1b262090c956a33fb8656138a4c59a71cc57a5d34904ad1d468625f296ad5502723e5ed6bb2e5b52
7
- data.tar.gz: 21247d3dde95fc33fc7a34f9b2e528a9562a0655e5e1daa39cefa5972a38a9afbecf603b2edae54f046ded8249c131e949dc0457003f269727862a2dbe11798a
6
+ metadata.gz: 30130e14bba971fd996209ea4918212be4bfcfea986a322ad68dc9c4d3ab246be61ea6dd78b6531e7fbc813563aa392125d083b27ef217e75c3582bf11f8818a
7
+ data.tar.gz: 179a63f71c4ad59a988d59b0ad1675d9fcc37cf2afa03084ef361fa16de91c45eb5ab6f5ffa32bc048325f2bedfc025422f159537849100ce86e25946178fcbe
@@ -4,7 +4,7 @@ class GovDelivery::TMS::Client
4
4
  include GovDelivery::TMS::Util::HalLinkParser
5
5
  include GovDelivery::TMS::CoreExt
6
6
 
7
- attr_accessor :connection, :href, :api_root, :logger
7
+ attr_accessor :connection, :href, :api_root, :logger, :sid
8
8
 
9
9
  DEFAULTS = { api_root: 'https://tms.govdelivery.com', logger: nil }.freeze
10
10
 
@@ -35,6 +35,7 @@ class GovDelivery::TMS::Client
35
35
 
36
36
  def discover!
37
37
  services = get('/').body
38
+ self.sid = services['sid']
38
39
  parse_links(services['_links'])
39
40
  end
40
41
 
@@ -1,5 +1,5 @@
1
1
  module GovDelivery
2
2
  module TMS #:nodoc:
3
- VERSION = '0.8.8'
3
+ VERSION = '0.8.9'
4
4
  end
5
5
  end
data/spec/client_spec.rb CHANGED
@@ -2,11 +2,14 @@ require 'spec_helper'
2
2
  describe GovDelivery::TMS::Client do
3
3
  context 'creating a new client' do
4
4
  before do
5
- response = double('response', status: 200, body: { '_links' => [{ 'self' => '/' }, { 'horse' => '/horses/new' }, { 'rabbits' => '/rabbits' }] })
5
+ response = double('response', status: 200, body: {'sid' => 'abcd12345', '_links' => [{ 'self' => '/' }, { 'horse' => '/horses/new' }, { 'rabbits' => '/rabbits' }] })
6
6
  @raw_connection = double('raw_connection', get: response)
7
7
  @connection = allow(GovDelivery::TMS::Connection).to receive(:new).and_return(double('connection', connection: @raw_connection))
8
8
  @client = GovDelivery::TMS::Client.new('auth_token', api_root: 'null_url')
9
9
  end
10
+ it 'should populate sid' do
11
+ expect(@client.sid).to eq 'abcd12345'
12
+ end
10
13
  it 'should set up logging' do
11
14
  expect(@client.logger).not_to be_nil
12
15
  expect(@client.logger.level).to eq(Logger::INFO)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govdelivery-tms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - GovDelivery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport