bunka 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bunka +2 -1
  3. data/bunka.gemspec +1 -1
  4. data/lib/bunka.rb +5 -4
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bcbc8b6e5fa260e526443bfcc2616f7c1286ec06
4
- data.tar.gz: c068a50c49ca9199e76347539577e81342efc1ca
3
+ metadata.gz: c2f4ae862ed5def414a479c371c79c4da80695b5
4
+ data.tar.gz: 26ecab7c3a36d9422d0dfc42b0d53dbb7df4387e
5
5
  SHA512:
6
- metadata.gz: cde791cd711a958f7426a69ec27aab8ecf45f5380306dfb20ab155ab04dbf8a5ba427667f79d2873b80af15956071c8e46fd296b370878cfaeb0a25217587445
7
- data.tar.gz: 67b527864f372858931caa27c53303a953acc7bfcac0ac31b62932aa0a3e10e6c4ac67c013b212d130e6c6dec518e8ad62c78174344ddb00ed2dc0f96e87d955
6
+ metadata.gz: a44cb8758b185129f890a7e91b67c12aae9ad9969d205e65050007b0a261c5f1aadbd3cf98f4273dcbce43fb1aa85dcd433a8409c491118252648e117ab84bda
7
+ data.tar.gz: c4ef94336c0838f4abd32ec522707efa7e4b43ba245e2cc03988d01aa5941313bc59bca2a30f38b264ce3be4ae0ba6e60276953f68d56146ceb1d1bb9468785f
data/bin/bunka CHANGED
@@ -10,9 +10,10 @@ class BunkaCommand < Thor
10
10
  option :sequential, type: :boolean, desc: 'run over nodes sequantially', default: false
11
11
  option :invert, type: :boolean, desc: 'invert matched results', default: false
12
12
  option :timeout, type: :numeric, desc: 'timeout interval per ssh connection (default: 15)', default: 15
13
+ option :threads, type: :numeric, desc: 'number of threads (default: 15)', default: 15
13
14
  option :'print-success', type: :boolean, desc: 'prints output of successful commands', default: false
14
15
  def test(command, query='name:*')
15
- Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential])
16
+ Bunka.test(command, query, options[:timeout], options[:'print-success'], options[:invert], options[:sequential], options[:threads])
16
17
  end
17
18
  end
18
19
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'bunka'
3
- spec.version = '1.2.0'
3
+ spec.version = '1.3.0'
4
4
  spec.executables << 'bunka'
5
5
  spec.date = '2013-11-26'
6
6
  spec.summary = 'Parallel ssh commands over chef servers with rspec-like output'
@@ -8,20 +8,21 @@ require 'bunka/ssh'
8
8
 
9
9
  class Bunka
10
10
  class << self
11
- def test command, query, timeout_interval, verbose_success, invert, sequential
11
+ def test command, query, timeout_interval, verbose_success, invert, sequential, threads
12
12
  @command = command
13
+ @invert = invert
13
14
  @query = query
15
+ @sequential = sequential
16
+ @threads = threads
14
17
  @timeout_interval = timeout_interval
15
18
  @verbose_success = verbose_success
16
- @invert = invert
17
- @sequential = sequential
18
19
 
19
20
  if sequential
20
21
  knife_search(@query).each do |fqdn|
21
22
  execute_query fqdn
22
23
  end
23
24
  else
24
- Parallel.map(knife_search(@query), in_threads: 15) do |fqdn|
25
+ Parallel.map(knife_search(@query), in_threads: @threads) do |fqdn|
25
26
  execute_query fqdn
26
27
  end
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven De Coeyer