dependencies_collector 0.1.2 → 0.1.3
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/README.md +3 -3
- data/lib/dependencies_collector.rb +7 -4
- data/lib/dependencies_collector/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: 035ec0aaf0a76b7c3811ca89fa71a6f06fc2254b
|
|
4
|
+
data.tar.gz: 9246f82082b887dcda07f11132ee3680f78ff731
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8d89e2c353bc0244c47f275e220f267c8c99156235627be786d884b377367b83b384568f16b8e54b33a2e2f5e53f42569e557f12252b1bede67ba8e625aeec9
|
|
7
|
+
data.tar.gz: 4ec612658fec4b8846bae4a8a0017bed31fa1826ef51b495b7babb7bb0fa96c20843dddbbd65f33f92fd7af418c8d645be8627607a546dc6b67efbd23f43a174
|
data/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
$ dependencies_collector
|
|
26
26
|
|
|
27
27
|
## Development
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
32
|
|
|
33
33
|
## Contributing
|
|
34
34
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/moazelnashar/dependencies_collector. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
36
36
|
|
|
37
37
|
## License
|
|
38
38
|
|
|
@@ -40,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
|
40
40
|
|
|
41
41
|
## Code of Conduct
|
|
42
42
|
|
|
43
|
-
Everyone interacting in the DependenciesCollector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
43
|
+
Everyone interacting in the DependenciesCollector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/moazelnashar/dependencies_collector/blob/master/CODE_OF_CONDUCT.md).
|
|
@@ -11,7 +11,7 @@ module DependenciesCollector
|
|
|
11
11
|
|
|
12
12
|
def execute
|
|
13
13
|
data = { packages: parsingGemfile , opreating_system: RbConfig::CONFIG["arch"]}
|
|
14
|
-
puts
|
|
14
|
+
puts parsingDependencies(JSON.parse((requestDependencies(data).body)))
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
# Parsing Gemfile.lock to get gems list
|
|
@@ -23,7 +23,7 @@ module DependenciesCollector
|
|
|
23
23
|
# Calling Api Service to get dependencies
|
|
24
24
|
def requestDependencies(packages)
|
|
25
25
|
# Create the HTTP objects
|
|
26
|
-
uri = URI.parse("http://localhost:3000/api/
|
|
26
|
+
uri = URI.parse("http://localhost:3000/api/packages/dependencies")
|
|
27
27
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
28
28
|
|
|
29
29
|
request = Net::HTTP::Post.new(
|
|
@@ -40,8 +40,8 @@ module DependenciesCollector
|
|
|
40
40
|
def parsingDependencies(packages)
|
|
41
41
|
final_result = Array.new
|
|
42
42
|
packages.each do |package|
|
|
43
|
-
package['dependencies'].each do |library|
|
|
44
|
-
|
|
43
|
+
package.first['dependencies'].each do |library|
|
|
44
|
+
final_result.push(library['library_name']) if not final_result.include?(library)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
puts final_result
|
|
@@ -49,4 +49,7 @@ module DependenciesCollector
|
|
|
49
49
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
x = Collector.new
|
|
53
|
+
x.execute
|
|
54
|
+
|
|
52
55
|
end
|