radius 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/README.rdoc +1 -2
- data/lib/radius/utility.rb +4 -1
- data/lib/radius/version.rb +1 -1
- data/radius.gemspec +1 -1
- data/test/quickstart_test.rb +4 -4
- data/test/utility_test.rb +1 -1
- metadata +5 -5
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
= Radius -- Powerful Tag-Based Templates
|
1
|
+
= Radius -- Powerful Tag-Based Templates {<img src="https://secure.travis-ci.org/jlong/radius.png" />}[http://travis-ci.org/jlong/radius]
|
2
2
|
|
3
3
|
Radius is a powerful tag-based template language for Ruby inspired by the
|
4
4
|
template languages used in MovableType[http://www.movabletype.org] and
|
5
5
|
TextPattern[http://www.textpattern.com]. It uses tags similar to XML, but can
|
6
6
|
be used to generate any form of plain text (HTML, e-mail, etc...).
|
7
7
|
|
8
|
-
|
9
8
|
== Usage
|
10
9
|
|
11
10
|
With Radius, it is extremely easy to create custom tags and parse them. Here's a small
|
data/lib/radius/utility.rb
CHANGED
@@ -33,7 +33,10 @@ module Radius
|
|
33
33
|
end
|
34
34
|
else
|
35
35
|
def self.array_to_s(c)
|
36
|
-
c.map
|
36
|
+
c.map do |x|
|
37
|
+
res = (x.is_a?(Array) ? array_to_s(x) : x.to_s)
|
38
|
+
(res.frozen? ? res.dup : res).force_encoding(Encoding::UTF_8)
|
39
|
+
end.join
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
data/lib/radius/version.rb
CHANGED
data/radius.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.summary = %q{A tag-based templating language for Ruby.}
|
25
25
|
|
26
26
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
-
s.add_development_dependency(%q<
|
27
|
+
s.add_development_dependency(%q<kramdown>, [">= 0"])
|
28
28
|
s.add_development_dependency('rake', ['~> 0.8.7'])
|
29
29
|
else
|
30
30
|
s.add_dependency(%q<RedCloth>, [">= 0"])
|
data/test/quickstart_test.rb
CHANGED
@@ -13,14 +13,14 @@ class QuickstartTest < Test::Unit::TestCase
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_example_2
|
16
|
-
require '
|
16
|
+
require 'kramdown'
|
17
17
|
context = Radius::Context.new
|
18
|
-
context.define_tag "
|
18
|
+
context.define_tag "markdown" do |tag|
|
19
19
|
contents = tag.expand
|
20
|
-
|
20
|
+
Kramdown::Document.new(contents).to_html
|
21
21
|
end
|
22
22
|
parser = Radius::Parser.new(context)
|
23
|
-
assert_equal "<p>Hello <
|
23
|
+
assert_equal "<p>Hello <strong>World</strong>!</p>\n", parser.parse('<radius:markdown>Hello **World**!</radius:markdown>')
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_nested_example
|
data/test/utility_test.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 3
|
10
|
+
version: 0.7.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John W. Long (me@johnwlong.com)
|
@@ -17,10 +17,10 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-02-
|
20
|
+
date: 2012-02-26 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
name:
|
23
|
+
name: kramdown
|
24
24
|
prerelease: false
|
25
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|