locum 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f87d91e87fda786817550758ea0d4365cf58ef04
4
- data.tar.gz: 9984285dd811c46e70108c990955156a3adf0a49
3
+ metadata.gz: bba75c2322409d1b71b6be6006045474b6b1e07a
4
+ data.tar.gz: 0c1d4596f12df4021a33f9459abb28222de42f4b
5
5
  SHA512:
6
- metadata.gz: 4928f011a040e9121996a12e120c8c39e71beb8a5b7224dc55757f798ffa30e8b9145ea25f79534f5addeaab6e25bc8ba645fdff7e8fad562b94499ebc9ca962
7
- data.tar.gz: b26529d4e406b214317910df40236904fc50cd9139c95aaf1677e60b130084d8433d76a7082be0a05c3a438882d339def90f6e4312da768aa10baba2b0f9d4e9
6
+ metadata.gz: 428ee12f3d3f632f589776a1bf5365c51ed9a665d6b7acc2bde016886bada0ac2eed04d1678700689f1e18d05a3d94c360f5cd905ec5ae880bfe48b29e55fed2
7
+ data.tar.gz: e5795020e532bf2542bb4ec853cb4474b94bf84231f4fc9f2eb3ea397788f3d233c24f7ea538cd7f75c0802bfae6f9f45e5ada42827cf55202f33c1593241124
data/lib/locum/cli.rb CHANGED
@@ -4,7 +4,7 @@ require 'highline/import'
4
4
  require 'locum'
5
5
 
6
6
  module Locum
7
- class SshCLI < Thor
7
+ class SshKey < Thor
8
8
  desc 'add', 'Настраивает беспарольную авторизацию по ключу'
9
9
  option :key
10
10
 
@@ -16,8 +16,8 @@ module Locum
16
16
  end
17
17
  cn.say "Используется ключ #{key_file}"
18
18
 
19
- ssh_auth = Locum::Ssh.new(key_file)
20
- ssh_auth.add_ssh_key
19
+ ssh_auth = Locum::Ssh.new
20
+ ssh_auth.add_ssh_key(key_file)
21
21
 
22
22
  s_out "Теперь вы можете авторизоваться по SSH без пароля"
23
23
  end
@@ -85,8 +85,8 @@ EOFBLOCK
85
85
  projects.projects.each { |p| say(" * #{p['name']} (##{p['id']} #{p['type']})") }
86
86
  end
87
87
 
88
- desc 'ssh', 'Работа с ключами'
89
- subcommand 'ssh', SshCLI
88
+ desc 'ssh_key', 'Работа с ключами'
89
+ subcommand 'ssh_key', SshKey
90
90
  end
91
91
 
92
92
  end
data/lib/locum/ssh.rb CHANGED
@@ -2,11 +2,9 @@
2
2
  require 'net/ssh'
3
3
 
4
4
  class Locum::Ssh
5
- def initialize(key_file)
5
+ def add_ssh_key(key_file)
6
6
  @key = File.read(key_file).strip
7
- end
8
7
 
9
- def add_ssh_key
10
8
  run_on_server("mkdir .ssh")
11
9
  run_on_server("echo #{@key} >> .ssh/authorized_keys")
12
10
  end
data/lib/locum/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Locum
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Shmelev