kanrisuru 0.8.13 → 0.8.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2465d4419a5fa15bc4ec736c6064e48386be6e130d4a934404b8a1b0f7eaaa0
4
- data.tar.gz: 5441c0ae297aad2fdc7f08686eca97585793f747aaf92b32339da66c4343f3cf
3
+ metadata.gz: 1537cdde3ded7563e59018ddb94f1c05bb17ff486c87f6113eaa1800b6f7c338
4
+ data.tar.gz: 571b0fef3b4d780d3fac4f485f7f1b1dd14bd3c73253a7b5649ae7e86975fd81
5
5
  SHA512:
6
- metadata.gz: 328fdfb44f1d0b18f4bd1fb49ab54779fb464e3f8948a8600f2d2e5cdddfe8ac351fa4499ee0f981a8f12fd262bf1d7757f71d721dafbf447834c8d6ff17ac6f
7
- data.tar.gz: 20c59fd7d9e2e57e356beecf55809c3cbb009fe5d0e8b5692088731ed6bac3665e1e88f6e162d6cda1b7874e8a9a30e30ef52a6c5572cdfbd33f4328ee402eda
6
+ metadata.gz: 2351ae7e335b61a1362c15a08540977c5d366ae2c441882f4feff32bc7939da71312dc5f380fa707a6c3cb187e81d413d558ae55e31e395d069e1a3c5e3f2a08
7
+ data.tar.gz: 2fbb6a9649eb2a67c46bc0a617cd22965738dfcbb092b4b99da588ae70518b4a0dfc79aa2da55c58d53f760170a5c33c844a86aae97f56eeed4628c735a65546
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## Kanrisuru 0.8.14 (October 8, 20201)
2
+ * Update `Kanrisuru::Remote::Cluster` instantiation method to use array splat instead of passing array directly.
3
+
1
4
  ## Kanrisuru 0.8.13 (October 4, 20201)
2
5
  * Fix `wc` command. Ensure result parsing is cast to integer values.
3
6
 
data/README.md CHANGED
@@ -48,7 +48,7 @@ result.path # => /home/ubuntu
48
48
 
49
49
  ### Cluster
50
50
  ```ruby
51
- cluster = Kanrisuru::Remote::Cluster.new([{
51
+ cluster = Kanrisuru::Remote::Cluster.new({
52
52
  host: 'host1', username: 'ubuntu', keys: ['~/.ssh/id_rsa']
53
53
  }, {
54
54
  host: 'host2', username: 'alice', keys: ['~/.ssh/id_rsa']
@@ -72,7 +72,7 @@ host.execute(command)
72
72
  command.success? #=> true
73
73
  command.to_s #=> Linux
74
74
 
75
- cluster = Kanrisuru::Remote::Cluster.new([host, {host: 'host2', username: 'alice', keys: ['~/.ssh/id_rsa']}])
75
+ cluster = Kanrisuru::Remote::Cluster.new(host, {host: 'host2', username: 'alice', keys: ['~/.ssh/id_rsa']})
76
76
 
77
77
  cluster.execute('uname') #=> {host: 'host1', result: 'Linux'}, {host: 'host2', result: 'Linux'}
78
78
  ```
@@ -6,7 +6,7 @@ module Kanrisuru
6
6
  extend OsPackage::Collection
7
7
  include Enumerable
8
8
 
9
- def initialize(hosts)
9
+ def initialize(*hosts)
10
10
  @hosts = {}
11
11
  hosts.each do |host_opts|
12
12
  add_host(host_opts)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.8.13'
4
+ VERSION = '0.8.14'
5
5
  end
@@ -111,7 +111,7 @@ RSpec.describe Kanrisuru::OsPackage do
111
111
  host = Kanrisuru::Remote::Host.new(host: '127.0.0.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
112
112
  host2 = Kanrisuru::Remote::Host.new(host: 'localhost', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
113
113
 
114
- cluster = Kanrisuru::Remote::Cluster.new([host, host2])
114
+ cluster = Kanrisuru::Remote::Cluster.new(host, host2)
115
115
 
116
116
  expect(host).to respond_to(:tester)
117
117
  expect(host.tester).to eq('hello ubuntu')
@@ -125,7 +125,7 @@ RSpec.describe Kanrisuru::OsPackage do
125
125
  host = Kanrisuru::Remote::Host.new(host: '127.0.0.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
126
126
  host2 = Kanrisuru::Remote::Host.new(host: 'localhost', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
127
127
 
128
- cluster = Kanrisuru::Remote::Cluster.new([host, host2])
128
+ cluster = Kanrisuru::Remote::Cluster.new(host, host2)
129
129
 
130
130
  expect(host).to respond_to(:asdf)
131
131
  expect(host.asdf).to respond_to(:tester)
@@ -151,7 +151,7 @@ RSpec.describe Kanrisuru::OsPackage do
151
151
  host2 = Kanrisuru::Remote::Host.new(host: 'centos-host', username: 'centos', keys: ['~/.ssh/id_rsa'])
152
152
  host3 = Kanrisuru::Remote::Host.new(host: 'opensuse-host', username: 'opensuse', keys: ['~/.ssh/id_rsa'])
153
153
 
154
- cluster = Kanrisuru::Remote::Cluster.new([host1, host2, host3])
154
+ cluster = Kanrisuru::Remote::Cluster.new(host1, host2, host3)
155
155
 
156
156
  expect(host1).to respond_to(:output)
157
157
  expect(host2).to respond_to(:output)
@@ -5,7 +5,7 @@ require 'spec_helper'
5
5
  RSpec.describe Kanrisuru::Remote::Cluster do
6
6
  context 'with ubuntu' do
7
7
  it 'gets hostname for cluster' do
8
- cluster = described_class.new([{
8
+ cluster = described_class.new({
9
9
  host: 'localhost',
10
10
  username: 'ubuntu',
11
11
  keys: ['~/.ssh/id_rsa']
@@ -13,7 +13,7 @@ RSpec.describe Kanrisuru::Remote::Cluster do
13
13
  host: '127.0.0.1',
14
14
  username: 'ubuntu',
15
15
  keys: ['~/.ssh/id_rsa']
16
- }])
16
+ })
17
17
 
18
18
  expect(cluster.hostname).to match([
19
19
  { host: 'localhost', result: 'ubuntu' },
@@ -24,7 +24,7 @@ RSpec.describe Kanrisuru::Remote::Cluster do
24
24
  end
25
25
 
26
26
  it 'can ping host cluster' do
27
- cluster = described_class.new([{
27
+ cluster = described_class.new({
28
28
  host: 'localhost',
29
29
  username: 'ubuntu',
30
30
  keys: ['~/.ssh/id_rsa']
@@ -32,7 +32,7 @@ RSpec.describe Kanrisuru::Remote::Cluster do
32
32
  host: '127.0.0.1',
33
33
  username: 'ubuntu',
34
34
  keys: ['~/.ssh/id_rsa']
35
- }])
35
+ })
36
36
 
37
37
  expect(cluster.ping?).to match([
38
38
  { host: 'localhost', result: true },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-04 00:00:00.000000000 Z
11
+ date: 2021-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec