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.
Files changed (56) hide show
  1. data/History.txt +32 -24
  2. data/README.txt +66 -66
  3. data/Rakefile +26 -22
  4. data/bin/org-ruby +40 -40
  5. data/lib/org-ruby.rb +50 -48
  6. data/lib/org-ruby/headline.rb +75 -75
  7. data/lib/org-ruby/html_output_buffer.rb +81 -80
  8. data/lib/org-ruby/line.rb +173 -172
  9. data/lib/org-ruby/output_buffer.rb +154 -154
  10. data/lib/org-ruby/parser.rb +76 -72
  11. data/lib/org-ruby/regexp_helper.rb +156 -156
  12. data/lib/org-ruby/textile_output_buffer.rb +67 -67
  13. data/spec/data/freeform.org +111 -111
  14. data/spec/data/hyp-planning.org +335 -335
  15. data/spec/data/remember.org +53 -53
  16. data/spec/headline_spec.rb +55 -55
  17. data/spec/html_examples/block_code.html +30 -29
  18. data/spec/html_examples/block_code.org +35 -35
  19. data/spec/html_examples/blockquote.html +7 -7
  20. data/spec/html_examples/blockquote.org +13 -13
  21. data/spec/html_examples/escape-pre.html +7 -0
  22. data/spec/html_examples/escape-pre.org +6 -0
  23. data/spec/html_examples/inline-formatting.html +10 -10
  24. data/spec/html_examples/inline-formatting.org +17 -17
  25. data/spec/html_examples/lists.html +19 -19
  26. data/spec/html_examples/lists.org +36 -36
  27. data/spec/html_examples/only-list.html +5 -0
  28. data/spec/html_examples/only-list.org +3 -0
  29. data/spec/html_examples/only-table.html +6 -0
  30. data/spec/html_examples/only-table.org +5 -0
  31. data/spec/html_examples/tables.html +20 -20
  32. data/spec/html_examples/tables.org +26 -26
  33. data/spec/html_examples/text.html +2 -2
  34. data/spec/html_examples/text.org +16 -16
  35. data/spec/line_spec.rb +89 -89
  36. data/spec/parser_spec.rb +86 -86
  37. data/spec/regexp_helper_spec.rb +57 -57
  38. data/spec/spec_helper.rb +20 -20
  39. data/spec/textile_examples/block_code.org +35 -35
  40. data/spec/textile_examples/block_code.textile +29 -29
  41. data/spec/textile_examples/blockquote.org +13 -13
  42. data/spec/textile_examples/blockquote.textile +11 -11
  43. data/spec/textile_examples/keywords.org +13 -13
  44. data/spec/textile_examples/keywords.textile +11 -11
  45. data/spec/textile_examples/links.org +11 -11
  46. data/spec/textile_examples/links.textile +10 -10
  47. data/spec/textile_examples/lists.org +36 -36
  48. data/spec/textile_examples/lists.textile +20 -20
  49. data/spec/textile_examples/single-space-plain-list.org +13 -13
  50. data/spec/textile_examples/single-space-plain-list.textile +10 -10
  51. data/spec/textile_examples/tables.org +26 -26
  52. data/spec/textile_examples/tables.textile +23 -23
  53. data/spec/textile_output_buffer_spec.rb +21 -21
  54. data/tasks/test_case.rake +49 -0
  55. metadata +21 -5
  56. data/.bnsignore +0 -18
