shexy 0.3 → 0.3.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.
Files changed (4) hide show
  1. data/README.md +4 -0
  2. data/Rakefile +1 -1
  3. data/lib/shexy.rb +4 -3
  4. metadata +3 -3
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  SSH, the way I like it.
4
4
 
5
+ ## Install
6
+
7
+ gem install shexy
8
+
5
9
  ## Do it
6
10
 
7
11
  require 'shexy'
data/Rakefile CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
18
18
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
19
19
  gem.version = Shexy::VERSION
20
20
  gem.name = "shexy"
21
- gem.homepage = "http://github.com/rubiojr/shexy"
21
+ gem.homepage = "http://rubiojr.github.com/shexy"
22
22
  gem.license = "MIT"
23
23
  gem.summary = %Q{SSH, the way I like it}
24
24
  gem.description = %Q{[extremely] thin wrapper around net-ssh and net-scp}
@@ -33,7 +33,7 @@ require 'net/scp'
33
33
 
34
34
  module Shexy
35
35
 
36
- VERSION = '0.3'
36
+ VERSION = '0.3.1'
37
37
 
38
38
  [:user, :password, :key, :cmd, :host].each do |n|
39
39
  instance_eval %{
@@ -242,11 +242,12 @@ module Shexy
242
242
  unless value =~ /^(yes|no|without-password)$/
243
243
  raise ArgumentError.new "Argument should be yes|no|without-password"
244
244
  end
245
+
245
246
  using_sudo = Shexy.sudo?
246
- Shexy.use_sudo
247
+ Shexy.use_sudo unless Shexy.user == 'root'
247
248
  out, err = batch do
248
249
  script <<-EOH
249
- sed -i 's/^#\?PermitRootLogin.*$/PermitRootLogin\ #{value}/' /etc/ssh/sshd_config
250
+ sed -i 's/^#\\?PermitRootLogin.*$/PermitRootLogin\\ #{value}/' /etc/ssh/sshd_config
250
251
  test -f /etc/init.d/ssh && /etc/init.d/ssh restart
251
252
  test -f /etc/init.d/sshd && /etc/init.d/sshd restart
252
253
  EOH
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shexy
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -139,7 +139,7 @@ files:
139
139
  - Rakefile
140
140
  - lib/shexy.rb
141
141
  - spec/spec_helper.rb
142
- homepage: http://github.com/rubiojr/shexy
142
+ homepage: http://rubiojr.github.com/shexy
143
143
  licenses:
144
144
  - MIT
145
145
  post_install_message:
@@ -154,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  segments:
156
156
  - 0
157
- hash: 130145655460833176
157
+ hash: 1420840912196924587
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  none: false
160
160
  requirements: