Skip to content

Commit 611264f

Browse files
committed
Renamed Buff internals to Buffer
1 parent 4d5eb83 commit 611264f

28 files changed

Lines changed: 107 additions & 87 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ notes.txt
2020
spec/fixtures/updates_by_profile_id_sent.txt
2121
utility.rb
2222
tags
23-
vendor/
23+
vendor

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source 'https://rubygems.org'
22

3-
# Specify your gem's dependencies in buff.gemspec
43
gem 'coveralls', require: false
54
gemspec

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Buff
1+
# buffer
22

3-
Buff is a Buffer API Wrapper written in Ruby. It provides more thorough API coverage than the existing gem.
3+
buffer is a Buffer API Wrapper written in Ruby. It provides more thorough API coverage than the existing gem.
44

55
Since the gem is currently in ALPHA development, the interface is prone to change. Please wait until v0.1.0 is released to become reliant on interface. As it stands, all of the basic API calls in BufferApp's spec are available. Some of the optional params are yet to be implemented.
66

@@ -15,25 +15,25 @@ Or
1515

1616
Add this line to your application's Gemfile to include HEAD code:
1717

18-
`gem 'buff', :github => 'bufferapp/buffer-ruby'`
18+
`gem 'buffer', :github => 'bufferapp/buffer-ruby'`
1919

2020
And then execute:
2121

2222
`$ bundle`
2323

2424
Or install RubyGems version, which will receive more attention to stability:
2525

26-
`$ gem install buff`
26+
`$ gem install buffer`
2727

2828
## Usage
2929

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.
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 buffer reaches v0.1.0 and submit issues on Github Issues tab.
3131
* Authentication is not included in this gem (Try OAuth-buffer2) or use the single API key given when registering your own Buffer Dev credentials.
3232
* Commandline bin is provided to enable posting of updates:
33-
`buff Super witty stuff that fits in 140 chars`
33+
`buffer Super witty stuff that fits in 140 chars`
3434
Will post to your first account when setup following instructions below.
3535
_A more convenient setup is planned in future releases._
36-
* For convenience load credentials into `~/.bufferapprc` in the following layout. This allows the `ACCESS_TOKEN` to be loaded into `Buff::ACCESS_TOKEN`:
36+
* For convenience load credentials into `~/.bufferapprc` in the following layout. This allows the `ACCESS_TOKEN` to be loaded into `buffer::ACCESS_TOKEN`:
3737

3838

3939
```

bin/buff renamed to bin/buffer

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
44

5-
require 'buff'
5+
require 'buffer'
66

77
begin
88
require 'yaml'
@@ -24,8 +24,8 @@ rescue
2424
puts "Please upgrade from older config file structure" if ENV['BUFF_DEBUG']
2525
end
2626

27-
client = Buff::Client.new(options['access_token'])
27+
client = Buffer::Client.new(options['access_token'])
2828
id = client.profiles[options['profile_index'].to_i].id
2929

30-
response = client.create_update(body: {text: ARGV.join(" "), profile_ids: [ id ] })
30+
response = client.create_update(body: {text: ARGF.chomp, profile_ids: [ id ] } )
3131
puts response if ENV['BUFF_DEBUG']

buff.gemspec renamed to buffer.gemspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# -*- encoding: utf-8 -*-
22
lib = File.expand_path('../lib', __FILE__)
33
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4-
require 'buff/version'
4+
require 'buffer/version'
55

66
Gem::Specification.new do |gem|
7-
gem.name = "buff"
8-
gem.version = Buff::VERSION
7+
gem.name = "buffer"
8+
gem.version = Buffer::VERSION
99
gem.authors = ["ZPH"]
1010
gem.email = ["[email protected]"]
11-
gem.description = %q{Buff is an API Wrapper Gem for Bufferapp.com's API}
12-
gem.summary = %q{Buff is an API Wrapper Gem for Bufferapp.com's API}
13-
gem.homepage = "http://github.com/zph/buff"
11+
gem.description = %q{Buffer is an API Wrapper Gem for Bufferapp.com's API}
12+
gem.summary = %q{Buffer is an API Wrapper Gem for Bufferapp.com's API}
13+
gem.homepage = "http://github.com/bufferapp/buffer-ruby"
1414

1515
gem.files = `git ls-files`.split($/)
1616
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }

lib/buffer.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require "faraday"
2+
require "faraday_middleware"
3+
require "json"
4+
require "rash"
5+
require "addressable/uri"
6+
7+
require "buffer/version"
8+
require "buffer/core"
9+
require "buffer/user"
10+
require "buffer/profile"
11+
require "buffer/update"
12+
require "buffer/link"
13+
require "buffer/error"
14+
require "buffer/encode"
15+
require "buffer/datastructure"
16+
require "buffer/info"
17+
require "buffer/client"
18+
require "buffer/setup"
19+
20+
module Buffer
21+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Buff
1+
module Buffer
22
class Client
33
include Core
44
include User

lib/buff/core.rb renamed to lib/buffer/core.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'pathname'
22

3-
module Buff
3+
module Buffer
44
begin
55
#TODO: change from #expand_path to Pathname if appropriate
66
# if File.exists?(File.expand_path("~/.bufferapprc"))
@@ -58,7 +58,7 @@ def interpret_response(response)
5858

5959
def handle_response_code(response)
6060
error = Hashie::Mash.new(response.body)
61-
raise Buff::Error::APIError unless error.code
61+
raise Buffer::Error::APIError unless error.code
6262
"Buffer API Error Code: #{error.code}\n" +
6363
"HTTP Code: #{response.code}." +
6464
"Description: #{error.error}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Buff
1+
module Buffer
22
class UserInfo < Hashie::Mash; end
33
class Profile < Hashie::Mash; end
44
class Response < Hashie::Mash; end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Buff
1+
module Buffer
22
class Encode
33
class << self
44
def encode(arg)

0 commit comments

Comments
 (0)