cortex-client 0.1.0 → 0.1.1

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: 14e4d0039502bbee65900225823ccd7f958b0981
4
- data.tar.gz: ac459ec522c256092704e54c9158d07e056d3281
3
+ metadata.gz: 52c91d9ed9913220d2dffdb5f5ba62bdd9203da2
4
+ data.tar.gz: 048fc0c77d4b098fa9457e9d35607b043dd67e4f
5
5
  SHA512:
6
- metadata.gz: 3afa800d12de8481d5e230c10188fdbeee788bb8ed5fb645ee928cd3006d53c6e8f6b92daf2aa4919fdad65e0bd9c8827968a2ba33b40e5ab9925ff7b9653d4c
7
- data.tar.gz: dc6cac4fde0ecaf8044b0ae0c518f637b60e0b9bcb7c669e0278d5a556779021069cd71b78bcef3d1ad3d4c58cd0efa41471237fb37d93a52c252879f790db22
6
+ metadata.gz: 1244ad240d3928ab04f55c3a65c8a2aeba3a36fae7cfdc57e8cc649a5580843614c99d6b2c9adb709ffc6b202bf35d65eabc558efe9738e97e521a2c1de0877f
7
+ data.tar.gz: 13c739389d695629dc14645fa661585e47073d1f6510429d6d546b0605491c38773377d4584b95b42f205889dcc348cbc8be91e5d7a57f628075029df63dc12a
data/README.md CHANGED
@@ -12,19 +12,29 @@ Please note that 0.1.0 and onward now require a hash be passed. You can access t
12
12
  ```ruby
13
13
  require 'cortex-client'
14
14
 
15
- client = Cortex::Client.new(access_token: access_token)
15
+ client = Cortex::Client.new(access_token: 'access_token')
16
16
 
17
17
  client.posts.query().each do |post|
18
18
  puts post
19
19
  end
20
20
  ```
21
21
 
22
- Alternatively, cortex-client will handle
22
+ Alternatively, cortex-client will handle OAuth2 authentication for you:
23
+
24
+ ```ruby
25
+ require 'cortex-client'
26
+
27
+ client = Cortex::Client.new(key: 'my-app-id', secret: 'secrey-key-ssh', base_url: 'base_url')
28
+
29
+ client.posts.query().each do |post|
30
+ puts post
31
+ end
32
+ ```
23
33
 
24
34
  ### Supported Endpoints
25
35
 
26
36
  - *Users* - me, get ,save
27
- - *Posts* - query, get, save, delete
37
+ - *Posts* - query, get, save, delete, feed
28
38
 
29
39
  ### TODO
30
40
  - Handle pagination
@@ -1,3 +1,3 @@
1
1
  module Cortex
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -5,7 +5,7 @@ describe Cortex::Client do
5
5
  let(:access_token) { '123' }
6
6
  let(:base_url) { 'http://localhost:3000' }
7
7
  let(:client) do
8
- Cortex::Client.new(access_token, base_url)
8
+ Cortex::Client.new(access_token: access_token, base_url: base_url)
9
9
  end
10
10
 
11
11
  it 'should preserve settings' do
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Cortex::Posts do
4
4
 
5
- let(:client) { Cortex::Client.new('123') }
5
+ let(:client) { Cortex::Client.new(access_token: '123') }
6
6
 
7
7
  describe :get do
8
8
  it 'should correctly make the request' do
@@ -11,6 +11,13 @@ describe Cortex::Posts do
11
11
  end
12
12
  end
13
13
 
14
+ describe :feed do
15
+ it 'should correctly make the request' do
16
+ client.should_receive(:get).with('/posts/feed').and_return('response')
17
+ client.posts.feed().should == 'response'
18
+ end
19
+ end
20
+
14
21
  describe :save do
15
22
  context 'with an existing post' do
16
23
  it 'should correctly make the request' do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Cortex::Request do
4
- let(:client) { Cortex::Client.new('123') }
4
+ let(:client) { Cortex::Client.new(access_token: '123') }
5
5
 
6
6
  context 'with a cortex error response' do
7
7
  it 'should return the error object' do
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Cortex::Users do
4
4
 
5
- let(:client) { Cortex::Client.new('123') }
5
+ let(:client) { Cortex::Client.new(access_token: '123') }
6
6
 
7
7
  describe :me do
8
8
  it 'should correctly make the request' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cortex-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bennett Goble