command_exec 0.0.1 → 0.0.2
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/LICENSE.md +20 -0
- data/README.md +77 -1
- data/TODO.md +1 -0
- data/lib/command_exec/version.rb +1 -1
- metadata +7 -5
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (C) 2012 Max Meyer
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
8
|
+
so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|
20
|
+
|
data/README.md
CHANGED
@@ -1,6 +1,82 @@
|
|
1
1
|
command-exec(1) -- execute shell commands with ease
|
2
2
|
===================================================
|
3
3
|
|
4
|
-
##
|
4
|
+
## Description
|
5
5
|
|
6
|
+
This gem brings command execution via POpen4 with all the bells and whistles.
|
6
7
|
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'command_exec'
|
12
|
+
|
13
|
+
#long form
|
14
|
+
command = CommandExec::Command.new( 'command' )
|
15
|
+
command.run
|
16
|
+
|
17
|
+
#short form
|
18
|
+
command = CommandExec::Command.execute( 'command')
|
19
|
+
|
20
|
+
#full path to commadn
|
21
|
+
command = CommandExec::Command.execute( 'path/to/command')
|
22
|
+
|
23
|
+
# available options
|
24
|
+
command = CommandExec::Command.new(
|
25
|
+
'command',
|
26
|
+
:logger => Logger.new($stderr),
|
27
|
+
:options => '--command options',
|
28
|
+
:parameter => 'command parameter',
|
29
|
+
:error_keywords => ['key words in', 'stdout with indicate errors' ],
|
30
|
+
:working_directory => 'working/directory/where/the/command/should/be/executed/in',
|
31
|
+
:logfile => 'path/to/logfile.log',
|
32
|
+
:debug => false,
|
33
|
+
)
|
34
|
+
command.run
|
35
|
+
```
|
36
|
+
|
37
|
+
## Output
|
38
|
+
|
39
|
+
After execute the command you get the following output. Today it's not possible
|
40
|
+
to suppress that output, but it's on the roadmap.
|
41
|
+
|
42
|
+
### Successfull
|
43
|
+
|
44
|
+
```
|
45
|
+
<timestamp> command: OK
|
46
|
+
```
|
47
|
+
|
48
|
+
### Failed with STDERR set
|
49
|
+
|
50
|
+
```
|
51
|
+
<timestamp> command: FAILED
|
52
|
+
================== LOGFILE ==================
|
53
|
+
[...]
|
54
|
+
================== STDOUT ==================
|
55
|
+
[...]
|
56
|
+
================== STDERR ==================
|
57
|
+
[...]
|
58
|
+
```
|
59
|
+
|
60
|
+
### Failed with string in STDOUT indicating an error
|
61
|
+
|
62
|
+
```
|
63
|
+
<timestamp> command: FAILED
|
64
|
+
================== STDOUT ==================
|
65
|
+
```
|
66
|
+
|
67
|
+
## Dependencies
|
68
|
+
|
69
|
+
Please see the gemspec for runtime dependencies and the 'Gemfile' for
|
70
|
+
development dependencies.
|
71
|
+
|
72
|
+
## Todo
|
73
|
+
|
74
|
+
Please see TODO.md for enhancements which are planned for implementation.
|
75
|
+
|
76
|
+
## Copyright
|
77
|
+
|
78
|
+
(c) 2012-, Max Meyer
|
79
|
+
|
80
|
+
## License
|
81
|
+
|
82
|
+
Please see LICENSE.md for license text.
|
data/TODO.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* Add options to execute a command silently
|
data/lib/command_exec/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command_exec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-21 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: POpen4
|
16
|
-
requirement: &
|
16
|
+
requirement: &20579680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20579680
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colored
|
27
|
-
requirement: &
|
27
|
+
requirement: &20579260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *20579260
|
36
36
|
description: This adds bells and whistles to ease shell command execution
|
37
37
|
email:
|
38
38
|
- dev@fedux.org
|
@@ -44,8 +44,10 @@ files:
|
|
44
44
|
- Gemfile
|
45
45
|
- Gemfile.lock
|
46
46
|
- Guardfile
|
47
|
+
- LICENSE.md
|
47
48
|
- README.md
|
48
49
|
- Rakefile
|
50
|
+
- TODO.md
|
49
51
|
- command_exec.gemspec
|
50
52
|
- lib/command_exec.rb
|
51
53
|
- lib/command_exec/command.rb
|