pogo 2.32.14 → 2.39.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/README.md +0 -2
  2. data/lib/heroku/auth.rb +3 -1
  3. data/lib/heroku/client.rb +8 -5
  4. data/lib/heroku/client/cisaurus.rb +25 -0
  5. data/lib/heroku/client/heroku_postgresql.rb +0 -3
  6. data/lib/heroku/client/rendezvous.rb +2 -1
  7. data/lib/heroku/command.rb +1 -1
  8. data/lib/heroku/command/addons.rb +11 -2
  9. data/lib/heroku/command/apps.rb +105 -20
  10. data/lib/heroku/command/base.rb +1 -1
  11. data/lib/heroku/command/certs.rb +95 -34
  12. data/lib/heroku/command/config.rb +5 -5
  13. data/lib/heroku/command/domains.rb +4 -4
  14. data/lib/heroku/command/fork.rb +160 -0
  15. data/lib/heroku/command/git.rb +19 -20
  16. data/lib/heroku/command/help.rb +18 -2
  17. data/lib/heroku/command/keys.rb +1 -1
  18. data/lib/heroku/command/labs.rb +1 -1
  19. data/lib/heroku/command/logs.rb +3 -56
  20. data/lib/heroku/command/maintenance.rb +2 -2
  21. data/lib/heroku/command/pg.rb +7 -16
  22. data/lib/heroku/command/pgbackups.rb +37 -17
  23. data/lib/heroku/command/ps.rb +82 -35
  24. data/lib/heroku/command/regions.rb +23 -0
  25. data/lib/heroku/command/releases.rb +3 -3
  26. data/lib/heroku/command/run.rb +40 -27
  27. data/lib/heroku/command/sharing.rb +4 -4
  28. data/lib/heroku/command/ssl.rb +7 -25
  29. data/lib/heroku/command/stack.rb +1 -1
  30. data/lib/heroku/helpers/heroku_postgresql.rb +13 -17
  31. data/lib/heroku/helpers/log_displayer.rb +70 -0
  32. data/lib/heroku/plugin.rb +3 -0
  33. data/lib/heroku/updater.rb +11 -2
  34. data/lib/heroku/version.rb +1 -1
  35. data/spec/heroku/auth_spec.rb +10 -0
  36. data/spec/heroku/client/ssl_endpoint_spec.rb +12 -12
  37. data/spec/heroku/client_spec.rb +100 -100
  38. data/spec/heroku/command/addons_spec.rb +63 -59
  39. data/spec/heroku/command/apps_spec.rb +68 -65
  40. data/spec/heroku/command/base_spec.rb +21 -21
  41. data/spec/heroku/command/certs_spec.rb +31 -31
  42. data/spec/heroku/command/config_spec.rb +18 -18
  43. data/spec/heroku/command/db_spec.rb +3 -3
  44. data/spec/heroku/command/domains_spec.rb +13 -13
  45. data/spec/heroku/command/drains_spec.rb +3 -3
  46. data/spec/heroku/command/fork_spec.rb +56 -0
  47. data/spec/heroku/command/git_spec.rb +57 -29
  48. data/spec/heroku/command/labs_spec.rb +8 -8
  49. data/spec/heroku/command/logs_spec.rb +3 -3
  50. data/spec/heroku/command/maintenance_spec.rb +5 -5
  51. data/spec/heroku/command/pg_spec.rb +11 -25
  52. data/spec/heroku/command/pgbackups_spec.rb +13 -8
  53. data/spec/heroku/command/ps_spec.rb +23 -23
  54. data/spec/heroku/command/releases_spec.rb +22 -24
  55. data/spec/heroku/command/run_spec.rb +12 -15
  56. data/spec/heroku/command/sharing_spec.rb +9 -9
  57. data/spec/heroku/command/stack_spec.rb +4 -4
  58. data/spec/heroku/command_spec.rb +12 -12
  59. data/spec/heroku/helpers/heroku_postgresql_spec.rb +35 -14
  60. data/spec/spec_helper.rb +17 -2
  61. data/spec/support/openssl_mock_helper.rb +1 -1
  62. metadata +11 -6
  63. data/spec/heroku/command/ssl_spec.rb +0 -32
