libdepend 1.0.0

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.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/libdepend +30 -0
  3. data/lib/libdepend.rb +54 -0
  4. metadata +47 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 45443f39aa441076e5eda6341d54e300de985031
4
+ data.tar.gz: f8ab53043238fc0b5726c2115df212ba0f8e7ec8
5
+ SHA512:
6
+ metadata.gz: bbf554c519a8954ab23546337972111fd67faec1e87b73d41e48f9fc02736fbcd41886a306aee997e21a225a5345d120509b4415a06b8dbeba249ee76eb62bfa
7
+ data.tar.gz: efaf22d38d7c115fc288832024290ac6d9e760255d212f213f40c5b2496a9cd777725d69774dfbb584032624a2fb431c37965373f0817aee03a00ddbf8b5e2c5
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+
5
+ # libdepend version
6
+ VERSION = 0.0
7
+
8
+
9
+ options = {}
10
+
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: libdepend -[options]"
13
+ opts.separator("")
14
+ opts.on("-h", "--help","Shows help") {puts opts; exit}
15
+ opts.on("-v", "--version", "Show version"){puts VERSION; exit}
16
+
17
+ end.parse!
18
+
19
+ case ARGV[0]
20
+ when "fetch"
21
+ load 'libdepend.rb'
22
+ exit
23
+
24
+ end
25
+
26
+ puts "Usage: libdepend [--version][--help] are only available options for now"
27
+ puts ""
28
+ puts "The most commonly used libdepend commands are:"
29
+ puts " fetch Displays the System libraries required for your Gem file"
30
+
@@ -0,0 +1,54 @@
1
+
2
+ require 'net/http'
3
+ require 'uri'
4
+
5
+ #class Libdepend
6
+
7
+ # def self.fetch
8
+ gems = Array.new
9
+
10
+ puts"Please Specify the location of your Gemfile "
11
+ location = STDIN.gets.chomp
12
+ #Reading the Gemfile line by line to extract used gems names
13
+ begin
14
+
15
+ File.readlines(location).each do |line|
16
+ words = line.split
17
+ if words[0] == "gem"
18
+ gems << words[1].split("'")[1]
19
+ end
20
+
21
+ end
22
+ rescue
23
+ abort("I could not read this file lel asaf")
24
+ end
25
+ #Now setting the OS info for the request
26
+ os = ""
27
+ if (/darwin/ =~ RUBY_PLATFORM) != nil
28
+ os = "mac"
29
+
30
+ elsif (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
31
+ os = "windows"
32
+ puts "Kill yourself !!!"
33
+ else
34
+ os = "linux"
35
+ end
36
+ #Sending request using NetHTTP to localserver(for now)
37
+ url = URI.parse('http://localhost:4567/getDep')
38
+ http = Net::HTTP.new(url.host, url.port)
39
+
40
+ req = Net::HTTP::Post.new(url)
41
+
42
+ req.set_form_data('gems[]' => gems,'os' => os)
43
+
44
+ res = http.request(req)
45
+
46
+
47
+ if res.body.empty?
48
+ puts "You are good to go (Y) not system dependencies are required"
49
+ else
50
+ puts res.body
51
+ end
52
+ # end
53
+ #end
54
+
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: libdepend
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ahmed Zaki
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A Gem that reads your current gems and send them to my webservice to
14
+ check for system dependencies needed
15
+ email: mshbor3y@gmail.com
16
+ executables:
17
+ - libdepend
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/libdepend
22
+ - lib/libdepend.rb
23
+ homepage: ''
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.6.12
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: lib dependency gem
47
+ test_files: []