russh 0.0.5 → 0.0.6
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 +4 -4
- data/README.md +4 -1
- data/lib/russh/accessor.rb +2 -2
- data/lib/russh/cli.rb +3 -1
- data/lib/russh/version.rb +1 -1
- data/spec/lib/russh/accessor_spec.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4af0e6a54d75a9e599d90c7b181111897ddab4
|
4
|
+
data.tar.gz: 00513f2149c5367fb396d5d32d4a2ce58c759751
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 296ec9449bf2cbdb87b6bdb05acd72e15b12fb7a11dbf84ed8e39db3f431919d0a0e1579a9bc8256a52a4d0c5a7d91bf0a7dd1cc1d273554cea0665088a8946d
|
7
|
+
data.tar.gz: b8454e6066df5d6b8f0b56cc33559703445cb42cfddec82fed377384544e3b479e79822ce9f8eb5b815e733202b8dbd45e76553d2af3255db6d2fa7cb187b008
|
data/README.md
CHANGED
data/lib/russh/accessor.rb
CHANGED
@@ -26,7 +26,7 @@ module Russh
|
|
26
26
|
begin
|
27
27
|
@is_readable = File.readable? @path
|
28
28
|
rescue => e
|
29
|
-
puts "Couldn't
|
29
|
+
puts "Couldn't read your ssh config: Error #{e}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,7 +35,7 @@ module Russh
|
|
35
35
|
begin
|
36
36
|
@is_writable = File.writable? @path
|
37
37
|
rescue => e
|
38
|
-
puts "Couldn't
|
38
|
+
puts "Couldn't write to your ssh config: Error #{e}"
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
data/lib/russh/cli.rb
CHANGED
@@ -18,6 +18,8 @@ module Russh
|
|
18
18
|
c.option '--host STRING', String, 'Host Address'
|
19
19
|
c.option '--user STRING', String, 'Username'
|
20
20
|
c.action do |args, options|
|
21
|
+
raise ArgumentError.new("Alias is required!") unless options.alias
|
22
|
+
raise ArgumentError.new("Host is required!") unless options.host
|
21
23
|
Accessor.new.create options.alias, options.host, options.user
|
22
24
|
end
|
23
25
|
end
|
@@ -25,7 +27,7 @@ module Russh
|
|
25
27
|
command :backup do |c|
|
26
28
|
c.syntax = 'russh backup'
|
27
29
|
c.description = 'Backups your ssh config'
|
28
|
-
c.action do
|
30
|
+
c.action do
|
29
31
|
Accessor.new.backup
|
30
32
|
end
|
31
33
|
end
|
data/lib/russh/version.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Russh::Accessor do
|
4
|
+
let(:path){ }
|
4
5
|
|
5
6
|
context 'accessing' do
|
6
7
|
it 'should be able to read .ssh/config' do
|
@@ -15,7 +16,7 @@ describe Russh::Accessor do
|
|
15
16
|
it 'should copy the original config' do
|
16
17
|
original_file = subject.read
|
17
18
|
subject.backup
|
18
|
-
File.read(
|
19
|
+
File.read( + '.bk').should == original_file
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -27,7 +28,8 @@ describe Russh::Accessor do
|
|
27
28
|
|
28
29
|
context 'writing' do
|
29
30
|
it 'should be able to create a new host' do
|
30
|
-
|
31
|
+
original_file = subject.read
|
32
|
+
subject.create('host1', 'www.sample.com', 'user1')
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|