This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

get api key from heroku gem

  • Loading branch information...
ddollar committed Feb 11, 2012
1 parent af2e356 commit caf27cbbe17695b6a54dfb7a8db1206a1624b54b
Showing with 34 additions and 35 deletions.
  1. +13 −2 Gemfile.lock
  2. +10 −23 lib/vulcan/cli.rb
  3. +10 −10 server/package.json
  4. +1 −0 vulcan.gemspec
View
@@ -1,18 +1,29 @@
PATH
remote: .
specs:
vulcan (0.2.5)
vulcan (0.1.4)
heroku (~> 2.20.0)
multipart-post (~> 1.1.3)
rest-client (~> 1.6.7)
thor (~> 0.14.6)
GEM
remote: http://rubygems.org/
specs:
addressable (2.2.6)
heroku (2.20.0)
launchy (>= 0.3.2)
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
launchy (2.0.5)
addressable (~> 2.2.6)
mime-types (1.17.2)
multipart-post (1.1.3)
multipart-post (1.1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.5)
term-ansicolor (1.0.7)
thor (0.14.6)
PLATFORMS
View
@@ -1,4 +1,9 @@
require "digest/sha1"
require "heroku/auth"
require "heroku/command"
require "heroku/command/base"
require "heroku/command/help"
require "heroku/plugin"
require "net/http/post/multipart"
require "rest_client"
require "thor"
@@ -101,32 +106,14 @@ def create(name)
def update
error "no app yet, create first" unless config[:app]
FileUtils.mkdir_p File.expand_path("~/.heroku/plugins/heroku-credentials")
File.open(File.expand_path("~/.heroku/plugins/heroku-credentials/init.rb"), "w") do |file|
file.puts <<-CONTENTS
class Heroku::Auth
def self.api_key
Heroku::Client.auth(user, password, host)["api_key"]
end
end
class Heroku::Command::Credentials < Heroku::Command::Base
# credentials
#
# list your api key
#
def index
puts Heroku::Auth.api_key
end
end
CONTENTS
end
# clean up old plugin, can use auth:token now
FileUtils.rm_rf(File.expand_path("~/.heroku/plugins/heroku-credentials"))
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
api_key = %x{ env BUNDLE_GEMFILE= heroku credentials 2>&1 }.chomp
error "invalid api key detected, try running `heroku credentials`" if api_key =~ / /
Heroku::Plugin.load!
api_key = Heroku::Auth.api_key
error "invalid api key detected, try running `heroku auth:token`" if api_key =~ / /
system "git init"
system "git remote add heroku git@#{heroku_git_domain}:#{config[:app]}.git"
View
@@ -1,16 +1,16 @@
{
"name": "heroku-make",
"version": "0.0.1",
"dependencies": {
"connect-form": "0.2.1",
"cradle": "0.5.8",
"express": "2.5.6",
"knox": "0.0.9",
"node-uuid": "1.3.3",
"restler": "0.2.4"
},
"dependencies": [
"connect-form",
"cradle",
"express",
"knox",
"node-uuid",
"restler"
],
"engines": {
"node": "0.6.x",
"npm": "1.0.x"
"node": ">=0.4.7 <0.6.0",
"npm": ">=1.0.0"
}
}
View
@@ -14,6 +14,7 @@ Gem::Specification.new do |gem|
gem.files = Dir["**/*"].select { |d| d =~ %r{^(README|bin/|data/|ext/|lib/|server/|spec/|test/)} }
gem.add_dependency "heroku", "~> 2.20.0"
gem.add_dependency "multipart-post", "~> 1.1.3"
gem.add_dependency "rest-client", "~> 1.6.7"
gem.add_dependency "thor", "~> 0.14.6"

0 comments on commit caf27cb

Please sign in to comment.