em-ssh 0.6.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ 0.6.1
2
+ - Allow Shell#buffer to be cleared
3
+
1
4
  0.6.0
2
5
  - Disconnect error codes are converted to Ruby exceptions and raised
3
6
  - ChannelOpen error codes are converted to Ruby exceptions and raised
@@ -45,9 +45,16 @@ module EventMachine
45
45
 
46
46
  # @returns[#to_s] Returns a #to_s object describing the dump of the content of the buffers used by
47
47
  # the methods of the interactive module mixed in the host object.
48
- def dump_buffers
48
+ def dump_buffer
49
49
  @buffer.dump
50
50
  end
51
+ # API compatibility with 0.6.0
52
+ alias :dump_buffers :dump_buffer
53
+
54
+ # Remove any data currently in the buffer.
55
+ def clear_buffer!
56
+ @buffer = ''
57
+ end
51
58
 
52
59
  # Wait for a number of seconds until a specified string or regexp is matched by the
53
60
  # data returned from the ssh channel. Optionally send a given string first.
data/lib/em-ssh/shell.rb CHANGED
@@ -184,7 +184,7 @@ module EventMachine
184
184
  @shell = shell
185
185
  shell.extend(EventMachine::Ssh::Connection::Channel::Interactive)
186
186
  shell.line_terminator = @line_terminator if @line_terminator
187
- shell.on(:data) { |data| debug("#{shell.dump_buffers}") }
187
+ shell.on(:data) { |data| debug("#{shell.dump_buffer}") }
188
188
  set_open_status(self)
189
189
  end
190
190
  @opening = false
@@ -340,6 +340,11 @@ module EventMachine
340
340
  shell.wait_for(strregex, {:timeout => @timeout, :log => self }.merge(opts))
341
341
  end
342
342
 
343
+ # Remove any data in the buffer.
344
+ def clear_buffer!
345
+ shell.clear_buffer!
346
+ end
347
+
343
348
  def debug(msg = nil, &blk)
344
349
  super("#{host} #{msg}", &blk)
345
350
  end
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  class Ssh
3
- VERSION='0.6.0'
3
+ VERSION='0.6.1'
4
4
  end # class::Ssh
5
5
  end # module::EventMachine
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-07 00:00:00.000000000 Z
12
+ date: 2013-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine