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