forte 1.0.0 → 1.0.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
- SHA1:
3
- metadata.gz: 2b940e6e029800b742bd33cd63aebe2e846d90dd
4
- data.tar.gz: 9b6d24ac6767c3243343e7ce290e9f5f84a2298d
2
+ SHA256:
3
+ metadata.gz: e4da4d23a5e9981308609c3d8900d26f9cc4e934140a1bbb8b379de5cfdd720b
4
+ data.tar.gz: adcba87a9412e19eccdb036e06b574bb228dec6c2206b60aaa649030fb190293
5
5
  SHA512:
6
- metadata.gz: 1ba93783bb6dfb7fab779e27efe4d3778b8445a5df17d1b597f5e79debdab746f0f43a20906faf0479d3f0c34b0d82d6222e58d44214c668d88d0005372502f5
7
- data.tar.gz: 766e4b08145ebbf412561c978364222a9cdf7f619d00656ea14a72b58874e4235ee31c026d9de9dde8035dd0db72b8a266b0bd0007dbbf23972d54badc9a904c
6
+ metadata.gz: 69676b1be44a2e56556449610f6745de4f6e38b8ddcf3546d6960fe397b461732be729e86fb7a7093b7149e7eb9af43647c6a48f29c7acd1f484b3e757631978
7
+ data.tar.gz: 6ca717f9bfc3e63b837c6b902b62797f14791a122a244173eaf57212b84568ba2a59f0599c6606c9689806dffee7c6b86180b4746dc1d0135fd4fdf23db66c6b
data/bin/forte CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'forte'
3
- Base.start(ARGV)
3
+ Forte::CLI.start(ARGV)
@@ -1,11 +1,13 @@
1
- class AuthorizedKeys
2
- def self.build(dir)
3
- out = ''
4
- Dir.glob(File.join(dir, '**', '*.pub')) do |file|
5
- keyfile = Keyfile.new(file)
6
- out << "##{keyfile.description}\n"
7
- out << "#{keyfile.body}\n"
1
+ module Forte
2
+ class AuthorizedKeys
3
+ def self.build(dir)
4
+ out = ''
5
+ Dir.glob(File.join(dir, '**', '*.pub')) do |file|
6
+ keyfile = Keyfile.new(file)
7
+ out << "##{keyfile.description}\n"
8
+ out << "#{keyfile.body}\n"
9
+ end
10
+ out
8
11
  end
9
- out
10
12
  end
11
13
  end
data/lib/forte/base.rb CHANGED
@@ -2,7 +2,7 @@ class Base < Thor
2
2
  desc "print", "Prints the public keys to STDOUT"
3
3
  def print(uri)
4
4
  loc = RepoLocation.new(uri)
5
- repo = Git.clone(loc.uri, File.join(Dir.pwd, './.tmp'))
5
+ repo = Git.clone(loc.uri, File.join(Dir.pwd, '.forte'))
6
6
  puts AuthorizedKeys.build(repo.dir.path)
7
7
  FileUtils.rm_rf(repo.dir.path)
8
8
  end
data/lib/forte/keyfile.rb CHANGED
@@ -1,15 +1,17 @@
1
- class Keyfile
2
- attr_accessor :path
3
- def initialize(path)
4
- @path = path
5
- end
1
+ module Forte
2
+ class Keyfile
3
+ attr_accessor :path
4
+ def initialize(path)
5
+ @path = path
6
+ end
6
7
 
7
- def description
8
- File.basename(path, '.*')
9
- end
8
+ def description
9
+ File.basename(path, '.*')
10
+ end
10
11
 
11
- def body
12
- IO.read(path)
13
- end
12
+ def body
13
+ IO.read(path)
14
+ end
14
15
 
16
+ end
15
17
  end
@@ -1,14 +1,17 @@
1
- class RepoLocation
2
- attr_accessor :path
1
+ module Forte
2
+ class RepoLocation
3
+ attr_accessor :path
3
4
 
4
- def initialize(path)
5
- @path = path
6
- end
5
+ def initialize(path)
6
+ @path = path
7
+ end
7
8
 
8
- def uri
9
- return path if path.start_with?('http')
10
- return path if Dir.exists?(File.join(path, '.git'))
11
- "https://github.com/#{path}.git"
12
- end
9
+ def uri
10
+ return path if path.start_with?('git@')
11
+ return path if path.start_with?('http')
12
+ return path if Dir.exists?(File.join(path, '.git'))
13
+ "https://github.com/#{path}.git"
14
+ end
13
15
 
16
+ end
14
17
  end
data/lib/forte/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Forte
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.4"
3
3
  end
data/lib/forte.rb CHANGED
@@ -2,7 +2,18 @@ require 'thor'
2
2
  require 'git'
3
3
  require 'fileutils'
4
4
  require 'forte/authorized_keys'
5
- require 'forte/base'
6
5
  require 'forte/keyfile'
7
6
  require 'forte/repo_location'
8
7
  require 'forte/version'
8
+
9
+ module Forte
10
+ class CLI < Thor
11
+ desc "print", "Prints the public keys to STDOUT"
12
+ def print(uri)
13
+ loc = RepoLocation.new(uri)
14
+ repo = Git.clone(loc.uri, File.join(Dir.pwd, '.forte'))
15
+ puts AuthorizedKeys.build(repo.dir.path)
16
+ FileUtils.rm_rf(repo.dir.path)
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forte
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Yockey
8
8
  - Ryan Cromwell
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-11 00:00:00.000000000 Z
12
+ date: 2022-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '0.18'
20
+ version: '1.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0.18'
27
+ version: '1.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: git
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.2'
34
+ version: '1.11'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.2'
41
+ version: '1.11'
42
42
  description: 'Create an authorized_keys file for a shared shell account from a repository
43
43
  of public key files '
44
44
  email:
@@ -60,7 +60,7 @@ homepage: https://github.com/yock/forte
60
60
  licenses:
61
61
  - MIT
62
62
  metadata: {}
63
- post_install_message:
63
+ post_install_message:
64
64
  rdoc_options: []
65
65
  require_paths:
66
66
  - lib
@@ -75,9 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubyforge_project:
79
- rubygems_version: 2.2.1
80
- signing_key:
78
+ rubygems_version: 3.3.7
79
+ signing_key:
81
80
  specification_version: 4
82
81
  summary: Create an authorized_keys file for a shared shell account from a repository
83
82
  of public key files