check-date 0.0.1

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/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in check-date.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "check-date/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "check-date"
7
+ s.version = Check::Date::VERSION
8
+ s.authors = ["Akira Ohnishi"]
9
+ s.email = ["s06206ao@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Check gem's date and warn if date is more than 1 years ago.}
12
+ s.description = %q{Check gem's date and warn if date is more than 1 years ago.}
13
+
14
+ s.rubyforge_project = "check-date"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ end
@@ -0,0 +1,11 @@
1
+ Gem.pre_install do |installer|
2
+ today = Time.now
3
+ year_sec = 365 * 24 * 60 * 60
4
+
5
+ if (today - installer.spec.date) / year_sec > 1 then
6
+ if !Gem::ConsoleUI.new.ask_yes_no("This gem was updated more than 1 years ago.\nInstall this gem?", true) then
7
+ abort
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,5 @@
1
+ module Check
2
+ module Date
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
data/lib/check-date.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "check-date/version"
2
+
3
+ module Check
4
+ module Date
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ require "rubygems/installer"
2
+ require "check-date/hook"
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: check-date
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Akira Ohnishi
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-07-05 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: Check gem's date and warn if date is more than 1 years ago.
15
+ email:
16
+ - s06206ao@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - Rakefile
24
+ - check-date.gemspec
25
+ - lib/check-date.rb
26
+ - lib/check-date/hook.rb
27
+ - lib/check-date/version.rb
28
+ - lib/rubygems_plugin.rb
29
+ homepage: ''
30
+ licenses: []
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubyforge_project: check-date
49
+ rubygems_version: 1.8.5
50
+ signing_key:
51
+ specification_version: 3
52
+ summary: Check gem's date and warn if date is more than 1 years ago.
53
+ test_files: []