sshkit-custom-dsl 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: d69e7d1a549d382002bb5f7b61505554d86cbea7
4
- data.tar.gz: 06927a065efea837d41444920c747f56da9fe253
3
+ metadata.gz: e925b4058eaddee6365c933ebea1f967efcf8842
4
+ data.tar.gz: 868fa74860240075e3b3307861081e638d1012d7
5
5
  SHA512:
6
- metadata.gz: f49e9f43033421eba935a4db6b7b483af95262154a290da5199c9ab6d84828f15bcbe52f5d179d9a700045a129b2ba3ac77bf45b2790d61d942646f3366ab5dd
7
- data.tar.gz: ac897cae0d3eb20962659992632d74986ef4f58686e0a468502e68f629465f29b91cbef1a30125159bd6de7d4dad0b42bf94a0de2adc6a39e60fd41de7b23a30
6
+ metadata.gz: 01d52e249057ef3a10c1868c70148c1a134d629c3262f0ab9043812364c7098a4115b4e7fe83dabce39c71bf7f06d38ff2a8e1e5d15565a4edfe4d3485102dff
7
+ data.tar.gz: f878fefddec2e6d6aabd06e89d319c4a656b489d2cf884eb525627cc569512b51a42492272f496e541b1e3a7c67901de6f65f366302eb6a8d830e4834ffe49de
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  [![Build Status](https://travis-ci.org/faber-lotto/sshkit-custom-dsl.svg)](https://travis-ci.org/faber-lotto/sshkit-custom-dsl)
2
2
  [![Coverage Status](https://coveralls.io/repos/faber-lotto/sshkit-custom-dsl/badge.png)](https://coveralls.io/r/faber-lotto/sshkit-custom-dsl)
3
3
  [![Code Climate](https://codeclimate.com/github/faber-lotto/sshkit-custom-dsl.png)](https://codeclimate.com/github/faber-lotto/sshkit-custom-dsl)
4
- [![Gem Version](https://badge.fury.io/rb/capistrano-template.svg)](http://badge.fury.io/rb/capistrano-template)
4
+ [![Gem Version](https://badge.fury.io/rb/sshkit-custom-dsl.svg)](http://badge.fury.io/rb/sshkit-custom-dsl)
5
5
 
6
6
  # SSHKit::Custom::DSL
7
7
 
@@ -23,7 +23,7 @@ module SSHKit
23
23
  # @option opts [Integer] :limit Amount of hosts to use in one Batch for Group Runner
24
24
  #
25
25
  def create_runner(opts)
26
- @runner = Runner::Abstract.create_runner opts
26
+ @runner = Runner::Abstract.create_runner((config_scope[:_default_runner_opts] || {}).merge(opts))
27
27
  end
28
28
 
29
29
  # The actual runner object
@@ -99,6 +99,10 @@ module SSHKit
99
99
  def active_backend
100
100
  SSHKit::Custom::Runner::Abstract.active_backend
101
101
  end
102
+
103
+ def default_runner_opts(opts)
104
+ config_scope[:_default_runner_opts] = opts
105
+ end
102
106
  end
103
107
  end
104
108
  end
@@ -82,6 +82,14 @@ module SSHKit
82
82
  _config_store.pop_user_group
83
83
  end
84
84
 
85
+ # Changes the default options for runner creation.
86
+ #
87
+ # @param opts [Hash<Symbol, String>] Default options for the runner
88
+ # @dsl
89
+ def default_runner_opts(opts)
90
+ _config_store.default_runner_opts(opts)
91
+ end
92
+
85
93
  # @api private
86
94
  def _setup_runner(hosts, options)
87
95
  _config_store.backends = hosts
@@ -1,7 +1,7 @@
1
1
  module SSHKit
2
2
  module Custom
3
3
  module DSL
4
- VERSION = '0.0.8'
4
+ VERSION = '0.0.9'
5
5
  end
6
6
  end
7
7
  end
@@ -14,6 +14,7 @@ module SSHKit
14
14
 
15
15
  before :each do
16
16
  SSHKit::Custom::Runner::Abstract.active_backend = mock_bck
17
+ Store.default_runner_opts nil
17
18
  end
18
19
 
19
20
  describe '.create_runner' do
@@ -110,6 +111,16 @@ module SSHKit
110
111
  expect(mock_bck.group).to eq 'g'
111
112
  end
112
113
  end
114
+
115
+ describe '.default_runner_opts' do
116
+ it 'sets the default options for a runner creation' do
117
+ Store.default_runner_opts(some: :things)
118
+
119
+ opts = { in: :groups }
120
+ expect(Runner::Abstract).to receive(:create_runner).with({ some: :things }.merge(opts))
121
+ Store.create_runner opts
122
+ end
123
+ end
113
124
  end
114
125
  end
115
126
  end
@@ -141,6 +141,15 @@ module SSHKit
141
141
  end
142
142
  end
143
143
 
144
+ describe '.default_runner_opts' do
145
+ it 'changes the default options for runners' do
146
+ opts = { a: :b }
147
+ expect(subject._config_store).to receive(:default_runner_opts).with(opts)
148
+
149
+ subject.default_runner_opts(opts)
150
+ end
151
+ end
152
+
144
153
  end
145
154
  end
146
155
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit-custom-dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dieter Späth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-11 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sshkit