mixlib-shellout 2.4.2-universal-mingw32 → 2.4.4-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mixlib/shellout/version.rb +1 -1
- metadata +4 -9
- data/README.md +0 -99
- data/lib/.DS_Store +0 -0
- data/lib/mixlib/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4709592fd85b38ce2040327ad6be689c349b58b563eb0327ee3038112e0c4f6
|
4
|
+
data.tar.gz: 5c7520acca04f64210fdbd2b660a216ca2d2b432607dcdedc0985bca9ab69b7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b98c77f78e9ffe650bb8e108a62db5ac4867b1b6770e0837c362394e789ecda94059a15b258c2a400a456d0581703145c75cc0937d036541a63e05a69d9d092f
|
7
|
+
data.tar.gz: f0872fa824d2caad075e197fcf9f54963745e5b2f38e9c58341ccc03097358a0e3337760ba0a9b7756b43944559d09cbc31f42fb95ac526dc84c22190c4321bd
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-shellout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.4
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Chef Software Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: win32-process
|
@@ -42,14 +42,9 @@ description: Run external commands on Unix or Windows
|
|
42
42
|
email: info@chef.io
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
45
|
-
extra_rdoc_files:
|
46
|
-
- README.md
|
47
|
-
- LICENSE
|
45
|
+
extra_rdoc_files: []
|
48
46
|
files:
|
49
47
|
- LICENSE
|
50
|
-
- README.md
|
51
|
-
- lib/.DS_Store
|
52
|
-
- lib/mixlib/.DS_Store
|
53
48
|
- lib/mixlib/shellout.rb
|
54
49
|
- lib/mixlib/shellout/exceptions.rb
|
55
50
|
- lib/mixlib/shellout/unix.rb
|
@@ -75,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
70
|
version: '0'
|
76
71
|
requirements: []
|
77
72
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.7.
|
73
|
+
rubygems_version: 2.7.6
|
79
74
|
signing_key:
|
80
75
|
specification_version: 4
|
81
76
|
summary: Run external commands on Unix or Windows
|
data/README.md
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
# Mixlib::ShellOut
|
2
|
-
[![Build Status Master](https://travis-ci.org/chef/mixlib-shellout.svg?branch=master)](https://travis-ci.org/chef/mixlib-shellout) [![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/mixlib-shellout?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/mixlib-shellout/branch/master) [![Gem Version](https://badge.fury.io/rb/mixlib-shellout.svg)](https://badge.fury.io/rb/mixlib-shellout)
|
3
|
-
|
4
|
-
Provides a simplified interface to shelling out while still collecting both standard out and standard error and providing full control over environment, working directory, uid, gid, etc.
|
5
|
-
|
6
|
-
No means for passing input to the subprocess is provided.
|
7
|
-
|
8
|
-
## Example
|
9
|
-
### Simple Shellout
|
10
|
-
Invoke find(1) to search for .rb files:
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
require 'mixlib/shellout'
|
14
|
-
find = Mixlib::ShellOut.new("find . -name '*.rb'")
|
15
|
-
find.run_command
|
16
|
-
```
|
17
|
-
|
18
|
-
If all went well, the results are on `stdout`
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
puts find.stdout
|
22
|
-
```
|
23
|
-
|
24
|
-
`find(1)` prints diagnostic info to STDERR:
|
25
|
-
|
26
|
-
```ruby
|
27
|
-
puts "error messages" + find.stderr
|
28
|
-
```
|
29
|
-
|
30
|
-
Raise an exception if it didn't exit with 0
|
31
|
-
|
32
|
-
```ruby
|
33
|
-
find.error!
|
34
|
-
```
|
35
|
-
|
36
|
-
### Advanced Shellout
|
37
|
-
In addition to the command to run there are other options that can be set to change the shellout behavior. The complete list of options can be found here: https://github.com/chef/mixlib-shellout/blob/master/lib/mixlib/shellout.rb
|
38
|
-
|
39
|
-
Run a command as the `www` user with no extra ENV settings from `/tmp` with a 1s timeout
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
cmd = Mixlib::ShellOut.new("apachectl", "start", :user => 'www', :env => nil, :cwd => '/tmp', :timeout => 1)
|
43
|
-
cmd.run_command # etc.
|
44
|
-
```
|
45
|
-
|
46
|
-
### STDIN Example
|
47
|
-
Invoke crontab to edit user cron:
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
# :input only supports simple strings
|
51
|
-
crontab_lines = [ "* * * * * /bin/true", "* * * * * touch /tmp/here" ]
|
52
|
-
crontab = Mixlib::ShellOut.new("crontab -l -u #{@new_resource.user}", :input => crontab_lines.join("\n"))
|
53
|
-
crontab.run_command
|
54
|
-
```
|
55
|
-
|
56
|
-
### Windows Impersonation Example
|
57
|
-
Invoke "whoami.exe" to demonstrate running a command as another user:
|
58
|
-
|
59
|
-
```ruby
|
60
|
-
whoami = Mixlib::ShellOut.new("whoami.exe", :user => "username", :domain => "DOMAIN", :password => "password")
|
61
|
-
whoami.run_command
|
62
|
-
```
|
63
|
-
|
64
|
-
Invoke "whoami.exe" with elevated privileges:
|
65
|
-
|
66
|
-
```ruby
|
67
|
-
whoami = Mixlib::ShellOut.new("whoami.exe", :user => "username", :domain => "DOMAIN", :password => "password", :elevated => true)
|
68
|
-
whoami.run_command
|
69
|
-
```
|
70
|
-
**NOTE:** The user 'admin' must have the 'Log on as a batch job' permission and the user chef is running as must have the 'Replace a process level token' and 'Adjust Memory Quotas for a process' permissions.
|
71
|
-
|
72
|
-
## Platform Support
|
73
|
-
Mixlib::ShellOut does a standard fork/exec on Unix, and uses the Win32 API on Windows. There is not currently support for JRuby.
|
74
|
-
|
75
|
-
## See Also
|
76
|
-
- `Process.spawn` in Ruby 1.9+
|
77
|
-
- [https://github.com/rtomayko/posix-spawn](https://github.com/rtomayko/posix-spawn)
|
78
|
-
|
79
|
-
## Contributing
|
80
|
-
|
81
|
-
For information on contributing to this project see <https://github.com/chef/chef/blob/master/CONTRIBUTING.md>
|
82
|
-
|
83
|
-
## License
|
84
|
-
- Copyright:: Copyright (c) 2011-2016 Chef Software, Inc.
|
85
|
-
- License:: Apache License, Version 2.0
|
86
|
-
|
87
|
-
```text
|
88
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
89
|
-
you may not use this file except in compliance with the License.
|
90
|
-
You may obtain a copy of the License at
|
91
|
-
|
92
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
93
|
-
|
94
|
-
Unless required by applicable law or agreed to in writing, software
|
95
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
96
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
97
|
-
See the License for the specific language governing permissions and
|
98
|
-
limitations under the License.
|
99
|
-
```
|
data/lib/.DS_Store
DELETED
Binary file
|
data/lib/mixlib/.DS_Store
DELETED
Binary file
|