darkhelmet-sinatra_more 0.3.34 → 0.3.35

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.
@@ -92,8 +92,11 @@ module Sinatra
92
92
  result_path = "/javascripts/#{source.gsub(/.js$/, '')}"
93
93
  result_path << ".js" unless source =~ /\.js\w{2,4}$/
94
94
  disk_path = "#{options.public}#{result_path}"
95
- stamp = File.exist?(disk_path) ? File.mtime(disk_path).to_i : Time.now.to_i
96
- "#{result_path}?#{stamp}"
95
+ if File.exist?(disk_path)
96
+ "#{result_path}?#{File.mtime(disk_path).to_i}"
97
+ else
98
+ result_path
99
+ end
97
100
  end
98
101
 
99
102
  def stylesheet_path(source)
@@ -101,8 +104,11 @@ module Sinatra
101
104
  result_path = "/stylesheets/#{source.gsub(/.css$/, '')}"
102
105
  result_path << ".css" unless source =~ /\.css\w{2,4}$/
103
106
  disk_path = "#{options.public}#{result_path}"
104
- stamp = File.exist?(disk_path) ? File.mtime(disk_path).to_i : Time.now.to_i
105
- "#{result_path}?#{stamp}"
107
+ if File.exist?(disk_path)
108
+ "#{result_path}?#{File.mtime(disk_path).to_i}"
109
+ else
110
+ result_path
111
+ end
106
112
  end
107
113
  end
108
114
  end
data/sinatra_more.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{darkhelmet-sinatra_more}
8
- s.version = "0.3.34"
8
+ s.version = "0.3.35"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Esquenazi", "Daniel Huckstep"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkhelmet-sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.34
4
+ version: 0.3.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi