wallyqs-org-ruby 0.6.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/History.txt +41 -11
  2. data/README.rdoc +55 -50
  3. data/bin/org-ruby +11 -5
  4. data/lib/org-ruby.rb +20 -27
  5. data/lib/org-ruby/headline.rb +0 -10
  6. data/lib/org-ruby/html_output_buffer.rb +224 -143
  7. data/lib/org-ruby/html_symbol_replace.rb +359 -340
  8. data/lib/org-ruby/line.rb +91 -30
  9. data/lib/org-ruby/output_buffer.rb +147 -139
  10. data/lib/org-ruby/parser.rb +45 -111
  11. data/lib/org-ruby/regexp_helper.rb +52 -57
  12. data/lib/org-ruby/textile_output_buffer.rb +90 -37
  13. data/lib/org-ruby/textile_symbol_replace.rb +360 -341
  14. metadata +39 -200
  15. data/.bnsignore +0 -18
  16. data/.gitignore +0 -2
  17. data/Gemfile +0 -7
  18. data/Gemfile.lock +0 -36
  19. data/Rakefile +0 -33
  20. data/TAGS +0 -167
  21. data/announcement.txt +0 -24
  22. data/org-ruby.gemspec +0 -40
  23. data/spec/data/freeform-example.org +0 -113
  24. data/spec/data/freeform.org +0 -111
  25. data/spec/data/hyp-planning.org +0 -335
  26. data/spec/data/remember.org +0 -53
  27. data/spec/headline_spec.rb +0 -65
  28. data/spec/html_examples/advanced-code.html +0 -81
  29. data/spec/html_examples/advanced-code.org +0 -106
  30. data/spec/html_examples/advanced-lists.html +0 -31
  31. data/spec/html_examples/advanced-lists.org +0 -31
  32. data/spec/html_examples/block_code.html +0 -28
  33. data/spec/html_examples/block_code.org +0 -35
  34. data/spec/html_examples/blockcomment.html +0 -3
  35. data/spec/html_examples/blockcomment.org +0 -15
  36. data/spec/html_examples/blockquote.html +0 -7
  37. data/spec/html_examples/blockquote.org +0 -13
  38. data/spec/html_examples/center.html +0 -6
  39. data/spec/html_examples/center.org +0 -7
  40. data/spec/html_examples/code-comment.html +0 -18
  41. data/spec/html_examples/code-comment.org +0 -22
  42. data/spec/html_examples/code-syntax.html +0 -98
  43. data/spec/html_examples/code-syntax.org +0 -99
  44. data/spec/html_examples/comment-trees.html +0 -4
  45. data/spec/html_examples/comment-trees.org +0 -13
  46. data/spec/html_examples/custom-seq-todo.html +0 -15
  47. data/spec/html_examples/custom-seq-todo.org +0 -24
  48. data/spec/html_examples/custom-todo.html +0 -15
  49. data/spec/html_examples/custom-todo.org +0 -24
  50. data/spec/html_examples/custom-typ-todo.html +0 -15
  51. data/spec/html_examples/custom-typ-todo.org +0 -24
  52. data/spec/html_examples/deflist.html +0 -6
  53. data/spec/html_examples/deflist.org +0 -6
  54. data/spec/html_examples/entities.html +0 -4
  55. data/spec/html_examples/entities.org +0 -11
  56. data/spec/html_examples/escape-pre.html +0 -6
  57. data/spec/html_examples/escape-pre.org +0 -6
  58. data/spec/html_examples/export-exclude-only.html +0 -13
  59. data/spec/html_examples/export-exclude-only.org +0 -81
  60. data/spec/html_examples/export-keywords.html +0 -4
  61. data/spec/html_examples/export-keywords.org +0 -18
  62. data/spec/html_examples/export-tags.html +0 -8
  63. data/spec/html_examples/export-tags.org +0 -82
  64. data/spec/html_examples/export-title.html +0 -2
  65. data/spec/html_examples/export-title.org +0 -4
  66. data/spec/html_examples/footnotes.html +0 -10
  67. data/spec/html_examples/footnotes.org +0 -7
  68. data/spec/html_examples/html-literal.html +0 -2
  69. data/spec/html_examples/html-literal.org +0 -6
  70. data/spec/html_examples/inline-formatting.html +0 -20
  71. data/spec/html_examples/inline-formatting.org +0 -33
  72. data/spec/html_examples/inline-images.html +0 -10
  73. data/spec/html_examples/inline-images.org +0 -15
  74. data/spec/html_examples/link-features.html +0 -8
  75. data/spec/html_examples/link-features.org +0 -19
  76. data/spec/html_examples/lists.html +0 -23
  77. data/spec/html_examples/lists.org +0 -47
  78. data/spec/html_examples/metadata-comment.html +0 -27
  79. data/spec/html_examples/metadata-comment.org +0 -30
  80. data/spec/html_examples/only-list.html +0 -5
  81. data/spec/html_examples/only-list.org +0 -3
  82. data/spec/html_examples/only-table.html +0 -6
  83. data/spec/html_examples/only-table.org +0 -5
  84. data/spec/html_examples/skip-header.html +0 -3
  85. data/spec/html_examples/skip-header.org +0 -28
  86. data/spec/html_examples/skip-table.html +0 -4
  87. data/spec/html_examples/skip-table.org +0 -19
  88. data/spec/html_examples/subsupscript-nil.html +0 -3
  89. data/spec/html_examples/subsupscript-nil.org +0 -6
  90. data/spec/html_examples/subsupscript.html +0 -3
  91. data/spec/html_examples/subsupscript.org +0 -5
  92. data/spec/html_examples/tables.html +0 -35
  93. data/spec/html_examples/tables.org +0 -50
  94. data/spec/html_examples/text.html +0 -2
  95. data/spec/html_examples/text.org +0 -16
  96. data/spec/line_spec.rb +0 -155
  97. data/spec/output_buffer_spec.rb +0 -19
  98. data/spec/parser_spec.rb +0 -152
  99. data/spec/regexp_helper_spec.rb +0 -57
  100. data/spec/spec_helper.rb +0 -20
  101. data/spec/textile_examples/block_code.org +0 -35
  102. data/spec/textile_examples/block_code.textile +0 -29
  103. data/spec/textile_examples/blockquote.org +0 -13
  104. data/spec/textile_examples/blockquote.textile +0 -11
  105. data/spec/textile_examples/center.org +0 -7
  106. data/spec/textile_examples/center.textile +0 -6
  107. data/spec/textile_examples/footnotes.org +0 -7
  108. data/spec/textile_examples/footnotes.textile +0 -8
  109. data/spec/textile_examples/keywords.org +0 -13
  110. data/spec/textile_examples/keywords.textile +0 -11
  111. data/spec/textile_examples/links.org +0 -11
  112. data/spec/textile_examples/links.textile +0 -10
  113. data/spec/textile_examples/lists.org +0 -36
  114. data/spec/textile_examples/lists.textile +0 -20
  115. data/spec/textile_examples/single-space-plain-list.org +0 -13
  116. data/spec/textile_examples/single-space-plain-list.textile +0 -10
  117. data/spec/textile_examples/tables.org +0 -50
  118. data/spec/textile_examples/tables.textile +0 -40
  119. data/spec/textile_output_buffer_spec.rb +0 -21
  120. data/tasks/test_case.rake +0 -49
  121. data/test/test_orgmode_parser.rb +0 -0
  122. data/util/gen-special-replace.el +0 -37
