gem-fast 0.0.6.2 → 0.0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -69,7 +69,7 @@ module GemFast
69
69
  end
70
70
 
71
71
  def quiet_safe_system *args
72
- safe_system *expand_safe_system_args(args)
72
+ safe_system(*expand_safe_system_args(args))
73
73
  end
74
74
  end
75
75
 
@@ -93,8 +93,13 @@ module GemFast
93
93
  def _fetch
94
94
  curl @url, '-o', @tarball_path
95
95
  end
96
-
96
+
97
+
97
98
  def fetch
99
+ if fetch_lastest_specs
100
+ return @tarball_path
101
+ end
102
+
98
103
  say "Downloading #{@url}"
99
104
  unless File.exist?(@tarball_path)
100
105
  begin
@@ -110,6 +115,26 @@ module GemFast
110
115
  end
111
116
 
112
117
  private
118
+
119
+ def fetch_lastest_specs
120
+ if @url.to_s =~ /\/latest_specs\.(.+)\.gz$/ && latest_specs_too_old?
121
+ say "lastest_specs too old, updating..."
122
+ say "Downloading #{@url}"
123
+ _fetch
124
+ true
125
+ else
126
+ false
127
+ end
128
+ end
129
+
130
+ def latest_specs_too_old?
131
+ if file = Dir[File.join(RUBYGEMPLUS_CACHE,"latest_specs.*.gz")].first
132
+ (Time.now - File.stat(file).ctime)/(3600*24) > 7
133
+ else
134
+ false
135
+ end
136
+ end
137
+
113
138
  def chdir
114
139
  entries=Dir['*']
115
140
  case entries.length
@@ -148,4 +173,4 @@ module GemFast
148
173
  end
149
174
  end
150
175
 
151
- end
176
+ end
@@ -1,3 +1,3 @@
1
1
  module GemFast
2
- VERSION = '0.0.6.2'
2
+ VERSION = '0.0.6.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-fast
3
3
  version: !ruby/object:Gem::Version
4
- hash: 83
4
+ hash: 81
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 6
10
- - 2
11
- version: 0.0.6.2
10
+ - 3
11
+ version: 0.0.6.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - dazuiba
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-21 00:00:00 +08:00
19
+ date: 2011-05-30 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22