mack-notifier 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. data/lib/gems.rb +13 -0
  2. data/lib/gems/tmail-1.2.3.1/ext/Makefile +20 -0
  3. data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/MANIFEST +4 -0
  4. data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/depend +1 -0
  5. data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/extconf.rb +33 -0
  6. data/lib/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/tmailscanner.c +583 -0
  7. data/lib/gems/tmail-1.2.3.1/lib/tmail.rb +5 -0
  8. data/lib/gems/tmail-1.2.3.1/lib/tmail/Makefile +18 -0
  9. data/lib/gems/tmail-1.2.3.1/lib/tmail/address.rb +426 -0
  10. data/lib/gems/tmail-1.2.3.1/lib/tmail/attachments.rb +46 -0
  11. data/lib/gems/tmail-1.2.3.1/lib/tmail/base64.rb +46 -0
  12. data/lib/gems/tmail-1.2.3.1/lib/tmail/compat.rb +41 -0
  13. data/lib/gems/tmail-1.2.3.1/lib/tmail/config.rb +67 -0
  14. data/lib/gems/tmail-1.2.3.1/lib/tmail/core_extensions.rb +63 -0
  15. data/lib/gems/tmail-1.2.3.1/lib/tmail/encode.rb +581 -0
  16. data/lib/gems/tmail-1.2.3.1/lib/tmail/header.rb +960 -0
  17. data/lib/gems/tmail-1.2.3.1/lib/tmail/index.rb +9 -0
  18. data/lib/gems/tmail-1.2.3.1/lib/tmail/interface.rb +1125 -0
  19. data/lib/gems/tmail-1.2.3.1/lib/tmail/loader.rb +3 -0
  20. data/lib/gems/tmail-1.2.3.1/lib/tmail/mail.rb +578 -0
  21. data/lib/gems/tmail-1.2.3.1/lib/tmail/mailbox.rb +495 -0
  22. data/lib/gems/tmail-1.2.3.1/lib/tmail/main.rb +6 -0
  23. data/lib/gems/tmail-1.2.3.1/lib/tmail/mbox.rb +3 -0
  24. data/lib/gems/tmail-1.2.3.1/lib/tmail/net.rb +248 -0
  25. data/lib/gems/tmail-1.2.3.1/lib/tmail/obsolete.rb +132 -0
  26. data/lib/gems/tmail-1.2.3.1/lib/tmail/parser.rb +1476 -0
  27. data/lib/gems/tmail-1.2.3.1/lib/tmail/parser.y +381 -0
  28. data/lib/gems/tmail-1.2.3.1/lib/tmail/port.rb +379 -0
  29. data/lib/gems/tmail-1.2.3.1/lib/tmail/quoting.rb +118 -0
  30. data/lib/gems/tmail-1.2.3.1/lib/tmail/require_arch.rb +58 -0
  31. data/lib/gems/tmail-1.2.3.1/lib/tmail/scanner.rb +49 -0
  32. data/lib/gems/tmail-1.2.3.1/lib/tmail/scanner_r.rb +261 -0
  33. data/lib/gems/tmail-1.2.3.1/lib/tmail/stringio.rb +280 -0
  34. data/lib/gems/tmail-1.2.3.1/lib/tmail/utils.rb +337 -0
  35. data/lib/gems/tmail-1.2.3.1/lib/tmail/version.rb +39 -0
  36. data/lib/gems/tmail-1.2.3.1/meta/MANIFEST +128 -0
  37. data/lib/gems/tmail-1.2.3.1/meta/VERSION +1 -0
  38. data/lib/gems/tmail-1.2.3.1/meta/project.yaml +30 -0
  39. data/lib/gems/tmail-1.2.3.1/meta/unixname +1 -0
  40. data/lib/gems/validatable-1.6.7/README +118 -0
  41. data/lib/gems/validatable-1.6.7/lib/child_validation.rb +15 -0
  42. data/lib/gems/validatable-1.6.7/lib/errors.rb +74 -0
  43. data/lib/gems/validatable-1.6.7/lib/included_validation.rb +9 -0
  44. data/lib/gems/validatable-1.6.7/lib/macros.rb +283 -0
  45. data/lib/gems/validatable-1.6.7/lib/object_extension.rb +21 -0
  46. data/lib/gems/validatable-1.6.7/lib/requireable.rb +26 -0
  47. data/lib/gems/validatable-1.6.7/lib/understandable.rb +31 -0
  48. data/lib/gems/validatable-1.6.7/lib/validatable.rb +19 -0
  49. data/lib/gems/validatable-1.6.7/lib/validatable_class_methods.rb +85 -0
  50. data/lib/gems/validatable-1.6.7/lib/validatable_instance_methods.rb +106 -0
  51. data/lib/gems/validatable-1.6.7/lib/validations/validates_acceptance_of.rb +11 -0
  52. data/lib/gems/validatable-1.6.7/lib/validations/validates_confirmation_of.rb +15 -0
  53. data/lib/gems/validatable-1.6.7/lib/validations/validates_each.rb +14 -0
  54. data/lib/gems/validatable-1.6.7/lib/validations/validates_format_of.rb +13 -0
  55. data/lib/gems/validatable-1.6.7/lib/validations/validates_length_of.rb +25 -0
  56. data/lib/gems/validatable-1.6.7/lib/validations/validates_numericality_of.rb +16 -0
  57. data/lib/gems/validatable-1.6.7/lib/validations/validates_presence_of.rb +13 -0
  58. data/lib/gems/validatable-1.6.7/lib/validations/validates_true_for.rb +13 -0
  59. data/lib/gems/validatable-1.6.7/lib/validations/validation_base.rb +88 -0
  60. data/lib/gems/validatable-1.6.7/rakefile.rb +50 -0
  61. data/lib/gems/validatable-1.6.7/test/all_tests.rb +1 -0
  62. data/lib/gems/validatable-1.6.7/test/functional/validatable_test.rb +437 -0
  63. data/lib/gems/validatable-1.6.7/test/functional/validates_acceptance_of_test.rb +16 -0
  64. data/lib/gems/validatable-1.6.7/test/functional/validates_confirmation_of_test.rb +56 -0
  65. data/lib/gems/validatable-1.6.7/test/functional/validates_each_test.rb +14 -0
  66. data/lib/gems/validatable-1.6.7/test/functional/validates_format_of_test.rb +34 -0
  67. data/lib/gems/validatable-1.6.7/test/functional/validates_length_of_test.rb +64 -0
  68. data/lib/gems/validatable-1.6.7/test/functional/validates_numericality_of_test.rb +57 -0
  69. data/lib/gems/validatable-1.6.7/test/functional/validates_presence_of_test.rb +16 -0
  70. data/lib/gems/validatable-1.6.7/test/functional/validates_true_for_test.rb +27 -0
  71. data/lib/gems/validatable-1.6.7/test/test_helper.rb +33 -0
  72. data/lib/gems/validatable-1.6.7/test/unit/errors_test.rb +64 -0
  73. data/lib/gems/validatable-1.6.7/test/unit/understandable_test.rb +19 -0
  74. data/lib/gems/validatable-1.6.7/test/unit/validatable_test.rb +38 -0
  75. data/lib/gems/validatable-1.6.7/test/unit/validates_acceptance_of_test.rb +21 -0
  76. data/lib/gems/validatable-1.6.7/test/unit/validates_confirmation_of_test.rb +64 -0
  77. data/lib/gems/validatable-1.6.7/test/unit/validates_format_of_test.rb +34 -0
  78. data/lib/gems/validatable-1.6.7/test/unit/validates_length_of_test.rb +75 -0
  79. data/lib/gems/validatable-1.6.7/test/unit/validates_numericality_of_test.rb +52 -0
  80. data/lib/gems/validatable-1.6.7/test/unit/validates_presence_of_test.rb +25 -0
  81. data/lib/gems/validatable-1.6.7/test/unit/validates_true_for_test.rb +29 -0
  82. data/lib/gems/validatable-1.6.7/test/unit/validation_base_test.rb +52 -0
  83. data/lib/gems/xmpp4r-0.4/CHANGELOG +83 -0
  84. data/lib/gems/xmpp4r-0.4/COPYING +340 -0
  85. data/lib/gems/xmpp4r-0.4/LICENSE +59 -0
  86. data/lib/gems/xmpp4r-0.4/README.rdoc +110 -0
  87. data/lib/gems/xmpp4r-0.4/README_ruby19.txt +43 -0
  88. data/lib/gems/xmpp4r-0.4/Rakefile +262 -0
  89. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/README +56 -0
  90. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/adventure.rb +23 -0
  91. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/adventuremuc.rb +136 -0
  92. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/cube.xml +15 -0
  93. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/tower.xml +69 -0
  94. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/adventure/world.rb +424 -0
  95. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/fileserve.conf +11 -0
  96. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/fileserve.rb +346 -0
  97. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/getonline.rb +56 -0
  98. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/gtkmucclient.rb +315 -0
  99. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/migrate.rb +88 -0
  100. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/minimuc.rb +266 -0
  101. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/pep-aggregator/index.xsl +235 -0
  102. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/pep-aggregator/pep-aggregator.rb +147 -0
  103. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/recvfile.rb +84 -0
  104. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/rosterdiscovery.rb +129 -0
  105. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/sendfile.conf +10 -0
  106. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/sendfile.rb +72 -0
  107. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr.rb +51 -0
  108. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_jabber.rb +43 -0
  109. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/shellmgr/shellmgr_test.rb +10 -0
  110. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/versionpoll.rb +90 -0
  111. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/xmpping.rb +146 -0
  112. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/advanced/xmppingrc.sample +14 -0
  113. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/change_password.rb +41 -0
  114. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/client.rb +70 -0
  115. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/component.rb +11 -0
  116. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/echo.rb +37 -0
  117. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/jabbersend.rb +41 -0
  118. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mass_sender.rb +68 -0
  119. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/muc_owner_config.rb +12 -0
  120. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mucinfo.rb +41 -0
  121. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/mucsimplebot.rb +82 -0
  122. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/register.rb +42 -0
  123. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/remove_registration.rb +18 -0
  124. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/roster.rb +44 -0
  125. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterprint.rb +50 -0
  126. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterrename.rb +34 -0
  127. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/rosterwatch.rb +171 -0
  128. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/send_vcard.rb +67 -0
  129. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/tune_client.rb +56 -0
  130. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/tune_server.rb +58 -0
  131. data/lib/gems/xmpp4r-0.4/data/doc/xmpp4r/examples/basic/versionbot.rb +75 -0
  132. data/lib/gems/xmpp4r-0.4/lib/xmpp4r.rb +116 -0
  133. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/base64.rb +32 -0
  134. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams.rb +15 -0
  135. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/filetransfer.rb +319 -0
  136. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/base.rb +257 -0
  137. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/initiator.rb +31 -0
  138. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/ibb/target.rb +47 -0
  139. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb +152 -0
  140. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb +86 -0
  141. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb +198 -0
  142. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb +65 -0
  143. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb +73 -0
  144. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb.orig +62 -0
  145. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/iq/bytestreams.rb +170 -0
  146. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/bytestreams/iq/si.rb +206 -0
  147. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/callbacks.rb +124 -0
  148. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps.rb +1 -0
  149. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/c.rb +53 -0
  150. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/helper/generator.rb +160 -0
  151. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/caps/helper/helper.rb +87 -0
  152. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/client.rb +317 -0
  153. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/command/helper/responder.rb +53 -0
  154. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/command/iq/command.rb +154 -0
  155. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/component.rb +103 -0
  156. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/connection.rb +219 -0
  157. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/dataforms.rb +5 -0
  158. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/dataforms/x/data.rb +297 -0
  159. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/debuglog.rb +42 -0
  160. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/delay.rb +5 -0
  161. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/delay/x/delay.rb +99 -0
  162. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery.rb +7 -0
  163. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/helper/responder.rb +165 -0
  164. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/iq/discoinfo.rb +211 -0
  165. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/discovery/iq/discoitems.rb +147 -0
  166. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/errors.rb +281 -0
  167. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/feature_negotiation.rb +5 -0
  168. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/feature_negotiation/iq/feature.rb +28 -0
  169. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/framework/base.rb +55 -0
  170. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/framework/bot.rb +148 -0
  171. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/httpbinding.rb +5 -0
  172. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/httpbinding/client.rb +285 -0
  173. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/idgenerator.rb +37 -0
  174. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/iq.rb +221 -0
  175. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/jid.rb +167 -0
  176. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/message.rb +148 -0
  177. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc.rb +14 -0
  178. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/mucbrowser.rb +92 -0
  179. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/mucclient.rb +462 -0
  180. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/helper/simplemucclient.rb +332 -0
  181. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucadmin.rb +23 -0
  182. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucadminitem.rb +20 -0
  183. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/iq/mucowner.rb +15 -0
  184. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/item.rb +143 -0
  185. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/muc.rb +70 -0
  186. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/mucuserinvite.rb +60 -0
  187. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/muc/x/mucuseritem.rb +36 -0
  188. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/presence.rb +232 -0
  189. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub.rb +8 -0
  190. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/configuration.rb +86 -0
  191. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/event.rb +49 -0
  192. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/item.rb +35 -0
  193. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/items.rb +44 -0
  194. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/node_config.rb +48 -0
  195. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/publish.rb +24 -0
  196. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription.rb +62 -0
  197. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/subscription_config.rb +67 -0
  198. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/children/unsubscribe.rb +48 -0
  199. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/nodebrowser.rb +130 -0
  200. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/nodehelper.rb +156 -0
  201. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/helper/servicehelper.rb +417 -0
  202. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/pubsub/iq/pubsub.rb +19 -0
  203. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/query.rb +15 -0
  204. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rexmladdons.rb +151 -0
  205. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster.rb +7 -0
  206. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/helper/roster.rb +519 -0
  207. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/iq/roster.rb +215 -0
  208. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/roster/x/roster.rb +138 -0
  209. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc.rb +2 -0
  210. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/client.rb +123 -0
  211. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/server.rb +74 -0
  212. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/helper/xmlrpcaddons.rb +67 -0
  213. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/rpc/iq/rpc.rb +23 -0
  214. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/sasl.rb +237 -0
  215. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/semaphore.rb +38 -0
  216. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/stream.rb +497 -0
  217. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/streamparser.rb +77 -0
  218. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune.rb +2 -0
  219. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune/helper/helper.rb +58 -0
  220. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/tune/tune.rb +113 -0
  221. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard.rb +6 -0
  222. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard/helper/vcard.rb +84 -0
  223. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/vcard/iq/vcard.rb +109 -0
  224. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version.rb +7 -0
  225. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/helper/responder.rb +72 -0
  226. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/helper/simpleresponder.rb +44 -0
  227. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/version/iq/version.rb +105 -0
  228. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/x.rb +37 -0
  229. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xhtml.rb +1 -0
  230. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xhtml/html.rb +115 -0
  231. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmpp4r.rb +18 -0
  232. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmppelement.rb +168 -0
  233. data/lib/gems/xmpp4r-0.4/lib/xmpp4r/xmppstanza.rb +162 -0
  234. data/lib/gems/xmpp4r-0.4/setup.rb +1586 -0
  235. data/lib/gems/xmpp4r-0.4/test/bytestreams/tc_ibb.rb +186 -0
  236. data/lib/gems/xmpp4r-0.4/test/bytestreams/tc_socks5bytestreams.rb +113 -0
  237. data/lib/gems/xmpp4r-0.4/test/caps/tc_helper.rb +156 -0
  238. data/lib/gems/xmpp4r-0.4/test/dataforms/tc_data.rb +81 -0
  239. data/lib/gems/xmpp4r-0.4/test/delay/tc_xdelay.rb +51 -0
  240. data/lib/gems/xmpp4r-0.4/test/discovery/tc_responder.rb +91 -0
  241. data/lib/gems/xmpp4r-0.4/test/lib/assert_equal_xml.rb +14 -0
  242. data/lib/gems/xmpp4r-0.4/test/lib/clienttester.rb +120 -0
  243. data/lib/gems/xmpp4r-0.4/test/muc/tc_muc_mucclient.rb +830 -0
  244. data/lib/gems/xmpp4r-0.4/test/muc/tc_muc_simplemucclient.rb +114 -0
  245. data/lib/gems/xmpp4r-0.4/test/muc/tc_mucowner.rb +50 -0
  246. data/lib/gems/xmpp4r-0.4/test/pubsub/tc_helper.rb +662 -0
  247. data/lib/gems/xmpp4r-0.4/test/pubsub/tc_nodeconfig.rb +54 -0
  248. data/lib/gems/xmpp4r-0.4/test/pubsub/tc_subscriptionconfig.rb +41 -0
  249. data/lib/gems/xmpp4r-0.4/test/roster/tc_helper.rb +514 -0
  250. data/lib/gems/xmpp4r-0.4/test/roster/tc_iqqueryroster.rb +173 -0
  251. data/lib/gems/xmpp4r-0.4/test/roster/tc_xroster.rb +73 -0
  252. data/lib/gems/xmpp4r-0.4/test/rpc/tc_helper.rb +96 -0
  253. data/lib/gems/xmpp4r-0.4/test/tc_callbacks.rb +129 -0
  254. data/lib/gems/xmpp4r-0.4/test/tc_class_names.rb +146 -0
  255. data/lib/gems/xmpp4r-0.4/test/tc_client.rb +30 -0
  256. data/lib/gems/xmpp4r-0.4/test/tc_errors.rb +146 -0
  257. data/lib/gems/xmpp4r-0.4/test/tc_idgenerator.rb +30 -0
  258. data/lib/gems/xmpp4r-0.4/test/tc_iq.rb +113 -0
  259. data/lib/gems/xmpp4r-0.4/test/tc_iqquery.rb +31 -0
  260. data/lib/gems/xmpp4r-0.4/test/tc_jid.rb +204 -0
  261. data/lib/gems/xmpp4r-0.4/test/tc_message.rb +116 -0
  262. data/lib/gems/xmpp4r-0.4/test/tc_presence.rb +150 -0
  263. data/lib/gems/xmpp4r-0.4/test/tc_rexml.rb +139 -0
  264. data/lib/gems/xmpp4r-0.4/test/tc_stream.rb +229 -0
  265. data/lib/gems/xmpp4r-0.4/test/tc_streamComponent.rb +95 -0
  266. data/lib/gems/xmpp4r-0.4/test/tc_streamError.rb +131 -0
  267. data/lib/gems/xmpp4r-0.4/test/tc_streamSend.rb +59 -0
  268. data/lib/gems/xmpp4r-0.4/test/tc_streamparser.rb +112 -0
  269. data/lib/gems/xmpp4r-0.4/test/tc_xmppstanza.rb +135 -0
  270. data/lib/gems/xmpp4r-0.4/test/ts_xmpp4r.rb +53 -0
  271. data/lib/gems/xmpp4r-0.4/test/tune/tc_helper_recv.rb +84 -0
  272. data/lib/gems/xmpp4r-0.4/test/tune/tc_helper_send.rb +74 -0
  273. data/lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb +79 -0
  274. data/lib/gems/xmpp4r-0.4/test/vcard/tc_helper.rb +49 -0
  275. data/lib/gems/xmpp4r-0.4/test/vcard/tc_iqvcard.rb +62 -0
  276. data/lib/gems/xmpp4r-0.4/test/version/tc_helper.rb +60 -0
  277. data/lib/gems/xmpp4r-0.4/test/version/tc_iqqueryversion.rb +97 -0
  278. data/lib/gems/xmpp4r-0.4/test/xhtml/tc_html.rb +41 -0
  279. data/lib/gems/xmpp4r-0.4/tools/gen_requires.bash +31 -0
  280. data/lib/gems/xmpp4r-0.4/tools/xmpp4r-gemspec-test.rb +11 -0
  281. data/lib/gems/xmpp4r-0.4/xmpp4r.gemspec +291 -0
  282. data/lib/gems/xmpp4r-simple-0.8.8/CHANGELOG +73 -0
  283. data/lib/gems/xmpp4r-simple-0.8.8/COPYING +281 -0
  284. data/lib/gems/xmpp4r-simple-0.8.8/README +59 -0
  285. data/lib/gems/xmpp4r-simple-0.8.8/lib/xmpp4r-simple.rb +492 -0
  286. data/lib/gems/xmpp4r-simple-0.8.8/test/test_xmpp4r_simple.rb +242 -0
  287. data/lib/mack-notifier.rb +1 -3
  288. metadata +398 -46
