buffer 0.1.2 → 0.1.3

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
- SHA1:
3
- metadata.gz: d221f19af636e707a8aaa8347c8250c9f82a0f2d
4
- data.tar.gz: d5e2cce4e5747447616336dfe57925e3ed01e278
2
+ SHA256:
3
+ metadata.gz: 2979d9173fcb68068c5e8d391da7e7290460addd043d464a18a12d5a72c4f332
4
+ data.tar.gz: 864c9caf44a4280345a8be69659eb4df5e9ebdbe92e8e18806eda92b0e4512f6
5
5
  SHA512:
6
- metadata.gz: 644e52c54def7336f7b79cd9391ea759701591e7d2f7cf28f954f2ea8f986077ff6061e90fbea33da52288d3ec7af338d3b39f5d1bcea0ca82a1831a4db98151
7
- data.tar.gz: e264fe061fa436d855c20dba0962c1a0876bec71256c8b3f5dec5882678b642c65d218c914a7e86bcd188ed02656d131abb1c118404c56a0842d9c2ec19e260e
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:
@@ -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
- url = "https://api.bufferapp.com/1/"
15
- @connection = Faraday.new(url: url) do |faraday|
16
- faraday.request :url_encoded
17
- faraday.adapter Faraday.default_adapter
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
@@ -9,7 +9,7 @@ module Buffer
9
9
 
10
10
  def get(path, options = {})
11
11
  options.merge!(auth_query)
12
- response = @connection.get do |req|
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 = @connection.post do |req|
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]
@@ -1,3 +1,3 @@
1
1
  module Buffer
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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.2
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: 2016-07-04 00:00:00.000000000 Z
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.2.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: