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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 435aa3e47ffde21d1d473feddff012aa4897f433
4
- data.tar.gz: 2e97a082e059606475f464fb3e0f1a144cff82a3
3
+ metadata.gz: f9f94e80ddee6a1250fff25db64409f32ac0d08f
4
+ data.tar.gz: 81147a091473c924c243eb7539cf962a2a74bb07
5
5
  SHA512:
6
- metadata.gz: 0d95c85383391d9f47374a28f0073eb0ce913c9b07220caf3170bec8abf630ae449e60a5707950f25dd38b85df685d1c8d2a342884e7e25fbb0d325f9a26f2b3
7
- data.tar.gz: d91343d88a09196cb73ddf6ee141910a7b8ebd21e757837751bffc318244b3287664251bbc5ea8adbfc52d128c9e53ca9942c18e80d0f781e0ab7b7b692f6f0f
6
+ metadata.gz: c302e1eb8db5b6166207a2336386d654a58eafe8acf7ff3b2f103541b5349df24b7f55defd620029badbb1566029a731a33d7bae05d2d11cd1cf903bbde8e283
7
+ data.tar.gz: b4af030a6531d6ef2fa10155cba85e43a425bc7b4ed159c7b4b79587181be5458582e4ad9ec995e8106e198fe0f1928c43542002a4030604bdba5ae5ffba0450
@@ -1,3 +1,3 @@
1
1
  module LibFinder
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
data/lib/libFinder.rb CHANGED
@@ -61,12 +61,12 @@ module LibFinder
61
61
  )
62
62
 
63
63
  dependencies = JSON.parse(response.body)
64
- puts dependencies
65
- puts dependencies.count
66
- dependencies.each do |dependency|
67
- puts dependency.class
68
- puts dependency["name"]
69
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libFinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mody