@@ -15,8 +15,7 @@ describe Heroku::Helpers::HerokuPostgresql do
15
15
  {
16
16
  "DATABASE_URL" => "postgres://default",
17
17
  "HEROKU_POSTGRESQL_BLACK_URL" => "postgres://black",
18
- "HEROKU_POSTGRESQL_IVORY_URL" => "postgres://default",
19
- "SHARED_DATABASE_URL" => "postgres://shared"
18
+ "HEROKU_POSTGRESQL_IVORY_URL" => "postgres://default"
20
19
  }
21
20
  end
22
21
 
@@ -32,16 +31,38 @@ describe Heroku::Helpers::HerokuPostgresql do
32
31
  ]
33
32
  }
34
33
 
35
- it "resolves DATABASE" do
36
- att = subject.hpg_resolve('DATABASE')
37
- att.display_name.should == "HEROKU_POSTGRESQL_IVORY_URL (DATABASE_URL)"
38
- att.url.should == "postgres://default"
34
+ context "when the DATABASE_URL has query options" do
35
+ let(:app_config_vars) do
36
+ {
37
+ "DATABASE_URL" => "postgres://default?pool=15",
38
+ "HEROKU_POSTGRESQL_BLACK_URL" => "postgres://black",
39
+ "HEROKU_POSTGRESQL_IVORY_URL" => "postgres://default",
40
+ "SHARED_DATABASE_URL" => "postgres://shared"
41
+ }
42
+ end
43
+
44
+ it "resolves DATABASE" do
45
+ att = subject.hpg_resolve('DATABASE')
46
+ att.display_name.should == "HEROKU_POSTGRESQL_IVORY_URL (DATABASE_URL)"
47
+ att.url.should == "postgres://default"
48
+ end
39
49
  end
40
50
 
41
- it "resolves SHARED_DATABASE" do
42
- att = subject.hpg_resolve('SHARED_DATABASE')
43
- att.display_name.should == "SHARED_DATABASE"
44
- att.url.should == "postgres://shared"
51
+ context "when the DATABASE_URL has no query options" do
52
+ let(:app_config_vars) do
53
+ {
54
+ "DATABASE_URL" => "postgres://default",
55
+ "HEROKU_POSTGRESQL_BLACK_URL" => "postgres://black",
56
+ "HEROKU_POSTGRESQL_IVORY_URL" => "postgres://default",
57
+ "SHARED_DATABASE_URL" => "postgres://shared"
58
+ }
59
+ end
60
+
61
+ it "resolves DATABASE" do
62
+ att = subject.hpg_resolve('DATABASE')
63
+ att.display_name.should == "HEROKU_POSTGRESQL_IVORY_URL (DATABASE_URL)"
64
+ att.url.should == "postgres://default"
65
+ end
45
66
  end
46
67
 
47
68
  it "resolves default using NAME" do
@@ -87,14 +108,14 @@ describe Heroku::Helpers::HerokuPostgresql do
87
108
  end
88
109
 
89
110
  it "throws an error if it doesnt exist" do
90
- subject.should_receive(:error).with("Unknown database: violet. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL, SHARED_DATABASE")
111
+ subject.should_receive(:error).with("Unknown database: violet. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL")
91
112
  subject.hpg_resolve("violet")
92
113
  end
93
114
 
94
115
  context "default" do
95
116
 
96
117
  it "errors if there is no default" do
97
- subject.should_receive(:error).with("Unknown database. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL, SHARED_DATABASE")
118
+ subject.should_receive(:error).with("Unknown database. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL")
98
119
  subject.hpg_resolve(nil)
99
120
  end
100
121
 
@@ -112,13 +133,13 @@ describe Heroku::Helpers::HerokuPostgresql do
112
133
 