@@ -0,0 +1,3 @@
1
+ #:stopdoc:
2
+ require 'tmail/mailbox'
3
+ #:startdoc:
@@ -0,0 +1,578 @@
1
+ =begin rdoc
2
+
3
+ = Mail class
4
+
5
+ =end
6
+ #--
7
+ # Copyright (c) 1998-2003 Minero Aoki <aamine@loveruby.net>
8
+ #
9
+ # Permission is hereby granted, free of charge, to any person obtaining
10
+ # a copy of this software and associated documentation files (the
11
+ # "Software"), to deal in the Software without restriction, including
12
+ # without limitation the rights to use, copy, modify, merge, publish,
13
+ # distribute, sublicense, and/or sell copies of the Software, and to
14
+ # permit persons to whom the Software is furnished to do so, subject to
15
+ # the following conditions:
16
+ #
17
+ # The above copyright notice and this permission notice shall be
18
+ # included in all copies or substantial portions of the Software.
19
+ #
20
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
+ #
28
+ # Note: Originally licensed under LGPL v2+. Using MIT license for Rails
29
+ # with permission of Minero Aoki.
30
+ #++
31
+
32
+
33
+
34
+ require 'tmail/interface'
35
+ require 'tmail/encode'
36
+ require 'tmail/header'
37
+ require 'tmail/port'
38
+ require 'tmail/config'
39
+ require 'tmail/utils'
40
+ require 'tmail/attachments'
41
+ require 'tmail/quoting'
42
+ require 'socket'
43
+
44
+ module TMail
45
+
46
+ # == Mail Class
47
+ #
48
+ # Accessing a TMail object done via the TMail::Mail class. As email can be fairly complex
49
+ # creatures, you will find a large amount of accessor and setter methods in this class!
50
+ #
51
+ # Most of the below methods handle the header, in fact, what TMail does best is handle the
52
+ # header of the email object. There are only a few methods that deal directly with the body
53
+ # of the email, such as base64_encode and base64_decode.
54
+ #
55
+ # === Using TMail inside your code
56
+ #
57
+ # The usual way is to install the gem (see the {README}[link:/README] on how to do this) and
58
+ # then put at the top of your class:
59
+ #
60
+ # require 'tmail'
61
+ #
62
+ # You can then create a new TMail object in your code with:
63
+ #
64
+ # @email = TMail::Mail.new
65
+ #
66
+ # Or if you have an email as a string, you can initialize a new TMail::Mail object and get it
67
+ # to parse that string for you like so:
68
+ #
69
+ # @email = TMail::Mail.parse(email_text)
70
+ #
71
+ # You can also read a single email off the disk, for example:
72
+ #
73
+ # @email = TMail::Mail.load('filename.txt')
74
+ #
75
+ # Also, you can read a mailbox (usual unix mbox format) and end up with an array of TMail
76
+ # objects by doing something like this:
77
+ #
78
+ # # Note, we pass true as the last variable to open the mailbox read only
79
+ # mailbox = TMail::UNIXMbox.new("mailbox", nil, true)
80
+ # @emails = []
81
+ # mailbox.each_port { |m| @emails << TMail::Mail.new(m) }
82
+ #
83
+ class Mail
84
+
85
+ class << self
86
+
87
+ # Opens an email that has been saved out as a file by itself.
88
+ #
89
+ # This function will read a file non-destructively and then parse
90
+ # the contents and return a TMail::Mail object.
91
+ #
92
+ # Does not handle multiple email mailboxes (like a unix mbox) for that
93
+ # use the TMail::UNIXMbox class.
94
+ #
95
+ # Example:
96
+ # mail = TMail::Mail.load('filename')
97
+ #
98
+ def load( fname )
99
+ new(FilePort.new(fname))
100
+ end
101
+
102
+ alias load_from load
103
+ alias loadfrom load
104
+
105
+ # Parses an email from the supplied string and returns a TMail::Mail
106
+ # object.
107
+ #
108
+ # Example:
109
+ # require 'rubygems'; require 'tmail'
110
+ # email_string =<<HEREDOC
111
+ # To: mikel@lindsaar.net
112
+ # From: mikel@me.com
113
+ # Subject: This is a short Email
114
+ #
115
+ # Hello there Mikel!
116
+ #
117
+ # HEREDOC
118
+ # mail = TMail::Mail.parse(email_string)
119
+ # #=> #<TMail::Mail port=#<TMail::StringPort:id=0xa30ac0> bodyport=nil>
120
+ # mail.body
121
+ # #=> "Hello there Mikel!\n\n"
122
+ def parse( str )
123
+ new(StringPort.new(str))
124
+ end
125
+
126
+ end
127
+
128
+ def initialize( port = nil, conf = DEFAULT_CONFIG ) #:nodoc:
129
+ @port = port || StringPort.new
130
+ @config = Config.to_config(conf)
131
+
132
+ @header = {}
133
+ @body_port = nil
134
+ @body_parsed = false
135
+ @epilogue = ''
136
+ @parts = []
137
+
138
+ @port.ropen {|f|
139
+ parse_header f
140
+ parse_body f unless @port.reproducible?
141
+ }
142
+ end
143
+
144
+ # Provides access to the port this email is using to hold it's data
145
+ #
146
+ # Example:
147
+ # mail = TMail::Mail.parse(email_string)
148
+ # mail.port
149
+ # #=> #<TMail::StringPort:id=0xa2c952>
150
+ attr_reader :port
151
+
152
+ def inspect
153
+ "\#<#{self.class} port=#{@port.inspect} bodyport=#{@body_port.inspect}>"
154
+ end
155
+
156
+ #
157
+ # to_s interfaces
158
+ #
159
+
160
+ public
161
+
162
+ include StrategyInterface
163
+
164
+ def write_back( eol = "\n", charset = 'e' )
165
+ parse_body
166
+ @port.wopen {|stream| encoded eol, charset, stream }
167
+ end
168
+
169
+ def accept( strategy )
170
+ with_multipart_encoding(strategy) {
171
+ ordered_each do |name, field|
172
+ next if field.empty?
173
+ strategy.header_name canonical(name)
174
+ field.accept strategy
175
+ strategy.puts
176
+ end
177
+ strategy.puts
178
+ body_port().ropen {|r|
179
+ strategy.write r.read
180
+ }
181
+ }
182
+ end
183
+
184
+ private
185
+
186
+ def canonical( name )
187
+ name.split(/-/).map {|s| s.capitalize }.join('-')
188
+ end
189
+
190
+ def with_multipart_encoding( strategy )
191
+ if parts().empty? # DO NOT USE @parts
192
+ yield
193
+
194
+ else
195
+ bound = ::TMail.new_boundary
196
+ if @header.key? 'content-type'
197
+ @header['content-type'].params['boundary'] = bound
198
+ else
199
+ store 'Content-Type', %<multipart/mixed; boundary="#{bound}">
200
+ end
201
+
202
+ yield
203
+
204
+ parts().each do |tm|
205
+ strategy.puts
206
+ strategy.puts '--' + bound
207
+ tm.accept strategy
208
+ end
209
+ strategy.puts
210
+ strategy.puts '--' + bound + '--'
211
+ strategy.write epilogue()
212
+ end
213
+ end
214
+
215
+ ###
216
+ ### header
217
+ ###
218
+
219
+ public
220
+
221
+ ALLOW_MULTIPLE = {
222
+ 'received' => true,
223
+ 'resent-date' => true,
224
+ 'resent-from' => true,
225
+ 'resent-sender' => true,
226
+ 'resent-to' => true,
227
+ 'resent-cc' => true,
228
+ 'resent-bcc' => true,
229
+ 'resent-message-id' => true,
230
+ 'comments' => true,
231
+ 'keywords' => true
232
+ }
233
+ USE_ARRAY = ALLOW_MULTIPLE
234
+
235
+ def header
236
+ @header.dup
237
+ end
238
+
239
+ # Returns a TMail::AddressHeader object of the field you are querying.
240
+ # Examples:
241
+ # @mail['from'] #=> #<TMail::AddressHeader "mikel@test.com.au">
242
+ # @mail['to'] #=> #<TMail::AddressHeader "mikel@test.com.au">
243
+ #
244
+ # You can get the string value of this by passing "to_s" to the query:
245
+ # Example:
246
+ # @mail['to'].to_s #=> "mikel@test.com.au"
247
+ def []( key )
248
+ @header[key.downcase]
249
+ end
250
+
251
+ def sub_header(key, param)
252
+ (hdr = self[key]) ? hdr[param] : nil
253
+ end
254
+
255
+ alias fetch []
256
+
257
+ # Allows you to set or delete TMail header objects at will.
258
+ # Eamples:
259
+ # @mail = TMail::Mail.new
260
+ # @mail['to'].to_s # => 'mikel@test.com.au'
261
+ # @mail['to'] = 'mikel@elsewhere.org'
262
+ # @mail['to'].to_s # => 'mikel@elsewhere.org'
263
+ # @mail.encoded # => "To: mikel@elsewhere.org\r\n\r\n"
264
+ # @mail['to'] = nil
265
+ # @mail['to'].to_s # => nil
266
+ # @mail.encoded # => "\r\n"
267
+ #
268
+ # Note: setting mail[] = nil actualy deletes the header field in question from the object,
269
+ # it does not just set the value of the hash to nil
270
+ def []=( key, val )
271
+ dkey = key.downcase
272
+
273
+ if val.nil?
274
+ @header.delete dkey
275
+ return nil
276
+ end
277
+
278
+ case val
279
+ when String
280
+ header = new_hf(key, val)
281
+ when HeaderField
282
+ ;
283
+ when Array
284
+ ALLOW_MULTIPLE.include? dkey or
285
+ raise ArgumentError, "#{key}: Header must not be multiple"
286
+ @header[dkey] = val
287
+ return val
288
+ else
289
+ header = new_hf(key, val.to_s)
290
+ end
291
+ if ALLOW_MULTIPLE.include? dkey
292
+ (@header[dkey] ||= []).push header
293
+ else
294
+ @header[dkey] = header
295
+ end
296
+
297
+ val
298
+ end
299
+
300
+ alias store []=
301
+
302
+ # Allows you to loop through each header in the TMail::Mail object in a block
303
+ # Example:
304
+ # @mail['to'] = 'mikel@elsewhere.org'
305
+ # @mail['from'] = 'me@me.com'
306
+ # @mail.each_header { |k,v| puts "#{k} = #{v}" }
307
+ # # => from = me@me.com
308
+ # # => to = mikel@elsewhere.org
309
+ def each_header
310
+ @header.each do |key, val|
311
+ [val].flatten.each {|v| yield key, v }
312
+ end
313
+ end
314
+
315
+ alias each_pair each_header
316
+
317
+ def each_header_name( &block )
318
+ @header.each_key(&block)
319
+ end
320
+
321
+ alias each_key each_header_name
322
+
323
+ def each_field( &block )
324
+ @header.values.flatten.each(&block)
325
+ end
326
+
327
+ alias each_value each_field
328
+
329
+ FIELD_ORDER = %w(
330
+ return-path received
331
+ resent-date resent-from resent-sender resent-to
332
+ resent-cc resent-bcc resent-message-id
333
+ date from sender reply-to to cc bcc
334
+ message-id in-reply-to references
335
+ subject comments keywords
336
+ mime-version content-type content-transfer-encoding
337
+ content-disposition content-description
338
+ )
339
+
340
+ def ordered_each
341
+ list = @header.keys
342
+ FIELD_ORDER.each do |name|
343
+ if list.delete(name)
344
+ [@header[name]].flatten.each {|v| yield name, v }
345
+ end
346
+ end
347
+ list.each do |name|
348
+ [@header[name]].flatten.each {|v| yield name, v }
349
+ end
350
+ end
351
+
352
+ def clear
353
+ @header.clear
354
+ end
355
+
356
+ def delete( key )
357
+ @header.delete key.downcase
358
+ end
359
+
360
+ def delete_if
361
+ @header.delete_if do |key,val|
362
+ if Array === val
363
+ val.delete_if {|v| yield key, v }
364
+ val.empty?
365
+ else
366
+ yield key, val
367
+ end
368
+ end
369
+ end
370
+
371
+ def keys
372
+ @header.keys
373
+ end
374
+
375
+ def key?( key )
376
+ @header.key? key.downcase
377
+ end
378
+
379
+ def values_at( *args )
380
+ args.map {|k| @header[k.downcase] }.flatten
381
+ end
382
+
383
+ alias indexes values_at
384
+ alias indices values_at
385
+
386
+ private
387
+
388
+ def parse_header( f )
389
+ name = field = nil
390
+ unixfrom = nil
391
+
392
+ while line = f.gets
393
+ case line
394
+ when /\A[ \t]/ # continue from prev line
395
+ raise SyntaxError, 'mail is began by space' unless field
396
+ field << ' ' << line.strip
397
+
398
+ when /\A([^\: \t]+):\s*/ # new header line
399
+ add_hf name, field if field
400
+ name = $1
401
+ field = $' #.strip
402
+
403
+ when /\A\-*\s*\z/ # end of header
404
+ add_hf name, field if field
405
+ name = field = nil
406
+ break
407
+
408
+ when /\AFrom (\S+)/
409
+ unixfrom = $1
410
+
411
+ when /^charset=.*/
412
+
413
+ else
414
+ raise SyntaxError, "wrong mail header: '#{line.inspect}'"
415
+ end
416
+ end
417
+ add_hf name, field if name
418
+
419
+ if unixfrom
420
+ add_hf 'Return-Path', "<#{unixfrom}>" unless @header['return-path']
421
+ end
422
+ end
423
+
424
+ def add_hf( name, field )
425
+ key = name.downcase
426
+ field = new_hf(name, field)
427
+
428
+ if ALLOW_MULTIPLE.include? key
429
+ (@header[key] ||= []).push field
430
+ else
431
+ @header[key] = field
432
+ end
433
+ end
434
+
435
+ def new_hf( name, field )
436
+ HeaderField.new(name, field, @config)
437
+ end
438
+
439
+ ###
440
+ ### body
441
+ ###
442
+
443
+ public
444
+
445
+ def body_port
446
+ parse_body
447
+ @body_port
448
+ end
449
+
450
+ def each( &block )
451
+ body_port().ropen {|f| f.each(&block) }
452
+ end
453
+
454
+ def quoted_body
455
+ body_port.ropen {|f| return f.read }
456
+ end
457
+
458
+ def quoted_body= str
459
+ body_port.wopen { |f| f.write str }
460
+ str
461
+ end
462
+
463
+ def body=( str )
464
+ # Sets the body of the email to a new (encoded) string.
465
+ #
466
+ # We also reparses the email if the body is ever reassigned, this is a performance hit, however when
467
+ # you assign the body, you usually want to be able to make sure that you can access the attachments etc.
468
+ #
469
+ # Usage:
470
+ #
471
+ # mail.body = "Hello, this is\nthe body text"
472
+ # # => "Hello, this is\nthe body"
473
+ # mail.body
474
+ # # => "Hello, this is\nthe body"
475
+ @body_parsed = false
476
+ parse_body(StringInput.new(str))
477
+ parse_body
478
+ @body_port.wopen {|f| f.write str }
479
+ str
480
+ end
481
+
482
+ alias preamble quoted_body
483
+ alias preamble= quoted_body=
484
+
485
+ def epilogue
486
+ parse_body
487
+ @epilogue.dup
488
+ end
489
+
490
+ def epilogue=( str )
491
+ parse_body
492
+ @epilogue = str
493
+ str
494
+ end
495
+
496
+ def parts
497
+ parse_body
498
+ @parts
499
+ end
500
+
501
+ def each_part( &block )
502
+ parts().each(&block)
503
+ end
504
+
505
+ # Returns true if the content type of this part of the email is
506
+ # a disposition attachment
507
+ def disposition_is_attachment?
508
+ (self['content-disposition'] && self['content-disposition'].disposition == "attachment")
509
+ end
510
+
511
+ # Returns true if this part's content main type is text, else returns false.
512
+ # By main type is meant "text/plain" is text. "text/html" is text
513
+ def content_type_is_text?
514
+ self.header['content-type'] && (self.header['content-type'].main_type != "text")
515
+ end
516
+
517
+ private
518
+
519
+ def parse_body( f = nil )
520
+ return if @body_parsed
521
+ if f
522
+ parse_body_0 f
523
+ else
524
+ @port.ropen {|f|
525
+ skip_header f
526
+ parse_body_0 f
527
+ }
528
+ end
529
+ @body_parsed = true
530
+ end
531
+
532
+ def skip_header( f )
533
+ while line = f.gets
534
+ return if /\A[\r\n]*\z/ === line
535
+ end
536
+ end
537
+
538
+ def parse_body_0( f )
539
+ if multipart?
540
+ read_multipart f
541
+ else
542
+ @body_port = @config.new_body_port(self)
543
+ @body_port.wopen {|w|
544
+ w.write f.read
545
+ }
546
+ end
547
+ end
548
+
549
+ def read_multipart( src )
550
+ bound = @header['content-type'].params['boundary']
551
+ is_sep = /\A--#{Regexp.quote bound}(?:--)?[ \t]*(?:\n|\r\n|\r)/
552
+ lastbound = "--#{bound}--"
553
+
554
+ ports = [ @config.new_preamble_port(self) ]
555
+ begin
556
+ f = ports.last.wopen
557
+ while line = src.gets
558
+ if is_sep === line
559
+ f.close
560
+ break if line.strip == lastbound
561
+ ports.push @config.new_part_port(self)
562
+ f = ports.last.wopen
563
+ else
564
+ f << line
565
+ end
566
+ end
567
+ @epilogue = (src.read || '')
568
+ ensure
569
+ f.close if f and not f.closed?
570
+ end
571
+
572
+ @body_port = ports.shift
573
+ @parts = ports.map {|p| self.class.new(p, @config) }
574
+ end
575
+
576
+ end # class Mail
577
+
578
+ end # module TMail