cronicle 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/cronicle.gemspec +1 -1
- data/lib/cronicle/ext/net-ssh_ext.rb +3 -1
- data/lib/cronicle/ext/sshkit_ext.rb +1 -1
- data/lib/cronicle/version.rb +1 -1
- data/lib/cronicle.rb +1 -1
- data/spec/cronicle_exec_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cdae0546bbdc1bd3e6a5bafd16d9b1f90f67d17
|
4
|
+
data.tar.gz: 61b267dfbc54560acdd815389696bda3ec5d8fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa6f2ff6eefa7bc123f0f6af444d566c6db47e8786439cb23b53aee310b8e3378c40385d5a3c2764c3658072d220fb64c36924fe94b51697e5f51d88232ff9f
|
7
|
+
data.tar.gz: ed515c832462b40bf65b737a9c963ac12db5a194cfc9e97bdf5acd504204ab0a3932aa716050190b841b2b9db6968103c841017e39bca06de21556722537de8c
|
data/README.md
CHANGED
@@ -133,7 +133,7 @@ server2
|
|
133
133
|
|
134
134
|
Hosts definition file is not required.
|
135
135
|
|
136
|
-
If you pass `--hosts`
|
136
|
+
If you pass `--hosts` option, can be defined as follows in Jobfile:
|
137
137
|
|
138
138
|
```ruby
|
139
139
|
on servers: /any_host/ do # use regexp
|
data/cronicle.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['sgwr_dts@yahoo.co.jp']
|
11
11
|
spec.summary = %q{It is a tool for execute script, and define cron on remote hosts.}
|
12
12
|
spec.description = %q{It is a tool for execute script, and define cron on remote hosts.}
|
13
|
-
spec.homepage = '
|
13
|
+
spec.homepage = 'http://cronicle.codenize.tools/'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -1,11 +1,13 @@
|
|
1
1
|
class Net::SSH::Connection::Channel
|
2
|
+
PROMPT_REGEXP = Regexp.compile('^' + Regexp.escape(SSHKit::Backend::Netssh::SUDO_PROMPT) + '\b')
|
3
|
+
|
2
4
|
alias on_data_orig on_data
|
3
5
|
|
4
6
|
def on_data(&block)
|
5
7
|
on_data_orig do |ch, data|
|
6
8
|
sudo_password = Thread.current[SSHKit::Backend::Netssh::SUDO_PASSWORD_KEY]
|
7
9
|
|
8
|
-
if sudo_password and data
|
10
|
+
if sudo_password and data =~ PROMPT_REGEXP
|
9
11
|
ch.send_data(sudo_password + "\n")
|
10
12
|
else
|
11
13
|
block.call(ch, data) if block
|
@@ -9,7 +9,7 @@ class SSHKit::Backend::Netssh
|
|
9
9
|
|
10
10
|
retval = with_sudo_password(host.options[:sudo_password] || '') do
|
11
11
|
with_sudo = [:sudo, '-p', SUDO_PROMPT, '-S']
|
12
|
-
with_sudo << '-u' << opts[:user] if opts[:user]
|
12
|
+
with_sudo << :sudo << '-u' << opts[:user] if opts[:user]
|
13
13
|
with_sudo.concat(args)
|
14
14
|
|
15
15
|
raise_on_non_zero_exit = opts.fetch(:raise_on_non_zero_exit, true)
|
data/lib/cronicle/version.rb
CHANGED
data/lib/cronicle.rb
CHANGED
@@ -15,8 +15,8 @@ require 'unindent'
|
|
15
15
|
|
16
16
|
module Cronicle; end
|
17
17
|
require 'cronicle/ext/hash_ext'
|
18
|
-
require 'cronicle/ext/net-ssh_ext'
|
19
18
|
require 'cronicle/ext/sshkit_ext'
|
19
|
+
require 'cronicle/ext/net-ssh_ext'
|
20
20
|
require 'cronicle/logger'
|
21
21
|
require 'cronicle/utils'
|
22
22
|
require 'cronicle/client'
|
data/spec/cronicle_exec_spec.rb
CHANGED
@@ -128,6 +128,7 @@ describe 'Cronicle::Client#exec' do
|
|
128
128
|
it do
|
129
129
|
expect(amzn_out).to eq <<-EOS.unindent
|
130
130
|
foo on amazon_linux/ec2-user> Execute job
|
131
|
+
foo on amazon_linux/ec2-user>\s
|
131
132
|
foo on amazon_linux/ec2-user> Linux
|
132
133
|
foo on amazon_linux/ec2-user> ec2-user
|
133
134
|
EOS
|
@@ -136,6 +137,7 @@ describe 'Cronicle::Client#exec' do
|
|
136
137
|
it do
|
137
138
|
expect(ubuntu_out).to eq <<-EOS.unindent
|
138
139
|
foo on ubuntu/ubuntu> Execute job
|
140
|
+
foo on ubuntu/ubuntu>\s
|
139
141
|
foo on ubuntu/ubuntu> Linux
|
140
142
|
foo on ubuntu/ubuntu> ubuntu
|
141
143
|
EOS
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronicle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -218,7 +218,7 @@ files:
|
|
218
218
|
- spec/cronicle_update_spec.rb
|
219
219
|
- spec/host_list_spec.rb
|
220
220
|
- spec/spec_helper.rb
|
221
|
-
homepage:
|
221
|
+
homepage: http://cronicle.codenize.tools/
|
222
222
|
licenses:
|
223
223
|
- MIT
|
224
224
|
metadata: {}
|