buff 0.0.4 → 0.0.5

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
2
  SHA1:
3
- metadata.gz: 9c37d99d456c1e05e2cd448103b3752b56714b0e
4
- data.tar.gz: 09fbe3cc3a1ddc935a7ce5e0698132569b5c91bf
3
+ metadata.gz: e3add86636c4568dac2c94eb6fd1fa399fbd87c4
4
+ data.tar.gz: 406043f768863c9cebec98b145b8a9f452d44d51
5
5
  SHA512:
6
- metadata.gz: 299b2b1a5989dad8d98547a91948f7344e7035bb205052af01c5cfbb2caf2435a4c7892fd434308c78b0db910475c686f78e2de310390ddd04b612a238583fcb
7
- data.tar.gz: db78b98a6845febd2b830973053031366a32cc436f2437f2840dff1caac7ac799e45c0eacfca63266f7eb662c4ddae3cda16b7fd28ad14e397eeb12a92ad1903
6
+ metadata.gz: 2ce8e4a47720cbed1cf45a3902065392152f7a21978d8fdcd159c8ec5a35fef736804e563ea7e44b3da2eb51dc99c9539013bebc794b97d41e0d8578041fa80b
7
+ data.tar.gz: 5594eb134afac30bbb71e071a50b596dab5a28e4ba18a9b911af8ba3a94a1ab45319370142fe7a9dd519d4c90f533a4c4d28ba16d59550df038fda83f7c49431
@@ -0,0 +1,21 @@
1
+ SUPER_SECRET_AUTH_TOKEN
2
+ 0
3
+
4
+ # How to Get Started:
5
+ # Create a Developer API Token here: http://bufferapp.com/developers/apps/create.
6
+ # Fill in Stuff. Your answers don't matter much for the purpose of this rudimentary setup.
7
+ # Submit that form and wait a short period (~2 min )
8
+ # Visit: http://bufferapp.com/developers/apps
9
+ # Gather Access Token and place it on line 1 of this file.
10
+ # Copy this file to the root of your user's home folder:
11
+ # - ~/.bufferapprc
12
+ # Set Line 2 to 0 if you only have one account to post to. Otherwise it's more complicated ;). Find me on Twitter and I can explain (@_ZPH).
13
+
14
+ # Structure:
15
+ # Line 1: Access Token
16
+ # Line 2: Buffer Account number, ie posting to first account in list, use 0 (ie zero)
17
+ #
18
+ #TODO: convert to yaml and improve instructions
19
+ # remove need for user to create their own App on bufferapp.com
20
+ # Future versions will integrate with Buffer-OAuth system.
21
+
data/README.md CHANGED
@@ -29,20 +29,43 @@ Or install RubyGems version, which will receive more attention to stability:
29
29
 
30
30
  * All methods are tested with Rspec and WebMock. Most methods do not have integration tests that reach out to the live Buffer API servers. Proceed with caution until Buff reaches v0.1.0 and submit issues on Github Issues tab.
31
31
  * Authentication is not included in this gem (Try OAuth-buffer2) or use the single API key given when registering your own Buffer Dev credentials.
32
+ * Commandline bin is provided to enable posting of updates:
33
+ `buff Super witty stuff that fits in 140 chars`
34
+ Will post to your first account when setup following instructions below.
35
+ _A more convenient setup is planned in future releases._
32
36
  * For convenience load credentials into `~/.bufferapprc` in the following layout. This allows the `ACCESS_TOKEN` to be loaded into `Buff::ACCESS_TOKEN`:
33
37
 
34
38
 
35
39
  ```
36
- CLIENT_ID
37
- CLIENT_SECRET
38
40
  ACCESS_TOKEN
41
+ PROFILE_INDEX (default of 0)
39
42
 
40
43
  # Structure:
41
- # client ID line 1
42
- # client secret line 2
43
- # Access Token: line 3
44
+ # Access Token: line 1
45
+ # Profile number, counting from zero
44
46
  ```
45
47
 
48
+ ## Access Token Instructions
49
+
50
+ How to Get Started:
51
+ ====
52
+ * Create a Developer API Token here: http://bufferapp.com/developers/apps/create.
53
+ * Fill in Stuff. Your answers don't matter much for the purpose of this rudimentary setup.
54
+ * Submit that form and wait a short period (~2 min )
55
+ * Visit: http://bufferapp.com/developers/apps
56
+ * Gather Access Token and place it on line 1 of this file.
57
+ * Copy this file to the root of your user's home folder:
58
+ - ~/.bufferapprc
59
+ * Set Line 2 to 0 if you only have one account to post to. Otherwise it's more complicated ;). Find me on Twitter and I can explain [@_ZPH](https://twitter.com/_ZPH).
60
+
61
+ Structure:
62
+ Line 1: Access Token
63
+ Line 2: Buffer Account number, ie posting to first account in list, use 0 (ie zero)
64
+
65
+ TODO: convert to yaml and improve instructions
66
+ remove need for user to create their own App on bufferapp.com
67
+ Future versions will integrate with Buffer-OAuth system.
68
+
46
69
  ## API Coverage
47
70
 
48
71
  #### Implemented
data/bin/buff CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
4
4
 
5
5
  require 'buff'
6
6
 
7
- _, _, access_token, profile_id = File.open(File.expand_path '~/.bufferapprc').readlines.map(&:chomp)
7
+ access_token, profile_id = File.open(File.expand_path '~/.bufferapprc').readlines.map(&:chomp)
8
8
 
9
9
  client = Buff::Client.new(access_token)
10
10
  id = client.profiles[profile_id.to_i].id
data/lib/buff/core.rb CHANGED
@@ -1,9 +1,11 @@
1
+ require 'pathname'
1
2
 
2
3
  module Buff
3
4
  begin
5
+ #TODO: change from #expand_path to Pathname if appropriate
4
6
  if File.exists?(File.expand_path("~/.bufferapprc"))
5
7
  ACCESS_TOKEN = File.open(File.expand_path("~/.bufferapprc")).
6
- readlines[2].chomp
8
+ readlines[0].chomp
7
9
  end
8
10
  rescue => x
9
11
  raise x, "Bufferapprc appears to be malformed"
data/lib/buff/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Buff
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZPH
@@ -214,6 +214,7 @@ executables:
214
214
  extensions: []
215
215
  extra_rdoc_files: []
216
216
  files:
217
+ - .bufferapprc.template
217
218
  - .gitignore
218
219
  - .rubocop.yml
219
220
  - .ruby-version