zenweb-haml 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/CHANGELOG.md +5 -0
- data/Manifest.txt +6 -0
- data/README.md +59 -0
- data/Rakefile +19 -0
- data/lib/zenweb/plugins/haml.rb +19 -0
- data/test/test_zenweb_plugins_haml.rb +34 -0
- metadata +108 -0
data/.gemtest
ADDED
File without changes
|
data/CHANGELOG.md
ADDED
data/Manifest.txt
ADDED
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# zenweb-haml
|
2
|
+
|
3
|
+
* https://github.com/flavorjones/zenweb-haml
|
4
|
+
|
5
|
+
|
6
|
+
## DESCRIPTION
|
7
|
+
|
8
|
+
A plugin for Zenweb to render HAML documents.
|
9
|
+
|
10
|
+
Related:
|
11
|
+
|
12
|
+
* http://zenspider.com/projects/zenweb.html
|
13
|
+
* http://haml.info
|
14
|
+
|
15
|
+
|
16
|
+
## FEATURES/PROBLEMS
|
17
|
+
|
18
|
+
* Renders HAML documents to HTML within the framework of a Zenweb site.
|
19
|
+
|
20
|
+
|
21
|
+
## SYNOPSIS
|
22
|
+
|
23
|
+
If you've got a Zenweb site, create a file with a `.haml` extension and render it.
|
24
|
+
|
25
|
+
|
26
|
+
## REQUIREMENTS
|
27
|
+
|
28
|
+
* the `haml` gem
|
29
|
+
|
30
|
+
|
31
|
+
## INSTALL
|
32
|
+
|
33
|
+
* `gem install zenweb-haml`
|
34
|
+
|
35
|
+
|
36
|
+
## LICENSE:
|
37
|
+
|
38
|
+
(The MIT License)
|
39
|
+
|
40
|
+
Copyright (c) 2012, Mike Dalessio
|
41
|
+
|
42
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
43
|
+
a copy of this software and associated documentation files (the
|
44
|
+
'Software'), to deal in the Software without restriction, including
|
45
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
46
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
47
|
+
permit persons to whom the Software is furnished to do so, subject to
|
48
|
+
the following conditions:
|
49
|
+
|
50
|
+
The above copyright notice and this permission notice shall be
|
51
|
+
included in all copies or substantial portions of the Software.
|
52
|
+
|
53
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
54
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
55
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
56
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
57
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
58
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
59
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
Hoe.plugin :bundler
|
7
|
+
Hoe.plugin :gemspec
|
8
|
+
|
9
|
+
Hoe.spec 'zenweb-haml' do
|
10
|
+
developer('Mike Dalessio', 'mike.dalessio@gmail.com')
|
11
|
+
|
12
|
+
self.readme_file = 'README.md'
|
13
|
+
self.history_file = 'CHANGELOG.md'
|
14
|
+
|
15
|
+
self.extra_deps << ["haml", ">= 0"]
|
16
|
+
self.extra_deps << ["zenweb", ">= 3.0.0.b1"]
|
17
|
+
end
|
18
|
+
|
19
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'haml'
|
2
|
+
|
3
|
+
module Zenweb::Haml
|
4
|
+
VERSION = '0.0.1'
|
5
|
+
end
|
6
|
+
|
7
|
+
class Zenweb::Page
|
8
|
+
##
|
9
|
+
# Render haml page content using Haml.
|
10
|
+
|
11
|
+
def render_haml page, content
|
12
|
+
haml(content || page.body)
|
13
|
+
end
|
14
|
+
|
15
|
+
def haml content
|
16
|
+
::Haml::Engine.new(content).render
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "minitest/autorun"
|
5
|
+
|
6
|
+
require "zenweb/site"
|
7
|
+
require "test/helper"
|
8
|
+
|
9
|
+
class TestZenwebPageHaml < MiniTest::Unit::TestCase
|
10
|
+
include ChdirTest("example-site")
|
11
|
+
|
12
|
+
attr_accessor :site, :page
|
13
|
+
|
14
|
+
def setup
|
15
|
+
super
|
16
|
+
|
17
|
+
self.site = Zenweb::Site.new
|
18
|
+
self.page = Zenweb::Page.new site, "pages/haml-devs-need-to-look-at-ruby-warnings.html.haml"
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_render_haml
|
22
|
+
act = page.render_haml page, nil
|
23
|
+
exp = "<div>Not really much here to see.</div>\n"
|
24
|
+
|
25
|
+
assert_equal exp, act
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_haml
|
29
|
+
act = page.haml "%div foo fah\n"
|
30
|
+
exp = "<div>foo fah</div>\n"
|
31
|
+
|
32
|
+
assert_equal exp, act
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zenweb-haml
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mike Dalessio
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: haml
|
16
|
+
requirement: &13076260 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *13076260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: zenweb
|
27
|
+
requirement: &13073940 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0.b1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *13073940
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rdoc
|
38
|
+
requirement: &13090360 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.10'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *13090360
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: hoe
|
49
|
+
requirement: &13089560 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *13089560
|
58
|
+
description: ! 'A plugin for Zenweb to render HAML documents.
|
59
|
+
|
60
|
+
|
61
|
+
Related:
|
62
|
+
|
63
|
+
|
64
|
+
* http://zenspider.com/projects/zenweb.html
|
65
|
+
|
66
|
+
* http://haml.info'
|
67
|
+
email:
|
68
|
+
- mike.dalessio@gmail.com
|
69
|
+
executables: []
|
70
|
+
extensions: []
|
71
|
+
extra_rdoc_files:
|
72
|
+
- Manifest.txt
|
73
|
+
files:
|
74
|
+
- CHANGELOG.md
|
75
|
+
- Manifest.txt
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- lib/zenweb/plugins/haml.rb
|
79
|
+
- test/test_zenweb_plugins_haml.rb
|
80
|
+
- .gemtest
|
81
|
+
homepage: https://github.com/flavorjones/zenweb-haml
|
82
|
+
licenses: []
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options:
|
85
|
+
- --main
|
86
|
+
- README.md
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project: zenweb-haml
|
103
|
+
rubygems_version: 1.8.10
|
104
|
+
signing_key:
|
105
|
+
specification_version: 3
|
106
|
+
summary: A plugin for Zenweb to render HAML documents
|
107
|
+
test_files:
|
108
|
+
- test/test_zenweb_plugins_haml.rb
|