113
134
  it 'throws an error if given an empty string and asked for the default and there is no default' do
114
135
  app_config_vars.delete 'DATABASE_URL'
115
- subject.should_receive(:error).with("Unknown database. Valid options are: HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL, SHARED_DATABASE")
136
+ subject.should_receive(:error).with("Unknown database. Valid options are: HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL")
116
137
  att = subject.hpg_resolve('', "DATABASE_URL")
117
138
  end
118
139
 
119
140
  it 'throws an error if given an empty string and asked for the default and the default doesnt match' do
120
141
  app_config_vars['DATABASE_URL'] = 'something different'
121
- subject.should_receive(:error).with("Unknown database. Valid options are: HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL, SHARED_DATABASE")
142
+ subject.should_receive(:error).with("Unknown database. Valid options are: HEROKU_POSTGRESQL_BLACK_URL, HEROKU_POSTGRESQL_IVORY_URL")
122
143
  att = subject.hpg_resolve('', "DATABASE_URL")
123
144
  end
124
145
 
@@ -31,7 +31,7 @@ end
31
31
 
32
32
  def prepare_command(klass)
33
33
  command = klass.new
34
- command.stub!(:app).and_return("myapp")
34
+ command.stub!(:app).and_return("example")
35
35
  command.stub!(:ask).and_return("")
36
36
  command.stub!(:display)
37
37
  command.stub!(:hputs)
@@ -50,7 +50,7 @@ def execute(command_line)
50
50
  object, method = Heroku::Command.prepare_run(command, args)
51
51
 
52
52
  any_instance_of(Heroku::Command::Base) do |base|
53
- stub(base).app.returns("myapp")
53
+ stub(base).app.returns("example")
54
54
  end
55
55
 
56
56
  stub(Heroku::Auth).get_credentials.returns(['email@example.com', 'apikey01'])
@@ -61,6 +61,11 @@ def execute(command_line)
61
61
  $stdin = captured_stdin = StringIO.new
62
62
  $stderr = captured_stderr = StringIO.new
63
63
  $stdout = captured_stdout = StringIO.new
64
+ class << captured_stdout
65
+ def tty?
66
+ true
67
+ end
68
+ end
64
69
 
65
70
  begin
66
71
  object.send(method)
@@ -158,6 +163,16 @@ def stub_rendezvous
158
163
  end
159
164
  end
160
165
 
166
+ def stub_cisaurus
167
+ @stub_cisaurus ||= begin
168
+ stub_cisaurus = nil
169
+ any_instance_of(Heroku::Client::Cisaurus) do |cisaurus|
170
+ stub_cisaurus = stub(cisaurus)
171
+ end
172
+ stub_cisaurus
173
+ end
174
+ end
175
+
161
176
  def with_blank_git_repository(&block)
162
177
  sandbox = File.join(Dir.tmpdir, "heroku", Process.pid.to_s)
163
178
  FileUtils.mkdir_p(sandbox)
@@ -1,5 +1,5 @@
1
1
  def mock_openssl
2
- @ctx_mock = mock "SSLContext", :key= => nil, :cert= => nil
2
+ @ctx_mock = mock "SSLContext", :key= => nil, :cert= => nil, :ssl_version= => nil
3
3
  @tcp_socket_mock = mock "TCPSocket", :close => true
4
4
  @ssl_socket_mock = mock "SSLSocket", :sync= => true, :connect => true, :close => true, :to_io => $stdin
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pogo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.32.14
4
+ version: 2.39.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,16 +9,16 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-18 00:00:00.000000000 Z
12
+ date: 2013-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: heroku-api
15
+ name: pogoapp-api
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.3.5
21
+ version: 0.3.7
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.3.5
29
+ version: 0.3.7
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: netrc
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +105,7 @@ files:
105
105
  - lib/heroku/auth.rb
106
106
  - lib/heroku/cli.rb
107
107
  - lib/heroku/client.rb
108
+ - lib/heroku/client/cisaurus.rb
108
109
  - lib/heroku/client/heroku_postgresql.rb
