This repository was archived by the owner on Mar 5, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,17 +7,25 @@ require 'buff'
77begin
88 require 'yaml'
99
10+ rc_file_path = File . expand_path ( '~/.bufferapprc' )
11+ raise Errno ::ENOENT unless File . exists? ( rc_file_path )
12+
1013 options = YAML . load_file ( File . expand_path ( '~/.bufferapprc' ) )
1114 if options . class == String
12- options [ 'access_token' ] , options [ 'profile_index' ] = options . split
15+ options_str = options . dup
16+ options = Hash . new
17+ options [ 'access_token' ] , options [ 'profile_index' ] = options_str . split
1318 options [ 'verion' ] = '0.0.0'
1419 end
20+ rescue Errno ::ENOENT
21+ puts "You're missing the ~/.bufferapprc file. See the README for info."
22+ exit 1
1523rescue
1624 puts "Please upgrade from older config file structure" if ENV [ 'BUFF_DEBUG' ]
1725end
1826
1927client = Buff ::Client . new ( options [ 'access_token' ] )
2028id = client . profiles [ options [ 'profile_index' ] . to_i ] . id
2129
22- response = client . create_update ( body : { text : ARGV . join ( " " ) , profile_ids : [ id ] } )
30+ response = client . create_update ( body : { text : ARGV . join ( " " ) , profile_ids : [ id ] } )
2331puts response if ENV [ 'BUFF_DEBUG' ]
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def get(path, options = {})
2929
3030 def post ( path , options = { } )
3131 params = merge_auth_token_and_query ( options )
32+ params . merge! ( options )
3233 response = @connection . post do |req |
3334 req . url path . remove_leading_slash
3435 req . headers [ 'Content-Type' ] = "application/x-www-form-urlencoded"
You can’t perform that action at this time.
0 commit comments