@@ -1,27 +0,0 @@
1
- <h1 class="title">Metadata, etc.</h1>
2
- <p>I normally filter out things that look like metadata. Can&#8217;t do it any more. I need to see all of the following:</p>
3
- <pre class="example">
4
- * DONE Handle inline formatting
5
- CLOSED: [2009-12-26 Sat 21:41]
6
- :PROPERTIES:
7
- :ARCHIVE_TIME: 2009-12-26 Sat 22:16
8
- :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
9
- :ARCHIVE_OLPATH: &lt;%= @page.title %&gt;/Future Development
10
- :ARCHIVE_CATEGORY: orgmode_parser
11
- :ARCHIVE_TODO: DONE
12
- :END:
13
-
14
- I still need to handle:
15
-
16
- - [ ] =Inline code=
17
-
18
- How does the =emacs= HTML parser handle *inline* formatting? Ah,
19
- it looks like it defines everything in =org-emphasis-alist= (line
20
- 2855 of =org.el=).
21
-
22
- And then look at =org-emphasis-regexp-components=, line 2828 of
23
- =org.el=. It looks like they just use a crazy regexp for inline
24
- formatting. Which is good, because it means I can copy!
25
-
26
-
27
- </pre>
@@ -1,30 +0,0 @@
1
- * Metadata, etc.
2
-
3
- I normally filter out things that look like metadata. Can't do it any
4
- more. I need to see all of the following:
5
-
6
- #+BEGIN_EXAMPLE
7
- * DONE Handle inline formatting
8
- CLOSED: [2009-12-26 Sat 21:41]
9
- :PROPERTIES:
10
- :ARCHIVE_TIME: 2009-12-26 Sat 22:16
11
- :ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
12
- :ARCHIVE_OLPATH: <%= @page.title %>/Future Development
13
- :ARCHIVE_CATEGORY: orgmode_parser
14
- :ARCHIVE_TODO: DONE
15
- :END:
16
-
17
- I still need to handle:
18
-
19
- - [ ] =Inline code=
20
-
21
- How does the =emacs= HTML parser handle *inline* formatting? Ah,
22
- it looks like it defines everything in =org-emphasis-alist= (line
23
- 2855 of =org.el=).
24
-
25
- And then look at =org-emphasis-regexp-components=, line 2828 of
26
- =org.el=. It looks like they just use a crazy regexp for inline
27
- formatting. Which is good, because it means I can copy!
28
-
29
-
30
- #+END_EXAMPLE
@@ -1,5 +0,0 @@
1
- <ul>
2
- <li>This file has only a list</li>
3
- <li>Note it will end with nothing other than a list item.</li>
4
- <li>the world wants to know: Will org-ruby write the closing ul tag?</li>
5
- </ul>
@@ -1,3 +0,0 @@
1
- - This file has only a list
2
- - Note it will end with nothing other than a list item.
3
- - the world wants to know: Will org-ruby write the closing ul tag?
@@ -1,6 +0,0 @@
1
- <table>
2
- <tr><th>One</th><th>Two</th><th>Three</th><th>Four</th></tr>
3
- <tr><td>Five</td><td>Six</td><td>Seven</td><td>Eight</td></tr>
4
- <tr><td>Nine</td><td>Ten</td><td>Eleven</td><td>Twelve</td></tr>
5
- <tr><td><b>format</b></td><td><i>text</i></td><td><code>in</code></td><td><span style="text-decoration:underline;">cells</span></td></tr>
6
- </table>
@@ -1,5 +0,0 @@
1
- | One | Two | Three | Four |
2
- |----------+--------+--------+---------|
3
- | Five | Six | Seven | Eight |
4
- | Nine | Ten | Eleven | Twelve |
5
- | *format* | /text/ | ~in~ | _cells_ |
@@ -1,3 +0,0 @@
1
- <p class="title">skip-header.org</p>
2
- <h1><span class="heading-number heading-number-1">1 </span>First heading</h1>
3
- <p>This should be the first text in the output.</p>
@@ -1,28 +0,0 @@
1
- #+TITLE: skip-header.org
2
- #+AUTHOR:
3
- #+EMAIL: brian@BRIAN-DESK
4
- #+DATE: 2009-12-29 Tue
5
- #+DESCRIPTION:
6
- #+KEYWORDS:
7
- #+LANGUAGE: en
8
- #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
9
- #+OPTIONS: TeX:t LaTeX:nil skip:t d:nil todo:t pri:nil tags:not-in-toc
10
- #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
11
- #+EXPORT_SELECT_TAGS: export
12
- #+EXPORT_EXCLUDE_TAGS: noexport
13
- #+LINK_UP:
14
- #+LINK_HOME:
15
- This is header text.
16
- It exists in the org-file, but shouldn't show up in the HTML output.
17
-
18
- - Same with this list
19
- - Nope, shouldn't be in the output.
20
-
21
- #+BEGIN_EXAMPLE
22
- Even this code snippet shouldn't be there.
23
- Like a ninja. You can't see me.
24
- #+END_EXAMPLE
25
-
26
- * First heading
27
-
28
- This should be the first text in the output.
@@ -1,4 +0,0 @@
1
- <p class="title">skip-table.org</p>
2
- <p>Checking that tables are skipped when directed.</p>
3
- <p>For grins, here&#8217;s another table without a header. Just keep the bases covered.</p>
4
- <p>Again, in the HTML output, you should see <b>no tables</b>.</p>
@@ -1,19 +0,0 @@
1
- #+TITLE: skip-table.org
2
- #+OPTIONS: |:nil
3
-
4
- Checking that tables are skipped when directed.
5
-
6
- | One | Two | Three |
7
- |-------+-------+-------|
8
- | Four | Five | Six |
9
- | Seven | Eight | Nine |
10
-
11
-
12
- For grins, here's another table without a header. Just keep the bases
13
- covered.
14
-
15
- | One | Two | Three |
16
- | Four | Five | Six |
17
- | Seven | Eight | Nine |
18
-
19
- Again, in the HTML output, you should see *no tables*.
@@ -1,3 +0,0 @@
1
- <p class="title">SUBSUPSCRIPT</p>
2
- <p>a^{b}</p>
3
- <p>a_{b}</p>
@@ -1,6 +0,0 @@
1
- #+OPTIONS: ^:nil
2
- SUBSUPSCRIPT
3
-
4
- a^{b}
5
-
6
- a_{b}
@@ -1,3 +0,0 @@
1
- <p class="title">SUBSUPSCRIPT</p>
2
- <p>a<sup>b</sup></p>
3
- <p>a<sub>b</sub></p>
@@ -1,5 +0,0 @@
1
- SUBSUPSCRIPT
2
-
3
- a^{b}
4
-
5
- a_{b}
@@ -1,35 +0,0 @@
1
- <p class="title">TABLES</p>
2
- <p>Different types of ORG tables.</p>
3
- <h1>Simple table, no header.</h1>
4
- <table>
5
- <tr><td>Cell one</td><td>Cell two</td></tr>
6
- <tr><td>Cell three</td><td>Cell four</td></tr>
7
- </table>
8
- <h1>Indented table</h1>
9
- <table>
10
- <tr><td>Cell one</td></tr>
11
- <tr><td>Cell two</td></tr>
12
- </table>
13
- <p>And here&#8217;s some paragraph content. The line breaks will need to get removed here, but not for the tables.</p>
14
- <h1>Table with header</h1>
15
- <table>
16
- <tr><th>One</th><th>Two</th><th>Three</th></tr>
17
- <tr><td>Four</td><td>Five</td><td>Six</td></tr>
18
- <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
19
- </table>
20
- <p>The separator row should not get printed out.</p>
21
- <h1>Table with complete box</h1>
22
- <table>
23
- <tr><th>One</th><th>Two</th><th>Three</th></tr>
24
- <tr><td>Four</td><td>Five</td><td>Six</td></tr>
25
- <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
26
- </table>
27
- <p>Only the first row should be a header row.</p>
28
- <h1>Table with extra lines</h1>
29
- <table>
30
- <tr><th>One</th><th>Two</th><th>Three</th></tr>
31
- <tr><td>Four</td><td>Five</td><td>Six</td></tr>
32
- <tr><td>Seven</td><td>Eight</td><td>Nine</td></tr>
33
- <tr><td>Ten</td><td>Eleven</td><td>Twelve</td></tr>
34
- </table>
35
- <p>Only the first row should be a header row.</p>
@@ -1,50 +0,0 @@
1
- TABLES
2
-
3
- Different types of ORG tables.
4
-
5
- * Simple table, no header.
6
-
7
- | Cell one | Cell two |
8
- | Cell three | Cell four |
9
-
10
-
11
- * Indented table
12
-
13
- | Cell one |
14
- | Cell two |
15
-
16
- And here's some paragraph content. The line breaks will need to get
17
- removed here, but not for the tables.
18
-
19
- * Table with header
20
-
21
- | One | Two | Three |
22
- |-------+-------+-------|
23
- | Four | Five | Six |
24
- | Seven | Eight | Nine |
25
-
26
- The separator row should not get printed out.
27
-
28
- * Table with complete box
29
-
30
- |-------+-------+-------|
31
- | One | Two | Three |
32
- |-------+-------+-------|
33
- | Four | Five | Six |
34
- | Seven | Eight | Nine |
35
- |-------+-------+-------|
36
-
37
- Only the first row should be a header row.
38
-
39
- * Table with extra lines
40
-
41
- |-------+--------+--------|
42
- | One | Two | Three |
43
- |-------+--------+--------|
44
- | Four | Five | Six |
45
- | Seven | Eight | Nine |
46
- |-------+--------+--------|
47
- | Ten | Eleven | Twelve |
48
- |-------+--------+--------|
49
-
50
- Only the first row should be a header row.
@@ -1,2 +0,0 @@
1
- <p class="title">The simplest case: translating plain text.</p>
2
- <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
@@ -1,16 +0,0 @@
1
- The simplest case: translating plain text.
2
-
3
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
4
- nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
5
- sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
6
- rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
7
- ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur
8
- sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
9
- dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
10
- et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
11
- takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
12
- amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
13
- invidunt ut labore et dolore magna aliquyam erat, sed diam
14
- voluptua. At vero eos et accusam et justo duo dolores et ea
15
- rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
16
- ipsum dolor sit amet.
@@ -1,155 +0,0 @@
1
- require File.join(File.dirname(__FILE__), %w[spec_helper])
2
-
3
- describe Orgmode::Line do
4
-
5
- it "should tell comments" do
6
- comments = ["# hello", "#hello" ]
7
- comments.each do |c|
8
- line = Orgmode::Line.new c
9
- line.comment?.should be_true
10
- end
11
-
12
- not_comments = ["", "\n", "hello\n", " foo ### bar\n"]
13
- not_comments.each do |c|
14
- line = Orgmode::Line.new c
15
- line.comment?.should_not be_true
16
- end
17
- end
18
-
19
- it "should tell blank lines" do
20
- blank = ["", " ", "\t", "\n", " \t\t\n\n"]
21
- blank.each do |b|
22
- line = Orgmode::Line.new b
23
- line.blank?.should be_true
24
- end
25
- end
26
-
27
- [": inline", " : inline", "\t\t:\tinline"].each do |inline_example|
28
- it "should recognize this inline example: #{inline_example}" do
29
- Orgmode::Line.new(inline_example).inline_example?.should be_true
30
- end
31
- end
32
-
33
- list_formats = ["- ",
34
- "+ ",
35
- " - ",
36
- " + ",
37
- " 1. ",
38
- " 2) "]
39
- list_formats.each do |list|
40
- it "should recognize this list format: '#{list}'" do
41
- line = Orgmode::Line.new list
42
- line.plain_list?.should be_true
43
- end
44
- end
45
-
46
- ["-foo", "+foo", "1.foo", "2.foo"].each do |invalid_list|
47
- it "should not recognize this invalid list: '#{invalid_list}'" do
48
- line = Orgmode::Line.new invalid_list
49
- line.plain_list?.should_not be_true
50
- end
51
- end
52
-
53
- it "should recognize table rows" do
54
- Orgmode::Line.new("| One | Two | Three |").table_row?.should be_true
55
- Orgmode::Line.new(" |-------+-------+-------|\n").table_separator?.should be_true
56
- Orgmode::Line.new("| Four | Five | Six |").table_row?.should be_true
57
- Orgmode::Line.new("| Seven | Eight | Nine |").table_row?.should be_true
58
- end
59
-
60
- it "should recognize indentation" do
61
- Orgmode::Line.new("").indent.should eql(0)
62
- Orgmode::Line.new(" a").indent.should eql(1)
63
- Orgmode::Line.new(" ").indent.should eql(0)
64
- Orgmode::Line.new(" \n").indent.should eql(0)
65
- Orgmode::Line.new(" a").indent.should eql(3)
66
- end
67
-
68
- it "should return paragraph type" do
69
- Orgmode::Line.new("").paragraph_type.should eql(:blank)
70
- Orgmode::Line.new("1. foo").paragraph_type.should eql(:ordered_list)
71
- Orgmode::Line.new("- [ ] checkbox").paragraph_type.should eql(:unordered_list)
72
- Orgmode::Line.new("hello!").paragraph_type.should eql(:paragraph)
73
- end
74
-
75
- it "should recognize BEGIN and END comments" do
76
- begin_examples = {
77
- "#+BEGIN_SRC emacs-lisp -n -r\n" => "SRC",
78
- "#+BEGIN_EXAMPLE" => "EXAMPLE",
79
- "\t#+BEGIN_QUOTE " => "QUOTE"
80
- }
81
-
82
- end_examples = {
83
- "#+END_SRC" => "SRC",
84
- "#+END_EXAMPLE" => "EXAMPLE",
85
- "\t#+END_QUOTE " => "QUOTE"
86
- }
87
-
88
- begin_examples.each_key do |str|
89
- line = Orgmode::Line.new str
90
- line.begin_block?.should be_true
91
- line.block_type.should eql(begin_examples[str])
92
- end
93
-
94
- end_examples.each_key do |str|
95
- line = Orgmode::Line.new str
96
- line.end_block?.should be_true
97
- line.block_type.should eql(end_examples[str])
98
- end
99
- end
100
-
101
- it "should accept assigned types" do
102
- cases = {
103
- "# this looks like a comment" => :comment,
104
- " 1. This looks like an ordered list" => :ordered_list,
105
- " - this looks like an # unordered list" => :unordered_list,
106
- " | one | two | table! | \n" => :table_row,
107
- "\n" => :blank,
108
- " |-----+-----+--------| \n" => :table_separator
109
- }
110
-
111
- cases.each_pair do |key, value|
112
- l = Orgmode::Line.new key
113
- l.paragraph_type.should eql(value)
114
- l.assigned_paragraph_type = :paragraph
115
- l.paragraph_type.should eql(:paragraph)
116
- l.assigned_paragraph_type = nil
117
- l.paragraph_type.should eql(value)
118
- end
119
- end
120
-
121
- it "should parse in-buffer settings" do
122
- cases = {
123
- "#+ARCHIVE: %s_done" => { :key => "ARCHIVE", :value => "%s_done" },
124
- "#+CATEGORY: foo" => { :key => "CATEGORY", :value => "foo"},
125
- "#+BEGIN_EXAMPLE:" => { :key => "BEGIN_EXAMPLE", :value => "" },
126
- "#+A:" => { :key => "A", :value => "" } # Boundary: Smallest keyword is one letter
127
- }
128
- cases.each_pair do |key, value|
129
- l = Orgmode::Line.new key
130
- l.in_buffer_setting?.should be_true
131
- called = nil
132
- l.in_buffer_setting? do |k, v|
133
- k.should eql(value[:key])
134
- v.should eql(value[:value])
135
- called = true
136
- end
137
- called.should be_true
138
- end
139
- end
140
-
141
- it "should reject ill-formed settings" do
142
- cases = [
143
- "##+ARCHIVE: blah",
144
- "#CATEGORY: foo",
145
- "",
146
- "\n",
147
- " #+BEGIN_EXAMPLE:\n"
148
- ]
149
-
150
- cases.each do |c|
151
- l = Orgmode::Line.new c
152
- l.in_buffer_setting?.should be_nil
153
- end
154
- end
155
- end
@@ -1,19 +0,0 @@
1
- require File.join(File.dirname(__FILE__), %w[spec_helper])
2
-
3
- describe Orgmode::OutputBuffer do
4
-
5
- it "computes outline level numbering" do
6
- output_buffer = Orgmode::OutputBuffer.new ""
7
- output_buffer.get_next_headline_number(1).should eql("1")
8
- output_buffer.get_next_headline_number(1).should eql("2")
9
- output_buffer.get_next_headline_number(1).should eql("3")
10
- output_buffer.get_next_headline_number(1).should eql("4")
11
- output_buffer.get_next_headline_number(2).should eql("4.1")
12
- output_buffer.get_next_headline_number(2).should eql("4.2")
13
- output_buffer.get_next_headline_number(1).should eql("5")
14
- output_buffer.get_next_headline_number(2).should eql("5.1")
15
- output_buffer.get_next_headline_number(2).should eql("5.2")
16
- output_buffer.get_next_headline_number(4).should eql("5.2.0.1")
17
- end
18
-
19
- end