Browse files

Docas.io synced with f19ffd4: Merge pull request #387 from mickeyreis…

…s/master
  • Loading branch information...
1 parent 9d4a75f commit 9ccb2c439b8519fcae979eeee0b98bb223458fe1 @docas docas committed Jul 9, 2012
Showing with 14,164 additions and 67 deletions.
  1. 0 "spec/docas.idx
  2. 0 "spec/fixtures/attachments/docas.idx
  3. 0 "spec/fixtures/docas.idx
  4. +50 −0 CONTRIBUTING.html
  5. +60 −0 Gemfile.html
  6. +656 −0 README.html
  7. +72 −0 Rakefile.html
  8. +14 −0 docas.idx
  9. +719 −67 index.html
  10. +6 −0 javascript/docco.min.js
  11. +31 −0 javascript/index.min.js
  12. +4 −0 lib/docas.idx
  13. +123 −0 lib/mail.html
  14. +136 −0 lib/mail/attachments_list.html
  15. +340 −0 lib/mail/body.html
  16. +104 −0 lib/mail/configuration.html
  17. +6 −0 lib/mail/core_extensions/docas.idx
  18. +47 −0 lib/mail/core_extensions/nil.html
  19. +43 −0 lib/mail/core_extensions/object.html
  20. +87 −0 lib/mail/core_extensions/shell_escape.html
  21. +56 −0 lib/mail/core_extensions/smtp.html
  22. +64 −0 lib/mail/core_extensions/string.html
  23. +178 −0 lib/mail/core_extensions/string/access.html
  24. +2 −0 lib/mail/core_extensions/string/docas.idx
  25. +110 −0 lib/mail/core_extensions/string/multibyte.html
  26. +29 −0 lib/mail/docas.idx
  27. +45 −0 lib/mail/elements.html
  28. +346 −0 lib/mail/elements/address.html
  29. +110 −0 lib/mail/elements/address_list.html
  30. +60 −0 lib/mail/elements/content_disposition_element.html
  31. +55 −0 lib/mail/elements/content_location_element.html
  32. +54 −0 lib/mail/elements/content_transfer_encoding_element.html
  33. +65 −0 lib/mail/elements/content_type_element.html
  34. +56 −0 lib/mail/elements/date_time_element.html
  35. +12 −0 lib/mail/elements/docas.idx
  36. +64 −0 lib/mail/elements/envelope_from_element.html
  37. +59 −0 lib/mail/elements/message_ids_element.html
  38. +56 −0 lib/mail/elements/mime_version_element.html
  39. +51 −0 lib/mail/elements/phrase_list.html
  40. +60 −0 lib/mail/elements/received_element.html
  41. +311 −0 lib/mail/encodings.html
  42. +64 −0 lib/mail/encodings/7bit.html
  43. +64 −0 lib/mail/encodings/8bit.html
  44. +64 −0 lib/mail/encodings/base64.html
  45. +64 −0 lib/mail/encodings/binary.html
  46. +6 −0 lib/mail/encodings/docas.idx
  47. +70 −0 lib/mail/encodings/quoted_printable.html
  48. +88 −0 lib/mail/encodings/transfer_encoding.html
  49. +65 −0 lib/mail/envelope.html
  50. +269 −0 lib/mail/field.html
  51. +63 −0 lib/mail/field_list.html
  52. +66 −0 lib/mail/fields.html
  53. +86 −0 lib/mail/fields/bcc_field.html
  54. +84 −0 lib/mail/fields/cc_field.html
  55. +70 −0 lib/mail/fields/comments_field.html
  56. +47 −0 lib/mail/fields/common/address_container.html
  57. +160 −0 lib/mail/fields/common/common_address.html
  58. +74 −0 lib/mail/fields/common/common_date.html
  59. +81 −0 lib/mail/fields/common/common_field.html
  60. +74 −0 lib/mail/fields/common/common_message_id.html
  61. +6 −0 lib/mail/fields/common/docas.idx
  62. +87 −0 lib/mail/fields/common/parameter_hash.html
  63. +46 −0 lib/mail/fields/content_description_field.html
  64. +99 −0 lib/mail/fields/content_disposition_field.html
  65. +91 −0 lib/mail/fields/content_id_field.html
  66. +69 −0 lib/mail/fields/content_location_field.html
  67. +78 −0 lib/mail/fields/content_transfer_encoding_field.html
  68. +236 −0 lib/mail/fields/content_type_field.html
  69. +86 −0 lib/mail/fields/date_field.html
  70. +33 −0 lib/mail/fields/docas.idx
  71. +84 −0 lib/mail/fields/from_field.html
  72. +84 −0 lib/mail/fields/in_reply_to_field.html
  73. +74 −0 lib/mail/fields/keywords_field.html
  74. +112 −0 lib/mail/fields/message_id_field.html
  75. +80 −0 lib/mail/fields/mime_version_field.html
  76. +43 −0 lib/mail/fields/optional_field.html
  77. +104 −0 lib/mail/fields/received_field.html
  78. +84 −0 lib/mail/fields/references_field.html
  79. +84 −0 lib/mail/fields/reply_to_field.html
  80. +84 −0 lib/mail/fields/resent_bcc_field.html
  81. +84 −0 lib/mail/fields/resent_cc_field.html
  82. +65 −0 lib/mail/fields/resent_date_field.html
  83. +84 −0 lib/mail/fields/resent_from_field.html
  84. +64 −0 lib/mail/fields/resent_message_id_field.html
  85. +91 −0 lib/mail/fields/resent_sender_field.html
  86. +84 −0 lib/mail/fields/resent_to_field.html
  87. +94 −0 lib/mail/fields/return_path_field.html
  88. +96 −0 lib/mail/fields/sender_field.html
  89. +83 −0 lib/mail/fields/structured_field.html
  90. +46 −0 lib/mail/fields/subject_field.html
  91. +84 −0 lib/mail/fields/to_field.html
  92. +233 −0 lib/mail/fields/unstructured_field.html
  93. +309 −0 lib/mail/header.html
  94. +172 −0 lib/mail/indifferent_hash.html
  95. +287 −0 lib/mail/mail.html
  96. +1 −0 lib/mail/matchers/docas.idx
  97. +155 −0 lib/mail/matchers/has_sent_mail.html
  98. +2,104 −0 lib/mail/message.html
  99. +74 −0 lib/mail/multibyte.html
  100. +514 −0 lib/mail/multibyte/chars.html
  101. +4 −0 lib/mail/multibyte/docas.idx
  102. +38 −0 lib/mail/multibyte/exceptions.html
  103. +439 −0 lib/mail/multibyte/unicode.html
  104. +94 −0 lib/mail/multibyte/utils.html
  105. +45 −0 lib/mail/network.html
  106. +6 −0 lib/mail/network/delivery_methods/docas.idx
  107. +84 −0 lib/mail/network/delivery_methods/exim.html
  108. +72 −0 lib/mail/network/delivery_methods/file_delivery.html
  109. +94 −0 lib/mail/network/delivery_methods/sendmail.html
  110. +186 −0 lib/mail/network/delivery_methods/smtp.html
  111. +107 −0 lib/mail/network/delivery_methods/smtp_connection.html
  112. +74 −0 lib/mail/network/delivery_methods/test_mailer.html
  113. +2 −0 lib/mail/network/docas.idx
  114. +90 −0 lib/mail/network/retriever_methods/base.html
  115. +4 −0 lib/mail/network/retriever_methods/docas.idx
  116. +197 −0 lib/mail/network/retriever_methods/imap.html
  117. +172 −0 lib/mail/network/retriever_methods/pop3.html
  118. +76 −0 lib/mail/network/retriever_methods/test_retriever.html
  119. +92 −0 lib/mail/parsers/address_lists.html
