microformats_helper 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,7 @@
1
1
  =Microformats Helper
2
-
2
+
3
+ {<img src="https://travis-ci.org/shadow11/microformats_helper.png" />}[https://travis-ci.org/shadow11/microformats_helper]
4
+
3
5
  Microformats Helper is a plugin for generating content-rich tags in HTML files, following Microformats standards. For more information about Microformats, check its website (http://microformats.org).
4
6
 
5
7
  Currently only hCard and hReview microformats are available.
@@ -42,7 +44,7 @@ In your views:
42
44
  The output is:
43
45
 
44
46
  <span class="vcard">
45
- <span class="fn n">Ricardo Yasuda</span>
47
+ <span class="fn n">Ricardo Yasuda</span>
46
48
  </span>
47
49
 
48
50
  A more complicated example:
@@ -73,3 +75,7 @@ The output is:
73
75
  <span class="tel-label-home type">Home: </span><span class="value">555-5555</span>
74
76
  </span>
75
77
  </span>
78
+
79
+ ==Credits
80
+
81
+ Many thanks to Carsten Zimmermann [carpodaster] (hReview and Rails 3 support) and arnaud sellenet [demental] (gem creation). Contributions are always welcome.
@@ -42,6 +42,9 @@ module MicroformatsHelper
42
42
  # support for additional HTML options, e.g. id
43
43
  html_options = (values[:html] || {})
44
44
 
45
+ # support for more regional divider styles to seperate "locality" and "region" fields
46
+ values[:divider] ||= " - "
47
+
45
48
  # support for additional classes
46
49
  if classes = values[:class]
47
50
  classes << " vcard"
@@ -91,7 +94,7 @@ module MicroformatsHelper
91
94
  end
92
95
  if region = values[:region]
93
96
  address = true
94
- adr += " - " + content_tag("span", region, {:class => "region"}, escape)
97
+ adr += values[:divider] + content_tag("span", region, {:class => "region"}, escape)
95
98
  end
96
99
  if postal_code = values[:postal_code]
97
100
  address = true
metadata CHANGED
@@ -1,85 +1,51 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: microformats_helper
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ricardo Shiota Yasuda
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-08-12 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
32
- type: :runtime
33
- version_requirements: *id001
12
+ date: 2013-06-20 00:00:00.000000000 Z
13
+ dependencies: []
34
14
  description: Helper to render microformats structures (eg hcard).
35
- email:
15
+ email:
36
16
  - shadow11@gmail.com
37
17
  executables: []
38
-
39
18
  extensions: []
40
-
41
- extra_rdoc_files:
19
+ extra_rdoc_files:
42
20
  - LICENSE
43
- - README
44
21
  - README.rdoc
45
- files:
22
+ files:
46
23
  - LICENSE
47
24
  - README.rdoc
48
25
  - lib/microformats_helper.rb
49
26
  - lib/microformats_helper/helpers.rb
50
- - README
51
27
  homepage: http://github.com/shadow11/microformats_helper/tree/master
52
28
  licenses: []
53
-
54
29
  post_install_message:
55
30
  rdoc_options: []
56
-
57
- require_paths:
31
+ require_paths:
58
32
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
33
+ required_ruby_version: !ruby/object:Gem::Requirement
60
34
  none: false
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- hash: 3
65
- segments:
66
- - 0
67
- version: "0"
68
- required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
40
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
77
45
  requirements: []
78
-
79
46
  rubyforge_project:
80
- rubygems_version: 1.8.11
47
+ rubygems_version: 1.8.25
81
48
  signing_key:
82
49
  specification_version: 3
83
50
  summary: Helper to render microformats structures (eg hcard).
84
51
  test_files: []
85
-
data/README DELETED
@@ -1,60 +0,0 @@
1
- =Microformats Helper
2
-
3
- Microformats Helper is a plugin for generating content-rich tags in HTML files, following Microformats standards. For more information about Microformats, check its website (http://microformats.org).
4
-
5
- Currently only hCard and hReview microformats are available.
6
-
7
- ==Options
8
-
9
- All fields are optional but the name, you are required to provide at least one of the names below.
10
-
11
- ===Name
12
-
13
- * +fn+ - Formal Name: should be used when no other name is provided
14
- * +given+ - Given Name
15
- * +family+ - Family Name
16
- * +additional+ - Additional Name: goes between given and family names
17
- * +prefix+ - Honorific Prefix: for titles like Dr. or Sir
18
- * +suffix+ - Honorific Suffix: for titles like M.D. or Jr
19
-
20
- ===Address
21
-
22
- * +street+ - Street Address
23
- * +locality+ - The city or similar
24
- * +region+ - The state, county or similar
25
- * +postal-code+ - ZIP number
26
- * +country+ - The country
27
-
28
- ===Contact
29
-
30
- * +tel+ - Provide the phone number
31
- * +url+ - Add a link to a site in the name
32
- * +email+ - Add a link to a mailto: address
33
-
34
-
35
- ==Usage
36
-
37
- In your views:
38
-
39
- <%= hcard :fn => "Ricardo Yasuda" %>
40
-
41
- The output is:
42
-
43
- <span class="vcard">
44
- <span class="fn n">Ricardo Yasuda</span>
45
- </span>
46
-
47
- A more complicated example:
48
-
49
- <%= hcard :given => "Ricardo", :family => "Yasuda", :url => "http://blog.shadowmaru.org", :country => "Brazil" %>
50
-
51
- The output is:
52
-
53
- <span class="vcard">
54
- <a href="http:blog.shadowmaru.org" class="fn n url">
55
- <span class="given-name">Ricardo</span> <span class="family-name">Yasuda</span>
56
- </a>
57
- <div class="adr">
58
- <span class="country-name">Brazil</span>
59
- </div>
60
- </span>