socialfred 0.2.0 → 0.2.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
  SHA256:
3
- metadata.gz: a7508235c71840e1bbf248ff2606e33501b550b2d2e0a5ab0488b6c8aeee3767
4
- data.tar.gz: 8abcd2bc7efa8aeb5e3b98ed158a6add5c85e5f2a7c8ce39bf0c235f86f8deeb
3
+ metadata.gz: cdf0d16bc214f06cf82bbece379057ab5027a2b4332cff4bf54f967f8e93a1e8
4
+ data.tar.gz: 5d53c8d181642879d89ce77d72bae239522880cf1d3904fa4f9587c0dad841c8
5
5
  SHA512:
6
- metadata.gz: 28fc572e05b9ee22247c748ea6820d07fea8cafe4544d93266b27a40f33d5896245c365a3fec28b546895c945d5a2219758db571eb7918b172c071e5c45a9bf7
7
- data.tar.gz: 9c42a0003e1977414070d76ef623bd718f7fc445449ace40f8e2dd8e45f709ef7c29229ede45e1a1a37e4883964d2edbcc8ee1090e0f28138b0bfad48cc18cf5
6
+ metadata.gz: ec533b07db247b4c2d720b2b66f7c7fa0ee58284670126f5e50d30a9e261e0dcba1f161e0bea18f5b90f9f4476f3a5618b4aa5e4ade24d4365135281d2c9bf41
7
+ data.tar.gz: 857112d106a002a7315ed12018e8bab8a0e3af96e461abcba9c69b004cfb1e19b32c0053e0d93fea49f04e91e7ccb1e7e3191f42faa690e339bf221f457d011c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- socialfred (0.2.0)
4
+ socialfred (0.2.1)
5
5
  faraday (>= 0.9.0)
6
6
  json (~> 2.2)
7
7
 
@@ -32,7 +32,10 @@ module Socialfred
32
32
  def create(publish_at: nil, text:, images: nil, options: nil)
33
33
  publish_at = Time.parse(publish_at.to_s).iso8601 if publish_at
34
34
  parameters = { social_post: { published_at: publish_at, text: text, images: images, options: options }.compact }
35
- response = conn.post(ENDPOINT, parameters)
35
+ response = conn.post(ENDPOINT) do |req|
36
+ req.headers[:content_type] = 'application/json'
37
+ req.body = JSON.generate(parameters)
38
+ end
36
39
 
37
40
  raise Socialfred::Error unless response.status == 200
38
41
 
@@ -42,7 +45,10 @@ module Socialfred
42
45
  def update(social_post_id, publish_at: nil, text:, images: nil, options: nil)
43
46
  publish_at = Time.parse(publish_at.to_s).iso8601 if publish_at
44
47
  parameters = { social_post: { published_at: publish_at, text: text, images: images, options: options }.compact }
45
- response = conn.put(ENDPOINT + "/#{social_post_id}", parameters)
48
+ response = conn.put(ENDPOINT + "/#{social_post_id}") do |req|
49
+ req.headers[:content_type] = 'application/json'
50
+ req.body = JSON.generate(parameters)
51
+ end
46
52
 
47
53
  raise Socialfred::Error unless response.status == 200
48
54
 
@@ -61,8 +67,6 @@ module Socialfred
61
67
 
62
68
  def conn
63
69
  @conn ||= Faraday.new(url: api_url) do |faraday|
64
- faraday.request :multipart
65
- faraday.request :url_encoded
66
70
  faraday.adapter Faraday.default_adapter
67
71
  faraday.headers['Api-Key'] = api_key
68
72
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Socialfred
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialfred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Krasnoperov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday