sshkit-custom-dsl 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.consolerc +3 -0
- data/.gitignore +23 -0
- data/.rspec +2 -0
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +0 -0
- data/.travis.yml +6 -0
- data/.versions.conf +4 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +76 -0
- data/Rakefile +15 -0
- data/lib/core_ext/sshkit.rb +6 -0
- data/lib/core_ext/sshkit/backend/abstract.rb +28 -0
- data/lib/core_ext/sshkit/runner/abstract.rb +41 -0
- data/lib/core_ext/sshkit/runner/group.rb +20 -0
- data/lib/core_ext/sshkit/runner/parallel.rb +27 -0
- data/lib/core_ext/sshkit/runner/sequential.rb +22 -0
- data/lib/sshkit/custom/dsl.rb +17 -0
- data/lib/sshkit/custom/dsl/config_store.rb +77 -0
- data/lib/sshkit/custom/dsl/configuration.rb +75 -0
- data/lib/sshkit/custom/dsl/execution.rb +16 -0
- data/lib/sshkit/custom/dsl/helper.rb +23 -0
- data/lib/sshkit/custom/dsl/version.rb +7 -0
- data/spec/acceptance/.gitkeep +0 -0
- data/spec/acceptance_spec_helper.rb +1 -0
- data/spec/integration/.gitkeep +0 -0
- data/spec/integration_spec_helper.rb +1 -0
- data/spec/spec_helper.rb +48 -0
- data/spec/support/.gitkeep +0 -0
- data/spec/unit/.gitkeep +0 -0
- data/spec/unit_spec_helper.rb +1 -0
- data/sshkit-custom-dsl.gemspec +33 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ab9dd14dc306c8e3f18d81ca8385ed115842edbe
|
4
|
+
data.tar.gz: 6526ba1775b63d8b6d87243033bd3b5895e8aee9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dcb0c1732f808742b14f7d4ae62e2ac22ed47a0d27dca66e3e6e937530261f110529867796bc954abf51631ecb0892a33bce960ce8979753fcd42dd61670e765
|
7
|
+
data.tar.gz: ef35b8bd4836fa29ead1faec46b58245b756cdc979ad61754b1c07726ef6df0f63bcf412fe0fcf98ddd49bc046c00f985a49dadd483fdf21efda27227bbe133c
|
data/.consolerc
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
.idea
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
|
4
|
+
LineLength:
|
5
|
+
Max: 160
|
6
|
+
|
7
|
+
Documentation:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
ParameterLists:
|
11
|
+
Max: 15
|
12
|
+
|
13
|
+
MethodLength:
|
14
|
+
Max: 50
|
15
|
+
|
16
|
+
# @see http://www.rubytapas.com/episodes/24-Incidental-Change
|
17
|
+
TrailingComma:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
RegexpLiteral:
|
21
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
File without changes
|
data/.travis.yml
ADDED
data/.versions.conf
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 FABER Lotto GmbH & Co. KG
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# Sshkit::Custom::Dsl
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'sshkit-custom-dsl'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install sshkit-custom-dsl
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
|
23
|
+
require 'sshkit/custom/dsl'
|
24
|
+
|
25
|
+
extend SSHKit::Custom::DSL
|
26
|
+
|
27
|
+
SSHKit.configure do |sshkit|
|
28
|
+
sshkit.format = :pretty
|
29
|
+
sshkit.output_verbosity = :debug
|
30
|
+
sshkit.default_env = {}
|
31
|
+
sshkit.backend = SSHKit::Backend::Netssh
|
32
|
+
sshkit.backend.configure do |backend|
|
33
|
+
backend.pty =false
|
34
|
+
backend.connection_timeout = 5
|
35
|
+
backend.ssh_options = {user: 'deploy'}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
on %w{localhost 127.0.0.1}, in: :sequence, wait: 0 do
|
40
|
+
within "/tmp" do
|
41
|
+
with rails_env: :production do
|
42
|
+
execute "echo", "12345"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
on %w{localhost 127.0.0.1} do
|
48
|
+
within "/tmp" do
|
49
|
+
with rails_env: :production do
|
50
|
+
execute "env", "|sort"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
on %w{localhost 127.0.0.1} do
|
56
|
+
within "/tmp" do
|
57
|
+
with rails_env: :production do
|
58
|
+
execute do |backend|
|
59
|
+
puts backend.inspect
|
60
|
+
["env", "|sort"]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
```
|
67
|
+
|
68
|
+
It should work like the original one, I hope.
|
69
|
+
|
70
|
+
## Contributing
|
71
|
+
|
72
|
+
1. Fork it ( https://github.com/[my-github-username]/sshkit-custom-dsl/fork )
|
73
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
74
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
75
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
76
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
|
+
RuboCop::RakeTask.new
|
7
|
+
|
8
|
+
task :default => :spec
|
9
|
+
|
10
|
+
|
11
|
+
desc 'Run RSpec with code coverage'
|
12
|
+
task :coverage do
|
13
|
+
ENV['SIMPLE_COVERAGE'] = 'true'
|
14
|
+
Rake::Task['spec'].execute
|
15
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Backend
|
3
|
+
class Abstract
|
4
|
+
attr_writer :pwd, :env, :host, :user, :group
|
5
|
+
|
6
|
+
def pwd
|
7
|
+
@pwd ||= []
|
8
|
+
end
|
9
|
+
|
10
|
+
def env
|
11
|
+
@env ||= {}
|
12
|
+
end
|
13
|
+
|
14
|
+
def host
|
15
|
+
@host
|
16
|
+
end
|
17
|
+
|
18
|
+
def user
|
19
|
+
@user
|
20
|
+
end
|
21
|
+
|
22
|
+
def group
|
23
|
+
@group
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Runner
|
3
|
+
class Abstract
|
4
|
+
attr_accessor :backends
|
5
|
+
|
6
|
+
def active_backend
|
7
|
+
self.class.active_backend
|
8
|
+
end
|
9
|
+
|
10
|
+
def active_backend=(new_backend)
|
11
|
+
self.class.active_backend=new_backend
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.active_backend
|
15
|
+
Thread.current[:active_backend]
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.active_backend=(new_backend)
|
19
|
+
Thread.current[:active_backend]=new_backend
|
20
|
+
end
|
21
|
+
|
22
|
+
def send_cmd(cmd, *args, &block)
|
23
|
+
|
24
|
+
begin
|
25
|
+
|
26
|
+
if block
|
27
|
+
args = Array(block.call(active_backend.host))
|
28
|
+
end
|
29
|
+
|
30
|
+
active_backend.send(cmd, *args)
|
31
|
+
|
32
|
+
rescue Exception => e
|
33
|
+
e2 = ExecuteError.new e
|
34
|
+
raise e2, "Exception while executing on host #{active_backend.host}: #{e.message}"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Runner
|
3
|
+
|
4
|
+
class Group < Sequential
|
5
|
+
attr_writer :group_size
|
6
|
+
|
7
|
+
def do_it( &block)
|
8
|
+
backends.each_slice(group_size).collect do |group_backends|
|
9
|
+
|
10
|
+
Parallel.new(nil, nil).tap do |runner|
|
11
|
+
runner.backends = group_backends
|
12
|
+
runner.do_it(&block)
|
13
|
+
end
|
14
|
+
|
15
|
+
sleep wait_interval
|
16
|
+
end.flatten
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Runner
|
3
|
+
|
4
|
+
class Parallel < Abstract
|
5
|
+
|
6
|
+
def do_it( &block)
|
7
|
+
threads = []
|
8
|
+
backends.each do |host|
|
9
|
+
threads << Thread.new(host) do |h|
|
10
|
+
begin
|
11
|
+
|
12
|
+
self.active_backend = h
|
13
|
+
block.call(h.host)
|
14
|
+
|
15
|
+
rescue Exception => e
|
16
|
+
e2 = ExecuteError.new e
|
17
|
+
raise e2, "Exception while executing on host #{h}: #{e.message}"
|
18
|
+
ensure
|
19
|
+
self.active_backend = nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
threads.map(&:join)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Runner
|
3
|
+
class Sequential < Abstract
|
4
|
+
def do_it( &block)
|
5
|
+
backends.each do |backend|
|
6
|
+
begin
|
7
|
+
|
8
|
+
self.active_backend = backend
|
9
|
+
block.call(backend.host)
|
10
|
+
|
11
|
+
rescue Exception => e
|
12
|
+
e2 = ExecuteError.new e
|
13
|
+
raise e2, "Exception while executing on host #{backend}: #{e.message}"
|
14
|
+
ensure
|
15
|
+
self.active_backend = nil
|
16
|
+
end
|
17
|
+
sleep wait_interval
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'sshkit/custom/dsl/version'
|
2
|
+
require 'core_ext/sshkit'
|
3
|
+
|
4
|
+
require 'sshkit/custom/dsl/config_store'
|
5
|
+
require 'sshkit/custom/dsl/configuration'
|
6
|
+
require 'sshkit/custom/dsl/execution'
|
7
|
+
require 'sshkit/custom/dsl/helper'
|
8
|
+
|
9
|
+
module SSHKit
|
10
|
+
module Custom
|
11
|
+
module DSL
|
12
|
+
include Configuration
|
13
|
+
include Execution
|
14
|
+
include Helper
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Custom
|
3
|
+
module DSL
|
4
|
+
module ConfigStore
|
5
|
+
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def runner_opts=(opts)
|
9
|
+
@runner = nil
|
10
|
+
@runner_opts = { in: :parallel }.merge(opts)
|
11
|
+
end
|
12
|
+
|
13
|
+
def runner
|
14
|
+
@runner ||= case @runner_opts[:in]
|
15
|
+
when :parallel then SSHKit::Runner::Parallel
|
16
|
+
when :sequence then SSHKit::Runner::Sequential
|
17
|
+
when :groups then SSHKit::Runner::Group
|
18
|
+
else
|
19
|
+
raise RuntimeError, "Don't know how to handle run style #{@runner_opts[:in].inspect}"
|
20
|
+
end.new(nil, @runner_opts)
|
21
|
+
|
22
|
+
@runner.tap{|r| r.backends = backends}
|
23
|
+
end
|
24
|
+
|
25
|
+
def backends=(hosts)
|
26
|
+
@backends = hosts.map { |host| SSHKit.config.backend.new(host) }
|
27
|
+
end
|
28
|
+
|
29
|
+
def backends
|
30
|
+
@backends ||= []
|
31
|
+
end
|
32
|
+
|
33
|
+
def add_pwd(directory)
|
34
|
+
backend.pwd ||= []; backend.pwd << directory
|
35
|
+
end
|
36
|
+
|
37
|
+
def pop_pwd
|
38
|
+
backend.pwd ||= []; backend.pwd.pop
|
39
|
+
end
|
40
|
+
|
41
|
+
def _envs
|
42
|
+
Thread.current[:_envs] ||= []
|
43
|
+
end
|
44
|
+
|
45
|
+
def add_env(env)
|
46
|
+
old_env = backends.first.env.clone
|
47
|
+
_envs << old_env
|
48
|
+
env = old_env.merge(env)
|
49
|
+
backend.env = env
|
50
|
+
end
|
51
|
+
|
52
|
+
def pop_env
|
53
|
+
old_env = _envs.pop || {}
|
54
|
+
backends.each {|backend| backend.env = old_env}
|
55
|
+
end
|
56
|
+
|
57
|
+
def _user_groups
|
58
|
+
Thread.current[:_user_groups] ||= []
|
59
|
+
end
|
60
|
+
|
61
|
+
def add_user_group(user, group)
|
62
|
+
_user_groups << {user: backend.user, group: backend.group }
|
63
|
+
backend.user = user; backend.group = group
|
64
|
+
end
|
65
|
+
|
66
|
+
def pop_user_group
|
67
|
+
old_user_group = _user_groups.pop || {}
|
68
|
+
backend.user = old_user_group[:user]; backend.group = old_user_group[:group]
|
69
|
+
end
|
70
|
+
|
71
|
+
def backend
|
72
|
+
SSHKit::Runner::Abstract.active_backend
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Custom
|
3
|
+
module DSL
|
4
|
+
module Configuration
|
5
|
+
|
6
|
+
def config_store
|
7
|
+
@config_store ||= SSHKit::Custom::DSL::ConfigStore
|
8
|
+
end
|
9
|
+
|
10
|
+
def on(hosts, options={}, &block)
|
11
|
+
hosts = Array(hosts).map { |rh| rh.is_a?(SSHKit::Host) ? rh : SSHKit::Host.new(rh) }.uniq
|
12
|
+
config_store.backends = hosts
|
13
|
+
config_store.runner_opts = options
|
14
|
+
config_store.runner.do_it(&block) if block_given?
|
15
|
+
end
|
16
|
+
|
17
|
+
def within(directory)
|
18
|
+
|
19
|
+
dir_to_check = File.join(config_store.backend.pwd + [directory])
|
20
|
+
|
21
|
+
execute <<-EOTEST, verbosity: Logger::DEBUG
|
22
|
+
if test ! -d #{dir_to_check}
|
23
|
+
then echo "Directory does not exist '#{dir_to_check}'" 1>&2
|
24
|
+
false
|
25
|
+
fi
|
26
|
+
EOTEST
|
27
|
+
|
28
|
+
config_store.add_pwd directory
|
29
|
+
|
30
|
+
yield if block_given?
|
31
|
+
ensure
|
32
|
+
config_store.pop_pwd
|
33
|
+
end
|
34
|
+
|
35
|
+
def with(environment)
|
36
|
+
config_store.add_env environment
|
37
|
+
yield if block_given?
|
38
|
+
ensure
|
39
|
+
config_store.pop_env
|
40
|
+
end
|
41
|
+
|
42
|
+
def as(who)
|
43
|
+
if who.is_a? Hash
|
44
|
+
user = who[:user] || who["user"]
|
45
|
+
group = who[:group] || who["group"]
|
46
|
+
else
|
47
|
+
user = who
|
48
|
+
group = nil
|
49
|
+
end
|
50
|
+
|
51
|
+
execute <<-EOTEST, verbosity: Logger::DEBUG
|
52
|
+
if ! sudo -u #{user} whoami > /dev/null
|
53
|
+
then echo "You cannot switch to user '#{user}' using sudo, please check the sudoers file" 1>&2
|
54
|
+
false
|
55
|
+
fi
|
56
|
+
EOTEST
|
57
|
+
|
58
|
+
execute <<-EOTEST, verbosity: Logger::DEBUG if group
|
59
|
+
if ! sudo -u #{user} -g #{group} whoami > /dev/null
|
60
|
+
then echo "You cannot switch to group '#{group}' using sudo, please check the sudoers file" 1>&2
|
61
|
+
false
|
62
|
+
fi
|
63
|
+
EOTEST
|
64
|
+
|
65
|
+
config_store.add_user_group user, group
|
66
|
+
|
67
|
+
yield if block_given?
|
68
|
+
ensure
|
69
|
+
config_store.pop_user_group
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Custom
|
3
|
+
module DSL
|
4
|
+
module Execution
|
5
|
+
|
6
|
+
|
7
|
+
[:execute, :make, :rake, :test, :capture, :upload!, :download!].each do |method|
|
8
|
+
define_method method do |*args, &block|
|
9
|
+
config_store.runner.send_cmd method, *args, &block
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module SSHKit
|
2
|
+
module Custom
|
3
|
+
module DSL
|
4
|
+
module Helper
|
5
|
+
|
6
|
+
def active_backend
|
7
|
+
SSHKit::Runner::Abstract.active_backend
|
8
|
+
end
|
9
|
+
|
10
|
+
def host
|
11
|
+
active_backend.host
|
12
|
+
end
|
13
|
+
|
14
|
+
[:log, :debug, :fatal, :error, :warn, :info, :debug].each do |method|
|
15
|
+
define_method method do |*args|
|
16
|
+
active_backend.send method, *args
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
Bundler.require(:development)
|
5
|
+
|
6
|
+
require 'coveralls'
|
7
|
+
Coveralls.wear! unless ENV['SIMPLE_COVERAGE']
|
8
|
+
|
9
|
+
begin
|
10
|
+
if ENV['SIMPLE_COVERAGE']
|
11
|
+
require 'simplecov'
|
12
|
+
SimpleCov.start do
|
13
|
+
add_group 'Lib', 'lib'
|
14
|
+
|
15
|
+
add_filter '/spec/'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
rescue LoadError
|
19
|
+
warn '=' * 80
|
20
|
+
warn 'simplecov not installed. No coverage report'
|
21
|
+
warn '=' * 80
|
22
|
+
end
|
23
|
+
|
24
|
+
#########################################
|
25
|
+
require 'sshkit/custom/dsl'
|
26
|
+
#########################################
|
27
|
+
|
28
|
+
Dir[File.join(File.expand_path(__dir__), 'support/**/*.rb')].each { |f| require f }
|
29
|
+
|
30
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
31
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
32
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
33
|
+
# loaded once.
|
34
|
+
#
|
35
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
38
|
+
config.run_all_when_everything_filtered = true
|
39
|
+
config.filter_run :focus
|
40
|
+
|
41
|
+
# Run specs in random order to surface order dependencies. If you find an
|
42
|
+
# order dependency and want to debug it, you can fix the order by providing
|
43
|
+
# the seed, which is printed after each run.
|
44
|
+
# --seed 1234
|
45
|
+
config.order = 'random'
|
46
|
+
end
|
47
|
+
|
48
|
+
|
File without changes
|
data/spec/unit/.gitkeep
ADDED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sshkit/custom/dsl/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sshkit-custom-dsl"
|
8
|
+
spec.version = SSHKit::Custom::DSL::VERSION
|
9
|
+
spec.authors = ["Dieter Späth"]
|
10
|
+
spec.email = ["d.spaeth@faber.de"]
|
11
|
+
spec.summary = %q{Exchanges original sshkit dsl against a custom dsl}
|
12
|
+
spec.description = %q{Exchanges original sshkit dsl against a custom dsl. This DSL does not change the scope of the blocks.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'sshkit', '~> 1.5.1'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
|
27
|
+
spec.add_development_dependency 'rspec', '2.99.0.rc1'
|
28
|
+
# show nicely how many specs have to be run
|
29
|
+
spec.add_development_dependency 'fuubar'
|
30
|
+
# extended console
|
31
|
+
spec.add_development_dependency 'pry'
|
32
|
+
spec.add_development_dependency 'pry-remote'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sshkit-custom-dsl
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dieter Späth
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sshkit
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.5.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.5.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.99.0.rc1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.99.0.rc1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: fuubar
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-remote
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Exchanges original sshkit dsl against a custom dsl. This DSL does not
|
126
|
+
change the scope of the blocks.
|
127
|
+
email:
|
128
|
+
- d.spaeth@faber.de
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- .consolerc
|
134
|
+
- .gitignore
|
135
|
+
- .rspec
|
136
|
+
- .rubocop.yml
|
137
|
+
- .rubocop_todo.yml
|
138
|
+
- .travis.yml
|
139
|
+
- .versions.conf
|
140
|
+
- Gemfile
|
141
|
+
- LICENSE.txt
|
142
|
+
- README.md
|
143
|
+
- Rakefile
|
144
|
+
- lib/core_ext/sshkit.rb
|
145
|
+
- lib/core_ext/sshkit/backend/abstract.rb
|
146
|
+
- lib/core_ext/sshkit/runner/abstract.rb
|
147
|
+
- lib/core_ext/sshkit/runner/group.rb
|
148
|
+
- lib/core_ext/sshkit/runner/parallel.rb
|
149
|
+
- lib/core_ext/sshkit/runner/sequential.rb
|
150
|
+
- lib/sshkit/custom/dsl.rb
|
151
|
+
- lib/sshkit/custom/dsl/config_store.rb
|
152
|
+
- lib/sshkit/custom/dsl/configuration.rb
|
153
|
+
- lib/sshkit/custom/dsl/execution.rb
|
154
|
+
- lib/sshkit/custom/dsl/helper.rb
|
155
|
+
- lib/sshkit/custom/dsl/version.rb
|
156
|
+
- spec/acceptance/.gitkeep
|
157
|
+
- spec/acceptance_spec_helper.rb
|
158
|
+
- spec/integration/.gitkeep
|
159
|
+
- spec/integration_spec_helper.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
- spec/support/.gitkeep
|
162
|
+
- spec/unit/.gitkeep
|
163
|
+
- spec/unit_spec_helper.rb
|
164
|
+
- sshkit-custom-dsl.gemspec
|
165
|
+
homepage: ''
|
166
|
+
licenses:
|
167
|
+
- MIT
|
168
|
+
metadata: {}
|
169
|
+
post_install_message:
|
170
|
+
rdoc_options: []
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - '>='
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
requirements: []
|
184
|
+
rubyforge_project:
|
185
|
+
rubygems_version: 2.1.11
|
186
|
+
signing_key:
|
187
|
+
specification_version: 4
|
188
|
+
summary: Exchanges original sshkit dsl against a custom dsl
|
189
|
+
test_files:
|
190
|
+
- spec/acceptance/.gitkeep
|
191
|
+
- spec/acceptance_spec_helper.rb
|
192
|
+
- spec/integration/.gitkeep
|
193
|
+
- spec/integration_spec_helper.rb
|
194
|
+
- spec/spec_helper.rb
|
195
|
+
- spec/support/.gitkeep
|
196
|
+
- spec/unit/.gitkeep
|
197
|
+
- spec/unit_spec_helper.rb
|