Skip to content

Commit

Permalink
Read API token from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwynne committed Sep 29, 2010
1 parent 52d004d commit f7947ef
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/relish/commands/push_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def post(tar_gz_data)
resource = RestClient::Resource.new(url)
resource.post(tar_gz_data, :content_type => 'application/x-gzip')
puts "sent:\n#{files.join("\n")}"
rescue RestClient::ResourceNotFound => exception
warn exception.response
exit 1
rescue RestClient::BadRequest => exception
warn exception.response
exit 1
Expand All @@ -29,13 +32,13 @@ def url
host = @options[:host]
account = @options[:account]
project = @options[:project]
"http://#{host}/pushes?account_id=#{account}&project_id=#{project}"
"http://#{host}/pushes?account_id=#{account}&project_id=#{project}&api_token=#{api_token}"
end

def options
{}
def api_token
File.read("~/.relish/api_token")
end

def features_as_tar_gz
stream = StringIO.new

Expand Down

0 comments on commit f7947ef

Please sign in to comment.