console-vmc-plugin 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,11 @@ require "tunnel-vmc-plugin/tunnel"
5
5
 
6
6
 
7
7
  class CFConsole < CFTunnel
8
- def initialize(client, app, port = 10000)
8
+ def initialize(client, app, port = 10000, v2 = false)
9
9
  @client = client
10
10
  @app = app
11
11
  @port = port
12
+ @v2 = v2
12
13
  end
13
14
 
14
15
  def get_connection_info(auth)
@@ -27,7 +28,11 @@ class CFConsole < CFTunnel
27
28
  end
28
29
 
29
30
  def get_credentials
30
- YAML.load(@app.file("app", "cf-rails-console", ".consoleaccess"))
31
+ if @v2
32
+ YAML.load(@app.file("cf-rails-console", ".consoleaccess"))
33
+ else
34
+ YAML.load(@app.file("app", "cf-rails-console", ".consoleaccess"))
35
+ end
31
36
  end
32
37
 
33
38
  def start_console
@@ -157,8 +162,10 @@ class CFConsole < CFTunnel
157
162
  end
158
163
 
159
164
  def exit_console
165
+ @telnet.cmd("String" => "exit", "Timeout" => 1)
166
+ rescue TimeoutError
160
167
  # TimeoutError expected, as exit doesn't return anything
161
- @telnet.cmd("String" => "exit", "Timeout" => 1) rescue TimeoutError
168
+ ensure
162
169
  close_console
163
170
  end
164
171
 
@@ -11,7 +11,7 @@ module VMCConsole
11
11
  def console
12
12
  app = input[:app]
13
13
 
14
- console = CFConsole.new(client, app)
14
+ console = CFConsole.new(client, app, nil, v2?)
15
15
  port = console.pick_port!(input[:port])
16
16
 
17
17
  with_progress("Opening console on port #{c(port, :name)}") do
@@ -23,7 +23,8 @@ module VMCConsole
23
23
  end
24
24
 
25
25
  filter(:start, :start_app) do |app|
26
- if app.framework.name == "rails3"
26
+ if app.framework.name == "rails3" || app.framework.name == "buildpack"
27
+ puts "Setting console to true"
27
28
  app.console = true
28
29
  end
29
30
 
@@ -1,3 +1,3 @@
1
1
  module VMCConsole
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0".freeze
3
3
  end
@@ -1,214 +1,205 @@
1
- require "cfoundry"
2
- require "vmc"
1
+ require "spec_helper"
3
2
  require "console-vmc-plugin/plugin"
4
3
 
5
4
  describe "CFConsole" do
6
- before(:each) do
7
- @app = mock("app")
8
- @console = CFConsole.new(nil, @app)
9
- end
10
-
11
- it "should return connection info for apps that have a console ip and port" do
12
- instance = mock("instance")
13
- @app.should_receive(:instances).and_return([instance])
14
- instance.should_receive(:console).
15
- and_return({:ip => "192.168.1.1", :port => 3344})
16
-
17
- @console.get_connection_info(nil).
18
- should == {"hostname" => "192.168.1.1", "port" => 3344}
19
- end
20
-
21
- it "should raise error when no app instances found" do
22
- @app.should_receive(:instances).and_return([])
23
-
24
- expect { @console.get_connection_info(nil) }.
25
- to raise_error("App has no running instances; try starting it.")
26
- end
27
-
28
- it "should raise error when app does not have console access" do
29
- instance = mock("instance")
30
- @app.should_receive(:instances).and_return([instance])
31
- instance.should_receive(:console).and_return(nil)
32
-
33
- expect { @console.get_connection_info(nil) }.
34
- to raise_error("App does not have console access; try restarting it.")
35
- end
36
-
37
- describe "start_console" do
38
- before(:each) do
39
- @creds = {
40
- :path => %w(app cf-rails-console .consoleaccess),
41
- :yaml => "username: cfuser\npassword: testpw",
42
- :telnet => {"Name" => "cfuser", "Password" => "testpw"}
43
- }
44
-
45
- unless example.metadata[:description_args].first ==
46
- "should raise error if console credentials cannot be obtained"
47
- @app.should_receive(:file).with(*@creds[:path]).
48
- and_return(@creds[:yaml])
49
- @telnet = mock("telnet")
50
- @console.should_receive(:telnet_client).and_return(@telnet)
51
- end
52
- end
53
-
54
- it "should raise error if console credentials cannot be obtained" do
55
- @app.should_receive(:file).with(*@creds[:path]).
56
- and_return("username: cfuser")
57
-
58
- expect { @console.start_console }.
59
- to raise_error("Unable to verify console credentials.")
60
- end
61
-
62
- it "should raise error if authentication fails" do
63
- @telnet.should_receive(:login).with(@creds[:telnet]).
64
- and_return("Login failed")
65
- @telnet.should_receive(:close)
66
-
67
- expect { @console.start_console }.to raise_error("Login failed")
68
- end
69
-
70
- it "should retry authentication on timeout" do
71
- @telnet.should_receive(:login).with(@creds[:telnet]).
72
- and_raise(TimeoutError)
73
- @telnet.should_receive(:login).with(@creds[:telnet]).
74
- and_return("Switch to inspect mode\nirb():001:0> ")
75
- verify_console_exit("irb():001:0> ")
76
5
 
