zenweb-textile 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +23 -0
- data/.gemtest +0 -0
- data/History.txt +5 -0
- data/Manifest.txt +8 -0
- data/README.txt +66 -0
- data/Rakefile +15 -0
- data/lib/zenweb-textile.rb +23 -0
- data/test/2012-01-05-page4.html.textile +5 -0
- data/test/test_zenweb_textile.rb +41 -0
- metadata +115 -0
data/.autotest
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'autotest/restart'
|
4
|
+
|
5
|
+
# Autotest.add_hook :initialize do |at|
|
6
|
+
# at.extra_files << "../some/external/dependency.rb"
|
7
|
+
#
|
8
|
+
# at.libs << ":../some/external"
|
9
|
+
#
|
10
|
+
# at.add_exception 'vendor'
|
11
|
+
#
|
12
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
13
|
+
# at.files_matching(/test_.*rb$/)
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# %w(TestA TestB).each do |klass|
|
17
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
# Autotest.add_hook :run_command do |at|
|
22
|
+
# system "rake build"
|
23
|
+
# end
|
data/.gemtest
ADDED
File without changes
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
= zenweb-textile
|
2
|
+
|
3
|
+
* Source :: http://github.com/tamc/zenweb-textile
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A plugin for zenweb to process .textile files with RedCloth
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* Only implements basic parsing of .textile files.
|
12
|
+
* No helper methods yet.
|
13
|
+
* No ability to customise RedCloth options yet
|
14
|
+
|
15
|
+
== SYNOPSIS:
|
16
|
+
|
17
|
+
If you want to use .textile pages in your zenweb site then:
|
18
|
+
|
19
|
+
gem install zenweb-textile
|
20
|
+
|
21
|
+
and in the Rakefile in your site add
|
22
|
+
|
23
|
+
require 'zenweb-textile'
|
24
|
+
|
25
|
+
== REQUIREMENTS:
|
26
|
+
|
27
|
+
* Zenweb 3.0.0.b3
|
28
|
+
* RedCloth
|
29
|
+
|
30
|
+
== INSTALL:
|
31
|
+
|
32
|
+
sudo gem install zenweb-textile
|
33
|
+
|
34
|
+
== DEVELOPERS:
|
35
|
+
|
36
|
+
After checking out the source, run:
|
37
|
+
|
38
|
+
$ rake newb
|
39
|
+
|
40
|
+
This task will install any missing dependencies, run the tests/specs,
|
41
|
+
and generate the RDoc.
|
42
|
+
|
43
|
+
== LICENSE:
|
44
|
+
|
45
|
+
(The MIT License)
|
46
|
+
|
47
|
+
Copyright (c) 2012 Tom Counsell
|
48
|
+
|
49
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
50
|
+
a copy of this software and associated documentation files (the
|
51
|
+
'Software'), to deal in the Software without restriction, including
|
52
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
53
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
54
|
+
permit persons to whom the Software is furnished to do so, subject to
|
55
|
+
the following conditions:
|
56
|
+
|
57
|
+
The above copyright notice and this permission notice shall be
|
58
|
+
included in all copies or substantial portions of the Software.
|
59
|
+
|
60
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
61
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
62
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
63
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
64
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
65
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
66
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
Hoe.plugin :minitest
|
7
|
+
Hoe.plugin :git
|
8
|
+
|
9
|
+
Hoe.spec 'zenweb-textile' do
|
10
|
+
developer 'tamc', 'tamc@greenonblack.com'
|
11
|
+
self.extra_deps << ['RedCloth','~> 4.2.9']
|
12
|
+
self.extra_deps << ['zenweb','3.0.0.b3']
|
13
|
+
end
|
14
|
+
|
15
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'zenweb'
|
2
|
+
|
3
|
+
module ZenwebTextile
|
4
|
+
VERSION = '0.0.1'
|
5
|
+
end
|
6
|
+
|
7
|
+
module Zenweb
|
8
|
+
class Page
|
9
|
+
|
10
|
+
##
|
11
|
+
# Render a page's textile and return the resulting html
|
12
|
+
def render_textile page, content
|
13
|
+
textile body
|
14
|
+
end
|
15
|
+
|
16
|
+
##
|
17
|
+
# Render textile in +content+
|
18
|
+
def textile content
|
19
|
+
require 'RedCloth'
|
20
|
+
@textile = RedCloth.new(content).to_html
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "minitest/autorun"
|
5
|
+
|
6
|
+
require "zenweb-textile"
|
7
|
+
|
8
|
+
class TestZenwebPageTextile < MiniTest::Unit::TestCase
|
9
|
+
|
10
|
+
attr_accessor :site, :page
|
11
|
+
|
12
|
+
def setup
|
13
|
+
super
|
14
|
+
|
15
|
+
@old_dir = Dir.pwd
|
16
|
+
Dir.chdir(File.dirname(__FILE__))
|
17
|
+
|
18
|
+
self.site = Zenweb::Site.new
|
19
|
+
self.page = Zenweb::Page.new site, "2012-01-05-page4.html.textile"
|
20
|
+
end
|
21
|
+
|
22
|
+
def teardown
|
23
|
+
super()
|
24
|
+
Dir.chdir @old_dir
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_render_textile
|
28
|
+
act = page.render_textile page, nil
|
29
|
+
exp = "<p>Not really <strong>much</strong> here to see.</p>"
|
30
|
+
|
31
|
+
assert_equal exp, act
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_textile
|
35
|
+
act = page.textile "this is *some* content"
|
36
|
+
exp = "<p>this is <strong>some</strong> content</p>"
|
37
|
+
|
38
|
+
assert_equal exp, act
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: zenweb-textile
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- tamc
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: RedCloth
|
16
|
+
requirement: &70190991676980 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 4.2.9
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70190991676980
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: zenweb
|
27
|
+
requirement: &70190991676460 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - =
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.0.0.b3
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70190991676460
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: minitest
|
38
|
+
requirement: &70190991675940 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70190991675940
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rdoc
|
49
|
+
requirement: &70190991675420 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.10'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70190991675420
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: hoe
|
60
|
+
requirement: &70190991674900 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '3.0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70190991674900
|
69
|
+
description: A plugin for zenweb to process .textile files with RedCloth
|
70
|
+
email:
|
71
|
+
- tamc@greenonblack.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files:
|
75
|
+
- History.txt
|
76
|
+
- Manifest.txt
|
77
|
+
- README.txt
|
78
|
+
files:
|
79
|
+
- .autotest
|
80
|
+
- History.txt
|
81
|
+
- Manifest.txt
|
82
|
+
- README.txt
|
83
|
+
- Rakefile
|
84
|
+
- lib/zenweb-textile.rb
|
85
|
+
- test/2012-01-05-page4.html.textile
|
86
|
+
- test/test_zenweb_textile.rb
|
87
|
+
- .gemtest
|
88
|
+
homepage: http://github.com/tamc/zenweb-textile
|
89
|
+
licenses: []
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options:
|
92
|
+
- --main
|
93
|
+
- README.txt
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project: zenweb-textile
|
110
|
+
rubygems_version: 1.8.10
|
111
|
+
signing_key:
|
112
|
+
specification_version: 3
|
113
|
+
summary: A plugin for zenweb to process .textile files with RedCloth
|
114
|
+
test_files:
|
115
|
+
- test/test_zenweb_textile.rb
|