libyear 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10b6af767f2c311397eb8cacc3411ed2faf23a70
4
- data.tar.gz: 46b24478fedc3efac195e8916389e64db44b269f
3
+ metadata.gz: 1c4d0879f313a2a7aacf2c8ac2eddbf45b6f0c24
4
+ data.tar.gz: c48c16cd644315491ea135fdf6795f471218e5ff
5
5
  SHA512:
6
- metadata.gz: 568702d22168ad898e48ba88896cbf4f2ba8925549f71baff495342253659af432c39c9913d64480c9dab4f115ebd1bd4255972305279150d72df8cfc7589883
7
- data.tar.gz: 45a0b87b0ba1c0e3d84e64e6ec1320d090c882f0de4e7ad195b982b99f8044e0aff42fdf02136d21f5882142a18e74f725f2fe8fee0a704080d66abd71fda18f
6
+ metadata.gz: c576c854264e1c6656daed3f9d62a057bd2d7a8d222eba70dff6429b4e1795fc3115d50a5f0258025044a00e851c087b334ae6b8644f6660e5b324807cb7f5ba
7
+ data.tar.gz: e428e2869687af159d4ec857b4ab9f57427e06770ea9165728856316f6c04ecc6ba7e8130db145ef4afbc789547c2282fc3be00822669a4f1e74b83ecafef7ec
data/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  This project follows [semver 2.0.0][1] and the recommendations
4
4
  of [keepachangelog.com][2].
5
5
 
6
+ ## 0.1.2 (2017-02-16)
7
+
8
+ Breaking changes:
9
+
10
+ - None
11
+
12
+ Added:
13
+
14
+ - None
15
+
16
+ Fixed:
17
+
18
+ - Better handling of weird sources like rails-assets
19
+ - Wider report columns
20
+
6
21
  ## 0.1.1 (2017-02-14)
7
22
 
8
23
  Breaking changes:
data/lib/libyear/query.rb CHANGED
@@ -25,7 +25,9 @@ module Libyear
25
25
  gems.each do |gem|
26
26
  di = release_date(gem[:name], gem[:installed][:version])
27
27
  dn = release_date(gem[:name], gem[:newest][:version])
28
- if dn <= di
28
+ gem[:installed][:date] = di
29
+ gem[:newest][:date] = dn
30
+ if di.nil? || dn.nil? || dn <= di
29
31
  # Known issue: Backports and maintenance releases of older minor versions.
30
32
  # Example: json 1.8.6 (2017-01-13) was released *after* 2.0.3 (2017-01-12)
31
33
  years = 0.0
@@ -33,8 +35,6 @@ module Libyear
33
35
  days = (dn - di).to_f
34
36
  years = days / 365.0
35
37
  end
36
- gem[:installed][:date] = di
37
- gem[:newest][:date] = dn
38
38
  gem[:libyears] = years
39
39
  end
40
40
  gems
@@ -65,6 +65,10 @@ module Libyear
65
65
  def release_date(gem_name, gem_version)
66
66
  dep = ::Bundler::Dependency.new(gem_name, gem_version)
67
67
  tuples, _errors = ::Gem::SpecFetcher.fetcher.search_for_dependency(dep)
68
+ if tuples.empty?
69
+ $stderr.puts "Could not find release date for: #{gem_name}"
70
+ return nil
71
+ end
68
72
  tup, source = tuples.first # Gem::NameTuple
69
73
  spec = source.fetch_spec(tup) # raises Gem::RemoteFetcher::FetchError
70
74
  spec.date.to_date
@@ -14,7 +14,7 @@ module Libyear
14
14
  sum_years += years
15
15
  puts(
16
16
  format(
17
- "%20s%10s%15s%10s%15s%10.1f",
17
+ "%30s%15s%15s%15s%15s%10.1f",
18
18
  gem[:name],
19
19
  gem[:installed][:version],
20
20
  gem[:installed][:date],
@@ -1,3 +1,3 @@
1
1
  module Libyear
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libyear
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Beck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-14 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler