sys_libs 1.1.9 → 1.1.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/bin/sys_libs +3 -1
- data/lib/sys_libs.rb +39 -32
- data/lib/sys_libs/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: dcaaa6d3e6dfb1a5b9b6d39829fc07b0d21ad3b4
|
4
|
+
data.tar.gz: 36562cdcf2eeafc6f286c071be3e861567538239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596fbc4868360840b7c570ec322512cec09dd94195a3aa2fce4e8993a305bad51b7b31c9d5561c4d96b87d5167999a80259aabd2d916fa81ee1bdbaff04e1db1
|
7
|
+
data.tar.gz: d3ca6f8a5abe3835c2279d543b448a2f9adda4ff1f88fea79ea66252b6576df804880cf12dd38cb5b6cf020f152cf0640ada77378bb7adf9769ecb55c9edb1d3
|
data/bin/sys_libs
CHANGED
data/lib/sys_libs.rb
CHANGED
@@ -3,44 +3,51 @@ require "rest-client"
|
|
3
3
|
|
4
4
|
module SysLibs
|
5
5
|
#Read the project's Gemfile, fetch all uncommented gems and add to array
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
def getPackages
|
7
|
+
@packagesArray = []
|
8
|
+
f = File.open("Gemfile", "r")
|
9
|
+
f.each_line do |line|
|
10
|
+
if !line.include?"#" and line.include? "gem" and !line.include?"rubygems.org" and !line.include? "gemspec"
|
11
|
+
name = line.split(" ")[1].slice(1..-2)
|
12
|
+
if name[-1].chr == "'"
|
13
|
+
name = name.slice(0..-2)
|
14
|
+
end
|
15
|
+
@packagesArray << (name)
|
16
|
+
end
|
13
17
|
end
|
14
|
-
|
15
|
-
|
18
|
+
f.close
|
19
|
+
return @packagesArray
|
16
20
|
end
|
17
|
-
f.close
|
18
21
|
|
19
22
|
#Get the current os
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
23
|
+
def getOS
|
24
|
+
@os ||= (
|
25
|
+
host_os = RbConfig::CONFIG['host_os']
|
26
|
+
case host_os
|
27
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
28
|
+
:windows
|
29
|
+
when /darwin|mac os/
|
30
|
+
:mac
|
31
|
+
when /linux/
|
32
|
+
:linux
|
33
|
+
when /solaris|bsd/
|
34
|
+
:unix
|
35
|
+
else
|
36
|
+
raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
|
37
|
+
end
|
38
|
+
)
|
39
|
+
end
|
35
40
|
|
36
41
|
#Send a post request to the server to retrieve the required sys libs
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
42
|
+
def getMissingLibs(packagesArray, os)
|
43
|
+
response = RestClient.post "https://stormy-bayou-25992.herokuapp.com/packages/search",
|
44
|
+
{ :packages => packagesArray, :os => os }
|
45
|
+
body = JSON.parse(response.body)
|
46
|
+
body.each do |key, value|
|
47
|
+
puts key["name"] + " needs the following sys libs to be installed:"
|
48
|
+
key["dependencies"].each do |d|
|
49
|
+
puts d["name"]
|
50
|
+
end
|
44
51
|
end
|
45
52
|
end
|
46
53
|
end
|
data/lib/sys_libs/version.rb
CHANGED