microformat_generator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +9 -0
- data/README.txt +54 -0
- data/Rakefile +26 -0
- data/bin/microformat_generator +0 -0
- data/lib/microformat_generator.rb +3 -0
- data/microformat_generator.rb +14 -0
- data/templates/hCard.haml +24 -0
- data/test/test_microformat_generator.rb +0 -0
- metadata +65 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
MicroformatGenerator
|
2
|
+
by Geoffrey Grosenbach
|
3
|
+
http://topfunky.com
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A set of HAML templates for generating Microformats.
|
8
|
+
|
9
|
+
== USAGE
|
10
|
+
|
11
|
+
ruby script/generate hCard
|
12
|
+
=> Copies a template partial to app/views/microformats/_hCard.haml
|
13
|
+
|
14
|
+
render :partial => 'microformats/hCard'
|
15
|
+
|
16
|
+
== FEATURES/PROBLEMS:
|
17
|
+
|
18
|
+
* TODO A more generic non-Rails script for copying templates to a Merb, Camping or PHP app is needed.
|
19
|
+
* TODO More templates are needed. A simple hCard template is currently the only template.
|
20
|
+
* TODO A class-based implementation. For example, take a Struct and return hCard using the data from the struct.
|
21
|
+
* TODO Erb templates might be nice, as an option.
|
22
|
+
|
23
|
+
== REQUIREMENTS:
|
24
|
+
|
25
|
+
* The HAML gem or Rails plugin.
|
26
|
+
|
27
|
+
== INSTALL:
|
28
|
+
|
29
|
+
* sudo gem install microformat_generator
|
30
|
+
|
31
|
+
== LICENSE:
|
32
|
+
|
33
|
+
(The MIT License)
|
34
|
+
|
35
|
+
Copyright (c) 2007 Topfunky Corporation
|
36
|
+
|
37
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
38
|
+
a copy of this software and associated documentation files (the
|
39
|
+
'Software'), to deal in the Software without restriction, including
|
40
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
41
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
42
|
+
permit persons to whom the Software is furnished to do so, subject to
|
43
|
+
the following conditions:
|
44
|
+
|
45
|
+
The above copyright notice and this permission notice shall be
|
46
|
+
included in all copies or substantial portions of the Software.
|
47
|
+
|
48
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
49
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
50
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
51
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
52
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
53
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
54
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require './lib/microformat_generator.rb'
|
6
|
+
|
7
|
+
Hoe.new('microformat_generator', MicroformatGenerator::VERSION) do |p|
|
8
|
+
p.rubyforge_name = 'microformat_generator'
|
9
|
+
p.author = 'Geoffrey Grosenbach'
|
10
|
+
p.email = 'boss@topfunky.com'
|
11
|
+
p.description = 'Templates for using Microformats in your HAML-powered app.'
|
12
|
+
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
13
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
14
|
+
end
|
15
|
+
|
16
|
+
# desc "Uninstall gem"
|
17
|
+
# task :uninstall_gem do
|
18
|
+
# system "sudo gem uninstall microformat_generator"
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# desc "Clean, uninstall gem, package, install_gem"
|
23
|
+
# task :reinstall_gem => [:clean, :uninstall_gem, :package, :install_gem]
|
24
|
+
#
|
25
|
+
|
26
|
+
# vim: syntax=Ruby
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class MicroformatGenerator < Rails::Generator::NamedBase
|
2
|
+
|
3
|
+
def manifest
|
4
|
+
record do |m|
|
5
|
+
m.directory File.join('app', 'views', 'microformats')
|
6
|
+
m.file "#{name}.haml", File.join('app', 'views', 'microformats', "_#{name}.haml")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def banner
|
11
|
+
"Usage: script/generate microformat hCard"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
.vcard
|
2
|
+
%a{:class=>"url fn hide", :href=>"http://yoururl.com"}
|
3
|
+
Your Name
|
4
|
+
|
5
|
+
.org
|
6
|
+
Your Company
|
7
|
+
.adr
|
8
|
+
.street-address
|
9
|
+
100 Street
|
10
|
+
%span.locality
|
11
|
+
City
|
12
|
+
,
|
13
|
+
%span.region
|
14
|
+
WA
|
15
|
+
,
|
16
|
+
%span.postal-code
|
17
|
+
10000
|
18
|
+
%abbr.country-name{:title => "United States of America"}
|
19
|
+
USA
|
20
|
+
.tel
|
21
|
+
%span.type
|
22
|
+
Mobile
|
23
|
+
%span.value
|
24
|
+
+1 999 999 9999
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: microformat_generator
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2007-07-16 00:00:00 -07:00
|
8
|
+
summary: The author was too lazy to write a summary
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: boss@topfunky.com
|
12
|
+
homepage: " by Geoffrey Grosenbach"
|
13
|
+
rubyforge_project: microformat_generator
|
14
|
+
description: Templates for using Microformats in your HAML-powered app.
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Geoffrey Grosenbach
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- Rakefile
|
36
|
+
- bin/microformat_generator
|
37
|
+
- lib/microformat_generator.rb
|
38
|
+
- microformat_generator.rb
|
39
|
+
- templates/hCard.haml
|
40
|
+
- test/test_microformat_generator.rb
|
41
|
+
test_files:
|
42
|
+
- test/test_microformat_generator.rb
|
43
|
+
rdoc_options:
|
44
|
+
- --main
|
45
|
+
- README.txt
|
46
|
+
extra_rdoc_files:
|
47
|
+
- History.txt
|
48
|
+
- Manifest.txt
|
49
|
+
- README.txt
|
50
|
+
executables:
|
51
|
+
- microformat_generator
|
52
|
+
extensions: []
|
53
|
+
|
54
|
+
requirements: []
|
55
|
+
|
56
|
+
dependencies:
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: hoe
|
59
|
+
version_requirement:
|
60
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.2.1
|
65
|
+
version:
|