htmlfive 0.1 → 0.1.5

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.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/htmlfive.gemspec +2 -2
  3. data/lib/helpers/ie.rb +41 -19
  4. metadata +2 -2
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  gem.email = "kossnocorp@gmail.com"
11
11
  gem.homepage = "http://github.com/kossnocorp/htmlfive"
12
12
  gem.authors = ["Aleksandr Koss", "Edward Tsech"]
13
- gem.version = '0.1'
13
+ gem.version = '0.1.5'
14
14
  #gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
15
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
16
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{htmlfive}
8
- s.version = "0.1"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aleksandr Koss", "Edward Tsech"]
12
- s.date = %q{2009-12-01}
12
+ s.date = %q{2009-12-02}
13
13
  s.description = %q{Useful helpers to create you HTML5 application today}
14
14
  s.email = %q{kossnocorp@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,30 +1,52 @@
1
1
  module Htmlfive
2
- module Ie
2
+ module Ie
3
3
  def self.included base
4
4
  base.class_eval do
5
5
  # Internet Explorer HTML5 elements initialization
6
6
 
7
- def ie_add_elements
8
- script = content_tag ('script',
7
+ def ie_init_html5_tags
8
+ unsupported_by_ie_html5_tags = %w(
9
+ article
10
+ aside
11
+ audio
12
+ canvas
13
+ command
14
+ datalist
15
+ details
16
+ dialog
17
+ embed
18
+ figure
19
+ footer
20
+ header
21
+ hgroup
22
+ keygen
23
+ mark
24
+ meter
25
+ nav
26
+ output
27
+ progress
28
+ rt
29
+ rp
30
+ ruby
31
+ section
32
+ source
33
+ time
34
+ video
35
+ )
36
+
37
+ output_string = "<!--[if IE]>#{content_tag('script',
9
38
  <<EOF
10
39
  ce=document.createElement;
11
- es=['article', 'aside', 'audio',
12
- 'canvas', 'command',
13
- 'datalist', 'details', 'dialog',
14
- 'embed',
15
- 'figure', 'footer',
16
- 'header', 'hgroup',
17
- 'keygen',
18
- 'mark', 'meter',
19
- 'nav',
20
- 'output', 'progress',
21
- 'rt', 'rp', 'ruby',
22
- 'section', 'source',
23
- 'time', 'video'];
24
- for(i=0;i<es.length;i++) ce(es[i]);
40
+ es=[#{unsupported_by_ie_html5_tags.collect {|tag| "'#{tag}'"}.join ','}];
41
+ for(i=0;i<es.length;i++)ce(es[i]);
25
42
  EOF
26
- )
27
- ie_comment = '<!--[if IE]>' + script + '<![endif]-->'
43
+ )}<![endif]-->".gsub(/\s/, '')
44
+
45
+ begin
46
+ output_string.html_safe!
47
+ rescue NoMethodError
48
+ output_string
49
+ end
28
50
  end
29
51
  end
30
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlfive
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.1"
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksandr Koss
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-12-01 00:00:00 +06:00
13
+ date: 2009-12-02 00:00:00 +06:00
14
14
  default_executable:
15
15
  dependencies: []
16
16