nate-markdown_j 0.1.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/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ major: 0
3
+ patch: 3
4
+ minor: 1
data/lib/markdown_j.rb ADDED
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + '/markdownj-1.0.2b4-0.3.0.jar'
2
+
3
+ class MarkdownJ
4
+ attr_accessor :text
5
+
6
+ def initialize(text)
7
+ @text = text
8
+ end
9
+
10
+ def to_html
11
+ com.petebevin.markdown.MarkdownProcessor.new.markdown(@text)
12
+ end
13
+ end
Binary file
@@ -0,0 +1,30 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ class MarkdownJTest < Test::Unit::TestCase
4
+ def test_should_initialize_with_a_text_value
5
+ assert_nothing_raised { MarkdownJ.new('some_text') }
6
+ end
7
+
8
+ def test_should_require_a_text_value_when_initializing
9
+ assert_raise(ArgumentError) { MarkdownJ.new }
10
+ end
11
+
12
+ def test_should_render_text_to_html
13
+ assert_equal MarkdownJ.new('This *is* **really** _very_ __interesting__').to_html,
14
+ "<p>This <em>is</em> <strong>really</strong> <em>very</em> <strong>interesting</strong></p>\n"
15
+ end
16
+
17
+ def test_should_have_text_accessible_as_an_attr_accessor
18
+ mdj = MarkdownJ.new('Original Text')
19
+ mdj.text = 'Other Text'
20
+ assert_equal mdj.text, 'Other Text'
21
+ end
22
+
23
+ def test_should_render_the_new_text_as_html_after_the_text_has_been_changed
24
+ mdj = MarkdownJ.new('_Original_ Text')
25
+ assert_equal mdj.to_html, "<p><em>Original</em> Text</p>\n"
26
+
27
+ mdj.text = 'New *Text*'
28
+ assert_equal mdj.to_html, "<p>New <em>Text</em></p>\n"
29
+ end
30
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require File.dirname(__FILE__) + '/../lib/markdown_j'
4
+
5
+ class Test::Unit::TestCase
6
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nate-markdown_j
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Nate Sutton
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-30 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: TODO
17
+ email: nate@sevenwire.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - VERSION.yml
26
+ - lib/markdown_j.rb
27
+ - lib/markdownj-1.0.2b4-0.3.0.jar
28
+ - test/markdown_j_test.rb
29
+ - test/test_helper.rb
30
+ has_rdoc: false
31
+ homepage: http://github.com/nate/markdown_j
32
+ post_install_message:
33
+ rdoc_options: []
34
+
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: "0"
42
+ version:
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: "0"
48
+ version:
49
+ requirements: []
50
+
51
+ rubyforge_project:
52
+ rubygems_version: 1.2.0
53
+ signing_key:
54
+ specification_version: 2
55
+ summary: TODO
56
+ test_files: []
57
+