myprecious_python 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/myprecious_python +4 -0
- data/lib/myprecious_python.rb +64 -0
- metadata +46 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dabe4f1c6e0f2fd5c9b5cff741aff4ebdcac5925
|
4
|
+
data.tar.gz: 1b79e2c09cdbe659f5b032975a26adb66e06d833
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a564561bdf5642e30cade87c23cc8e0b160faa8d77f31c13e64295f8c2b8f2127d0befb3ed8116d8b67b5a4aa5db3f38d1ae453eb9631a33707acd179a49941a
|
7
|
+
data.tar.gz: a6291666a94b1d8ed9463b46bfc9ed75a476606f369f013edaf4ae3267890f9e366838d114256c657d52d14d9d8e5ec2862e5a1c7ab6b91a08c2b77672562009
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'date'
|
4
|
+
require 'byebug'
|
5
|
+
|
6
|
+
class MyPreciousPython
|
7
|
+
def self.update
|
8
|
+
file = File.new("Packages", "r")
|
9
|
+
|
10
|
+
File.open('dependency-tracking.md', 'w') { |write_file|
|
11
|
+
write_file.puts "dependency | Our Version | Latest Version | Date available | Age (in days) | Change Log"
|
12
|
+
write_file.puts "--- | --- | --- | --- | --- | ---"
|
13
|
+
while (line = file.gets)
|
14
|
+
gem_line = line.strip
|
15
|
+
name = gem_line.split('==')[0]
|
16
|
+
current_version = gem_line.split('==')[1]
|
17
|
+
latest_version_string = %x(yolk -U #{name})
|
18
|
+
begin
|
19
|
+
latest_version = latest_version_string.split(' ')[2].split("(")[1].split(")")[0]
|
20
|
+
rescue
|
21
|
+
latest_version = current_version
|
22
|
+
end
|
23
|
+
scrape_url = "https://pypi.python.org/pypi/" + name.to_s + "/" + current_version.to_s
|
24
|
+
doc = Nokogiri::HTML(open(scrape_url))
|
25
|
+
doc_data = doc.css('tr.odd td')
|
26
|
+
if !doc_data.nil?
|
27
|
+
current_build_date = doc_data[3].content
|
28
|
+
else
|
29
|
+
current_build_date = ""
|
30
|
+
end
|
31
|
+
|
32
|
+
scrape_url = "https://pypi.python.org/pypi/"+name+"/"+latest_version
|
33
|
+
doc = Nokogiri::HTML(open(scrape_url))
|
34
|
+
doc_data = doc.css('tr.odd td')
|
35
|
+
if !doc_data.nil?
|
36
|
+
latest_build_date = doc_data[3].content
|
37
|
+
else
|
38
|
+
latest_build_date = ""
|
39
|
+
end
|
40
|
+
|
41
|
+
begin
|
42
|
+
documentation = doc.at('li:contains("Documentation:")').css('a').map { |link| link['href'] }[0]
|
43
|
+
rescue Exception => e
|
44
|
+
documentation = ""
|
45
|
+
end
|
46
|
+
|
47
|
+
begin
|
48
|
+
homepage_uri = doc.at('li:contains("Home Page")').text.strip.split("\n").last.strip
|
49
|
+
rescue Exception => e
|
50
|
+
homepage_uri = ""
|
51
|
+
end
|
52
|
+
|
53
|
+
days_complete = Date.parse(latest_build_date) - Date.parse(current_build_date)
|
54
|
+
|
55
|
+
write_file.puts "[" + name + "]" + "(" + homepage_uri.to_s + ")" +
|
56
|
+
"|" + current_version.to_s + "|" + latest_version.to_s + "|" +
|
57
|
+
(latest_build_date).to_s + "|" + days_complete.to_i.to_s + "|" +
|
58
|
+
documentation.to_s
|
59
|
+
end
|
60
|
+
file.close
|
61
|
+
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: myprecious_python
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Balki Kodarapu
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-24 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A simple, markdown generated with information about your python dependencies
|
14
|
+
email: balki.kodarapu@gmail.com
|
15
|
+
executables:
|
16
|
+
- myprecious_python
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- bin/myprecious_python
|
21
|
+
- lib/myprecious_python.rb
|
22
|
+
homepage: http://rubygems.org/gems/myprecious_python
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 2.4.8
|
43
|
+
signing_key:
|
44
|
+
specification_version: 4
|
45
|
+
summary: Your precious python dependencies!
|
46
|
+
test_files: []
|