tty-command 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/tty/command/execute.rb +4 -6
- data/lib/tty/command/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 858fdf67fb28440aac840d0d2cddcc619d2b8d57
|
4
|
+
data.tar.gz: e643017a30586492fa9f4f36fd8837d4cee920ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30dc457a331aaf5cf8111264053f47860aca76bf3acd20f613ab73cad938fa878e3990d47eadc0a4b45b2a12bdff18d376c070118834cc2e808a82bf6db633be
|
7
|
+
data.tar.gz: d22d2094e22c85851ed3f4f479a6873bf2543f0b3dbd64ef9a658d6e345a1ba72d59e745b79ff218724931bb57cd23123f76512d6a8b59763a2cc43590a5fc2d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.3.3] - 2017-02-10
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Update deprecated Fixnum class to Integer for Ruby 2.4 compatability by Edmund Larden(@admund)
|
7
|
+
* Remove self extension from Execute
|
8
|
+
|
3
9
|
## [v0.3.2] - 2017-02-06
|
4
10
|
|
5
11
|
### Fixed
|
@@ -33,6 +39,7 @@
|
|
33
39
|
|
34
40
|
* Initial implementation and release
|
35
41
|
|
42
|
+
[v0.3.3]: https://github.com/piotrmurach/tty-command/compare/v0.3.2...v0.3.3
|
36
43
|
[v0.3.2]: https://github.com/piotrmurach/tty-command/compare/v0.3.1...v0.3.2
|
37
44
|
[v0.3.1]: https://github.com/piotrmurach/tty-command/compare/v0.3.0...v0.3.1
|
38
45
|
[v0.3.0]: https://github.com/piotrmurach/tty-command/compare/v0.2.0...v0.3.0
|
data/README.md
CHANGED
@@ -249,7 +249,7 @@ You can directly use shell redirection facility like so:
|
|
249
249
|
cmd.run("ls 1&>2")
|
250
250
|
```
|
251
251
|
|
252
|
-
You can provide the streams as additional hash options where the key is one of `:in`, `:out`, `:err`,
|
252
|
+
You can provide the streams as additional hash options where the key is one of `:in`, `:out`, `:err`, an integer (a file descriptor for the child process), an IO or array. The pair value can be a filename for redirection.
|
253
253
|
|
254
254
|
```ruby
|
255
255
|
cmd.run(:ls, :in => "/dev/null") # read mode
|
data/lib/tty/command/execute.rb
CHANGED
@@ -6,8 +6,6 @@ require 'securerandom'
|
|
6
6
|
module TTY
|
7
7
|
class Command
|
8
8
|
module Execute
|
9
|
-
extend self
|
10
|
-
|
11
9
|
# Execute command in a child process
|
12
10
|
#
|
13
11
|
# The caller should ensure that all IO objects are closed
|
@@ -62,7 +60,7 @@ module TTY
|
|
62
60
|
if process_key.to_s == 'in'
|
63
61
|
value = convert_to_fd(value)
|
64
62
|
end
|
65
|
-
opts[process_key]= value
|
63
|
+
opts[process_key] = value
|
66
64
|
end
|
67
65
|
opts
|
68
66
|
end
|
@@ -77,7 +75,7 @@ module TTY
|
|
77
75
|
true
|
78
76
|
when ::IO
|
79
77
|
true
|
80
|
-
when ::
|
78
|
+
when ::Integer
|
81
79
|
object >= 0
|
82
80
|
when respond_to?(:to_i) && !object.to_io.nil?
|
83
81
|
true
|
@@ -99,7 +97,7 @@ module TTY
|
|
99
97
|
def convert_to_fd(object)
|
100
98
|
return object if fd?(object)
|
101
99
|
|
102
|
-
if object.is_a?(::String) && ::File.
|
100
|
+
if object.is_a?(::String) && ::File.exist?(object)
|
103
101
|
return object
|
104
102
|
end
|
105
103
|
|
@@ -119,7 +117,7 @@ module TTY
|
|
119
117
|
:out
|
120
118
|
when STDERR, $stderr, :err, :stderr, 2
|
121
119
|
:err
|
122
|
-
when
|
120
|
+
when Integer
|
123
121
|
object >= 0 ? IO.for_fd(object) : nil
|
124
122
|
when IO
|
125
123
|
object
|
data/lib/tty/command/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pastel
|