gito 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gito/project.rb +12 -6
- data/lib/gito/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a85c3491174797ae615e8813408296ec576aa961
|
4
|
+
data.tar.gz: 474751d9fb58d4c7e2acb018d6c13fe01b7f2106
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b75428890252e0cb8386bbc0b6269bff49aeac67164af731d7c2ca1caab6a0dddfc23f553c7cdf729136949e7b84185472f56813bb2cf53108bbabec1963350
|
7
|
+
data.tar.gz: fda5014a0c155278ca8e1b304e2c3b8c84038dbf4b9f88937275f20426eb837ec24df0ef12cd7ef0fb7cfb114d25d28723d502ba60cb12905c9ca721ce131639
|
data/lib/gito/project.rb
CHANGED
@@ -33,16 +33,20 @@ class Project
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def destination
|
36
|
-
unless @base_url.include? 'github.com'
|
37
|
-
return Digest::SHA256.hexdigest @base_url
|
38
|
-
end
|
39
|
-
|
40
36
|
stripped_url = @base_url.gsub('.git', '')
|
41
37
|
stripped_url = stripped_url.gsub('.git', '')
|
42
38
|
stripped_url = stripped_url.gsub('git@github.com:', '')
|
43
39
|
stripped_url = stripped_url.gsub('https://github.com/', '')
|
44
40
|
stripped_url.gsub('http://github.com/', '')
|
45
41
|
|
42
|
+
if stripped_url.start_with?('http')
|
43
|
+
stripped_url = stripped_url.split('/').last(2).join('/')
|
44
|
+
end
|
45
|
+
|
46
|
+
if stripped_url.include?(':') && stripped_url.start_with?('git@')
|
47
|
+
stripped_url = stripped_url.split(':').last
|
48
|
+
end
|
49
|
+
|
46
50
|
stripped_url.gsub('/','-')
|
47
51
|
end
|
48
52
|
|
@@ -76,7 +80,7 @@ class Project
|
|
76
80
|
end
|
77
81
|
end
|
78
82
|
|
79
|
-
def
|
83
|
+
def retrieve_cloneable_url
|
80
84
|
starts_with_git = @base_url.split(//).first(4).join.eql? 'git@'
|
81
85
|
ends_with_git = @base_url.split(//).last(4).join.eql? '.git'
|
82
86
|
|
@@ -93,7 +97,7 @@ class Project
|
|
93
97
|
## CLONE THE REPOSITORY
|
94
98
|
##
|
95
99
|
def clone(is_temp_folder=false, shell_copy=true)
|
96
|
-
url =
|
100
|
+
url = retrieve_cloneable_url
|
97
101
|
|
98
102
|
unless is_temp_folder
|
99
103
|
prefix = Dir.pwd + '/'
|
@@ -105,6 +109,8 @@ class Project
|
|
105
109
|
|
106
110
|
if File.directory?(@destination_dir)
|
107
111
|
puts "The folder #{@destination_dir.green} is not empty..."
|
112
|
+
go_inside_and_run "git reset --hard HEAD"
|
113
|
+
go_inside_and_run "git pull"
|
108
114
|
else
|
109
115
|
shell_copy_string = shell_copy ? '--depth 1' : ''
|
110
116
|
AppUtils.execute("git clone #{shell_copy_string} --recursive #{url} #{@destination_dir}")
|
data/lib/gito/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gito
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cesar ferreira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|