gitgem 0.1.2 → 0.1.4
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 +4 -4
- data/lib/gitgem/action.rb +12 -4
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 479d7e78a1ecdc575549900fd2799694e1b73243
|
4
|
+
data.tar.gz: 4cbf05310c5e7a4e3fce5d5ad1efb4e441e53d60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6285aa20d9f5526e9fc55b262d9dfa2c4514431af7b807f19cf6dedeae500979747215e4db80256efb06a2ac2449081074659da6fffa613872860cf476e47f61
|
7
|
+
data.tar.gz: fb9c9fd2c93714b1d7cba82debe04016644ab87d25233673f0fd190bc8f53de80739e13d5dd0f7f5b276986595818c08d9d5ebd45d7cde1698ad42aee880a76f
|
data/lib/gitgem/action.rb
CHANGED
@@ -7,7 +7,7 @@ require 'fileutils'
|
|
7
7
|
module GitGem
|
8
8
|
module Action
|
9
9
|
class << self
|
10
|
-
def add(repo_alias
|
10
|
+
def add(repo_alias, repo)
|
11
11
|
repo_alias = repo if repo_alias.nil? || repo_alias.empty?
|
12
12
|
|
13
13
|
abort("Alias could not start with '.'") if repo_alias.start_with?(".")
|
@@ -19,7 +19,7 @@ module GitGem
|
|
19
19
|
unless result.nil?
|
20
20
|
puts "#{repo_alias} is already exist: #{result}"
|
21
21
|
printf "replace? (y/n): "
|
22
|
-
input = STDIN.gets
|
22
|
+
input = STDIN.gets.chomp
|
23
23
|
|
24
24
|
if input.start_with?("y")
|
25
25
|
remove(repo_alias)
|
@@ -41,8 +41,16 @@ module GitGem
|
|
41
41
|
def install(repo_alias, gem_dir, bindir)
|
42
42
|
abort("Please specify alias like alias/gem") if repo_alias.nil? || repo_alias.empty?
|
43
43
|
result = read_alias(repo_alias)
|
44
|
-
|
45
|
-
|
44
|
+
repo = ""
|
45
|
+
if result.nil?
|
46
|
+
printf "Could not found repo named #{repo_alias}, please enter? (xxx@xxx.git): "
|
47
|
+
repo = STDIN.gets.chomp
|
48
|
+
add(repo_alias, repo)
|
49
|
+
else
|
50
|
+
repo = result.gsub("#{repo_alias}=", "")
|
51
|
+
end
|
52
|
+
abort("Error git repo format #{repo_alias}, please check again.") unless repo.end_with?(".git")
|
53
|
+
|
46
54
|
|
47
55
|
alias_dir = File.join(base_dir, repo_alias)
|
48
56
|
repo_dir = File.join(alias_dir, File.basename(repo, ".git"))
|
data/lib/version.rb
CHANGED