forte 1.0.1 → 1.0.2

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: 18c29a8d6bebd48bbd02f04a24a19469d95bc685
4
- data.tar.gz: dc3c481f030984d0f4f485fe196568fd317c8043
3
+ metadata.gz: 7b807f2b5969715d6f8cf32beb6c83fabdf2a149
4
+ data.tar.gz: 776a96165b52bc2be3b3340bf3c763b14372dd24
5
5
  SHA512:
6
- metadata.gz: 07e347903001314b22e2cfd68444864389195f2ba3f6c2be8a29385d3c0c9aeb2a723ca6ca5d5234fa949f9fbc6dae3d0528f5b78510da8d93ed3e55fd89a63c
7
- data.tar.gz: 85bbfdc523fb3a0ec959b756de2617b80d2eb3c80c4f04bb3eb075b05cd45b3e85e2da0d47302aaa152ed334795d8793e85f6bd9163a05250c0f93b1d2d2f209
6
+ metadata.gz: 8de4ab00527964f949e3b699477f72bf3ebeb97125cbb95205f266d0c055e25fb4458af1f14e9889861baea68ee125f69d65ee8db2119c4255e0f8d591576f00
7
+ data.tar.gz: 445d5778a75311ad97ef544bc6120a182cde8cbd109e1a8ead8a0981b0b3f8c43c63997b481a1da69d99a76a0bb2f7d3018e9d47c00f3394d558c22967aa9ee3
Binary file
Binary file
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)
@@ -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
@@ -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
@@ -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
@@ -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,15 +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?('git@')
10
- return path if path.start_with?('http')
11
- return path if Dir.exists?(File.join(path, '.git'))
12
- "https://github.com/#{path}.git"
13
- 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
14
15
 
16
+ end
15
17
  end
@@ -1,3 +1,3 @@
1
1
  module Forte
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,15 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forte
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Yockey
8
8
  - Ryan Cromwell
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain: []
12
- date: 2014-02-13 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ0wCwYDVQQDDARtaWtl
15
+ MRswGQYKCZImiZPyLGQBGRYLaGV5c3Bhcmtib3gxEzARBgoJkiaJk/IsZAEZFgNj
16
+ b20wHhcNMTYxMTExMTUzNjA2WhcNMTcxMTExMTUzNjA2WjBBMQ0wCwYDVQQDDARt
17
+ aWtlMRswGQYKCZImiZPyLGQBGRYLaGV5c3Bhcmtib3gxEzARBgoJkiaJk/IsZAEZ
18
+ FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCik8+XzkA64kgf
19
+ zfSZ5KIT+lTz/AlSU/HFMV3Ck7i0GkUuHxLhg6CdDa7XEQ5HdBMljIYPVJj1PJK+
20
+ 3GwbiAtPQbqU9oxEp7VXj0faS6GyqbFWII0fFIKsOrddqW80k5Ubd4lL8HT7G6Xo
21
+ cxzHt+Tn2ZwFqmG0wOuIUNMG5odzS8EnZ1a46bFs0nguw4q58EwR9U2AAoIPtZhx
22
+ mhvqMWzlVgXaLlT/uYIrzXaZxQ4xDxntUwEPmls0SYzGto/9s2wUchgSKAFwbdYC
23
+ QPr1rTAlJhiwi8AD/c/1nLEt1ED+C4nhjY+R6Di03ylxzhFjI8gWpOg17s5fGYfw
24
+ qEp2kDZ7AgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
25
+ BBR3lOIR54PS6RovCqHbQsxKRSR/1jAfBgNVHREEGDAWgRRtaWtlQGhleXNwYXJr
26
+ Ym94LmNvbTAfBgNVHRIEGDAWgRRtaWtlQGhleXNwYXJrYm94LmNvbTANBgkqhkiG
27
+ 9w0BAQUFAAOCAQEABkS4vDUOo+qqKMKKdb5v+fe/S1kjJuntA6/1WV5a6ijF5T2v
28
+ sWhCfC6takYZx2b1AfRj4jhhYAbVvQB8+QM0m8lnFxhCWY01R/wRqRrwomJraBUq
29
+ e74nKemkuS6mqh02BFITjGQl4CS8MsonEX7Vjy6CxQdjcWpLfuv7aObPqFb7dz18
30
+ tLTu/w9Go4EHMq0wgsGqryA4VjR0sutlFWKB8CcaVrPCSCSkde644eo7Q7CMXQ+D
31
+ JWMid62PEnFDyv5f3a5If9c59DEilI2E329oMDA6aPGQToXraUvrTlI7Z+Mgq0zZ
32
+ jr9De1k7hsxpVLLFZXrrYQ0XPf5CXwFHy16KTg==
33
+ -----END CERTIFICATE-----
34
+ date: 2016-11-11 00:00:00.000000000 Z
13
35
  dependencies:
14
36
  - !ruby/object:Gem::Dependency
15
37
  name: thor
@@ -76,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
98
  version: '0'
77
99
  requirements: []
78
100
  rubyforge_project:
79
- rubygems_version: 2.2.1
101
+ rubygems_version: 2.5.1
80
102
  signing_key:
81
103
  specification_version: 4
82
104
  summary: Create an authorized_keys file for a shared shell account from a repository
Binary file