padrino-helpers 0.9.5 → 0.9.6

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.9.5
1
+ 0.9.6
@@ -207,17 +207,18 @@ module Padrino
207
207
  end
208
208
 
209
209
  ##
210
- # Generates a favicon link.
210
+ # Generates a favicon link. looks inside images folder
211
211
  #
212
212
  # ==== Examples
213
213
  #
214
- # favicon_tag 'images/favicon.png'
214
+ # favicon_tag 'favicon.png'
215
+ # favicon_tag 'icons/favicon.png'
215
216
  # # or override some options
216
- # favicon_tag 'images/favicon.png', :type => 'image/ico'
217
+ # favicon_tag 'favicon.png', :type => 'image/ico'
217
218
  #
218
219
  def favicon_tag(source,options={})
219
220
  type = File.extname(source).gsub('.','')
220
- options = options.dup.reverse_merge!(:href => source, :rel => 'icon', :type => "image/#{type}")
221
+ options = options.dup.reverse_merge!(:href => image_path(source), :rel => 'icon', :type => "image/#{type}")
221
222
  tag(:link, options)
222
223
  end
223
224
 
@@ -244,7 +244,7 @@ module Padrino
244
244
  # js_escape_html("<h1>Hey</h1>")
245
245
  #
246
246
  def js_escape_html(html_content)
247
- "\"#{escape_javascript(html_content)}\""
247
+ %Q["#{escape_javascript(html_content)}"]
248
248
  end
249
249
  end # FormatHelpers
250
250
  end # Helpers
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{padrino-helpers}
8
- s.version = "0.9.5"
8
+ s.version = "0.9.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
12
- s.date = %q{2010-03-11}
12
+ s.date = %q{2010-03-15}
13
13
  s.description = %q{Tag helpers, asset helpers, form helpers, form builders and many more helpers for padrino}
14
14
  s.email = %q{padrinorb@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -84,14 +84,14 @@ Gem::Specification.new do |s|
84
84
  s.specification_version = 3
85
85
 
86
86
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
87
- s.add_runtime_dependency(%q<padrino-core>, ["= 0.9.5"])
87
+ s.add_runtime_dependency(%q<padrino-core>, ["= 0.9.6"])
88
88
  s.add_development_dependency(%q<haml>, [">= 2.2.1"])
89
89
  s.add_development_dependency(%q<shoulda>, [">= 2.10.3"])
90
90
  s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
91
91
  s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
92
92
  s.add_development_dependency(%q<webrat>, [">= 0.5.1"])
93
93
  else
94
- s.add_dependency(%q<padrino-core>, ["= 0.9.5"])
94
+ s.add_dependency(%q<padrino-core>, ["= 0.9.6"])
95
95
  s.add_dependency(%q<haml>, [">= 2.2.1"])
96
96
  s.add_dependency(%q<shoulda>, [">= 2.10.3"])
97
97
  s.add_dependency(%q<mocha>, [">= 0.9.7"])
@@ -99,7 +99,7 @@ Gem::Specification.new do |s|
99
99
  s.add_dependency(%q<webrat>, [">= 0.5.1"])
100
100
  end
101
101
  else
102
- s.add_dependency(%q<padrino-core>, ["= 0.9.5"])
102
+ s.add_dependency(%q<padrino-core>, ["= 0.9.6"])
103
103
  s.add_dependency(%q<haml>, [">= 2.2.1"])
104
104
  s.add_dependency(%q<shoulda>, [">= 2.10.3"])
105
105
  s.add_dependency(%q<mocha>, [">= 0.9.7"])
@@ -6,9 +6,9 @@ require 'rack/test'
6
6
  require 'webrat'
7
7
 
8
8
  # We try to load the vendored padrino-core if exist
9
- %w(core).each do |gem|
10
- if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{gem}/lib")
11
- $:.unshift File.dirname(__FILE__) + "/../../padrino-#{gem}/lib"
9
+ %w(core).each do |lib|
10
+ if File.exist?(File.dirname(__FILE__) + "/../../padrino-#{lib}/lib")
11
+ $:.unshift File.dirname(__FILE__) + "/../../padrino-#{lib}/lib"
12
12
  end
13
13
  end
14
14
 
@@ -27,6 +27,10 @@ class Test::Unit::TestCase
27
27
  include Rack::Test::Methods
28
28
  include Webrat::Methods
29
29
  include Webrat::Matchers
30
+
31
+ def setup
32
+ Padrino.stubs(:root).returns("/tmp/sample")
33
+ end
30
34
 
31
35
  Webrat.configure do |config|
32
36
  config.mode = :rack
@@ -206,18 +206,18 @@ class TestAssetTagHelpers < Test::Unit::TestCase
206
206
  context "for #favicon_tag method" do
207
207
  should "display favicon" do
208
208
  time = stop_time_for_test
209
- actual_html = favicon_tag('images/favicon.png')
210
- assert_has_tag('link', :rel => 'icon', :type => 'image/png', :href => 'images/favicon.png') { actual_html }
209
+ actual_html = favicon_tag('icons/favicon.png')
210
+ assert_has_tag('link', :rel => 'icon', :type => 'image/png', :href => '/images/icons/favicon.png') { actual_html }
211
211
  end
212
212
  should "match type with file ext" do
213
213
  time = stop_time_for_test
214
- actual_html = favicon_tag('images/favicon.ico')
215
- assert_has_tag('link', :rel => 'icon', :type => 'image/ico', :href => 'images/favicon.ico') { actual_html }
214
+ actual_html = favicon_tag('favicon.ico')
215
+ assert_has_tag('link', :rel => 'icon', :type => 'image/ico', :href => '/images/favicon.ico') { actual_html }
216
216
  end
217
217
  should "allow option overrides" do
218
218
  time = stop_time_for_test
219
- actual_html = favicon_tag('images/favicon.png', :type => 'image/ico')
220
- assert_has_tag('link', :rel => 'icon', :type => 'image/ico', :href => 'images/favicon.png') { actual_html }
219
+ actual_html = favicon_tag('favicon.png', :type => 'image/ico')
220
+ assert_has_tag('link', :rel => 'icon', :type => 'image/ico', :href => '/images/favicon.png') { actual_html }
221
221
  end
222
222
 
223
223
  end
@@ -176,7 +176,7 @@ class TestFormatHelpers < Test::Unit::TestCase
176
176
 
177
177
  context 'for #js_escape_html method' do
178
178
  should "escape double quotes" do
179
- assert_equal "\"hello\"", js_escape_html('"hello"')
179
+ assert_equal %Q{"hello"}, js_escape_html('"hello"')
180
180
  end
181
181
  should "escape single quotes" do
182
182
  assert_equal "\"hello\"", js_escape_html("'hello'")
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 5
9
- version: 0.9.5
8
+ - 6
9
+ version: 0.9.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Padrino Team
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-03-11 00:00:00 +01:00
20
+ date: 2010-03-15 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -30,8 +30,8 @@ dependencies:
30
30
  segments:
31
31
  - 0
32
32
  - 9
33
- - 5
34
- version: 0.9.5
33
+ - 6
34
+ version: 0.9.6
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency