russh 0.0.5 → 0.0.6

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: 1914bfc930ce7a0fe5d96e79309e8694d49287cc
4
- data.tar.gz: de673be7381035aa26230359be3654a30db6f0bc
3
+ metadata.gz: 7e4af0e6a54d75a9e599d90c7b181111897ddab4
4
+ data.tar.gz: 00513f2149c5367fb396d5d32d4a2ce58c759751
5
5
  SHA512:
6
- metadata.gz: 0b476daad69ad412a0578dcb2bfa9458a40ed6bd0271c1f8dfa8d0f4de9e1b0382826beb8fd9a48ba49a646fd6891cf629088897e1c0935aef82026e240995ea
7
- data.tar.gz: f8dea1d5ec7c589876608ee245fccf4cd7a81acf1a86be5bceb65a874b151d22c5d9a9c931136baa9caf2928d83635ec42d0f87d972aab4fa5586fc0e97f7e01
6
+ metadata.gz: 296ec9449bf2cbdb87b6bdb05acd72e15b12fb7a11dbf84ed8e39db3f431919d0a0e1579a9bc8256a52a4d0c5a7d91bf0a7dd1cc1d273554cea0665088a8946d
7
+ data.tar.gz: b8454e6066df5d6b8f0b56cc33559703445cb42cfddec82fed377384544e3b479e79822ce9f8eb5b815e733202b8dbd45e76553d2af3255db6d2fa7cb187b008
data/README.md CHANGED
@@ -14,8 +14,11 @@ Currently under heavy development.
14
14
 
15
15
  ### Create a new configuration
16
16
 
17
- russh create
17
+ russh create --alias host1 --host www.example.com --username ubuntu
18
18
 
19
+ ### Backup
20
+
21
+ russh backup
19
22
 
20
23
  ## Contributing
21
24
 
@@ -26,7 +26,7 @@ module Russh
26
26
  begin
27
27
  @is_readable = File.readable? @path
28
28
  rescue => e
29
- puts "Couldn't be able to read your ssh config: Error #{e}"
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 be able to write your ssh config: Error #{e}"
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 |args, options|
30
+ c.action do
29
31
  Accessor.new.backup
30
32
  end
31
33
  end
data/lib/russh/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Russh
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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(subject.path + '.bk').should == original_file
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serdar Dogruyol