gito 0.4.9 ā 0.4.10
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/gito.rb +2 -0
- data/lib/gito/app_utils.rb +1 -1
- data/lib/gito/config_manager.rb +1 -1
- data/lib/gito/project.rb +10 -19
- 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: ec9dc7c8ba9fa9a6e354b9869e407c011d6b4ce1
|
4
|
+
data.tar.gz: c4b3e9c2d494a8b85d622ab34686d167fe2bd816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 656d7706405a6f0987fa407740ec042a6a74173c1e2de4450cc35b70e2ebb588455b5ff988661d9342dc0ebcacc6ce02513fb41be8039f8e8ccdd915fc306a90
|
7
|
+
data.tar.gz: 52448da1016af99f414c6e2457d7e8bdf942e8da5da3cd63c4d677ea17acf7168af7387446117868e062e154bb190575eab7b06a39cad2c1fa0008de33a611f8
|
data/lib/gito.rb
CHANGED
data/lib/gito/app_utils.rb
CHANGED
@@ -8,7 +8,7 @@ class AppUtils
|
|
8
8
|
puts "\n\n======================================================\n\n"
|
9
9
|
puts ' Something went wrong while executing this:'.red
|
10
10
|
puts " $ #{command}\n".yellow
|
11
|
-
puts "======================================================\n
|
11
|
+
puts "======================================================\n"
|
12
12
|
exit 1 if should_exit
|
13
13
|
end
|
14
14
|
end
|
data/lib/gito/config_manager.rb
CHANGED
data/lib/gito/project.rb
CHANGED
@@ -34,35 +34,25 @@ class Project
|
|
34
34
|
|
35
35
|
def destination
|
36
36
|
stripped_url = @base_url.gsub('.git', '')
|
37
|
-
stripped_url = stripped_url.gsub('.git', '')
|
38
|
-
stripped_url = stripped_url.gsub('git@github.com:', '')
|
39
|
-
stripped_url = stripped_url.gsub('https://github.com/', '')
|
40
|
-
stripped_url.gsub('http://github.com/', '')
|
41
37
|
|
42
38
|
if stripped_url.start_with?('http')
|
43
|
-
stripped_url = stripped_url.split('/').last
|
39
|
+
stripped_url = stripped_url.split('/').last
|
44
40
|
end
|
45
41
|
|
46
42
|
if stripped_url.include?(':') && stripped_url.start_with?('git@')
|
47
|
-
stripped_url = stripped_url.split(':').last
|
43
|
+
stripped_url = stripped_url.split(':').last.split('/').last
|
48
44
|
end
|
49
45
|
|
50
|
-
stripped_url
|
46
|
+
stripped_url
|
51
47
|
end
|
52
48
|
|
53
49
|
def change_directory
|
54
|
-
# TODO aparently this doesn't work because ruby forks the terminal process and can't communicate with his parent
|
55
|
-
|
56
|
-
# temp_script_name = './temp.sh'
|
57
|
-
# AppUtils::execute 'echo "cd '+@destination+'" > ' + temp_script_name
|
58
|
-
# AppUtils::execute '. '+temp_script_name
|
59
|
-
# AppUtils::execute 'rm -rf ' + temp_script_name
|
60
50
|
short_path = @destination_dir.to_s.gsub(Dir.home, '~')
|
61
51
|
|
62
|
-
puts "-------------------------------------------"
|
52
|
+
puts "\n-------------------------------------------"
|
63
53
|
puts "Please change directory"
|
64
54
|
puts "cd #{short_path.yellow}"
|
65
|
-
puts "
|
55
|
+
puts "-------------------------------------------\n\n"
|
66
56
|
end
|
67
57
|
|
68
58
|
def install_dependencies
|
@@ -74,7 +64,7 @@ class Project
|
|
74
64
|
|
75
65
|
types.each do |item|
|
76
66
|
if File.exists? (item['file_requirement'])
|
77
|
-
puts "#{item['type']} detected
|
67
|
+
puts "\nš #{item['type']} detected...\n".yellow
|
78
68
|
go_inside_and_run item['installation_command']
|
79
69
|
end
|
80
70
|
end
|
@@ -108,10 +98,11 @@ class Project
|
|
108
98
|
@destination_dir = prefix + "#{@destination}"
|
109
99
|
|
110
100
|
if File.directory?(@destination_dir)
|
111
|
-
puts "The folder #{@destination_dir.green} is not empty
|
101
|
+
puts "\nš¤ The folder #{@destination_dir.green} is not empty...\n\n"
|
112
102
|
go_inside_and_run "git reset --hard HEAD"
|
113
103
|
go_inside_and_run "git pull"
|
114
104
|
else
|
105
|
+
puts "\nš Cloning #{url.green}...\n\n"
|
115
106
|
shell_copy_string = shell_copy ? '--depth 1' : ''
|
116
107
|
AppUtils.execute("git clone #{shell_copy_string} --recursive #{url} #{@destination_dir}")
|
117
108
|
end
|
@@ -120,12 +111,12 @@ class Project
|
|
120
111
|
end
|
121
112
|
|
122
113
|
def open_editor(app)
|
123
|
-
puts "Opening editor...".yellow
|
114
|
+
puts "\nšā Opening editor...".yellow
|
124
115
|
go_inside_and_run "#{app} ."
|
125
116
|
end
|
126
117
|
|
127
118
|
def open_folder
|
128
|
-
puts
|
119
|
+
puts "\nš³ Opening folder...".yellow
|
129
120
|
go_inside_and_run 'open .'
|
130
121
|
end
|
131
122
|
|
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.10
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|