gemfresh 1.0.1 → 1.0.2
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.
- data/gemfresh.gemspec +2 -2
- data/gemfresh.rb +2 -37
- data/support.rb +4 -2
- metadata +7 -7
data/gemfresh.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'gemfresh'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.2'
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.authors = ['Jon Williams']
|
6
6
|
s.email = ['jon@jonathannen.com']
|
@@ -13,5 +13,5 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
14
|
s.require_paths = ['.']
|
15
15
|
|
16
|
-
s.add_runtime_dependency 'bundler', '
|
16
|
+
s.add_runtime_dependency 'bundler', '>= 1.0.10'
|
17
17
|
end
|
data/gemfresh.rb
CHANGED
@@ -116,41 +116,6 @@ dep_specs.each do |dep, spec|
|
|
116
116
|
# Stats
|
117
117
|
prereleases +=1 if diff.prerelease?
|
118
118
|
count += 1
|
119
|
-
|
120
|
-
# Get the dates of the given and current versions
|
121
|
-
# version_date = versions.find { |v| v['number'] == version }
|
122
|
-
# version_date = Time.parse(version_date['built_at']) unless version_date.nil?
|
123
|
-
# current_date = versions.find { |v| v['number'] == current }
|
124
|
-
# current_date = Time.parse(current_date['built_at']) unless current_date.nil?
|
125
|
-
|
126
|
-
# Exact match or directly updatable? If so, we can move on
|
127
|
-
# prerelease = false
|
128
|
-
# match = case
|
129
|
-
# when (version == current) then :current
|
130
|
-
# when (dep.match?(dep.name, current)) then :update
|
131
|
-
# else nil
|
132
|
-
# end
|
133
|
-
#
|
134
|
-
# # Not exact or updatable - we need to check if you're on a pre-release version
|
135
|
-
# if match.nil?
|
136
|
-
# match = :obsolete
|
137
|
-
# versions = versions.select { |v| v['prerelease']}.map { |v| v['number'] }
|
138
|
-
# prerelease = versions.include?(version)
|
139
|
-
# # If it's a prerelease determine what kind
|
140
|
-
# if prerelease
|
141
|
-
# prereleases += 1
|
142
|
-
# current = versions.first # Big assumption
|
143
|
-
# match = case
|
144
|
-
# when (version == current) then :current
|
145
|
-
# when (dep.match?(dep.name, current)) then :update
|
146
|
-
# else :obsolete
|
147
|
-
# end
|
148
|
-
# end
|
149
|
-
# end
|
150
|
-
|
151
|
-
# Got our result
|
152
|
-
# results[match] << SpecDiff.new(dep, spec, versions)
|
153
|
-
# [dep, spec, current, prerelease, version_date, current_date]
|
154
119
|
print "."
|
155
120
|
STDOUT.flush
|
156
121
|
end
|
@@ -164,9 +129,9 @@ end
|
|
164
129
|
# Output Gem Ages
|
165
130
|
puts "\nThe following Gems are:"
|
166
131
|
ages = results.values.flatten.group_by(&:build_age)
|
167
|
-
{:month1 => 'less than a month', :month6 => '6 months
|
132
|
+
{:none => 'No build dates available', :month1 => 'less than a month old', :month6 => 'less than 6 months old', :year1 => 'less than a year old', :more => 'more than a year old'}.each_pair do |key, value|
|
168
133
|
next if ages[key].nil?
|
169
|
-
puts "-- #{value}
|
134
|
+
puts "-- #{value}:"
|
170
135
|
puts ages[key].map(&:to_s).join(', ')
|
171
136
|
end
|
172
137
|
|
data/support.rb
CHANGED
@@ -12,7 +12,7 @@ class SpecDiff < Struct.new(:dep, :spec, :gemdata, :versions)
|
|
12
12
|
# build age of the available version
|
13
13
|
def build_age
|
14
14
|
build_date = version_build_date(version_in_use)
|
15
|
-
return :
|
15
|
+
return :none if build_date.nil?
|
16
16
|
days = ((Time.now.utc - build_date)/(24 * 60 * 60)).round
|
17
17
|
case
|
18
18
|
when days < 31 then :month1
|
@@ -65,7 +65,9 @@ class SpecDiff < Struct.new(:dep, :spec, :gemdata, :versions)
|
|
65
65
|
# Return the build date for a given version string (e.g. '1.2.1')
|
66
66
|
def version_build_date(version)
|
67
67
|
return nil if versions.nil? || versions.empty?
|
68
|
-
|
68
|
+
data = version_data(version)
|
69
|
+
return nil if data.nil?
|
70
|
+
version_date = data['built_at']
|
69
71
|
version_date.nil? ? nil : Time.parse(version_date)
|
70
72
|
end
|
71
73
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemfresh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jon Williams
|
@@ -24,14 +24,14 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 3
|
30
30
|
segments:
|
31
31
|
- 1
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
version: 1.0.
|
33
|
+
- 10
|
34
|
+
version: 1.0.10
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: Scans Gemfiles to check for obsolete and updateable gems.
|