org-ruby 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.bnsignore +18 -0
  2. data/History.txt +40 -32
  3. data/README.txt +66 -66
  4. data/Rakefile +27 -26
  5. data/bin/org-ruby +40 -40
  6. data/lib/org-ruby.rb +50 -50
  7. data/lib/org-ruby/headline.rb +80 -75
  8. data/lib/org-ruby/html_output_buffer.rb +105 -81
  9. data/lib/org-ruby/line.rb +173 -173
  10. data/lib/org-ruby/output_buffer.rb +172 -154
  11. data/lib/org-ruby/parser.rb +80 -76
  12. data/lib/org-ruby/regexp_helper.rb +156 -156
  13. data/lib/org-ruby/textile_output_buffer.rb +67 -67
  14. data/spec/data/freeform.org +111 -111
  15. data/spec/data/hyp-planning.org +335 -335
  16. data/spec/data/remember.org +53 -53
  17. data/spec/headline_spec.rb +55 -55
  18. data/spec/html_examples/advanced-lists.html +31 -0
  19. data/spec/html_examples/advanced-lists.org +31 -0
  20. data/spec/html_examples/block_code.html +30 -30
  21. data/spec/html_examples/block_code.org +35 -35
  22. data/spec/html_examples/blockquote.html +7 -7
  23. data/spec/html_examples/blockquote.org +13 -13
  24. data/spec/html_examples/escape-pre.html +7 -7
  25. data/spec/html_examples/escape-pre.org +6 -6
  26. data/spec/html_examples/inline-formatting.html +10 -10
  27. data/spec/html_examples/inline-formatting.org +17 -17
  28. data/spec/html_examples/lists.html +19 -19
  29. data/spec/html_examples/lists.org +36 -36
  30. data/spec/html_examples/only-list.html +5 -5
  31. data/spec/html_examples/only-list.org +3 -3
  32. data/spec/html_examples/only-table.html +6 -6
  33. data/spec/html_examples/only-table.org +5 -5
  34. data/spec/html_examples/tables.html +20 -20
  35. data/spec/html_examples/tables.org +26 -26
  36. data/spec/html_examples/text.html +2 -2
  37. data/spec/html_examples/text.org +16 -16
  38. data/spec/line_spec.rb +89 -89
  39. data/spec/parser_spec.rb +86 -86
  40. data/spec/regexp_helper_spec.rb +57 -57
  41. data/spec/spec_helper.rb +20 -20
  42. data/spec/textile_examples/block_code.org +35 -35
  43. data/spec/textile_examples/block_code.textile +29 -29
  44. data/spec/textile_examples/blockquote.org +13 -13
  45. data/spec/textile_examples/blockquote.textile +11 -11
  46. data/spec/textile_examples/keywords.org +13 -13
  47. data/spec/textile_examples/keywords.textile +11 -11
  48. data/spec/textile_examples/links.org +11 -11
  49. data/spec/textile_examples/links.textile +10 -10
  50. data/spec/textile_examples/lists.org +36 -36
  51. data/spec/textile_examples/lists.textile +20 -20
  52. data/spec/textile_examples/single-space-plain-list.org +13 -13
  53. data/spec/textile_examples/single-space-plain-list.textile +10 -10
  54. data/spec/textile_examples/tables.org +26 -26
  55. data/spec/textile_examples/tables.textile +23 -23
  56. data/spec/textile_output_buffer_spec.rb +21 -21
  57. data/tasks/test_case.rake +49 -49
  58. metadata +5 -2
data/tasks/test_case.rake CHANGED
@@ -1,49 +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
-
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dewey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-27 00:00:00 -08:00
12
+ date: 2009-12-28 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ extra_rdoc_files:
47
47
  - README.txt
48
48
  - bin/org-ruby
49
49
  files:
50
+ - .bnsignore
50
51
  - History.txt
51
52
  - README.txt
52
53
  - Rakefile
@@ -64,6 +65,8 @@ files:
64
65
  - spec/data/hyp-planning.org
65
66
  - spec/data/remember.org
66
67
  - spec/headline_spec.rb
68
+ - spec/html_examples/advanced-lists.html
69
+ - spec/html_examples/advanced-lists.org
67
70
  - spec/html_examples/block_code.html
68
71
  - spec/html_examples/block_code.org
69
72
  - spec/html_examples/blockquote.html