@@ -1,53 +1,53 @@
1
- * New Ideas
2
- ** YAML header in Webby
3
-
4
- Make sure you don't have TABS here. Best practice: Configure your
5
- editor to use spaces instaed of tabs, and if you can see whitespace,
6
- even better.
7
-
8
- In emacs, set indent-tabs-mode to NIL.
9
- ** Ruby Gems behind Proxy
10
-
11
- Set the following environment variable:
12
-
13
- So, I added a User Variable for my account called http_proxy with
14
- the value of http://<proxyserveraddress>:8080, rebooted, ran plan
15
- old vanillia gem install rails –include-dependencies, and magically,
16
- it worked
17
- ** Hyper-V technical info
18
-
19
- http://technet.microsoft.com/en-us/dd565807.aspx
20
- ** VirtualBox
21
-
22
- Virtualization software from Sun. Looks like it might be more for
23
- dev/test. I'm surprised this hasn't popped at
24
- all. http://www.virtualbox.org/. Backed by Sun.
25
- ** Interesting LaTeX article
26
-
27
- http://nitens.org/taraborelli/latex -- on the virtues of LaTeX
28
- ** XEmacs / Emacs internals
29
-
30
- Looks like an interesting resource if I want to learn how Emacs works.
31
-
32
- http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19
33
- ** MikTeX
34
-
35
- Get it here: http://www.miktex.org/portable/
36
- ** Orgmode publishing tutorial
37
-
38
- [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]]
39
- ** Git and Live Mesh
40
-
41
- This is really helpful:
42
- http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds
43
- ** VDI deployment stats
44
-
45
- Key takeaways:
46
- - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users
47
- - Upward of 55% of the DAC members [project] they will have up to 50% of their users using VDI in 3 years (~1/2 of those will have > 50%)
48
- - No real surprises on the reasons / benefits etc
49
- - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS
50
- - Most companies said a portion of their users would have VDI as the primary replacement desktop (60% < 20% of users, 32% 21-50% of users)
51
- ** Hyper-V Scheduler Information
52
-
53
- http://msdn.microsoft.com/en-us/library/bb969782.aspx
1
+ * New Ideas
2
+ ** YAML header in Webby
3
+
4
+ Make sure you don't have TABS here. Best practice: Configure your
5
+ editor to use spaces instaed of tabs, and if you can see whitespace,
6
+ even better.
7
+
8
+ In emacs, set indent-tabs-mode to NIL.
9
+ ** Ruby Gems behind Proxy
10
+
11
+ Set the following environment variable:
12
+
13
+ So, I added a User Variable for my account called http_proxy with
14
+ the value of http://<proxyserveraddress>:8080, rebooted, ran plan
15
+ old vanillia gem install rails –include-dependencies, and magically,
16
+ it worked
17
+ ** Hyper-V technical info
18
+
19
+ http://technet.microsoft.com/en-us/dd565807.aspx
20
+ ** VirtualBox
21
+
22
+ Virtualization software from Sun. Looks like it might be more for
23
+ dev/test. I'm surprised this hasn't popped at
24
+ all. http://www.virtualbox.org/. Backed by Sun.
25
+ ** Interesting LaTeX article
26
+
27
+ http://nitens.org/taraborelli/latex -- on the virtues of LaTeX
28
+ ** XEmacs / Emacs internals
29
+
30
+ Looks like an interesting resource if I want to learn how Emacs works.
31
+
32
+ http://www.xemacs.org/Documentation/21.5/html/internals_9.html#SEC19
33
+ ** MikTeX
34
+
35
+ Get it here: http://www.miktex.org/portable/
36
+ ** Orgmode publishing tutorial
37
+
38
+ [[http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php][Publishing Org-mode files to HTML]]
39
+ ** Git and Live Mesh
40
+
41
+ This is really helpful:
42
+ http://whereslou.com/2009/06/04/using-live-mesh-and-git-the-best-of-both-worlds
43
+ ** VDI deployment stats
44
+
45
+ Key takeaways:
46
+ - 74% are using VDI in production or pilot ... but 45% of those using have less than 100 users
47
+ - Upward of 55% of the DAC members [project] they will have up to 50% of their users using VDI in 3 years (~1/2 of those will have > 50%)
48
+ - No real surprises on the reasons / benefits etc
49
+ - Interestingly ... even if TS supported all client apps / supported user-install apps - 100% of the DAC preferred VDI over TS
50
+ - Most companies said a portion of their users would have VDI as the primary replacement desktop (60% < 20% of users, 32% 21-50% of users)
51
+ ** Hyper-V Scheduler Information
52
+
53
+ http://msdn.microsoft.com/en-us/library/bb969782.aspx
@@ -1,55 +1,55 @@
1
-
2
- require File.join(File.dirname(__FILE__), %w[spec_helper])
3
-
4
- describe Orgmode::Headline do
5
-
6
- it "should recognize headlines that start with asterisks" do
7
- Orgmode::Headline.headline?("*** test\n").should_not be_nil
8
- end
9
-
10
- it "should reject headlines without headlines at the start" do
11
- Orgmode::Headline.headline?(" nope!").should be_nil
12
- Orgmode::Headline.headline?(" tricked you!!!***").should be_nil
13
- end
14
-
15
- it "should reject improper initialization" do
16
- lambda { Orgmode::Headline.new " tricked**" }.should raise_error
17
- end
18
-
19
- it "should properly determine headline level" do
20
- samples = ["* one", "** two", "*** three", "**** four"]
21
- expected = 1
22
- samples.each do |sample|
23
- h = Orgmode::Headline.new sample
24
- h.level.should eql(expected)
25
- expected += 1
26
- end
27
- end
28
-
29
- it "should find simple headline text" do
30
- h = Orgmode::Headline.new "*** sample"
31
- h.headline_text.should eql("sample")
32
- end
33
-
34
- it "should understand tags" do
35
- h = Orgmode::Headline.new "*** sample :tag:tag2:\n"
36
- h.headline_text.should eql("sample")
37
- h.should have(2).tags
38
- h.tags[0].should eql("tag")
39
- h.tags[1].should eql("tag2")
40
- end
41
-
42
- it "should understand a single tag" do
43
- h = Orgmode::Headline.new "*** sample :tag:\n"
44
- h.headline_text.should eql("sample")
45
- h.should have(1).tags
46
- h.tags[0].should eql("tag")
47
- end
48
-
49
- it "should understand keywords" do
50
- h = Orgmode::Headline.new "*** TODO Feed cat :home:"
51
- h.headline_text.should eql("Feed cat")
52
- h.keyword.should eql("TODO")
53
- end
54
- end
55
-
1
+
2
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
3
+
4
+ describe Orgmode::Headline do
5
+
6
+ it "should recognize headlines that start with asterisks" do
7
+ Orgmode::Headline.headline?("*** test\n").should_not be_nil
8
+ end
9
+
10
+ it "should reject headlines without headlines at the start" do
11
+ Orgmode::Headline.headline?(" nope!").should be_nil
12
+ Orgmode::Headline.headline?(" tricked you!!!***").should be_nil
13
+ end
14
+
15
+ it "should reject improper initialization" do
16
+ lambda { Orgmode::Headline.new " tricked**" }.should raise_error
17
+ end
18
+
19
+ it "should properly determine headline level" do
20
+ samples = ["* one", "** two", "*** three", "**** four"]
21
+ expected = 1
22
+ samples.each do |sample|
23
+ h = Orgmode::Headline.new sample
24
+ h.level.should eql(expected)
25
+ expected += 1
26
+ end
27
+ end
28
+
29
+ it "should find simple headline text" do
30
+ h = Orgmode::Headline.new "*** sample"
31
+ h.headline_text.should eql("sample")
32
+ end
33
+
34
+ it "should understand tags" do
35
+ h = Orgmode::Headline.new "*** sample :tag:tag2:\n"
36
+ h.headline_text.should eql("sample")
37
+ h.should have(2).tags
38
+ h.tags[0].should eql("tag")
39
+ h.tags[1].should eql("tag2")
40
+ end
41
+
42
+ it "should understand a single tag" do
43
+ h = Orgmode::Headline.new "*** sample :tag:\n"
44
+ h.headline_text.should eql("sample")
45
+ h.should have(1).tags
46
+ h.tags[0].should eql("tag")
47
+ end
48
+
49
+ it "should understand keywords" do
50
+ h = Orgmode::Headline.new "*** TODO Feed cat :home:"
51
+ h.headline_text.should eql("Feed cat")
52
+ h.keyword.should eql("TODO")
53
+ end
54
+ end
55
+
@@ -1,29 +1,30 @@
1
- <h1>Block Code</h1>
2
- <p>I need to get block code examples working. In <code>orgmode</code>, they look like this:</p>
3
- <pre>
4
-
5
-
6
- def initialize(output)
7
- @output = output
8
- @buffer = ""
9
- @output_type = :start
10
- @list_indent_stack = []
11
- @paragraph_modifier = nil
12
-
13
- @logger = Logger.new(STDERR)
14
- @logger.level = Logger::WARN
15
- end
16
-
17
- </pre>
18
- <p>And now I should be back to normal text.</p>
19
- <p>Putting in another paragraph for good measure.</p>
20
- <p>Code should also get cancelled by a list, thus:</p>
21
- <pre>
22
-
23
- This is my code!
24
-
25
- Another line!
26
- </pre>
27
- <ul>
28
- <li>My list should cancel this.</li>
29
- <li>Another list line.</li>
1
+ <h1>Block Code</h1>
2
+ <p>I need to get block code examples working. In <code>orgmode</code>, they look like this:</p>
3
+ <pre>
4
+
5
+
6
+ def initialize(output)
7
+ @output = output
8
+ @buffer = &quot;&quot;
9
+ @output_type = :start
10
+ @list_indent_stack = []
11
+ @paragraph_modifier = nil
12
+
13
+ @logger = Logger.new(STDERR)
14
+ @logger.level = Logger::WARN
15
+ end
16
+
17
+ </pre>
18
+ <p>And now I should be back to normal text.</p>
19
+ <p>Putting in another paragraph for good measure.</p>
20
+ <p>Code should also get cancelled by a list, thus:</p>
21
+ <pre>
22
+
23
+ This is my code!
24
+
25
+ Another line!
26
+ </pre>
27
+ <ul>
28
+ <li>My list should cancel this.</li>
29
+ <li>Another list line.</li>
30
+ </ul>
@@ -1,35 +1,35 @@
1
- * Block Code
2
-
3
- I need to get block code examples working. In =orgmode=, they look
4
- like this:
5
-
6
- #+BEGIN_EXAMPLE
7
-
8
- def initialize(output)
9
- @output = output
10
- @buffer = ""
11
- @output_type = :start
12
- @list_indent_stack = []
13
- @paragraph_modifier = nil
14
-
15
- @logger = Logger.new(STDERR)
16
- @logger.level = Logger::WARN
17
- end
18
-
19
- #+END_EXAMPLE
20
-
21
- And now I should be back to normal text.
22
-
23
- Putting in another paragraph for good measure.
24
-
25
-
26
- Code should also get cancelled by a list, thus:
27
-
28
- #+BEGIN_EXAMPLE
29
- This is my code!
30
-
31
- Another line!
32
- #+END_EXAMPLE
33
-
34
- - My list should cancel this.
35
- - Another list line.
1
+ * Block Code
2
+
3
+ I need to get block code examples working. In =orgmode=, they look
4
+ like this:
5
+
6
+ #+BEGIN_EXAMPLE
7
+
8
+ def initialize(output)
9
+ @output = output
10
+ @buffer = ""
11
+ @output_type = :start
12
+ @list_indent_stack = []
13
+ @paragraph_modifier = nil
14
+
15
+ @logger = Logger.new(STDERR)
16
+ @logger.level = Logger::WARN
17
+ end
18
+
19
+ #+END_EXAMPLE
20
+
21
+ And now I should be back to normal text.
22
+
23
+ Putting in another paragraph for good measure.
24
+
25
+
26
+ Code should also get cancelled by a list, thus:
27
+
28
+ #+BEGIN_EXAMPLE
29
+ This is my code!
30
+
31
+ Another line!
32
+ #+END_EXAMPLE
33
+
34
+ - My list should cancel this.
35
+ - Another list line.
@@ -1,7 +1,7 @@
1
- <p>BLOCKQUOTE</p>
2
- <p>Testing that I can have block quotes:</p>
3
- <blockquote>
4
- <p><i>Example:</i></p>
5
- <p>This is blockquote text.</p>
6
- </blockquote>
7
- <p>And now I'm back to normal text!</p>
1
+ <p>BLOCKQUOTE</p>
2
+ <p>Testing that I can have block quotes:</p>
3
+ <blockquote>
4
+ <p><i>Example:</i></p>
5
+ <p>This is blockquote text.</p>
6
+ </blockquote>
7
+ <p>And now I&#8217;m back to normal text!</p>
@@ -1,13 +1,13 @@
1
- BLOCKQUOTE
2
-
3
- Testing that I can have block quotes:
4
-
5
- #+BEGIN_QUOTE
6
-
7
- /Example:/
8
-
9
- This is blockquote text.
10
-
11
- #+END_QUOTE
12
-
13
- And now I'm back to normal text!
1
+ BLOCKQUOTE
2
+
3
+ Testing that I can have block quotes:
4
+
5
+ #+BEGIN_QUOTE
6
+
7
+ /Example:/
8
+
9
+ This is blockquote text.
10
+
11
+ #+END_QUOTE
12
+
13
+ And now I'm back to normal text!
@@ -0,0 +1,7 @@
1
+ <pre>
2
+
3
+ &lt;li&gt;[ ] &amp;#8220;smart quotes&amp;#8221;&lt;/li&gt;
4
+ &lt;li&gt;[ ] I think I need this for &amp;#8216;single quotes&amp;#8217; too. Don&amp;#8217;t I?&lt;/li&gt;
5
+ &lt;li&gt;[ ] Em dashes would be great &amp;#8212; wouldn&amp;#8217;t they?&lt;/li&gt;
6
+ &lt;li&gt;[ ] I hope to develop an en dash sometime in 2010 &amp;#8211; 2011.&lt;/li&gt;
7
+ </pre>
@@ -0,0 +1,6 @@
1
+ #+BEGIN_EXAMPLE
2
+ <li>[ ] &#8220;smart quotes&#8221;</li>
3
+ <li>[ ] I think I need this for &#8216;single quotes&#8217; too. Don&#8217;t I?</li>
4
+ <li>[ ] Em dashes would be great &#8212; wouldn&#8217;t they?</li>
5
+ <li>[ ] I hope to develop an en dash sometime in 2010 &#8211; 2011.</li>
6
+ #+END_EXAMPLE
@@ -1,10 +1,10 @@
1
- <p>Inline Formatting</p>
2
- <p>I want to make sure I handle all inline formatting. I need to handle <b>bold</b>, <i>italic</i>, <code>code</code>, <code>verbatim</code>, <span style="text-decoration:underline;">underline</span>, <del>strikethrough</del>.</p>
3
- <p>In addition, I need to make sure I can handle links. We've got simple links, like this:</p>
4
- <ul>
5
- <li><a href="http://www.bing.com">http://www.bing.com</a></li>
6
- <li><a href="http://www.google.com">http://www.google.com</a></li>
7
- <li>http://www.gmail.com</li>
8
- </ul>
9
- <p>Note the last one <b>is not</b> a link, as the source doesn't include it in double-brackets and I don't auto-recognize URLs.</p>
10
- <p>I should also handle links with <a href="http://www.xkcd.com">helpful text</a>.</p>
1
+ <p>Inline Formatting</p>
2
+ <p>I want to make sure I handle all inline formatting. I need to handle <b>bold</b>, <i>italic</i>, <code>code</code>, <code>verbatim</code>, <span style="text-decoration:underline;">underline</span>, <del>strikethrough</del>.</p>
3
+ <p>In addition, I need to make sure I can handle links. We&#8217;ve got simple links, like this:</p>
4
+ <ul>
5
+ <li><a href="http://www.bing.com">http://www.bing.com</a></li>
6
+ <li><a href="http://www.google.com">http://www.google.com</a></li>
7
+ <li>http://www.gmail.com</li>
8
+ </ul>
9
+ <p>Note the last one <b>is not</b> a link, as the source doesn&#8217;t include it in double-brackets and I don&#8217;t auto-recognize URLs.</p>
10
+ <p>I should also handle links with <a href="http://www.xkcd.com">helpful text</a>.</p>
@@ -1,17 +1,17 @@
1
- Inline Formatting
2
-
3
- I want to make sure I handle all inline formatting. I need to handle
4
- *bold*, /italic/, =code=, ~verbatim~, _underline_, +strikethrough+.
5
-
6
- In addition, I need to make sure I can handle links. We've got simple
7
- links, like this:
8
-
9
- - [[http://www.bing.com]]
10
- - [[http://www.google.com]]
11
- - http://www.gmail.com
12
-
13
- Note the last one *is not* a link, as the source doesn't include it in
14
- double-brackets and I don't auto-recognize URLs.
15
-
16
- I should also handle links with [[http://www.xkcd.com][helpful text]].
17
-
1
+ Inline Formatting
2
+
3
+ I want to make sure I handle all inline formatting. I need to handle
4
+ *bold*, /italic/, =code=, ~verbatim~, _underline_, +strikethrough+.
5
+
6
+ In addition, I need to make sure I can handle links. We've got simple
7
+ links, like this:
8
+
9
+ - [[http://www.bing.com]]
10
+ - [[http://www.google.com]]
11
+ - http://www.gmail.com
12
+
13
+ Note the last one *is not* a link, as the source doesn't include it in
14
+ double-brackets and I don't auto-recognize URLs.
15
+
16
+ I should also handle links with [[http://www.xkcd.com][helpful text]].
17
+