fulmar-shell 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fulmar/shell.rb +27 -18
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07c5c0cf088d46e90387950e52896969cf0db870
|
4
|
+
data.tar.gz: b78a90442cd9754b781d495dceba2e2ca2790cf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 332a535c24266d9ebfdb9388ae97d26ab103cbd64fef6569dbf12d6ac23f37c2328236b58e77245e40faa161f22b885cceef4c7d08d6e66268b5781814d035ab
|
7
|
+
data.tar.gz: d6aa30cc0ae1db82448ead093e46899aaa22c01b4539e77c3d25557a0e098c0e850e8aa9465f9bf8352340ec29e4cb9f42f35c44aa13cfa6ac8733fdcdcca278
|
data/lib/fulmar/shell.rb
CHANGED
@@ -5,7 +5,7 @@ require 'open3'
|
|
5
5
|
module Fulmar
|
6
6
|
# Implements simple access to shell commands
|
7
7
|
class Shell
|
8
|
-
VERSION = '1.6.
|
8
|
+
VERSION = '1.6.1'
|
9
9
|
|
10
10
|
attr_accessor :debug, :last_output, :last_error, :quiet, :strict
|
11
11
|
attr_reader :path
|
@@ -88,25 +88,34 @@ module Fulmar
|
|
88
88
|
def execute(command, error_message)
|
89
89
|
# Ladies and gentleman: More debug, please!
|
90
90
|
puts command if @debug
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
91
|
+
return_value = -1
|
92
|
+
|
93
|
+
Open3.popen3(environment, command) do |_stdin, stdout, stderr, wait_thread|
|
94
|
+
Thread.new do
|
95
|
+
stdout.each do |line|
|
96
|
+
@last_value << line
|
97
|
+
puts line unless @quiet
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
Thread.new do
|
102
|
+
stderr.each do |line|
|
103
|
+
@last_error << line
|
104
|
+
puts line unless @quiet
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
_stdin.close
|
109
|
+
|
110
|
+
return_value = wait_thread.value
|
111
|
+
|
112
|
+
if @strict and return_value != 0
|
113
|
+
dump_error_message(command)
|
114
|
+
fail error_message
|
115
|
+
end
|
107
116
|
end
|
108
117
|
|
109
|
-
|
118
|
+
return_value == 0
|
110
119
|
end
|
111
120
|
|
112
121
|
def escape_for_sh(text)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fulmar-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerrit Visscher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
75
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
76
|
+
rubygems_version: 2.5.1
|
77
77
|
signing_key:
|
78
78
|
specification_version: 4
|
79
79
|
summary: Small service to run shell commands on a local or remote shell
|