Created
November 11, 2009 07:55
Revisions
-
matthewtodd revised this gist
Nov 11, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -wKU # I use 2 different Heroku accounts, one for my own apps and one for Amani's. # This script givens me a reasonable way to switch between them, with a little -
matthewtodd revised this gist
Nov 11, 2009 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,16 +7,16 @@ require 'pathname' require 'yaml' credentials = Pathname.new(ENV['HOME']).join('.heroku', 'credentials') config = YAML.load(DATA) current_user = credentials.readlines.first.chomp available_users = config.keys - [current_user] selected_user = available_users.abbrev[ARGV.shift] if password = config[selected_user] puts "Re-authenticating as #{selected_user}." credentials.open('w') do |file| file.puts(selected_user) file.puts(password) end -
matthewtodd revised this gist
Nov 11, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ config = YAML.load(DATA) current_user = file.readlines.first.chomp available_users = config.keys - [current_user] selected_user = available_users.abbrev[ARGV.shift] if password = config[selected_user] -
matthewtodd renamed this gist
Nov 11, 2009 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
matthewtodd created this gist
Nov 11, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/usr/bin/env ruby # I use 2 different Heroku accounts, one for my own apps and one for Amani's. # This script givens me a reasonable way to switch between them, with a little # less typing than moving a symlink around. And I get to use abbrev! require 'abbrev' require 'pathname' require 'yaml' file = Pathname.new(ENV['HOME']).join('.heroku', 'credentials') config = YAML.load(DATA) current_user = file.readlines.first.chomp available_users = config.keys.sort - [current_user] selected_user = available_users.abbrev[ARGV.shift] if password = config[selected_user] puts "Re-authenticating as #{selected_user}." file.open('w') do |file| file.puts(selected_user) file.puts(password) end else puts "You are #{current_user}." end __END__ [email protected]: ELIDED [email protected]: ELIDED