sinatra_more 0.3.25 → 0.3.26

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.25
1
+ 0.3.26
@@ -80,14 +80,16 @@ module SinatraMore
80
80
 
81
81
  def javascript_path(source)
82
82
  return source if source =~ /^http/
83
- result_path = "/javascripts/#{source.gsub(/.js/, '')}.js"
83
+ result_path = "/javascripts/#{source.gsub(/.js$/, '')}"
84
+ result_path << ".js" unless source =~ /\.js\w{2,4}$/
84
85
  stamp = File.exist?(result_path) ? File.mtime(result_path) : Time.now.to_i
85
86
  "#{result_path}?#{stamp}"
86
87
  end
87
88
 
88
89
  def stylesheet_path(source)
89
90
  return source if source =~ /^http/
90
- result_path = "/stylesheets/#{source.gsub(/.css/, '')}.css"
91
+ result_path = "/stylesheets/#{source.gsub(/.css$/, '')}"
92
+ result_path << ".css" unless source =~ /\.css\w{2,4}$/
91
93
  stamp = File.exist?(result_path) ? File.mtime(result_path) : Time.now.to_i
92
94
  "#{result_path}?#{stamp}"
93
95
  end
@@ -1,9 +1,19 @@
1
1
  # This is for adding specific methods that are required by sinatra_more if activesupport isn't required
2
2
 
3
3
  unless String.method_defined?(:titleize) && Hash.method_defined?(:slice)
4
+ require 'active_support/core_ext/kernel'
5
+ require 'active_support/core_ext/module'
6
+ require 'active_support/core_ext/class'
7
+ require 'active_support/deprecation'
4
8
  require 'active_support/inflector'
5
- require 'active_support/core_ext/blank'
6
- require 'active_support/core_ext/class/attribute_accessors'
7
9
  require 'active_support/core_ext/hash'
8
10
  require 'active_support/core_ext/array'
9
11
  end
12
+
13
+ unless String.method_defined?(:blank?)
14
+ begin
15
+ require 'active_support/core_ext/object/blank'
16
+ rescue LoadError
17
+ require 'active_support/core_ext/blank'
18
+ end
19
+ end
data/sinatra_more.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_more}
8
- s.version = "0.3.25"
8
+ s.version = "0.3.26"
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"]
12
- s.date = %q{2009-11-25}
12
+ s.date = %q{2009-11-30}
13
13
  s.default_executable = %q{sinatra_gen}
14
14
  s.description = %q{Expands sinatra with standard helpers and tools to allow for complex applications}
15
15
  s.email = %q{nesquena@gmail.com}
@@ -121,6 +121,16 @@ class TestAssetTagHelpers < Test::Unit::TestCase
121
121
  actual_html = javascript_include_tag('application')
122
122
  assert_has_tag('script', :src => "/javascripts/application.js?#{time.to_i}", :type => "text/javascript") { actual_html }
123
123
  end
124
+ should "display javascript item for path containing js" do
125
+ time = stop_time_for_test
126
+ actual_html = javascript_include_tag 'test/jquery.json'
127
+ assert_has_tag('script', :src => "/javascripts/test/jquery.json?#{time.to_i}", :type => "text/javascript") { actual_html }
128
+ end
129
+ should "display javascript item for path containing period" do
130
+ time = stop_time_for_test
131
+ actual_html = javascript_include_tag 'test/jquery.min'
132
+ assert_has_tag('script', :src => "/javascripts/test/jquery.min.js?#{time.to_i}", :type => "text/javascript") { actual_html }
133
+ end
124
134
  should "display javascript item for long relative path" do
125
135
  time = stop_time_for_test
126
136
  actual_html = javascript_include_tag('example/demo/application')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_more
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.25
4
+ version: 0.3.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Esquenazi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-25 00:00:00 -08:00
12
+ date: 2009-11-30 00:00:00 -08:00
13
13
  default_executable: sinatra_gen
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency