rcmd 1.5.7 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
data/doc/rdocs/index.html CHANGED
@@ -2,60 +2,69 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>RDoc Documentation</title>
8
8
 
9
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
-
11
9
  <script type="text/javascript">
12
10
  var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
13
12
  </script>
14
13
 
15
- <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
14
+ <script src="./js/jquery.js"></script>
15
+ <script src="./js/darkfish.js"></script>
16
+
17
+ <link href="./css/fonts.css" rel="stylesheet">
18
+ <link href="./css/rdoc.css" rel="stylesheet">
19
+
21
20
 
22
21
 
23
- <body>
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="./index.html">Home</a>
22
+ <body id="top" role="document" class="file">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="./index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="./table_of_contents.html#pages">Pages</a>
28
32
  <a href="./table_of_contents.html#classes">Classes</a>
29
33
  <a href="./table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
34
+ </div>
35
+ </div>
32
36
 
33
37
 
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
38
+ <div id="search-section" role="search" class="project-section initially-hidden">
35
39
  <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
40
+ <div id="search-field-wrapper">
41
+ <input id="search-field" role="combobox" aria-label="Search"
42
+ aria-autocomplete="list" aria-controls="search-results"
43
+ type="text" name="search" placeholder="Search" spellcheck="false"
38
44
  title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
45
+ </div>
41
46
 
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
47
+ <ul id="search-results" aria-label="Search Results"
48
+ aria-busy="false" aria-expanded="false"
49
+ aria-atomic="false" class="initially-hidden"></ul>
50
+ </form>
51
+ </div>
44
52
 
53
+ </div>
45
54
 
46
55
  <div id="project-metadata">
47
- <nav id="fileindex-section" class="section project-section">
48
- <h3 class="section-header">Pages</h3>
56
+ <div id="fileindex-section" class="nav-section">
57
+ <h3>Pages</h3>
49
58
 
50
- <ul>
59
+ <ul class="link-list">
51
60
 
52
- <li class="file"><a href="./README_md.html">README</a>
61
+ <li><a href="./README_md.html">README</a>
53
62
 
54
63
  </ul>
55
- </nav>
64
+ </div>
56
65
 
57
- <nav id="classindex-section" class="section project-section">
58
- <h3 class="section-header">Class and Module Index</h3>
66
+ <div id="classindex-section" class="nav-section">
67
+ <h3>Class and Module Index</h3>
59
68
 
60
69
  <ul class="link-list">
61
70
 
@@ -64,23 +73,22 @@
64
73
  <li><a href="./Rcmd.html">Rcmd</a>
65
74
 
66
75
  </ul>
67
- </nav>
76
+ </div>
68
77
 
69
78
  </div>
70
79
  </nav>
71
80
 
72
- <div id="documentation" class="description">
81
+ <main role="main">
82
+
73
83
 
74
- <h1 id="label-Description">Description<span><a href="#label-Description">&para;</a> <a href="#documentation">&uarr;</a></span></h1>
84
+ <h1 id="label-Description">Description<span><a href="#label-Description">&para;</a> <a href="#top">&uarr;</a></span></h1>
75
85
 
76
86
  <p>rcmd (remote command) is a command line utility written in Ruby for
77
- executing the same command on
78
- multiple systems through ssh. This is done by
79
- assigning a host to a
80
- thread and creating the ssh sessions in those
87
+ executing the same command on multiple systems through ssh. This is done by
88
+ assigning a host to a thread and creating the ssh sessions in those
81
89
  threads.</p>
82
90
 
83
- <h2 id="label-Features">Features<span><a href="#label-Features">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
91
+ <h2 id="label-Features">Features<span><a href="#label-Features">&para;</a> <a href="#top">&uarr;</a></span></h2>
84
92
  <ul><li>
85
93
  <p>Command line switch for setting number of threads to be used at a time.
86
94
  (Default is 4)</p>
@@ -96,70 +104,65 @@ the node list.</p>
96
104
  <p>Stdout can be suppressed, only allowing for stderr to be shown</p>
97
105
  </li></ul>
98
106
 
99
- <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
107
+ <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#top">&uarr;</a></span></h2>
100
108
 
101
109
  <p>rcmd is available as a gem and kan be installed with <code>gem install
102
110
  rcmd</code></p>
103
111
 
104
- <h1 id="label-Usage+Examples">Usage Examples<span><a href="#label-Usage+Examples">&para;</a> <a href="#documentation">&uarr;</a></span></h1>
112
+ <h1 id="label-Usage+Examples">Usage Examples<span><a href="#label-Usage+Examples">&para;</a> <a href="#top">&uarr;</a></span></h1>
105
113
 
106
- <h2 id="label-Help+Screen">Help Screen<span><a href="#label-Help+Screen">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
114
+ <h2 id="label-Help+Screen">Help Screen<span><a href="#label-Help+Screen">&para;</a> <a href="#top">&uarr;</a></span></h2>
107
115
 
108
- <pre>daibhidh@darkstar:~/$ rcmd --help
109
- Usage: rcmd [options]
116
+ <pre>Usage: rcmd [options]
110
117
  -u, --username username Username for SSH connections
111
118
  -n, --nodes x,y,z Comma seperated list of nodes. use &#39;-&#39; for a space seperated list piped from another command
119
+ -r, --regexp regex Use Regex to build host list (ruby regexp)
112
120
  -t, --threads threads Number of threads to run
113
121
  -c, --command &lt;command&gt; Quoted string containing the command to be run
114
122
  -q, --quiet Suppress stdout of commands. stderr will still be displayed
115
- -v, --version Print what version of the command is in use</pre>
123
+ -v, --version Print what version of the command is in use
124
+ -D, --debug Print debug information</pre>
116
125
 
117
- <h2 id="label-Specifying+nodes+manually">Specifying nodes manually<span><a href="#label-Specifying+nodes+manually">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
126
+ <h2 id="label-Specifying+nodes+manually">Specifying nodes manually<span><a href="#label-Specifying+nodes+manually">&para;</a> <a href="#top">&uarr;</a></span></h2>
118
127
 
119
128
  <p>Specifying a comma seperated list of hosts and timing the total execution
120
- time.
121
- ```bash
122
- daibhidh@darkstar:~/$ time rcmd -n node1,node2,node3,node4 -c
123
- &#39;cat /etc/redhat-release&#39;
124
- node2 :: Red Hat Enterprise Linux
125
- ComputeNode release 6.8 (Santiago)
126
- node1 :: Red Hat Enterprise Linux
127
- ComputeNode release 6.8 (Santiago)
128
- node4 :: Red Hat Enterprise Linux
129
- ComputeNode release 6.9 (Santiago)
130
- node3 :: Red Hat Enterprise Linux
129
+ time. “`bash daibhidh@darkstar:~/$ time rcmd -n node1,node2,node3,node4 -c
130
+ &#39;cat /etc/redhat-release&#39; node2 :: Red Hat Enterprise Linux
131
+ ComputeNode release 6.8 (Santiago) node1 :: Red Hat Enterprise Linux
132
+ ComputeNode release 6.8 (Santiago) node4 :: Red Hat Enterprise Linux
133
+ ComputeNode release 6.9 (Santiago) node3 :: Red Hat Enterprise Linux
131
134
  ComputeNode release 6.9 (Santiago)</p>
132
135
 
133
- <p>real 0m2.749s
134
- user 0m0.272s
135
- sys 0m0.050s
136
- ```</p>
136
+ <p>real 0m2.749s user 0m0.272s sys 0m0.050s “`</p>
137
137
 
138
- <h2 id="label-Piping+list+of+nodes">Piping list of nodes<span><a href="#label-Piping+list+of+nodes">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
138
+ <h2 id="label-Piping+list+of+nodes">Piping list of nodes<span><a href="#label-Piping+list+of+nodes">&para;</a> <a href="#top">&uarr;</a></span></h2>
139
139
 
140
140
  <p>Using the hammer cli to get a list of hosts from a RedHat Satellite and
141
- providing it to rcmd as the node
142
- list.
143
- &lt;code&gt;bash
144
- daibhidh@darkstar:~/$ hammer --output base host list
145
- --organization org | awk &#39;/Name:/ {print $2}&#39; | rcmd -n - -c
146
- &#39;cat /etc/redhat-release&#39;
147
- node1.example.com :: Red Hat Enterprise
148
- Linux ComputeNode release 6.8 (Santiago)
149
- node3.example.com :: Red Hat
150
- Enterprise Linux ComputeNode release 6.9 (Santiago)
151
- node2.example.com ::
152
- Red Hat Enterprise Linux ComputeNode release 6.8
153
- (Santiago)
154
- node4.example.com :: Red Hat Enterprise Linux ComputeNode
155
- release 6.9 (Santiago)
156
- &lt;/code&gt;</p>
157
-
158
- <h2 id="label-Using+a+database+for+obtaining+nodes">Using a database for obtaining nodes<span><a href="#label-Using+a+database+for+obtaining+nodes">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
159
-
160
- <p>TODO</p>
161
-
162
- <h1 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#documentation">&uarr;</a></span></h1>
141
+ providing it to rcmd as the node list. <code>bash daibhidh@darkstar:~/$
142
+ hammer --output base host list --organization org | awk &#39;/Name:/ {print
143
+ $2}&#39; | rcmd -n - -c &#39;cat /etc/redhat-release&#39; node1.example.com
144
+ :: Red Hat Enterprise Linux ComputeNode release 6.8 (Santiago)
145
+ node3.example.com :: Red Hat Enterprise Linux ComputeNode release 6.9
146
+ (Santiago) node2.example.com :: Red Hat Enterprise Linux ComputeNode
147
+ release 6.8 (Santiago) node4.example.com :: Red Hat Enterprise Linux
148
+ ComputeNode release 6.9 (Santiago) </code></p>
149
+
150
+ <h2 id="label-Using+regex+to+build+node+list">Using regex to build node list<span><a href="#label-Using+regex+to+build+node+list">&para;</a> <a href="#top">&uarr;</a></span></h2>
151
+
152
+ <pre>daibhidh@darkstar:~/$ rcmd -r &#39;node([1-9]|1[1-2])$&#39; -c &#39;hostname -f&#39;
153
+ node2 :: node2.example.com
154
+ node1 :: node1.example.com
155
+ node4 :: node4.example.com
156
+ node3 :: node3.example.com
157
+ node5 :: node5.example.com
158
+ node6 :: node6.example.com
159
+ node8 :: node8.example.com
160
+ node7 :: node7.example.com
161
+ node11 :: CONNECT ERROR :: Unable to connect to host!
162
+ node9 :: node9.example.com
163
+ node12 :: node12.example.com</pre>
164
+
165
+ <h1 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h1>
163
166
 
164
167
  <p>If you are wanting to modify the code by all means do so. If you clone this
165
168
  repository you can then run <code>bundle install</code> to install the
@@ -168,24 +171,26 @@ with <em>rake</em>.</p>
168
171
 
169
172
  <p>Available Rake tasks are:</p>
170
173
 
171
- <pre>rake build # Build rcmd-1.5.5.gem into the pkg directory
172
- rake clean # Remove any temporary products
173
- rake clobber # Remove any generated files
174
- rake clobber_rdoc # Remove RDoc HTML files
175
- rake console # Open an IRB console with this gem loaded
176
- rake install # Build and install rcmd-1.5.5.gem into system gems
177
- rake install:local # Build and install rcmd-1.5.5.gem into system gems without network access
178
- rake rdoc # Build RDoc HTML files
179
- rake reinstall # Remove, build, and install gem
180
- rake release[remote] # Create tag v1.5.5 and build and push rcmd-1.5.5.gem to Rubygems
181
- rake rerdoc # Rebuild RDoc HTML files
182
- rake spec # Run RSpec code examples</pre>
183
- </div>
184
-
185
-
186
- <footer id="validator-badges">
187
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
188
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
189
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
174
+ <pre class="ruby"><span class="ruby-identifier">rake</span> <span class="ruby-identifier">build</span> <span class="ruby-comment"># Build rcmd-1.5.5.gem into the pkg directory</span>
175
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">clean</span> <span class="ruby-comment"># Remove any temporary products</span>
176
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">clobber</span> <span class="ruby-comment"># Remove any generated files</span>
177
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">clobber_rdoc</span> <span class="ruby-comment"># Remove RDoc HTML files</span>
178
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">console</span> <span class="ruby-comment"># Open an IRB console with this gem loaded</span>
179
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">install</span> <span class="ruby-comment"># Build and install rcmd-1.5.5.gem into system gems</span>
180
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">install</span>:<span class="ruby-identifier">local</span> <span class="ruby-comment"># Build and install rcmd-1.5.5.gem into system gems without network access</span>
181
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">rdoc</span> <span class="ruby-comment"># Build RDoc HTML files</span>
182
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">reinstall</span> <span class="ruby-comment"># Remove, build, and install gem</span>
183
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">release</span>[<span class="ruby-identifier">remote</span>] <span class="ruby-comment"># Create tag v1.5.5 and build and push rcmd-1.5.5.gem to Rubygems</span>
184
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">rerdoc</span> <span class="ruby-comment"># Rebuild RDoc HTML files</span>
185
+ <span class="ruby-identifier">rake</span> <span class="ruby-identifier">spec</span> <span class="ruby-comment"># Run RSpec code examples</span>
186
+ </pre>
187
+ </main>
188
+
189
+
190
+
191
+ <footer id="validator-badges" role="contentinfo">
192
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
193
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.0.0.
194
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
190
195
  </footer>