Sorry, we could not display the entire diff because it was too big.
View
0 "spec/docas.idx
No changes.
View
0 "spec/fixtures/attachments/docas.idx
No changes.
View
0 "spec/fixtures/docas.idx
No changes.
View
50 CONTRIBUTING.html
@@ -0,0 +1,50 @@
+<h1>Contributing to Mail</h1>
+
+<p>Hi there, I welcome pull requests! Here are some thoughts on how to get your
+pull request merged quickly:</p>
+
+<ol>
+<li>Check the Reference RFCs, they are in the References directory, so no excuses.</li>
+<li>Check for a ticket on GitHub, maybe someone else has the problem too</li>
+<li>Make a fork of my GitHub repository</li>
+<li>Run the specs. We only take pull requests with passing tests, and it's great
+to know that you have a clean slate: <code>bundle &amp;&amp; bundle exec rake</code></li>
+<li>Add a spec for your change. Only refactoring and documentation changes
+require no new specs. If you are adding functionality or fixing a bug, we need
+a spec!</li>
+<li>Test the spec <em>at</em> <em>least</em> against MRI-1.9.2 and MRI-1.8.7</li>
+<li>Update the README if needed to reflect your change / addition</li>
+<li>With all specs passing push your changes back to your fork</li>
+<li>Send me a pull request</li>
+</ol>
+
+<p>Note, specs that break MRI 1.8.7 will not be accepted.</p>
+
+<p>At this point you're waiting on us. We like to at least comment on, if not
+accept, pull requests within three business days (and, typically, one business
+day). We may suggest some changes or improvements or alternatives.</p>
+
+<p>Some things that will increase the chance that your pull request is accepted,
+taken straight from the Ruby on Rails guide:</p>
+
+<ul>
+<li>Tell me you have tested it against more than one version of Ruby, RVM is great for
+this. I test against 7 rubies before I push into master.</li>
+<li>Use good, idiomatic, strcutred and modular code</li>
+<li>Include tests that fail without your code, and pass with it</li>
+<li>Update the documentation, the surrounding one, examples elsewhere, guides,
+whatever is affected by your contribution</li>
+</ul>
+
+<p>Syntax:</p>
+
+<ul>
+<li>Two spaces, no tabs.</li>
+<li>No trailing whitespace. Blank lines should not have any space.</li>
+<li>Prefer &amp;&amp;/|| over and/or.</li>
+<li>MyClass.my<em>method(my</em>arg) not my<em>method( my</em>arg ) or my<em>method my</em>arg.</li>
+<li>a = b and not a=b.</li>
+<li>Follow the conventions you see used in the source already.</li>
+</ul>
+
+<p>And in case we didn't emphasize it enough: we love specs!</p>
View
60 Gemfile.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html><head><title>joekychen/mail » Gemfile
+
+</title>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta name="generator" content="Docco">
+<link rel="stylesheet" media="all" href="stylesheets/docco.min.css" />
+
+
+</head>
+<body>
+<div id="container">
+<div id="background"></div>
+<table cellpadding="0" cellspacing="0">
+<thead><tr><th class="docs"><a id="home" href="index.html"></a><h1>Gemfile</h1></th><th class="code"></th></tr></thead>
+<tbody>
+
+
+<tr id="section-1"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-1">&#182;</a></div></td><td class="code"><div class="highlight"><pre><span class="n">source</span> <span class="ss">:rubygems</span>
+
+<span class="n">gem</span> <span class="s2">&quot;activesupport&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 2.3.6&quot;</span>
+<span class="n">gem</span> <span class="s2">&quot;tlsmail&quot;</span> <span class="k">if</span> <span class="no">RUBY_VERSION</span> <span class="o">&lt;=</span> <span class="s1">&#39;1.8.6&#39;</span>
+<span class="n">gem</span> <span class="s2">&quot;mime-types&quot;</span><span class="p">,</span> <span class="s2">&quot;~&gt; 1.16&quot;</span>
+<span class="n">gem</span> <span class="s2">&quot;treetop&quot;</span><span class="p">,</span> <span class="s2">&quot;~&gt; 1.4.10&quot;</span>
+<span class="n">gem</span> <span class="s2">&quot;i18n&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt;= 0.4.0&quot;</span>
+
+<span class="k">if</span> <span class="n">defined?</span><span class="p">(</span><span class="no">RUBY_ENGINE</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="no">RUBY_ENGINE</span> <span class="o">==</span> <span class="s1">&#39;jruby&#39;</span>
+ <span class="n">gem</span> <span class="s1">&#39;jruby-openssl&#39;</span>
+<span class="k">end</span>
+
+<span class="n">group</span> <span class="ss">:test</span> <span class="k">do</span>
+ <span class="n">gem</span> <span class="s2">&quot;rake&quot;</span><span class="p">,</span> <span class="s2">&quot;&gt; 0.8.7&quot;</span>
+ <span class="n">gem</span> <span class="s2">&quot;rspec&quot;</span><span class="p">,</span> <span class="s2">&quot;~&gt; 2.8.0&quot;</span>
+ <span class="k">case</span>
+ <span class="k">when</span> <span class="n">defined?</span><span class="p">(</span><span class="no">RUBY_ENGINE</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="no">RUBY_ENGINE</span> <span class="o">==</span> <span class="s1">&#39;rbx&#39;</span></pre></div></td></tr>
+
+
+<tr id="section-2"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-2">&#182;</a></div><p>Skip it</p></td><td class="code"><div class="highlight"><pre> <span class="k">when</span> <span class="no">RUBY_PLATFORM</span> <span class="o">==</span> <span class="s1">&#39;java&#39;</span></pre></div></td></tr>
+
+
+<tr id="section-3"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-3">&#182;</a></div><p>Skip it</p></td><td class="code"><div class="highlight"><pre> <span class="k">when</span> <span class="no">RUBY_VERSION</span> <span class="o">&lt;</span> <span class="s1">&#39;1.9&#39;</span>
+ <span class="n">gem</span> <span class="s2">&quot;ruby-debug&quot;</span>
+ <span class="k">else</span></pre></div></td></tr>
+
+
+<tr id="section-4"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-4">&#182;</a></div><p>Skip it</p></td><td class="code"><div class="highlight"><pre> <span class="k">end</span>
+<span class="k">end</span>
+
+</pre></div></td></tr>
+
+</tbody>
+</table>
+</div>
+
+</body>
+<script>docas={repo:"joekychen/mail",depth:0}</script>
+<script>document.write('<script src=' + ('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js' : 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')+'><\\/script>')</script>
+<script src="http://baoshan.github.com/moment/min/moment.min.js"></script>
+<script src="javascript/docco.min.js"></script>
+</html>
View
656 README.html
@@ -0,0 +1,656 @@
+<h1>Mail</h1>
+
+<h2>Introduction</h2>
+
+<p>Mail is an internet library for Ruby that is designed to handle emails
+generation, parsing and sending in a simple, rubyesque manner.</p>
+
+<p>The purpose of this library is to provide a single point of access to handle
+all email functions, including sending and receiving emails. All network
+type actions are done through proxy methods to Net::SMTP, Net::POP3 etc.</p>
+
+<p>Built from my experience with TMail, it is designed to be a pure ruby
+implementation that makes generating, sending and parsing emails a no
+brainer.</p>
+
+<p>It is also designed form the ground up to work with Ruby 1.9. This is because
+Ruby 1.9 handles text encodings much more magically than Ruby 1.8.x and so
+these features have been taken full advantage of in this library allowing
+Mail to handle a lot more messages more cleanly than TMail. Mail does run on
+Ruby 1.8.x... it's just not as fun to code.</p>
+
+<p>Finally, Mail has been designed with a very simple object oriented system
+that really opens up the email messages you are parsing, if you know what
+you are doing, you can fiddle with every last bit of your email directly.</p>
+
+<h2>Donations</h2>
+
+<p>Mail has been downloaded millions of times, by people around the world, in fact,
+it represents more than 1% of <em>all</em> gems downloaded. </p>
+
+<p>It is (like all open source software) a labour of love and something I am doing
+with my own free time. If you would like to say thanks, please feel free to
+<a href="http://www.pledgie.com/campaigns/8790">make a donation</a> and feel free to send
+me a nice email :)</p>
+
+<p><a href='http://www.pledgie.com/campaigns/8790'><img alt='Click here to lend your support to: mail and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/8790.png?skin_name=chrome' border='0' /></a></p>
+
+<h2>Compatibility</h2>
+
+<p>Mail is tested by Travis (<img src="https://secure.travis-ci.org/mikel/mail.png" alt="Travis Build Status" title="Build Status" />) and works on the following platforms:</p>
+
+<ul>
+<li>jruby-1.6.5.1 [ x86_64 ]</li>
+<li>rbx-head-d18 [ x86_64 ]</li>
+<li>ree-1.8.7-2011.03 [ i686 ]</li>
+<li>ruby-1.8.7-p357 [ i686 ]</li>
+<li>ruby-1.9.2-p290 [ x86_64 ]</li>
+<li>ruby-1.9.3-p0 [ x86_64 ]</li>
+</ul>
+
+<h2>Discussion</h2>
+
+<p>If you want to discuss mail with like minded individuals, please subscribe to
+the <a href="http://groups.google.com/group/mail-ruby">Google Group</a>.</p>
+
+<h2>Current Capabilities of Mail</h2>
+
+<ul>
+<li>RFC2822 Support, Reading and Writing</li>
+<li>RFC2045-2049 Support for multipart emails</li>
+<li>Support for creating multipart alternate emails</li>
+<li>Support for reading multipart/report emails &amp; getting details from such</li>
+<li>Support for multibyte emails - needs quite a lot of work and testing</li>
+<li>Wrappers for File, Net/POP3, Net/SMTP</li>
+<li>Auto encoding of non US-ASCII header fields</li>
+<li>Auto encoding of non US-ASCII bodies</li>
+</ul>
+
+<p>Mail is RFC2822 compliant now, that is, it can parse and generate valid US-ASCII
+emails. There are a few obsoleted syntax emails that it will have problems with, but
+it also is quite robust, meaning, if it finds something it doesn't understand it will
+not crash, instead, it will skip the problem and keep parsing. In the case of a header
+it doesn't understand, it will initialise the header as an optional unstructured
+field and continue parsing.</p>
+
+<p>This means Mail won't (ever) crunch your data (I think).</p>
+
+<p>You can also create MIME emails. There are helper methods for making a
+multipart/alternate email for text/plain and text/html (the most common pair)
+and you can manually create any other type of MIME email.</p>
+
+<h2>Roadmap</h2>
+
+<p>Next TODO:</p>
+
+<ul>
+<li>Improve MIME support for character sets in headers, currently works, mostly, needs
+refinement.</li>
+</ul>
+
+<h2>Testing Policy</h2>
+
+<p>Basically... we do BDD on Mail. No method gets written in Mail without a
+corresponding or covering spec. We expect as a minimum 100% coverage
+measured by RCov. While this is not perfect by any measure, it is pretty
+good. Additionally, all functional tests from TMail are to be passing before
+the gem gets released.</p>
+
+<p>It also means you can be sure Mail will behave correctly.</p>
+
+<h2>API Policy</h2>
+
+<p>No API removals within a single point release. All removals to be deprecated with
+warnings for at least one MINOR point release before removal.</p>
+
+<p>Also, all private or protected methods to be declared as such - though this is still I/P.</p>
+
+<h2>Installation</h2>
+
+<p>Installation is fairly simple, I host mail on rubygems, so you can just do:</p>
+
+<pre><code># gem install mail
+</code></pre>
+
+<h2>Encodings</h2>
+
+<p>If you didn't know, handling encodings in Emails is not as straight forward as you
+would hope.</p>
+
+<p>I have tried to simplify it some:</p>
+
+<ol>
+<li><p>All objects that can render into an email, have an <code>#encoded</code> method. Encoded will
+return the object as a complete string ready to send in the mail system, that is,
+it will include the header field and value and CRLF at the end and wrapped as
+needed.</p></li>
+<li><p>All objects that can render into an email, have a :decoded method. Decoded will
+return the object's "value" only as a string. This means it will not include
+the header fields (like 'To:' or 'Subject:').</p></li>
+<li><p>By default, calling <code>#to<em>s</code> on a container object will call its encoded
+method, while <code>#to</em>s</code> on a field object will call it's decoded method.
+So calling <code>#to<em>s</code> on a Mail object will return the mail, all encoded
+ready to send, while calling <code>#to</em>s</code> on the From field or the body will
+return the decoded value of the object. The header object of Mail is considered a
+container. If you are in doubt, call <code>#encoded</code>, or <code>#decoded</code>
+explicitly, this is safer if you are not sure.</p></li>
+<li><p>Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
+provide decoded parameter values when you call the parameter names as methods against
+the object.</p></li>
+<li><p>Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
+provide encoded parameter values when you call the parameter names through the
+<code>object.parameters['<parameter_name>']</code> method call.</p></li>
+</ol>
+
+<h2>Contributing</h2>
+
+<p>Please do! Contributing is easy in Mail. Please read the CONTRIBUTING.md document for more info</p>
+
+<h2>Usage</h2>
+
+<p>All major mail functions should be able to happen from the Mail module.
+So, you should be able to just <code>require 'mail'</code> to get started.</p>
+
+<h3>Making an email</h3>
+
+<p>```ruby
+mail = Mail.new do
+ from 'mikel@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'This is a test email'
+ body File.read('body.txt')
+end</p>
+
+<p>mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...
+```</p>
+
+<h3>Making an email, have it your way:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ body File.read('body.txt')
+end</p>
+
+<p>mail['from'] = 'mikel@test.lindsaar.net'
+mail[:to] = 'you@test.lindsaar.net'
+mail.subject = 'This is a test email'</p>
+
+<p>mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...
+```</p>
+
+<h3>Don't Worry About Message IDs:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ to 'you@test.lindsaar.net'
+ body 'Some simple body'
+end</p>
+
+<p>mail.to<em>s =~ /Message-ID: &lt;[\d\w</em>]+@.+.mail/ #=> 27
+```</p>
+
+<p>Mail will automatically add a Message-ID field if it is missing and
+give it a unique, random Message-ID along the lines of:</p>
+
+<pre><code>&lt;4a7ff76d7016_13a81ab802e1@local.fqdn.mail&gt;
+</code></pre>
+
+<h3>Or do worry about Message-IDs:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ to 'you@test.lindsaar.net'
+ message_id '<a href="&#109;&#x61;&#x69;&#108;&#116;&#x6F;:T&#x68;i&#115;&#73;&#115;&#x4D;&#121;M&#x65;&#x73;&#115;&#x61;&#x67;&#x65;&#73;&#100;&#x40;s&#111;&#x6D;&#x65;&#46;d&#111;&#109;&#97;&#105;&#x6E;&#46;&#x63;&#x6F;&#109;">T&#x68;i&#115;&#73;&#115;&#x4D;&#121;M&#x65;&#x73;&#115;&#x61;&#x67;&#x65;&#73;&#100;&#x40;s&#111;&#x6D;&#x65;&#46;d&#111;&#109;&#97;&#105;&#x6E;&#46;&#x63;&#x6F;&#109;</a>'
+ body 'Some simple body'
+end</p>
+
+<p>mail.to_s =~ /Message-ID: <a href="ma&#105;&#x6C;&#116;&#x6F;:&#x54;&#104;&#105;s&#x49;&#x73;&#x4D;&#x79;&#x4D;&#101;&#115;&#115;&#97;&#103;&#x65;&#x49;&#x64;&#64;&#115;&#x6F;&#109;&#x65;&#46;&#100;&#x6F;&#x6D;&#x61;&#x69;&#x6E;&#x2E;&#99;&#x6F;&#109;">&#x54;&#104;&#105;s&#x49;&#x73;&#x4D;&#x79;&#x4D;&#101;&#115;&#115;&#97;&#103;&#x65;&#x49;&#x64;&#64;&#115;&#x6F;&#109;&#x65;&#46;&#100;&#x6F;&#x6D;&#x61;&#x69;&#x6E;&#x2E;&#99;&#x6F;&#109;</a>/ #=> 27
+```</p>
+
+<p>Mail will take the message_id you assign to it trusting that you know
+what you are doing.</p>
+
+<h3>Sending an email:</h3>
+
+<p>Mail defaults to sending via SMTP to local host port 25. If you have a
+sendmail or postfix daemon running on on this port, sending email is as
+easy as:</p>
+
+<p><code>ruby
+Mail.deliver do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file '/full/path/to/somefile.png'
+end
+</code></p>
+
+<p>or</p>
+
+<p>```ruby
+mail = Mail.new do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
+end</p>
+
+<p>mail.deliver!
+```</p>
+
+<p>Sending via sendmail can be done like so:</p>
+
+<p>```ruby
+mail = Mail.new do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
+end</p>
+
+<p>mail.delivery_method :sendmail</p>
+
+<p>mail.deliver
+```</p>
+
+<p>Exim requires it's own delivery manager, and can be used like so:</p>
+
+<p>```ruby
+mail.delivery_method :exim, :location => "/usr/bin/exim"</p>
+
+<p>mail.deliver
+```</p>
+
+<h3>Getting emails from a pop server:</h3>
+
+<p>You can configure Mail to receive email using <code>retriever_method</code>
+within <code>Mail.defaults</code>:</p>
+
+<p><code>ruby
+Mail.defaults do
+ retriever_method :pop3, :address =&gt; "pop.gmail.com",
+ :port =&gt; 995,
+ :user_name =&gt; '&lt;username&gt;',
+ :password =&gt; '&lt;password&gt;',
+ :enable_ssl =&gt; true
+end
+</code></p>
+
+<p>You can access incoming email in a number of ways.</p>
+
+<p>The most recent email:</p>
+
+<p><code>ruby
+Mail.all #=&gt; Returns an array of all emails
+Mail.first #=&gt; Returns the first unread email
+Mail.last #=&gt; Returns the first unread email
+</code></p>
+
+<p>The first 10 emails sorted by date in ascending order:</p>
+
+<p><code>ruby
+emails = Mail.find(:what =&gt; :first, :count =&gt; 10, :order =&gt; :asc)
+emails.length #=&gt; 10
+</code></p>
+
+<p>Or even all emails:</p>
+
+<p><code>ruby
+emails = Mail.all
+emails.length #=&gt; LOTS!
+</code></p>
+
+<h3>Reading an Email</h3>
+
+<p>```ruby
+mail = Mail.read('/path/to/message.eml')</p>
+
+<p>mail.envelope.from #=> 'mikel@test.lindsaar.net'
+mail.from.addresses #=> ['mikel@test.lindsaar.net', 'ada@test.lindsaar.net']
+mail.sender.address #=> 'mikel@test.lindsaar.net'
+mail.to #=> 'bob@test.lindsaar.net'
+mail.cc #=> 'sam@test.lindsaar.net'
+mail.subject #=> "This is the subject"
+mail.date.to<em>s #=> '21 Nov 1997 09:55:06 -0600'
+mail.message</em>id #=> '<a href="&#x6D;&#97;i&#x6C;&#x74;&#x6F;:4&#68;&#x36;&#65;&#65;&#x37;E&#x42;&#46;&#x36;&#52;&#x39;&#48;&#x35;&#51;&#52;&#x40;&#x78;&#120;&#x78;&#x2E;&#x78;&#x78;&#120;">4&#68;&#x36;&#65;&#65;&#x37;E&#x42;&#46;&#x36;&#52;&#x39;&#48;&#x35;&#51;&#52;&#x40;&#x78;&#120;&#x78;&#x2E;&#x78;&#x78;&#120;</a>'
+mail.body.decoded #=> 'This is the body of the email...
+```</p>
+
+<p>Many more methods available.</p>
+
+<h3>Reading a Multipart Email</h3>
+
+<p>```ruby
+mail = Mail.read('multipart_email')</p>
+
+<p>mail.multipart? #=> true
+mail.parts.length #=> 2
+mail.preamble #=> "Text before the first part"
+mail.epilogue #=> "Text after the last part"
+mail.parts.map { |p| p.content<em>type } #=> ['text/plain', 'application/pdf']
+mail.parts.map { |p| p.class } #=> [Mail::Message, Mail::Message]
+mail.parts[0].content</em>type<em>parameters #=> {'charset' => 'ISO-8859-1'}
+mail.parts[1].content</em>type_parameters #=> {'name' => 'my.pdf'}
+```</p>
+
+<p>Mail generates a tree of parts. Each message has many or no parts. Each part
+is another message which can have many or no parts.</p>
+
+<p>A message will only have parts if it is a multipart/mixed or related/mixed
+content type and has a boundary defined.</p>
+
+<h3>Testing and extracting attachments</h3>
+
+<p><code>ruby
+mail.attachments.each do | attachment |
+ # Attachments is an AttachmentsList object containing a
+ # number of Part objects
+ if (attachment.content_type.start_with?('image/'))
+ # extracting images for example...
+ filename = attachment.filename
+ begin
+ File.open(images_dir + filename, "w+b", 0644) {|f| f.write attachment.body.decoded}
+ rescue Exception =&gt; e
+ puts "Unable to save data for #{filename} because #{e.message}"
+ end
+ end
+end
+</code></p>
+
+<h3>Writing and sending a multipart/alternative (html and text) email</h3>
+
+<p>Mail makes some basic assumptions and makes doing the common thing as
+simple as possible.... (asking a lot from a mail library)</p>
+
+<p>```ruby
+mail = Mail.deliver do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="m&#x61;&#x69;&#x6C;&#116;&#x6F;:&#x6D;&#x69;&#107;&#x65;&#108;&#x40;&#x74;&#x65;&#115;&#x74;&#46;&#108;&#x69;&#110;&#x64;&#115;&#97;&#x61;&#114;.n&#x65;&#116;&#46;&#97;&#x75;">&#x6D;&#x69;&#107;&#x65;&#108;&#x40;&#x74;&#x65;&#115;&#x74;&#46;&#108;&#x69;&#110;&#x64;&#115;&#97;&#x61;&#114;.n&#x65;&#116;&#46;&#97;&#x75;</a>'
+ subject 'First multipart email sent with Mail'</p>
+
+<p>text_part do
+ body 'This is plain text'
+ end</p>
+
+<p>html<em>part do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>This is HTML</h1>'
+ end
+end
+```</p>
+
+<p>Mail then delivers the email at the end of the block and returns the
+resulting Mail::Message object, which you can then inspect if you
+so desire...</p>
+
+<p>```
+puts mail.to_s #=></p>
+
+<p>To: nicolas@test.lindsaar.net.au
+From: Mikel Lindsaar <a href="&#x6D;&#x61;&#x69;&#x6C;&#116;&#x6F;:&#109;&#x69;&#x6B;&#x65;l&#64;&#116;&#101;&#x73;&#x74;&#x2E;&#x6C;&#x69;&#x6E;&#x64;&#115;&#97;a&#114;&#x2E;&#110;&#101;&#x74;.&#x61;&#117;">&#109;&#x69;&#x6B;&#x65;l&#64;&#116;&#101;&#x73;&#x74;&#x2E;&#x6C;&#x69;&#x6E;&#x64;&#115;&#97;a&#114;&#x2E;&#110;&#101;&#x74;.&#x61;&#117;</a>
+Subject: First multipart email sent with Mail
+Content-Type: multipart/alternative;
+ boundary=--==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Message-ID: <a href="m&#x61;&#x69;&#108;&#x74;&#x6F;:&#x34;&#97;&#57;&#x31;&#x34;&#x66;&#x31;&#50;&#x61;c&#x37;&#101;&#95;&#x36;&#x66;&#x30;&#x66;&#x31;&#x61;b&#56;&#x30;&#50;&#54;&#55;&#100;&#x31;&#64;&#98;&#97;&#x63;&#105;&#46;&#108;&#111;c&#x61;l.&#109;&#97;&#x69;&#x6C;">&#x34;&#97;&#57;&#x31;&#x34;&#x66;&#x31;&#50;&#x61;c&#x37;&#101;&#95;&#x36;&#x66;&#x30;&#x66;&#x31;&#x61;b&#56;&#x30;&#50;&#54;&#55;&#100;&#x31;&#64;&#98;&#97;&#x63;&#105;&#46;&#108;&#111;c&#x61;l.&#109;&#97;&#x69;&#x6C;</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Transfer-Encoding: 7bit</p>
+
+<p>----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Content-ID: <a href="&#109;&#x61;&#x69;&#108;&#116;&#111;:&#52;a&#x39;&#49;&#52;&#x66;&#49;&#50;&#x63;&#56;&#99;&#52;&#x5F;&#54;f&#48;&#102;&#x31;&#x61;b&#56;&#x30;&#x32;&#54;&#x38;&#100;&#54;&#x40;&#x62;&#x61;c&#105;&#x2E;&#x6C;&#111;&#99;&#x61;&#108;&#46;m&#97;&#x69;&#108;">&#52;a&#x39;&#49;&#52;&#x66;&#49;&#50;&#x63;&#56;&#99;&#52;&#x5F;&#54;f&#48;&#102;&#x31;&#x61;b&#56;&#x30;&#x32;&#54;&#x38;&#100;&#54;&#x40;&#x62;&#x61;c&#105;&#x2E;&#x6C;&#111;&#99;&#x61;&#108;&#46;m&#97;&#x69;&#108;</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit</p>
+
+<p>This is plain text
+----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Content-Type: text/html; charset=UTF-8
+Content-ID: <a href="&#x6D;&#x61;&#105;&#108;&#x74;&#x6F;:&#x34;&#97;&#x39;&#49;&#52;&#x66;&#49;&#50;&#99;&#102;&#56;&#x36;&#95;6&#x66;&#48;&#102;&#x31;&#97;&#x62;&#x38;&#x30;&#x32;&#54;&#57;&#50;&#x63;&#64;&#x62;&#97;&#99;&#x69;&#46;&#x6C;&#111;&#99;&#97;&#108;&#46;m&#x61;&#105;l">&#x34;&#97;&#x39;&#49;&#52;&#x66;&#49;&#50;&#99;&#102;&#56;&#x36;&#95;6&#x66;&#48;&#102;&#x31;&#97;&#x62;&#x38;&#x30;&#x32;&#54;&#57;&#50;&#x63;&#64;&#x62;&#97;&#99;&#x69;&#46;&#x6C;&#111;&#99;&#97;&#108;&#46;m&#x61;&#105;l</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Transfer-Encoding: 7bit</p>
+
+<h1>This is HTML</h1>
+
+<p>----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659--
+```</p>
+
+<p>Mail inserts the content transfer encoding, the mime version,
+the content-id's and handles the content-type and boundary.</p>
+
+<p>Mail assumes that if your text in the body is only us-ascii, that your
+transfer encoding is 7bit and it is text/plain. You can override this
+by explicitly declaring it.</p>
+
+<h3>Making Multipart/Alternate, without a block</h3>
+
+<p>You don't have to use a block with the text and html part included, you
+can just do it declaratively. However, you need to add Mail::Parts to
+an email, not Mail::Messages.</p>
+
+<p>```ruby
+mail = Mail.new do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="&#x6D;&#97;&#105;&#x6C;&#x74;&#x6F;:&#109;&#x69;&#x6B;e&#x6C;&#x40;&#x74;e&#115;&#116;&#46;&#x6C;&#105;&#110;&#100;&#x73;&#97;&#x61;&#x72;&#46;&#x6E;e&#x74;&#46;&#x61;&#x75;">&#109;&#x69;&#x6B;e&#x6C;&#x40;&#x74;e&#115;&#116;&#46;&#x6C;&#105;&#110;&#100;&#x73;&#97;&#x61;&#x72;&#46;&#x6E;e&#x74;&#46;&#x61;&#x75;</a>'
+ subject 'First multipart email sent with Mail'
+end</p>
+
+<p>text_part = Mail::Part.new do
+ body 'This is plain text'
+end</p>
+
+<p>html<em>part = Mail::Part.new do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>This is HTML</h1>'
+end</p>
+
+<p>mail.text<em>part = text</em>part
+mail.html<em>part = html</em>part
+```</p>
+
+<p>Results in the same email as done using the block form</p>
+
+<h3>Getting error reports from an email:</h3>
+
+<p>```ruby
+@mail = Mail.read('/path/to/bounce_message.eml')</p>
+
+<p>@mail.bounced? #=> true
+@mail.final<em>recipient #=> rfc822;mikel@dont.exist.com
+@mail.action #=> failed
+@mail.error</em>status #=> 5.5.0
+@mail.diagnostic_code #=> smtp;550 Requested action not taken: mailbox unavailable
+@mail.retryable? #=> false
+```</p>
+
+<h3>Attaching and Detaching Files</h3>
+
+<p>You can just read the file off an absolute path, Mail will try
+to guess the mime_type and will encode the file in Base64 for you.</p>
+
+<p><code>ruby
+@mail = Mail.new
+@mail.add_file("/path/to/file.jpg")
+@mail.parts.first.attachment? #=&gt; true
+@mail.parts.first.content_transfer_encoding.to_s #=&gt; 'base64'
+@mail.attachments.first.mime_type #=&gt; 'image/jpg'
+@mail.attachments.first.filename #=&gt; 'file.jpg'
+@mail.attachments.first.decoded == File.read('/path/to/file.jpg') #=&gt; true
+</code></p>
+
+<p>Or You can pass in file<em>data and give it a filename, again, mail
+will try and guess the mime</em>type for you.</p>
+
+<p><code>ruby
+@mail = Mail.new
+@mail.attachments['myfile.pdf'] = File.read('path/to/myfile.pdf')
+@mail.parts.first.attachment? #=&gt; true
+@mail.attachments.first.mime_type #=&gt; 'application/pdf'
+@mail.attachments.first.decoded == File.read('path/to/myfile.pdf') #=&gt; true
+</code></p>
+
+<p>You can also override the guessed MIME media type if you really know better
+than mail (this should be rarely needed)</p>
+
+<p><code>ruby
+@mail = Mail.new
+file_data = File.read('path/to/myfile.pdf')
+@mail.attachments['myfile.pdf'] = { :mime_type =&gt; 'application/x-pdf',
+ :content =&gt; File.read('path/to/myfile.pdf') }
+@mail.parts.first.mime_type #=&gt; 'application/x-pdf'
+</code></p>
+
+<p>Of course... Mail will round trip an attachment as well</p>
+
+<p>```ruby
+@mail = Mail.new do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="&#109;&#x61;&#x69;&#108;&#116;&#x6F;:&#x6D;&#105;&#x6B;&#x65;&#x6C;&#64;&#116;&#101;&#115;&#116;&#x2E;&#108;i&#110;&#x64;&#x73;&#x61;&#97;&#114;&#x2E;&#110;&#101;&#116;&#x2E;&#97;&#x75;">&#x6D;&#105;&#x6B;&#x65;&#x6C;&#64;&#116;&#101;&#115;&#116;&#x2E;&#108;i&#110;&#x64;&#x73;&#x61;&#97;&#114;&#x2E;&#110;&#101;&#116;&#x2E;&#97;&#x75;</a>'
+ subject 'First multipart email sent with Mail'</p>
+
+<p>text_part do
+ body 'Here is the attachment you wanted'
+ end</p>
+
+<p>html<em>part do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>Funky Title</h1><p>Here is the attachment you wanted</p>'
+ end</p>
+
+<p>add_file '/path/to/myfile.pdf'
+end</p>
+
+<p>@round<em>tripped</em>mail = Mail.new(@mail.encoded)</p>
+
+<p>@round<em>tripped</em>mail.attachments.length #=> 1
+@round<em>tripped</em>mail.attachments.first.filename #=> 'myfile.pdf'
+```
+See "Testing and extracting attachments" above for more details.</p>
+
+<h2>Using Mail with Testing or Spec'ing Libraries</h2>
+
+<p>If mail is part of your system, you'll need a way to test it without actually
+sending emails, the TestMailer can do this for you.</p>
+
+<p><code>
+require 'mail'
+=&gt; true
+Mail.defaults do
+ delivery_method :test
+end
+=&gt; #&lt;Mail::Configuration:0x19345a8 @delivery_method=Mail::TestMailer&gt;
+Mail::TestMailer.deliveries
+=&gt; []
+Mail.deliver do
+ to 'mikel@me.com'
+ from 'you@you.com'
+ subject 'testing'
+ body 'hello'
+end
+=&gt; #&lt;Mail::Message:0x19284ec ...
+Mail::TestMailer.deliveries.length
+=&gt; 1
+Mail::TestMailer.deliveries.first
+=&gt; #&lt;Mail::Message:0x19284ec ...
+Mail::TestMailer.deliveries.clear
+=&gt; []
+</code></p>
+
+<p>There is also a set of RSpec matchers stolen fr^H^H^H^H^H^H^H^H inspired by Shoulda's ActionMailer matchers (you'll want to set <code>delivery_method</code> as above too):</p>
+
+<p>```
+Mail.defaults do
+ delivery<em>method :test # in practice you'd do this in spec</em>helper.rb
+end</p>
+
+<p>describe "sending an email" do
+ include Mail::Matchers</p>
+
+<p>before(:each) do
+ Mail::TestMailer.deliveries.clear</p>
+
+<pre><code>Mail.deliver do
+ to ['mikel@me.com', 'mike2@me.com']
+ from 'you@you.com'
+ subject 'testing'
+ body 'hello'
+end
+</code></pre>
+
+<p>end</p>
+
+<p>it { should have<em>sent</em>email } # passes if any email at all was sent</p>
+
+<p>it { should have<em>sent</em>email.from('you@you.com') }
+ it { should have<em>sent</em>email.to('mike1@me.com') }</p>
+
+<p># can specify a list of recipients...
+ it { should have<em>sent</em>email.to(['mike1@me.com', 'mike2@me.com']) }</p>
+
+<p># ...or chain recipients together
+ it { should have<em>sent</em>email.to('mike1@me.com').to('mike2@me.com') }</p>
+
+<p>it { should have<em>sent</em>email.with_subject('testing') }</p>
+
+<p>it { should have<em>sent</em>email.with_body('hello') }</p>
+
+<p># Can match subject or body with a regex
+ # (or anything that responds_to? :match)</p>
+
+<p>it { should have<em>sent</em>email.matching<em>subject(/test(ing)?/) }
+ it { should have</em>sent<em>email.matching</em>body(/h(a|e)llo/) }</p>
+
+<p># Can chain together modifiers
+ # Note that apart from recipients, repeating a modifier overwrites old value.</p>
+
+<p>it { should have<em>sent</em>email.from('you@you.com').to('mike1@me.com').matching_body(/hell/)
+end
+```</p>
+
+<h2>Excerpts from TREC Spam Corpus 2005</h2>
+
+<p>The spec fixture files in spec/fixtures/emails/from<em>trec</em>2005 are from the
+2005 TREC Public Spam Corpus. They remain copyrighted under the terms of
+that project and license agreement. They are used in this project to verify
+and describe the development of this email parser implementation.</p>
+
+<p>http://plg.uwaterloo.ca/~gvcormac/treccorpus/</p>
+
+<p>They are used as allowed by 'Permitted Uses, Clause 3':</p>
+
+<pre><code>"Small excerpts of the information may be displayed to others
+ or published in a scientific or technical context, solely for
+ the purpose of describing the research and development and
+ related issues."
+
+ -- http://plg.uwaterloo.ca/~gvcormac/treccorpus/
+</code></pre>
+
+<h2>License</h2>
+
+<p>(The MIT License)</p>
+
+<p>Copyright (c) 2009, 2010, 2011, 2012</p>
+
+<p>Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
View
72 Rakefile.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html><head><title>joekychen/mail » Rakefile
+
+</title>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<meta name="generator" content="Docco">
+<link rel="stylesheet" media="all" href="stylesheets/docco.min.css" />
+
+
+</head>
+<body>
+<div id="container">
+<div id="background"></div>
+<table cellpadding="0" cellspacing="0">
+<thead><tr><th class="docs"><a id="home" href="index.html"></a><h1>Rakefile</h1></th><th class="code"></th></tr></thead>
+<tbody>
+
+
+<tr id="section-1"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-1">&#182;</a></div></td><td class="code"><div class="highlight"><pre><span class="k">begin</span>
+ <span class="nb">require</span> <span class="s2">&quot;rubygems&quot;</span>
+ <span class="nb">require</span> <span class="s2">&quot;bundler&quot;</span>
+<span class="k">rescue</span> <span class="no">LoadError</span>
+ <span class="k">raise</span> <span class="s2">&quot;Could not load the bundler gem. Install it with `gem install bundler`.&quot;</span>
+<span class="k">end</span>
+
+<span class="k">if</span> <span class="no">Gem</span><span class="o">::</span><span class="no">Version</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="no">Bundler</span><span class="o">::</span><span class="no">VERSION</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="no">Gem</span><span class="o">::</span><span class="no">Version</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="s2">&quot;1.0.0&quot;</span><span class="p">)</span>
+ <span class="k">raise</span> <span class="no">RuntimeError</span><span class="p">,</span> <span class="s2">&quot;Your bundler version is too old for Mail&quot;</span> <span class="o">+</span>
+ <span class="s2">&quot;Run `gem install bundler` to upgrade.&quot;</span>
+<span class="k">end</span>
+
+<span class="k">begin</span></pre></div></td></tr>
+
+
+<tr id="section-2"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-2">&#182;</a></div><p>Set up load paths for all bundled gems</p></td><td class="code"><div class="highlight"><pre> <span class="no">ENV</span><span class="o">[</span><span class="s2">&quot;BUNDLE_GEMFILE&quot;</span><span class="o">]</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s2">&quot;../Gemfile&quot;</span><span class="p">,</span> <span class="bp">__FILE__</span><span class="p">)</span>
+ <span class="no">Bundler</span><span class="o">.</span><span class="n">setup</span>
+<span class="k">rescue</span> <span class="no">Bundler</span><span class="o">::</span><span class="no">GemNotFound</span>
+ <span class="k">raise</span> <span class="no">RuntimeError</span><span class="p">,</span> <span class="s2">&quot;Bundler couldn&#39;t find some gems.&quot;</span> <span class="o">+</span>
+ <span class="s2">&quot;Did you run `bundle install`?&quot;</span>
+<span class="k">end</span>
+
+<span class="nb">require</span> <span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s1">&#39;../spec/environment&#39;</span><span class="p">,</span> <span class="bp">__FILE__</span><span class="p">)</span>
+
+<span class="nb">require</span> <span class="s1">&#39;rake/testtask&#39;</span>
+<span class="nb">require</span> <span class="s1">&#39;rspec/core/rake_task&#39;</span>
+
+<span class="n">desc</span> <span class="s2">&quot;Build a gem file&quot;</span>
+<span class="n">task</span> <span class="ss">:build</span> <span class="k">do</span>
+ <span class="nb">system</span> <span class="s2">&quot;gem build mail.gemspec&quot;</span>
+<span class="k">end</span>
+
+<span class="n">task</span> <span class="ss">:default</span> <span class="o">=&gt;</span> <span class="ss">:spec</span>
+
+<span class="no">RSpec</span><span class="o">::</span><span class="no">Core</span><span class="o">::</span><span class="no">RakeTask</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">:spec</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">t</span><span class="o">|</span>
+ <span class="n">t</span><span class="o">.</span><span class="n">ruby_opts</span> <span class="o">=</span> <span class="s1">&#39;-w&#39;</span>
+ <span class="n">t</span><span class="o">.</span><span class="n">rspec_opts</span> <span class="o">=</span> <span class="sx">%w(--backtrace --color)</span>
+<span class="k">end</span></pre></div></td></tr>
+
+
+<tr id="section-3"><td class="docs"><div class="pilwrap"><a class="pilcrow" href="#section-3">&#182;</a></div><p>load custom rake tasks</p></td><td class="code"><div class="highlight"><pre><span class="no">Dir</span><span class="o">[</span><span class="s2">&quot;</span><span class="si">#{</span><span class="no">File</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">__FILE__</span><span class="p">)</span><span class="si">}</span><span class="s2">/lib/tasks/**/*.rake&quot;</span><span class="o">].</span><span class="n">sort</span><span class="o">.</span><span class="n">each</span> <span class="p">{</span> <span class="o">|</span><span class="n">ext</span><span class="o">|</span> <span class="nb">load</span> <span class="n">ext</span> <span class="p">}</span>
+
+</pre></div></td></tr>
+
+</tbody>
+</table>
+</div>
+
+</body>
+<script>docas={repo:"joekychen/mail",depth:0}</script>
+<script>document.write('<script src=' + ('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js' : 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')+'><\\/script>')</script>
+<script src="http://baoshan.github.com/moment/min/moment.min.js"></script>
+<script src="javascript/docco.min.js"></script>
+</html>
View
14 docas.idx
@@ -0,0 +1,14 @@
+f | README.md | s | 20K | 501 | Mathieu D'Amours | mathieu.damours@nextorms.com | 1330608286 | | Small typo in readme.
+f | TODO.rdoc | g | 425B | | Mikel Lindsaar | raasdnil@gmail.com | 1266973237 | | Fixing up TODO and docs
+d | reference | | 25 items | | Mikel Lindsaar | mikel@rubyx.com | 1291970874 | | Closes issue 135 - Invalid filename for windows
+f | Dependencies.txt | g | 213B | | Tim Carey-Smith, Corey Donohoe, Simon Rozet & Ben Burkert | ninja@engineyard.com | 1258600558 | | Rename Dependancies.txt -> Dependencies.txt
+f | mail.gemspec | g | 1.0K | | Mikel Lindsaar | mikel@rubyx.com | 1326627498 | | Version bump to 2.4.0 and gem release
+f | Gemfile | s | 523B | 23 | Mikel Lindsaar | mikel@rubyx.com | 1327068476 | | Updating treetop version, specs now run 20-30% faster
+d | patches | | 1 items | | Mikel Lindsaar | mikel@rubyx.com | 1296017652 | | Adding patch file
+f | CONTRIBUTING.md | s | 1.9K | 36 | Mikel Lindsaar | mikel@rubyx.com | 1326511286 | | Updating README and CONTRIBUTING
+f | Rakefile | s | 1023B | 32 | Mikel Lindsaar | mikel@rubyx.com | 1326627498 | | Version bump to 2.4.0 and gem release
+d | lib | | 4 items | | Mickey Reiss | mreiss@andrew.cmu.edu | 1335244077 | | Fixed typo in documentation
+f | test.rb | s | 426B | 12 | Donald Ball | donald.ball@gmail.com | 1288062582 | | Merge branch 'master' of github.com:dball/mail Conflicts: lib/mail/encodings.rb lib/mail/utilities.rb spec/mail/network/retriever_methods/pop3_spec.rb
+f | CHANGELOG.rdoc | g | 28K | | Mikel Lindsaar | mikel@rubyx.com | 1332572561 | | Removing unused variable
+d | spec | | 6 items | | Mikel Lindsaar | mikel@rubyx.com | 1331725467 | | Preventing file system traversal in file_delivery method
+f | ROADMAP | g | 2.4K | | Mikel Lindsaar | raasdnil@gmail.com | 1270810999 | | Updating Roadmap
View
786 index.html
@@ -1,77 +1,729 @@
-<!doctype html>
-<html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <title>Mail by joekychen</title>
- <link rel="stylesheet" href="stylesheets/styles.css">
- <link rel="stylesheet" href="stylesheets/pygment_trac.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="javascripts/main.js"></script>
- <!--[if lt IE 9]>
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-
- </head>
- <body>
-
- <header>
- <h1>Mail</h1>
- <p>A Really Ruby Mail Library</p>
- </header>
-
- <div id="banner">
- <span id="logo"></span>
-
- <a href="https://github.com/joekychen/mail" class="button fork"><strong>View On GitHub</strong></a>
- <div class="downloads">
- <span>Downloads:</span>
- <ul>
- <li><a href="https://github.com/joekychen/mail/zipball/master" class="button">ZIP</a></li>
- <li><a href="https://github.com/joekychen/mail/tarball/master" class="button">TAR</a></li>
- </ul>
- </div>
- </div><!-- end banner -->
-
- <div class="wrapper">
- <nav>
- <ul></ul>
- </nav>
- <section>
- <h3>Welcome to GitHub Pages.</h3>
-
-<p>This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:</p>
-
-<pre><code>$ cd your_repo_root/repo_name
-$ git fetch origin
-$ git checkout gh-pages
+<!DOCTYPE html>
+<html><head>
+<title>joekychen/mail - A Really Ruby Mail Library</title>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" media="all" href="stylesheets/index.min.css" />
+</head>
+<body>
+<div id="container">
+<div id="background"></div>
+<table cellpadding="0" cellspacing="0">
+<tbody>
+<tr>
+<td>
+<div style="position:absolute;top:0px;left:0px;width:525px">
+<a href="https://github.com/joekychen/mail"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
+</div>
+<h1>mail</h1>
+<p>A Really Ruby Mail Library</p>
+<!--readme-->
+</td>
+<td></td>
+</tr>
+<tr>
+<td>
+<div class="markdown_browser"><h1>Mail</h1>
+
+<h2>Introduction</h2>
+
+<p>Mail is an internet library for Ruby that is designed to handle emails
+generation, parsing and sending in a simple, rubyesque manner.</p>
+
+<p>The purpose of this library is to provide a single point of access to handle
+all email functions, including sending and receiving emails. All network
+type actions are done through proxy methods to Net::SMTP, Net::POP3 etc.</p>
+
+<p>Built from my experience with TMail, it is designed to be a pure ruby
+implementation that makes generating, sending and parsing emails a no
+brainer.</p>
+
+<p>It is also designed form the ground up to work with Ruby 1.9. This is because
+Ruby 1.9 handles text encodings much more magically than Ruby 1.8.x and so
+these features have been taken full advantage of in this library allowing
+Mail to handle a lot more messages more cleanly than TMail. Mail does run on
+Ruby 1.8.x... it's just not as fun to code.</p>
+
+<p>Finally, Mail has been designed with a very simple object oriented system
+that really opens up the email messages you are parsing, if you know what
+you are doing, you can fiddle with every last bit of your email directly.</p>
+
+<h2>Donations</h2>
+
+<p>Mail has been downloaded millions of times, by people around the world, in fact,
+it represents more than 1% of <em>all</em> gems downloaded. </p>
+
+<p>It is (like all open source software) a labour of love and something I am doing
+with my own free time. If you would like to say thanks, please feel free to
+<a href="http://www.pledgie.com/campaigns/8790">make a donation</a> and feel free to send
+me a nice email :)</p>
+
+<p><a href='http://www.pledgie.com/campaigns/8790'><img alt='Click here to lend your support to: mail and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/8790.png?skin_name=chrome' border='0' /></a></p>
+
+<h2>Compatibility</h2>
+
+<p>Mail is tested by Travis (<img src="https://secure.travis-ci.org/mikel/mail.png" alt="Travis Build Status" title="Build Status" />) and works on the following platforms:</p>
+
+<ul>
+<li>jruby-1.6.5.1 [ x86_64 ]</li>
+<li>rbx-head-d18 [ x86_64 ]</li>
+<li>ree-1.8.7-2011.03 [ i686 ]</li>
+<li>ruby-1.8.7-p357 [ i686 ]</li>
+<li>ruby-1.9.2-p290 [ x86_64 ]</li>
+<li>ruby-1.9.3-p0 [ x86_64 ]</li>
+</ul>
+
+<h2>Discussion</h2>
+
+<p>If you want to discuss mail with like minded individuals, please subscribe to
+the <a href="http://groups.google.com/group/mail-ruby">Google Group</a>.</p>
+
+<h2>Current Capabilities of Mail</h2>
+
+<ul>
+<li>RFC2822 Support, Reading and Writing</li>
+<li>RFC2045-2049 Support for multipart emails</li>
+<li>Support for creating multipart alternate emails</li>
+<li>Support for reading multipart/report emails &amp; getting details from such</li>
+<li>Support for multibyte emails - needs quite a lot of work and testing</li>
+<li>Wrappers for File, Net/POP3, Net/SMTP</li>
+<li>Auto encoding of non US-ASCII header fields</li>
+<li>Auto encoding of non US-ASCII bodies</li>
+</ul>
+
+<p>Mail is RFC2822 compliant now, that is, it can parse and generate valid US-ASCII
+emails. There are a few obsoleted syntax emails that it will have problems with, but
+it also is quite robust, meaning, if it finds something it doesn't understand it will
+not crash, instead, it will skip the problem and keep parsing. In the case of a header
+it doesn't understand, it will initialise the header as an optional unstructured
+field and continue parsing.</p>
+
+<p>This means Mail won't (ever) crunch your data (I think).</p>
+
+<p>You can also create MIME emails. There are helper methods for making a
+multipart/alternate email for text/plain and text/html (the most common pair)
+and you can manually create any other type of MIME email.</p>
+
+<h2>Roadmap</h2>
+
+<p>Next TODO:</p>
+
+<ul>
+<li>Improve MIME support for character sets in headers, currently works, mostly, needs
+refinement.</li>
+</ul>
+
+<h2>Testing Policy</h2>
+
+<p>Basically... we do BDD on Mail. No method gets written in Mail without a
+corresponding or covering spec. We expect as a minimum 100% coverage
+measured by RCov. While this is not perfect by any measure, it is pretty
+good. Additionally, all functional tests from TMail are to be passing before
+the gem gets released.</p>
+
+<p>It also means you can be sure Mail will behave correctly.</p>
+
+<h2>API Policy</h2>
+
+<p>No API removals within a single point release. All removals to be deprecated with
+warnings for at least one MINOR point release before removal.</p>
+
+<p>Also, all private or protected methods to be declared as such - though this is still I/P.</p>
+
+<h2>Installation</h2>
+
+<p>Installation is fairly simple, I host mail on rubygems, so you can just do:</p>
+
+<pre><code># gem install mail
+</code></pre>
+
+<h2>Encodings</h2>
+
+<p>If you didn't know, handling encodings in Emails is not as straight forward as you
+would hope.</p>
+
+<p>I have tried to simplify it some:</p>
+
+<ol>
+<li><p>All objects that can render into an email, have an <code>#encoded</code> method. Encoded will
+return the object as a complete string ready to send in the mail system, that is,
+it will include the header field and value and CRLF at the end and wrapped as
+needed.</p></li>
+<li><p>All objects that can render into an email, have a :decoded method. Decoded will
+return the object's "value" only as a string. This means it will not include
+the header fields (like 'To:' or 'Subject:').</p></li>
+<li><p>By default, calling <code>#to<em>s</code> on a container object will call its encoded
+method, while <code>#to</em>s</code> on a field object will call it's decoded method.
+So calling <code>#to<em>s</code> on a Mail object will return the mail, all encoded
+ready to send, while calling <code>#to</em>s</code> on the From field or the body will
+return the decoded value of the object. The header object of Mail is considered a
+container. If you are in doubt, call <code>#encoded</code>, or <code>#decoded</code>
+explicitly, this is safer if you are not sure.</p></li>
+<li><p>Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
+provide decoded parameter values when you call the parameter names as methods against
+the object.</p></li>
+<li><p>Structured fields that have parameter values that can be encoded (e.g. Content-Type) will
+provide encoded parameter values when you call the parameter names through the
+<code>object.parameters['<parameter_name>']</code> method call.</p></li>
+</ol>
+
+<h2>Contributing</h2>
+
+<p>Please do! Contributing is easy in Mail. Please read the CONTRIBUTING.md document for more info</p>
+
+<h2>Usage</h2>
+
+<p>All major mail functions should be able to happen from the Mail module.
+So, you should be able to just <code>require 'mail'</code> to get started.</p>
+
+<h3>Making an email</h3>
+
+<p>```ruby
+mail = Mail.new do
+ from 'mikel@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'This is a test email'
+ body File.read('body.txt')
+end</p>
+
+<p>mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...
+```</p>
+
+<h3>Making an email, have it your way:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ body File.read('body.txt')
+end</p>
+
+<p>mail['from'] = 'mikel@test.lindsaar.net'
+mail[:to] = 'you@test.lindsaar.net'
+mail.subject = 'This is a test email'</p>
+
+<p>mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@...
+```</p>
+
+<h3>Don't Worry About Message IDs:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ to 'you@test.lindsaar.net'
+ body 'Some simple body'
+end</p>
+
+<p>mail.to<em>s =~ /Message-ID: &lt;[\d\w</em>]+@.+.mail/ #=> 27
+```</p>
+
+<p>Mail will automatically add a Message-ID field if it is missing and
+give it a unique, random Message-ID along the lines of:</p>
+
+<pre><code>&lt;4a7ff76d7016_13a81ab802e1@local.fqdn.mail&gt;
+</code></pre>
+
+<h3>Or do worry about Message-IDs:</h3>
+
+<p>```ruby
+mail = Mail.new do
+ to 'you@test.lindsaar.net'
+ message_id '<a href="&#x6D;&#97;&#x69;&#x6C;&#x74;&#x6F;:Th&#105;&#x73;&#73;s&#x4D;y&#x4D;e&#115;&#115;&#x61;&#x67;&#x65;&#73;&#100;&#64;&#115;&#x6F;&#x6D;e&#x2E;&#x64;&#x6F;&#109;&#97;i&#x6E;&#46;&#x63;&#x6F;&#109;">Th&#105;&#x73;&#73;s&#x4D;y&#x4D;e&#115;&#115;&#x61;&#x67;&#x65;&#73;&#100;&#64;&#115;&#x6F;&#x6D;e&#x2E;&#x64;&#x6F;&#109;&#97;i&#x6E;&#46;&#x63;&#x6F;&#109;</a>'
+ body 'Some simple body'
+end</p>
+
+<p>mail.to_s =~ /Message-ID: <a href="&#109;&#x61;&#105;&#x6C;&#116;&#111;:&#84;&#104;&#105;&#115;&#x49;&#x73;M&#x79;&#x4D;&#x65;&#115;&#115;&#x61;&#x67;&#101;&#x49;&#100;&#64;&#115;&#111;&#x6D;&#101;&#46;&#100;&#111;&#x6D;&#x61;&#105;&#110;&#x2E;&#x63;&#111;&#109;">&#84;&#104;&#105;&#115;&#x49;&#x73;M&#x79;&#x4D;&#x65;&#115;&#115;&#x61;&#x67;&#101;&#x49;&#100;&#64;&#115;&#111;&#x6D;&#101;&#46;&#100;&#111;&#x6D;&#x61;&#105;&#110;&#x2E;&#x63;&#111;&#109;</a>/ #=> 27
+```</p>
+
+<p>Mail will take the message_id you assign to it trusting that you know
+what you are doing.</p>
+
+<h3>Sending an email:</h3>
+
+<p>Mail defaults to sending via SMTP to local host port 25. If you have a
+sendmail or postfix daemon running on on this port, sending email is as
+easy as:</p>
+
+<p><code>ruby
+Mail.deliver do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file '/full/path/to/somefile.png'
+end
+</code></p>
+
+<p>or</p>
+
+<p>```ruby
+mail = Mail.new do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
+end</p>
+
+<p>mail.deliver!
+```</p>
+
+<p>Sending via sendmail can be done like so:</p>
+
+<p>```ruby
+mail = Mail.new do
+ from 'me@test.lindsaar.net'
+ to 'you@test.lindsaar.net'
+ subject 'Here is the image you wanted'
+ body File.read('body.txt')
+ add_file :filename => 'somefile.png', :content => File.read('/somefile.png')
+end</p>
+
+<p>mail.delivery_method :sendmail</p>
+
+<p>mail.deliver
+```</p>
+
+<p>Exim requires it's own delivery manager, and can be used like so:</p>
+
+<p>```ruby
+mail.delivery_method :exim, :location => "/usr/bin/exim"</p>
+
+<p>mail.deliver
+```</p>
+
+<h3>Getting emails from a pop server:</h3>
+
+<p>You can configure Mail to receive email using <code>retriever_method</code>
+within <code>Mail.defaults</code>:</p>
+
+<p><code>ruby
+Mail.defaults do
+ retriever_method :pop3, :address =&gt; "pop.gmail.com",
+ :port =&gt; 995,
+ :user_name =&gt; '&lt;username&gt;',
+ :password =&gt; '&lt;password&gt;',
+ :enable_ssl =&gt; true
+end
+</code></p>
+
+<p>You can access incoming email in a number of ways.</p>
+
+<p>The most recent email:</p>
+
+<p><code>ruby
+Mail.all #=&gt; Returns an array of all emails
+Mail.first #=&gt; Returns the first unread email
+Mail.last #=&gt; Returns the first unread email
+</code></p>
+
+<p>The first 10 emails sorted by date in ascending order:</p>
+
+<p><code>ruby
+emails = Mail.find(:what =&gt; :first, :count =&gt; 10, :order =&gt; :asc)
+emails.length #=&gt; 10
+</code></p>
+
+<p>Or even all emails:</p>
+
+<p><code>ruby
+emails = Mail.all
+emails.length #=&gt; LOTS!
+</code></p>
+
+<h3>Reading an Email</h3>
+
+<p>```ruby
+mail = Mail.read('/path/to/message.eml')</p>
+
+<p>mail.envelope.from #=> 'mikel@test.lindsaar.net'
+mail.from.addresses #=> ['mikel@test.lindsaar.net', 'ada@test.lindsaar.net']
+mail.sender.address #=> 'mikel@test.lindsaar.net'
+mail.to #=> 'bob@test.lindsaar.net'
+mail.cc #=> 'sam@test.lindsaar.net'
+mail.subject #=> "This is the subject"
+mail.date.to<em>s #=> '21 Nov 1997 09:55:06 -0600'
+mail.message</em>id #=> '<a href="&#x6D;&#97;&#105;&#108;&#x74;&#x6F;:&#52;&#68;&#54;&#x41;&#x41;&#x37;&#x45;B&#x2E;6&#52;&#x39;&#x30;&#53;&#x33;&#52;&#64;&#120;&#120;&#x78;&#46;&#120;&#120;&#x78;">&#52;&#68;&#54;&#x41;&#x41;&#x37;&#x45;B&#x2E;6&#52;&#x39;&#x30;&#53;&#x33;&#52;&#64;&#120;&#120;&#x78;&#46;&#120;&#120;&#x78;</a>'
+mail.body.decoded #=> 'This is the body of the email...
+```</p>
+
+<p>Many more methods available.</p>
+
+<h3>Reading a Multipart Email</h3>
+
+<p>```ruby
+mail = Mail.read('multipart_email')</p>
+
+<p>mail.multipart? #=> true
+mail.parts.length #=> 2
+mail.preamble #=> "Text before the first part"
+mail.epilogue #=> "Text after the last part"
+mail.parts.map { |p| p.content<em>type } #=> ['text/plain', 'application/pdf']
+mail.parts.map { |p| p.class } #=> [Mail::Message, Mail::Message]
+mail.parts[0].content</em>type<em>parameters #=> {'charset' => 'ISO-8859-1'}
+mail.parts[1].content</em>type_parameters #=> {'name' => 'my.pdf'}
+```</p>
+
+<p>Mail generates a tree of parts. Each message has many or no parts. Each part
+is another message which can have many or no parts.</p>
+
+<p>A message will only have parts if it is a multipart/mixed or related/mixed
+content type and has a boundary defined.</p>
+
+<h3>Testing and extracting attachments</h3>
+
+<p><code>ruby
+mail.attachments.each do | attachment |
+ # Attachments is an AttachmentsList object containing a
+ # number of Part objects
+ if (attachment.content_type.start_with?('image/'))
+ # extracting images for example...
+ filename = attachment.filename
+ begin
+ File.open(images_dir + filename, "w+b", 0644) {|f| f.write attachment.body.decoded}
+ rescue Exception =&gt; e
+ puts "Unable to save data for #{filename} because #{e.message}"
+ end
+ end
+end
+</code></p>
+
+<h3>Writing and sending a multipart/alternative (html and text) email</h3>
+
+<p>Mail makes some basic assumptions and makes doing the common thing as
+simple as possible.... (asking a lot from a mail library)</p>
+
+<p>```ruby
+mail = Mail.deliver do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="&#109;&#x61;&#x69;&#108;&#116;&#x6F;:&#x6D;&#x69;&#107;&#101;&#x6C;&#x40;t&#x65;&#115;&#116;&#x2E;&#108;&#x69;&#110;&#x64;&#115;&#97;&#97;&#x72;.&#x6E;&#101;&#116;&#46;&#97;&#x75;">&#x6D;&#x69;&#107;&#101;&#x6C;&#x40;t&#x65;&#115;&#116;&#x2E;&#108;&#x69;&#110;&#x64;&#115;&#97;&#97;&#x72;.&#x6E;&#101;&#116;&#46;&#97;&#x75;</a>'
+ subject 'First multipart email sent with Mail'</p>
+
+<p>text_part do
+ body 'This is plain text'
+ end</p>
+
+<p>html<em>part do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>This is HTML</h1>'
+ end
+end
+```</p>
+
+<p>Mail then delivers the email at the end of the block and returns the
+resulting Mail::Message object, which you can then inspect if you
+so desire...</p>
+
+<p>```
+puts mail.to_s #=></p>
+
+<p>To: nicolas@test.lindsaar.net.au
+From: Mikel Lindsaar <a href="&#109;&#97;&#105;&#108;&#x74;&#x6F;:&#x6D;&#x69;&#x6B;e&#108;&#x40;&#x74;&#x65;&#x73;&#x74;&#x2E;&#x6C;&#x69;&#x6E;&#100;&#x73;&#97;&#97;r&#x2E;&#x6E;&#x65;&#116;&#46;&#97;&#117;">&#x6D;&#x69;&#x6B;e&#108;&#x40;&#x74;&#x65;&#x73;&#x74;&#x2E;&#x6C;&#x69;&#x6E;&#100;&#x73;&#97;&#97;r&#x2E;&#x6E;&#x65;&#116;&#46;&#97;&#117;</a>
+Subject: First multipart email sent with Mail
+Content-Type: multipart/alternative;
+ boundary=--==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Message-ID: <a href="&#109;&#x61;&#x69;&#108;&#x74;&#x6F;:&#x34;&#x61;&#x39;14f&#x31;&#50;&#x61;&#99;7&#x65;&#95;&#x36;f&#x30;&#102;1&#x61;&#98;&#56;&#x30;&#50;&#54;&#x37;&#x64;&#x31;&#64;&#x62;&#97;&#x63;i&#x2E;l&#x6F;&#99;&#97;&#108;&#46;&#109;&#x61;&#105;&#x6C;">&#x34;&#x61;&#x39;14f&#x31;&#50;&#x61;&#99;7&#x65;&#95;&#x36;f&#x30;&#102;1&#x61;&#98;&#56;&#x30;&#50;&#54;&#x37;&#x64;&#x31;&#64;&#x62;&#97;&#x63;i&#x2E;l&#x6F;&#99;&#97;&#108;&#46;&#109;&#x61;&#105;&#x6C;</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Transfer-Encoding: 7bit</p>
+
+<p>----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Content-ID: <a href="m&#97;&#x69;&#x6C;&#116;&#111;:&#52;&#97;&#x39;&#49;&#x34;&#x66;&#x31;&#50;&#x63;&#x38;&#99;&#x34;&#95;6f&#x30;&#x66;&#49;&#97;&#98;&#x38;0&#50;&#54;8&#100;&#x36;&#x40;&#98;&#97;&#x63;&#105;&#46;&#x6C;&#111;&#99;&#97;&#x6C;.&#x6D;&#x61;&#x69;&#108;">&#52;&#97;&#x39;&#49;&#x34;&#x66;&#x31;&#50;&#x63;&#x38;&#99;&#x34;&#95;6f&#x30;&#x66;&#49;&#97;&#98;&#x38;0&#50;&#54;8&#100;&#x36;&#x40;&#98;&#97;&#x63;&#105;&#46;&#x6C;&#111;&#99;&#97;&#x6C;.&#x6D;&#x61;&#x69;&#108;</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit</p>
+
+<p>This is plain text
+----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659
+Content-Type: text/html; charset=UTF-8
+Content-ID: <a href="&#x6D;&#x61;i&#108;&#x74;o:&#52;&#97;&#57;&#49;&#52;&#x66;&#49;&#x32;&#x63;&#x66;&#56;&#54;&#95;&#x36;&#x66;&#x30;&#x66;1a&#98;&#x38;&#48;&#50;&#x36;&#x39;&#50;&#x63;&#x40;&#98;&#x61;&#99;&#105;&#x2E;l&#111;&#x63;&#x61;&#x6C;.&#x6D;&#97;&#105;&#108;">&#52;&#97;&#57;&#49;&#52;&#x66;&#49;&#x32;&#x63;&#x66;&#56;&#54;&#95;&#x36;&#x66;&#x30;&#x66;1a&#98;&#x38;&#48;&#50;&#x36;&#x39;&#50;&#x63;&#x40;&#98;&#x61;&#99;&#105;&#x2E;l&#111;&#x63;&#x61;&#x6C;.&#x6D;&#97;&#105;&#108;</a>
+Date: Mon, 24 Aug 2009 00:15:46 +1000
+Mime-Version: 1.0
+Content-Transfer-Encoding: 7bit</p>
+
+<h1>This is HTML</h1>
+
+<p>----==<em>mimepart</em>4a914f0c911be_6f0f1ab8026659--
+```</p>
+
+<p>Mail inserts the content transfer encoding, the mime version,
+the content-id's and handles the content-type and boundary.</p>
+
+<p>Mail assumes that if your text in the body is only us-ascii, that your
+transfer encoding is 7bit and it is text/plain. You can override this
+by explicitly declaring it.</p>
+
+<h3>Making Multipart/Alternate, without a block</h3>
+
+<p>You don't have to use a block with the text and html part included, you
+can just do it declaratively. However, you need to add Mail::Parts to
+an email, not Mail::Messages.</p>
+
+<p>```ruby
+mail = Mail.new do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="&#x6D;&#x61;&#x69;&#x6C;&#x74;&#111;:&#109;&#x69;&#x6B;&#x65;&#x6C;&#x40;&#x74;&#x65;&#115;&#x74;&#46;&#108;&#105;&#x6E;&#x64;&#x73;&#97;&#97;&#114;&#x2E;&#x6E;&#101;&#116;&#46;&#97;&#117;">&#109;&#x69;&#x6B;&#x65;&#x6C;&#x40;&#x74;&#x65;&#115;&#x74;&#46;&#108;&#105;&#x6E;&#x64;&#x73;&#97;&#97;&#114;&#x2E;&#x6E;&#101;&#116;&#46;&#97;&#117;</a>'
+ subject 'First multipart email sent with Mail'
+end</p>
+
+<p>text_part = Mail::Part.new do
+ body 'This is plain text'
+end</p>
+
+<p>html<em>part = Mail::Part.new do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>This is HTML</h1>'
+end</p>
+
+<p>mail.text<em>part = text</em>part
+mail.html<em>part = html</em>part
+```</p>
+
+<p>Results in the same email as done using the block form</p>
+
+<h3>Getting error reports from an email:</h3>
+
+<p>```ruby
+@mail = Mail.read('/path/to/bounce_message.eml')</p>
+
+<p>@mail.bounced? #=> true
+@mail.final<em>recipient #=> rfc822;mikel@dont.exist.com
+@mail.action #=> failed
+@mail.error</em>status #=> 5.5.0
+@mail.diagnostic_code #=> smtp;550 Requested action not taken: mailbox unavailable
+@mail.retryable? #=> false
+```</p>
+
+<h3>Attaching and Detaching Files</h3>
+
+<p>You can just read the file off an absolute path, Mail will try
+to guess the mime_type and will encode the file in Base64 for you.</p>
+
+<p><code>ruby
+@mail = Mail.new
+@mail.add_file("/path/to/file.jpg")
+@mail.parts.first.attachment? #=&gt; true
+@mail.parts.first.content_transfer_encoding.to_s #=&gt; 'base64'
+@mail.attachments.first.mime_type #=&gt; 'image/jpg'
+@mail.attachments.first.filename #=&gt; 'file.jpg'
+@mail.attachments.first.decoded == File.read('/path/to/file.jpg') #=&gt; true
+</code></p>
+
+<p>Or You can pass in file<em>data and give it a filename, again, mail
+will try and guess the mime</em>type for you.</p>
+
+<p><code>ruby
+@mail = Mail.new
+@mail.attachments['myfile.pdf'] = File.read('path/to/myfile.pdf')
+@mail.parts.first.attachment? #=&gt; true
+@mail.attachments.first.mime_type #=&gt; 'application/pdf'
+@mail.attachments.first.decoded == File.read('path/to/myfile.pdf') #=&gt; true
+</code></p>
+
+<p>You can also override the guessed MIME media type if you really know better
+than mail (this should be rarely needed)</p>
+
+<p><code>ruby
+@mail = Mail.new
+file_data = File.read('path/to/myfile.pdf')
+@mail.attachments['myfile.pdf'] = { :mime_type =&gt; 'application/x-pdf',
+ :content =&gt; File.read('path/to/myfile.pdf') }
+@mail.parts.first.mime_type #=&gt; 'application/x-pdf'
+</code></p>
+
+<p>Of course... Mail will round trip an attachment as well</p>
+
+<p>```ruby
+@mail = Mail.new do
+ to 'nicolas@test.lindsaar.net.au'
+ from 'Mikel Lindsaar <a href="m&#97;&#x69;&#x6C;&#116;&#111;:&#x6D;&#105;&#107;&#x65;&#x6C;&#64;&#116;&#x65;&#115;&#116;&#46;&#108;&#105;&#x6E;&#x64;&#115;&#97;&#97;&#114;.&#110;&#101;&#116;&#x2E;&#97;u">&#x6D;&#105;&#107;&#x65;&#x6C;&#64;&#116;&#x65;&#115;&#116;&#46;&#108;&#105;&#x6E;&#x64;&#115;&#97;&#97;&#114;.&#110;&#101;&#116;&#x2E;&#97;u</a>'
+ subject 'First multipart email sent with Mail'</p>
+
+<p>text_part do
+ body 'Here is the attachment you wanted'
+ end</p>
+
+<p>html<em>part do
+ content</em>type 'text/html; charset=UTF-8'
+ body '<h1>Funky Title</h1><p>Here is the attachment you wanted</p>'
+ end</p>
+
+<p>add_file '/path/to/myfile.pdf'
+end</p>
+
+<p>@round<em>tripped</em>mail = Mail.new(@mail.encoded)</p>
+
+<p>@round<em>tripped</em>mail.attachments.length #=> 1
+@round<em>tripped</em>mail.attachments.first.filename #=> 'myfile.pdf'
+```
+See "Testing and extracting attachments" above for more details.</p>
+
+<h2>Using Mail with Testing or Spec'ing Libraries</h2>
+
+<p>If mail is part of your system, you'll need a way to test it without actually
+sending emails, the TestMailer can do this for you.</p>
+
+<p><code>
+require 'mail'
+=&gt; true
+Mail.defaults do
+ delivery_method :test
+end
+=&gt; #&lt;Mail::Configuration:0x19345a8 @delivery_method=Mail::TestMailer&gt;
+Mail::TestMailer.deliveries
+=&gt; []
+Mail.deliver do
+ to 'mikel@me.com'
+ from 'you@you.com'
+ subject 'testing'
+ body 'hello'
+end
+=&gt; #&lt;Mail::Message:0x19284ec ...
+Mail::TestMailer.deliveries.length
+=&gt; 1
+Mail::TestMailer.deliveries.first
+=&gt; #&lt;Mail::Message:0x19284ec ...
+Mail::TestMailer.deliveries.clear
+=&gt; []
+</code></p>
+
+<p>There is also a set of RSpec matchers stolen fr^H^H^H^H^H^H^H^H inspired by Shoulda's ActionMailer matchers (you'll want to set <code>delivery_method</code> as above too):</p>
+
+<p>```
+Mail.defaults do
+ delivery<em>method :test # in practice you'd do this in spec</em>helper.rb
+end</p>
+
+<p>describe "sending an email" do
+ include Mail::Matchers</p>
+
+<p>before(:each) do
+ Mail::TestMailer.deliveries.clear</p>
+
+<pre><code>Mail.deliver do
+ to ['mikel@me.com', 'mike2@me.com']
+ from 'you@you.com'
+ subject 'testing'
+ body 'hello'
+end
</code></pre>
-<p>If you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.</p>
+<p>end</p>
+
+<p>it { should have<em>sent</em>email } # passes if any email at all was sent</p>
+
+<p>it { should have<em>sent</em>email.from('you@you.com') }
+ it { should have<em>sent</em>email.to('mike1@me.com') }</p>
+
+<p># can specify a list of recipients...
+ it { should have<em>sent</em>email.to(['mike1@me.com', 'mike2@me.com']) }</p>
+
+<p># ...or chain recipients together
+ it { should have<em>sent</em>email.to('mike1@me.com').to('mike2@me.com') }</p>
+
+<p>it { should have<em>sent</em>email.with_subject('testing') }</p>
+
+<p>it { should have<em>sent</em>email.with_body('hello') }</p>
+
+<p># Can match subject or body with a regex
+ # (or anything that responds_to? :match)</p>
+
+<p>it { should have<em>sent</em>email.matching<em>subject(/test(ing)?/) }
+ it { should have</em>sent<em>email.matching</em>body(/h(a|e)llo/) }</p>
+
+<p># Can chain together modifiers
+ # Note that apart from recipients, repeating a modifier overwrites old value.</p>
+
+<p>it { should have<em>sent</em>email.from('you@you.com').to('mike1@me.com').matching_body(/hell/)
+end
+```</p>
+
+<h2>Excerpts from TREC Spam Corpus 2005</h2>
+
+<p>The spec fixture files in spec/fixtures/emails/from<em>trec</em>2005 are from the
+2005 TREC Public Spam Corpus. They remain copyrighted under the terms of
+that project and license agreement. They are used in this project to verify
+and describe the development of this email parser implementation.</p>
+
+<p>http://plg.uwaterloo.ca/~gvcormac/treccorpus/</p>
+
+<p>They are used as allowed by 'Permitted Uses, Clause 3':</p>
+
+<pre><code>"Small excerpts of the information may be displayed to others
+ or published in a scientific or technical context, solely for
+ the purpose of describing the research and development and
+ related issues."
+
+ -- http://plg.uwaterloo.ca/~gvcormac/treccorpus/
+</code></pre>
+
+<h2>License</h2>
+
+<p>(The MIT License)</p>
+
+<p>Copyright (c) 2009, 2010, 2011, 2012</p>
+
+<p>Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:</p>
+
+<p>The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.</p>
+
+<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p></div>
+</td>
+<td>
+<!--content-->
+<div class="content">
+<h2 id="language_statistics_heading">Language Statistics</h2>
+<table id="code_stats">
+
+<tr>
+<td>100%</td>
+<td>Ruby</td>
+<td><span data-lang="Ruby"></span></td>
+<td style="width:400px;"><div><span data-lang="Ruby" percent="100%" style="width:0%;"></span><span total="30405"></span></div></td>
+</tr>
+<tr>
+
+</table>
+<h2 id="recent_commits_heading">Recent Commits</h2>
+<ol id="recent_commits">
+
+
+<li>Merge pull request #387 from mickeyreiss/master, Arun Agrawal, <span relative_date="1335244262000"></span></li>
+
-<h3>Designer Templates</h3>
+<li>Fixed typo in documentation, Mickey Reiss, <span relative_date="1335244077000"></span></li>
-<p>We've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.</p>
-<h3>Rather Drive Stick?</h3>
+<li>Merge branch 'master' of https://github.com/robdimarco/mail into robdimarco-master, Mikel Lindsaar, <span relative_date="1332572944000"></span></li>
-<p>If you prefer to not use the automatic generator, push a branch named <code>gh-pages</code> to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.</p>
-<h3>Authors and Contributors</h3>
+<li>Merge pull request #374 from gerad/master, Mikel Lindsaar, <span relative_date="1332572848000"></span></li>
-<p>You can <a href="https://github.com/blog/821" class="user-mention">@mention</a> a GitHub username to generate a link to their profile. The resulting <code>&lt;a&gt;</code> element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (<a href="https://github.com/defunkt" class="user-mention">@defunkt</a>), PJ Hyett (<a href="https://github.com/pjhyett" class="user-mention">@pjhyett</a>), and Tom Preston-Werner (<a href="https://github.com/mojombo" class="user-mention">@mojombo</a>) founded GitHub.</p>
-<h3>Support or Contact</h3>
+<li>Merge pull request #364 from matehat/patch-1, Arun Agrawal, <span relative_date="1332572667000"></span></li>
-<p>Having trouble with Pages? Check out the documentation at <a href="http://help.github.com/pages">http://help.github.com/pages</a> or contact <a href="mailto:support@github.com">support@github.com</a> and we’ll help you sort it out.</p>
- </section>
- <footer>
- <p>Project maintained by <a href="https://github.com/joekychen">joekychen</a></p>
- <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="http://twitter.com/#!/michigangraham">mattgraham</a></small></p>
- </footer>
- </div>
- <!--[if !IE]><script>fixScale(document);</script><!--<![endif]-->
-
- </body>
-</html>
+</ol>
+<div id="filebrowser">
+<div id="breadcrumb"><span>mail</span></div>
+<div id="filelists"><div depth="0" class="filelist"><table class="repo_nav"> <thead><tr><th></th><th>name</th><th class="size"><span>sloc</span>&nbsp;&nbsp;<span>size</span></th><th>age</th><th class="message"><span>message</span>&nbsp;&nbsp;<span>description</span><div class="history"><a target="_blank" href="https://github.com/joekychen/mail/commits/master">history</a></div></th></tr></thead> <tbody> <tr class="d"> <td class="icon"></td> <td><a forward>lib</a></td> <td class="size"><span>-</span><span>4 items</span></td> <td relative_date="1335244077000"></td> <td class="message"><div><span>Fixed typo in documentation</span><span class="file_browser_author" email="mreiss@andrew.cmu.edu"> Mickey Reiss</span></div><div></div></td> </tr> <tr class="d"> <td class="icon"></td> <td><a forward>patches</a></td> <td class="size"><span>-</span><span>1 items</span></td> <td relative_date="1296017652000"></td> <td class="message"><div><span>Adding patch file</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="d"> <td class="icon"></td> <td><a forward>reference</a></td> <td class="size"><span>-</span><span>25 items</span></td> <td relative_date="1291970874000"></td> <td class="message"><div><span>Closes issue 135 - Invalid filename for windows</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="d"> <td class="icon"></td> <td><a forward>spec</a></td> <td class="size"><span>-</span><span>6 items</span></td> <td relative_date="1331725467000"></td> <td class="message"><div><span>Preventing file system traversal in file_delivery method</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="https://github.com/joekychen/mail/blob/master/CHANGELOG.rdoc"target='_blank'>CHANGELOG.rdoc</a></td> <td class="size"><span>-</span><span>28K</span></td> <td relative_date="1332572561000"></td> <td class="message"><div><span>Removing unused variable</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f markdown"> <td class="icon"></td> <td><a markdown="CONTRIBUTING.html">CONTRIBUTING.md</a></td> <td class="size"><span>36 lines</span><span>1.9K</span></td> <td relative_date="1326511286000"></td> <td class="message"><div><span>Updating README and CONTRIBUTING</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="https://github.com/joekychen/mail/blob/master/Dependencies.txt"target='_blank'>Dependencies.txt</a></td> <td class="size"><span>-</span><span>213B</span></td> <td relative_date="1258600558000"></td> <td class="message"><div><span>Rename Dependancies.txt -> Dependencies.txt</span><span class="file_browser_author" email="ninja@engineyard.com"> Tim Carey-Smith, Corey Donohoe, Simon Rozet & Ben Burkert</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="Gemfile.html">Gemfile</a></td> <td class="size"><span>23 lines</span><span>523B</span></td> <td relative_date="1327068476000"></td> <td class="message"><div><span>Updating treetop version, specs now run 20-30% faster</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f markdown shown"> <td class="icon"></td> <td><a markdown="README.html">README.md</a></td> <td class="size"><span>501 lines</span><span>20K</span></td> <td relative_date="1330608286000"></td> <td class="message"><div><span>Small typo in readme.</span><span class="file_browser_author" email="mathieu.damours@nextorms.com"> Mathieu D'Amours</span></div><div>README.md for project mail</div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="https://github.com/joekychen/mail/blob/master/ROADMAP"target='_blank'>ROADMAP</a></td> <td class="size"><span>-</span><span>2.4K</span></td> <td relative_date="1270810999000"></td> <td class="message"><div><span>Updating Roadmap</span><span class="file_browser_author" email="raasdnil@gmail.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="Rakefile.html">Rakefile</a></td> <td class="size"><span>32 lines</span><span>1023B</span></td> <td relative_date="1326627498000"></td> <td class="message"><div><span>Version bump to 2.4.0 and gem release</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="https://github.com/joekychen/mail/blob/master/TODO.rdoc"target='_blank'>TODO.rdoc</a></td> <td class="size"><span>-</span><span>425B</span></td> <td relative_date="1266973237000"></td> <td class="message"><div><span>Fixing up TODO and docs</span><span class="file_browser_author" email="raasdnil@gmail.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="https://github.com/joekychen/mail/blob/master/mail.gemspec"target='_blank'>mail.gemspec</a></td> <td class="size"><span>-</span><span>1.0K</span></td> <td relative_date="1326627498000"></td> <td class="message"><div><span>Version bump to 2.4.0 and gem release</span><span class="file_browser_author" email="mikel@rubyx.com"> Mikel Lindsaar</span></div><div></div></td> </tr> <tr class="f"> <td class="icon"></td> <td><a href="test.html">test.rb</a></td> <td class="size"><span>12 lines</span><span>426B</span></td> <td relative_date="1288062582000"></td> <td class="message"><div><span>Merge branch 'master' of github.com:dball/mail Conflicts: lib/mail/encodings.rb lib/mail/utilities.rb spec/mail/network/retriever_methods/pop3_spec.rb</span><span class="file_browser_author" email="donald.ball@gmail.com"> Donald Ball</span></div><div></div></td> </tr> </tbody> </table> <div class="spinner"></div> </div></div>
+</div>
+</div>
+</td>
+</tr>
+</tbody>
+</table>
+</div>
+<script>docas={user:"joekychen",repo:"mail"};document.write('<script src=' + ('__proto__' in {} ? 'http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js':'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js') + '><\/script>')</script>
+<script src="javascript/index.min.js"></script>
+</body>
+</html>
View
6 javascript/docco.min.js
@@ -0,0 +1,6 @@
+(function(){var h,j,k;h="type name action size sloc author email date description message".split(" ");j=function(c,f,i){var d,a;a=c.split("\n");a.pop();d=[];a.forEach(function(a){var b,g,e,l;b={};g=/[^\|]\|/g;for(c=e=0;l=g.exec(a);)e=a.substring(e,l.index),e=e.replace("||","|"),b[h[c++]]=e,e=g.lastIndex+1;b[h[c]]=a.substr(e).replace("||","|");for(a=b.name.split(".");""===a[0];)a.splice(0,1);"s"===b.action&&(b.document=a.slice(0,1<a.length?a.length-1:a.length).join(".")+".html");"m"===b.type[0]&&(b.submodule=
+b.type.substr(1),b.type="m");b.modified="undefined"===typeof moment?1*b.date:moment(new Date(1E3*b.date)).fromNow();"f"===b.type&&".md"===b.name.slice(b.name.length-3,b.name.length)&&(b.is_markdown=!0);"README.md"===b.name&&(b.description=f.length?"README.md for directory "+f[f.length-1]:"README.md for project "+i);return d.push(b)});return d.sort(function(a,b){var c;c=function(a){return"f"===a?1:0};return""+c(a.type)+a.name>""+c(b.type)+b.name?1:-1})};"undefined"===typeof window&&(module.exports=
+j);k=function(c,f,i){$(".spinner").show();return $.get(""+c.join("/")+"?timestamp="+Date.now().valueOf(),function(d){var a,h,b,g,e;$(".spinner").hide();h=j(d);a='<div id="jump_to">Jump To &hellip;<div id="jump_wrapper"><div id="jump_page">';i&&(a=a+"<a dir='u' class='s d'><span>\u2190</span>..&nbsp;</a>");g=0;for(e=h.length;g<e;g++){d=h[g];a=a+("<a class='source "+d.type+"' ");d.action==="s"?a=a+('href="'+(c.length>1?c.slice(0,c.length-1).join("/")+"/":"")+d.document+'"'):d.type==="m"?a=a+('href="https://github.com/'+
+d.submodule+'"'):d.action==="g"?a=a+('href="https://github.com/'+docas.repo+"/tree/master/"+f.join("/")+"/"+d.name+'"'):d.type==="d"&&(a=a+'dir="d"');a=a+(">"+(d.type==="d"?"<span>\u2192</span>":"")+d.name+"</a>")}d=$($(a+'</div><div class="spinner"></div></div></div>')[0]);d.find("a[dir]").click(function(){if($(this).attr("dir")==="u"){f.pop();c.length>1?c.splice(c.length-2,1):c.splice(c.length-1,0,"..")}else{f.push($(this).html());c.splice(c.length-1,0,$(this).html().substr(14))}return k(c,f,i+
+($(this).attr("dir")==="u"?-1:1)*1)});b=d.find("#jump_wrapper");if($("#jump_to").length){a=$("#jump_to > :first-child").height();b.css("min-height",a);b.addClass("show");$("#jump_to").remove()}b.on("mouseout",function(a){if(a.target.id==="jump_wrapper")return b.removeClass("show")});d.on("mouseout",function(a){if(a.target.id==="jump_to")return b.removeClass("show")});d.find("#jump_page a").on("mouseover",function(){return b.css("min-height","")});return $("#background").after(d)})};$(function(){var c;
+c=window.location.pathname.split("/");c.pop();c.shift();c=c.splice(c.length-docas.depth);return k(["docas.idx"],c,docas.depth)})}).call(this);
View
31 javascript/index.min.js
@@ -0,0 +1,31 @@
+(function(o,u){function n(a,i){this._d=a;this._isUTC=!!i}function f(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a){var i=this._data={},h=a.years||a.y||0,e=a.months||a.M||0,b=a.weeks||a.w||0,c=a.days||a.d||0,s=a.hours||a.h||0,g=a.minutes||a.m||0,d=a.seconds||a.s||0,a=a.milliseconds||a.ms||0;this._milliseconds=a+1E3*d+6E4*g+36E5*s;this._days=c+7*b;this._months=e+12*h;i.milliseconds=a%1E3;d+=f(a/1E3);i.seconds=d%60;g+=f(d/60);i.minutes=g%60;s+=f(g/60);i.hours=s%24;c+=f(s/24);c+=7*b;i.days=c%
+30;e+=f(c/30);i.months=e%12;h+=f(e/12);i.years=h}function m(a,i){for(var h=a+"";h.length<i;)h="0"+h;return h}function r(a,i,h){var e=i._milliseconds,b=i._days,i=i._months,c;e&&a._d.setTime(+a+e*h);b&&a.date(a.date()+b*h);i&&(c=a.date(),a.date(1).month(a.month()+i*h).date(Math.min(c,a.daysInMonth())))}function t(a){return"[object Array]"===Object.prototype.toString.call(a)}function x(a){return new o(a[0],a[1]||0,a[2]||1,a[3]||0,a[4]||0,a[5]||0,a[6]||0)}function v(a,i){function h(i){var q,p;switch(i){case "M":return b+
+1;case "Mo":return b+1+n(b+1);case "MM":return m(b+1,2);case "MMM":return e.monthsShort[b];case "MMMM":return e.months[b];case "D":return c;case "Do":return c+n(c);case "DD":return m(c,2);case "DDD":return q=new o(g,b,c),p=new o(g,0,1),~~((q-p)/864E5+1.5);case "DDDo":return q=h("DDD"),q+n(q);case "DDDD":return m(h("DDD"),3);case "d":return s;case "do":return s+n(s);case "ddd":return e.weekdaysShort[s];case "dddd":return e.weekdays[s];case "w":return q=new o(g,b,c-s+5),p=new o(q.getFullYear(),0,4),
+~~((q-p)/864E5/7+1.5);case "wo":return q=h("w"),q+n(q);case "ww":return m(h("w"),2);case "YY":return m(g%100,2);case "YYYY":return g;case "a":return A?A(d,l,!1):11<d?"pm":"am";case "A":return A?A(d,l,!0):11<d?"PM":"AM";case "H":return d;case "HH":return m(d,2);case "h":return d%12||12;case "hh":return m(d%12||12,2);case "m":return l;case "mm":return m(l,2);case "s":return f;case "ss":return m(f,2);case "S":return~~(j/100);case "SS":return m(~~(j/10),2);case "SSS":return m(j,3);case "Z":return(0>k?
+"-":"+")+m(~~(Math.abs(k)/60),2)+":"+m(~~(Math.abs(k)%60),2);case "ZZ":return(0>k?"-":"+")+m(~~(10*Math.abs(k)/6),4);case "L":case "LL":case "LLL":case "LLLL":case "LT":return v(a,e.longDateFormat[i]);default:return i.replace(/(^\[)|(\\)|\]$/g,"")}}var b=a.month(),c=a.date(),g=a.year(),s=a.day(),d=a.hours(),l=a.minutes(),f=a.seconds(),j=a.milliseconds(),k=-a.zone(),n=e.ordinal,A=e.meridiem;return i.replace(q,h)}function B(a){switch(a){case "DDDD":return I;case "YYYY":return J;case "S":case "SS":case "SSS":case "DDD":return K;
+case "MMM":case "MMMM":case "ddd":case "dddd":case "a":case "A":return L;case "Z":case "ZZ":return E;case "T":return M;case "MM":case "DD":case "dd":case "YY":case "HH":case "hh":case "mm":case "ss":case "M":case "D":case "d":case "H":case "h":case "m":case "s":return N;default:return RegExp(a.replace("\\",""))}}function w(a,i){var h=[0,0,1,0,0,0,0],b={tzh:0,tzm:0},c=i.match(q),g,d;for(g=0;g<c.length;g++){d=(B(c[g]).exec(a)||[])[0];var a=a.replace(B(c[g]),""),l=h,f=b,j=void 0;switch(c[g]){case "M":case "MM":l[1]=
+null==d?0:~~d-1;break;case "MMM":case "MMMM":for(j=0;12>j;j++)if(e.monthsParse[j].test(d)){l[1]=j;break}break;case "D":case "DD":case "DDD":case "DDDD":l[2]=~~d;break;case "YY":d=~~d;l[0]=d+(70<d?1900:2E3);break;case "YYYY":l[0]=~~Math.abs(d);break;case "a":case "A":f.isPm="pm"===(d+"").toLowerCase();break;case "H":case "HH":case "h":case "hh":l[3]=~~d;break;case "m":case "mm":l[4]=~~d;break;case "s":case "ss":l[5]=~~d;break;case "S":case "SS":case "SSS":l[6]=~~(1E3*("0."+d));break;case "Z":case "ZZ":f.isUTC=
+!0,(j=(d+"").match(O))&&j[1]&&(f.tzh=~~j[1]),j&&j[2]&&(f.tzm=~~j[2]),j&&"+"===j[0]&&(f.tzh=-f.tzh,f.tzm=-f.tzm)}}return b.isPm&&12>h[3]&&(h[3]+=12),!1===b.isPm&&12===h[3]&&(h[3]=0),h[3]+=b.tzh,h[4]+=b.tzm,b.isUTC?new o(o.UTC.apply({},h)):x(h)}function D(a,i,h,b){var d=e.relativeTime[a];return"function"==typeof d?d(i||1,!!h,a,b):d.replace(/%d/i,i||1)}function C(a,i){e.fn[a]=function(a){var b=this._isUTC?"UTC":"";return null!=a?(this._d["set"+b+i](a),this):this._d["get"+b+i]()}}function y(a){e.duration.fn[a]=
+function(){return this._data[a]}}function z(a,i){e.duration.fn["as"+a]=function(){return+this/i}}var e,b=Math.round,c,l={},j="en",k="undefined"!=typeof module,d="months monthsShort monthsParse weekdays weekdaysShort longDateFormat calendar relativeTime ordinal meridiem".split(" "),g=/^\/?Date\((\-?\d+)/i,q=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|LT|LL?L?L?)/g,A=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,N=/\d\d?/,K=
+/\d{1,3}/,I=/\d{3}/,J=/\d{4}/,L=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,E=/Z|[\+\-]\d\d:?\d\d/i,M=/T/i,P=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,H=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],O=/([\+\-]|\d\d)/gi,F="Month Date Hours Minutes Seconds Milliseconds".split(" "),G={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6};e=function(a,i){if(null===
+a||""===a)return null;var h,b;if(e.isMoment(a))h=new o(+a._d),b=a._isUTC;else if(i)if(t(i)){var d=a.match(A)||[],c,l=99,j,f,k;for(j=0;j<i.length;j++){f=w(a,i[j]);c=v(new n(f),i[j]).match(A)||[];k=d;for(var q=Math.min(k.length,c.length),m=Math.abs(k.length-c.length),p=0,r=void 0,r=0;r<q;r++)~~k[r]!==~~c[r]&&p++;k=p+m;k<l&&(l=k,h=f)}}else h=w(a,i);else if(h=g.exec(a),a===u)h=new o;else if(h)h=new o(+h[1]);else if(a instanceof o)h=a;else if(t(a))h=x(a);else if("string"==typeof a)if(h="YYYY-MM-DDT",P.exec(a)){for(d=
+0;4>d;d++)if(H[d][1].exec(a)){h+=H[d][0];break}h=E.exec(a)?w(a,h+" Z"):w(a,h)}else h=new o(a);else h=new o(a);return new n(h,b)};e.utc=function(a,i){return t(a)?new n(new o(o.UTC.apply({},a)),!0):i&&a?e(a+" +0000",i+" Z").utc():e(a&&!E.exec(a)?a+"+0000":a).utc()};e.unix=function(a){return e(1E3*a)};e.duration=function(a,i){var h=e.isDuration(a),b="number"==typeof a,h=h?a._data:b?{}:a;return b&&(i?h[i]=a:h.milliseconds=a),new p(h)};e.humanizeDuration=function(a,i,b){return e.duration(a,!0===i?null:
+i).humanize(!0===i?!0:b)};e.version="1.6.2";e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";e.lang=function(a,i){var b,c,g=[];if(!a)return j;if(i){for(b=0;12>b;b++)g[b]=RegExp("^"+i.months[b]+"|^"+i.monthsShort[b].replace(".",""),"i");i.monthsParse=i.monthsParse||g;l[a]=i}if(l[a]){for(b=0;b<d.length;b++)e[d[b]]=l[a][d[b]]||l.en[d[b]];j=a}else k&&(c=require("./lang/"+a),e.lang(a,c))};e.lang("en",{months:"January February March April May June July August September October November December".split(" "),monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
+weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:!1,calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s",s:"just now",m:"a minute ago",mm:"%d minutes ago",
+h:"an hour ago",hh:"%d hours ago",d:"a day ago",dd:"%d days ago",M:"a month ago",MM:"%d months ago",y:"a year ago",yy:"%d years ago"},ordinal:function(a){var b=a%10;return 1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"}});e.isMoment=function(a){return a instanceof n};e.isDuration=function(a){return a instanceof p};e.fn=n.prototype={clone:function(){return e(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1E3)},toString:function(){return this._d.toString()},
+toDate:function(){return this._d},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return v(this,a?a:e.defaultFormat)},add:function(a,b){var d=b?e.duration(+b,a):e.duration(a);return r(this,d,1),this},subtract:function(a,b){var d=b?e.duration(+b,a):e.duration(a);return r(this,d,-1),this},diff:function(a,d,c){var a=this._isUTC?e(a).utc():e(a).local(),g=6E4*(this.zone()-a.zone()),g=this._d-a._d-g,j=this.year()-a.year(),l=this.month()-a.month(),
+a=this.date()-a.date(),f;return"months"===d?f=12*j+l+a/30:"years"===d?f=j+(l+a/30)/12:f="seconds"===d?g/1E3:"minutes"===d?g/6E4:"hours"===d?g/36E5:"days"===d?g/864E5:"weeks"===d?g/6048E5:g,c?f:b(f)},from:function(a,b){return e.duration(this.diff(a)).humanize(!b)},fromNow:function(a){return this.from(e(),a)},calendar:function(){var a=this.diff(e().sod(),"days",!0),b=e.calendar,d=b.sameElse,a=-6>a?d:-1>a?b.lastWeek:0>a?b.lastDay:1>a?b.sameDay:2>a?b.nextDay:7>a?b.nextWeek:d;return this.format("function"==
+typeof a?a.apply(this):a)},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()<e([this.year()]).zone()||this.zone()<e([this.year(),5]).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null==a?b:this.add({d:a-b})},sod:function(){return e(this).hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},
+daysInMonth:function(){return e(this).month(this.month()+1).date(0).date()}};for(c=0;c<F.length;c++)C(F[c].toLowerCase(),F[c]);C("year","FullYear");e.duration.fn=p.prototype={weeks:function(){return f(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+2592E6*this._months},humanize:function(a){var d=+this,c=e.relativeTime,g;g=!a;var j=b(Math.abs(d)/1E3),f=b(j/60),l=b(f/60),k=b(l/24),q=b(k/365),j=45>j&&["s",j]||1===f&&["m"]||45>f&&["mm",f]||1===l&&["h"]||22>l&&["hh",l]||1===
+k&&["d"]||25>=k&&["dd",k]||45>=k&&["M"]||345>k&&["MM",b(k/30)]||1===q&&["y"]||["yy",q];g=(j[2]=g,j[3]=0<d,D.apply({},j));return a&&(g=(0>=d?c.past:c.future).replace(/%s/i,g)),g}};for(c in G)G.hasOwnProperty(c)&&(z(c,G[c]),y(c.toLowerCase()));z("Weeks",6048E5);k&&(module.exports=e);"undefined"!=typeof window&&"undefined"==typeof ender&&(window.moment=e);"function"==typeof define&&define.amd&&define("moment",[],function(){return e})})(Date);(function(o){o.cookie=function(u,n,f){if(1<arguments.length&&(!/Object/.test(Object.prototype.toString.call(n))||null===n||void 0===n)){f=o.extend({},f);if(null===n||void 0===n)f.expires=-1;if("number"===typeof f.expires){var p=f.expires,m=f.expires=new Date;m.setDate(m.getDate()+p)}n=""+n;return document.cookie=[encodeURIComponent(u),"=",f.raw?n:encodeURIComponent(n),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":
+""].join("")}for(var f=n||{},p=f.raw?function(f){return f}:decodeURIComponent,m=document.cookie.split("; "),r=0,t;t=m[r]&&m[r].split("=");r++)if(p(t[0])===u)return p(t[1]||"");return null}})($);(function(){var o,u,n,f,p,m,r,t,x,v,B,w,D,C,y,z,e=[].slice;p="type name action size sloc author email date description message".split(" ");t=function(b,c,e){var j,f;f=b.split("\n");f.pop();j=[];f.forEach(function(d){var g,f,k,m;g={};f=/[^\|]\|/g;for(b=k=0;m=f.exec(d);)k=d.substring(k,m.index),k=k.replace("||","|"),g[p[b++]]=k,k=f.lastIndex+1;g[p[b]]=d.substr(k).replace("||","|");for(d=g.name.split(".");""===d[0];)d.splice(0,1);"s"===g.action&&(g.document=d.slice(0,1<d.length?d.length-1:d.length).join(".")+
+".html");"m"===g.type[0]&&(g.submodule=g.type.substr(1),g.type="m");g.modified="undefined"===typeof moment?1*g.date:moment(new Date(1E3*g.date)).fromNow();"f"===g.type&&".md"===g.name.slice(g.name.length-3,g.name.length)&&(g.is_markdown=!0);"README.md"===g.name&&(g.description=c.length?"README.md for directory "+c[c.length-1]:"README.md for project "+e);return j.push(g)});return j.sort(function(b,c){var e;e=function(b){return"f"===b?1:0};return""+e(b.type)+b.name>""+e(c.type)+c.name?1:-1})};"undefined"===
+typeof window&&(module.exports=t);m=function(b){return new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").replace(/'(?=[^<]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');")}("<div depth=\"<%= index_path.length %>\" class=\"filelist\">\n<table class=\"repo_nav\">\n<thead><tr><th></th><th>name</th><th class=\"<%= size %>\"><span>sloc</span>&nbsp;&nbsp;<span>size</span></th><th>age</th><th class=\"<%= message %>\"><span>message</span>&nbsp;&nbsp;<span>description</span><div class=\"history\"><a target=\"_blank\" href=\"https://github.com/<%= user %>/<%= repo %>/commits/master\">history</a></div></th></tr></thead>\n<tbody>\n<% if(index_path.length) { %>\n<tr class=\"directory\"><td></td><td><a backward>..</a></td><td></td><td></td><td></td></tr>\n<% } %>\n<% entries.forEach(function(entry) { %>\n<tr class=\"<%= entry.type %><%= entry.is_markdown ? ' markdown' : '' %><%= entry.name.toLowerCase() == 'readme.md' ? ' shown' : '' %>\">\n<td class=\"icon\"></td>\n<td><a <%= entry.type == 'd' ? 'forward' : entry.is_markdown ? 'markdown=\"' + entry.document + '\"' : 'href=\"' + (entry.type == 'm' ? 'https://github.com/' + entry.submodule : (entry.action === 's' ? index_path.concat(entry.document).join('/') : 'https://github.com/' + user + '/' + repo + '/blob/master/' + index_path.concat(entry.name).join('/'))) + '\"' %><%= entry.action === \"g\" ? \"target='_blank'\": \"\" %>><%= entry.name %></a></td>\n<td class=\"<%= size %>\"><span><%= entry.sloc ? (entry.sloc + \" \" + (entry.sloc > 1 ? \"lines\" : \"line\")) : \"-\" %></span><span><%= entry.size %></span></td>\n<td <%= (typeof entry.modified) === 'string' ? '' : 'relative_date=\"' + entry.modified * 1000 + '\"' %>><%= (typeof entry.modified) === 'string' ? entry.modified : '' %></td>\n<td class=\"<%= message %>\"><div><span><%= entry.message %></span><span class=\"file_browser_author\" email=\"<%= entry.email %>\"> <%= entry.author %></span></div><div><%= entry.description %></div></td>\n</tr>\n<% }); %>\n</tbody>\n</table>\n<div class=\"spinner\"></div>\n</div>".replace("\n",
+""));"undefined"===typeof window&&(module.exports=m);u=$("#code_stats span[percent]");u.length&&(w=u.length,(o=function(){var b,c,e;if(w){b=$(u[--w]);c=b.next();e=1*c.attr("total");(function(b,c){var d,e,f;d=0;f=c*1E3/1E3/20;return(e=function(){(d=d+f)>c?d=c:setTimeout(e,50);return b.html(Math.floor(d)+" sloc")})()})(c,e);return b.attr("percent")===b.css("width")?o():b.animate({width:b.attr("percent")},1E3,"linear",o)}})());f="README.html";B=function(b,c){return $.ajax({url:e.call(b).concat([c]).join("/"),
+success:function(l){if(l){f=e.call(b).concat([c]).join();return $(".markdown_browser").animate({opacity:0},400,"linear",function(){var b,c;b=$(".markdown_browser").parent();$(".markdown_browser").remove();c=$("<div class='markdown_browser'>"+l+"</div>").css("opacity","0");$(b).append(c);return $(c).animate({opacity:1},400,"linear")})}}})};C=docas.user;v=docas.repo;n=function(b){var c,f,j,k,d,b=[v].concat(e.call(b));j="";f=k=0;for(d=b.length;k<d;f=++k){c=b[f];j=f<b.length-1?j+("<a depth="+f+">"+c+
+"</a>&nbsp;/&nbsp;"):j+("<span>"+c+"</span>")}return j};r=function(b,c){var l,j,k;D();$(b).find("a[backward]").click(function(){return x(c.slice(0,c.length-1))});$(b).find("a[forward]").click(function(){return x(e.call(c).concat([$(this).html()]))});$(b).find("a[markdown]").click(function(){var b,g;g=$(this).attr("markdown");b=$(this).parent().parent();b.siblings().removeClass("shown");b.addClass("shown");if(f!==e.call(c).concat([g]).join())return B(c,g)});$(b).find("thead th:nth-child(3) > :first-child").click(function(){$.cookie("size",
+"sloc");return $(".repo_nav tr > :nth-child(3)").attr("class","sloc")});$(b).find("thead th:nth-child(3) > :last-child").click(function(){$.cookie("size","size");return $(".repo_nav tr > :nth-child(3)").attr("class","size")});$(b).find("thead th:last-child > :first-child").click(function(){$.cookie("message","message");return $