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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gitgem/action.rb +12 -4
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db06fbe33924e7756d3d63ce91b0a16661e25b5f
4
- data.tar.gz: b9f5fe444a09e183ab1d9167e32326e8b4b3315e
3
+ metadata.gz: 479d7e78a1ecdc575549900fd2799694e1b73243
4
+ data.tar.gz: 4cbf05310c5e7a4e3fce5d5ad1efb4e441e53d60
5
5
  SHA512:
6
- metadata.gz: 5179d28f0037a482e0ddee3e88c5355cfc86e0ecb82cb043dfce8902e3ce10071d2b85040aa4f2460d446d2a1c229fb5a704b0f84db4ff1a49d3a4850b4b3b58
7
- data.tar.gz: 6b63fa0e22a57021bb917a44041d7bd739154eadb824f2cd966294f51d4e5b7166b7e1ed07ab88877fe0011bcc77b50aa83c4da18654459b9c461ca7583412bc
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 = nil, repo)
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
- abort("Could not find alias named #{repo_alias}, please check again.") if result.nil?
45
- repo = result.gsub("#{repo_alias}=", "")
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
@@ -1,3 +1,3 @@
1
1
  module GitGem
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - saitjr