Skip to content

Commit 7f01baa

Browse files
committed
Merge branch 'develop'
2 parents c718d4c + e3ae664 commit 7f01baa

File tree

7 files changed

+39
-8
lines changed

7 files changed

+39
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.ruby-version
44
Gemfile.lock
55
*.gem
6+
.ruby-version

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Version History
33
* All Version bumps are required to update this file as well!
44
----
55

6+
* 0.10.3 - Stop warnings from FaradayMiddleware and Hashie::Mash
67
* 0.10.2 - Add all_posts function to posts class to retrieve all articles.
78
* 0.10.0:
89
* Utilize `Addressable::URI` as Faraday's default URI parser so that resourceful URI fragments are escaped and parsed properly

cortex-client.gemspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Gem::Specification.new do |s|
1515
s.require_paths = ['lib']
1616

1717
s.add_development_dependency 'rake', '~> 12.0'
18-
s.add_development_dependency 'rspec', '~> 3.5'
18+
s.add_development_dependency 'rspec', '~> 3.6'
1919
s.add_development_dependency 'mocha', '~> 1.2'
2020
s.add_development_dependency 'webmock', '~> 2.3'
2121

22-
s.add_dependency 'oauth2', '~> 1.1'
23-
s.add_dependency 'faraday', '~> 0.9'
24-
s.add_dependency 'faraday_middleware', '~> 0.10'
22+
s.add_dependency 'oauth2', '~> 1.4'
23+
s.add_dependency 'faraday', '~> 0.12'
24+
s.add_dependency 'faraday_middleware', '~> 0.11'
2525
s.add_dependency 'addressable', '~> 2.5'
26-
s.add_dependency 'hashie', '~> 3.4'
26+
s.add_dependency 'hashie', '~> 3.5'
2727
s.add_dependency 'cortex-exceptions', '~> 0.0.4'
2828
end

lib/cortex/client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
require 'cortex/connection'
44
require 'cortex/request'
55
require 'cortex/resource'
6+
require 'cortex/content_items'
67
require 'cortex/posts'
78
require 'cortex/users'
89
require 'cortex/webpages'
910
require 'cortex/result'
1011

1112
module Cortex
1213
class Client
13-
attr_reader :posts, :users, :webpages
14+
attr_reader :posts, :users, :webpages, :content_items
1415
attr_accessor :access_token, :base_url, :auth_method
1516
@key = ''
1617
@secret = ''
@@ -32,6 +33,7 @@ def initialize(hasharg)
3233
@posts = Cortex::Posts.new(self)
3334
@users = Cortex::Users.new(self)
3435
@webpages = Cortex::Webpages.new(self)
36+
@content_items = Cortex::ContentItems.new(self)
3537
end
3638

3739
def get_cc_token

lib/cortex/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def connection
2323
Faraday.new options do |conn|
2424
## Request middleware first:
2525
conn.use Cortex::FaradayMiddleware::NormalizeURIPath
26-
conn.request :oauth2, access_token.is_a?(OAuth2::AccessToken) ? access_token.token : access_token
26+
conn.request :oauth2, access_token.is_a?(OAuth2::AccessToken) ? access_token.token : access_token, token_type: 'param'
2727
conn.request :json
2828

2929
## Response middleware second:

lib/cortex/content_items.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module Cortex
2+
class ContentItems < Cortex::Resource
3+
def query(params = {})
4+
client.get('/content_items', params)
5+
end
6+
7+
def feed(params = {})
8+
client.get('/content_items/feed', params)
9+
end
10+
11+
def get(id)
12+
client.get("/content_items/#{id}")
13+
end
14+
15+
def get_published(id)
16+
client.get("/content_items/feed/#{id}")
17+
end
18+
19+
def save(content_item)
20+
client.save('/content_items', content_item)
21+
end
22+
23+
def delete(id)
24+
client.delete("/content_items/#{id}")
25+
end
26+
end
27+
end

lib/cortex/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Cortex
2-
VERSION = '0.10.2'
2+
VERSION = '0.11.0'
33
end

0 commit comments

Comments
 (0)