creole 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/creole.gemspec +24 -0
- data/lib/creole/version.rb +1 -1
- metadata +6 -16
- data/lib/creole/template.rb +0 -21
- data/test/template_test.rb +0 -12
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
doc
|
data/creole.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.dirname(__FILE__) + '/lib/creole/version'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'creole'
|
7
|
+
s.version = Creole::VERSION
|
8
|
+
s.date = Date.today.to_s
|
9
|
+
|
10
|
+
s.authors = ['Lars Christensen', 'Daniel Mendler']
|
11
|
+
s.email = ['larsch@belunktum.dk', 'mail@daniel-mendler.de']
|
12
|
+
s.summary = 'Lightweight markup language'
|
13
|
+
s.description = 'Creole is a lightweight markup language (http://wikicreole.org/).'
|
14
|
+
s.extra_rdoc_files = %w(README.creole)
|
15
|
+
s.rubyforge_project = s.name
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = %w(lib)
|
20
|
+
|
21
|
+
s.homepage = 'http://github.com/minad/creole'
|
22
|
+
s.rdoc_options = %w(--main README.creole)
|
23
|
+
s.add_development_dependency('bacon')
|
24
|
+
end
|
data/lib/creole/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 4
|
8
|
-
- 1
|
9
|
-
version: 0.4.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.4.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Lars Christensen
|
@@ -15,7 +11,7 @@ autorequire:
|
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
13
|
|
18
|
-
date: 2011-03
|
14
|
+
date: 2011-05-03 00:00:00 +02:00
|
19
15
|
default_executable:
|
20
16
|
dependencies:
|
21
17
|
- !ruby/object:Gem::Dependency
|
@@ -26,8 +22,6 @@ dependencies:
|
|
26
22
|
requirements:
|
27
23
|
- - ">="
|
28
24
|
- !ruby/object:Gem::Version
|
29
|
-
segments:
|
30
|
-
- 0
|
31
25
|
version: "0"
|
32
26
|
type: :development
|
33
27
|
version_requirements: *id001
|
@@ -42,14 +36,14 @@ extensions: []
|
|
42
36
|
extra_rdoc_files:
|
43
37
|
- README.creole
|
44
38
|
files:
|
39
|
+
- .gitignore
|
45
40
|
- README.creole
|
46
41
|
- Rakefile
|
42
|
+
- creole.gemspec
|
47
43
|
- lib/creole.rb
|
48
44
|
- lib/creole/parser.rb
|
49
|
-
- lib/creole/template.rb
|
50
45
|
- lib/creole/version.rb
|
51
46
|
- test/parser_test.rb
|
52
|
-
- test/template_test.rb
|
53
47
|
has_rdoc: true
|
54
48
|
homepage: http://github.com/minad/creole
|
55
49
|
licenses: []
|
@@ -65,21 +59,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
59
|
requirements:
|
66
60
|
- - ">="
|
67
61
|
- !ruby/object:Gem::Version
|
68
|
-
segments:
|
69
|
-
- 0
|
70
62
|
version: "0"
|
71
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
64
|
none: false
|
73
65
|
requirements:
|
74
66
|
- - ">="
|
75
67
|
- !ruby/object:Gem::Version
|
76
|
-
segments:
|
77
|
-
- 0
|
78
68
|
version: "0"
|
79
69
|
requirements: []
|
80
70
|
|
81
71
|
rubyforge_project: creole
|
82
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.6.2
|
83
73
|
signing_key:
|
84
74
|
specification_version: 3
|
85
75
|
summary: Lightweight markup language
|
data/lib/creole/template.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'tilt'
|
2
|
-
require 'creole'
|
3
|
-
|
4
|
-
module Creole
|
5
|
-
class Template < Tilt::Template
|
6
|
-
def prepare
|
7
|
-
opts = {}
|
8
|
-
[:allowed_schemes, :extensions, :no_escape].each do |k|
|
9
|
-
opts[k] = options[k] if options[k]
|
10
|
-
end
|
11
|
-
@creole = Creole::Parser.new(data, opts)
|
12
|
-
@output = nil
|
13
|
-
end
|
14
|
-
|
15
|
-
def evaluate(scope, locals, &block)
|
16
|
-
@output ||= @creole.to_html
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
Tilt.register 'creole', Creole::Template
|
data/test/template_test.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'creole/template'
|
2
|
-
|
3
|
-
describe Creole::Template do
|
4
|
-
it 'should be registered for .creole files' do
|
5
|
-
Tilt.mappings['creole'].should.equal Creole::Template
|
6
|
-
end
|
7
|
-
|
8
|
-
it 'should prepare and evaluate templates on #render' do
|
9
|
-
template = Creole::Template.new { |t| '= Hello World!' }
|
10
|
-
3.times { template.render.should.equal '<h1>Hello World!</h1>' }
|
11
|
-
end
|
12
|
-
end
|