radius 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source :rubygems
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem 'RedCloth'
6
+ gem 'kramdown'
7
7
  end
@@ -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
@@ -33,7 +33,10 @@ module Radius
33
33
  end
34
34
  else
35
35
  def self.array_to_s(c)
36
- c.map{|x| (x.is_a?(Array) ? array_to_s(x) : x.to_s).force_encoding(Encoding::UTF_8) }.join
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
@@ -1,5 +1,5 @@
1
1
  module Radius #:nodoc:
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  def self.version
4
4
  VERSION
5
5
  end
@@ -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<RedCloth>, [">= 0"])
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"])
@@ -13,14 +13,14 @@ class QuickstartTest < Test::Unit::TestCase
13
13
  end
14
14
 
15
15
  def test_example_2
16
- require 'redcloth'
16
+ require 'kramdown'
17
17
  context = Radius::Context.new
18
- context.define_tag "textile" do |tag|
18
+ context.define_tag "markdown" do |tag|
19
19
  contents = tag.expand
20
- RedCloth.new(contents).to_html
20
+ Kramdown::Document.new(contents).to_html
21
21
  end
22
22
  parser = Radius::Parser.new(context)
23
- assert_equal "<p>Hello <b>World</b>!</p>", parser.parse('<radius:textile>Hello **World**!</radius:textile>')
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
@@ -25,6 +25,6 @@ class RadiusUtilityTest < Test::Unit::TestCase
25
25
  end
26
26
 
27
27
  def test_array_to_s
28
- assert_equal Radius::Utility.array_to_s(['a', 1, [:c]]), 'a1c'
28
+ assert_equal Radius::Utility.array_to_s(['a', 1, [:c], 'brain'.freeze]), 'a1cbrain'
29
29
  end
30
30
  end
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: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 2
10
- version: 0.7.2
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-13 00:00:00 Z
20
+ date: 2012-02-26 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: RedCloth
23
+ name: kramdown
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false