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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcaaa6d3e6dfb1a5b9b6d39829fc07b0d21ad3b4
4
- data.tar.gz: 36562cdcf2eeafc6f286c071be3e861567538239
3
+ metadata.gz: 6767455aa9895e3e6eab4d408ccd52d37bb58a10
4
+ data.tar.gz: 56b1aef56f7e9707110d182044a42785b36891de
5
5
  SHA512:
6
- metadata.gz: 596fbc4868360840b7c570ec322512cec09dd94195a3aa2fce4e8993a305bad51b7b31c9d5561c4d96b87d5167999a80259aabd2d916fa81ee1bdbaff04e1db1
7
- data.tar.gz: d3ca6f8a5abe3835c2279d543b448a2f9adda4ff1f88fea79ea66252b6576df804880cf12dd38cb5b6cf020f152cf0640ada77378bb7adf9769ecb55c9edb1d3
6
+ metadata.gz: 405200cdbb44dd50d1d3fc4f95829da003bbcbcbb8f70496e5647a7b7df5bb47023b2b9cc7e8c130061f849ab4a04e5a0e4e76ddc16ceba891a1c14821fdbedb
7
+ data.tar.gz: 646c5cc95cea47e0424ea3ddc7c26d6016d360b72cb01cbd2833e879f6445fbe540a4e7abf67463461fb095b3057f9ea92e62b56b30c4501c079c5b79b07e4be
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "sys_libs"
4
- packages = SysLibs.getPackages
5
- os = SysLibs.getOS
6
- SysLibs.getMissingLins(packages, os)
4
+ i = SysLibs.::Task.new
5
+ packages = i.getPackages
6
+ os = i.getOS
7
+ i.getMissingLins(packages, os)
@@ -2,51 +2,53 @@ require "sys_libs/version"
2
2
  require "rest-client"
3
3
 
4
4
  module SysLibs
5
- #Read the project's Gemfile, fetch all uncommented gems and add to array
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)
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
- @packagesArray << (name)
16
- end
19
+ f.close
20
+ return @packagesArray
17
21
  end
18
- f.close
19
- return @packagesArray
20
- end
21
-
22
- #Get the current os
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
40
-
41
- #Send a post request to the server to retrieve the required sys libs
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"]
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
@@ -1,3 +1,3 @@
1
1
  module SysLibs
2
- VERSION = "1.1.10"
2
+ VERSION = "1.1.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys_libs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Safwany