check-date 0.0.2 → 0.0.3

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.
@@ -1,8 +1,7 @@
1
1
  Gem.pre_install do |installer|
2
- today = Time.now
3
- year_sec = 365 * 24 * 60 * 60
2
+ today = Date.today
4
3
 
5
- if (today - installer.spec.date) / year_sec > 1 then
4
+ if (today - installer.spec.date).to_f > 365 then
6
5
  if !Gem::ConsoleUI.new.ask_yes_no("This gem was updated more than 1 years ago. (last update: #{installer.spec.date})\nInstall this gem?", true) then
7
6
  abort
8
7
  end
@@ -1,5 +1,5 @@
1
1
  module Check
2
2
  module Date
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: check-date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-05 00:00:00.000000000Z
12
+ date: 2011-07-26 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Check gem's date and warn if date is more than 1 years ago.
15
15
  email: