forte 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/forte/base.rb +1 -0
  3. data/lib/forte/git.rb +10 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43a3df028232e9e46b0500ffd3c02c3e4320052b
4
- data.tar.gz: a14f82c2552c2b92e09e6ee41864ec5255604fe3
3
+ metadata.gz: 877ec9d6eee6d9b7c328cdb1d7703446ebe39190
4
+ data.tar.gz: 97d852ccfdee9469fc78ac9fe28f2add71a0f69a
5
5
  SHA512:
6
- metadata.gz: 37d1807895f31c0856daf289e1ac1c9f12df75242545418286b4e6ce9ab7668fd02eb156d22cb907f971607153e74a9bc144e377c763d5f71838897449e1ef9b
7
- data.tar.gz: 4cf4007589bcce4a137d6c2164c2c5880634670cd0427a781fe7010a47a45d24cf8811e4a6efd32d2cfb81bfa9662f3893672a0387a2701843119faeffde58b9
6
+ metadata.gz: e7cb46d4601cc855e86828e8b493d7609eb3602ecd0b2f42f887bd03a528c908940e14a57722e149450235ec3304ecf04b481eae48eac932878c5280b90c8558
7
+ data.tar.gz: 55a069eff3cf0e37028be4de61424a47bdd73a252840611c2a484fdf547adfc9dd2347b782ce05721bb8095d73667540305ef49e0957cf320dbb8a335d3a468f
data/lib/forte/base.rb CHANGED
@@ -3,5 +3,6 @@ class Base < Thor
3
3
  def print(uri)
4
4
  dir = Git.clone(uri)
5
5
  puts AuthorizedKeys.build(dir)
6
+ Git.cleanup
6
7
  end
7
8
  end
data/lib/forte/git.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'fileutils'
2
2
  class Git
3
3
  class << self
4
- TMP_DIR = File.join(Dir.pwd, '.tmp', 'forte')
4
+ TMP_DIR = File.join(Dir.pwd, '.forte')
5
5
 
6
6
  def clone(uri)
7
7
  FileUtils.mkdir_p(TMP_DIR)
8
- cmd = "git clone #{uri} #{TMP_DIR}"
8
+ cmd = "git clone -q #{complete_uri(uri)} #{TMP_DIR}"
9
9
  system(cmd)
10
10
  TMP_DIR
11
11
  end
@@ -13,5 +13,13 @@ class Git
13
13
  def cleanup
14
14
  FileUtils.rm_rf(TMP_DIR)
15
15
  end
16
+
17
+ private
18
+
19
+ def complete_uri(uri)
20
+ return uri if Dir.exist?("#{uri}/.git")
21
+ return uri if uri.start_with?('http')
22
+ "https://github.com/#{uri}.git"
23
+ end
16
24
  end
17
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Yockey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-03 00:00:00.000000000 Z
12
+ date: 2014-01-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: