ndo 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/HISTORY.txt +6 -0
- data/Rakefile +6 -0
- data/bin/ndo +9 -9
- data/man/ndo.1 +66 -0
- data/man/ndo.1.html +140 -0
- data/man/ndo.1.ronn +51 -0
- metadata +16 -13
data/Gemfile
CHANGED
data/HISTORY.txt
CHANGED
data/Rakefile
CHANGED
@@ -8,6 +8,7 @@ task :default => :spec
|
|
8
8
|
|
9
9
|
# This task actually builds the gem.
|
10
10
|
task :gem => :spec
|
11
|
+
task :gem => :build_man
|
11
12
|
spec = eval(File.read('ndo.gemspec'))
|
12
13
|
|
13
14
|
desc "Generate the gem package."
|
@@ -26,3 +27,8 @@ desc 'Clear out RDoc and generated packages'
|
|
26
27
|
task :clean => [:clobber_rdoc, :clobber_package] do
|
27
28
|
rm "#{spec.name}.gemspec"
|
28
29
|
end
|
30
|
+
|
31
|
+
desc "Build manual"
|
32
|
+
task :build_man do
|
33
|
+
sh "ronn -br5 man/*.ronn"
|
34
|
+
end
|
data/bin/ndo
CHANGED
@@ -2,13 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
optparse = OptionParser.new do |opts|
|
6
|
-
opts.banner = "Usage: ndo [options] HOST_SET COMMAND"
|
7
|
-
end
|
8
|
-
optparse.parse!
|
9
|
-
|
10
5
|
unless ARGV.size >= 2
|
11
|
-
puts
|
6
|
+
puts "Usage: ndo [options] HOST_SET COMMAND"
|
12
7
|
puts
|
13
8
|
puts "You need to specify at least a host set and a command."
|
14
9
|
exit 1
|
@@ -18,9 +13,14 @@ host_set, *cmd_parts = ARGV
|
|
18
13
|
command = cmd_parts.join(' ')
|
19
14
|
|
20
15
|
|
21
|
-
hosts =
|
22
|
-
|
23
|
-
|
16
|
+
hosts = if host_set == '-'
|
17
|
+
# stdin
|
18
|
+
STDIN.readlines.map { |l| l.chomp }
|
19
|
+
else
|
20
|
+
File.read(
|
21
|
+
File.join(ENV['HOME'], '.ndo', host_set)).
|
22
|
+
lines.map { |l| l.chomp.strip }
|
23
|
+
end
|
24
24
|
|
25
25
|
$:.unshift File.dirname(__FILE__) + "/../lib"
|
26
26
|
require 'ndo'
|
data/man/ndo.1
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "NDO" "1" "December 2011" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBndo\fR \- ndo does things N times
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBndo\fR \fIhost_set\fR \fIcommand\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
description
|
14
|
+
.
|
15
|
+
.SH "EXAMPLES"
|
16
|
+
Given a host file in \fB~/\.ndo/test\fR containing \'foo\' and \'bar\', each on a separate line:
|
17
|
+
.
|
18
|
+
.IP "" 4
|
19
|
+
.
|
20
|
+
.nf
|
21
|
+
|
22
|
+
$ ndo test uname \-a
|
23
|
+
foo Linux foo 2\.6\.32\-33\-server #72\-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
24
|
+
bar Linux bar 2\.6\.32\-32\-server #62\-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
25
|
+
.
|
26
|
+
.fi
|
27
|
+
.
|
28
|
+
.IP "" 0
|
29
|
+
.
|
30
|
+
.P
|
31
|
+
Using an ad\-hoc host set generated by \fBother_command\fR (one host per line):
|
32
|
+
.
|
33
|
+
.IP "" 4
|
34
|
+
.
|
35
|
+
.nf
|
36
|
+
|
37
|
+
$ cat > hosts\.txt
|
38
|
+
bianca
|
39
|
+
callisto
|
40
|
+
^D
|
41
|
+
|
42
|
+
$ cat hosts\.txt | ndo \- uname \-a
|
43
|
+
bianca Linux bianca 2\.6\.32\-33\-server #72\-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
44
|
+
callisto Linux callisto 2\.6\.32\-32\-server #62\-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
45
|
+
.
|
46
|
+
.fi
|
47
|
+
.
|
48
|
+
.IP "" 0
|
49
|
+
.
|
50
|
+
.SH "OPTIONS"
|
51
|
+
.
|
52
|
+
.TP
|
53
|
+
\fB\-\fR
|
54
|
+
Read host set from stdin\.
|
55
|
+
.
|
56
|
+
.SH "FILES"
|
57
|
+
<~/\.ndo/host_set>
|
58
|
+
.
|
59
|
+
.SH "BUGS"
|
60
|
+
\fIhttps://github\.com/kschiess/ndo/issues\fR
|
61
|
+
.
|
62
|
+
.SH "AUTHOR"
|
63
|
+
Kaspar Schiess :: kaspar\.schiess@absurd\.li :: @kschiess
|
64
|
+
.
|
65
|
+
.SH "SEE ALSO"
|
66
|
+
\fIhttps://github\.com/kschiess\fR, \fIhttps://github\.com/kschiess/ndo\fR
|
data/man/ndo.1.html
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>ndo(1) - ndo does things N times</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
60
|
+
<a href="#OPTIONS">OPTIONS</a>
|
61
|
+
<a href="#FILES">FILES</a>
|
62
|
+
<a href="#BUGS">BUGS</a>
|
63
|
+
<a href="#AUTHOR">AUTHOR</a>
|
64
|
+
<a href="#SEE-ALSO">SEE ALSO</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<ol class='man-decor man-head man head'>
|
68
|
+
<li class='tl'>ndo(1)</li>
|
69
|
+
<li class='tc'></li>
|
70
|
+
<li class='tr'>ndo(1)</li>
|
71
|
+
</ol>
|
72
|
+
|
73
|
+
<h2 id="NAME">NAME</h2>
|
74
|
+
<p class="man-name">
|
75
|
+
<code>ndo</code> - <span class="man-whatis">ndo does things N times</span>
|
76
|
+
</p>
|
77
|
+
|
78
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
79
|
+
|
80
|
+
<p><code>ndo</code> <var>host_set</var> <var>command</var></p>
|
81
|
+
|
82
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
83
|
+
|
84
|
+
<p>description</p>
|
85
|
+
|
86
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
87
|
+
|
88
|
+
<p>Given a host file in <code>~/.ndo/test</code> containing 'foo' and 'bar', each on a separate
|
89
|
+
line:</p>
|
90
|
+
|
91
|
+
<pre><code>$ ndo test uname -a
|
92
|
+
foo Linux foo 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
93
|
+
bar Linux bar 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
94
|
+
</code></pre>
|
95
|
+
|
96
|
+
<p>Using an ad-hoc host set generated by <code>other_command</code> (one host per line):</p>
|
97
|
+
|
98
|
+
<pre><code>$ cat > hosts.txt
|
99
|
+
bianca
|
100
|
+
callisto
|
101
|
+
^D
|
102
|
+
|
103
|
+
$ cat hosts.txt | ndo - uname -a
|
104
|
+
bianca Linux bianca 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
105
|
+
callisto Linux callisto 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
106
|
+
</code></pre>
|
107
|
+
|
108
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
109
|
+
|
110
|
+
<dl>
|
111
|
+
<dt class="flush"><code>-</code></dt><dd>Read host set from stdin.</dd>
|
112
|
+
</dl>
|
113
|
+
|
114
|
+
|
115
|
+
<h2 id="FILES">FILES</h2>
|
116
|
+
|
117
|
+
<p><~/.ndo/host_set></p>
|
118
|
+
|
119
|
+
<h2 id="BUGS">BUGS</h2>
|
120
|
+
|
121
|
+
<p><a href="https://github.com/kschiess/ndo/issues" data-bare-link="true">https://github.com/kschiess/ndo/issues</a></p>
|
122
|
+
|
123
|
+
<h2 id="AUTHOR">AUTHOR</h2>
|
124
|
+
|
125
|
+
<p>Kaspar Schiess :: kaspar.schiess@absurd.li :: @kschiess</p>
|
126
|
+
|
127
|
+
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
128
|
+
|
129
|
+
<p><a href="https://github.com/kschiess" data-bare-link="true">https://github.com/kschiess</a>, <a href="https://github.com/kschiess/ndo" data-bare-link="true">https://github.com/kschiess/ndo</a></p>
|
130
|
+
|
131
|
+
|
132
|
+
<ol class='man-decor man-foot man foot'>
|
133
|
+
<li class='tl'></li>
|
134
|
+
<li class='tc'>December 2011</li>
|
135
|
+
<li class='tr'>ndo(1)</li>
|
136
|
+
</ol>
|
137
|
+
|
138
|
+
</div>
|
139
|
+
</body>
|
140
|
+
</html>
|
data/man/ndo.1.ronn
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
ndo(1) - ndo does things N times
|
2
|
+
===================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`ndo` <host_set> <command>
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
description
|
11
|
+
|
12
|
+
## EXAMPLES
|
13
|
+
|
14
|
+
Given a host file in `~/.ndo/test` containing 'foo' and 'bar', each on a separate
|
15
|
+
line:
|
16
|
+
|
17
|
+
$ ndo test uname -a
|
18
|
+
foo Linux foo 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
19
|
+
bar Linux bar 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
20
|
+
|
21
|
+
Using an ad-hoc host set generated by `other_command` (one host per line):
|
22
|
+
|
23
|
+
$ cat > hosts.txt
|
24
|
+
bianca
|
25
|
+
callisto
|
26
|
+
^D
|
27
|
+
|
28
|
+
$ cat hosts.txt | ndo - uname -a
|
29
|
+
bianca Linux bianca 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux
|
30
|
+
callisto Linux callisto 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux
|
31
|
+
|
32
|
+
## OPTIONS
|
33
|
+
|
34
|
+
* `-`:
|
35
|
+
Read host set from stdin.
|
36
|
+
|
37
|
+
## FILES
|
38
|
+
|
39
|
+
<~/.ndo/host_set>
|
40
|
+
|
41
|
+
## BUGS
|
42
|
+
|
43
|
+
<https://github.com/kschiess/ndo/issues>
|
44
|
+
|
45
|
+
## AUTHOR
|
46
|
+
|
47
|
+
Kaspar Schiess :: kaspar.schiess@absurd.li :: @kschiess
|
48
|
+
|
49
|
+
## SEE ALSO
|
50
|
+
|
51
|
+
<https://github.com/kschiess>, <https://github.com/kschiess/ndo>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: procrastinate
|
16
|
-
requirement: &
|
16
|
+
requirement: &70310922478840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '0.
|
21
|
+
version: '0.4'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70310922478840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: text-highlight
|
27
|
-
requirement: &
|
27
|
+
requirement: &70310922477960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70310922477960
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70310922477360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70310922477360
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: flexmock
|
49
|
-
requirement: &
|
49
|
+
requirement: &70310922476620 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70310922476620
|
58
58
|
description:
|
59
59
|
email: kaspar.schiess@absurd.li
|
60
60
|
executables:
|
@@ -68,13 +68,16 @@ files:
|
|
68
68
|
- LICENSE
|
69
69
|
- Rakefile
|
70
70
|
- README
|
71
|
+
- bin/ndo
|
71
72
|
- lib/ndo/host.rb
|
72
73
|
- lib/ndo/multi_host.rb
|
73
74
|
- lib/ndo/popen.rb
|
74
75
|
- lib/ndo/result.rb
|
75
76
|
- lib/ndo.rb
|
76
77
|
- examples/uname.rb
|
77
|
-
-
|
78
|
+
- man/ndo.1
|
79
|
+
- man/ndo.1.html
|
80
|
+
- man/ndo.1.ronn
|
78
81
|
homepage: http://blog.absurd.li
|
79
82
|
licenses: []
|
80
83
|
post_install_message:
|
@@ -91,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
94
|
version: '0'
|
92
95
|
segments:
|
93
96
|
- 0
|
94
|
-
hash:
|
97
|
+
hash: 1523388427314741121
|
95
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
99
|
none: false
|
97
100
|
requirements:
|