+---
+in: |-
+
+ *** test
+
+out: |-
+ *** test
+---
+in: '*this is strong*'
+out: '
this is strong
'
+---
+in: '*this test is strong*'
+out: '
this test is strong
'
+---
+in:
__inline__
+out:
__inline__
+---
+in: |-
+ * @foo@
+ * @bar@
+ * and @x@ is also.
+out: "
\n\t
foo
\n\t\t
bar
\n\t\t
and x is also.
\n\t
"
+---
+in: |-
+
+
+out: |-
+
<hello>
+
<hello>
+---
+in: |
+ Test of Markdown-style indented code.
+
+ a = [1, 2, 3]
+ a.each do |x|
+ puts "test number", x,
+ "and more!"
+ end
+
+ Paragraph 2.
+
+ Paragraph 3.
+out: |-
+
Test of Markdown-style indented code.
+
+
a = [1, 2, 3]
+ a.each do |x|
+ puts "test number", x,
+ "and more!"
+ end
+
+
Paragraph 2.
+
+
Paragraph 3.
diff --git a/tracks/vendor/RedCloth-3.0.3/tests/images.yml b/tracks/vendor/RedCloth-3.0.3/tests/images.yml
new file mode 100644
index 00000000..d097e0fb
--- /dev/null
+++ b/tracks/vendor/RedCloth-3.0.3/tests/images.yml
@@ -0,0 +1,171 @@
+---
+in: This is an !image.jpg!
+out:
This is an
+---
+in: This is an !image.jpg(with alt text)!
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg#a1!
+out:
This is an
+---
+in: This is an !image.jpg!.
+out:
This is an .
+---
+in: This is an !image.jpg(with alt text)!.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg#a1!.
+out:
This is an .
+---
+in: This is not an image!!!
+out:
This is not an image!!!
+---
+in: This is an !http://example.com/i/image.jpg!:#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10
+out:
This is an
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10.
+out:
This is an .
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b, but this is not.
+out:
This is an , but this is not.
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1, but this is not.
+out:
This is an , but this is not.
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a, but this is not.
+out:
This is an , but this is not.
+---
+in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1, but this is not.
+out:
This is an , but this is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
+out:
(This is an ) This is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b) This is not.
+out:
(This is an ) This is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1) This is not.
+out:
(This is an ) This is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a) This is not.
+out:
(This is an ) This is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1) This is not.
+out:
(This is an ) This is not.
+---
+in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
+out:
(This is an ) This is not.
diff --git a/tracks/vendor/RedCloth-3.0.3/tests/instiki.yml b/tracks/vendor/RedCloth-3.0.3/tests/instiki.yml
new file mode 100644
index 00000000..89b8ec6b
--- /dev/null
+++ b/tracks/vendor/RedCloth-3.0.3/tests/instiki.yml
@@ -0,0 +1,39 @@
+--- # Bugs filed at http://www.instiki.org/show/BugReports
+in: |-
+ _Hi, Joe Bob?, this should all be in italic!_
+out: |-
+
'
+---
+in: |-
+ h2. Version History
+
+ * "Version
+ 0.0":http://www.threewordslong.com/render-0-8-9b.patch - Early version using MD5 hashes.
+ * "Version
+ 0.1":http://www.threewordslong.com/chunk-0-1.patch.gz - First cut of new system. Much cleaner.
+ * "Version 0.2":http://www.threewordslong.com/chunk-0-2.patch.gz - Fixed problem with "authors" page and some tests.
+out: |-
+
"
+---
+in: 'The ION coding style document found at "IONCodingStyleGuide.doc":http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22 codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text'
+out:
The ION coding style document found at IONCodingStyleGuide.doc codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text
diff --git a/tracks/vendor/RedCloth-3.0.3/tests/lists.yml b/tracks/vendor/RedCloth-3.0.3/tests/lists.yml
new file mode 100644
index 00000000..cf8938f0
--- /dev/null
+++ b/tracks/vendor/RedCloth-3.0.3/tests/lists.yml
@@ -0,0 +1,77 @@
+--- # Bret Pettichord, Thanks.
+in: |-
+ * first line
+ * second
+ line
+ * third line
+out: |-
+
+
first line
+
second
+ line
+
third line
+
+---
+in: |-
+ p. start
+
+ * one
+ and one
+ * two
+ and two
+ * three
+
+ p. end
+out: |-
+
start
+
+
one
+ and one
+
two
+ and two
+
three
+
+
+
end
+---
+in: |-
+ Funky:
+
+ * Testing
+ *# number
+ *##* bullet
+ *# number
+ *# number
+ yeah number
+ #* bullet
+ *** okay
+ ****# what
+
+
+out: |-
+
+
+# We don't do this.
+# ---
+# in: 4 < 5
+# out: 4 < 5
+---
+in: |
+ This is an H1
+ =============
+
+ This is an H2
+ -------------
+out: |-
+
This is an H1
+
+
This is an H2
+---
+in: |
+ # This is an H1
+
+ ## This is an H2
+
+ ###### This is an H6
+out: |-
+
This is an H1
+
+
This is an H2
+
+
This is an H6
+---
+in: |
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+ > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+ > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+ >
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+ > id sem consectetuer libero luctus adipiscing.
+out: |-
+
+
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+
Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+ id sem consectetuer libero luctus adipiscing.
+
+
+---
+in: |
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+ >
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+ id sem consectetuer libero luctus adipiscing.
+out: |-
+
+
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+
Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+ id sem consectetuer libero luctus adipiscing.
+
+
+---
+in: |
+ > This is the first level of quoting.
+ >
+ > > This is nested blockquote.
+ >
+ > Back to the first level.
+out: |-
+
+
This is the first level of quoting.
+
+
This is nested blockquote.
+
+
+
+
+
+
Back to the first level.
+
+
+---
+in: |
+ > ## This is a header.
+ >
+ > 1. This is the first list item.
+ > 2. This is the second list item.
+ >
+ > Here's some example code:
+ >
+ > return shell_exec("echo $input | $markdown_script");
+out: |-
+
+
This is a header.
+
+
+
+
1. This is the first list item.
+ 2. This is the second list item.
+---
+in: |
+ I get 10 times more traffic from [Google] [1] than from
+ [Yahoo] [2] or [MSN] [3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+out: |-
+
I get 10 times more traffic from Google than from
+ Yahoo or MSN.
+---
+in: |
+ I get 10 times more traffic from [Google][] than from
+ [Yahoo][] or [MSN][].
+
+ [google]: http://google.com/ "Google"
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
+ [msn]: http://search.msn.com/ "MSN Search"
+out: |-
+
I get 10 times more traffic from Google than from
+ Yahoo or MSN.
diff --git a/tracks/vendor/RedCloth-3.0.3/tests/poignant.yml b/tracks/vendor/RedCloth-3.0.3/tests/poignant.yml
new file mode 100644
index 00000000..1a0f6942
--- /dev/null
+++ b/tracks/vendor/RedCloth-3.0.3/tests/poignant.yml
@@ -0,0 +1,64 @@
+--- # Tests from the (Poignant Guide)
+in: >
+ h3. False
+
+
+ !
+ if plastic_cup
+ print "Plastic cup is on the up 'n' up!"
+ end
+
+
+
+ If @plastic_cup@ contains either @nil@ or @false@, you won't see anything print
+ to the screen. They're not on the @if@ guest list. So @if@ isn't going to run
+ any of the code it's protecting.
+
+
+ But @nil@ and @false@ need not walk away in shame. They may be of questionable
+ character, but @unless@ runs a smaller establishment that caters to the bedraggled.
+ The @unless@ keyword has a policy of only allowing those with a negative charge in.
+ Who are: @nil@ and @false@.
+
+
+
+ unless plastic_cup
+ print "Plastic cup is on the down low."
+ end
+
+
+
+ You can also use @if@ and @unless@ at the end of a single line of code, if that's
+ all that is being protected.
+
+
+
+ print "Yeah, plastic cup is up again!" if plastic_cup
+ print "Hardly. It's down." unless plastic_cup
+
+
+
+ Now that you've met @false@, I'm sure you can see what's on next.
+
+out: "
False
\n\n\t
\n\n\t
The cat Trady Blix. Frozen in emptiness. Immaculate whiskers rigid. Placid eyes of lake. Tail of warm icicle. Sponsored by a Very Powerful Pause Button.
\n\n\t
The darkness surrounding Blix can be called negative space. Hang on to that phrase. Let it suggest that the emptiness has a negative connotation. In a similar way, nil has a slightly sour note that it whistles.
\n\n\t
Generally speaking, everything in Ruby has a positive charge to it. This spark flows through strings, numbers, regexps, all of it. Only two keywords wear a shady cloak: nil and false draggin us down.
\n\n\t
You can test that charge with an if keyword. It looks very much like the do blocks we saw in the last chapter, in that both end with an end.
\n\n\n
\n if plastic_cup\n print \"Plastic cup is on the up 'n' up!\" \n end\n
\n\t
If plastic_cup contains either nil or false, you won’t see anything print to the screen. They’re not on the if guest list. So if isn’t going to run any of the code it’s protecting.
\n\n\t
But nil and false need not walk away in shame. They may be of questionable character, but unless runs a smaller establishment that caters to the bedraggled. The unless keyword has a policy of only allowing those with a negative charge in. Who are: nil and false.
\n\n\n
\n unless plastic_cup\n print \"Plastic cup is on the down low.\" \n end\n
\n\t
You can also use if and unless at the end of a single line of code, if that’s all that is being protected.
\n\n\n
\n print \"Yeah, plastic cup is up again!\" if plastic_cup\n print \"Hardly. It's down.\" unless plastic_cup\n
\n\t
Now that you’ve met false, I’m sure you can see what’s on next.
"
diff --git a/tracks/vendor/RedCloth-3.0.3/tests/table.yml b/tracks/vendor/RedCloth-3.0.3/tests/table.yml
new file mode 100644
index 00000000..bf5059e1
--- /dev/null
+++ b/tracks/vendor/RedCloth-3.0.3/tests/table.yml
@@ -0,0 +1,198 @@
+in: |
+ {background:#ddd}. |S|Target|Complete|App|Milestone|
+ |!/i/g.gif!|11/18/04|11/18/04|070|XML spec complete|
+ |!/i/g.gif!|11/29/04|11/29/04|011|XML spec complete (KH is on schedule)|
+ |!/i/g.gif!|11/29/04|11/29/04|051|XML spec complete (KH is on schedule)|
+ |!/i/g.gif!|11/29/04|11/29/04|081|XML spec complete (KH is on schedule)|
+ |!/i/g.gif!|11/19/04|11/22/04|070|Preprocessor complete|
+ |!/i/g.gif!|11/22/04|11/22/04|070|Dialog pass 1 builds an index file|
+ |!/i/g.gif!|11/24/04|11/24/04|070|Dialog pass 2 98% complete|
+ |!/i/g.gif!|11/30/04|11/30/04|070|Feature complete. Passes end-to-end smoke test.|
+ |!/i/g.gif!|11/30/04|11/30/04|011|Preprocessor updates complete|
+ |!/i/g.gif!|11/30/04|11/30/04|051|Preprocessor updates complete|
+ |!/i/g.gif!|11/30/04|11/29/04|081|Preprocessor updates complete|
+ |!/i/w.gif!|12/02/04|.|011|Dialog pass 1 and 2 complete (98+%)|
+ |!/i/w.gif!|12/02/04|.|051|Dialog pass 1 and 2 complete (98+%)|
+ |!/i/w.gif!|12/02/04|.|081|Dialog pass 1 and 2 complete (98+%)|
+ |!/i/w.gif!|12/03/04|.|011|Feature complete|
+ |!/i/w.gif!|12/03/04|.|051|Feature complete|
+ |!/i/w.gif!|12/03/04|.|081|Feature complete|
+ |!/i/w.gif!|12/10/04|.|011|Deployed to Napa test workstation. Passes smoke test.|
+ |!/i/w.gif!|12/10/04|.|051|Deployed to Napa test workstation. Passes smoke test.|
+ |!/i/w.gif!|12/10/04|.|081|Deployed to Napa test workstation. Passes smoke test.|
+ |!/i/w.gif!|12/10/04|.|070|Deployed to Napa test workstation. Passes smoke test.|
+ |!/i/w.gif!|12/17/04|.|011|System testing complete. Begin testing with live customer data.|
+ |!/i/w.gif!|12/17/04|.|051|System testing complete. Begin testing with live customer data.|
+ |!/i/w.gif!|12/17/04|.|081|System testing complete. Begin testing with live customer data.|
+ |!/i/w.gif!|12/17/04|.|070|System testing complete. Begin testing with live customer data.|
+out: |-
+
+
+
S
+
Target
+
Complete
+
App
+
Milestone
+
+
+
+
11/18/04
+
11/18/04
+
070
+
XML spec complete
+
+
+
+
11/29/04
+
11/29/04
+
011
+
XML spec complete (KH is on schedule)
+
+
+
+
11/29/04
+
11/29/04
+
051
+
XML spec complete (KH is on schedule)
+
+
+
+
11/29/04
+
11/29/04
+
081
+
XML spec complete (KH is on schedule)
+
+
+
+
11/19/04
+
11/22/04
+
070
+
Preprocessor complete
+
+
+
+
11/22/04
+
11/22/04
+
070
+
Dialog pass 1 builds an index file
+
+
+
+
11/24/04
+
11/24/04
+
070
+
Dialog pass 2 98% complete
+
+
+
+
11/30/04
+
11/30/04
+
070
+
Feature complete. Passes end-to-end smoke test.
+
+
+
+
11/30/04
+
11/30/04
+
011
+
Preprocessor updates complete
+
+
+
+
11/30/04
+
11/30/04
+
051
+
Preprocessor updates complete
+
+
+
+
11/30/04
+
11/29/04
+
081
+
Preprocessor updates complete
+
+
+
+
12/02/04
+
011
+
Dialog pass 1 and 2 complete (98+%)
+
+
+
+
12/02/04
+
051
+
Dialog pass 1 and 2 complete (98+%)
+
+
+
+
12/02/04
+
081
+
Dialog pass 1 and 2 complete (98+%)
+
+
+
+
12/03/04
+
011
+
Feature complete
+
+
+
+
12/03/04
+
051
+
Feature complete
+
+
+
+
12/03/04
+
081
+
Feature complete
+
+
+
+
12/10/04
+
011
+
Deployed to Napa test workstation. Passes smoke test.
+
+
+
+
12/10/04
+
051
+
Deployed to Napa test workstation. Passes smoke test.
+
+
+
+
12/10/04
+
081
+
Deployed to Napa test workstation. Passes smoke test.
+
+
+
+
12/10/04
+
070
+
Deployed to Napa test workstation. Passes smoke test.
+
+
+
+
12/17/04
+
011
+
System testing complete. Begin testing with live customer data.
+
+
+
+
12/17/04
+
051
+
System testing complete. Begin testing with live customer data.
+
+
+
+
12/17/04
+
081
+
System testing complete. Begin testing with live customer data.
+
+
+
+
12/17/04
+
070
+
System testing complete. Begin testing with live customer data.
+# ---
+# in: |-
+# This is a "link":bob to Bob's website.
+#
+# [bob]http://itsbob.com/index.html
+---
+in: ACLU(American Civil Liberties Union)
+out:
ACLU
+---
+in: |-
+ h2{color:green}. This is a title
+
+ h3. This is a subhead
+
+ p{color:red}. This is some text of dubious character. Isn't the use of "quotes" just lazy writing -- and theft of 'intellectual property' besides? I think the time has come to see a block quote.
+
+ bq[fr]. This is a block quote. I'll admit it's not the most exciting block quote ever devised.
+
+ Simple list:
+
+ #{color:blue} one
+ # two
+ # three
+
+ Multi-level list:
+
+ # one
+ ## aye
+ ## bee
+ ## see
+ # two
+ ## x
+ ## y
+ # three
+
+ Mixed list:
+
+ * Point one
+ * Point two
+ ## Step 1
+ ## Step 2
+ ## Step 3
+ * Point three
+ ** Sub point 1
+ ** Sub point 2
+
+
+ Well, that went well. How about we insert an old-fashioned hypertext link? Will the quote marks in the tags get messed up? No!
+
+ "This is a link (optional title)":http://www.textism.com
+
+ table{border:1px solid black}.
+ |_. this|_. is|_. a|_. header|
+ <{background:gray}. |\2. this is|{background:red;width:200px}. a|^<>{height:200px}. row|
+ |this|<>{padding:10px}. is|^. another|(bob#bob). row|
+
+ An image:
+
+ !/common/textist.gif(optional alt text)!
+
+ # Librarians rule
+ # Yes they do
+ # But you knew that
+
+ Some more text of dubious character. Here is a noisome string of CAPITAL letters. Here is something we want to _emphasize_.
+ That was a linebreak. And something to indicate *strength*. Of course I could use my own HTML tags if I felt like it.
+
+ h3. Coding
+
+ This is some code, "isn't it". Watch those quote marks! Now for some preformatted text:
+
+
+
+ This isn't code.
+
+
+ So you see, my friends:
+
+ * The time is now
+ * The time is not later
+ * The time is not yesterday
+ * We must act
+
+out: |-
+
This is a title
+
+
This is a subhead
+
+
This is some text of dubious character. Isn’t the use of “quotes” just lazy writing—and theft of ‘intellectual property’ besides? I think the time has come to see a block quote.
+
+
+
This is a block quote. I’ll admit it’s not the most exciting block quote ever devised.
+
+
+
Simple list:
+
+
one
+
two
+
three
+
+
+
Multi-level list:
+
+
one
+
+
aye
+
bee
+
see
+
+
+
two
+
+
x
+
y
+
+
+
three
+
+
+
Mixed list:
+
+
Point one
+
Point two
+
+
Step 1
+
Step 2
+
Step 3
+
+
+
Point three
+
+
Sub point 1
+
Sub point 2
+
+
+
+
Well, that went well. How about we insert an old-fashioned hypertext link? Will the quote marks in the tags get messed up? No!
Some more text of dubious character. Here is a noisome string of CAPITAL letters. Here is something we want to emphasize.
+ That was a linebreak. And something to indicate strength. Of course I could use my own HTML tags if I felt like it.
+
+
Coding
+
+
This is some code, "isn't it". Watch those quote marks! Now for some preformatted text:
\n\n", mail.parts[1].body
+ end
+
+ def test_headers_removed_on_smtp_delivery
+ ActionMailer::Base.delivery_method = :smtp
+ TestMailer.deliver_cc_bcc(@recipient)
+ assert MockSMTP.deliveries[0][2].include?("root@loudthinking.com")
+ assert MockSMTP.deliveries[0][2].include?("nobody@loudthinking.com")
+ assert MockSMTP.deliveries[0][2].include?(@recipient)
+ assert_match %r{^Cc: nobody@loudthinking.com}, MockSMTP.deliveries[0][0]
+ assert_match %r{^To: #{@recipient}}, MockSMTP.deliveries[0][0]
+ assert_no_match %r{^Bcc: root@loudthinking.com}, MockSMTP.deliveries[0][0]
+ end
+
+ def test_recursive_multipart_processing
+ fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email7")
+ mail = TMail::Mail.parse(fixture)
+ assert_equal "This is the first part.\n\nAttachment: test.pdf\n\n\nAttachment: smime.p7s\n", mail.body
+ end
+
+ def test_decode_encoded_attachment_filename
+ fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email8")
+ mail = TMail::Mail.parse(fixture)
+ attachment = mail.attachments.last
+ assert_equal "01QuienTeDijat.Pitbull.mp3", attachment.original_filename
+ end
+
+ def test_wrong_mail_header
+ fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email9")
+ assert_raise(TMail::SyntaxError) { TMail::Mail.parse(fixture) }
+ end
+
+ def test_decode_message_with_unknown_charset
+ fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email10")
+ mail = TMail::Mail.parse(fixture)
+ assert_nothing_raised { mail.body }
+ end
+
+ def test_decode_message_with_unquoted_atchar_in_header
+ fixture = File.read(File.dirname(__FILE__) + "/fixtures/raw_email11")
+ mail = TMail::Mail.parse(fixture)
+ assert_not_nil mail.from
+ end
+
+ def test_empty_header_values_omitted
+ result = TestMailer.create_unnamed_attachment(@recipient).encoded
+ assert_match %r{Content-Type: application/octet-stream[^;]}, result
+ assert_match %r{Content-Disposition: attachment[^;]}, result
+ end
+
+ def test_headers_with_nonalpha_chars
+ mail = TestMailer.create_headers_with_nonalpha_chars(@recipient)
+ assert !mail.from_addrs.empty?
+ assert !mail.cc_addrs.empty?
+ assert !mail.bcc_addrs.empty?
+ assert_match(/:/, mail.from_addrs.to_s)
+ assert_match(/:/, mail.cc_addrs.to_s)
+ assert_match(/:/, mail.bcc_addrs.to_s)
+ end
+
+ def test_deliver_with_mail_object
+ mail = TestMailer::create_headers_with_nonalpha_chars(@recipient)
+ assert_nothing_raised { TestMailer.deliver(mail) }
+ assert_equal 1, TestMailer.deliveries.length
+ end
+end
+
diff --git a/tracks/vendor/rails/actionmailer/test/quoting_test.rb b/tracks/vendor/rails/actionmailer/test/quoting_test.rb
new file mode 100644
index 00000000..6291cd3d
--- /dev/null
+++ b/tracks/vendor/rails/actionmailer/test/quoting_test.rb
@@ -0,0 +1,48 @@
+$:.unshift(File.dirname(__FILE__) + "/../lib/")
+$:.unshift(File.dirname(__FILE__) + "/../lib/action_mailer/vendor")
+
+require 'test/unit'
+require 'tmail'
+require 'tempfile'
+
+class QuotingTest < Test::Unit::TestCase
+ def test_quote_multibyte_chars
+ original = "\303\246 \303\270 and \303\245"
+
+ result = execute_in_sandbox(<<-CODE)
+ $:.unshift(File.dirname(__FILE__) + "/../lib/")
+ $KCODE = 'u'
+ require 'jcode'
+ require 'action_mailer/quoting'
+ include ActionMailer::Quoting
+ quoted_printable(#{original.inspect}, "UTF-8")
+ CODE
+
+ unquoted = TMail::Unquoter.unquote_and_convert_to(result, nil)
+ assert_equal unquoted, original
+ end
+
+ private
+
+ # This whole thing *could* be much simpler, but I don't think Tempfile,
+ # popen and others exist on all platforms (like Windows).
+ def execute_in_sandbox(code)
+ test_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.rb"
+ res_name = "#{File.dirname(__FILE__)}/am-quoting-test.#{$$}.out"
+
+ File.open(test_name, "w+") do |file|
+ file.write(<<-CODE)
+ block = Proc.new do
+ #{code}
+ end
+ puts block.call
+ CODE
+ end
+
+ system("ruby #{test_name} > #{res_name}") or raise "could not run test in sandbox"
+ File.read(res_name)
+ ensure
+ File.delete(test_name) rescue nil
+ File.delete(res_name) rescue nil
+ end
+end
diff --git a/tracks/vendor/rails/actionmailer/test/tmail_test.rb b/tracks/vendor/rails/actionmailer/test/tmail_test.rb
new file mode 100644
index 00000000..3930c7d3
--- /dev/null
+++ b/tracks/vendor/rails/actionmailer/test/tmail_test.rb
@@ -0,0 +1,17 @@
+$:.unshift(File.dirname(__FILE__) + "/../lib/")
+$:.unshift File.dirname(__FILE__) + "/fixtures/helpers"
+
+require 'test/unit'
+require 'action_mailer'
+
+class TMailMailTest < Test::Unit::TestCase
+ def test_body
+ m = TMail::Mail.new
+ expected = 'something_with_underscores'
+ m.encoding = 'quoted-printable'
+ quoted_body = [expected].pack('*M')
+ m.body = quoted_body
+ assert_equal "something_with_underscores=\n", m.quoted_body
+ assert_equal expected, m.body
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/CHANGELOG b/tracks/vendor/rails/actionpack/CHANGELOG
new file mode 100644
index 00000000..9453a59f
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/CHANGELOG
@@ -0,0 +1,2120 @@
+*1.1.2* (December 13th, 2005)
+
+* Update to script.aculo.us 1.5.0 final (equals 1.5.0_rc6) [Thomas Fuchs]
+
+* Update to Prototype 1.4.0 final [Sam Stephenson]
+
+* Become part of Rails 1.0
+
+
+*1.11.1* (December 7th, 2005)
+
+* More robust relative url root discovery for SCGI compatibility. This solves the 'SCGI routes problem' -- you no longer need to prefix all your routes with the name of the SCGI mountpoint. #3070 [Dave Ringoen]
+
+* Fix docs for text_area_tag. #3083. [Christopher Cotton]
+
+* Make ActionController's render honor the :locals option when rendering a :file. #1665. [Emanuel Borsboom, Marcel Molina Jr.]
+
+* Don't put flash in session if sessions are disabled. [Jeremy Kemper]
+
+* Strip out trailing &_= for raw post bodies. Closes #2868. [Sam Stephenson]
+
+* Correct docs for automatic layout assignment. #2610. [Charles M. Gerungan]
+
+* Always create new AR sessions rather than trying too hard to avoid database traffic. #2731 [Jeremy Kemper]
+
+* Update to Prototype 1.4.0_rc4. Closes #2943 (old Array.prototype.reverse behavior can be obtained by passing false as an argument). [Sam Stephenson]
+
+* Update to Prototype 1.4.0_rc3. Closes #1893, #2505, #2550, #2748, #2783. [Sam Stephenson]
+
+* Updated docs for in_place_editor, fixes a couple bugs and offers extended support for external controls [Justin Palmer]
+
+* Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
+
+* Remove the unused, slow response_dump and session_dump variables from error pages. #1222 [lmarlow@yahoo.com]
+
+* Update to latest script.aculo.us version (as of [3031])
+
+* Update documentation for render :file. #2858 [Tom Werner]
+
+* Only include builtin filters whose filenames match /^[a-z][a-z_]*_helper.rb$/ to avoid including operating system metadata such as ._foo_helper.rb. #2855 [court3nay@gmail.com]
+
+* options_for_select allows any objects which respond_to? :first and :last rather than restricting to Array and Range. #2824 [Jacob Robbins , Jeremy Kemper]
+
+* The auto_link text helper accepts an optional block to format the link text for each url and email address. Example: auto_link(post.body) { |text| truncate(text, 10) } [Jeremy Kemper]
+
+* assert_tag uses exact matches for string conditions, instead of partial matches. Use regex to do partial matches. #2799 [Jamis Buck]
+
+* CGI::Session::ActiveRecordStore.data_column_name = 'foobar' to use a different session data column than the 'data' default. [nbpwie102@sneakemail.com]
+
+* Do not raise an exception when default helper is missing; log a debug message instead. It's nice to delete empty helpers. [Jeremy Kemper]
+
+* Controllers with acronyms in their names (e.g. PDFController) require the correct default helper (PDFHelper in file pdf_helper.rb). #2262 [jeff@opendbms.com]
+
+
+*1.11.0* (November 7th, 2005)
+
+* Added request as instance method to views, so you can do <%= request.env["HTTP_REFERER"] %>, just like you can already access response, session, and the likes [DHH]
+
+* Fix conflict with assert_tag and Glue gem #2255 [david.felstead@gmail.com]
+
+* Add documentation to assert_tag indicating that it only works with well-formed XHTML #1937, #2570 [Jamis Buck]
+
+* Added action_pack.rb stub so that ActionPack::Version loads properly [Sam Stephenson]
+
+* Added short-hand to assert_tag so assert_tag :tag => "span" can be written as assert_tag "span" [DHH]
+
+* Added skip_before_filter/skip_after_filter for easier control of the filter chain in inheritance hierachies [DHH]. Example:
+
+ class ApplicationController < ActionController::Base
+ before_filter :authenticate
+ end
+
+ class WeblogController < ApplicationController
+ # will run the :authenticate filter
+ end
+
+ class SignupController < ActionController::Base
+ # will not run the :authenticate filter
+ skip_before_filter :authenticate
+ end
+
+* Added redirect_to :back as a short-hand for redirect_to(request.env["HTTP_REFERER"]) [DHH]
+
+* Change javascript_include_tag :defaults to not use script.aculo.us loader, which facilitates the use of plugins for future script.aculo.us and third party javascript extensions, and provide register_javascript_include_default for plugins to specify additional JavaScript files to load. Removed slider.js and builder.js from actionpack. [Thomas Fuchs]
+
+* Fix problem where redirecting components can cause an infinite loop [Rick Olson]
+
+* Added support for the queue option on visual_effect [Thomas Fuchs]
+
+* Update script.aculo.us to V1.5_rc4 [Thomas Fuchs]
+
+* Fix that render :text didn't interpolate instance variables #2629, #2626 [skaes]
+
+* Fix line number detection and escape RAILS_ROOT in backtrace Regexp [Nicholas Seckar]
+
+* Fixed document.getElementsByClassName from Prototype to be speedy again [Sam Stephenson]
+
+* Recognize ./#{RAILS_ROOT} as RAILS_ROOT in error traces [Nicholas Seckar]
+
+* Remove ARStore session fingerprinting [Nicholas Seckar]
+
+* Fix obscure bug in ARStore [Nicholas Seckar]
+
+* Added TextHelper#strip_tags for removing HTML tags from a string (using HTMLTokenizer) #2229 [marcin@junkheap.net]
+
+* Added a reader for flash.now, so it's possible to do stuff like flash.now[:alert] ||= 'New if not set' #2422 [Caio Chassot]
+
+
+*1.10.2* (October 26th, 2005)
+
+* Reset template variables after using render_to_string [skaes@web.de]
+
+* Expose the session model backing CGI::Session
+
+* Abbreviate RAILS_ROOT in traces
+
+
+*1.10.1* (October 19th, 2005)
+
+* Update error trace templates [Nicholas Seckar]
+
+* Stop showing generated routing code in application traces [Nicholas Seckar]
+
+
+*1.10.0* (October 16th, 2005)
+
+* Make string-keys locals assigns optional. Add documentation describing depreciated state [skaes@web.de]
+
+* Improve line number detection for template errors [Nicholas Seckar]
+
+* Update/clean up documentation (rdoc)
+
+* Upgrade to Prototype 1.4.0_rc0 [Sam Stephenson]
+
+* Added assert_vaild. Reports the proper AR error messages as fail message when the passed record is invalid [Tobias Luetke]
+
+* Add temporary support for passing locals to render using string keys [Nicholas Seckar]
+
+* Clean up error pages by providing better backtraces [Nicholas Seckar]
+
+* Raise an exception if an attempt is made to insert more session data into the ActiveRecordStore data column than the column can hold. #2234. [justin@textdrive.com]
+
+* Removed references to assertions.rb from actionpack assert's backtraces. Makes error reports in functional unit tests much less noisy. [Tobias Luetke]
+
+* Updated and clarified documentation for JavaScriptHelper to be more concise about the various options for including the JavaScript libs. [Thomas Fuchs]
+
+* Hide "Retry with Breakpoint" button on error pages until feature is functional. [DHH]
+
+* Fix Request#host_with_port to use the standard port when Rails is behind a proxy. [Nicholas Seckar]
+
+* Escape query strings in the href attribute of URLs created by url_helper. #2333 [Michael Schuerig ]
+
+* Improved line number reporting for template errors [Nicholas Seckar]
+
+* Added :locals support for render :inline #2463 [mdabney@cavoksolutions.com]
+
+* Unset the X-Requested-With header when using the xhr wrapper in functional tests so that future requests aren't accidentally xhr'ed #2352 [me@julik.nl, Sam Stephenson]
+
+* Unescape paths before writing cache to file system. #1877. [Damien Pollet]
+
+* Wrap javascript_tag contents in a CDATA section and add a cdata_section method to TagHelper #1691 [Michael Schuerig, Sam Stephenson]
+
+* Misc doc fixes (typos/grammar/etc). #2445. [coffee2code]
+
+* Speed improvement for session_options. #2287. [skaes@web.de]
+
+* Make cacheing binary files friendly with Windows. #1975. [Rich Olson]
+
+* Convert boolean form options form the tag_helper. #809. [Michael Schuerig ]
+
+* Fixed that an instance variable with the same name as a partial should be implicitly passed as the partial :object #2269 [court3nay]
+
+* Update Prototype to V1.4.0_pre11, script.aculo.us to [2502] [Thomas Fuchs]
+
+* Make assert_tag :children count appropriately. Closes #2181. [jamie@bravenet.com]
+
+* Forced newer versions of RedCloth to use hard breaks [DHH]
+
+* Added new scriptaculous options for auto_complete_field #2343 [m.stienstra@fngtps.com]
+
+* Don't prepend the asset host if the string is already a fully-qualified URL
+
+* Updated to script.aculo.us V1.5.0_rc2 and Prototype to V1.4.0_pre7 [Thomas Fuchs]
+
+* Undo condition change made in [2345] to prevent normal parameters arriving as StringIO.
+
+* Tolerate consecutive delimiters in query parameters. #2295 [darashi@gmail.com]
+
+* Streamline render process, code cleaning. Closes #2294. [skae]
+
+* Keep flash after components are rendered. #2291 [Rick Olson, Scott]
+
+* Shorten IE file upload path to filename only to match other browsers. #1507 [court3nay@gmail.com]
+
+* Fix open/save dialog in IE not opening files send with send_file/send_data, #2279 [Thomas Fuchs]
+
+* Fixed that auto_discovery_link_tag couldn't take a string as the URL [DHH]
+
+* Fixed problem with send_file and WEBrick using stdout #1812 [DHH]
+
+* Optimized tag_options to not sort keys, which is no longer necessary when assert_dom_equal and friend is available #1995 [skae]
+
+* Added assert_dom_equal and assert_dom_not_equal to compare tags generated by the helpers in an order-indifferent manner #1995 [skae]
+
+* Fixed that Request#domain caused an exception if the domain header wasn't set in the original http request #1795 [Michael Koziarski]
+
+* Make the truncate() helper multi-byte safe (assuming $KCODE has been set to something other than "NONE") #2103
+
+* Add routing tests from #1945 [ben@groovie.org]
+
+* Add a routing test case covering #2101 [Nicholas Seckar]
+
+* Cache relative_url_root for all webservers, not just Apache #2193 [skae]
+
+* Speed up cookie use by decreasing string copying #2194 [skae]
+
+* Fixed access to "Host" header with requests made by crappy old HTTP/1.0 clients #2124 [Marcel Molina]
+
+* Added easy assignment of fragment cache store through use of symbols for included stores (old way still works too)
+
+ Before:
+ ActionController::Base.fragment_cache_store =
+ ActionController::Base::Caching::Fragments::FileStore.new("/path/to/cache/directory")
+
+ After:
+ ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory"
+
+* Added ActionController::Base.session_store=, session_store, and session_options to make it easier to tweak the session options (instead of going straight to ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS)
+
+* Added TextHelper#cycle to cycle over an array of values on each hit (useful for alternating row colors etc) #2154 [dave-ml@dribin.org]
+
+* Ensure that request.path never returns nil. Closes #1675 [Nicholas Seckar]
+
+* Add ability to specify Route Regexps for controllers. Closes #1917. [Sebastian Kanthak]
+
+* Provide Named Route's hash methods as helper methods. Closes #1744. [Nicholas Seckar, Steve Purcell]
+
+* Added :multipart option to ActiveRecordHelper#form to make it possible to add file input fields #2034 [jstirk@oobleyboo.com]
+
+* Moved auto-completion and in-place editing into the Macros module and their helper counterparts into JavaScriptMacrosHelper
+
+* Added in-place editing support in the spirit of auto complete with ActionController::Base.in_place_edit_for, JavascriptHelper#in_place_editor_field, and Javascript support from script.aculo.us #2038 [Jon Tirsen]
+
+* Added :disabled option to all data selects that'll make the elements inaccessible for change #2167, #253 [eigentone]
+
+* Fixed that TextHelper#auto_link_urls would include punctuation in the links #2166, #1671 [eigentone]
+
+* Fixed that number_to_currency(1000, {:precision => 0})) should return "$1,000", instead of "$1,000." #2122 [sd@notso.net]
+
+* Allow link_to_remote to use any DOM-element as the parent of the form elements to be submitted #2137 [erik@ruby-lang.nl]. Example:
+
+
+
+* Fixed that render :partial would fail when :object was a Hash (due to backwards compatibility issues) #2148 [Sam Stephenson]
+
+* Fixed JavascriptHelper#auto_complete_for to only include unique items #2153 [Thomas Fuchs]
+
+* Fixed all AssetHelper methods to work with relative paths, such that javascript_include_tag('stdlib/standard') will look in /javascripts/stdlib/standard instead of '/stdlib/standard/' #1963
+
+* Avoid extending view instance with helper modules each request. Closes #1979
+
+* Performance improvements to CGI methods. Closes #1980 [Skaes]
+
+* Added :post option to UrlHelper#link_to that makes it possible to do POST requests through normal ahref links using Javascript
+
+* Fixed overwrite_params
+
+* Added ActionController::Base.benchmark and ActionController::Base.silence to allow for easy benchmarking and turning off the log
+
+* Updated vendor copy of html-scanner to support better xml parsing
+
+* Added :popup option to UrlHelper#link_to #1996 [gabriel.gironda@gmail.com]. Examples:
+
+ link_to "Help", { :action => "help" }, :popup => true
+ link_to "Busy loop", { :action => "busy" }, :popup => ['new_window', 'height=300,width=600']
+
+* Drop trailing \000 if present on RAW_POST_DATA (works around bug in Safari Ajax implementation) #918
+
+* Fix observe_field to fall back to event-based observation if frequency <= 0 #1916 [michael@schubert.cx]
+
+* Allow use of the :with option for submit_to_remote #1936 [jon@instance-design.co.uk]
+
+* AbstractRequest#domain returns nil when host is an ip address #2012 [kevin.clark@gmail.com]
+
+* ActionController documentation update #2051 [fbeausoleil@ftml.net]
+
+* Yield @content_for_ variables to templates #2058 [Sam Stephenson]
+
+* Make rendering an empty partial collection behave like :nothing => true #2080 [Sam Stephenson]
+
+* Add option to specify the singular name used by pagination.
+
+* Use string key to obtain action value. Allows indifferent hashes to be disabled.
+
+* Added ActionView::Base.cache_template_loading back.
+
+* Rewrote compiled templates to decrease code complexity. Removed template load caching in favour of compiled caching. Fixed template error messages. [Nicholas Seckar]
+
+* Fix Routing to handle :some_param => nil better. [Nicholas Seckar, Luminas]
+
+* Add support for :include with pagination (subject to existing constraints for :include with :limit and :offset) #1478 [michael@schubert.cx]
+
+* Prevent the benchmark module from blowing up if a non-HTTP/1.1 request is processed
+
+* Added :use_short_month option to select_month helper to show month names as abbreviations
+
+* Make link_to escape the javascript in the confirm option #1964 [nicolas.pouillard@gmail.com]
+
+* Make assert_redirected_to properly check URL's passed as strings #1910 [Scott Barron]
+
+* Make sure :layout => false is always used when rendering inside a layout
+
+* Use raise instead of assert_not_nil in Test::Unit::TestCase#process to ensure that the test variables (controller, request, response) have been set
+
+* Make sure assigns are built for every request when testing #1866
+
+* Allow remote_addr to be queried on TestRequest #1668
+
+* Fixed bug when a partial render was passing a local with the same name as the partial
+
+* Improved performance of test app req/sec with ~10% refactoring the render method #1823 [Stefan Kaes]
+
+* Improved performance of test app req/sec with 5-30% through a series of Action Pack optimizations #1811 [Stefan Kaes]
+
+* Changed caching/expiration/hit to report using the DEBUG log level and errors to use the ERROR log level instead of both using INFO
+
+* Added support for per-action session management #1763
+
+* Improved rendering speed on complicated templates by up to 100% (the more complex the templates, the higher the speedup) #1234 [Stephan Kaes]. This did necessasitate a change to the internals of ActionView#render_template that now has four parameters. Developers of custom view handlers (like Amrita) need to update for that.
+
+* Added options hash as third argument to FormHelper#input, so you can do input('person', 'zip', :size=>10) #1719 [jeremye@bsa.ca.gov]
+
+* Added Base#expires_in(seconds)/Base#expires_now to control HTTP content cache headers #1755 [Thomas Fuchs]
+
+* Fixed line number reporting for Builder template errors #1753 [piotr]
+
+* Fixed assert_routing so that testing controllers in modules works as expected [Nicholas Seckar, Rick Olson]
+
+* Fixed bug with :success/:failure callbacks for the JavaScriptHelper methods #1730 [court3nay/Thomas Fuchs]
+
+* Added named_route method to RouteSet instances so that RouteSet instance methods do not prevent certain names from being used. [Nicholas Seckar]
+
+* Fixed routes so that routes which do not specify :action in the path or in the requirements have a default of :action => 'index', In addition, fixed url generation so that :action => 'index' does not need to be provided for such urls. [Nicholas Seckar, Markjuh]
+
+* Worked around a Safari bug where it wouldn't pass headers through if the response was zero length by having render :nothing return ' ' instead of ''
+
+* Fixed Request#subdomains to handle "foo.foo.com" correctly
+
+
+*1.9.1* (11 July, 2005)
+
+* Fixed that auto_complete_for didn't force the input string to lower case even as the db comparison was
+
+* Fixed that Action View should always use the included Builder, never attempt to require the gem, to ensure compatibility
+
+* Added that nil options are not included in tags, so tag("p", :ignore => nil) now returns not but that tag("p", :ignore => "") still includes it #1465 [michael@schuerig.de]
+
+* Fixed that UrlHelper#link_to_unless/link_to_if used html_escape on the name if no link was to be applied. This is unnecessary and breaks its use with images #1649 [joergd@pobox.com]
+
+* Improved error message for DoubleRenderError
+
+* Fixed routing to allow for testing of *path components #1650 [Nicholas Seckar]
+
+* Added :handle as an option to sortable_element to restrict the drag handle to a given class #1642 [thejohnny]
+
+* Added a bunch of script.aculo.us features #1644, #1677, #1695 [Thomas Fuchs]
+ * Effect.ScrollTo, to smoothly scroll the page to an element
+ * Better Firefox flickering handling on SlideUp/SlideDown
+ * Removed a possible memory leak in IE with draggables
+ * Added support for cancelling dragging my hitting ESC
+ * Added capability to remove draggables/droppables and redeclare sortables in dragdrop.js (this makes it possible to call sortable_element on the same element more than once, e.g. in AJAX returns that modify the sortable element. all current sortable 'stuff' on the element will be discarded and the sortable will be rebuilt)
+ * Always reset background color on Effect.Highlight; this make change backwards-compatibility, to be sure include style="background-color:(target-color)" on your elements or else elements will fall back to their CSS rules (which is a good thing in most circumstances)
+ * Removed circular references from element to prevent memory leaks (still not completely gone in IE)
+ * Changes to class extension in effects.js
+ * Make Effect.Highlight restore any previously set background color when finishing (makes effect work with CSS classes that set a background color)
+ * Fixed myriads of memory leaks in IE and Gecko-based browsers [David Zülke]
+ * Added incremental and local autocompleting and loads of documentation to controls.js [Ivan Krstic]
+ * Extended the auto_complete_field helper to accept tokens option
+ * Changed object extension mechanism to favor Object.extend to make script.aculo.us easily adaptable to support 3rd party libs like IE7.js [David Zülke]
+
+* Fixed that named routes didn't use the default values for action and possible other parameters #1534 [Nicholas Seckar]
+
+* Fixed JavascriptHelper#visual_effect to use camelize such that :blind_up will work #1639 [pelletierm@eastmedia.net]
+
+* Fixed that a SessionRestoreError was thrown if a model object was placed in the session that wasn't available to all controllers. This means that it's no longer necessary to use the 'model :post' work-around in ApplicationController to have a Post model in your session.
+
+
+*1.9.0* (6 July, 2005)
+
+* Added logging of the request URI in the benchmark statement (makes it easy to grep for slow actions)
+
+* Added javascript_include_tag :defaults shortcut that'll include all the default javascripts included with Action Pack (prototype, effects, controls, dragdrop)
+
+* Cache several controller variables that are expensive to calculate #1229 [skaes@web.de]
+
+* The session class backing CGI::Session::ActiveRecordStore may be replaced with any class that duck-types with a subset of Active Record. See docs for details #1238 [skaes@web.de]
+
+* Fixed that hashes was not working properly when passed by GET to lighttpd #849 [Nicholas Seckar]
+
+* Fixed assert_template nil will be true when no template was rendered #1565 [maceywj@telus.net]
+
+* Added :prompt option to FormOptions#select (and the users of it, like FormOptions#select_country etc) to create "Please select" style descriptors #1181 [Michael Schuerig]
+
+* Added JavascriptHelper#update_element_function, which returns a Javascript function (or expression) that'll update a DOM element according to the options passed #933 [mortonda@dgrmm.net]. Examples:
+
+ <%= update_element_function("products", :action => :insert, :position => :bottom, :content => "
+ <% end %>
+
+* Added :field_name option to DateHelper#select_(year|month|day) to deviate from the year/month/day defaults #1266 [Marcel Molina]
+
+* Added JavascriptHelper#draggable_element and JavascriptHelper#drop_receiving_element to facilitate easy dragging and dropping through the script.aculo.us libraries #1578 [Thomas Fuchs]
+
+* Added that UrlHelper#mail_to will now also encode the default link title #749 [f.svehla@gmail.com]
+
+* Removed the default option of wrap=virtual on FormHelper#text_area to ensure XHTML compatibility #1300 [thomas@columbus.rr.com]
+
+* Adds the ability to include XML CDATA tags using Builder #1563 [Josh Knowles]. Example:
+
+ xml.cdata! "some text" # =>
+
+* Added evaluation of
+ #
+ # javascript_include_tag "common.javascript", "/elsewhere/cools" # =>
+ #
+ #
+ #
+ # javascript_include_tag :defaults # =>
+ #
+ #
+ # ...
+ # *see below
+ #
+ # If there's an application.js file in your public/javascripts directory,
+ # javascript_include_tag :defaults will automatically include it. This file
+ # facilitates the inclusion of small snippets of JavaScript code, along the lines of
+ # controllers/application.rb and helpers/application_helper.rb.
+ def javascript_include_tag(*sources)
+ options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }
+ if sources.first == :defaults
+ sources = @@javascript_default_sources.dup
+ if defined?(RAILS_ROOT) and File.exists?("#{RAILS_ROOT}/public/javascripts/application.js")
+ sources << 'application'
+ end
+ end
+ sources.collect { |source|
+ source = javascript_path(source)
+ content_tag("script", "", { "type" => "text/javascript", "src" => source }.merge(options))
+ }.join("\n")
+ end
+
+ # Register one or more additional JavaScript files to be included when
+ #
+ # javascript_include_tag :defaults
+ #
+ # is called. This method is intended to be called only from plugin initialization
+ # to register extra .js files the plugin installed in public/javascripts.
+ def self.register_javascript_include_default(*sources)
+ @@javascript_default_sources.concat(sources)
+ end
+
+ def self.reset_javascript_include_default #:nodoc:
+ @@javascript_default_sources = JAVASCRIPT_DEFAULT_SOURCES.dup
+ end
+
+ # Returns path to a stylesheet asset. Example:
+ #
+ # stylesheet_path "style" # => /stylesheets/style.css
+ def stylesheet_path(source)
+ compute_public_path(source, 'stylesheets', 'css')
+ end
+
+ # Returns a css link tag per source given as argument. Examples:
+ #
+ # stylesheet_link_tag "style" # =>
+ #
+ #
+ # stylesheet_link_tag "style", :media => "all" # =>
+ #
+ #
+ # stylesheet_link_tag "random.styles", "/css/stylish" # =>
+ #
+ #
+ def stylesheet_link_tag(*sources)
+ options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }
+ sources.collect { |source|
+ source = stylesheet_path(source)
+ tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => source }.merge(options))
+ }.join("\n")
+ end
+
+ # Returns path to an image asset. Example:
+ #
+ # The +src+ can be supplied as a...
+ # * full path, like "/my_images/image.gif"
+ # * file name, like "rss.gif", that gets expanded to "/images/rss.gif"
+ # * file name without extension, like "logo", that gets expanded to "/images/logo.png"
+ def image_path(source)
+ compute_public_path(source, 'images', 'png')
+ end
+
+ # Returns an image tag converting the +options+ into html options on the tag, but with these special cases:
+ #
+ # * :alt - If no alt text is given, the file name part of the +src+ is used (capitalized and without the extension)
+ # * :size - Supplied as "XxY", so "30x45" becomes width="30" and height="45"
+ #
+ # The +src+ can be supplied as a...
+ # * full path, like "/my_images/image.gif"
+ # * file name, like "rss.gif", that gets expanded to "/images/rss.gif"
+ # * file name without extension, like "logo", that gets expanded to "/images/logo.png"
+ def image_tag(source, options = {})
+ options.symbolize_keys
+
+ options[:src] = image_path(source)
+ options[:alt] ||= File.basename(options[:src], '.*').split('.').first.capitalize
+
+ if options[:size]
+ options[:width], options[:height] = options[:size].split("x")
+ options.delete :size
+ end
+
+ tag("img", options)
+ end
+
+ private
+ def compute_public_path(source, dir, ext)
+ source = "/#{dir}/#{source}" unless source.first == "/" || source.include?(":")
+ source = "#{source}.#{ext}" unless source.include?(".")
+ source = "#{@controller.request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source
+ source = ActionController::Base.asset_host + source unless source.include?(":")
+ source
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb
new file mode 100644
index 00000000..1d53be51
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -0,0 +1,24 @@
+require 'benchmark'
+
+module ActionView
+ module Helpers
+ module BenchmarkHelper
+ # Measures the execution time of a block in a template and reports the result to the log. Example:
+ #
+ # <% benchmark "Notes section" do %>
+ # <%= expensive_notes_operation %>
+ # <% end %>
+ #
+ # Will add something like "Notes section (0.34523)" to the log.
+ #
+ # You may give an optional logger level as the second argument
+ # (:debug, :info, :warn, :error). The default is :info.
+ def benchmark(message = "Benchmarking", level = :info)
+ if @logger
+ real = Benchmark.realtime { yield }
+ @logger.send level, "#{message} (#{'%.5f' % real})"
+ end
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb
new file mode 100644
index 00000000..de2707ac
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb
@@ -0,0 +1,10 @@
+module ActionView
+ module Helpers
+ # See ActionController::Caching::Fragments for usage instructions.
+ module CacheHelper
+ def cache(name = {}, &block)
+ @controller.cache_erb_fragment(block, name)
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb
new file mode 100644
index 00000000..5c1f32a9
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb
@@ -0,0 +1,89 @@
+module ActionView
+ module Helpers
+ # Capture lets you extract parts of code into instance variables which
+ # can be used in other points of the template or even layout file.
+ #
+ # == Capturing a block into an instance variable
+ #
+ # <% @script = capture do %>
+ # [some html...]
+ # <% end %>
+ #
+ #
+ # == Add javascript to header using content_for
+ #
+ # content_for("name") is a wrapper for capture which will store the
+ # fragment in a instance variable similar to @content_for_layout.
+ #
+ # layout.rhtml:
+ #
+ #
+ #
+ # layout with js
+ #
+ #
+ #
+ # <%= @content_for_layout %>
+ #
+ #
+ #
+ # view.rhtml
+ #
+ # This page shows an alert box!
+ #
+ # <% content_for("script") do %>
+ # alert('hello world')
+ # <% end %>
+ #
+ # Normal view text
+ module CaptureHelper
+ # Capture allows you to extract a part of the template into an
+ # instance variable. You can use this instance variable anywhere
+ # in your templates and even in your layout.
+ #
+ # Example:
+ #
+ # <% @greeting = capture do %>
+ # Welcome To my shiny new web page!
+ # <% end %>
+ def capture(*args, &block)
+ # execute the block
+ buffer = eval("_erbout", block.binding)
+ pos = buffer.length
+ block.call(*args)
+
+ # extract the block
+ data = buffer[pos..-1]
+
+ # replace it in the original with empty string
+ buffer[pos..-1] = ''
+
+ data
+ end
+
+ # Content_for will store the given block
+ # in an instance variable for later use in another template
+ # or in the layout.
+ #
+ # The name of the instance variable is content_for_
+ # to stay consistent with @content_for_layout which is used
+ # by ActionView's layouts
+ #
+ # Example:
+ #
+ # <% content_for("header") do %>
+ # alert('hello world')
+ # <% end %>
+ #
+ # You can use @content_for_header anywhere in your templates.
+ #
+ # NOTE: Beware that content_for is ignored in caches. So you shouldn't use it
+ # for elements that are going to be fragment cached.
+ def content_for(name, &block)
+ eval "@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)"
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb
new file mode 100644
index 00000000..ba1834b5
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb
@@ -0,0 +1,297 @@
+require "date"
+
+module ActionView
+ module Helpers
+ # The Date Helper primarily creates select/option tags for different kinds of dates and date elements. All of the select-type methods
+ # share a number of common options that are as follows:
+ #
+ # * :prefix - overwrites the default prefix of "date" used for the select names. So specifying "birthday" would give
+ # birthday[month] instead of date[month] if passed to the select_month method.
+ # * :include_blank - set to true if it should be possible to set an empty date.
+ # * :discard_type - set to true if you want to discard the type part of the select name. If set to true, the select_month
+ # method would use simply "date" (which can be overwritten using :prefix) instead of "date[month]".
+ module DateHelper
+ DEFAULT_PREFIX = 'date' unless const_defined?('DEFAULT_PREFIX')
+
+ # Reports the approximate distance in time between two Time objects or integers.
+ # For example, if the distance is 47 minutes, it'll return
+ # "about 1 hour". See the source for the complete wording list.
+ #
+ # Integers are interpreted as seconds. So,
+ # distance_of_time_in_words(50) returns "less than a minute".
+ #
+ # Set include_seconds to true if you want more detailed approximations if distance < 1 minute
+ def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false)
+ from_time = from_time.to_time if from_time.respond_to?(:to_time)
+ to_time = to_time.to_time if to_time.respond_to?(:to_time)
+ distance_in_minutes = (((to_time - from_time).abs)/60).round
+ distance_in_seconds = ((to_time - from_time).abs).round
+
+ case distance_in_minutes
+ when 0..1
+ return (distance_in_minutes==0) ? 'less than a minute' : '1 minute' unless include_seconds
+ case distance_in_seconds
+ when 0..5 then 'less than 5 seconds'
+ when 6..10 then 'less than 10 seconds'
+ when 11..20 then 'less than 20 seconds'
+ when 21..40 then 'half a minute'
+ when 41..59 then 'less than a minute'
+ else '1 minute'
+ end
+
+ when 2..45 then "#{distance_in_minutes} minutes"
+ when 46..90 then 'about 1 hour'
+ when 90..1440 then "about #{(distance_in_minutes.to_f / 60.0).round} hours"
+ when 1441..2880 then '1 day'
+ else "#{(distance_in_minutes / 1440).round} days"
+ end
+ end
+
+ # Like distance_of_time_in_words, but where to_time is fixed to Time.now.
+ def time_ago_in_words(from_time, include_seconds = false)
+ distance_of_time_in_words(from_time, Time.now, include_seconds)
+ end
+
+ alias_method :distance_of_time_in_words_to_now, :time_ago_in_words
+
+ # Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based attribute (identified by
+ # +method+) on an object assigned to the template (identified by +object+). It's possible to tailor the selects through the +options+ hash,
+ # which accepts all the keys that each of the individual select builders do (like :use_month_numbers for select_month) as well as a range of
+ # discard options. The discard options are :discard_year, :discard_month and :discard_day. Set to true, they'll
+ # drop the respective select. Discarding the month select will also automatically discard the day select. It's also possible to explicitly
+ # set the order of the tags using the :order option with an array of symbols :year, :month and :day in
+ # the desired order. Symbols may be omitted and the respective select is not included.
+ #
+ # Passing :disabled => true as part of the +options+ will make elements inaccessible for change.
+ #
+ # NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed.
+ #
+ # Examples:
+ #
+ # date_select("post", "written_on")
+ # date_select("post", "written_on", :start_year => 1995)
+ # date_select("post", "written_on", :start_year => 1995, :use_month_numbers => true,
+ # :discard_day => true, :include_blank => true)
+ # date_select("post", "written_on", :order => [:day, :month, :year])
+ # date_select("user", "birthday", :order => [:month, :day])
+ #
+ # The selects are prepared for multi-parameter assignment to an Active Record object.
+ def date_select(object, method, options = {})
+ InstanceTag.new(object, method, self).to_date_select_tag(options)
+ end
+
+ # Returns a set of select tags (one for year, month, day, hour, and minute) pre-selected for accessing a specified datetime-based
+ # attribute (identified by +method+) on an object assigned to the template (identified by +object+). Examples:
+ #
+ # datetime_select("post", "written_on")
+ # datetime_select("post", "written_on", :start_year => 1995)
+ #
+ # The selects are prepared for multi-parameter assignment to an Active Record object.
+ def datetime_select(object, method, options = {})
+ InstanceTag.new(object, method, self).to_datetime_select_tag(options)
+ end
+
+ # Returns a set of html select-tags (one for year, month, and day) pre-selected with the +date+.
+ def select_date(date = Date.today, options = {})
+ select_year(date, options) + select_month(date, options) + select_day(date, options)
+ end
+
+ # Returns a set of html select-tags (one for year, month, day, hour, and minute) pre-selected with the +datetime+.
+ def select_datetime(datetime = Time.now, options = {})
+ select_year(datetime, options) + select_month(datetime, options) + select_day(datetime, options) +
+ select_hour(datetime, options) + select_minute(datetime, options)
+ end
+
+ # Returns a set of html select-tags (one for hour and minute)
+ def select_time(datetime = Time.now, options = {})
+ h = select_hour(datetime, options) + select_minute(datetime, options) + (options[:include_seconds] ? select_second(datetime, options) : '')
+ end
+
+ # Returns a select tag with options for each of the seconds 0 through 59 with the current second selected.
+ # The second can also be substituted for a second number.
+ # Override the field name using the :field_name option, 'second' by default.
+ def select_second(datetime, options = {})
+ second_options = []
+
+ 0.upto(59) do |second|
+ second_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.sec) == second) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'second', second_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ # Returns a select tag with options for each of the minutes 0 through 59 with the current minute selected.
+ # Also can return a select tag with options by minute_step from 0 through 59 with the 00 minute selected
+ # The minute can also be substituted for a minute number.
+ # Override the field name using the :field_name option, 'minute' by default.
+ def select_minute(datetime, options = {})
+ minute_options = []
+
+ 0.step(59, options[:minute_step] || 1) do |minute|
+ minute_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.min) == minute) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'minute', minute_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ # Returns a select tag with options for each of the hours 0 through 23 with the current hour selected.
+ # The hour can also be substituted for a hour number.
+ # Override the field name using the :field_name option, 'hour' by default.
+ def select_hour(datetime, options = {})
+ hour_options = []
+
+ 0.upto(23) do |hour|
+ hour_options << ((datetime && (datetime.kind_of?(Fixnum) ? datetime : datetime.hour) == hour) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'hour', hour_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ # Returns a select tag with options for each of the days 1 through 31 with the current day selected.
+ # The date can also be substituted for a hour number.
+ # Override the field name using the :field_name option, 'day' by default.
+ def select_day(date, options = {})
+ day_options = []
+
+ 1.upto(31) do |day|
+ day_options << ((date && (date.kind_of?(Fixnum) ? date : date.day) == day) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'day', day_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ # Returns a select tag with options for each of the months January through December with the current month selected.
+ # The month names are presented as keys (what's shown to the user) and the month numbers (1-12) are used as values
+ # (what's submitted to the server). It's also possible to use month numbers for the presentation instead of names --
+ # set the :use_month_numbers key in +options+ to true for this to happen. If you want both numbers and names,
+ # set the :add_month_numbers key in +options+ to true. Examples:
+ #
+ # select_month(Date.today) # Will use keys like "January", "March"
+ # select_month(Date.today, :use_month_numbers => true) # Will use keys like "1", "3"
+ # select_month(Date.today, :add_month_numbers => true) # Will use keys like "1 - January", "3 - March"
+ #
+ # Override the field name using the :field_name option, 'month' by default.
+ #
+ # If you would prefer to show month names as abbreviations, set the
+ # :use_short_month key in +options+ to true.
+ def select_month(date, options = {})
+ month_options = []
+ month_names = options[:use_short_month] ? Date::ABBR_MONTHNAMES : Date::MONTHNAMES
+
+ 1.upto(12) do |month_number|
+ month_name = if options[:use_month_numbers]
+ month_number
+ elsif options[:add_month_numbers]
+ month_number.to_s + ' - ' + month_names[month_number]
+ else
+ month_names[month_number]
+ end
+
+ month_options << ((date && (date.kind_of?(Fixnum) ? date : date.month) == month_number) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'month', month_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ # Returns a select tag with options for each of the five years on each side of the current, which is selected. The five year radius
+ # can be changed using the :start_year and :end_year keys in the +options+. Both ascending and descending year
+ # lists are supported by making :start_year less than or greater than :end_year. The date can also be
+ # substituted for a year given as a number. Example:
+ #
+ # select_year(Date.today, :start_year => 1992, :end_year => 2007) # ascending year values
+ # select_year(Date.today, :start_year => 2005, :end_year => 1900) # descending year values
+ #
+ # Override the field name using the :field_name option, 'year' by default.
+ def select_year(date, options = {})
+ year_options = []
+ y = date ? (date.kind_of?(Fixnum) ? (y = (date == 0) ? Date.today.year : date) : date.year) : Date.today.year
+
+ start_year, end_year = (options[:start_year] || y-5), (options[:end_year] || y+5)
+ step_val = start_year < end_year ? 1 : -1
+
+ start_year.step(end_year, step_val) do |year|
+ year_options << ((date && (date.kind_of?(Fixnum) ? date : date.year) == year) ?
+ %(\n) :
+ %(\n)
+ )
+ end
+
+ select_html(options[:field_name] || 'year', year_options, options[:prefix], options[:include_blank], options[:discard_type], options[:disabled])
+ end
+
+ private
+ def select_html(type, options, prefix = nil, include_blank = false, discard_type = false, disabled = false)
+ select_html = %(\n"
+ end
+
+ def leading_zero_on_single_digits(number)
+ number > 9 ? number : "0#{number}"
+ end
+ end
+
+ class InstanceTag #:nodoc:
+ include DateHelper
+
+ def to_date_select_tag(options = {})
+ defaults = { :discard_type => true }
+ options = defaults.merge(options)
+ options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") }
+ date = options[:include_blank] ? (value || 0) : (value || Date.today)
+
+ date_select = ''
+ options[:order] = [:month, :year, :day] if options[:month_before_year] # For backwards compatibility
+ options[:order] ||= [:year, :month, :day]
+
+ position = {:year => 1, :month => 2, :day => 3}
+
+ discard = {}
+ discard[:year] = true if options[:discard_year]
+ discard[:month] = true if options[:discard_month]
+ discard[:day] = true if options[:discard_day] or options[:discard_month]
+
+ options[:order].each do |param|
+ date_select << self.send("select_#{param}", date, options_with_prefix.call(position[param])) unless discard[param]
+ end
+
+ date_select
+ end
+
+ def to_datetime_select_tag(options = {})
+ defaults = { :discard_type => true }
+ options = defaults.merge(options)
+ options_with_prefix = Proc.new { |position| options.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") }
+ datetime = options[:include_blank] ? (value || nil) : (value || Time.now)
+
+ datetime_select = select_year(datetime, options_with_prefix.call(1))
+ datetime_select << select_month(datetime, options_with_prefix.call(2)) unless options[:discard_month]
+ datetime_select << select_day(datetime, options_with_prefix.call(3)) unless options[:discard_day] || options[:discard_month]
+ datetime_select << ' — ' + select_hour(datetime, options_with_prefix.call(4)) unless options[:discard_hour]
+ datetime_select << ' : ' + select_minute(datetime, options_with_prefix.call(5)) unless options[:discard_minute] || options[:discard_hour]
+
+ datetime_select
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb
new file mode 100644
index 00000000..8baea6f4
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb
@@ -0,0 +1,17 @@
+module ActionView
+ module Helpers
+ # Provides a set of methods for making it easier to locate problems.
+ module DebugHelper
+ # Returns a
-tag set with the +object+ dumped by YAML. Very readable way to inspect an object.
+ def debug(object)
+ begin
+ Marshal::dump(object)
+ "
#{h(object.to_yaml).gsub(" ", " ")}
"
+ rescue Object => e
+ # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
+ "#{h(object.inspect)}"
+ end
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
new file mode 100644
index 00000000..eadaeaea
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
@@ -0,0 +1,290 @@
+require 'cgi'
+require File.dirname(__FILE__) + '/date_helper'
+require File.dirname(__FILE__) + '/tag_helper'
+
+module ActionView
+ module Helpers
+ # Provides a set of methods for working with forms and especially forms related to objects assigned to the template.
+ # The following is an example of a complete form for a person object that works for both creates and updates built
+ # with all the form helpers. The @person object was assigned by an action on the controller:
+ #
+ #
+ # ...is compiled to:
+ #
+ #
+ #
+ # If the object name contains square brackets the id for the object will be inserted. Example:
+ #
+ # <%= textfield "person[]", "name" %>
+ #
+ # ...becomes:
+ #
+ #
+ #
+ # If the helper is being used to generate a repetitive sequence of similar form elements, for example in a partial
+ # used by render_collection_of_partials, the "index" option may come in handy. Example:
+ #
+ # <%= text_field "person", "name", "index" => 1 %>
+ #
+ # becomes
+ #
+ #
+ #
+ # There's also methods for helping to build form tags in link:classes/ActionView/Helpers/FormOptionsHelper.html,
+ # link:classes/ActionView/Helpers/DateHelper.html, and link:classes/ActionView/Helpers/ActiveRecordHelper.html
+ module FormHelper
+ # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object
+ # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
+ # hash with +options+.
+ #
+ # Examples (call, result):
+ # text_field("post", "title", "size" => 20)
+ #
+ def text_field(object, method, options = {})
+ InstanceTag.new(object, method, self).to_input_field_tag("text", options)
+ end
+
+ # Works just like text_field, but returns an input tag of the "password" type instead.
+ def password_field(object, method, options = {})
+ InstanceTag.new(object, method, self).to_input_field_tag("password", options)
+ end
+
+ # Works just like text_field, but returns an input tag of the "hidden" type instead.
+ def hidden_field(object, method, options = {})
+ InstanceTag.new(object, method, self).to_input_field_tag("hidden", options)
+ end
+
+ # Works just like text_field, but returns an input tag of the "file" type instead, which won't have a default value.
+ def file_field(object, method, options = {})
+ InstanceTag.new(object, method, self).to_input_field_tag("file", options)
+ end
+
+ # Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+)
+ # on an object assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
+ # hash with +options+.
+ #
+ # Example (call, result):
+ # text_area("post", "body", "cols" => 20, "rows" => 40)
+ #
+ def text_area(object, method, options = {})
+ InstanceTag.new(object, method, self).to_text_area_tag(options)
+ end
+
+ # Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+) on an object
+ # assigned to the template (identified by +object+). It's intended that +method+ returns an integer and if that
+ # integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed as a
+ # hash with +options+. The +checked_value+ defaults to 1 while the default +unchecked_value+
+ # is set to 0 which is convenient for boolean values. Usually unchecked checkboxes don't post anything.
+ # We work around this problem by adding a hidden value with the same name as the checkbox.
+ #
+ # Example (call, result). Imagine that @post.validated? returns 1:
+ # check_box("post", "validated")
+ #
+ #
+ #
+ # Example (call, result). Imagine that @puppy.gooddog returns no:
+ # check_box("puppy", "gooddog", {}, "yes", "no")
+ #
+ #
+ def check_box(object, method, options = {}, checked_value = "1", unchecked_value = "0")
+ InstanceTag.new(object, method, self).to_check_box_tag(options, checked_value, unchecked_value)
+ end
+
+ # Returns a radio button tag for accessing a specified attribute (identified by +method+) on an object
+ # assigned to the template (identified by +object+). If the current value of +method+ is +tag_value+ the
+ # radio button will be checked. Additional options on the input tag can be passed as a
+ # hash with +options+.
+ # Example (call, result). Imagine that @post.category returns "rails":
+ # radio_button("post", "category", "rails")
+ # radio_button("post", "category", "java")
+ #
+ #
+ #
+ def radio_button(object, method, tag_value, options = {})
+ InstanceTag.new(object, method, self).to_radio_button_tag(tag_value, options)
+ end
+ end
+
+ class InstanceTag #:nodoc:
+ include Helpers::TagHelper
+
+ attr_reader :method_name, :object_name
+
+ DEFAULT_FIELD_OPTIONS = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS)
+ DEFAULT_RADIO_OPTIONS = { }.freeze unless const_defined?(:DEFAULT_RADIO_OPTIONS)
+ DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 40, "rows" => 20 }.freeze unless const_defined?(:DEFAULT_TEXT_AREA_OPTIONS)
+ DEFAULT_DATE_OPTIONS = { :discard_type => true }.freeze unless const_defined?(:DEFAULT_DATE_OPTIONS)
+
+ def initialize(object_name, method_name, template_object, local_binding = nil)
+ @object_name, @method_name = object_name.to_s, method_name.to_s
+ @template_object, @local_binding = template_object, local_binding
+ if @object_name.sub!(/\[\]$/,"")
+ @auto_index = @template_object.instance_variable_get("@#{Regexp.last_match.pre_match}").id_before_type_cast
+ end
+ end
+
+ def to_input_field_tag(field_type, options = {})
+ options = options.stringify_keys
+ options["size"] ||= options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"]
+ options = DEFAULT_FIELD_OPTIONS.merge(options)
+ if field_type == "hidden"
+ options.delete("size")
+ end
+ options["type"] = field_type
+ options["value"] ||= value_before_type_cast unless field_type == "file"
+ add_default_name_and_id(options)
+ tag("input", options)
+ end
+
+ def to_radio_button_tag(tag_value, options = {})
+ options = DEFAULT_RADIO_OPTIONS.merge(options.stringify_keys)
+ options["type"] = "radio"
+ options["value"] = tag_value
+ options["checked"] = "checked" if value.to_s == tag_value.to_s
+ pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase
+ options["id"] = @auto_index ?
+ "#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" :
+ "#{@object_name}_#{@method_name}_#{pretty_tag_value}"
+ add_default_name_and_id(options)
+ tag("input", options)
+ end
+
+ def to_text_area_tag(options = {})
+ options = DEFAULT_TEXT_AREA_OPTIONS.merge(options.stringify_keys)
+ add_default_name_and_id(options)
+ content_tag("textarea", html_escape(value_before_type_cast), options)
+ end
+
+ def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
+ options = options.stringify_keys
+ options["type"] = "checkbox"
+ options["value"] = checked_value
+ checked = case value
+ when TrueClass, FalseClass
+ value
+ when NilClass
+ false
+ when Integer
+ value != 0
+ when String
+ value == checked_value
+ else
+ value.to_i != 0
+ end
+ if checked || options["checked"] == "checked"
+ options["checked"] = "checked"
+ else
+ options.delete("checked")
+ end
+ add_default_name_and_id(options)
+ tag("input", options) << tag("input", "name" => options["name"], "type" => "hidden", "value" => unchecked_value)
+ end
+
+ def to_date_tag()
+ defaults = DEFAULT_DATE_OPTIONS.dup
+ date = value || Date.today
+ options = Proc.new { |position| defaults.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") }
+ html_day_select(date, options.call(3)) +
+ html_month_select(date, options.call(2)) +
+ html_year_select(date, options.call(1))
+ end
+
+ def to_boolean_select_tag(options = {})
+ options = options.stringify_keys
+ add_default_name_and_id(options)
+ tag_text = ""
+ end
+
+ def to_content_tag(tag_name, options = {})
+ content_tag(tag_name, value, options)
+ end
+
+ def object
+ @template_object.instance_variable_get "@#{@object_name}"
+ end
+
+ def value
+ object.send(@method_name) unless object.nil?
+ end
+
+ def value_before_type_cast
+ unless object.nil?
+ object.respond_to?(@method_name + "_before_type_cast") ?
+ object.send(@method_name + "_before_type_cast") :
+ object.send(@method_name)
+ end
+ end
+
+ private
+ def add_default_name_and_id(options)
+ if options.has_key?("index")
+ options["name"] ||= tag_name_with_index(options["index"])
+ options["id"] ||= tag_id_with_index(options["index"])
+ options.delete("index")
+ elsif @auto_index
+ options["name"] ||= tag_name_with_index(@auto_index)
+ options["id"] ||= tag_id_with_index(@auto_index)
+ else
+ options["name"] ||= tag_name
+ options["id"] ||= tag_id
+ end
+ end
+
+ def tag_name
+ "#{@object_name}[#{@method_name}]"
+ end
+
+ def tag_name_with_index(index)
+ "#{@object_name}[#{index}][#{@method_name}]"
+ end
+
+ def tag_id
+ "#{@object_name}_#{@method_name}"
+ end
+
+ def tag_id_with_index(index)
+ "#{@object_name}_#{index}_#{@method_name}"
+ end
+ end
+ end
+end
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb
new file mode 100644
index 00000000..a529b71e
--- /dev/null
+++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -0,0 +1,339 @@
+require 'cgi'
+require 'erb'
+require File.dirname(__FILE__) + '/form_helper'
+
+module ActionView
+ module Helpers
+ # Provides a number of methods for turning different kinds of containers into a set of option tags.
+ # == Options
+ # The collection_select, country_select, select,
+ # and time_zone_select methods take an options parameter,
+ # a hash.
+ #
+ # * :include_blank - set to true if the first option element of the select element is a blank. Useful if there is not a default value required for the select element. For example,
+ #
+ # select("post", "category", Post::CATEGORIES, {:include_blank => true})
+ #
+ # could become:
+ #
+ #
+ #
+ # * :prompt - set to true or a prompt string. When the select element doesn't have a value yet, this prepends an option with a generic prompt -- "Please select" -- or the given prompt string.
+ #
+ # Another common case is a select tag for an belongs_to-associated object. For example,
+ #
+ # select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] })
+ #
+ # could become:
+ #
+ #
+ module FormOptionsHelper
+ include ERB::Util
+
+ # Create a select tag and a series of contained option tags for the provided object and method.
+ # The option currently held by the object will be selected, provided that the object is available.
+ # See options_for_select for the required format of the choices parameter.
+ #
+ # Example with @post.person_id => 1:
+ # select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true })
+ #
+ # could become:
+ #
+ #
+ #
+ # This can be used to provide a default set of options in the standard way: before rendering the create form, a
+ # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved
+ # to the database. Instead, a second model object is created when the create request is received.
+ # This allows the user to submit a form page more than once with the expected results of creating multiple records.
+ # In addition, this allows a single partial to be used to generate form inputs for both edit and create forms.
+ def select(object, method, choices, options = {}, html_options = {})
+ InstanceTag.new(object, method, self).to_select_tag(choices, options, html_options)
+ end
+
+ # Return select and option tags for the given object and method using options_from_collection_for_select to generate the list of option tags.
+ def collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})
+ InstanceTag.new(object, method, self).to_collection_select_tag(collection, value_method, text_method, options, html_options)
+ end
+
+ # Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.
+ def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
+ InstanceTag.new(object, method, self).to_country_select_tag(priority_countries, options, html_options)
+ end
+
+ # Return select and option tags for the given object and method, using
+ # #time_zone_options_for_select to generate the list of option tags.
+ #
+ # In addition to the :include_blank option documented above,
+ # this method also supports a :model option, which defaults
+ # to TimeZone. This may be used by users to specify a different time
+ # zone model object. (See #time_zone_options_for_select for more
+ # information.)
+ def time_zone_select(object, method, priority_zones = nil, options = {}, html_options = {})
+ InstanceTag.new(object, method, self).to_time_zone_select_tag(priority_zones, options, html_options)
+ end
+
+ # Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container
+ # where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and
+ # the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values
+ # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +Selected+
+ # may also be an array of values to be selected when using a multiple select.
+ #
+ # Examples (call, result):
+ # options_for_select([["Dollar", "$"], ["Kroner", "DKK"]])
+ # \n
+ #
+ # options_for_select([ "VISA", "MasterCard" ], "MasterCard")
+ # \n
+ #
+ # options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40")
+ # \n
+ #
+ # options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"])
+ # \n\n
+ #
+ # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
+ def options_for_select(container, selected = nil)
+ container = container.to_a if Hash === container
+
+ options_for_select = container.inject([]) do |options, element|
+ if !element.is_a?(String) and element.respond_to?(:first) and element.respond_to?(:last)
+ is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element.last) : element.last == selected) )
+ is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element.last) : element.last == selected) )
+ if is_selected
+ options << ""
+ else
+ options << ""
+ end
+ else
+ is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element) : element == selected) )
+ is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element) : element == selected) )
+ options << ((is_selected) ? "" : "")
+ end
+ end
+
+ options_for_select.join("\n")
+ end
+
+ # Returns a string of option tags that have been compiled by iterating over the +collection+ and assigning the
+ # the result of a call to the +value_method+ as the option value and the +text_method+ as the option text.
+ # If +selected_value+ is specified, the element returning a match on +value_method+ will get the selected option tag.
+ #
+ # Example (call, result). Imagine a loop iterating over each +person+ in @project.people to generate an input tag:
+ # options_from_collection_for_select(@project.people, "id", "name")
+ #
+ #
+ # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
+ def options_from_collection_for_select(collection, value_method, text_method, selected_value = nil)
+ options_for_select(
+ collection.inject([]) { |options, object| options << [ object.send(text_method), object.send(value_method) ] },
+ selected_value
+ )
+ end
+
+ # Returns a string of option tags, like options_from_collection_for_select, but surrounds them with