libFinder 0.5.0 → 0.5.1
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/libFinder/version.rb +1 -1
- data/lib/libFinder.rb +30 -6
- 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: f9f94e80ddee6a1250fff25db64409f32ac0d08f
|
4
|
+
data.tar.gz: 81147a091473c924c243eb7539cf962a2a74bb07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c302e1eb8db5b6166207a2336386d654a58eafe8acf7ff3b2f103541b5349df24b7f55defd620029badbb1566029a731a33d7bae05d2d11cd1cf903bbde8e283
|
7
|
+
data.tar.gz: b4af030a6531d6ef2fa10155cba85e43a425bc7b4ed159c7b4b79587181be5458582e4ad9ec995e8106e198fe0f1928c43542002a4030604bdba5ae5ffba0450
|
data/lib/libFinder/version.rb
CHANGED
data/lib/libFinder.rb
CHANGED
@@ -61,12 +61,12 @@ module LibFinder
|
|
61
61
|
)
|
62
62
|
|
63
63
|
dependencies = JSON.parse(response.body)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
if dependencies.count>0
|
65
|
+
#calles the downloading and installing of the missing deps method
|
66
|
+
#if the dependencies are greater than one
|
67
|
+
self.install_libs(dependencies)
|
68
|
+
end
|
69
|
+
|
70
70
|
end
|
71
71
|
|
72
72
|
def self.get_os
|
@@ -79,6 +79,30 @@ module LibFinder
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def self.install_libs(deps)
|
83
|
+
#this function recives the missing dependencies that are retrived
|
84
|
+
#by the web service and start to download them based on the current os
|
85
|
+
command ="" # this is the line that is responsible for building the system command string
|
86
|
+
if self.get_os == 1
|
87
|
+
command += "sudo apt-get install " #in ubunto and debian distros
|
88
|
+
deps.each do |dep|
|
89
|
+
#a loop to go through all the dependencies to build the command string
|
90
|
+
command += dep["name"]+" " #adding the lib name to the command
|
91
|
+
end
|
92
|
+
|
93
|
+
elsif self.get_os == 2
|
94
|
+
#if the current os is mac
|
95
|
+
command += "brew install "
|
96
|
+
deps.each do |dep|
|
97
|
+
#a loop to go through all the dependencies to build the command string
|
98
|
+
command += dep["name"]+" " #adding the lib name to the command
|
99
|
+
end
|
100
|
+
end
|
101
|
+
#running the command
|
102
|
+
%x(command)
|
103
|
+
|
104
|
+
end
|
105
|
+
|
82
106
|
|
83
107
|
|
84
108
|
end
|