ezbash 1.0.5 → 1.1.0
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/bin/ezbash +71 -73
- 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: da2b7c174ccb943a74943478b40ea94b20b69a5c
|
4
|
+
data.tar.gz: cbc92169c26d8b0cd8eb58012f1a6c0329d16fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72db11c00092443aafe580ecfc77aee3dbf0ca80aa6fee4569b8acf56e694b709d0c8fede43358a5cac2019892633f55d02ba6d08c7b706d0aefc4314f780d7c
|
7
|
+
data.tar.gz: cd55c403d0a64a1ecfe5d729ea9cd619cf0dceee055d34a308036947cb90d3e667ddb8d9af4072b6cbf28d1ee2850ab5dbba9b905ff3ffd384668593570f84aa
|
data/bin/ezbash
CHANGED
@@ -32,17 +32,16 @@ def installRpm(package)
|
|
32
32
|
puts "\r"
|
33
33
|
puts "I ran: 'sudo yum install #{package}'"
|
34
34
|
end
|
35
|
-
def installPac(package)
|
36
|
-
Kernel.system "sudo pacman -S #{package}"
|
37
|
-
puts "\r"
|
38
|
-
puts "I ran: 'sudo pacman -S #{package}'"
|
39
|
-
puts 'Shouldn\'t you know how to use pacman if you\'re using Arch? Just kidding.'
|
40
|
-
end
|
41
35
|
def installHb(package)
|
42
36
|
Kernel.system "brew install #{package}"
|
43
37
|
puts "\r"
|
44
38
|
puts "I ran: 'brew install #{package}'"
|
45
39
|
end
|
40
|
+
def installPac(package)
|
41
|
+
Kernel.system "sudo pacman -S #{package}"
|
42
|
+
puts "\r"
|
43
|
+
puts "I ran: 'sudo pacman -S #{package}'"
|
44
|
+
end
|
46
45
|
def uninstallDeb(package)
|
47
46
|
Kernel.system "sudo apt-get remove #{package}"
|
48
47
|
puts "\r"
|
@@ -53,17 +52,16 @@ def uninstallRpm(package)
|
|
53
52
|
puts "\r"
|
54
53
|
puts "I ran: 'sudo yum uninstall #{package}'"
|
55
54
|
end
|
56
|
-
def uninstallPac(package)
|
57
|
-
Kernel.system "sudo pacman -R #{package}"
|
58
|
-
puts "\r"
|
59
|
-
puts "I ran: 'sudo pacman -R #{package}'"
|
60
|
-
puts 'Shouldn\'t you know how to use pacman if you\'re using Arch? Just kidding.'
|
61
|
-
end
|
62
55
|
def uninstallHb(package)
|
63
56
|
Kernel.system "brew uninstall #{package}"
|
64
57
|
puts "\r"
|
65
58
|
puts "I ran: 'brew uninstall #{package}'"
|
66
59
|
end
|
60
|
+
def uninstallPac(package)
|
61
|
+
Kernel.system "sudo pacman -R #{package}"
|
62
|
+
puts "\r"
|
63
|
+
puts "I ran: 'sudo pacman -R #{package}'"
|
64
|
+
end
|
67
65
|
def searchDeb(package)
|
68
66
|
Kernel.system "apt-cache search #{package}"
|
69
67
|
puts "\r"
|
@@ -74,23 +72,24 @@ def searchRpm(package)
|
|
74
72
|
puts "\r"
|
75
73
|
puts "I ran: 'yum search #{package}'"
|
76
74
|
end
|
77
|
-
def searchPac(package)
|
78
|
-
Kernel.system "pacman -Ss #{package}"
|
79
|
-
puts "\r"
|
80
|
-
puts "I ran: 'pacman -Ss #{package}'"
|
81
|
-
puts 'Shouldn\'t you know how to use pacman if you\'re using Arch? Just kidding.'
|
82
|
-
end
|
83
75
|
def searchHb(package)
|
84
76
|
Kernel.system "brew search #{package}"
|
85
77
|
puts "\r"
|
86
78
|
puts "I ran: 'brew search #{package}'"
|
87
79
|
end
|
80
|
+
def searchPac(package)
|
81
|
+
Kernel.system "sudo pacman -Ss #{package}"
|
82
|
+
puts "\r"
|
83
|
+
puts "I ran: 'sudo pacman -Ss #{package}'"
|
84
|
+
end
|
88
85
|
|
89
86
|
#Detect OS
|
90
87
|
osRaw = `uname -a`
|
91
88
|
osRaw.downcase!
|
92
89
|
osLin = osRaw.split(' ')[5]
|
93
90
|
osDar = osRaw.split(' ')[3]
|
91
|
+
osArchRaw = osRaw.split(' ')[2]
|
92
|
+
osArch = osArchRaw.split('-')[2]
|
94
93
|
if osDar == 'darwin' then addBrew() end
|
95
94
|
|
96
95
|
#Start Program
|
@@ -117,84 +116,84 @@ while exitIs == 0 do
|
|
117
116
|
when 'linux mint'
|
118
117
|
installDeb(package)
|
119
118
|
when 'redhat'
|
120
|
-
|
119
|
+
installRpm(package)
|
121
120
|
when 'fedora'
|
122
|
-
|
121
|
+
installRpm(package)
|
123
122
|
when 'open suse'
|
124
|
-
|
125
|
-
when 'arch'
|
126
|
-
installPac(package)
|
123
|
+
installRpm(package)
|
127
124
|
else
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
125
|
+
if osDar == 'darwin'
|
126
|
+
installHb(package)
|
127
|
+
elsif osArch == 'arch'
|
128
|
+
installPac(package)
|
129
|
+
else
|
130
|
+
print "\r"
|
131
|
+
puts 'Sorry, I didn\'t recognize your operating system.'
|
132
|
+
end
|
134
133
|
end
|
135
134
|
runOnce = true
|
136
135
|
when 'uninstall'
|
137
136
|
print 'Please enter the name of the program you\'d like to remove. >> '
|
138
137
|
package = gets.chomp
|
139
138
|
package.downcase
|
140
|
-
|
141
|
-
|
139
|
+
case osLin
|
140
|
+
when 'ubuntu'
|
142
141
|
uninstallDeb(package)
|
143
142
|
when 'debian'
|
144
143
|
uninstallDeb(package)
|
145
144
|
when 'linux mint'
|
146
145
|
uninstallDeb(package)
|
147
146
|
when 'redhat'
|
148
|
-
|
147
|
+
uninstallRpm(package)
|
149
148
|
when 'fedora'
|
150
|
-
|
149
|
+
uninstallRpm(package)
|
151
150
|
when 'open suse'
|
152
|
-
|
153
|
-
when 'arch'
|
154
|
-
uninstallPac(package)
|
151
|
+
uninstallRpm(package)
|
155
152
|
else
|
156
153
|
if osDar == 'darwin'
|
157
154
|
uninstallHb(package)
|
155
|
+
elsif osArch == 'arch'
|
156
|
+
uninstallPac(package)
|
158
157
|
else
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
158
|
+
print "\r"
|
159
|
+
puts 'Sorry, I didn\'t recognize your operating system.'
|
160
|
+
end
|
161
|
+
end
|
162
|
+
runOnce = true
|
163
|
+
when 'search'
|
164
|
+
print 'Please enter the name of the program you\'d like to search for. >> '
|
165
|
+
package = gets.chomp
|
166
|
+
package.downcase!
|
167
|
+
case osLin
|
168
|
+
when 'ubuntu'
|
169
|
+
searchDeb(package)
|
170
|
+
when 'debian'
|
171
|
+
searchDeb(package)
|
172
|
+
when 'linux mint'
|
173
|
+
searchDeb(package)
|
174
|
+
when 'redhat'
|
175
|
+
searchRpm(package)
|
176
|
+
when 'fedora'
|
177
|
+
searchRpm(package)
|
178
|
+
when 'open suse'
|
179
|
+
searchRpm(package)
|
180
|
+
else
|
181
|
+
if osDar == 'darwin'
|
182
|
+
searchHb(package)
|
183
|
+
elsif osArch == 'arch'
|
182
184
|
searchPac(package)
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
else
|
187
|
-
print "\r"
|
188
|
-
puts 'Sorry, I didn\'t recognize you\'re operating system.'
|
189
|
-
end
|
185
|
+
else
|
186
|
+
print "\r"
|
187
|
+
puts 'Sorry, I didn\'t recognize your operating system.'
|
190
188
|
end
|
191
|
-
|
192
|
-
|
189
|
+
end
|
190
|
+
runOnce = true
|
191
|
+
#File/folder manipulation
|
193
192
|
when 'copy'
|
194
193
|
print 'Please enter the path to the file (e.g. Downloads/report.doc) >> '
|
195
194
|
cpFile = gets.chomp
|
196
195
|
puts ' '
|
197
|
-
print 'Please enter the destination
|
196
|
+
print 'Please enter the destination including the name of the file (e.g. Documents/report.doc) >> '
|
198
197
|
cpDest = gets.chomp
|
199
198
|
Kernel.system "cp -avr #{cpFile} #{cpDest}"
|
200
199
|
puts "\r"
|
@@ -204,7 +203,7 @@ while exitIs == 0 do
|
|
204
203
|
print 'Please enter the path to the file (e.g. Documents/report.doc). >> '
|
205
204
|
cpFile = gets.chomp
|
206
205
|
puts ' '
|
207
|
-
print 'Please enter the new name
|
206
|
+
print 'Please enter the new name including the destination you used earlier (e.g. Documents/Essay.doc). >> '
|
208
207
|
cpDest = gets.chomp
|
209
208
|
Kernel.system "cp #{cpFile} #{cpDest}"
|
210
209
|
puts "\r"
|
@@ -238,7 +237,6 @@ while exitIs == 0 do
|
|
238
237
|
puts "\r"
|
239
238
|
puts "I ran: 'touch #{file}'"
|
240
239
|
runOnce = true
|
241
|
-
puts "I ran: 'nano #{file}'"
|
242
240
|
when "compile"
|
243
241
|
print 'Please enter the location of the c++ code you\'d like to compile (e.g. Projects/helloworld.cpp). >> '
|
244
242
|
code = gets.chomp
|
@@ -268,8 +266,8 @@ while exitIs == 0 do
|
|
268
266
|
["compile", "compiles a c++ file (e.g. foo.cpp)"],
|
269
267
|
["run c++ program", "runs a c++ program compiled with the aforementioned command"],
|
270
268
|
["exit", "exits ezbash"]]
|
271
|
-
|
272
|
-
|
269
|
+
puts PrettyTable.new(commands, headers).to_s
|
270
|
+
puts "\r"
|
273
271
|
when 'exit'
|
274
272
|
abort
|
275
273
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezbash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logan Saunders
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pretty_table
|