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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e33a76397600f6b7c1dc022459638a2fa110e8fb
4
- data.tar.gz: be4c62e61702f516a1c0fa1092d4db59d63eb9e5
3
+ metadata.gz: 7cdae0546bbdc1bd3e6a5bafd16d9b1f90f67d17
4
+ data.tar.gz: 61b267dfbc54560acdd815389696bda3ec5d8fdb
5
5
  SHA512:
6
- metadata.gz: db4e5c51f3742cbb08a974fb9beac13aa9507a6a05d72827891dfa22b277968602a7ea48d8c4a684df2f44b3e391be3789a2cc3077bdf4f32badc6f4091a693e
7
- data.tar.gz: 897f0d4f90395b938e06be90bed3cc8cd5df90cfaf5e1fe57dcf057d7818503c5ef2c19c56706bc21f72a0708de99039d4f55610bb37557e43944a8d10810f80
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` options, can be defined as follows in Jobfile:
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 = 'https://github.com/winebarrel/cronicle'
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 == SSHKit::Backend::Netssh::SUDO_PROMPT
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)
@@ -1,3 +1,3 @@
1
1
  module Cronicle
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
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'
@@ -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.3
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: https://github.com/winebarrel/cronicle
221
+ homepage: http://cronicle.codenize.tools/
222
222
  licenses:
223
223
  - MIT
224
224
  metadata: {}