acts_as_markdown 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -1
- data/acts_as_markdown.gemspec +11 -2
- data/lib/acts_as_markdown.rb +1 -1
- data/tasks/git.rake +1 -1
- data/test/acts_as_markdown_test.rb +72 -0
- metadata +33 -4
data/Rakefile
CHANGED
@@ -15,9 +15,11 @@ PROJ.email = 'brian.landau@viget.com'
|
|
15
15
|
PROJ.url = 'http://viget.rubyforge.com/acts_as_markdown'
|
16
16
|
PROJ.description = "Represent ActiveRecord markdown text columns as Markdown objects using various external libraries to convert to HTML."
|
17
17
|
PROJ.rubyforge.name = 'viget'
|
18
|
-
PROJ.dependencies = ['active_support', 'active_record']
|
19
18
|
PROJ.version = ActsAsMarkdown::VERSION
|
20
19
|
PROJ.rdoc.include = %w(^lib/ LICENSE\.txt README\.rdoc)
|
21
20
|
PROJ.rdoc.remote_dir = 'acts_as_markdown'
|
22
21
|
PROJ.test.files = FileList['test/**/*_test.rb']
|
23
22
|
|
23
|
+
%W(activesupport activerecord rdiscount).each do |gem|
|
24
|
+
depend_on gem
|
25
|
+
end
|
data/acts_as_markdown.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{acts_as_markdown}
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.1"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.authors = ["Brian Landau"]
|
7
|
-
s.date = %q{2008-08-
|
7
|
+
s.date = %q{2008-08-05}
|
8
8
|
s.description = %q{Represent ActiveRecord markdown text columns as Markdown objects using various external libraries to convert to HTML.}
|
9
9
|
s.email = %q{brian.landau@viget.com}
|
10
10
|
s.extra_rdoc_files = ["LICENSE.txt", "README.rdoc"]
|
@@ -23,8 +23,17 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.specification_version = 2
|
24
24
|
|
25
25
|
if current_version >= 3 then
|
26
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 2.1.0"])
|
27
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 2.1.0"])
|
28
|
+
s.add_runtime_dependency(%q<rdiscount>, [">= 1.2.7"])
|
26
29
|
else
|
30
|
+
s.add_dependency(%q<activesupport>, [">= 2.1.0"])
|
31
|
+
s.add_dependency(%q<activerecord>, [">= 2.1.0"])
|
32
|
+
s.add_dependency(%q<rdiscount>, [">= 1.2.7"])
|
27
33
|
end
|
28
34
|
else
|
35
|
+
s.add_dependency(%q<activesupport>, [">= 2.1.0"])
|
36
|
+
s.add_dependency(%q<activerecord>, [">= 2.1.0"])
|
37
|
+
s.add_dependency(%q<rdiscount>, [">= 1.2.7"])
|
29
38
|
end
|
30
39
|
end
|
data/lib/acts_as_markdown.rb
CHANGED
data/tasks/git.rake
CHANGED
@@ -27,6 +27,30 @@ class ActsAsMarkdownTest < Test::Unit::TestCase
|
|
27
27
|
assert_match(/<h2>\s*Markdown Test Text\s*<\/h2>/, @post.body.to_html)
|
28
28
|
end
|
29
29
|
|
30
|
+
context "changing value of markdown field should return new markdown object" do
|
31
|
+
setup do
|
32
|
+
@old_body = @post.body
|
33
|
+
@post.body = "`@count = 20`"
|
34
|
+
end
|
35
|
+
|
36
|
+
should "still have an RDiscount object but not the same object" do
|
37
|
+
assert_kind_of RDiscount, @post.body
|
38
|
+
assert_not_same @post.body, @old_body
|
39
|
+
end
|
40
|
+
|
41
|
+
should "return correct text for `to_s`" do
|
42
|
+
assert_equal "`@count = 20`", @post.body.to_s
|
43
|
+
end
|
44
|
+
|
45
|
+
should "return correct HTML for the `to_html` method" do
|
46
|
+
assert_match(/<code>\s*\@count\s\=\s20\s*<\/code>/, @post.body.to_html)
|
47
|
+
end
|
48
|
+
|
49
|
+
teardown do
|
50
|
+
@old_body = nil
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
30
54
|
teardown do
|
31
55
|
@post = nil
|
32
56
|
Post.delete_all
|
@@ -54,6 +78,30 @@ class ActsAsMarkdownTest < Test::Unit::TestCase
|
|
54
78
|
assert_match(/<h2>\s*Markdown Test Text\s*<\/h2>/, @post.body.to_html)
|
55
79
|
end
|
56
80
|
|
81
|
+
context "changing value of markdown field should return new markdown object" do
|
82
|
+
setup do
|
83
|
+
@old_body = @post.body
|
84
|
+
@post.body = "`@count = 20`"
|
85
|
+
end
|
86
|
+
|
87
|
+
should "still have an PEGMarkdown object but not the same object" do
|
88
|
+
assert_kind_of PEGMarkdown, @post.body
|
89
|
+
assert_not_same @post.body, @old_body
|
90
|
+
end
|
91
|
+
|
92
|
+
should "return correct text for `to_s`" do
|
93
|
+
assert_equal "`@count = 20`", @post.body.to_s
|
94
|
+
end
|
95
|
+
|
96
|
+
should "return correct HTML for the `to_html` method" do
|
97
|
+
assert_match(/<code>\s*\@count\s\=\s20\s*<\/code>/, @post.body.to_html)
|
98
|
+
end
|
99
|
+
|
100
|
+
teardown do
|
101
|
+
@old_body = nil
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
57
105
|
teardown do
|
58
106
|
@post = nil
|
59
107
|
Post.delete_all
|
@@ -81,6 +129,30 @@ class ActsAsMarkdownTest < Test::Unit::TestCase
|
|
81
129
|
assert_match(/<h2>\s*Markdown Test Text\s*<\/h2>/, @post.body.to_html)
|
82
130
|
end
|
83
131
|
|
132
|
+
context "changing value of markdown field should return new markdown object" do
|
133
|
+
setup do
|
134
|
+
@old_body = @post.body
|
135
|
+
@post.body = "`@count = 20`"
|
136
|
+
end
|
137
|
+
|
138
|
+
should "still have an BlueCloth object but not the same object" do
|
139
|
+
assert_kind_of BlueCloth, @post.body
|
140
|
+
assert_not_same @post.body, @old_body
|
141
|
+
end
|
142
|
+
|
143
|
+
should "return correct text for `to_s`" do
|
144
|
+
assert_equal "`@count = 20`", @post.body.to_s
|
145
|
+
end
|
146
|
+
|
147
|
+
should "return correct HTML for the `to_html` method" do
|
148
|
+
assert_match(/<code>\s*\@count\s\=\s20\s*<\/code>/, @post.body.to_html)
|
149
|
+
end
|
150
|
+
|
151
|
+
teardown do
|
152
|
+
@old_body = nil
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
84
156
|
teardown do
|
85
157
|
@post = nil
|
86
158
|
Post.delete_all
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Landau
|
@@ -9,10 +9,39 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-05 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activesupport
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.1.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activerecord
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.1.0
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rdiscount
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.2.7
|
44
|
+
version:
|
16
45
|
description: Represent ActiveRecord markdown text columns as Markdown objects using various external libraries to convert to HTML.
|
17
46
|
email: brian.landau@viget.com
|
18
47
|
executables: []
|