myprecious 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/myprecious.rb +52 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d4cf8ebd1780d2dc90bea1c4416a1efe2e37fa56
4
+ data.tar.gz: f86f4d8abf0ea8d3814cb6acac7cffd1781ce7fa
5
+ SHA512:
6
+ metadata.gz: 8d95c7581629036c1ac7d4410272e01f82aff8f9417ed0ed808d2d2fa88ff9013420d77572a3e71d37b10190e8aa5534a4dc71dd77e018b9dcac95acd8e47fd4
7
+ data.tar.gz: 128022f685078307b71fe572e1dcd53d8408a5cbaa799a0cd0763f19e0f4ac9c0ba7ead43bf0b2c205f10f92cdbfd115f4a9aaecd1e36c41ac0adb829fb46197
@@ -0,0 +1,52 @@
1
+ require 'gems'
2
+ require 'date'
3
+
4
+ class MyPrecious
5
+ def self.update
6
+ file = File.new("Gemfile", "r")
7
+
8
+ File.open('myprecious.md', 'w') { |write_file|
9
+ write_file.puts "gem | Our Version | Latest Version | Date available | Age (in days) | Home Page | Change Log"
10
+ write_file.puts "--- | --- | --- | --- | --- | --- | ---"
11
+ while (line = file.gets)
12
+ gem_line = line.strip
13
+ if (gem_line.include? 'gem') && !gem_line.start_with?('#') && !gem_line.start_with?('source')
14
+ name = gem_line.split(' ')[1].split(',')[0].split('\'')[1]
15
+ # gems_info = Gems.versions name
16
+ begin
17
+ a = require name
18
+ if a
19
+ current_version = Gem::Specification.find_all_by_name(name).max.version
20
+ gems_info = Gems.versions name
21
+ gems_latest_info = Gems.info name
22
+ latest_build = ''
23
+ #write_file.puts "Gem Name: " + name
24
+ #write_file.puts "Current Version: " + current_version.to_s
25
+ #write_file.puts "Latest Version: " + gems_latest_info["version"].to_s
26
+ #write_file.puts "Home Page Url: " + gems_latest_info["homepage_uri"].to_s
27
+ #write_file.puts "Change log: " + gems_latest_info["changelog_uri"].to_s
28
+ gems_info.each do |gem_info|
29
+ if gem_info["number"].to_s == gems_latest_info["version"].to_s
30
+ latest_build = Date.parse gem_info["built_at"]
31
+ #write_file.puts "Latest Version Date: " + (latest_build).to_s
32
+ end
33
+ if gem_info["number"].to_s == current_version.to_s
34
+ current_build = Date.parse gem_info["built_at"]
35
+ days_complete = latest_build - current_build
36
+ #write_file.puts name + ":" + days_complete.to_i.to_s
37
+ write_file.puts name + "|" + current_version.to_s + "|" + gems_latest_info["version"].to_s + "|" +
38
+ (latest_build).to_s + "|" + days_complete.to_i.to_s + "|" +
39
+ gems_latest_info["homepage_uri"].to_s + "|" + gems_latest_info["changelog_uri"].to_s
40
+ end
41
+ end
42
+
43
+ end
44
+ rescue Exception => e
45
+
46
+ end
47
+ end
48
+ end
49
+ file.close
50
+ }
51
+ end
52
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: myprecious
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-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple, markdown generated with information about your gems
14
+ email: balki.kodarapu@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/myprecious.rb
20
+ homepage: http://rubygems.org/gems/myprecious
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.4.8
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Your precious dependencies!
44
+ test_files: []