191
196
 
@@ -44,28 +44,6 @@ function hookSourceViews() {
44
44
  $('.method-heading').click( showSource );
45
45
  };
46
46
 
47
- function toggleDebuggingSection() {
48
- $('.debugging-section').slideToggle();
49
- };
50
-
51
- function hookDebuggingToggle() {
52
- $('#debugging-toggle img').click( toggleDebuggingSection );
53
- };
54
-
55
- function hookTableOfContentsToggle() {
56
- $('.indexpage li .toc-toggle').each( function() {
57
- $(this).click( function() {
58
- $(this).toggleClass('open');
59
- });
60
-
61
- var section = $(this).next();
62
-
63
- $(this).click( function() {
64
- section.slideToggle();
65
- });
66
- });
67
- }
68
-
69
47
  function hookSearch() {
70
48
  var input = $('#search-field').eq(0);
71
49
  var result = $('#search-results').eq(0);
@@ -81,7 +59,7 @@ function hookSearch() {
81
59
  var html = '';
82
60
 
83
61
  // TODO add relative path to <script> per-page
84
- html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
62
+ html += '<p class="search-match"><a href="' + index_rel_prefix + result.path + '">' + this.hlt(result.title);
85
63
  if (result.params)
86
64
  html += '<span class="params">' + result.params + '</span>';
87
65
  html += '</a>';
@@ -143,13 +121,41 @@ function highlightClickTarget( event ) {
143
121
  };
144
122
  };
145
123
 
124
+ function loadAsync(path, success, prefix) {
125
+ $.ajax({
126
+ url: prefix + path,
127
+ dataType: 'script',
128
+ success: success,
129
+ cache: true
130
+ });
131
+ };
146
132
 
147
133
  $(document).ready( function() {
148
134
  hookSourceViews();
149
- hookDebuggingToggle();
150
- hookSearch();
151
135
  highlightLocationTarget();
152
- hookTableOfContentsToggle();
153
-
154
136
  $('ul.link-list a').bind( "click", highlightClickTarget );
137
+
138
+ var search_scripts_loaded = {
139
+ navigation_loaded: false,
140
+ search_loaded: false,
141
+ search_index_loaded: false,
142
+ searcher_loaded: false,
143
+ }
144
+
145
+ var search_success_function = function(variable) {
146
+ return (function (data, status, xhr) {
147
+ search_scripts_loaded[variable] = true;
148
+
149
+ if (search_scripts_loaded['navigation_loaded'] == true &&
150
+ search_scripts_loaded['search_loaded'] == true &&
151
+ search_scripts_loaded['search_index_loaded'] == true &&
152
+ search_scripts_loaded['searcher_loaded'] == true)
153
+ hookSearch();
154
+ });
155
+ }
156
+
157
+ loadAsync('js/navigation.js', search_success_function('navigation_loaded'), rdoc_rel_prefix);
158
+ loadAsync('js/search.js', search_success_function('search_loaded'), rdoc_rel_prefix);
159
+ loadAsync('js/search_index.js', search_success_function('search_index_loaded'), index_rel_prefix);
160
+ loadAsync('js/searcher.js', search_success_function('searcher_loaded'), rdoc_rel_prefix);
155
161
  });
Binary file
@@ -14,7 +14,12 @@ Search.prototype = $.extend({}, Navigation, new function() {
14
14
 
15
15
  this.init = function() {
16
16
  var _this = this;
17
- var observer = function() {
17
+ var observer = function(e) {
18
+ switch(e.originalEvent.keyCode) {
19
+ case 38: // Event.KEY_UP
20
+ case 40: // Event.KEY_DOWN
21
+ return;
22
+ }
18
23
  _this.search(_this.$input[0].value);
19
24
  };
20
25
  this.$input.keyup(observer);
@@ -39,9 +44,12 @@ Search.prototype = $.extend({}, Navigation, new function() {
39
44
  if (value == '') {
40
45
  this.lastQuery = value;
41
46
  this.$result.empty();
47
+ this.$result.attr('aria-expanded', 'false');
42
48
  this.setNavigationActive(false);
43
49
  } else if (value != this.lastQuery) {
44
50
  this.lastQuery = value;
51
+ this.$result.attr('aria-busy', 'true');
52
+ this.$result.attr('aria-expanded', 'true');
45
53
  this.firstRun = true;
46
54
  this.searcher.find(value);
47
55
  }
@@ -55,25 +63,32 @@ Search.prototype = $.extend({}, Navigation, new function() {
55
63
  }
56
64
 
57
65
  for (var i=0, l = results.length; i < l; i++) {
58
- target.appendChild(this.renderItem.call(this, results[i]));
66
+ var item = this.renderItem.call(this, results[i]);
67
+ item.setAttribute('id', 'search-result-' + target.childElementCount);
68
+ target.appendChild(item);
59
69
  };
60
70
 
61
71
  if (this.firstRun && results.length > 0) {
62
72
  this.firstRun = false;
63
73
  this.$current = $(target.firstChild);
64
- this.$current.addClass('current');
74
+ this.$current.addClass('search-selected');
65
75
  }
66
76
  if (jQuery.browser.msie) this.$element[0].className += '';
77
+
78
+ if (isLast) this.$result.attr('aria-busy', 'false');
67
79
  }
68
80
 
69
81
  this.move = function(isDown) {
70
82
  if (!this.$current) return;
71
83
  var $next = this.$current[isDown ? 'next' : 'prev']();
72
84
  if ($next.length) {
73
- this.$current.removeClass('current');
74
- $next.addClass('current');
85
+ this.$current.removeClass('search-selected');
86
+ $next.addClass('search-selected');
87
+ this.$input.attr('aria-activedescendant', $next.attr('id'));
75
88
  this.scrollIntoView($next[0], this.$view[0]);
76
89
  this.$current = $next;
90
+ this.$input.val($next[0].firstChild.firstChild.text);
91
+ this.$input.select();
77
92
  }
78
93
  return true;
79
94
  }
Binary file
@@ -52,13 +52,13 @@ Searcher.prototype = new function() {
52
52
  /* ----- Utilities ------ */
53
53
  function splitQuery(query) {
54
54
  return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
55
- return string.match(/\S/)
55
+ return string.match(/\S/);
56
56
  });
57
57
  }
58
58
 
59
59
  function buildRegexps(queries) {
60
60
  return jQuery.map(queries, function(query) {
61
- return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
61
+ return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i');
62
62
  });
63
63
  }
64
64
 
@@ -172,6 +172,7 @@ Searcher.prototype = new function() {
172
172
  result.path = info[2];
173
173
  result.params = info[3];
174
174
  result.snippet = info[4];
175
+ result.badge = info[6];
175
176
  return result;
176
177
  }
177
178
 
Binary file
@@ -2,34 +2,33 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>Table of Contents - RDoc Documentation</title>
8
8
 
9
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
-
11
9
  <script type="text/javascript">
12
10
  var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
13
12
  </script>
14
13
 
15
- <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
14
+ <script src="./js/jquery.js"></script>
15
+ <script src="./js/darkfish.js"></script>
16
+
17
+ <link href="./css/fonts.css" rel="stylesheet">
18
+ <link href="./css/rdoc.css" rel="stylesheet">
21
19
 
22
20
 
23
- <body class="indexpage">
24
- <h1>Table of Contents - RDoc Documentation</h1>
25
21
 
26
- <h2>Pages</h2>
22
+ <body id="top" class="table-of-contents">
23
+ <main role="main">
24
+ <h1 class="class">Table of Contents - RDoc Documentation</h1>
25
+
26
+ <h2 id="pages">Pages</h2>
27
27
  <ul>
28
28
  <li class="file">
29
29
  <a href="README_md.html">README</a>
30
30
 
31
- <img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
32
- <ul class="initially-hidden">
31
+ <ul>
33
32
  <li><a href="README_md.html#label-Description">Description</a>
34
33
  <li><a href="README_md.html#label-Features">Features</a>
35
34
  <li><a href="README_md.html#label-Installation">Installation</a>
@@ -37,35 +36,37 @@
37
36
  <li><a href="README_md.html#label-Help+Screen">Help Screen</a>
38
37
  <li><a href="README_md.html#label-Specifying+nodes+manually">Specifying nodes manually</a>
39
38
  <li><a href="README_md.html#label-Piping+list+of+nodes">Piping list of nodes</a>
40
- <li><a href="README_md.html#label-Using+a+database+for+obtaining+nodes">Using a database for obtaining nodes</a>
39
+ <li><a href="README_md.html#label-Using+regex+to+build+node+list">Using regex to build node list</a>
41
40
  <li><a href="README_md.html#label-Development">Development</a>
42
41
  </ul>
43
42
  </li>
44
43
 
45
44
  </ul>
46
45
 
47
- <h2 id="classes">Classes/Modules</h2>
46
+ <h2 id="classes">Classes and Modules</h2>
48
47
  <ul>
49
48
  <li class="module">
50
49
  <a href="OptionParser.html">OptionParser</a>
51
50
  </li>
52
- <li class="module">
51
+ <li class="module">
53
52
  <a href="Rcmd.html">Rcmd</a>
54
53
  </li>
55
-
56
54
  </ul>
57
55
 
58
56
  <h2 id="methods">Methods</h2>
59
57
  <ul>
60
-
61
- <li class="method"><a href="Rcmd.html#method-c-run_command">::run_command &mdash; Rcmd</a>
62
-
58
+
59
+ <li class="method">
60
+ <a href="Rcmd.html#method-c-run_command">::run_command</a>
61
+ &mdash;
62
+ <span class="container">Rcmd</span>
63
63
  </ul>
64
+ </main>
64
65
 
65
66
 
66
- <footer id="validator-badges">
67
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
68
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
69
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
67
+ <footer id="validator-badges" role="contentinfo">
68
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
69
+ <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.0.0.
70
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
70
71
  </footer>
71
72
 
data/exe/rcmd CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'optparse'
4
+ require 'regexp-examples'
4
5
  require 'rcmd'
5
6
 
6
7
  # This program is for executing a command on multiple nodes at the same time and accepts the following arguments.
@@ -14,7 +15,7 @@ require 'rcmd'
14
15
 
15
16
 
16
17
  # Set default options
17
- options = { :threads => 4, :nodes => nil, :environment => nil, :host_file => nil, :user => 'root', :password => false, :command => nil, :quiet => false, :version => false, :debug => false }
18
+ options = { :threads => 4, :nodes => nil, :environment => nil, :host_file => nil, :user => 'root', :password => false, :command => nil, :quiet => false, :version => false, :debug => false, :expression => nil, :database => false }
18
19
 
19
20
  host_list = []
20
21
 
@@ -23,8 +24,8 @@ opts = OptionParser.new #:nodoc:
23
24
 
24
25
  opts.on('-u username', '--username username', String, "Username for SSH connections") { |v| options[:user] = v }
25
26
  opts.on('-n nodes', '--nodes x,y,z', Array, "Comma seperated list of nodes. use '-' for a space seperated list piped from another command") { |v| options[:nodes] = v }
26
- opts.on('-r regex', '--regexp regex', String, "Use Regex to build/search host list") { |v| options[:expression] = v}
27
- opts.on('-d database', '--database database', String, "Database connection string") { |v| options[:database] = v}
27
+ opts.on('-r regex', '--regexp regex', String, "Use Regex to build host list (ruby regexp)") { |v| options[:expression] = v}
28
+ # opts.on('-d database', '--database', "Use hosts from database (~/.dbconf.yaml)") { |v| options[:database] = v}
28
29
  opts.on('-t threads', '--threads threads', Integer, "Number of threads to run") { |v| options[:threads] = v }
29
30
  opts.on('-c <command>', '--command <command>', String, "Quoted string containing the command to be run") { |v| options[:command] = v }
30
31
  opts.on('-q', '--quiet', "Suppress stdout of commands. stderr will still be displayed") { |v| options[:quiet] = v }
@@ -34,7 +35,7 @@ opts.on('-D', '--debug', "Print debug information") { |v| options[:debug] = v }
34
35
  # Process options
35
36
  begin
36
37
  opts.parse!(ARGV)
37
- unless options[:version]
38
+ unless options[:version] or options[:expression]
38
39
  mandatory = [:command, :nodes]
39
40
  missing = mandatory.select{ |param| options[param].nil? }
40
41
  raise OptionParser::MissingArgument, missing.join(', ') unless missing.empty?
@@ -45,6 +46,13 @@ begin
45
46
  exit
46
47
  end
47
48
 
49
+ # Process Regex for node list generation
50
+ if options[:expression]
51
+ unless options[:database]
52
+ options[:nodes] = Regexp.new(options[:expression]).examples(max_group_results: 500)
53
+ end
54
+ end
55
+
48
56
  # Print version and exit if version option chosen
49
57
  if options[:version]
50
58
  $stdout.puts "Version: #{Rcmd::VERSION}"