77
- @console.start_console
6
+ context "V1" do
7
+ before do
8
+ @app = mock("app")
9
+ @console = CFConsole.new(nil, @app)
78
10
  end
79
11
 
80
- it "should retry authentication on EOF" do
81
- @console.should_receive(:telnet_client).and_return(@telnet)
82
- @telnet.should_receive(:login).with(@creds[:telnet]).and_raise(EOFError)
83
- @telnet.should_receive(:close)
84
- @telnet.should_receive(:login).with(@creds[:telnet]).
85
- and_return("irb():001:0> ")
86
- verify_console_exit("irb():001:0> ")
12
+ it "should return connection info for apps that have a console ip and port" do
13
+ instance = mock("instance")
14
+ mock(@app).instances { [instance] }
15
+ mock(instance).console { {:ip => "192.168.1.1", :port => 3344} }
87
16
 
88
- @console.start_console
89
- end
90
-
91
- it "should operate console interactively" do
92
- @telnet.should_receive(:login).with(@creds[:telnet]).
93
- and_return("irb():001:0> ")
94
- Readline.should_receive(:readline).with("irb():001:0> ").
95
- and_return("puts 'hi'")
96
- Readline::HISTORY.should_receive(:push).with("puts 'hi'")
97
- @telnet.should_receive(:cmd).with("puts 'hi'").
98
- and_return("nil" + "\n" + "irb():002:0> ")
99
- STDOUT.should_receive(:puts).with("nil")
100
- verify_console_exit("irb():002:0> ")
101
-
102
- @console.start_console
17
+ @console.get_connection_info(nil).should == {
18
+ "hostname" => "192.168.1.1",
19
+ "port" => 3344
20
+ }
103
21
  end
104
22
 
105
- it "should not crash if command times out" do
106
- @telnet.should_receive(:login).with(@creds[:telnet]).
107
- and_return("irb():001:0> ")
108
- Readline.should_receive(:readline).with("irb():001:0> ").
109
- and_return("puts 'hi'")
110
- Readline::HISTORY.should_receive(:push).with("puts 'hi'")
111
- @telnet.should_receive(:cmd).with("puts 'hi'").and_raise(TimeoutError)
112
- STDOUT.should_receive(:puts).with("Timed out sending command to server.")
113
- verify_console_exit("irb():001:0> ")
114
-
115
- @console.start_console
116
- end
23
+ it "should raise error when no app instances found" do
24
+ mock(@app).instances { [] }
117
25
 
118
- it "should raise error if an EOF is received" do
119
- @telnet.should_receive(:login).with(@creds[:telnet]).
120
- and_return("Switch to inspect mode\nirb():001:0> ")
121
- Readline.should_receive(:readline).with("irb():001:0> ").
122
- and_return("puts 'hi'")
123
- Readline::HISTORY.should_receive(:push).with("puts 'hi'")
124
- @telnet.should_receive(:cmd).with("puts 'hi'").and_raise(EOFError)
125
-
126
- expect { @console.start_console }.
127
- to raise_error("The console connection has been terminated. " +
128
- "Perhaps the app was stopped or deleted?")
26
+ expect {
27
+ @console.get_connection_info(nil)
28
+ }.to raise_error("App has no running instances; try starting it.")
129
29
  end
130
30
 
131
- it "should not keep blank lines in history" do
132
- @telnet.should_receive(:login).with(@creds[:telnet]).
133
- and_return("irb():001:0> ")
134
- Readline.should_receive(:readline).with("irb():001:0> ").and_return("")
135
- Readline::HISTORY.should_not_receive(:push).with("")
136
- @telnet.should_receive(:cmd).with("").and_return("irb():002:0*> ")
137
- verify_console_exit("irb():002:0*> ")
31
+ it "should raise error when app does not have console access" do
32
+ instance = mock("instance")
33
+ mock(@app).instances { [instance] }
34
+ mock(instance).console { nil }
138
35
 
139
- @console.start_console
36
+ expect {
37
+ @console.get_connection_info(nil)
38
+ }.to raise_error("App does not have console access; try restarting it.")
140
39
  end
141
40
 
