sinatra-ie6nomore 0.1.2 → 0.1.3

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/Rakefile CHANGED
@@ -10,8 +10,8 @@ begin
10
10
  gem.email = "kematzy@gmail.com"
11
11
  gem.homepage = "http://github.com/kematzy/sinatra-ie6nomore"
12
12
  gem.authors = ["kematzy"]
13
- gem.add_dependency('sinatra', '>= 0.9.4')
14
- gem.add_development_dependency('spec', '>= 1.2.7')
13
+ gem.add_dependency('sinatra', '>= 1.0')
14
+ gem.add_development_dependency('rspec', '>= 1.3.0')
15
15
  gem.add_development_dependency('rspec_hpricot_matchers', '>= 1.0.0')
16
16
 
17
17
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -169,7 +169,7 @@ module Sinatra
169
169
  #
170
170
  module IE6NoMore
171
171
 
172
- VERSION = '0.1.2' unless const_defined?(:VERSION)
172
+ VERSION = '0.1.3' unless const_defined?(:VERSION)
173
173
  def self.version; "Sinatra::IE6NoMore v#{VERSION}"; end
174
174
 
175
175
  ##
@@ -229,24 +229,28 @@ module Sinatra
229
229
  # set the localisation
230
230
  i18n = localizations[o[:locale].to_s]
231
231
 
232
- html = ''
233
- html << %Q[<!--[if lt IE 7]>\n] unless o[:debug] # == true
234
- html << %Q[<div style="border: #{o[:border]}; background: #{o[:background]}; text-align: center; clear: both; height: 75px; position: relative;">\n]
235
- html << %Q[ <div style="position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;"><a href="#" onclick="javascript:this.parentNode.parentNode.style.display='none'; return false;"><img src="#{o[:img_host]}ie6nomore-cornerx.jpg" style="border: none;" alt="#{i18n['close']}"/></a></div>\n]
236
- html << %Q[ <div style="width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: #{o[:text_color]};">\n]
237
- html << %Q[ <div style="width: 75px; float: left;"><img src="#{o[:img_host]}ie6nomore-warning.jpg" alt="Warning!"/></div>\n]
238
- html << %Q[ <div style="width: 275px; float: left; font-family: Arial, sans-serif;">\n]
239
- html << %Q[ <div style="font-size: 14px; font-weight: bold; margin-top: 12px;">#{i18n['header']}</div>\n]
240
- html << %Q[ <div style="font-size: 12px; margin-top: 6px; line-height: 12px;">#{i18n['sub']}</div>\n]
241
- html << %Q[ </div>\n]
242
- html << %Q[ <div style="width: 75px; float: left;"><a href="#{i18n['ff_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-firefox.jpg" style="border: none;" alt="#{i18n['get']} Firefox 3.5"/></a></div>\n]
243
- html << %Q[ <div style="width: 75px; float: left;"><a href="#{i18n['ie_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-ie8.jpg" style="border: none;" alt="#{i18n['get']} Internet Explorer 8"/></a></div>\n]
244
- html << %Q[ <div style="width: 73px; float: left;"><a href="#{i18n['safari_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-safari.jpg" style="border: none;" alt="#{i18n['get']} Safari 4"/></a></div>\n]
245
- html << %Q[ <div style="float: left;"><a href="#{i18n['chrome_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-chrome.jpg" style="border: none;" alt="#{i18n['get']} Google Chrome"/></a></div>\n]
246
- html << %Q[ </div>\n]
247
- html << %Q[</div>\n]
248
- html << %Q[<![endif]-->\n] unless o[:debug] # == true
249
- html
232
+ start_tag = o[:debug] ? "<!-- DEBUG [if lt IE 7] -->" : "<!--[if lt IE 7]>"
233
+ close_tag = o[:debug] ? "<!-- DEBUG [endif] -->" : "<![endif]-->"
234
+
235
+ (<<-CODE).gsub(/^ {4}/, '')
236
+
237
+ #{start_tag}
238
+ <div id="ie6nomore" style="border: #{o[:border]}; background: #{o[:background]}; text-align: center; clear: both; height: 75px; position: relative;">
239
+ <div style="position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;"><a href="#" onclick="javascript:this.parentNode.parentNode.style.display='none'; return false;"><img src="#{o[:img_host]}ie6nomore-cornerx.jpg" style="border: none;" alt="#{i18n['close']}"/></a></div>
240
+ <div style="width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: #{o[:text_color]};">
241
+ <div style="width: 75px; float: left;"><img src="#{o[:img_host]}ie6nomore-warning.jpg" alt="Warning!"/></div>
242
+ <div style="width: 275px; float: left; font-family: Arial, sans-serif;">
243
+ <div style="font-size: 14px; font-weight: bold; margin-top: 12px;">#{i18n['header']}</div>
244
+ <div style="font-size: 12px; margin-top: 6px; line-height: 12px;">#{i18n['sub']}</div>
245
+ </div>
246
+ <div style="width: 75px; float: left;"><a href="#{i18n['ff_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-firefox.jpg" style="border: none;" alt="#{i18n['get']} Firefox 3.5"/></a></div>
247
+ <div style="width: 75px; float: left;"><a href="#{i18n['ie_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-ie8.jpg" style="border: none;" alt="#{i18n['get']} Internet Explorer 8"/></a></div>
248
+ <div style="width: 73px; float: left;"><a href="#{i18n['safari_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-safari.jpg" style="border: none;" alt="#{i18n['get']} Safari 4"/></a></div>
249
+ <div style="float: left;"><a href="#{i18n['chrome_url']}" target="_blank"><img src="#{o[:img_host]}ie6nomore-chrome.jpg" style="border: none;" alt="#{i18n['get']} Google Chrome"/></a></div>
250
+ </div>
251
+ </div>
252
+ #{close_tag}
253
+ CODE
250
254
  end
251
255
 
252
256
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra-ie6nomore}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["kematzy"]
12
- s.date = %q{2010-03-01}
12
+ s.date = %q{2010-08-01}
13
13
  s.description = %q{A Sinatra Extension that shows an 'IE6 No More' div on the page for IE6 browsers, making the eradication of IE6 easier.}
14
14
  s.email = %q{kematzy@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
39
39
  s.homepage = %q{http://github.com/kematzy/sinatra-ie6nomore}
40
40
  s.rdoc_options = ["--charset=UTF-8"]
41
41
  s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.3.6}
42
+ s.rubygems_version = %q{1.3.7}
43
43
  s.summary = %q{A Sinatra Extension that shows an 'IE6 No More' div on the page for IE6 browsers, making the eradication of IE6 easier.}
44
44
  s.test_files = [
45
45
  "spec/sinatra/ie6nomore_spec.rb",
@@ -50,18 +50,18 @@ Gem::Specification.new do |s|
50
50
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
51
51
  s.specification_version = 3
52
52
 
53
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
54
- s.add_runtime_dependency(%q<sinatra>, [">= 0.9.4"])
55
- s.add_development_dependency(%q<spec>, [">= 1.2.7"])
53
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
+ s.add_runtime_dependency(%q<sinatra>, [">= 1.0"])
55
+ s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
56
56
  s.add_development_dependency(%q<rspec_hpricot_matchers>, [">= 1.0.0"])
57
57
  else
58
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
59
- s.add_dependency(%q<spec>, [">= 1.2.7"])
58
+ s.add_dependency(%q<sinatra>, [">= 1.0"])
59
+ s.add_dependency(%q<rspec>, [">= 1.3.0"])
60
60
  s.add_dependency(%q<rspec_hpricot_matchers>, [">= 1.0.0"])
61
61
  end
62
62
  else
63
- s.add_dependency(%q<sinatra>, [">= 0.9.4"])
64
- s.add_dependency(%q<spec>, [">= 1.2.7"])
63
+ s.add_dependency(%q<sinatra>, [">= 1.0"])
64
+ s.add_dependency(%q<rspec>, [">= 1.3.0"])
65
65
  s.add_dependency(%q<rspec_hpricot_matchers>, [">= 1.0.0"])
66
66
  end
67
67
  end
@@ -38,7 +38,7 @@ describe "Sinatra" do
38
38
  # remove the comments so we can test the code output
39
39
  markup = remove_enclosing_html_comments(body)
40
40
  # we get the border and background through OK
41
- markup.should match(/<div style="border: 1px solid #F7941D; background: #FEEFDA;/)
41
+ markup.should match(/<div id="ie6nomore" style="border: 1px solid #F7941D; background: #FEEFDA;/)
42
42
  # we have a warning image
43
43
  markup.should have_tag('div[@style=width: 75px; float: left;] > img') do |img|
44
44
  img.attributes['src'].should == '/images/ie6nomore/ie6nomore-warning.jpg'
@@ -78,11 +78,11 @@ describe "Sinatra" do
78
78
  end
79
79
 
80
80
  it "should set the border style attribute" do
81
- @markup.should match(/<div style="border: 10px dashed #fff; background: yellow;/)
81
+ @markup.should match(/<div id="ie6nomore" style="border: 10px dashed #fff; background: yellow;/)
82
82
  end
83
83
 
84
84
  it "should set the background style attribute" do
85
- @markup.should match(/<div style="(.*)background: yellow;/)
85
+ @markup.should match(/<div id="ie6nomore" style="(.*)background: yellow;/)
86
86
  end
87
87
 
88
88
  it "should set the text color style attribute" do
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-ie6nomore
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 29
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 2
9
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - kematzy
@@ -14,44 +15,49 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-01 00:00:00 +08:00
18
+ date: 2010-08-01 00:00:00 +08:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: sinatra
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 15
27
30
  segments:
31
+ - 1
28
32
  - 0
29
- - 9
30
- - 4
31
- version: 0.9.4
33
+ version: "1.0"
32
34
  type: :runtime
33
35
  version_requirements: *id001
34
36
  - !ruby/object:Gem::Dependency
35
- name: spec
37
+ name: rspec
36
38
  prerelease: false
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
38
41
  requirements:
39
42
  - - ">="
40
43
  - !ruby/object:Gem::Version
44
+ hash: 27
41
45
  segments:
42
46
  - 1
43
- - 2
44
- - 7
45
- version: 1.2.7
47
+ - 3
48
+ - 0
49
+ version: 1.3.0
46
50
  type: :development
47
51
  version_requirements: *id002
48
52
  - !ruby/object:Gem::Dependency
49
53
  name: rspec_hpricot_matchers
50
54
  prerelease: false
51
55
  requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
52
57
  requirements:
53
58
  - - ">="
54
59
  - !ruby/object:Gem::Version
60
+ hash: 23
55
61
  segments:
56
62
  - 1
57
63
  - 0
@@ -97,23 +103,27 @@ rdoc_options:
97
103
  require_paths:
98
104
  - lib
99
105
  required_ruby_version: !ruby/object:Gem::Requirement
106
+ none: false
100
107
  requirements:
101
108
  - - ">="
102
109
  - !ruby/object:Gem::Version
110
+ hash: 3
103
111
  segments:
104
112
  - 0
105
113
  version: "0"
106
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
+ none: false
107
116
  requirements:
108
117
  - - ">="
109
118
  - !ruby/object:Gem::Version
119
+ hash: 3
110
120
  segments:
111
121
  - 0
112
122
  version: "0"
113
123
  requirements: []
114
124
 
115
125
  rubyforge_project:
116
- rubygems_version: 1.3.6
126
+ rubygems_version: 1.3.7
117
127
  signing_key:
118
128
  specification_version: 3
119
129
  summary: A Sinatra Extension that shows an 'IE6 No More' div on the page for IE6 browsers, making the eradication of IE6 easier.