unix_commander 0.1.5 → 0.1.6
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/lib/unix_commander.rb +8 -8
- data/lib/unix_commander/version.rb +1 -1
- metadata +2 -2
data/lib/unix_commander.rb
CHANGED
@@ -93,7 +93,7 @@ module UnixCommander
|
|
93
93
|
attr :cmd
|
94
94
|
|
95
95
|
# Creates a new command
|
96
|
-
# @param [String] create a command with some unix code inside (defaults to "")
|
96
|
+
# @param [String] _cmd create a command with some unix code inside (defaults to "")
|
97
97
|
def initialize(_cmd = "")
|
98
98
|
@cmd = _cmd
|
99
99
|
end
|
@@ -104,8 +104,8 @@ module UnixCommander
|
|
104
104
|
end
|
105
105
|
|
106
106
|
# Redirects *stdout* to someplace (Using >). By default it uses destructive redirection.
|
107
|
-
# @param [String] place to redirect the output (e.g. /dev/null)
|
108
|
-
# @param [true,false]
|
107
|
+
# @param [String] _str place to redirect the output (e.g. /dev/null)
|
108
|
+
# @param [true,false] _append if true uses append redirection (>>) it defaults to false.
|
109
109
|
# @return [Command] New command with *stdout* redirected to _str
|
110
110
|
def out_to(_str,_append=false)
|
111
111
|
if cmd == ""
|
@@ -116,8 +116,8 @@ module UnixCommander
|
|
116
116
|
end
|
117
117
|
|
118
118
|
# Redirects *stderr* to someplace (Using >). By default it uses destructive redirection.
|
119
|
-
# @param [String] place to redirect the output (e.g. /dev/null)
|
120
|
-
# @param [true,false]
|
119
|
+
# @param [String] _str place to redirect the output (e.g. /dev/null)
|
120
|
+
# @param [true,false] _append if true uses append redirection (>>) it defaults to false.
|
121
121
|
# @return [Command] New command with *stderr* redirected to _str
|
122
122
|
def err_to(_str,_append=false)
|
123
123
|
if cmd == ""
|
@@ -128,8 +128,8 @@ module UnixCommander
|
|
128
128
|
end
|
129
129
|
|
130
130
|
# Redirects *stdout* and *stderr* to someplace (Using >). By default it uses destructive redirection.
|
131
|
-
# @param [String] place to redirect the output (e.g. /dev/null)
|
132
|
-
# @param [true,false]
|
131
|
+
# @param [String] _str place to redirect the output (e.g. /dev/null)
|
132
|
+
# @param [true,false] _append if true uses append redirection (>>) it defaults to false.
|
133
133
|
# @return [Command] New command with *stdout and stderr* redirected to _str
|
134
134
|
def both_to(_str,_append=false)
|
135
135
|
if cmd == ""
|
@@ -158,7 +158,7 @@ module UnixCommander
|
|
158
158
|
# is interpreted as a unix command and its args are used as the args of the unix command.
|
159
159
|
# When the command already has some unix command inside, it pipes them together (|)
|
160
160
|
# @param [String] m name of the unix command you want to execute
|
161
|
-
# @param [Array]
|
161
|
+
# @param [Array] args args for the aforementioned command
|
162
162
|
# @return [Command] new command with internal unix commands piped together
|
163
163
|
def method_missing(m, *args, &block)
|
164
164
|
if cmd == ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unix_commander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
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: 2012-12-
|
12
|
+
date: 2012-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|