open4ssh 0.1.4 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 859de83020910fb97bfbed4f89e3e32306f526e0
4
- data.tar.gz: f82516949783aa2b4ef1221d28a3a43ae8d876c1
3
+ metadata.gz: ccf88f70ce6864212bb272081720505b596accb1
4
+ data.tar.gz: 2316152b8b85d3457e36f23c9ea7c2ad5b31cab6
5
5
  SHA512:
6
- metadata.gz: 71c18f7d591916475d7898b235b5840b549b67fddab11cb4a50fe0d5fbbe62d082491a8a90f6a5c2669cb50030bca7db211bfecb5d6cc798d6fd68def99f677c
7
- data.tar.gz: 142af0bc569e8812cfa3bf803dad4531d7934a6f7517627d8030ec70fdc1f6506db1caec37d0f5580a2e989cdfd849e5ced9e2ed02e63751ef9d99d6b257d907
6
+ metadata.gz: f2adc8f816a6ddc7823b9d097ee58cc943ddaa62d150a01cbf82842d16ba4424f089f7b6f26802c7760f54bf15a7cea115e4840b1df081e175c6b17f08297973
7
+ data.tar.gz: 33742e1cf386283107c3e1132904f75aa8a7dfb278c5422e7d443846811b012cc4baae0c940665ff013d16831d21e929a4222dddbfe62df6e0f263395ca2d570
data/.travis.yml CHANGED
@@ -1,4 +1,18 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
4
  - 2.2.0
4
- before_install: gem install bundler -v 1.10.6
5
+ - 2.3.0
6
+
7
+ sudo: required
8
+
9
+ services:
10
+ - docker
11
+
12
+ before_install:
13
+ - gem install bundler -v 1.10.6
14
+ - docker pull keto/ssh
15
+ - docker run -d -p 2222:22 -e SSH_PASSWORD=secret -e SSH_USERNAME=nane keto/ssh
16
+
17
+ script:
18
+ - bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## Upcoming Version 0.1.4
3
+ ## Version 0.2.0
4
+
5
+ - Improved unit test coverage.
6
+ - Basic continuous integration using Travis CI.
7
+
8
+ ## Version 0.1.4
4
9
 
5
10
  - Added code coverage
6
11
 
data/README.md CHANGED
@@ -16,8 +16,8 @@ sequence of commands and returns their exit codes, standard out and standard err
16
16
  Open4ssh is most useful in remote automation scenarios which are triggered from Ruby environments.
17
17
 
18
18
  - [RubyGems](https://rubygems.org/gems/open4ssh)
19
- - [CHANGELOG](file.CHANGELOG.html)
20
- - [LICENSE](file.LICENSE.html)
19
+ - Master: [![Build Status](https://travis-ci.org/nkratzke/open4ssh.svg?branch=master)](https://travis-ci.org/nkratzke/open4ssh)
20
+ - Develop: [![Build Status](https://travis-ci.org/nkratzke/open4ssh.svg?branch=develop)](https://travis-ci.org/nkratzke/open4ssh)
21
21
 
22
22
  ## Installation
23
23
 
data/Rakefile CHANGED
@@ -2,6 +2,8 @@ require "bundler/gem_tasks"
2
2
  require 'yard'
3
3
  require 'rake/testtask'
4
4
 
5
+ task :default => :test
6
+
5
7
  Rake::TestTask.new do |t|
6
8
  t.libs << "test"
7
9
  t.test_files = FileList['test/test_*.rb']
@@ -2,5 +2,5 @@ module Open4ssh
2
2
 
3
3
  # Version of Open4ssh according to {http://semver.org semantic versioning}
4
4
  #
5
- VERSION = "0.1.4"
5
+ VERSION = "0.2.0"
6
6
  end
data/lib/open4ssh.rb CHANGED
@@ -37,6 +37,7 @@ module Open4ssh
37
37
  # @param cmd [String] valid shell command string to be executed on host (required)
38
38
  #
39
39
  # @return [String] console output of executed command (output includes stdout and stderr)
40
+ # @raise [One of Net::SSH::Exceptions] In case of net::ssh errors due to connection problems, authentication errors, timeouts, ....
40
41
  #
41
42
  # @example
42
43
  # stdout = Open4ssh.capture(
@@ -69,6 +70,7 @@ module Open4ssh
69
70
  # @param verbose [Bool] console outputs are plotted to stdout/stderr if set (defaults to false)
70
71
  #
71
72
  # @return [exit_code, std_out, std_err] exit_code, stdout, stderr of executed command
73
+ # @raise [One of Net::SSH::Exceptions] In case of net::ssh errors due to connection problems, authentication errors, timeouts, ....
72
74
  #
73
75
  # @example
74
76
  # exit_code, std_err, std_out = Open4ssh.capture3(
@@ -98,6 +100,7 @@ module Open4ssh
98
100
  # @param verbose [Bool] console outputs are plotted to stdout/stderr if set (defaults to false)
99
101
  #
100
102
  # @return [Array<exit_code, std_out, std_err, command>] List of exit_code, stdout, stderr and executed commands
103
+ # @raise [One of Net::SSH::Exceptions] In case of net::ssh errors due to connection problems, authentication errors, timeouts, ....
101
104
  #
102
105
  # @example
103
106
  # exit_code, stderr, stdout, command = Open4ssh.capture4(
@@ -179,8 +182,7 @@ module Open4ssh
179
182
  # end
180
183
  #
181
184
  def self.success(results)
182
- results.select { |result| result[0] != 0 }
183
- .empty?
185
+ results.select { |result| result[0] != 0 }.empty?
184
186
  end
185
187
 
186
188
  # Collects all stdout messages of a list of executed shell commands.
@@ -208,9 +210,8 @@ module Open4ssh
208
210
  # end
209
211
  #
210
212
  def self.stdout(results)
211
- output = results.map { |result| result[1] }
212
- .select { |stdout| not stdout.strip.empty? } * "\n"
213
- output.strip
213
+ results.map { |result| result[1] }
214
+ .select { |stdout| not stdout.strip.empty? } * ''
214
215
  end
215
216
 
216
217
  # Collects all stderr messages of a list of executed shell commands.
@@ -238,9 +239,8 @@ module Open4ssh
238
239
  # end
239
240
  #
240
241
  def self.stderr(results)
241
- output = results.map { |result| result[2] }
242
- .select { |stderr| not stderr.strip.empty? } * "\n"
243
- output.strip
242
+ results.map { |result| result[2] }
243
+ .select { |stderr| not stderr.strip.empty? } * ''
244
244
  end
245
245
 
246
246
  # Collects all console messages (stdout + stderr) of a list of executed shell commands.
@@ -265,9 +265,7 @@ module Open4ssh
265
265
  # puts Open4ssh.console(ecodes) # Print collected console messages of all executed commands
266
266
  #
267
267
  def self.console(results)
268
- output = results.map { |result| "#{result[1]}\n#{result[2]}" }
269
- .select { |console| not console.strip.empty? } * "\n"
270
- output.strip
268
+ results.map { |result| "#{result[1]}#{result[2]}" }
269
+ .select { |console| not console.strip.empty? } * ''
271
270
  end
272
-
273
271
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open4ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nane Kratzke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.4.6
136
+ rubygems_version: 2.4.5.1
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Wrapper around net-ssh for plain execution of remote shell commands.