142
- it "should not keep identical commands in history" do
143
- @telnet.should_receive(:login).with(@creds[:telnet]).
144
- and_return("irb():001:0> ")
145
- Readline.should_receive(:readline).with("irb():001:0> ").
146
- and_return("puts 'hi'")
147
- Readline::HISTORY.should_receive(:to_a).and_return(["puts 'hi'"])
148
- Readline::HISTORY.should_not_receive(:push).with("puts 'hi'")
149
- @telnet.should_receive(:cmd).with("puts 'hi'").
150
- and_return("nil" + "\n" + "irb():002:0> ")
151
- STDOUT.should_receive(:puts).with("nil")
152
- verify_console_exit("irb():002:0> ")
153
-
154
- @console.start_console
155
- end
156
-
157
- it "should return tab completion data" do
158
- @telnet.should_receive(:login).with(@creds[:telnet]).
159
- and_return("Switch to inspect mode\nirb():001:0> ")
160
- @telnet.should_receive(:cmd).
161
- with({"String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10}).
162
- and_return("to_s,nil?\n")
163
- verify_console_exit("irb():001:0> ")
41
+ describe "start_console" do
42
+ before do
43
+ @creds = {
44
+ :path => %w(app cf-rails-console .consoleaccess),
45
+ :yaml => "username: cfuser\npassword: testpw",
46
+ :telnet => {"Name" => "cfuser", "Password" => "testpw"}
47
+ }
48
+ end
164
49
 
165
- @console.start_console
166
- Readline.completion_proc.yield("app.").should == ["to_s","nil?"]
167
- end
50
+ context "when console credentials cannot be obtained" do
51
+ it "should raise error" do
52
+ mock(@app).file(*@creds[:path]) { "username: cfuser" }
168
53
 
169
- it "should return tab completion data receiving empty completion string" do
170
- @telnet.should_receive(:login).with(@creds[:telnet]).
171
- and_return("irb():001:0> ")
172
- @telnet.should_receive(:cmd).
173
- with({"String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10}).
174
- and_return("\n")
175
- verify_console_exit("irb():001:0> ")
54
+ expect {
55
+ @console.start_console
56
+ }.to raise_error("Unable to verify console credentials.")
57
+ end
58
+ end
176
59
 
177
- @console.start_console
178
- Readline.completion_proc.yield("app.").should == []
60
+ context "when console credentials can be obtained" do
61
+ before do
62
+ mock(@app).file(*@creds[:path]) { @creds[:yaml] }
63
+ @telnet = Object.new
64
+ mock(@console).telnet_client { @telnet }
65
+ end
66
+
67
+ it "should raise error if authentication fails" do
68
+ mock(@telnet).login(@creds[:telnet]) { "Login failed" }
69
+ mock(@telnet).close
70
+
71
+ expect { @console.start_console }.to raise_error("Login failed")
72
+ end
73
+
74
+ it "should retry authentication on timeout" do
75
+ mock(@telnet).login(@creds[:telnet]) { raise TimeoutError }
76
+ mock(@telnet).login(@creds[:telnet]) { "Switch to inspect mode\nirb():001:0> " }
77
+ verify_console_exit("irb():001:0> ")
78
+
79
+ @console.start_console
80
+ end
81
+
82
+ it "should retry authentication on EOF" do
83
+ mock(@console).telnet_client { @telnet }
84
+ mock(@telnet).login(@creds[:telnet]) { raise EOFError }
85
+ mock(@telnet).close
86
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
87
+ verify_console_exit("irb():001:0> ")
88
+
89
+ @console.start_console
90
+ end
91
+
92
+ it "should operate console interactively" do
93
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
94
+ mock(Readline).readline("irb():001:0> ") { "puts 'hi'" }
95
+ mock(Readline::HISTORY).push("puts 'hi'")
96
+ mock(@telnet).cmd("puts 'hi'") { "nil" + "\n" + "irb():002:0> " }
97
+ mock(@console).puts("nil")
98
+ verify_console_exit("irb():002:0> ")
99
+
100
+ @console.start_console
101
+ end
102
+
103
+ it "should not crash if command times out" do
104
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
105
+ mock(Readline).readline("irb():001:0> ") { "puts 'hi'" }
106
+ mock(Readline::HISTORY).push("puts 'hi'")
107
+ mock(@telnet).cmd("puts 'hi'") { raise TimeoutError }
108
+ mock(@console).puts("Timed out sending command to server.")
109
+ verify_console_exit("irb():001:0> ")
110
+
111
+ @console.start_console
112
+ end
113
+
114
+ it "should raise error if an EOF is received" do
115
+ mock(@telnet).login(@creds[:telnet]) { "Switch to inspect mode\nirb():001:0> " }
116
+ mock(Readline).readline("irb():001:0> ") { "puts 'hi'" }
117
+ mock(Readline::HISTORY).push("puts 'hi'")
118
+ mock(@telnet).cmd("puts 'hi'") { raise EOFError }
119
+
120
+ expect {
121
+ @console.start_console
122
+ }.to raise_error("The console connection has been terminated. Perhaps the app was stopped or deleted?")
123
+ end
124
+
125
+ it "should not keep blank lines in history" do
126
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
127
+ mock(Readline).readline("irb():001:0> ") { "" }
128
+ dont_allow(Readline::HISTORY).push("")
129
+ mock(@telnet).cmd("") { "irb():002:0*> " }
130
+ verify_console_exit("irb():002:0*> ")
131
+
132
+ @console.start_console
133
+ end
134
+
135
+ it "should not keep identical commands in history" do
136
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
137
+ mock(Readline).readline("irb():001:0> ") { "puts 'hi'" }
138
+ mock(Readline::HISTORY).to_a { ["puts 'hi'"] }
139
+ dont_allow(Readline::HISTORY).push("puts 'hi'")
140
+ mock(@telnet).cmd("puts 'hi'") { "nil" + "\n" + "irb():002:0> " }
141
+ mock(@console).puts("nil")
142
+ verify_console_exit("irb():002:0> ")
143
+
144
+ @console.start_console
145
+ end
146
+
147
+ it "should return tab completion data" do
148
+ mock(@telnet).login(@creds[:telnet]) { "Switch to inspect mode\nirb():001:0> " }
149
+ mock(@telnet).cmd("String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10) { "to_s,nil?\n" }
150
+ verify_console_exit("irb():001:0> ")
151
+
152
+ @console.start_console
153
+ Readline.completion_proc.call("app.").should == ["to_s", "nil?"]
154
+ end
155
+
156
+ it "should return tab completion data receiving empty completion string" do
157
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
158
+ mock(@telnet).cmd("String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10) { "\n" }
159
+ verify_console_exit("irb():001:0> ")
160
+
161
+ @console.start_console
162
+ Readline.completion_proc.call("app.").should == []
163
+ end
164
+
165
+ it "should not crash on timeout of remote tab completion data" do
166
+ mock(@telnet).login(@creds[:telnet]) { "Switch to inspect mode\nirb():001:0> " }
167
+ mock(@telnet).cmd("String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10) { raise TimeoutError }
168
+ verify_console_exit("irb():001:0> ")
169
+
170
+ @console.start_console
171
+ Readline.completion_proc.call("app.").should == []
172
+ end
173
+
174
+ it "should properly initialize Readline for tab completion" do
175
+ mock(@telnet).login(@creds[:telnet]) { "irb():001:0> " }
176
+ mock(Readline).respond_to?("basic_word_break_characters=") { true }
177
+ mock(Readline).basic_word_break_characters=(" \t\n`><=;|&{(")
178
+ mock(Readline).completion_append_character=(nil)
179
+ mock(Readline).completion_proc=(anything)
180
+ verify_console_exit("irb():001:0> ")
181
+
182
+ @console.start_console
183
+ end
184
+ end
179
185
  end
186
+ end
180
187
 
181
- it "should not crash on timeout of remote tab completion data" do
182
- @telnet.should_receive(:login).with(@creds[:telnet]).
183
- and_return("Switch to inspect mode\nirb():001:0> ")
184
- @telnet.should_receive(:cmd).
185
- with({"String" => "app.\t", "Match" => /\S*\n$/, "Timeout" => 10}).
186
- and_raise(TimeoutError)
187
- verify_console_exit("irb():001:0> ")
188
-
189
- @console.start_console
190
- Readline.completion_proc.yield("app.").should == []
188
+ context "V2" do
189
+ before do
190
+ @app = mock("app")
191
+ @console = CFConsole.new(nil, @app, nil, true)
191
192
  end
192
193
 
193
- it "should properly initialize Readline for tab completion" do
194
- @telnet.should_receive(:login).with(@creds[:telnet]).
195
- and_return("irb():001:0> ")
196
- Readline.should_receive(:respond_to?).
197
- with("basic_word_break_characters=").and_return(true)
198
- Readline.should_receive(:basic_word_break_characters=).
199
- with(" \t\n`><=;|&{(")
200
- Readline.should_receive(:completion_append_character=).with(nil)
201
- Readline.should_receive(:completion_proc=)
202
- verify_console_exit("irb():001:0> ")
203
-
204
- @console.start_console
194
+ it "reads console credentials from correct file" do
195
+ mock(@app).file(*%w(cf-rails-console .consoleaccess)) { "username: cfuser\npassword: testpw" }
196
+ @console.get_credentials
205
197
  end
206
198
  end
207
199
 
208
200
  def verify_console_exit(prompt)
209
- Readline.should_receive(:readline).with(prompt).and_return("exit")
210
- @telnet.should_receive(:cmd).with(({"String" => "exit", "Timeout" => 1})).
211
- and_raise(TimeoutError)
212
- @telnet.should_receive(:close)
201
+ mock(Readline).readline(prompt) { "exit" }
202
+ mock(@telnet).cmd("String" => "exit", "Timeout" => 1) { raise TimeoutError }
203
+ mock(@telnet).close
213
204
  end
214
- end
205
+ end
@@ -0,0 +1,11 @@
1
+ SPEC_ROOT = File.dirname(__FILE__).freeze
2
+
3
+ require "rspec"
4
+ require "vmc"
5
+ require "cfoundry"
6
+ require "cfoundry/test_support"
7
+
8
+ RSpec.configure do |c|
9
+ c.include Fake::FakeMethods
10
+ c.mock_with :rr
11
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console-vmc-plugin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 4
10
- version: 0.0.4
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Suraci
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-20 00:00:00 -08:00
19
- default_executable:
18
+ date: 2013-02-06 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: tunnel-vmc-plugin
@@ -26,12 +25,12 @@ dependencies:
26
25
  requirements:
27
26
  - - ~>
28
27
  - !ruby/object:Gem::Version
29
- hash: 11
28
+ hash: 23
30
29
  segments:
31
30
  - 0
32
- - 1
33
- - 8
34
- version: 0.1.8
31
+ - 2
32
+ - 0
33
+ version: 0.2.0
35
34
  type: :runtime
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
@@ -40,12 +39,13 @@ dependencies:
40
39
  requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
- - - ">="
42
+ - - ~>
44
43
  - !ruby/object:Gem::Version
45
- hash: 3
44
+ hash: 25
46
45
  segments:
47
46
  - 0
48
- version: "0"
47
+ - 9
48
+ version: "0.9"
49
49
  type: :development
50
50
  version_requirements: *id002
51
51
  - !ruby/object:Gem::Dependency
@@ -56,43 +56,41 @@ dependencies:
56
56
  requirements:
57
57
  - - ~>
58
58
  - !ruby/object:Gem::Version
59
- hash: 3
59
+ hash: 21
60
60
  segments:
61
61
  - 2
62
- - 0
63
- version: "2.0"
62
+ - 11
63
+ version: "2.11"
64
64
  type: :development
65
65
  version_requirements: *id003
66
66
  - !ruby/object:Gem::Dependency
67
- name: vmc
67
+ name: webmock
68
68
  prerelease: false
69
69
  requirement: &id004 !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
72
- - - ">="
72
+ - - ~>
73
73
  - !ruby/object:Gem::Version
74
- hash: -305487662
74
+ hash: 29
75
75
  segments:
76
- - 0
77
- - 4
78
- - 0
79
- - beta
80
- - 42
81
- version: 0.4.0.beta.42
76
+ - 1
77
+ - 9
78
+ version: "1.9"
82
79
  type: :development
83
80
  version_requirements: *id004
84
81
  - !ruby/object:Gem::Dependency
85
- name: ruby-debug19
82
+ name: rr
86
83
  prerelease: false
87
84
  requirement: &id005 !ruby/object:Gem::Requirement
88
85
  none: false
89
86
  requirements:
90
- - - ">="
87
+ - - ~>
91
88
  - !ruby/object:Gem::Version
92
- hash: 3
89
+ hash: 15
93
90
  segments:
91
+ - 1
94
92
  - 0
95
- version: "0"
93
+ version: "1.0"
96
94
  type: :development
97
95
  version_requirements: *id005
98
96
  description:
@@ -106,61 +104,59 @@ extra_rdoc_files: []
106
104
 
107
105
  files:
108
106
  - Rakefile
109
- - lib/console-vmc-plugin/version.rb
110
- - lib/console-vmc-plugin/plugin.rb
111
107
  - lib/console-vmc-plugin/console.rb
112
- - spec/console_spec.rb
113
- - spec/assets/rails328_ruby187_app/doc/README_FOR_APP
114
- - spec/assets/rails328_ruby187_app/app/controllers/application_controller.rb
115
- - spec/assets/rails328_ruby187_app/app/helpers/application_helper.rb
108
+ - lib/console-vmc-plugin/plugin.rb
109
+ - lib/console-vmc-plugin/version.rb
110
+ - spec/assets/rails328_ruby187_app/app/assets/images/rails.png
116
111
  - spec/assets/rails328_ruby187_app/app/assets/javascripts/application.js
117
112
  - spec/assets/rails328_ruby187_app/app/assets/stylesheets/application.css
118
- - spec/assets/rails328_ruby187_app/app/assets/images/rails.png
113
+ - spec/assets/rails328_ruby187_app/app/controllers/application_controller.rb
114
+ - spec/assets/rails328_ruby187_app/app/helpers/application_helper.rb
119
115
  - spec/assets/rails328_ruby187_app/app/views/layouts/application.html.erb
120
- - spec/assets/rails328_ruby187_app/manifest.yml
121
- - spec/assets/rails328_ruby187_app/script/rails
122
- - spec/assets/rails328_ruby187_app/db/seeds.rb
123
- - spec/assets/rails328_ruby187_app/Gemfile
124
- - spec/assets/rails328_ruby187_app/config/routes.rb
125
- - spec/assets/rails328_ruby187_app/config/environments/production.rb
116
+ - spec/assets/rails328_ruby187_app/config/application.rb
117
+ - spec/assets/rails328_ruby187_app/config/boot.rb
118
+ - spec/assets/rails328_ruby187_app/config/database.yml
119
+ - spec/assets/rails328_ruby187_app/config/environment.rb
126
120
  - spec/assets/rails328_ruby187_app/config/environments/development.rb
121
+ - spec/assets/rails328_ruby187_app/config/environments/production.rb
127
122
  - spec/assets/rails328_ruby187_app/config/environments/test.rb
123
+ - spec/assets/rails328_ruby187_app/config/initializers/backtrace_silencers.rb
128
124
  - spec/assets/rails328_ruby187_app/config/initializers/inflections.rb
129
- - spec/assets/rails328_ruby187_app/config/initializers/wrap_parameters.rb
130
125
  - spec/assets/rails328_ruby187_app/config/initializers/mime_types.rb
131
- - spec/assets/rails328_ruby187_app/config/initializers/session_store.rb
132
- - spec/assets/rails328_ruby187_app/config/initializers/backtrace_silencers.rb
133
126
  - spec/assets/rails328_ruby187_app/config/initializers/secret_token.rb
134
- - spec/assets/rails328_ruby187_app/config/application.rb
135
- - spec/assets/rails328_ruby187_app/config/environment.rb
136
- - spec/assets/rails328_ruby187_app/config/database.yml
137
- - spec/assets/rails328_ruby187_app/config/boot.rb
127
+ - spec/assets/rails328_ruby187_app/config/initializers/session_store.rb
128
+ - spec/assets/rails328_ruby187_app/config/initializers/wrap_parameters.rb
138
129
  - spec/assets/rails328_ruby187_app/config/locales/en.yml
139
- - spec/assets/rails328_ruby187_app/test/test_helper.rb
140
- - spec/assets/rails328_ruby187_app/test/performance/browsing_test.rb
130
+ - spec/assets/rails328_ruby187_app/config/routes.rb
141
131
  - spec/assets/rails328_ruby187_app/config.ru
142
- - spec/assets/rails328_ruby187_app/public/favicon.ico
143
- - spec/assets/rails328_ruby187_app/public/robots.txt
132
+ - spec/assets/rails328_ruby187_app/db/seeds.rb
133
+ - spec/assets/rails328_ruby187_app/doc/README_FOR_APP
134
+ - spec/assets/rails328_ruby187_app/Gemfile
135
+ - spec/assets/rails328_ruby187_app/manifest.yml
136
+ - spec/assets/rails328_ruby187_app/public/404.html
144
137
  - spec/assets/rails328_ruby187_app/public/422.html
145
- - spec/assets/rails328_ruby187_app/public/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png
146
- - spec/assets/rails328_ruby187_app/public/assets/application.js
147
- - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css.gz
148
- - spec/assets/rails328_ruby187_app/public/assets/manifest.yml
149
- - spec/assets/rails328_ruby187_app/public/assets/application.js.gz
138
+ - spec/assets/rails328_ruby187_app/public/500.html
150
139
  - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css
140
+ - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css.gz
141
+ - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js
151
142
  - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js.gz
143
+ - spec/assets/rails328_ruby187_app/public/assets/application.css
152
144
  - spec/assets/rails328_ruby187_app/public/assets/application.css.gz
153
- - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js
145
+ - spec/assets/rails328_ruby187_app/public/assets/application.js
146
+ - spec/assets/rails328_ruby187_app/public/assets/application.js.gz
147
+ - spec/assets/rails328_ruby187_app/public/assets/manifest.yml
148
+ - spec/assets/rails328_ruby187_app/public/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png
154
149
  - spec/assets/rails328_ruby187_app/public/assets/rails.png
155
- - spec/assets/rails328_ruby187_app/public/assets/application.css
156
- - spec/assets/rails328_ruby187_app/public/404.html
150
+ - spec/assets/rails328_ruby187_app/public/favicon.ico
157
151
  - spec/assets/rails328_ruby187_app/public/index.html
158
- - spec/assets/rails328_ruby187_app/public/500.html
159
- - spec/assets/rails328_ruby187_app/README.rdoc
152
+ - spec/assets/rails328_ruby187_app/public/robots.txt
160
153
  - spec/assets/rails328_ruby187_app/Rakefile
161
- - spec/console_functional_spec.rb
162
- - spec/Rakefile
163
- has_rdoc: true
154
+ - spec/assets/rails328_ruby187_app/README.rdoc
155
+ - spec/assets/rails328_ruby187_app/script/rails
156
+ - spec/assets/rails328_ruby187_app/test/performance/browsing_test.rb
157
+ - spec/assets/rails328_ruby187_app/test/test_helper.rb
158
+ - spec/console_spec.rb
159
+ - spec/spec_helper.rb
164
160
  homepage: http://cloudfoundry.com/
165
161
  licenses: []
166
162
 
@@ -190,59 +186,58 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
186
  requirements: []
191
187
 
192
188
  rubyforge_project: console-vmc-plugin
193
- rubygems_version: 1.6.2
189
+ rubygems_version: 1.8.24
194
190
  signing_key:
195
191
  specification_version: 3
196
192
  summary: Port of rails-console to vmc-ng.
197
193
  test_files:
198
- - spec/console_spec.rb
199
- - spec/assets/rails328_ruby187_app/doc/README_FOR_APP
200
- - spec/assets/rails328_ruby187_app/app/controllers/application_controller.rb
201
- - spec/assets/rails328_ruby187_app/app/helpers/application_helper.rb
194
+ - spec/assets/rails328_ruby187_app/app/assets/images/rails.png
202
195
  - spec/assets/rails328_ruby187_app/app/assets/javascripts/application.js
203
196
  - spec/assets/rails328_ruby187_app/app/assets/stylesheets/application.css
204
- - spec/assets/rails328_ruby187_app/app/assets/images/rails.png
197
+ - spec/assets/rails328_ruby187_app/app/controllers/application_controller.rb
198
+ - spec/assets/rails328_ruby187_app/app/helpers/application_helper.rb
205
199
  - spec/assets/rails328_ruby187_app/app/views/layouts/application.html.erb
206
- - spec/assets/rails328_ruby187_app/manifest.yml
207
- - spec/assets/rails328_ruby187_app/script/rails
208
- - spec/assets/rails328_ruby187_app/db/seeds.rb
209
- - spec/assets/rails328_ruby187_app/Gemfile
210
- - spec/assets/rails328_ruby187_app/config/routes.rb
211
- - spec/assets/rails328_ruby187_app/config/environments/production.rb
200
+ - spec/assets/rails328_ruby187_app/config/application.rb
201
+ - spec/assets/rails328_ruby187_app/config/boot.rb
202
+ - spec/assets/rails328_ruby187_app/config/database.yml
203
+ - spec/assets/rails328_ruby187_app/config/environment.rb
212
204
  - spec/assets/rails328_ruby187_app/config/environments/development.rb
205
+ - spec/assets/rails328_ruby187_app/config/environments/production.rb
213
206
  - spec/assets/rails328_ruby187_app/config/environments/test.rb
207
+ - spec/assets/rails328_ruby187_app/config/initializers/backtrace_silencers.rb
214
208
  - spec/assets/rails328_ruby187_app/config/initializers/inflections.rb
215
- - spec/assets/rails328_ruby187_app/config/initializers/wrap_parameters.rb
216
209
  - spec/assets/rails328_ruby187_app/config/initializers/mime_types.rb
217
- - spec/assets/rails328_ruby187_app/config/initializers/session_store.rb
218
- - spec/assets/rails328_ruby187_app/config/initializers/backtrace_silencers.rb
219
210
  - spec/assets/rails328_ruby187_app/config/initializers/secret_token.rb
220
- - spec/assets/rails328_ruby187_app/config/application.rb
221
- - spec/assets/rails328_ruby187_app/config/environment.rb
222
- - spec/assets/rails328_ruby187_app/config/database.yml
223
- - spec/assets/rails328_ruby187_app/config/boot.rb
211
+ - spec/assets/rails328_ruby187_app/config/initializers/session_store.rb
212
+ - spec/assets/rails328_ruby187_app/config/initializers/wrap_parameters.rb
224
213
  - spec/assets/rails328_ruby187_app/config/locales/en.yml
225
- - spec/assets/rails328_ruby187_app/test/test_helper.rb
226
- - spec/assets/rails328_ruby187_app/test/performance/browsing_test.rb
214
+ - spec/assets/rails328_ruby187_app/config/routes.rb
227
215
  - spec/assets/rails328_ruby187_app/config.ru
228
- - spec/assets/rails328_ruby187_app/public/favicon.ico
229
- - spec/assets/rails328_ruby187_app/public/robots.txt
216
+ - spec/assets/rails328_ruby187_app/db/seeds.rb
217
+ - spec/assets/rails328_ruby187_app/doc/README_FOR_APP
218
+ - spec/assets/rails328_ruby187_app/Gemfile
219
+ - spec/assets/rails328_ruby187_app/manifest.yml
220
+ - spec/assets/rails328_ruby187_app/public/404.html
230
221
  - spec/assets/rails328_ruby187_app/public/422.html
231
- - spec/assets/rails328_ruby187_app/public/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png
232
- - spec/assets/rails328_ruby187_app/public/assets/application.js
233
- - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css.gz
234
- - spec/assets/rails328_ruby187_app/public/assets/manifest.yml
235
- - spec/assets/rails328_ruby187_app/public/assets/application.js.gz
222
+ - spec/assets/rails328_ruby187_app/public/500.html
236
223
  - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css
224
+ - spec/assets/rails328_ruby187_app/public/assets/application-7270767b2a9e9fff880aa5de378ca791.css.gz
225
+ - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js
237
226
  - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js.gz
227
+ - spec/assets/rails328_ruby187_app/public/assets/application.css
238
228
  - spec/assets/rails328_ruby187_app/public/assets/application.css.gz
239
- - spec/assets/rails328_ruby187_app/public/assets/application-ccab98dc1abdf097c0af693e20aed861.js
229
+ - spec/assets/rails328_ruby187_app/public/assets/application.js
230
+ - spec/assets/rails328_ruby187_app/public/assets/application.js.gz
231
+ - spec/assets/rails328_ruby187_app/public/assets/manifest.yml
232
+ - spec/assets/rails328_ruby187_app/public/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png
240
233
  - spec/assets/rails328_ruby187_app/public/assets/rails.png
241
- - spec/assets/rails328_ruby187_app/public/assets/application.css
242
- - spec/assets/rails328_ruby187_app/public/404.html
234
+ - spec/assets/rails328_ruby187_app/public/favicon.ico
243
235
  - spec/assets/rails328_ruby187_app/public/index.html
244
- - spec/assets/rails328_ruby187_app/public/500.html
245
- - spec/assets/rails328_ruby187_app/README.rdoc
236
+ - spec/assets/rails328_ruby187_app/public/robots.txt
246
237
  - spec/assets/rails328_ruby187_app/Rakefile
247
- - spec/console_functional_spec.rb
248
- - spec/Rakefile
238
+ - spec/assets/rails328_ruby187_app/README.rdoc
239
+ - spec/assets/rails328_ruby187_app/script/rails
240
+ - spec/assets/rails328_ruby187_app/test/performance/browsing_test.rb
241
+ - spec/assets/rails328_ruby187_app/test/test_helper.rb
242
+ - spec/console_spec.rb
243
+ - spec/spec_helper.rb
@@ -1,13 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- Bundler.require(:default, :development)
4
-
5
- require 'rake/dsl_definition'
6
- require 'rake'
7
- require 'rspec'
8
- require 'rspec/core/rake_task'
9
-
10
- RSpec::Core::RakeTask.new do |t|
11
- t.pattern = "*_spec.rb"
12
- t.rspec_opts = ["--format", "documentation", "--colour"]
13
- end
@@ -1,53 +0,0 @@
1
- require "vmc/spec_helpers"
2
- require "console-vmc-plugin/plugin"
3
-
4
- describe "VMCConsole#console" do
5
- before(:all) do
6
- rails_app = File.expand_path("../assets/rails328_ruby187_app", __FILE__)
7
- @name = "app-#{random_str}"
8
- client.app_by_name(@name).should_not be
9
-
10
- @app = client.app
11
- @app.name = @name
12
- @app.space = client.current_space if client.current_space
13
- @app.framework = client.framework_by_name("rails3")
14
- @app.runtime = client.runtime_by_name("ruby18")
15
- @app.memory = client.is_a?(CFoundry::V2::Client) ? 128 : "128M"
16
- @app.total_instances = 1
17
- @app.console = true
18
- @app.create!
19
-
20
- @app.upload(rails_app)
21
- @app.start!
22
-
23
- @caldecott = client.app_by_name("caldecott")
24
- @caldecott_running = @caldecott.running? if @caldecott
25
- end
26
-
27
- after(:all) do
28
- if created = client.app_by_name(@name)
29
- created.delete!
30
- end
31
-
32
- if @caldecott
33
- client.app_by_name("caldecott").stop! unless @caldecott_running
34
- else
35
- client.app_by_name("caldecott").delete!
36
- end
37
- end
38
-
39
- it "runs with args APP" do
40
- running(:console, :app => @app) do
41
- does("Opening console on port 10000")
42
- kill
43
- end
44
- end
45
-
46
- it "runs with args APP and PORT" do
47
- port = "10024"
48
- running(:console, :app => @app, :port => port) do
49
- does("Opening console on port #{port}")
50
- kill
51
- end
52
- end
53
- end