console-websocket-cf-plugin 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -43,4 +43,8 @@ $ cf push --reset
43
43
  5 - Start a console
44
44
  ```
45
45
  $ cf console <app name>
46
- ```
46
+ ```
47
+
48
+ Of course you could chose to launch 'bash' and then start 'rails c' from within the shell itself, this is my preferred method. In fact, 'bash' is the default for the -console-process option if it is omitted!
49
+
50
+ **NOTE: At the moment, "exit" tells the plugin to kill the websocket connection and finish the session.**
@@ -24,7 +24,7 @@ module ConsoleWebsocketCfPlugin
24
24
  def receive_line(data)
25
25
  EM.stop if data == "exit"
26
26
  @ws.lines_in << data
27
- @ws.send data.gsub("\n", "")
27
+ @ws.send data
28
28
  end
29
29
 
30
30
  def move_history(direction)
@@ -78,7 +78,10 @@ module ConsoleWebsocketCfPlugin
78
78
  end
79
79
 
80
80
  ws.on :message do |event|
81
- print event.data unless event.data.strip == ws.lines_in.last
81
+ msg = event.data
82
+
83
+ msg = msg[(ws.lines_in.last.length)..(msg.length - 1)].lstrip if msg.start_with?(ws.lines_in.last)
84
+ print msg
82
85
  end
83
86
 
84
87
  ws.on :close do |event|
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console-websocket-cf-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - GoPivotal
8
+ - Dan Higham
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-28 00:00:00.000000000 Z
12
+ date: 2013-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cf