heroku-multi 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bin/heroku-multi +14 -11
- data/heroku-multi.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/bin/heroku-multi
CHANGED
@@ -5,13 +5,15 @@ require 'yaml'
|
|
5
5
|
require 'heroku-multi'
|
6
6
|
|
7
7
|
flag = HerokuMulti.flags
|
8
|
-
|
9
|
-
|
8
|
+
Home = `echo $HOME`.strip
|
9
|
+
CredLocation = "#{Home}/.heroku/credentials"
|
10
|
+
ConfLocation = "#{Home}/.heroku/multi.yml"
|
11
|
+
KeyLocation = "#{Home}/.ssh/id_rsa.pub"
|
10
12
|
|
11
|
-
if File.exists?(
|
12
|
-
cred = File.open(
|
13
|
+
if File.exists?(CredLocation)
|
14
|
+
cred = File.open(CredLocation, 'r').readlines.map{|line| line.strip}
|
13
15
|
|
14
|
-
unless File.exists?(
|
16
|
+
unless File.exists?(ConfLocation)
|
15
17
|
default_conf = [
|
16
18
|
{
|
17
19
|
:name => 'default',
|
@@ -20,26 +22,27 @@ if File.exists?(cred_location)
|
|
20
22
|
}
|
21
23
|
]
|
22
24
|
|
23
|
-
File.open(
|
25
|
+
File.open(ConfLocation, 'w+') do |conf|
|
24
26
|
conf.puts default_conf.to_yaml
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
28
|
-
confs = YAML.load(File.open(
|
30
|
+
confs = YAML.load(File.open(ConfLocation, 'r').read)
|
29
31
|
|
30
32
|
if flag.u?
|
31
33
|
if conf = confs.find{|conf| flag.u == conf[:name] or flag.u == conf[:email]}
|
32
|
-
|
33
|
-
|
34
|
+
key_name = File.open(KeyLocation, 'r').read.match(/[^ ]+$/)[0].strip
|
35
|
+
puts "clearing SSH keys #{key_name}"
|
36
|
+
`heroku keys:remove #{key_name}`
|
34
37
|
|
35
38
|
puts "rewriting credentials"
|
36
|
-
File.open(
|
39
|
+
File.open(CredLocation, 'w+') do |cred_file|
|
37
40
|
cred_file.puts conf[:email]
|
38
41
|
cred_file.puts conf[:password]
|
39
42
|
end
|
40
43
|
|
41
44
|
puts "uploading SSH keys"
|
42
|
-
`heroku keys:add #{
|
45
|
+
`heroku keys:add #{KeyLocation}`
|
43
46
|
|
44
47
|
puts "Switched user to \"#{conf[:email]}\""
|
45
48
|
else
|
data/heroku-multi.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{heroku-multi}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ben Wyrosdick"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-24}
|
13
13
|
s.default_executable = %q{heroku-multi}
|
14
14
|
s.description = %q{Niceities for managing multiple heroku accounts. It uploads SSH keys and replaces credentials}
|
15
15
|
s.email = %q{ben@commonthread.com}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ben Wyrosdick
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-24 00:00:00 -05:00
|
18
18
|
default_executable: heroku-multi
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|