buffer 0.1.2 → 0.1.3
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 +5 -5
- data/README.md +4 -0
- data/lib/buffer/client.rb +8 -5
- data/lib/buffer/core.rb +2 -2
- data/lib/buffer/version.rb +1 -1
- data/spec/lib/buffer_spec.rb +6 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2979d9173fcb68068c5e8d391da7e7290460addd043d464a18a12d5a72c4f332
|
4
|
+
data.tar.gz: 864c9caf44a4280345a8be69659eb4df5e9ebdbe92e8e18806eda92b0e4512f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8ecb2f90919fdf99815b669b96b9096643eb13376fc2ef051e59c55d9ca4972bb5b0fec217a7b8bb7d52b7d13bf0fa68e85f52c493f220664306417917d6a98
|
7
|
+
data.tar.gz: '0803727795ac7e0e21c1f60b6274dca944fe31f4ddee2abf3cc535704d72e9ad8573d703048f2e3efadd09463a234471f541ba9b47ab6a27ca2853388b799385'
|
data/README.md
CHANGED
@@ -40,6 +40,10 @@ export BUFFER_ACCESS_TOKEN="1/jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj" # (BufferApp OAu
|
|
40
40
|
export BUFFER_PROFILE_ID="0" # (default of 0)
|
41
41
|
```
|
42
42
|
|
43
|
+
If you wish to post to multiple ids from the commandline, BUFFER_PROFILE_ID accepts a
|
44
|
+
comma delimited array of integers, ie `BUFFER_PROFILE_ID="0,1"`. This will post to both
|
45
|
+
0 and 1 index in your profiles list.
|
46
|
+
|
43
47
|
## Access Token Instructions
|
44
48
|
|
45
49
|
#### How to Get Started:
|
data/lib/buffer/client.rb
CHANGED
@@ -9,18 +9,21 @@ module Buffer
|
|
9
9
|
|
10
10
|
attr_accessor :access_token
|
11
11
|
|
12
|
+
URL = 'https://api.bufferapp.com/1/'.freeze
|
13
|
+
|
12
14
|
def initialize(access_token)
|
13
15
|
@access_token = access_token
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
end
|
17
|
+
|
18
|
+
def connection
|
19
|
+
@connection ||= Faraday.new(url: URL) do |faraday|
|
20
|
+
faraday.request :url_encoded
|
21
|
+
faraday.adapter Faraday.default_adapter
|
18
22
|
end
|
19
23
|
end
|
20
24
|
|
21
25
|
def auth_query
|
22
26
|
{ access_token: @access_token }
|
23
27
|
end
|
24
|
-
|
25
28
|
end
|
26
29
|
end
|
data/lib/buffer/core.rb
CHANGED
@@ -9,7 +9,7 @@ module Buffer
|
|
9
9
|
|
10
10
|
def get(path, options = {})
|
11
11
|
options.merge!(auth_query)
|
12
|
-
response =
|
12
|
+
response = connection.get do |req|
|
13
13
|
req.url path.remove_leading_slash
|
14
14
|
req.params = options
|
15
15
|
end
|
@@ -20,7 +20,7 @@ module Buffer
|
|
20
20
|
def post(path, options = {})
|
21
21
|
params = merge_auth_token_and_query(options)
|
22
22
|
params.merge!(options)
|
23
|
-
response =
|
23
|
+
response = connection.post do |req|
|
24
24
|
req.url path.remove_leading_slash
|
25
25
|
req.headers['Content-Type'] = "application/x-www-form-urlencoded"
|
26
26
|
req.body = options[:body]
|
data/lib/buffer/version.rb
CHANGED
data/spec/lib/buffer_spec.rb
CHANGED
@@ -13,6 +13,12 @@ describe Buffer::Client do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
describe "#connection" do
|
17
|
+
it "assigns the connection instance variable" do
|
18
|
+
subject.connection.should eq(subject.instance_variable_get(:@connection))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
16
22
|
describe "#info" do
|
17
23
|
before do
|
18
24
|
stub_request(:get, "#{base_path}/info/configuration.json?access_token=some_token").
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ZPH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
294
|
version: '0'
|
295
295
|
requirements: []
|
296
296
|
rubyforge_project:
|
297
|
-
rubygems_version: 2.
|
297
|
+
rubygems_version: 2.7.6
|
298
298
|
signing_key:
|
299
299
|
specification_version: 4
|
300
300
|
summary: Buffer is an API Wrapper Gem for Bufferapp.com's API
|
@@ -320,4 +320,3 @@ test_files:
|
|
320
320
|
- spec/lib/buffer_spec.rb
|
321
321
|
- spec/lib/core_spec.rb
|
322
322
|
- spec/spec_helper.rb
|
323
|
-
has_rdoc:
|