org-ruby 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +32 -24
- data/README.txt +66 -66
- data/Rakefile +26 -22
- data/bin/org-ruby +40 -40
- data/lib/org-ruby.rb +50 -48
- data/lib/org-ruby/headline.rb +75 -75
- data/lib/org-ruby/html_output_buffer.rb +81 -80
- data/lib/org-ruby/line.rb +173 -172
- data/lib/org-ruby/output_buffer.rb +154 -154
- data/lib/org-ruby/parser.rb +76 -72
- data/lib/org-ruby/regexp_helper.rb +156 -156
- data/lib/org-ruby/textile_output_buffer.rb +67 -67
- data/spec/data/freeform.org +111 -111
- data/spec/data/hyp-planning.org +335 -335
- data/spec/data/remember.org +53 -53
- data/spec/headline_spec.rb +55 -55
- data/spec/html_examples/block_code.html +30 -29
- data/spec/html_examples/block_code.org +35 -35
- data/spec/html_examples/blockquote.html +7 -7
- data/spec/html_examples/blockquote.org +13 -13
- data/spec/html_examples/escape-pre.html +7 -0
- data/spec/html_examples/escape-pre.org +6 -0
- data/spec/html_examples/inline-formatting.html +10 -10
- data/spec/html_examples/inline-formatting.org +17 -17
- data/spec/html_examples/lists.html +19 -19
- data/spec/html_examples/lists.org +36 -36
- data/spec/html_examples/only-list.html +5 -0
- data/spec/html_examples/only-list.org +3 -0
- data/spec/html_examples/only-table.html +6 -0
- data/spec/html_examples/only-table.org +5 -0
- data/spec/html_examples/tables.html +20 -20
- data/spec/html_examples/tables.org +26 -26
- data/spec/html_examples/text.html +2 -2
- data/spec/html_examples/text.org +16 -16
- data/spec/line_spec.rb +89 -89
- data/spec/parser_spec.rb +86 -86
- data/spec/regexp_helper_spec.rb +57 -57
- data/spec/spec_helper.rb +20 -20
- data/spec/textile_examples/block_code.org +35 -35
- data/spec/textile_examples/block_code.textile +29 -29
- data/spec/textile_examples/blockquote.org +13 -13
- data/spec/textile_examples/blockquote.textile +11 -11
- data/spec/textile_examples/keywords.org +13 -13
- data/spec/textile_examples/keywords.textile +11 -11
- data/spec/textile_examples/links.org +11 -11
- data/spec/textile_examples/links.textile +10 -10
- data/spec/textile_examples/lists.org +36 -36
- data/spec/textile_examples/lists.textile +20 -20
- data/spec/textile_examples/single-space-plain-list.org +13 -13
- data/spec/textile_examples/single-space-plain-list.textile +10 -10
- data/spec/textile_examples/tables.org +26 -26
- data/spec/textile_examples/tables.textile +23 -23
- data/spec/textile_output_buffer_spec.rb +21 -21
- data/tasks/test_case.rake +49 -0
- metadata +21 -5
- data/.bnsignore +0 -18
@@ -0,0 +1,49 @@
|
|
1
|
+
require File.expand_path(
|
2
|
+
File.join(File.dirname(__FILE__), %w[.. lib org-ruby]))
|
3
|
+
|
4
|
+
namespace :testcase do
|
5
|
+
@data_directory = File.join(File.dirname(__FILE__), "../spec/html_examples")
|
6
|
+
|
7
|
+
desc "List all of the current HTML test cases"
|
8
|
+
task :list do
|
9
|
+
org_files = File.expand_path(File.join(@data_directory, "*.org" ))
|
10
|
+
files = Dir.glob(org_files)
|
11
|
+
files.each do |file|
|
12
|
+
puts File.basename(file, ".org")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Accept the current org-ruby output for the test case as correct"
|
17
|
+
task :accept, :case do |t, args|
|
18
|
+
basename = args[:case]
|
19
|
+
raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
|
20
|
+
fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
|
21
|
+
oname = File.expand_path(File.join(@data_directory, "#{basename}.html"))
|
22
|
+
data = IO.read(fname)
|
23
|
+
puts "=== #{fname} is: ===>>>\n\n"
|
24
|
+
puts data
|
25
|
+
puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n"
|
26
|
+
p = Orgmode::Parser.new(data)
|
27
|
+
puts p.to_html
|
28
|
+
File.open(oname, "w") do |s|
|
29
|
+
s.write(p.to_html)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Look at the current org-ruby output for a test case"
|
34
|
+
task :inspect, :case do |t, args|
|
35
|
+
basename = args[:case]
|
36
|
+
raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
|
37
|
+
fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
|
38
|
+
data = IO.read(fname)
|
39
|
+
puts "=== #{fname} is: ===>>>\n\n"
|
40
|
+
puts data
|
41
|
+
puts "\n\n=== #{fname} converts to: ===>>>\n\n"
|
42
|
+
p = Orgmode::Parser.new(data)
|
43
|
+
puts p.to_html
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
desc "Alias for testcase:list"
|
48
|
+
task :testcase => ["testcase:list"]
|
49
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: org-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Dewey
|
@@ -9,9 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-12-27 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rubypants
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.2.0
|
24
|
+
version:
|
15
25
|
- !ruby/object:Gem::Dependency
|
16
26
|
name: bones
|
17
27
|
type: :development
|
@@ -37,7 +47,6 @@ extra_rdoc_files:
|
|
37
47
|
- README.txt
|
38
48
|
- bin/org-ruby
|
39
49
|
files:
|
40
|
-
- .bnsignore
|
41
50
|
- History.txt
|
42
51
|
- README.txt
|
43
52
|
- Rakefile
|
@@ -59,10 +68,16 @@ files:
|
|
59
68
|
- spec/html_examples/block_code.org
|
60
69
|
- spec/html_examples/blockquote.html
|
61
70
|
- spec/html_examples/blockquote.org
|
71
|
+
- spec/html_examples/escape-pre.html
|
72
|
+
- spec/html_examples/escape-pre.org
|
62
73
|
- spec/html_examples/inline-formatting.html
|
63
74
|
- spec/html_examples/inline-formatting.org
|
64
75
|
- spec/html_examples/lists.html
|
65
76
|
- spec/html_examples/lists.org
|
77
|
+
- spec/html_examples/only-list.html
|
78
|
+
- spec/html_examples/only-list.org
|
79
|
+
- spec/html_examples/only-table.html
|
80
|
+
- spec/html_examples/only-table.org
|
66
81
|
- spec/html_examples/tables.html
|
67
82
|
- spec/html_examples/tables.org
|
68
83
|
- spec/html_examples/text.html
|
@@ -86,9 +101,10 @@ files:
|
|
86
101
|
- spec/textile_examples/tables.org
|
87
102
|
- spec/textile_examples/tables.textile
|
88
103
|
- spec/textile_output_buffer_spec.rb
|
104
|
+
- tasks/test_case.rake
|
89
105
|
- test/test_orgmode_parser.rb
|
90
106
|
has_rdoc: true
|
91
|
-
homepage: http://
|
107
|
+
homepage: http://github.com/bdewey/org-ruby
|
92
108
|
licenses: []
|
93
109
|
|
94
110
|
post_install_message:
|
data/.bnsignore
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# The list of files that should be ignored by Mr Bones.
|
2
|
-
# Lines that start with '#' are comments.
|
3
|
-
#
|
4
|
-
# A .gitignore file can be used instead by setting it as the ignore
|
5
|
-
# file in your Rakefile:
|
6
|
-
#
|
7
|
-
# Bones {
|
8
|
-
# ignore_file '.gitignore'
|
9
|
-
# }
|
10
|
-
#
|
11
|
-
# For a project with a C extension, the following would be a good set of
|
12
|
-
# exclude patterns (uncomment them if you want to use them):
|
13
|
-
# *.[oa]
|
14
|
-
# *~
|
15
|
-
announcement.txt
|
16
|
-
coverage
|
17
|
-
doc
|
18
|
-
pkg
|