109
110
  - lib/heroku/client/pgbackups.rb
110
111
  - lib/heroku/client/rendezvous.rb
@@ -121,6 +122,7 @@ files:
121
122
  - lib/heroku/command/db.rb
122
123
  - lib/heroku/command/domains.rb
123
124
  - lib/heroku/command/drains.rb
125
+ - lib/heroku/command/fork.rb
124
126
  - lib/heroku/command/git.rb
125
127
  - lib/heroku/command/help.rb
126
128
  - lib/heroku/command/keys.rb
@@ -131,6 +133,7 @@ files:
131
133
  - lib/heroku/command/pgbackups.rb
132
134
  - lib/heroku/command/plugins.rb
133
135
  - lib/heroku/command/ps.rb
136
+ - lib/heroku/command/regions.rb
134
137
  - lib/heroku/command/releases.rb
135
138
  - lib/heroku/command/run.rb
136
139
  - lib/heroku/command/sharing.rb
@@ -145,6 +148,7 @@ files:
145
148
  - lib/heroku/excon.rb
146
149
  - lib/heroku/helpers.rb
147
150
  - lib/heroku/helpers/heroku_postgresql.rb
151
+ - lib/heroku/helpers/log_displayer.rb
148
152
  - lib/heroku/plugin.rb
149
153
  - lib/heroku/updater.rb
150
154
  - lib/heroku/version.rb
@@ -165,6 +169,7 @@ files:
165
169
  - spec/heroku/command/db_spec.rb
166
170
  - spec/heroku/command/domains_spec.rb
167
171
  - spec/heroku/command/drains_spec.rb
172
+ - spec/heroku/command/fork_spec.rb
168
173
  - spec/heroku/command/git_spec.rb
169
174
  - spec/heroku/command/help_spec.rb
170
175
  - spec/heroku/command/keys_spec.rb
@@ -178,7 +183,6 @@ files:
178
183
  - spec/heroku/command/releases_spec.rb
179
184
  - spec/heroku/command/run_spec.rb
180
185
  - spec/heroku/command/sharing_spec.rb
181
- - spec/heroku/command/ssl_spec.rb
182
186
  - spec/heroku/command/stack_spec.rb
183
187
  - spec/heroku/command/status_spec.rb
184
188
  - spec/heroku/command/version_spec.rb
@@ -219,3 +223,4 @@ signing_key:
219
223
  specification_version: 3
220
224
  summary: Client library and CLI to deploy apps on Pogoapp.
221
225
  test_files: []
226
+ has_rdoc:
@@ -1,32 +0,0 @@
1
- require "spec_helper"
2
- require "heroku/command/ssl"
3
-
4
- module Heroku::Command
5
- describe Ssl do
6
-
7
- it "adds ssl certificates to domains" do
8
- File.should_receive(:exists?).with('.git').and_return(false)
9
- File.should_receive(:exists?).with('my.crt').and_return(true)
10
- File.should_receive(:read).with('my.crt').and_return('crt contents')
11
- File.should_receive(:exists?).with('my.key').and_return(true)
12
- File.should_receive(:read).with('my.key').and_return('key contents')
13
- expires_at = Time.now + 60 * 60 * 24 * 365
14
- stub_core.add_ssl('myapp', 'crt contents', 'key contents').returns({"domain" => "example.com", "expires_at" => expires_at})
15
- stderr, stdout = execute("ssl:add my.crt my.key")
16
- stderr.should == ""
17
- stdout.should == <<-STDOUT
18
- Added certificate to example.com, expiring at #{expires_at}
19
- STDOUT
20
- end
21
-
22
- it "removes certificates" do
23
- stub_core.remove_ssl('myapp', 'example.com')
24
- stderr, stdout = execute("ssl:remove example.com")
25
- stderr.should == ""
26
- stdout.should == <<-STDOUT
27
- Removed certificate from example.com
28
- STDOUT
29
- end
30
-
31
- end
32
- end