sinatra-export 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source :rubygems
2
2
 
3
3
  group :development do
4
- gem 'debugger'
4
+ gem 'debugger' unless RUBY_VERSION < '1.9'
5
5
  gem 'awesome_print'
6
6
  end
7
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sinatra-export (0.9.3)
4
+ sinatra-export (0.9.4)
5
5
  rack
6
6
  sinatra
7
7
  sinatra-advanced-routes
@@ -36,11 +36,18 @@ module Sinatra
36
36
  end
37
37
 
38
38
  def build_path(path, dir)
39
- body = get_path(path).body
40
- ::FileUtils.mkdir_p(dir_for_path(path, dir))
41
- ::File.open(file_for_path(path, dir), 'w+') do |f|
39
+ response = get_path(path)
40
+ body = response.body
41
+ mtime = response.headers.key?("Last-Modified") ?
42
+ Time.httpdate(response.headers["Last-Modified"]) : Time.now
43
+ file_path = file_for_path(path, dir)
44
+ dir_path = dir_for_path(path, dir)
45
+
46
+ ::FileUtils.mkdir_p(dir_path)
47
+ ::File.open(file_path, 'w+') do |f|
42
48
  f.write(body)
43
49
  end
50
+ ::FileUtils.touch(file_path, :mtime => mtime)
44
51
  end
45
52
 
46
53
  def get_path(path)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sinatra-export'
3
- s.version = '0.9.3'
3
+ s.version = '0.9.4'
4
4
 
5
5
  s.authors = ['Jean-Philippe Doyle', 'Paul Asmuth']
6
6
  s.date = '2013-01-16'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: