diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 02a1aac2..bac9b63b 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -148,16 +148,16 @@ class ApplicationController < ActionController::Base def set_content_type_header if %w(atom_with_content atom_with_headlines).include?(action_name) - response.headers['Content-Type'] = 'application/atom+xml; charset=UTF-8' + response.headers['type'] = 'application/atom+xml; charset=UTF-8' elsif %w(tex).include?(action_name) - response.headers['Content-Type'] = 'text/plain; charset=UTF-8' + response.headers['type'] = 'text/plain; charset=UTF-8' elsif request.env['HTTP_USER_AGENT'] =~ /Validator/ or request.env.include?('HTTP_ACCEPT') && Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML) - response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8' + response.headers['type'] = 'application/xhtml+xml; charset=UTF-8' elsif request.env['HTTP_USER_AGENT'] =~ /MathPlayer/ - response.headers['Content-Type'] = 'application/xhtml+xml' + response.headers['type'] = 'application/xhtml+xml' else - response.headers['Content-Type'] = 'text/html; charset=UTF-8' + response.headers['type'] = 'text/html; charset=UTF-8' end end diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index aa1e6710..76945a33 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -136,8 +136,8 @@ class WikiController < ApplicationController if rss_with_content_allowed? render_atom(hide_description = false) else - render_text 'Atom feed with content for this web is blocked for security reasons. ' + - 'The web is password-protected and not published', '403 Forbidden' + render :text => 'Atom feed with content for this web is blocked for security reasons. ' + + 'The web is password-protected and not published', :status => 403 end end @@ -268,7 +268,7 @@ class WikiController < ApplicationController begin @renderer = PageRenderer.new(@page.revisions.last) @show_diff = (params[:mode] == 'diff') - render_action 'page' + render :action => 'page' # TODO this rescue should differentiate between errors due to rendering and errors in # the application itself (for application errors, it's better not to rescue the error at all) rescue => e @@ -284,7 +284,7 @@ class WikiController < ApplicationController if not @page_name.nil? and not @page_name.empty? redirect_to :web => @web_name, :action => 'new', :id => @page_name else - render_text 'Page name is not specified', '404 Not Found' + render :text => 'Page name is not specified', :status => 404 end end end diff --git a/config/environment.rb b/config/environment.rb index 2b551925..f299f4fd 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,16 @@ # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') +require 'rails_generator/secret_key_generator' Rails::Initializer.run do |config| + + # Secret session key + generator = Rails::SecretKeyGenerator.new("Instiki") + config.action_controller.session = { + :session_key => "instiki_session", + :secret => generator.generate_secret + } + # Skip frameworks you're not going to use config.frameworks -= [ :action_web_service, :action_mailer ] diff --git a/lib/chunks/chunk.rb b/lib/chunks/chunk.rb index 90b4939a..55c96748 100644 --- a/lib/chunks/chunk.rb +++ b/lib/chunks/chunk.rb @@ -11,7 +11,7 @@ module Chunk # Rails's default utf-8 support causes problems here. So, for Chunk::Abstract class, turn off # multibyte character support. - $KCODE = 'iso-8859-1' + $KCODE = 'n' # automatically construct the array of derivatives of Chunk::Abstract @derivatives = [] diff --git a/lib/chunks/literal.rb b/lib/chunks/literal.rb index 09da4005..3927c31e 100644 --- a/lib/chunks/literal.rb +++ b/lib/chunks/literal.rb @@ -24,8 +24,7 @@ module Literal # A literal chunk that protects HTML tags from wiki rendering. class Tags < AbstractLiteral - TAGS = "a|img|em|strong|div|span|table|td|th|ul|ol|li|dl|dt|dd" - TAGS_PATTERN = Regexp.new('<(?:'+TAGS+')[^>]*?>', Regexp::MULTILINE) + TAGS_PATTERN = Regexp.new('<[a-zA-Z]+[^>]*?>', Regexp::MULTILINE) def self.pattern() TAGS_PATTERN end end end diff --git a/test/functional/application_test.rb b/test/functional/application_test.rb index c32f8b23..e028a052 100755 --- a/test/functional/application_test.rb +++ b/test/functional/application_test.rb @@ -19,7 +19,7 @@ class ApplicationTest < Test::Unit::TestCase def test_utf8_header get :show, :web => 'wiki1', :id => 'HomePage' - assert_equal 'text/html; charset=UTF-8', @response.headers['Content-Type'] + assert_equal 'text/html; charset=UTF-8', @response.headers['type'] end def test_connect_to_model_unknown_wiki diff --git a/test/functional/file_controller_test.rb b/test/functional/file_controller_test.rb index 1e8d8d51..ff64282c 100755 --- a/test/functional/file_controller_test.rb +++ b/test/functional/file_controller_test.rb @@ -36,7 +36,7 @@ class FileControllerTest < Test::Unit::TestCase assert_response(:success, bypass_body_parsing = true) assert_equal "Contents of the file", r.body - assert_equal 'text/plain', r.headers['Content-Type'] + assert_equal 'text/plain', r.headers['type'] end def test_file_download_pdf_file @@ -47,7 +47,7 @@ class FileControllerTest < Test::Unit::TestCase assert_response(:success, bypass_body_parsing = true) assert_equal "aaa\nbbb\n", r.body - assert_equal 'application/pdf', r.headers['Content-Type'] + assert_equal 'application/pdf', r.headers['type'] end def test_pic_download_gif @@ -57,7 +57,7 @@ class FileControllerTest < Test::Unit::TestCase r = get :file, :web => 'wiki1', :id => 'rails.gif' assert_response(:success, bypass_body_parsing = true) - assert_equal 'image/gif', r.headers['Content-Type'] + assert_equal 'image/gif', r.headers['type'] assert_equal pic.size, r.body.size assert_equal pic, r.body end diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 11b4e661..b3b62a2e 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -112,7 +112,7 @@ class WikiControllerTest < Test::Unit::TestCase r = process 'export_html', 'web' => 'wiki1' assert_response(:success, bypass_body_parsing = true) - assert_equal 'application/zip', r.headers['Content-Type'] + assert_equal 'application/zip', r.headers['type'] assert_match /attachment; filename="wiki1-html-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/, r.headers['Content-Disposition'] assert_equal 'PK', r.body[0..1], 'Content is not a zip file' @@ -140,7 +140,7 @@ class WikiControllerTest < Test::Unit::TestCase r = process 'export_html', 'web' => 'wiki1', 'layout' => 'no' assert_response(:success, bypass_body_parsing = true) - assert_equal 'application/zip', r.headers['Content-Type'] + assert_equal 'application/zip', r.headers['type'] assert_match /attachment; filename="wiki1-html-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/, r.headers['Content-Disposition'] assert_equal 'PK', r.body[0..1], 'Content is not a zip file' @@ -150,7 +150,7 @@ class WikiControllerTest < Test::Unit::TestCase r = process 'export_markup', 'web' => 'wiki1' assert_response(:success, bypass_body_parsing = true) - assert_equal 'application/zip', r.headers['Content-Type'] + assert_equal 'application/zip', r.headers['type'] assert_match /attachment; filename="wiki1-markdownMML-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.zip"/, r.headers['Content-Disposition'] assert_equal 'PK', r.body[0..1], 'Content is not a zip file' @@ -162,7 +162,7 @@ class WikiControllerTest < Test::Unit::TestCase # def test_export_pdf # r = process 'export_pdf', 'web' => 'wiki1' # assert_response(:success, bypass_body_parsing = true) -# assert_equal 'application/pdf', r.headers['Content-Type'] +# assert_equal 'application/pdf', r.headers['type'] # assert_match /attachment; filename="wiki1-tex-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.pdf"/, # r.headers['Content-Disposition'] # assert_equal '%PDF', r.body[0..3] @@ -179,7 +179,7 @@ class WikiControllerTest < Test::Unit::TestCase # r = process 'export_tex', 'web' => 'wiki1' # # assert_response(:success, bypass_body_parsing = true) -# assert_equal 'application/octet-stream', r.headers['Content-Type'] +# assert_equal 'application/octet-stream', r.headers['type'] # assert_match /attachment; filename="wiki1-tex-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.tex"/, # r.headers['Content-Disposition'] # assert_equal '\documentclass', r.body[0..13], 'Content is not a TeX file' @@ -259,7 +259,7 @@ class WikiControllerTest < Test::Unit::TestCase # assert_equal '%PDF', r.body[0..3] # assert_equal "EOF\n", r.body[-4..-1] # -# assert_equal 'application/pdf', r.headers['Content-Type'] +# assert_equal 'application/pdf', r.headers['type'] # assert_match /attachment; filename="HomePage-wiki1-\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d.pdf"/, # r.headers['Content-Disposition'] # end @@ -633,8 +633,8 @@ class WikiControllerTest < Test::Unit::TestCase end def test_show_page - r = process('show', 'id' => 'Oak', 'web' => 'wiki1') - assert_response(:success) + r = process 'show', 'id' => 'Oak', 'web' => 'wiki1' + assert_response :success assert_tag :content => /All about oak/ end @@ -644,7 +644,7 @@ class WikiControllerTest < Test::Unit::TestCase r = process('show', 'id' => 'HomePage', 'web' => 'wiki1') - assert_response(:success) + assert_response :success assert_match /Second revision of the end/, r.body end diff --git a/test/unit/page_renderer_test.rb b/test/unit/page_renderer_test.rb index 50a74b12..2723381a 100644 --- a/test/unit/page_renderer_test.rb +++ b/test/unit/page_renderer_test.rb @@ -110,6 +110,12 @@ class PageRendererTest < Test::Unit::TestCase %{
\\sin(x)
}, "ecuasi\303\263n\n$$\\sin(x)$$") + assert_markup_parsed_as( + %{

ecuasi\303\263n

\n\n

} + + %{sin(x)

}, + "ecuasi\303\263n \n\n$\\sin(x)$") + #FIXME assert_markup_parsed_as( %{

ecuasi\303\263n "", :status => 304) + controller.send(:render, {:text => "", :status => 304}) end def client_has_latest?(cache_entry, controller) diff --git a/vendor/plugins/maruku/lib/maruku/output/s5/to_s5.rb b/vendor/plugins/maruku/lib/maruku/output/s5/to_s5.rb index 8542ee4e..ef0349d9 100644 --- a/vendor/plugins/maruku/lib/maruku/output/s5/to_s5.rb +++ b/vendor/plugins/maruku/lib/maruku/output/s5/to_s5.rb @@ -105,7 +105,12 @@ module MaRuKu xml = "" if (content_only) - body.write(xml,indent,transitive=true,ie_hack); + if $rexml_new_version + formatter = REXML::Formatters::Default.new(ie_hack) + formatter.write(body, xml) + else + body.write(xml,indent,transitive=true,ie_hack); + end else doc2 = Document.new("

"+S5_external+"
",{:respect_whitespace =>:all}) doc2.root.children.each{ |child| head << child } diff --git a/vendor/rails/actionmailer/CHANGELOG b/vendor/rails/actionmailer/CHANGELOG index aab72a91..8ba3ccde 100644 --- a/vendor/rails/actionmailer/CHANGELOG +++ b/vendor/rails/actionmailer/CHANGELOG @@ -1,11 +1,49 @@ -*1.3.5* (October 12th, 2007) +*2.0.2* (December 16th, 2007) -* Depend on Action Pack 1.13.5 +* Included in Rails 2.0.2 -*1.3.4* (October 4th, 2007) +*2.0.1* (December 7th, 2007) -* Depend on Action Pack 1.13.4 +* Update ActionMailer so it treats ActionView the same way that ActionController does. Closes #10244 [rick] + + * Pass the template_root as an array as ActionView's view_path + * Request templates with the "#{mailer_name}/#{action}" as opposed to just "#{action}" + +* Fixed that partials would be broken when using text.plain.erb as the extension #10130 [java] + +* Update README to use new smtp settings configuration API. Closes #10060 [psq] + +* Allow ActionMailer subclasses to individually set their delivery method (so two subclasses can have different delivery methods) #10033 [zdennis] + +* Update TMail to v1.1.0. Use an updated version of TMail if available. [mikel] + +* Introduce a new base test class for testing Mailers. ActionMailer::TestCase [Koz] + +* Fix silent failure of rxml templates. #9879 [jstewart] + +* Fix attachment decoding when using the TMail C extension. #7861 [orangechicken] + +* Increase mail delivery test coverage. #8692 [Kamal Fariz Mahyuddin] + +* Register alternative template engines using ActionMailer::Base.register_template_extension('haml'). #7534 [cwd, Josh Peek] + +* Only load ActionController::UrlWriter if ActionController is present [Rick Olson] + +* Make sure parsed emails recognized attachments nested inside multipart parts. #6714 [Jamis Buck] + +* Allow mailer actions named send by using __send__ internally. #6467 [iGEL] + +* Add assert_emails and assert_no_emails to test the number of emails delivered. #6479 [Jonathan Viney] + # Assert total number of emails delivered: + assert_emails 0 + ContactMailer.deliver_contact + assert_emails 1 + + # Assert number of emails delivered within a block: + assert_emails 1 do + post :signup, :name => 'Jonathan' + end *1.3.3* (March 12th, 2007) @@ -39,6 +77,8 @@ * Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar] +* Mailer template root applies to a class and its subclasses rather than acting globally. #5555 [somekool@gmail.com] + * Resolve action naming collision. #5520 [ssinghi@kreeti.com] * ActionMailer::Base documentation rewrite. Closes #4991 [Kevin Clark, Marcel Molina Jr.] @@ -47,30 +87,8 @@ * Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.] - -*1.2.5* (August 10th, 2006) - -* Depend on Action Pack 1.12.5 - - -*1.2.4* (August 8th, 2006) - -* Backport of documentation enhancements. [Kevin Clark, Marcel Molina Jr] - * Correct spurious documentation example code which results in a SyntaxError. [Marcel Molina Jr.] -* Mailer template root applies to a class and its subclasses rather than acting globally. #5555 [somekool@gmail.com] - - -*1.2.3* (June 29th, 2006) - -* Depend on Action Pack 1.12.3 - - -*1.2.2* (June 27th, 2006) - -* Depend on Action Pack 1.12.2 - *1.2.1* (April 6th, 2006) diff --git a/vendor/rails/actionmailer/MIT-LICENSE b/vendor/rails/actionmailer/MIT-LICENSE index 5856add6..007cc942 100644 --- a/vendor/rails/actionmailer/MIT-LICENSE +++ b/vendor/rails/actionmailer/MIT-LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2006 David Heinemeier Hansson +Copyright (c) 2004-2007 David Heinemeier Hansson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/vendor/rails/actionmailer/README b/vendor/rails/actionmailer/README index 354c1ab8..67e8266e 100755 --- a/vendor/rails/actionmailer/README +++ b/vendor/rails/actionmailer/README @@ -86,7 +86,7 @@ This Mailman can be the target for Postfix. In Rails, you would use the runner l The Base class has the full list of configuration options. Here's an example: -ActionMailer::Base.server_settings = { +ActionMailer::Base.smtp_settings = { :address=>'smtp.yourserver.com', # default: localhost :port=>'25', # default: 25 :user_name=>'user', @@ -142,4 +142,4 @@ And as Jim from Rake says: Feel free to submit commits or feature requests. If you send a patch, remember to update the corresponding unit tests. If fact, I prefer - new feature to be submitted in the form of new unit tests. \ No newline at end of file + new feature to be submitted in the form of new unit tests. diff --git a/vendor/rails/actionmailer/Rakefile b/vendor/rails/actionmailer/Rakefile index 5bb9f1d0..4622871a 100755 --- a/vendor/rails/actionmailer/Rakefile +++ b/vendor/rails/actionmailer/Rakefile @@ -29,11 +29,12 @@ Rake::TestTask.new { |t| } -# Genereate the RDoc documentation +# Generate the RDoc documentation Rake::RDocTask.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Action Mailer -- Easy email delivery and testing" rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' + rdoc.options << '--charset' << 'utf-8' rdoc.template = "#{ENV['template']}.rb" if ENV['template'] rdoc.rdoc_files.include('README', 'CHANGELOG') rdoc.rdoc_files.include('lib/action_mailer.rb') @@ -54,7 +55,7 @@ spec = Gem::Specification.new do |s| s.rubyforge_project = "actionmailer" s.homepage = "http://www.rubyonrails.org" - s.add_dependency('actionpack', '= 1.13.5' + PKG_BUILD) + s.add_dependency('actionpack', '= 2.0.2' + PKG_BUILD) s.has_rdoc = true s.requirements << 'none' @@ -92,4 +93,4 @@ task :release => [ :package ] do rubyforge = RubyForge.new rubyforge.login rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages) -end \ No newline at end of file +end diff --git a/vendor/rails/actionmailer/install.rb b/vendor/rails/actionmailer/install.rb index c559edff..8d7c140c 100644 --- a/vendor/rails/actionmailer/install.rb +++ b/vendor/rails/actionmailer/install.rb @@ -18,7 +18,7 @@ unless $sitedir end end -# the acual gruntwork +# the actual gruntwork Dir.chdir("lib") Find.find("action_mailer", "action_mailer.rb") { |f| diff --git a/vendor/rails/actionmailer/lib/action_mailer.rb b/vendor/rails/actionmailer/lib/action_mailer.rb index eeb1a428..ec803f5a 100755 --- a/vendor/rails/actionmailer/lib/action_mailer.rb +++ b/vendor/rails/actionmailer/lib/action_mailer.rb @@ -1,5 +1,5 @@ #-- -# Copyright (c) 2004-2006 David Heinemeier Hansson +# Copyright (c) 2004-2007 David Heinemeier Hansson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -31,13 +31,15 @@ unless defined?(ActionController) end end -$:.unshift(File.dirname(__FILE__) + "/action_mailer/vendor/") +require 'action_mailer/vendor' +require 'tmail' require 'action_mailer/base' require 'action_mailer/helpers' require 'action_mailer/mail_helper' require 'action_mailer/quoting' -require 'tmail' +require 'action_mailer/test_helper' + require 'net/smtp' ActionMailer::Base.class_eval do diff --git a/vendor/rails/actionmailer/lib/action_mailer/base.rb b/vendor/rails/actionmailer/lib/action_mailer/base.rb index 4f1b6787..b15c010e 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/base.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/base.rb @@ -52,9 +52,9 @@ module ActionMailer #:nodoc: # # Like ActionController, each mailer class has a corresponding view directory # in which each method of the class looks for a template with its name. - # To define a template to be used with a mailing, create an .rhtml file with the same name as the method + # To define a template to be used with a mailing, create an .erb file with the same name as the method # in your mailer model. For example, in the mailer defined above, the template at - # app/views/notifier/signup_notification.rhtml would be used to generate the email. + # app/views/notifier/signup_notification.erb would be used to generate the email. # # Variables defined in the model are accessible as instance variables in the view. # @@ -103,7 +103,7 @@ module ActionMailer #:nodoc: # # = HTML email # - # To send mail as HTML, make sure your view (the .rhtml file) generates HTML and + # To send mail as HTML, make sure your view (the .erb file) generates HTML and # set the content type to html. # # class MyMailer < ActionMailer::Base @@ -142,10 +142,10 @@ module ActionMailer #:nodoc: # by the content type. Each such detected template will be added as separate part to the message. # # For example, if the following templates existed: - # * signup_notification.text.plain.rhtml - # * signup_notification.text.html.rhtml - # * signup_notification.text.xml.rxml - # * signup_notification.text.x-yaml.rhtml + # * signup_notification.text.plain.erb + # * signup_notification.text.html.erb + # * signup_notification.text.xml.builder + # * signup_notification.text.x-yaml.erb # # Each would be rendered and added as a separate part to the message, # with the corresponding content type. The same body hash is passed to @@ -219,17 +219,16 @@ module ActionMailer #:nodoc: # @implicit_parts_order. class Base include AdvAttrAccessor, PartContainer - include ActionController::UrlWriter + include ActionController::UrlWriter if Object.const_defined?(:ActionController) - # Action Mailer subclasses should be reloaded by the dispatcher in Rails - # when Dependencies.mechanism = :load. - include Reloadable::Deprecated - private_class_method :new #:nodoc: class_inheritable_accessor :template_root cattr_accessor :logger + cattr_accessor :template_extensions + @@template_extensions = ['erb', 'builder', 'rhtml', 'rxml'] + @@smtp_settings = { :address => "localhost", :port => 25, @@ -249,8 +248,8 @@ module ActionMailer #:nodoc: @@raise_delivery_errors = true cattr_accessor :raise_delivery_errors - @@delivery_method = :smtp - cattr_accessor :delivery_method + superclass_delegating_accessor :delivery_method + self.delivery_method = :smtp @@perform_deliveries = true cattr_accessor :perform_deliveries @@ -299,11 +298,6 @@ module ActionMailer #:nodoc: # This defaults to the value for the +default_implicit_parts_order+. adv_attr_accessor :implicit_parts_order - # Override the mailer name, which defaults to an inflected version of the - # mailer's class name. If you want to use a template in a non-standard - # location, you can use this to specify that location. - adv_attr_accessor :mailer_name - # Defaults to "1.0", but may be explicitly given if needed. adv_attr_accessor :mime_version @@ -323,10 +317,35 @@ module ActionMailer #:nodoc: # have multiple mailer methods share the same template. adv_attr_accessor :template + # Override the mailer name, which defaults to an inflected version of the + # mailer's class name. If you want to use a template in a non-standard + # location, you can use this to specify that location. + def mailer_name(value = nil) + if value + self.mailer_name = value + else + self.class.mailer_name + end + end + + def mailer_name=(value) + self.class.mailer_name = value + end + # The mail object instance referenced by this mailer. attr_reader :mail class << self + attr_writer :mailer_name + + def mailer_name + @mailer_name ||= name.underscore + end + + # for ActionView compatibility + alias_method :controller_name, :mailer_name + alias_method :controller_path, :mailer_name + def method_missing(method_symbol, *parameters)#:nodoc: case method_symbol.id2name when /^create_([_a-z]\w*)/ then new($1, *parameters).mail @@ -363,18 +382,17 @@ module ActionMailer #:nodoc: def deliver(mail) new.deliver!(mail) end - - # Server Settings is the old name for smtp_settings - def server_settings - smtp_settings + + # Register a template extension so mailer templates written in a + # templating language other than rhtml or rxml are supported. + # To use this, include in your template-language plugin's init + # code or on a per-application basis, this can be invoked from + # config/environment.rb: + # + # ActionMailer::Base.register_template_extension('haml') + def register_template_extension(extension) + template_extensions << extension end - deprecate :server_settings=>"It's now named smtp_settings" - - def server_settings=(settings) - ActiveSupport::Deprecation.warn("server_settings has been renamed smtp_settings, this warning will be removed with rails 2.0", caller) - self.smtp_settings=settings - end - end # Instantiate a new mailer object. If +method_name+ is not +nil+, the mailer @@ -389,20 +407,20 @@ module ActionMailer #:nodoc: # rendered and a new TMail::Mail object created. def create!(method_name, *parameters) #:nodoc: initialize_defaults(method_name) - send(method_name, *parameters) + __send__(method_name, *parameters) # If an explicit, textual body has not been set, we check assumptions. unless String === @body # First, we look to see if there are any likely templates that match, # which include the content-type in their file name (i.e., - # "the_template_file.text.html.rhtml", etc.). Only do this if parts + # "the_template_file.text.html.erb", etc.). Only do this if parts # have not already been specified manually. if @parts.empty? templates = Dir.glob("#{template_path}/#{@template}.*") templates.each do |path| - # TODO: don't hardcode rhtml|rxml basename = File.basename(path) - next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(rhtml|rxml)$/.match(basename) + template_regex = Regexp.new("^([^\\\.]+)\\\.([^\\\.]+\\\.[^\\\.]+)\\\.(" + template_extensions.join('|') + ")$") + next unless md = template_regex.match(basename) template_name = basename content_type = md.captures[1].gsub('.', '/') @parts << Part.new(:content_type => content_type, @@ -448,7 +466,7 @@ module ActionMailer #:nodoc: logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil? begin - send("perform_delivery_#{delivery_method}", mail) if perform_deliveries + __send__("perform_delivery_#{delivery_method}", mail) if perform_deliveries rescue Exception => e # Net::SMTP errors or sendmail pipe errors raise e if raise_delivery_errors end @@ -478,6 +496,9 @@ module ActionMailer #:nodoc: def render(opts) body = opts.delete(:body) + if opts[:file] && opts[:file] !~ /\// + opts[:file] = "#{mailer_name}/#{opts[:file]}" + end initialize_template_class(body).render(opts) end @@ -486,7 +507,7 @@ module ActionMailer #:nodoc: end def initialize_template_class(assigns) - ActionView::Base.new(template_path, assigns, self) + ActionView::Base.new([template_root], assigns, self) end def sort_parts(parts, order = []) diff --git a/vendor/rails/actionmailer/lib/action_mailer/helpers.rb b/vendor/rails/actionmailer/lib/action_mailer/helpers.rb index 8176ba8a..7777d16d 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/helpers.rb @@ -49,7 +49,7 @@ module ActionMailer begin require_dependency(file_name) rescue LoadError => load_error - requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1] + requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1] msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" raise LoadError.new(msg).copy_blame!(load_error) end @@ -72,7 +72,7 @@ module ActionMailer methods.flatten.each do |method| master_helper_module.module_eval <<-end_eval def #{method}(*args, &block) - controller.send(%(#{method}), *args, &block) + controller.send!(%(#{method}), *args, &block) end end_eval end @@ -92,7 +92,7 @@ module ActionMailer inherited_without_helper(child) begin child.master_helper_module = Module.new - child.master_helper_module.send :include, master_helper_module + child.master_helper_module.send! :include, master_helper_module child.helper child.name.underscore rescue MissingSourceFile => e raise unless e.is_missing?("helpers/#{child.name.underscore}_helper") @@ -108,4 +108,4 @@ module ActionMailer end end end -end \ No newline at end of file +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/part.rb b/vendor/rails/actionmailer/lib/action_mailer/part.rb index 31f5b441..de1b1689 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/part.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/part.rb @@ -84,11 +84,8 @@ module ActionMailer end else if String === body - part = TMail::Mail.new - part.body = body - part.set_content_type(real_content_type, nil, ctype_attrs) - part.set_content_disposition "inline" - m.parts << part + @parts.unshift Part.new(:charset => charset, :body => @body, :content_type => 'text/plain') + @body = nil end @parts.each do |p| diff --git a/vendor/rails/actionmailer/lib/action_mailer/test_case.rb b/vendor/rails/actionmailer/lib/action_mailer/test_case.rb new file mode 100644 index 00000000..cc75b392 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/test_case.rb @@ -0,0 +1,59 @@ +require 'active_support/test_case' + +module ActionMailer + class NonInferrableMailerError < ::StandardError + def initialize(name) + super "Unable to determine the mailer to test from #{name}. " + + "You'll need to specify it using tests YourMailer in your " + + "test case definition" + end + end + # New Test Super class for forward compatibility. + # To override + class TestCase < ActiveSupport::TestCase + include ActionMailer::Quoting + + class << self + def tests(mailer) + write_inheritable_attribute(:mailer_class, mailer) + end + + def mailer_class + if mailer = read_inheritable_attribute(:mailer_class) + mailer + else + tests determine_default_mailer(name) + end + end + + def determine_default_mailer(name) + name.sub(/Test$/, '').constantize + rescue NameError => e + raise NonInferrableMailerError.new(name) + end + end + + def setup + ActionMailer::Base.delivery_method = :test + ActionMailer::Base.perform_deliveries = true + ActionMailer::Base.deliveries = [] + + @expected = TMail::Mail.new + @expected.set_content_type "text", "plain", { "charset" => charset } + @expected.mime_version = '1.0' + end + + private + def charset + "utf-8" + end + + def encode(subject) + quoted_printable(subject, charset) + end + + def read_fixture(action) + IO.readlines(File.join(RAILS_ROOT, 'test', 'fixtures', self.class.mailer_class.name.underscore, action)) + end + end +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb b/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb new file mode 100644 index 00000000..3a161244 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb @@ -0,0 +1,67 @@ +module ActionMailer + module TestHelper + # Asserts that the number of emails sent matches the given number. + # + # def test_emails + # assert_emails 0 + # ContactMailer.deliver_contact + # assert_emails 1 + # ContactMailer.deliver_contact + # assert_emails 2 + # end + # + # If a block is passed, that block should cause the specified number of emails to be sent. + # + # def test_emails_again + # assert_emails 1 do + # ContactMailer.deliver_contact + # end + # + # assert_emails 2 do + # ContactMailer.deliver_contact + # ContactMailer.deliver_contact + # end + # end + def assert_emails(number) + if block_given? + original_count = ActionMailer::Base.deliveries.size + yield + new_count = ActionMailer::Base.deliveries.size + assert_equal original_count + number, new_count, "#{number} emails expected, but #{new_count - original_count} were sent" + else + assert_equal number, ActionMailer::Base.deliveries.size + end + end + + # Assert that no emails have been sent. + # + # def test_emails + # assert_no_emails + # ContactMailer.deliver_contact + # assert_emails 1 + # end + # + # If a block is passed, that block should not cause any emails to be sent. + # + # def test_emails_again + # assert_no_emails do + # # No emails should be sent from this block + # end + # end + # + # Note: This assertion is simply a shortcut for: + # + # assert_emails 0 + def assert_no_emails(&block) + assert_emails 0, &block + end + end +end + +module Test + module Unit + class TestCase + include ActionMailer::TestHelper + end + end +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor.rb new file mode 100644 index 00000000..0ad7386f --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor.rb @@ -0,0 +1,14 @@ +# Prefer gems to the bundled libs. +require 'rubygems' + +begin + gem 'tmail', '~> 1.1.0' +rescue Gem::LoadError + $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.1.0" +end + +begin + gem 'text-format', '>= 0.6.3' +rescue Gem::LoadError + $:.unshift "#{File.dirname(__FILE__)}/vendor/text-format-0.6.3" +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/text/format.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/text/format.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb new file mode 100755 index 00000000..7de18501 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb @@ -0,0 +1,4 @@ +require 'tmail/version' +require 'tmail/mail' +require 'tmail/mailbox' +require 'tmail/core_extensions' diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile new file mode 100644 index 00000000..346353b8 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile @@ -0,0 +1,19 @@ +# +# lib/tmail/Makefile +# + +debug: + rm -f parser.rb + make parser.rb DEBUG=true + +parser.rb: parser.y + if [ "$(DEBUG)" = true ]; then \ + racc -v -g -o$@ parser.y ;\ + else \ + racc -E -o$@ parser.y ;\ + fi + +clean: + rm -f parser.rb parser.output + +distclean: clean diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb similarity index 99% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb index 235ec761..224ed709 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb @@ -1,5 +1,8 @@ -# -# address.rb +=begin rdoc + += Address handling class + +=end # #-- # Copyright (c) 1998-2003 Minero Aoki @@ -51,6 +54,7 @@ module TMail raise SyntaxError, 'empty word in domain' if s.empty? end end + @local = local @domain = domain @name = nil @@ -96,7 +100,6 @@ module TMail alias address spec - def ==( other ) other.respond_to? :spec and self.spec == other.spec end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb similarity index 87% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb index 4d8d106a..a8b8017c 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb @@ -1,3 +1,9 @@ +=begin rdoc + += Attachment handling class + +=end + require 'stringio' module TMail @@ -18,7 +24,9 @@ module TMail def attachments if multipart? parts.collect { |part| - if attachment?(part) + if part.multipart? + part.attachments + elsif attachment?(part) content = part.body # unquoted automatically by TMail#body file_name = (part['content-location'] && part['content-location'].body) || @@ -32,7 +40,7 @@ module TMail attachment.content_type = part.content_type attachment end - }.compact + }.flatten.compact end end end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb new file mode 100755 index 00000000..e99b6b0b --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb @@ -0,0 +1,52 @@ +# = TITLE: +# +# Base64 +# +# = COPYRIGHT: +# +# Copyright (c) 1998-2003 Minero Aoki +# +# 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: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# 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. +# +# Note: Originally licensed under LGPL v2+. Using MIT license for Rails +# with permission of Minero Aoki. + +# +module TMail + + module Base64 + + module_function + + def folding_encode( str, eol = "\n", limit = 60 ) + [str].pack('m') + end + + def encode( str ) + [str].pack('m').tr( "\r\n", '' ) + end + + def decode( str, strict = false ) + str.unpack('m').first + end + + end + +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb new file mode 100644 index 00000000..9d2aa837 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb @@ -0,0 +1,39 @@ +unless Enumerable.method_defined?(:map) + module Enumerable + alias map collect + end +end + +unless Enumerable.method_defined?(:select) + module Enumerable + alias select find_all + end +end + +unless Enumerable.method_defined?(:reject) + module Enumerable + def reject + result = [] + each do |i| + result.push i unless yield(i) + end + result + end + end +end + +unless Enumerable.method_defined?(:sort_by) + module Enumerable + def sort_by + map {|i| [yield(i), i] }.sort.map {|val, i| i } + end + end +end + +unless File.respond_to?(:read) + def File.read(fname) + File.open(fname) {|f| + return f.read + } + end +end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb similarity index 97% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb index b075299b..4b253d2b 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb @@ -1,6 +1,8 @@ -# -# config.rb -# +=begin rdoc + += Configuration Class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb new file mode 100644 index 00000000..cc24e977 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb @@ -0,0 +1,67 @@ +=begin rdoc + += Ruby on Rails Core Extensions + +provides .blank? + +=end +unless Object.respond_to?(:blank?) #:nodoc: + # Check first to see if we are in a Rails environment, no need to + # define these methods if we are + class Object + # An object is blank if it's nil, empty, or a whitespace string. + # For example, "", " ", nil, [], and {} are blank. + # + # This simplifies + # if !address.nil? && !address.empty? + # to + # if !address.blank? + def blank? + if respond_to?(:empty?) && respond_to?(:strip) + empty? or strip.empty? + elsif respond_to?(:empty?) + empty? + else + !self + end + end + end + + class NilClass #:nodoc: + def blank? + true + end + end + + class FalseClass #:nodoc: + def blank? + true + end + end + + class TrueClass #:nodoc: + def blank? + false + end + end + + class Array #:nodoc: + alias_method :blank?, :empty? + end + + class Hash #:nodoc: + alias_method :blank?, :empty? + end + + class String #:nodoc: + def blank? + empty? || strip.empty? + end + end + + class Numeric #:nodoc: + def blank? + false + end + end +end \ No newline at end of file diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb similarity index 95% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb index 91bd289c..0721a254 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb @@ -1,6 +1,8 @@ -# -# encode.rb -# +=begin rdoc + += Text Encoding class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # @@ -50,23 +52,25 @@ module TMail end end module_function :create_dest - + def encoded( eol = "\r\n", charset = 'j', dest = nil ) accept_strategy Encoder, eol, charset, dest end - + def decoded( eol = "\n", charset = 'e', dest = nil ) + # Turn the E-Mail into a string and return it with all + # encoded characters decoded. alias for to_s accept_strategy Decoder, eol, charset, dest end - + alias to_s decoded - + def accept_strategy( klass, eol, charset, dest = nil ) dest ||= '' - accept klass.new(create_dest(dest), charset, eol) + accept klass.new( create_dest(dest), charset, eol ) dest end - + end @@ -141,6 +145,7 @@ module TMail end def kv_pair( k, v ) + v = dquote(v) unless token_safe?(v) @f << k << '=' << v end @@ -190,9 +195,18 @@ module TMail @f = StrategyInterface.create_dest(dest) @opt = OPTIONS[$KCODE] @eol = eol + @preserve_quotes = true reset end + def preserve_quotes=( bool ) + @preserve_quotes + end + + def preserve_quotes + @preserve_quotes + end + def normalize_encoding( str ) if @opt then NKF.nkf(@opt, str) diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/facade.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/facade.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/facade.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb similarity index 96% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb index be97803d..41c371f3 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb @@ -1,5 +1,10 @@ -# -# header.rb +=begin rdoc + += Header handling class + +=end +# RFC #822 ftp://ftp.isi.edu/in-notes/rfc822.txt +# # #-- # Copyright (c) 1998-2003 Minero Aoki @@ -76,6 +81,7 @@ module TMail @illegal = false @parsed = false + if intern @parsed = true parse_init @@ -129,7 +135,7 @@ module TMail include StrategyInterface - def accept( strategy, dummy1 = nil, dummy2 = nil ) + def accept( strategy ) ensure_parsed do_accept strategy strategy.terminate @@ -207,6 +213,7 @@ module TMail end def do_parse + quote_boundary obj = Parser.parse(self.class::PARSE_TYPE, @body, @comments) set obj if obj end @@ -739,12 +746,17 @@ module TMail def params ensure_parsed + unless @params.blank? + @params.each do |k, v| + @params[k] = unquote(v) + end + end @params end def []( key ) ensure_parsed - @params and @params[key] + @params and unquote(@params[key]) end def []=( key, val ) @@ -835,12 +847,17 @@ module TMail def params ensure_parsed + unless @params.blank? + @params.each do |k, v| + @params[k] = unquote(v) + end + end @params end def []( key ) ensure_parsed - @params and @params[key] + @params and unquote(@params[key]) end def []=( key, val ) @@ -867,7 +884,7 @@ module TMail @params.each do |k,v| strategy.meta ';' strategy.space - strategy.kv_pair k, v + strategy.kv_pair k, unquote(v) end end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/info.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/info.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/info.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb new file mode 100644 index 00000000..957e8997 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb @@ -0,0 +1,540 @@ +=begin rdoc + += Facade.rb Provides an interface to the TMail object + +=end +#-- +# Copyright (c) 1998-2003 Minero Aoki +# +# 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: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# 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. +# +# Note: Originally licensed under LGPL v2+. Using MIT license for Rails +# with permission of Minero Aoki. +#++ + +require 'tmail/utils' + +module TMail + + class Mail + + def header_string( name, default = nil ) + h = @header[name.downcase] or return default + h.to_s + end + + ### + ### attributes + ### + + include TextUtils + + def set_string_array_attr( key, strs ) + strs.flatten! + if strs.empty? + @header.delete key.downcase + else + store key, strs.join(', ') + end + strs + end + private :set_string_array_attr + + def set_string_attr( key, str ) + if str + store key, str + else + @header.delete key.downcase + end + str + end + private :set_string_attr + + def set_addrfield( name, arg ) + if arg + h = HeaderField.internal_new(name, @config) + h.addrs.replace [arg].flatten + @header[name] = h + else + @header.delete name + end + arg + end + private :set_addrfield + + def addrs2specs( addrs ) + return nil unless addrs + list = addrs.map {|addr| + if addr.address_group? + then addr.map {|a| a.spec } + else addr.spec + end + }.flatten + return nil if list.empty? + list + end + private :addrs2specs + + # + # date time + # + + def date( default = nil ) + if h = @header['date'] + h.date + else + default + end + end + + def date=( time ) + if time + store 'Date', time2str(time) + else + @header.delete 'date' + end + time + end + + def strftime( fmt, default = nil ) + if t = date + t.strftime(fmt) + else + default + end + end + + # + # destination + # + + def to_addrs( default = nil ) + if h = @header['to'] + h.addrs + else + default + end + end + + def cc_addrs( default = nil ) + if h = @header['cc'] + h.addrs + else + default + end + end + + def bcc_addrs( default = nil ) + if h = @header['bcc'] + h.addrs + else + default + end + end + + def to_addrs=( arg ) + set_addrfield 'to', arg + end + + def cc_addrs=( arg ) + set_addrfield 'cc', arg + end + + def bcc_addrs=( arg ) + set_addrfield 'bcc', arg + end + + def to( default = nil ) + addrs2specs(to_addrs(nil)) || default + end + + def cc( default = nil ) + addrs2specs(cc_addrs(nil)) || default + end + + def bcc( default = nil ) + addrs2specs(bcc_addrs(nil)) || default + end + + def to=( *strs ) + set_string_array_attr 'To', strs + end + + def cc=( *strs ) + set_string_array_attr 'Cc', strs + end + + def bcc=( *strs ) + set_string_array_attr 'Bcc', strs + end + + # + # originator + # + + def from_addrs( default = nil ) + if h = @header['from'] + h.addrs + else + default + end + end + + def from_addrs=( arg ) + set_addrfield 'from', arg + end + + def from( default = nil ) + addrs2specs(from_addrs(nil)) || default + end + + def from=( *strs ) + set_string_array_attr 'From', strs + end + + def friendly_from( default = nil ) + h = @header['from'] + a, = h.addrs + return default unless a + return a.phrase if a.phrase + return h.comments.join(' ') unless h.comments.empty? + a.spec + end + + + def reply_to_addrs( default = nil ) + if h = @header['reply-to'] + h.addrs + else + default + end + end + + def reply_to_addrs=( arg ) + set_addrfield 'reply-to', arg + end + + def reply_to( default = nil ) + addrs2specs(reply_to_addrs(nil)) || default + end + + def reply_to=( *strs ) + set_string_array_attr 'Reply-To', strs + end + + + def sender_addr( default = nil ) + f = @header['sender'] or return default + f.addr or return default + end + + def sender_addr=( addr ) + if addr + h = HeaderField.internal_new('sender', @config) + h.addr = addr + @header['sender'] = h + else + @header.delete 'sender' + end + addr + end + + def sender( default ) + f = @header['sender'] or return default + a = f.addr or return default + a.spec + end + + def sender=( str ) + set_string_attr 'Sender', str + end + + + # + # subject + # + + def subject( default = nil ) + if h = @header['subject'] + h.body + else + default + end + end + alias quoted_subject subject + + def subject=( str ) + set_string_attr 'Subject', str + end + + # + # identity & threading + # + + def message_id( default = nil ) + if h = @header['message-id'] + h.id || default + else + default + end + end + + def message_id=( str ) + set_string_attr 'Message-Id', str + end + + def in_reply_to( default = nil ) + if h = @header['in-reply-to'] + h.ids + else + default + end + end + + def in_reply_to=( *idstrs ) + set_string_array_attr 'In-Reply-To', idstrs + end + + def references( default = nil ) + if h = @header['references'] + h.refs + else + default + end + end + + def references=( *strs ) + set_string_array_attr 'References', strs + end + + # + # MIME headers + # + + def mime_version( default = nil ) + if h = @header['mime-version'] + h.version || default + else + default + end + end + + def mime_version=( m, opt = nil ) + if opt + if h = @header['mime-version'] + h.major = m + h.minor = opt + else + store 'Mime-Version', "#{m}.#{opt}" + end + else + store 'Mime-Version', m + end + m + end + + def content_type( default = nil ) + if h = @header['content-type'] + h.content_type || default + else + default + end + end + + def main_type( default = nil ) + if h = @header['content-type'] + h.main_type || default + else + default + end + end + + def sub_type( default = nil ) + if h = @header['content-type'] + h.sub_type || default + else + default + end + end + + def set_content_type( str, sub = nil, param = nil ) + if sub + main, sub = str, sub + else + main, sub = str.split(%r, 2) + raise ArgumentError, "sub type missing: #{str.inspect}" unless sub + end + if h = @header['content-type'] + h.main_type = main + h.sub_type = sub + h.params.clear + else + store 'Content-Type', "#{main}/#{sub}" + end + @header['content-type'].params.replace param if param + str + end + + alias content_type= set_content_type + + def type_param( name, default = nil ) + if h = @header['content-type'] + h[name] || default + else + default + end + end + + def charset( default = nil ) + if h = @header['content-type'] + h['charset'] or default + else + default + end + end + + def charset=( str ) + if str + if h = @header[ 'content-type' ] + h['charset'] = str + else + store 'Content-Type', "text/plain; charset=#{str}" + end + end + str + end + + def transfer_encoding( default = nil ) + if h = @header['content-transfer-encoding'] + h.encoding || default + else + default + end + end + + def transfer_encoding=( str ) + set_string_attr 'Content-Transfer-Encoding', str + end + + alias encoding transfer_encoding + alias encoding= transfer_encoding= + alias content_transfer_encoding transfer_encoding + alias content_transfer_encoding= transfer_encoding= + + def disposition( default = nil ) + if h = @header['content-disposition'] + h.disposition || default + else + default + end + end + + alias content_disposition disposition + + def set_disposition( str, params = nil ) + if h = @header['content-disposition'] + h.disposition = str + h.params.clear + else + store('Content-Disposition', str) + h = @header['content-disposition'] + end + h.params.replace params if params + end + + alias disposition= set_disposition + alias set_content_disposition set_disposition + alias content_disposition= set_disposition + + def disposition_param( name, default = nil ) + if h = @header['content-disposition'] + h[name] || default + else + default + end + end + + ### + ### utils + ### + + def create_reply + mail = TMail::Mail.parse('') + mail.subject = 'Re: ' + subject('').sub(/\A(?:\[[^\]]+\])?(?:\s*Re:)*\s*/i, '') + mail.to_addrs = reply_addresses([]) + mail.in_reply_to = [message_id(nil)].compact + mail.references = references([]) + [message_id(nil)].compact + mail.mime_version = '1.0' + mail + end + + def base64_encode + store 'Content-Transfer-Encoding', 'Base64' + self.body = Base64.folding_encode(self.body) + end + + def base64_decode + if /base64/i === self.transfer_encoding('') + store 'Content-Transfer-Encoding', '8bit' + self.body = Base64.decode(self.body, @config.strict_base64decode?) + end + end + + def destinations( default = nil ) + ret = [] + %w( to cc bcc ).each do |nm| + if h = @header[nm] + h.addrs.each {|i| ret.push i.address } + end + end + ret.empty? ? default : ret + end + + def each_destination( &block ) + destinations([]).each do |i| + if Address === i + yield i + else + i.each(&block) + end + end + end + + alias each_dest each_destination + + def reply_addresses( default = nil ) + reply_to_addrs(nil) or from_addrs(nil) or default + end + + def error_reply_addresses( default = nil ) + if s = sender(nil) + [s] + else + from_addrs(default) + end + end + + def multipart? + main_type('').downcase == 'multipart' + end + + end # class Mail + +end # module TMail diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/loader.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/loader.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/loader.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb similarity index 94% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb index e11fa0f0..d10275b7 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb @@ -1,6 +1,8 @@ -# -# mail.rb -# +=begin rdoc + += Mail class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # @@ -27,7 +29,7 @@ # with permission of Minero Aoki. #++ -require 'tmail/facade' +require 'tmail/interface' require 'tmail/encode' require 'tmail/header' require 'tmail/port' @@ -37,7 +39,6 @@ require 'tmail/attachments' require 'tmail/quoting' require 'socket' - module TMail class Mail @@ -53,6 +54,7 @@ module TMail def parse( str ) new(StringPort.new(str)) end + end def initialize( port = nil, conf = DEFAULT_CONFIG ) @@ -355,6 +357,19 @@ module TMail end def body=( str ) + # Sets the body of the email to a new (encoded) string. + # + # We also reparses the email if the body is ever reassigned, this is a performance hit, however when + # you assign the body, you usually want to be able to make sure that you can access the attachments etc. + # + # Usage: + # + # mail.body = "Hello, this is\nthe body text" + # # => "Hello, this is\nthe body" + # mail.body + # # => "Hello, this is\nthe body" + @body_parsed = false + parse_body(StringInput.new(str)) parse_body @body_port.wopen {|f| f.write str } str diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb similarity index 99% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb index d85915ed..bb7a460e 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb @@ -1,6 +1,8 @@ -# -# mailbox.rb -# +=begin rdoc + += Mailbox and Mbox interaction class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mbox.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mbox.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mbox.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb similarity index 99% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb index f96cf64c..50b1dd95 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb @@ -1,6 +1,8 @@ -# -# net.rb -# +=begin rdoc + += Net provides SMTP wrapping + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb similarity index 98% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb index f98be747..b871510b 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb @@ -1,6 +1,8 @@ -# -# obsolete.rb -# +=begin rdoc + += Obsolete methods that are depriciated + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb similarity index 70% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb index 825eca92..5deb0ff6 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb @@ -1,38 +1,32 @@ -# # DO NOT MODIFY!!!! -# This file is automatically generated by racc 1.4.3 +# This file is automatically generated by racc 1.4.5 # from racc grammer file "parser.y". # # # parser.rb: generated by racc (runtime embedded) # - -###### racc/parser.rb - +###### racc/parser.rb begin unless $".index 'racc/parser.rb' $".push 'racc/parser.rb' -self.class.module_eval <<'..end /home/aamine/lib/ruby/racc/parser.rb modeval..idb76f2e220d', '/home/aamine/lib/ruby/racc/parser.rb', 1 +self.class.module_eval <<'..end racc/parser.rb modeval..id8076474214', 'racc/parser.rb', 1 # -# parser.rb +# $Id: parser.rb,v 1.7 2005/11/20 17:31:32 aamine Exp $ # -# Copyright (c) 1999-2003 Minero Aoki +# Copyright (c) 1999-2005 Minero Aoki # -# This program is free software. -# You can distribute/modify this program under the same terms of ruby. +# This program is free software. +# You can distribute/modify this program under the same terms of ruby. # -# As a special exception, when this code is copied by Racc -# into a Racc output file, you may use that output file -# without restriction. -# -# $Id: parser.rb,v 1.1.1.1 2004/10/14 11:59:58 webster132 Exp $ +# As a special exception, when this code is copied by Racc +# into a Racc output file, you may use that output file +# without restriction. # -unless defined? NotImplementedError +unless defined?(NotImplementedError) NotImplementedError = NotImplementError end - module Racc class ParseError < StandardError; end end @@ -40,24 +34,23 @@ unless defined?(::ParseError) ParseError = Racc::ParseError end - module Racc - unless defined? Racc_No_Extentions + unless defined?(Racc_No_Extentions) Racc_No_Extentions = false end class Parser - Racc_Runtime_Version = '1.4.3' - Racc_Runtime_Revision = '$Revision: 1.1.1.1 $'.split(/\s+/)[1] + Racc_Runtime_Version = '1.4.5' + Racc_Runtime_Revision = '$Revision: 1.7 $'.split[1] - Racc_Runtime_Core_Version_R = '1.4.3' - Racc_Runtime_Core_Revision_R = '$Revision: 1.1.1.1 $'.split(/\s+/)[1] + Racc_Runtime_Core_Version_R = '1.4.5' + Racc_Runtime_Core_Revision_R = '$Revision: 1.7 $'.split[1] begin require 'racc/cparse' # Racc_Runtime_Core_Version_C = (defined in extention) - Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split(/\s+/)[2] + Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2] unless new.respond_to?(:_racc_do_parse_c, true) raise LoadError, 'old cparse.so' end @@ -78,7 +71,7 @@ module Racc Racc_Runtime_Type = 'ruby' end - def self.racc_runtime_type + def Parser.racc_runtime_type Racc_Runtime_Type end @@ -86,9 +79,9 @@ module Racc def _racc_setup @yydebug = false unless self.class::Racc_debug_parser - @yydebug = false unless defined? @yydebug + @yydebug = false unless defined?(@yydebug) if @yydebug - @racc_debug_out = $stderr unless defined? @racc_debug_out + @racc_debug_out = $stderr unless defined?(@racc_debug_out) @racc_debug_out ||= $stderr end arg = self.class::Racc_arg @@ -110,20 +103,19 @@ module Racc @racc_error_status = 0 end - ### ### do_parse ### def do_parse - __send__ Racc_Main_Parsing_Routine, _racc_setup(), false + __send__(Racc_Main_Parsing_Routine, _racc_setup(), false) end def next_token raise NotImplementedError, "#{self.class}\#next_token is not defined" end - def _racc_do_parse_rb( arg, in_debug ) + def _racc_do_parse_rb(arg, in_debug) action_table, action_check, action_default, action_pointer, goto_table, goto_check, goto_default, goto_pointer, nt_base, reduce_table, token_table, shift_n, @@ -134,47 +126,45 @@ module Racc nerr = 0 catch(:racc_end_parse) { - while true - if i = action_pointer[@racc_state[-1]] - if @racc_read_next - if @racc_t != 0 # not EOF - tok, @racc_val = next_token() - unless tok # EOF - @racc_t = 0 - else - @racc_t = (token_table[tok] or 1) # error token - end - racc_read_token(@racc_t, tok, @racc_val) if @yydebug - @racc_read_next = false + while true + if i = action_pointer[@racc_state[-1]] + if @racc_read_next + if @racc_t != 0 # not EOF + tok, @racc_val = next_token() + unless tok # EOF + @racc_t = 0 + else + @racc_t = (token_table[tok] or 1) # error token end + racc_read_token(@racc_t, tok, @racc_val) if @yydebug + @racc_read_next = false end - i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; - else - act = action_default[@racc_state[-1]] - end - else + end + i += @racc_t + unless i >= 0 and + act = action_table[i] and + action_check[i] == @racc_state[-1] act = action_default[@racc_state[-1]] end - while act = _racc_evalact(act, arg) - end + else + act = action_default[@racc_state[-1]] end + while act = _racc_evalact(act, arg) + ; + end + end } end - ### ### yyparse ### - def yyparse( recv, mid ) - __send__ Racc_YY_Parse_Method, recv, mid, _racc_setup(), true + def yyparse(recv, mid) + __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true) end - def _racc_yyparse_rb( recv, mid, arg, c_debug ) + def _racc_yyparse_rb(recv, mid, arg, c_debug) action_table, action_check, action_default, action_pointer, goto_table, goto_check, goto_default, goto_pointer, nt_base, reduce_table, token_table, shift_n, @@ -186,15 +176,13 @@ module Racc i = nil nerr = 0 - catch(:racc_end_parse) { until i = action_pointer[@racc_state[-1]] while act = _racc_evalact(action_default[@racc_state[-1]], arg) + ; end end - recv.__send__(mid) do |tok, val| -# $stderr.puts "rd: tok=#{tok}, val=#{val}" unless tok @racc_t = 0 else @@ -204,67 +192,53 @@ module Racc @racc_read_next = false i += @racc_t - if i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "01: act=#{act}" - else + unless i >= 0 and + act = action_table[i] and + action_check[i] == @racc_state[-1] act = action_default[@racc_state[-1]] -# $stderr.puts "02: act=#{act}" -# $stderr.puts "curstate=#{@racc_state[-1]}" end - while act = _racc_evalact(act, arg) + ; end while not (i = action_pointer[@racc_state[-1]]) or not @racc_read_next or @racc_t == 0 # $ - if i and i += @racc_t and - i >= 0 and - act = action_table[i] and - action_check[i] == @racc_state[-1] - ; -# $stderr.puts "03: act=#{act}" - else -# $stderr.puts "04: act=#{act}" + unless i and i += @racc_t and + i >= 0 and + act = action_table[i] and + action_check[i] == @racc_state[-1] act = action_default[@racc_state[-1]] end - while act = _racc_evalact(act, arg) + ; end end end } end - ### ### common ### - def _racc_evalact( act, arg ) -# $stderr.puts "ea: act=#{act}" + def _racc_evalact(act, arg) action_table, action_check, action_default, action_pointer, goto_table, goto_check, goto_default, goto_pointer, nt_base, reduce_table, token_table, shift_n, reduce_n, use_result, * = arg -nerr = 0 # tmp + nerr = 0 # tmp if act > 0 and act < shift_n # # shift # - if @racc_error_status > 0 @racc_error_status -= 1 unless @racc_t == 1 # error token end - @racc_vstack.push @racc_val @racc_state.push act @racc_read_next = true - if @yydebug @racc_tstack.push @racc_t racc_shift @racc_t, @racc_tstack, @racc_vstack @@ -274,10 +248,9 @@ nerr = 0 # tmp # # reduce # - code = catch(:racc_jump) { - @racc_state.push _racc_do_reduce(arg, act) - false + @racc_state.push _racc_do_reduce(arg, act) + false } if code case code @@ -287,7 +260,7 @@ nerr = 0 # tmp when 2 # yyaccept return shift_n else - raise RuntimeError, '[Racc Bug] unknown jump code' + raise '[Racc Bug] unknown jump code' end end @@ -295,7 +268,6 @@ nerr = 0 # tmp # # accept # - racc_accept if @yydebug throw :racc_end_parse, @racc_vstack[0] @@ -303,7 +275,6 @@ nerr = 0 # tmp # # error # - case @racc_error_status when 0 unless arg[21] # user_yyerror @@ -318,7 +289,6 @@ nerr = 0 # tmp end @racc_user_yyerror = false @racc_error_status = 3 - while true if i = action_pointer[@racc_state[-1]] i += 1 # error token @@ -328,8 +298,7 @@ nerr = 0 # tmp break end end - - throw :racc_end_parse, nil if @racc_state.size < 2 + throw :racc_end_parse, nil if @racc_state.size <= 1 @racc_state.pop @racc_vstack.pop if @yydebug @@ -337,11 +306,10 @@ nerr = 0 # tmp racc_e_pop @racc_state, @racc_tstack, @racc_vstack end end - return act else - raise RuntimeError, "[Racc Bug] unknown action #{act.inspect}" + raise "[Racc Bug] unknown action #{act.inspect}" end racc_next_state(@racc_state[-1], @racc_state) if @yydebug @@ -349,7 +317,7 @@ nerr = 0 # tmp nil end - def _racc_do_reduce( arg, act ) + def _racc_do_reduce(arg, act) action_table, action_check, action_default, action_pointer, goto_table, goto_check, goto_default, goto_pointer, nt_base, reduce_table, token_table, shift_n, @@ -390,7 +358,7 @@ nerr = 0 # tmp goto_default[k1] end - def on_error( t, val, vstack ) + def on_error(t, val, vstack) raise ParseError, sprintf("\nparse error on value %s (%s)", val.inspect, token_to_str(t) || '?') end @@ -407,23 +375,24 @@ nerr = 0 # tmp @racc_error_status = 0 end - + # # for debugging output + # - def racc_read_token( t, tok, val ) + def racc_read_token(t, tok, val) @racc_debug_out.print 'read ' @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') ' @racc_debug_out.puts val.inspect @racc_debug_out.puts end - def racc_shift( tok, tstack, vstack ) + def racc_shift(tok, tstack, vstack) @racc_debug_out.puts "shift #{racc_token2str tok}" racc_print_stacks tstack, vstack @racc_debug_out.puts end - def racc_reduce( toks, sim, tstack, vstack ) + def racc_reduce(toks, sim, tstack, vstack) out = @racc_debug_out out.print 'reduce ' if toks.empty? @@ -442,20 +411,20 @@ nerr = 0 # tmp @racc_debug_out.puts end - def racc_e_pop( state, tstack, vstack ) + def racc_e_pop(state, tstack, vstack) @racc_debug_out.puts 'error recovering mode: pop token' racc_print_states state racc_print_stacks tstack, vstack @racc_debug_out.puts end - def racc_next_state( curstate, state ) + def racc_next_state(curstate, state) @racc_debug_out.puts "goto #{curstate}" racc_print_states state @racc_debug_out.puts end - def racc_print_stacks( t, v ) + def racc_print_stacks(t, v) out = @racc_debug_out out.print ' [' t.each_index do |i| @@ -464,57 +433,39 @@ nerr = 0 # tmp out.puts ' ]' end - def racc_print_states( s ) + def racc_print_states(s) out = @racc_debug_out out.print ' [' s.each {|st| out.print ' ', st } out.puts ' ]' end - def racc_token2str( tok ) + def racc_token2str(tok) self.class::Racc_token_to_s_table[tok] or - raise RuntimeError, "[Racc Bug] can't convert token #{tok} to string" + raise "[Racc Bug] can't convert token #{tok} to string" end - def token_to_str( t ) + def token_to_str(t) self.class::Racc_token_to_s_table[t] end end end -..end /home/aamine/lib/ruby/racc/parser.rb modeval..idb76f2e220d -end # end of racc/parser.rb +..end racc/parser.rb modeval..id8076474214 +end +###### racc/parser.rb end # # parser.rb # -#-- -# Copyright (c) 1998-2003 Minero Aoki +# Copyright (c) 1998-2007 Minero Aoki # -# 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: +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU Lesser General Public License version 2.1. # -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# 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. -# -# Note: Originally licensed under LGPL v2+. Using MIT license for Rails -# with permission of Minero Aoki. -#++ require 'tmail/scanner' require 'tmail/utils' @@ -524,7 +475,7 @@ module TMail class Parser < Racc::Parser -module_eval <<'..end parser.y modeval..id43721faf1c', 'parser.y', 331 +module_eval <<'..end parser.y modeval..id7b0b3dccb7', 'parser.y', 340 include TextUtils @@ -567,9 +518,9 @@ module_eval <<'..end parser.y modeval..id43721faf1c', 'parser.y', 331 raise SyntaxError, "parse error on token #{racc_token2str t}" end -..end parser.y modeval..id43721faf1c +..end parser.y modeval..id7b0b3dccb7 -##### racc 1.4.3 generates ### +##### racc 1.4.5 generates ### racc_reduce_table = [ 0, 0, :racc_error, @@ -669,10 +620,9 @@ racc_reduce_table = [ 3, 43, :_reduce_94, 0, 80, :_reduce_95, 5, 80, :_reduce_96, - 1, 82, :_reduce_none, - 1, 82, :_reduce_none, - 1, 44, :_reduce_99, - 3, 45, :_reduce_100, + 5, 80, :_reduce_97, + 1, 44, :_reduce_98, + 3, 45, :_reduce_99, 0, 81, :_reduce_none, 1, 81, :_reduce_none, 1, 78, :_reduce_none, @@ -683,15 +633,15 @@ racc_reduce_table = [ 1, 78, :_reduce_none, 1, 78, :_reduce_none ] -racc_reduce_n = 110 +racc_reduce_n = 109 -racc_shift_n = 168 +racc_shift_n = 167 racc_action_table = [ - -70, -69, 23, 25, 146, 147, 29, 31, 105, 106, + -70, -69, 23, 25, 145, 146, 29, 31, 105, 106, 16, 17, 20, 22, 136, 27, -70, -69, 32, 101, - -70, -69, 154, 100, 113, 115, -70, -69, -70, 109, - 75, 23, 25, 101, 155, 29, 31, 142, 143, 16, + -70, -69, 153, 100, 113, 115, -70, -69, -70, 109, + 75, 23, 25, 101, 154, 29, 31, 142, 143, 16, 17, 20, 22, 107, 27, 23, 25, 32, 98, 29, 31, 96, 94, 16, 17, 20, 22, 78, 27, 23, 25, 32, 112, 29, 31, 74, 91, 16, 17, 20, @@ -703,11 +653,11 @@ racc_action_table = [ 78, 29, 31, 133, 78, 16, 17, 20, 22, 77, 23, 25, 75, 32, 29, 31, 65, 62, 16, 17, 20, 22, 139, 23, 25, 101, 32, 29, 31, 60, - 100, 16, 17, 20, 22, 44, 27, 101, 148, 32, - 23, 25, 120, 149, 29, 31, 152, 153, 16, 17, - 20, 22, 42, 27, 157, 159, 32, 23, 25, 120, - 40, 29, 31, 15, 164, 16, 17, 20, 22, 40, - 27, 23, 25, 32, 68, 29, 31, 166, 167, 16, + 100, 16, 17, 20, 22, 44, 27, 101, 147, 32, + 23, 25, 120, 148, 29, 31, 151, 152, 16, 17, + 20, 22, 42, 27, 156, 158, 32, 23, 25, 120, + 40, 29, 31, 15, 163, 16, 17, 20, 22, 40, + 27, 23, 25, 32, 68, 29, 31, 165, 166, 16, 17, 20, 22, nil, 27, 23, 25, 32, nil, 29, 31, 74, nil, 16, 17, 20, 22, nil, 23, 25, nil, 32, 29, 31, nil, nil, 16, 17, 20, 22, @@ -735,9 +685,9 @@ racc_action_check = [ 68, 68, 68, 68, 126, 68, 75, 28, 68, 67, 75, 28, 143, 66, 86, 86, 75, 28, 75, 75, 28, 3, 3, 86, 143, 3, 3, 134, 134, 3, - 3, 3, 3, 73, 3, 152, 152, 3, 62, 152, - 152, 60, 56, 152, 152, 152, 152, 51, 152, 52, - 52, 152, 80, 52, 52, 52, 50, 52, 52, 52, + 3, 3, 3, 73, 3, 151, 151, 3, 62, 151, + 151, 60, 56, 151, 151, 151, 151, 51, 151, 52, + 52, 151, 80, 52, 52, 52, 50, 52, 52, 52, 52, 45, 89, 52, 42, 52, 71, 71, 41, 96, 71, 71, 97, 98, 71, 71, 71, 71, 100, 7, 7, 101, 71, 7, 7, 102, 104, 7, 7, 7, @@ -748,13 +698,13 @@ racc_action_check = [ 10, 10, 130, 2, 2, 131, 10, 2, 2, 11, 135, 2, 2, 2, 2, 6, 2, 138, 139, 2, 90, 90, 90, 140, 90, 90, 141, 142, 90, 90, - 90, 90, 5, 90, 148, 151, 90, 127, 127, 127, - 4, 127, 127, 1, 157, 127, 127, 127, 127, 159, - 127, 26, 26, 127, 26, 26, 26, 163, 164, 26, + 90, 90, 5, 90, 147, 150, 90, 127, 127, 127, + 4, 127, 127, 1, 156, 127, 127, 127, 127, 158, + 127, 26, 26, 127, 26, 26, 26, 162, 163, 26, 26, 26, 26, nil, 26, 27, 27, 26, nil, 27, - 27, 27, nil, 27, 27, 27, 27, nil, 155, 155, - nil, 27, 155, 155, nil, nil, 155, 155, 155, 155, - nil, 122, 122, nil, 155, 122, 122, nil, nil, 122, + 27, 27, nil, 27, 27, 27, 27, nil, 154, 154, + nil, 27, 154, 154, nil, nil, 154, 154, 154, 154, + nil, 122, 122, nil, 154, 122, 122, nil, nil, 122, 122, 122, 122, nil, 76, 76, nil, 122, 76, 76, nil, nil, 76, 76, 76, 76, nil, 38, 38, nil, 76, 38, 38, nil, nil, 38, 38, 38, 38, nil, @@ -788,78 +738,78 @@ racc_action_pointer = [ nil, 80, 96, 344, 296, nil, nil, 108, nil, nil, nil, 98, 217, nil, nil, nil, -19, 163, nil, 380, 128, 116, nil, nil, 14, 124, -26, nil, 128, 141, - 148, 141, 152, 7, nil, nil, nil, nil, 160, nil, - nil, 149, 31, nil, nil, 204, nil, 167, nil, 174, - nil, nil, nil, 169, 184, nil, nil, nil ] + 148, 141, 152, 7, nil, nil, nil, 160, nil, nil, + 149, 31, nil, nil, 204, nil, 167, nil, 174, nil, + nil, nil, 169, 184, nil, nil, nil ] racc_action_default = [ - -110, -110, -110, -110, -14, -110, -20, -110, -110, -110, - -110, -110, -110, -110, -10, -95, -106, -107, -77, -44, - -108, -11, -109, -79, -43, -103, -110, -110, -60, -104, - -55, -105, -78, -68, -54, -71, -45, -12, -110, -1, - -110, -110, -110, -2, -110, -22, -51, -48, -50, -3, - -40, -41, -110, -46, -4, -86, -5, -88, -6, -90, - -110, -7, -95, -8, -9, -99, -101, -61, -59, -56, - -69, -110, -110, -110, -110, -75, -110, -110, -57, -15, - -110, 168, -73, -80, -82, -21, -24, -81, -110, -27, - -110, -83, -47, -89, -110, -91, -110, -101, -110, -100, - -102, -75, -58, -52, -110, -110, -64, -63, -65, -76, - -72, -67, -110, -110, -110, -26, -23, -110, -29, -49, - -84, -42, -87, -92, -94, -95, -110, -110, -62, -110, - -110, -25, -74, -28, -31, -101, -110, -53, -66, -110, - -110, -34, -110, -110, -93, -96, -98, -97, -110, -18, - -13, -38, -110, -30, -33, -110, -32, -16, -19, -14, - -35, -36, -37, -110, -110, -39, -85, -17 ] + -109, -109, -109, -109, -14, -109, -20, -109, -109, -109, + -109, -109, -109, -109, -10, -95, -105, -106, -77, -44, + -107, -11, -108, -79, -43, -102, -109, -109, -60, -103, + -55, -104, -78, -68, -54, -71, -45, -12, -109, -1, + -109, -109, -109, -2, -109, -22, -51, -48, -50, -3, + -40, -41, -109, -46, -4, -86, -5, -88, -6, -90, + -109, -7, -95, -8, -9, -98, -100, -61, -59, -56, + -69, -109, -109, -109, -109, -75, -109, -109, -57, -15, + -109, 167, -73, -80, -82, -21, -24, -81, -109, -27, + -109, -83, -47, -89, -109, -91, -109, -100, -109, -99, + -101, -75, -58, -52, -109, -109, -64, -63, -65, -76, + -72, -67, -109, -109, -109, -26, -23, -109, -29, -49, + -84, -42, -87, -92, -94, -95, -109, -109, -62, -109, + -109, -25, -74, -28, -31, -100, -109, -53, -66, -109, + -109, -34, -109, -109, -93, -96, -97, -109, -18, -13, + -38, -109, -30, -33, -109, -32, -16, -19, -14, -35, + -36, -37, -109, -109, -39, -85, -17 ] racc_goto_table = [ - 39, 67, 70, 73, 24, 37, 69, 66, 36, 38, - 57, 59, 55, 67, 108, 83, 90, 111, 69, 99, - 85, 49, 53, 76, 158, 134, 141, 70, 73, 151, - 118, 89, 45, 156, 160, 150, 140, 21, 14, 19, - 119, 102, 64, 63, 61, 83, 70, 104, 83, 58, - 124, 132, 56, 131, 97, 54, 93, 43, 5, 83, - 95, 145, 76, nil, 116, 76, nil, nil, 127, 138, - 103, nil, nil, nil, 38, nil, nil, 110, nil, nil, - nil, nil, nil, nil, 83, 83, nil, nil, 144, nil, - nil, nil, nil, nil, nil, 57, 121, 122, nil, nil, - 83, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 135, nil, nil, - nil, nil, nil, 93, nil, nil, nil, 70, 162, 137, - 70, 163, 161, 38, nil, nil, nil, nil, nil, nil, + 39, 67, 70, 73, 38, 66, 69, 24, 37, 57, + 59, 36, 55, 67, 99, 90, 85, 157, 69, 108, + 83, 134, 111, 76, 49, 53, 141, 70, 73, 150, + 118, 89, 45, 155, 159, 149, 140, 21, 14, 19, + 119, 102, 64, 63, 61, 124, 70, 104, 58, 132, + 83, 56, 97, 83, 54, 93, 43, 5, 131, 95, + 116, nil, 76, nil, 83, 76, nil, 127, nil, 38, + nil, nil, nil, 103, 138, nil, 110, nil, nil, nil, + nil, nil, nil, 144, nil, nil, nil, nil, nil, 83, + 83, nil, nil, nil, 57, nil, nil, 122, nil, 121, + nil, nil, nil, nil, nil, 83, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 135, nil, nil, nil, nil, + nil, nil, 93, nil, nil, nil, 70, 161, 38, 70, + 162, 160, 137, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 165 ] + nil, nil, nil, nil, 164 ] racc_goto_check = [ - 2, 37, 37, 29, 13, 13, 28, 46, 31, 36, - 41, 41, 45, 37, 25, 44, 32, 25, 28, 47, - 24, 4, 4, 42, 23, 20, 21, 37, 29, 22, + 2, 37, 37, 29, 36, 46, 28, 13, 13, 41, + 41, 31, 45, 37, 47, 32, 24, 23, 28, 25, + 44, 20, 25, 42, 4, 4, 21, 37, 29, 22, 19, 18, 17, 26, 27, 16, 15, 12, 11, 33, - 34, 35, 10, 9, 8, 44, 37, 29, 44, 7, - 47, 43, 6, 25, 46, 5, 41, 3, 1, 44, - 41, 48, 42, nil, 24, 42, nil, nil, 32, 25, - 13, nil, nil, nil, 36, nil, nil, 41, nil, nil, - nil, nil, nil, nil, 44, 44, nil, nil, 47, nil, - nil, nil, nil, nil, nil, 41, 31, 45, nil, nil, - 44, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, nil, nil, 46, nil, nil, - nil, nil, nil, 41, nil, nil, nil, 37, 29, 13, - 37, 29, 28, 36, nil, nil, nil, nil, nil, nil, + 34, 35, 10, 9, 8, 47, 37, 29, 7, 43, + 44, 6, 46, 44, 5, 41, 3, 1, 25, 41, + 24, nil, 42, nil, 44, 42, nil, 32, nil, 36, + nil, nil, nil, 13, 25, nil, 41, nil, nil, nil, + nil, nil, nil, 47, nil, nil, nil, nil, nil, 44, + 44, nil, nil, nil, 41, nil, nil, 45, nil, 31, + nil, nil, nil, nil, nil, 44, nil, nil, nil, nil, + nil, nil, nil, nil, nil, 46, nil, nil, nil, nil, + nil, nil, 41, nil, nil, nil, 37, 29, 36, 37, + 29, 28, 13, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 2 ] + nil, nil, nil, nil, 2 ] racc_goto_pointer = [ - nil, 58, -4, 51, 14, 47, 43, 39, 33, 31, - 29, 37, 35, 2, nil, -94, -105, 26, -14, -59, - -93, -108, -112, -127, -24, -60, -110, -118, -20, -24, - nil, 6, -34, 37, -50, -27, 6, -25, nil, nil, - nil, 1, -5, -63, -29, 3, -8, -47, -75 ] + nil, 57, -4, 50, 17, 46, 42, 38, 33, 31, + 29, 37, 35, 5, nil, -94, -105, 26, -14, -59, + -97, -108, -112, -133, -28, -55, -110, -117, -20, -24, + nil, 9, -35, 37, -50, -27, 1, -25, nil, nil, + nil, 0, -5, -65, -24, 3, -10, -52 ] racc_goto_default = [ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 48, 41, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 86, nil, nil, 30, 34, 50, 51, nil, 46, 47, nil, 26, 28, 71, 72, - 33, 35, 114, 82, 18, nil, nil, nil, nil ] + 33, 35, 114, 82, 18, nil, nil, nil ] racc_token_table = { false => 0, @@ -999,8 +949,7 @@ Racc_token_to_s_table = [ 'atom', 'phrase', 'params', -'opt_semicolon', -'value'] +'opt_semicolon'] Racc_debug_parser = false @@ -1080,7 +1029,7 @@ module_eval <<'.,.,', 'parser.y', 27 end .,., -module_eval <<'.,.,', 'parser.y', 33 +module_eval <<'.,.,', 'parser.y', 36 def _reduce_13( val, _values) t = Time.gm(val[3].to_i, val[2], val[1].to_i, 0, 0, 0) (t + val[4] - val[5]).localtime @@ -1091,14 +1040,14 @@ module_eval <<'.,.,', 'parser.y', 33 # reduce 15 omitted -module_eval <<'.,.,', 'parser.y', 42 +module_eval <<'.,.,', 'parser.y', 45 def _reduce_16( val, _values) (val[0].to_i * 60 * 60) + (val[2].to_i * 60) end .,., -module_eval <<'.,.,', 'parser.y', 47 +module_eval <<'.,.,', 'parser.y', 51 def _reduce_17( val, _values) (val[0].to_i * 60 * 60) + (val[2].to_i * 60) + @@ -1106,13 +1055,13 @@ module_eval <<'.,.,', 'parser.y', 47 end .,., -module_eval <<'.,.,', 'parser.y', 54 +module_eval <<'.,.,', 'parser.y', 56 def _reduce_18( val, _values) timezone_string_to_unixtime(val[0]) end .,., -module_eval <<'.,.,', 'parser.y', 59 +module_eval <<'.,.,', 'parser.y', 61 def _reduce_19( val, _values) val end @@ -1120,7 +1069,7 @@ module_eval <<'.,.,', 'parser.y', 59 # reduce 20 omitted -module_eval <<'.,.,', 'parser.y', 65 +module_eval <<'.,.,', 'parser.y', 67 def _reduce_21( val, _values) val[1] end @@ -1128,25 +1077,25 @@ module_eval <<'.,.,', 'parser.y', 65 # reduce 22 omitted -module_eval <<'.,.,', 'parser.y', 71 +module_eval <<'.,.,', 'parser.y', 73 def _reduce_23( val, _values) val[1] end .,., -module_eval <<'.,.,', 'parser.y', 77 +module_eval <<'.,.,', 'parser.y', 79 def _reduce_24( val, _values) join_domain(val[0]) end .,., -module_eval <<'.,.,', 'parser.y', 81 +module_eval <<'.,.,', 'parser.y', 83 def _reduce_25( val, _values) join_domain(val[2]) end .,., -module_eval <<'.,.,', 'parser.y', 85 +module_eval <<'.,.,', 'parser.y', 87 def _reduce_26( val, _values) join_domain(val[0]) end @@ -1154,19 +1103,19 @@ module_eval <<'.,.,', 'parser.y', 85 # reduce 27 omitted -module_eval <<'.,.,', 'parser.y', 91 +module_eval <<'.,.,', 'parser.y', 93 def _reduce_28( val, _values) val[1] end .,., -module_eval <<'.,.,', 'parser.y', 96 +module_eval <<'.,.,', 'parser.y', 98 def _reduce_29( val, _values) [] end .,., -module_eval <<'.,.,', 'parser.y', 100 +module_eval <<'.,.,', 'parser.y', 103 def _reduce_30( val, _values) val[0].push val[2] val[0] @@ -1175,13 +1124,13 @@ module_eval <<'.,.,', 'parser.y', 100 # reduce 31 omitted -module_eval <<'.,.,', 'parser.y', 107 +module_eval <<'.,.,', 'parser.y', 109 def _reduce_32( val, _values) val[1] end .,., -module_eval <<'.,.,', 'parser.y', 111 +module_eval <<'.,.,', 'parser.y', 113 def _reduce_33( val, _values) val[1] end @@ -1189,19 +1138,19 @@ module_eval <<'.,.,', 'parser.y', 111 # reduce 34 omitted -module_eval <<'.,.,', 'parser.y', 117 +module_eval <<'.,.,', 'parser.y', 119 def _reduce_35( val, _values) val[1] end .,., -module_eval <<'.,.,', 'parser.y', 123 +module_eval <<'.,.,', 'parser.y', 125 def _reduce_36( val, _values) val[0].spec end .,., -module_eval <<'.,.,', 'parser.y', 127 +module_eval <<'.,.,', 'parser.y', 129 def _reduce_37( val, _values) val[0].spec end @@ -1209,7 +1158,7 @@ module_eval <<'.,.,', 'parser.y', 127 # reduce 38 omitted -module_eval <<'.,.,', 'parser.y', 134 +module_eval <<'.,.,', 'parser.y', 136 def _reduce_39( val, _values) val[1] end @@ -1235,15 +1184,16 @@ module_eval <<'.,.,', 'parser.y', 146 end .,., -module_eval <<'.,.,', 'parser.y', 148 +module_eval <<'.,.,', 'parser.y', 152 def _reduce_48( val, _values) - val + val end .,., -module_eval <<'.,.,', 'parser.y', 149 +module_eval <<'.,.,', 'parser.y', 157 def _reduce_49( val, _values) - val[0].push val[2]; val[0] + val[0].push val[2] + val[0] end .,., @@ -1251,13 +1201,13 @@ module_eval <<'.,.,', 'parser.y', 149 # reduce 51 omitted -module_eval <<'.,.,', 'parser.y', 156 +module_eval <<'.,.,', 'parser.y', 165 def _reduce_52( val, _values) val end .,., -module_eval <<'.,.,', 'parser.y', 160 +module_eval <<'.,.,', 'parser.y', 170 def _reduce_53( val, _values) val[0].push val[2] val[0] @@ -1268,7 +1218,7 @@ module_eval <<'.,.,', 'parser.y', 160 # reduce 55 omitted -module_eval <<'.,.,', 'parser.y', 168 +module_eval <<'.,.,', 'parser.y', 178 def _reduce_56( val, _values) val[1].phrase = Decoder.decode(val[0]) val[1] @@ -1277,38 +1227,38 @@ module_eval <<'.,.,', 'parser.y', 168 # reduce 57 omitted -module_eval <<'.,.,', 'parser.y', 176 +module_eval <<'.,.,', 'parser.y', 185 def _reduce_58( val, _values) AddressGroup.new(val[0], val[2]) end .,., -module_eval <<'.,.,', 'parser.y', 178 +module_eval <<'.,.,', 'parser.y', 185 def _reduce_59( val, _values) AddressGroup.new(val[0], []) end .,., -module_eval <<'.,.,', 'parser.y', 181 +module_eval <<'.,.,', 'parser.y', 188 def _reduce_60( val, _values) val[0].join('.') end .,., -module_eval <<'.,.,', 'parser.y', 182 +module_eval <<'.,.,', 'parser.y', 189 def _reduce_61( val, _values) val[0] << ' ' << val[1].join('.') end .,., -module_eval <<'.,.,', 'parser.y', 186 +module_eval <<'.,.,', 'parser.y', 196 def _reduce_62( val, _values) val[2].routes.replace val[1] val[2] end .,., -module_eval <<'.,.,', 'parser.y', 191 +module_eval <<'.,.,', 'parser.y', 200 def _reduce_63( val, _values) val[1] end @@ -1316,25 +1266,25 @@ module_eval <<'.,.,', 'parser.y', 191 # reduce 64 omitted -module_eval <<'.,.,', 'parser.y', 196 +module_eval <<'.,.,', 'parser.y', 203 def _reduce_65( val, _values) [ val[1].join('.') ] end .,., -module_eval <<'.,.,', 'parser.y', 197 +module_eval <<'.,.,', 'parser.y', 204 def _reduce_66( val, _values) val[0].push val[3].join('.'); val[0] end .,., -module_eval <<'.,.,', 'parser.y', 199 +module_eval <<'.,.,', 'parser.y', 206 def _reduce_67( val, _values) Address.new( val[0], val[2] ) end .,., -module_eval <<'.,.,', 'parser.y', 200 +module_eval <<'.,.,', 'parser.y', 207 def _reduce_68( val, _values) Address.new( val[0], nil ) end @@ -1342,19 +1292,19 @@ module_eval <<'.,.,', 'parser.y', 200 # reduce 69 omitted -module_eval <<'.,.,', 'parser.y', 203 +module_eval <<'.,.,', 'parser.y', 210 def _reduce_70( val, _values) val[0].push ''; val[0] end .,., -module_eval <<'.,.,', 'parser.y', 206 +module_eval <<'.,.,', 'parser.y', 213 def _reduce_71( val, _values) val end .,., -module_eval <<'.,.,', 'parser.y', 209 +module_eval <<'.,.,', 'parser.y', 222 def _reduce_72( val, _values) val[1].times do val[0].push '' @@ -1364,13 +1314,13 @@ module_eval <<'.,.,', 'parser.y', 209 end .,., -module_eval <<'.,.,', 'parser.y', 217 +module_eval <<'.,.,', 'parser.y', 224 def _reduce_73( val, _values) val end .,., -module_eval <<'.,.,', 'parser.y', 220 +module_eval <<'.,.,', 'parser.y', 233 def _reduce_74( val, _values) val[1].times do val[0].push '' @@ -1380,13 +1330,13 @@ module_eval <<'.,.,', 'parser.y', 220 end .,., -module_eval <<'.,.,', 'parser.y', 227 +module_eval <<'.,.,', 'parser.y', 234 def _reduce_75( val, _values) 0 end .,., -module_eval <<'.,.,', 'parser.y', 228 +module_eval <<'.,.,', 'parser.y', 235 def _reduce_76( val, _values) 1 end @@ -1408,20 +1358,20 @@ module_eval <<'.,.,', 'parser.y', 228 # reduce 84 omitted -module_eval <<'.,.,', 'parser.y', 243 +module_eval <<'.,.,', 'parser.y', 253 def _reduce_85( val, _values) val[1] = val[1].spec val.join('') end .,., -module_eval <<'.,.,', 'parser.y', 247 +module_eval <<'.,.,', 'parser.y', 254 def _reduce_86( val, _values) val end .,., -module_eval <<'.,.,', 'parser.y', 248 +module_eval <<'.,.,', 'parser.y', 255 def _reduce_87( val, _values) val[0].push val[2]; val[0] end @@ -1429,72 +1379,77 @@ module_eval <<'.,.,', 'parser.y', 248 # reduce 88 omitted -module_eval <<'.,.,', 'parser.y', 251 +module_eval <<'.,.,', 'parser.y', 258 def _reduce_89( val, _values) val[0] << ' ' << val[1] end .,., -module_eval <<'.,.,', 'parser.y', 255 +module_eval <<'.,.,', 'parser.y', 265 def _reduce_90( val, _values) val.push nil val end .,., -module_eval <<'.,.,', 'parser.y', 260 +module_eval <<'.,.,', 'parser.y', 269 def _reduce_91( val, _values) val end .,., -module_eval <<'.,.,', 'parser.y', 265 +module_eval <<'.,.,', 'parser.y', 274 def _reduce_92( val, _values) [ val[0].to_i, val[2].to_i ] end .,., -module_eval <<'.,.,', 'parser.y', 270 +module_eval <<'.,.,', 'parser.y', 279 def _reduce_93( val, _values) [ val[0].downcase, val[2].downcase, decode_params(val[3]) ] end .,., -module_eval <<'.,.,', 'parser.y', 274 +module_eval <<'.,.,', 'parser.y', 283 def _reduce_94( val, _values) [ val[0].downcase, nil, decode_params(val[1]) ] end .,., -module_eval <<'.,.,', 'parser.y', 279 +module_eval <<'.,.,', 'parser.y', 288 def _reduce_95( val, _values) {} end .,., -module_eval <<'.,.,', 'parser.y', 283 +module_eval <<'.,.,', 'parser.y', 293 def _reduce_96( val, _values) + val[0][ val[2].downcase ] = ('"' + val[4].to_s + '"') + val[0] + end +.,., + +module_eval <<'.,.,', 'parser.y', 298 + def _reduce_97( val, _values) val[0][ val[2].downcase ] = val[4] val[0] end .,., - # reduce 97 omitted - - # reduce 98 omitted - -module_eval <<'.,.,', 'parser.y', 292 - def _reduce_99( val, _values) +module_eval <<'.,.,', 'parser.y', 303 + def _reduce_98( val, _values) val[0].downcase end .,., -module_eval <<'.,.,', 'parser.y', 297 - def _reduce_100( val, _values) +module_eval <<'.,.,', 'parser.y', 308 + def _reduce_99( val, _values) [ val[0].downcase, decode_params(val[1]) ] end .,., + # reduce 100 omitted + # reduce 101 omitted # reduce 102 omitted @@ -1511,8 +1466,6 @@ module_eval <<'.,.,', 'parser.y', 297 # reduce 108 omitted - # reduce 109 omitted - def _reduce_none( val, _values) val[0] end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y new file mode 100644 index 00000000..77a14577 --- /dev/null +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y @@ -0,0 +1,381 @@ +# +# parser.y +# +# Copyright (c) 1998-2007 Minero Aoki +# +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU Lesser General Public License version 2.1. +# + +class TMail::Parser + + options no_result_var + +rule + + content : DATETIME datetime { val[1] } + | RECEIVED received { val[1] } + | MADDRESS addrs_TOP { val[1] } + | RETPATH retpath { val[1] } + | KEYWORDS keys { val[1] } + | ENCRYPTED enc { val[1] } + | MIMEVERSION version { val[1] } + | CTYPE ctype { val[1] } + | CENCODING cencode { val[1] } + | CDISPOSITION cdisp { val[1] } + | ADDRESS addr_TOP { val[1] } + | MAILBOX mbox { val[1] } + + datetime : day DIGIT ATOM DIGIT hour zone + # 0 1 2 3 4 5 + # date month year + { + t = Time.gm(val[3].to_i, val[2], val[1].to_i, 0, 0, 0) + (t + val[4] - val[5]).localtime + } + + day : /* none */ + | ATOM ',' + + hour : DIGIT ':' DIGIT + { + (val[0].to_i * 60 * 60) + + (val[2].to_i * 60) + } + | DIGIT ':' DIGIT ':' DIGIT + { + (val[0].to_i * 60 * 60) + + (val[2].to_i * 60) + + (val[4].to_i) + } + + zone : ATOM + { + timezone_string_to_unixtime(val[0]) + } + + received : from by via with id for received_datetime + { + val + } + + from : /* none */ + | FROM received_domain + { + val[1] + } + + by : /* none */ + | BY received_domain + { + val[1] + } + + received_domain + : domain + { + join_domain(val[0]) + } + | domain '@' domain + { + join_domain(val[2]) + } + | domain DOMLIT + { + join_domain(val[0]) + } + + via : /* none */ + | VIA ATOM + { + val[1] + } + + with : /* none */ + { + [] + } + | with WITH ATOM + { + val[0].push val[2] + val[0] + } + + id : /* none */ + | ID msgid + { + val[1] + } + | ID ATOM + { + val[1] + } + + for : /* none */ + | FOR received_addrspec + { + val[1] + } + + received_addrspec + : routeaddr + { + val[0].spec + } + | spec + { + val[0].spec + } + + received_datetime + : /* none */ + | ';' datetime + { + val[1] + } + + addrs_TOP : addrs + | group_bare + | addrs commas group_bare + + addr_TOP : mbox + | group + | group_bare + + retpath : addrs_TOP + | '<' '>' { [ Address.new(nil, nil) ] } + + addrs : addr + { + val + } + | addrs commas addr + { + val[0].push val[2] + val[0] + } + + addr : mbox + | group + + mboxes : mbox + { + val + } + | mboxes commas mbox + { + val[0].push val[2] + val[0] + } + + mbox : spec + | routeaddr + | addr_phrase routeaddr + { + val[1].phrase = Decoder.decode(val[0]) + val[1] + } + + group : group_bare ';' + + group_bare: addr_phrase ':' mboxes + { + AddressGroup.new(val[0], val[2]) + } + | addr_phrase ':' { AddressGroup.new(val[0], []) } + + addr_phrase + : local_head { val[0].join('.') } + | addr_phrase local_head { val[0] << ' ' << val[1].join('.') } + + routeaddr : '<' routes spec '>' + { + val[2].routes.replace val[1] + val[2] + } + | '<' spec '>' + { + val[1] + } + + routes : at_domains ':' + + at_domains: '@' domain { [ val[1].join('.') ] } + | at_domains ',' '@' domain { val[0].push val[3].join('.'); val[0] } + + spec : local '@' domain { Address.new( val[0], val[2] ) } + | local { Address.new( val[0], nil ) } + + local: local_head + | local_head '.' { val[0].push ''; val[0] } + + local_head: word + { val } + | local_head dots word + { + val[1].times do + val[0].push '' + end + val[0].push val[2] + val[0] + } + + domain : domword + { val } + | domain dots domword + { + val[1].times do + val[0].push '' + end + val[0].push val[2] + val[0] + } + + dots : '.' { 0 } + | '.' '.' { 1 } + + word : atom + | QUOTED + | DIGIT + + domword : atom + | DOMLIT + | DIGIT + + commas : ',' + | commas ',' + + msgid : '<' spec '>' + { + val[1] = val[1].spec + val.join('') + } + + keys : phrase { val } + | keys ',' phrase { val[0].push val[2]; val[0] } + + phrase : word + | phrase word { val[0] << ' ' << val[1] } + + enc : word + { + val.push nil + val + } + | word word + { + val + } + + version : DIGIT '.' DIGIT + { + [ val[0].to_i, val[2].to_i ] + } + + ctype : TOKEN '/' TOKEN params opt_semicolon + { + [ val[0].downcase, val[2].downcase, decode_params(val[3]) ] + } + | TOKEN params opt_semicolon + { + [ val[0].downcase, nil, decode_params(val[1]) ] + } + + params : /* none */ + { + {} + } + | params ';' TOKEN '=' QUOTED + { + val[0][ val[2].downcase ] = ('"' + val[4].to_s + '"') + val[0] + } + | params ';' TOKEN '=' TOKEN + { + val[0][ val[2].downcase ] = val[4] + val[0] + } + + cencode : TOKEN + { + val[0].downcase + } + + cdisp : TOKEN params opt_semicolon + { + [ val[0].downcase, decode_params(val[1]) ] + } + + opt_semicolon + : + | ';' + + atom : ATOM + | FROM + | BY + | VIA + | WITH + | ID + | FOR + +end + + +---- header +# +# parser.rb +# +# Copyright (c) 1998-2007 Minero Aoki +# +# This program is free software. +# You can distribute/modify this program under the terms of +# the GNU Lesser General Public License version 2.1. +# + +require 'tmail/scanner' +require 'tmail/utils' + +---- inner + + include TextUtils + + def self.parse( ident, str, cmt = nil ) + new.parse(ident, str, cmt) + end + + MAILP_DEBUG = false + + def initialize + self.debug = MAILP_DEBUG + end + + def debug=( flag ) + @yydebug = flag && Racc_debug_parser + @scanner_debug = flag + end + + def debug + @yydebug + end + + def parse( ident, str, comments = nil ) + @scanner = Scanner.new(str, ident, comments) + @scanner.debug = @scanner_debug + @first = [ident, ident] + result = yyparse(self, :parse_in) + comments.map! {|c| to_kcode(c) } if comments + result + end + + private + + def parse_in( &block ) + yield @first + @scanner.scan(&block) + end + + def on_error( t, val, vstack ) + raise SyntaxError, "parse error on token #{racc_token2str t}" + end + diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/port.rb similarity index 99% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/port.rb index f973c05b..445f0e63 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/port.rb @@ -1,6 +1,8 @@ -# -# port.rb -# +=begin rdoc + += Port class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb similarity index 91% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb index 69424234..0b2d11c3 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb @@ -1,3 +1,8 @@ +=begin rdoc + += Quoting methods + +=end module TMail class Mail def subject(to_charset = 'utf-8') @@ -8,6 +13,12 @@ module TMail from_charset = sub_header("content-type", "charset") case (content_transfer_encoding || "7bit").downcase when "quoted-printable" + # the default charset is set to iso-8859-1 instead of 'us-ascii'. + # This is needed as many mailer do not set the charset but send in ISO. This is only used if no charset is set. + if !from_charset.blank? && from_charset.downcase == 'us-ascii' + from_charset = 'iso-8859-1' + end + Unquoter.unquote_quoted_printable_and_convert_to(quoted_body, to_charset, from_charset, true) when "base64" @@ -78,7 +89,7 @@ module TMail end def unquote_base64_and_convert_to(text, to, from) - convert_to(Base64.decode(text).first, to, from) + convert_to(Base64.decode(text), to, from) end begin diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb similarity index 97% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb index 839dd793..9216b430 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb @@ -1,6 +1,8 @@ -# -# scanner.rb -# +=begin rdoc + += Scanner for TMail + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb similarity index 99% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb index ccf576c2..d9169c53 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb @@ -44,7 +44,7 @@ module TMail } alnum = 'a-zA-Z0-9' - atomsyms = %q[ _#!$%&`'*+-{|}~^@/=? ].strip + atomsyms = %q[ _#!$%&`'*+-{|}~^/=? ].strip tokensyms = %q[ _#!$%&`'*+-{|}~^@. ].strip atomchars = alnum + Regexp.quote(atomsyms) diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb similarity index 97% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb index 532be3db..3817850f 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb @@ -1,6 +1,8 @@ -# -# stringio.rb -# +=begin rdoc + += String handling class + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # @@ -218,7 +220,7 @@ class StringOutput#:nodoc: alias pos size def inspect - "#<#{self.class}:#{@dest ? 'open' : 'closed'},#{id}>" + "#<#{self.class}:#{@dest ? 'open' : 'closed'},#{object_id}>" end def print( *args ) diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/tmail.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb similarity index 100% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/tmail.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/tmail.rb diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb similarity index 74% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb index 852acd75..016330ff 100755 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb @@ -1,6 +1,8 @@ -# -# utils.rb -# +=begin rdoc + += General Purpose TMail Utilities + +=end #-- # Copyright (c) 1998-2003 Minero Aoki # @@ -52,9 +54,9 @@ module TMail @uniq = 0 - module TextUtils - + # Defines characters per RFC that are OK for TOKENs, ATOMs, PHRASEs and CONTROL characters. + aspecial = '()<>[]:;.\\,"' tspecial = '()<>[];:\\,"/?=' lwsp = " \t\r\n" @@ -66,31 +68,50 @@ module TMail CONTROL_CHAR = /[#{control}]/n def atom_safe?( str ) + # Returns true if the string supplied is free from characters not allowed as an ATOM not ATOM_UNSAFE === str end def quote_atom( str ) + # If the string supplied has ATOM unsafe characters in it, will return the string quoted + # in double quotes, otherwise returns the string unmodified (ATOM_UNSAFE === str) ? dquote(str) : str end def quote_phrase( str ) + # If the string supplied has PHRASE unsafe characters in it, will return the string quoted + # in double quotes, otherwise returns the string unmodified (PHRASE_UNSAFE === str) ? dquote(str) : str end def token_safe?( str ) + # Returns true if the string supplied is free from characters not allowed as a TOKEN not TOKEN_UNSAFE === str end def quote_token( str ) + # If the string supplied has TOKEN unsafe characters in it, will return the string quoted + # in double quotes, otherwise returns the string unmodified (TOKEN_UNSAFE === str) ? dquote(str) : str end def dquote( str ) - '"' + str.gsub(/["\\]/n) {|s| '\\' + s } + '"' + # Wraps supplied string in double quotes unless it is already wrapped + # Returns double quoted string + unless str =~ /^".*?"$/ + '"' + str.gsub(/["\\]/n) {|s| '\\' + s } + '"' + else + str + end end private :dquote - + def unquote( str ) + # Unwraps supplied string from inside double quotes + # Returns unquoted string + str =~ /^"(.*?)"$/ ? $1 : str + end + def join_domain( arr ) arr.map {|i| if /\A\[.*\]\z/ === i @@ -149,6 +170,7 @@ module TMail } def timezone_string_to_unixtime( str ) + # Takes a time zone string from an EMail and converts it to Unix Time (seconds) if m = /([\+\-])(\d\d?)(\d\d)/.match(str) sec = (m[2].to_i * 60 + m[3].to_i) * 60 m[1] == '-' ? -sec : sec @@ -233,6 +255,27 @@ module TMail end end + def quote_boundary + # Make sure the Content-Type boundary= parameter is quoted if it contains illegal characters + # (to ensure any special characters in the boundary text are escaped from the parser + # (such as = in MS Outlook's boundary text)) + if @body =~ /^(.*)boundary=(.*)$/m + preamble = $1 + remainder = $2 + if remainder =~ /;/ + remainder =~ /^(.*)(;.*)$/m + boundary_text = $1 + post = $2.chomp + else + boundary_text = remainder.chomp + end + if boundary_text =~ /[\/\?\=]/ + boundary_text = "\"#{boundary_text}\"" unless boundary_text =~ /^".*?"$/ + @body = "#{preamble}boundary=#{boundary_text}#{post}" + end + end + end + end end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb old mode 100755 new mode 100644 similarity index 57% rename from vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb rename to vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb index 8f89a489..14df4b06 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb @@ -1,5 +1,5 @@ # -# base64.rb +# version.rb # #-- # Copyright (c) 1998-2003 Minero Aoki @@ -27,45 +27,12 @@ # with permission of Minero Aoki. #++ -module TMail - - module Base64 - - module_function - - def rb_folding_encode( str, eol = "\n", limit = 60 ) - [str].pack('m') - end - - def rb_encode( str ) - [str].pack('m').tr( "\r\n", '' ) - end - - def rb_decode( str, strict = false ) - str.unpack('m') - end - - begin - require 'tmail/base64.so' - alias folding_encode c_folding_encode - alias encode c_encode - alias decode c_decode - class << self - alias folding_encode c_folding_encode - alias encode c_encode - alias decode c_decode - end - rescue LoadError - alias folding_encode rb_folding_encode - alias encode rb_encode - alias decode rb_decode - class << self - alias folding_encode rb_folding_encode - alias encode rb_encode - alias decode rb_decode - end - end +module TMail #:nodoc: + module VERSION #:nodoc: + MAJOR = 1 + MINOR = 1 + TINY = 1 + STRING = [MAJOR, MINOR, TINY].join('.') end - end diff --git a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb b/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb deleted file mode 100755 index 8cea88d3..00000000 --- a/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'tmail/info' -require 'tmail/mail' -require 'tmail/mailbox' diff --git a/vendor/rails/actionmailer/lib/action_mailer/version.rb b/vendor/rails/actionmailer/lib/action_mailer/version.rb index 498af239..954a4727 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/version.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/version.rb @@ -1,8 +1,8 @@ module ActionMailer module VERSION #:nodoc: - MAJOR = 1 - MINOR = 3 - TINY = 5 + MAJOR = 2 + MINOR = 0 + TINY = 2 STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/vendor/rails/actionmailer/lib/actionmailer.rb b/vendor/rails/actionmailer/lib/actionmailer.rb new file mode 100644 index 00000000..50641629 --- /dev/null +++ b/vendor/rails/actionmailer/lib/actionmailer.rb @@ -0,0 +1 @@ +require 'action_mailer' diff --git a/vendor/rails/actionmailer/test/abstract_unit.rb b/vendor/rails/actionmailer/test/abstract_unit.rb index 8a30e39a..9b7a4661 100644 --- a/vendor/rails/actionmailer/test/abstract_unit.rb +++ b/vendor/rails/actionmailer/test/abstract_unit.rb @@ -2,6 +2,7 @@ require 'test/unit' $:.unshift "#{File.dirname(__FILE__)}/../lib" require 'action_mailer' +require 'action_mailer/test_case' # Show backtraces for deprecated behavior for quicker cleanup. ActiveSupport::Deprecation.debug = true @@ -28,3 +29,21 @@ class Net::SMTP yield MockSMTP.new end end + +# Wrap tests that use Mocha and skip if unavailable. +def uses_mocha(test_name) + gem 'mocha', ">=0.5" + require 'stubba' + yield +rescue Gem::LoadError + $stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again." +end + +def set_delivery_method(delivery_method) + @old_delivery_method = ActionMailer::Base.delivery_method + ActionMailer::Base.delivery_method = delivery_method +end + +def restore_delivery_method + ActionMailer::Base.delivery_method = @old_delivery_method +end diff --git a/vendor/rails/actionmailer/test/delivery_method_test.rb b/vendor/rails/actionmailer/test/delivery_method_test.rb new file mode 100644 index 00000000..ebee2356 --- /dev/null +++ b/vendor/rails/actionmailer/test/delivery_method_test.rb @@ -0,0 +1,51 @@ +require "#{File.dirname(__FILE__)}/abstract_unit" + +class DefaultDeliveryMethodMailer < ActionMailer::Base +end + +class NonDefaultDeliveryMethodMailer < ActionMailer::Base + self.delivery_method = :sendmail +end + +class ActionMailerBase_delivery_method_Test < Test::Unit::TestCase + def setup + set_delivery_method :smtp + end + + def teardown + restore_delivery_method + end + + def test_should_be_the_default_smtp + assert_equal :smtp, ActionMailer::Base.delivery_method + end +end + +class DefaultDeliveryMethodMailer_delivery_method_Test < Test::Unit::TestCase + def setup + set_delivery_method :smtp + end + + def teardown + restore_delivery_method + end + + def test_should_be_the_default_smtp + assert_equal :smtp, DefaultDeliveryMethodMailer.delivery_method + end +end + +class NonDefaultDeliveryMethodMailer_delivery_method_Test < Test::Unit::TestCase + def setup + set_delivery_method :smtp + end + + def teardown + restore_delivery_method + end + + def test_should_be_the_set_delivery_method + assert_equal :sendmail, NonDefaultDeliveryMethodMailer.delivery_method + end +end + diff --git a/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb b/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb new file mode 100644 index 00000000..da43638c --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb @@ -0,0 +1 @@ +first mail diff --git a/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml b/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml index da43638c..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml @@ -1 +0,0 @@ -first mail diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb new file mode 100644 index 00000000..fcff3bb1 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb @@ -0,0 +1 @@ +So, <%= example_format(@text) %> diff --git a/vendor/rails/railties/test/generators/missing_class/missing_class_generator.rb b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml similarity index 100% rename from vendor/rails/railties/test/generators/missing_class/missing_class_generator.rb rename to vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb new file mode 100644 index 00000000..378777f8 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb @@ -0,0 +1 @@ +Hello, <%= person_name %>. Thanks for registering! diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml index 378777f8..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml @@ -1 +0,0 @@ -Hello, <%= person_name %>. Thanks for registering! diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb new file mode 100644 index 00000000..d5b8b285 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb @@ -0,0 +1 @@ +This message brought to you by <%= name_of_the_mailer_class %>. diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml index d5b8b285..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml @@ -1 +0,0 @@ -This message brought to you by <%= name_of_the_mailer_class %>. diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb new file mode 100644 index 00000000..96ec49d1 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb @@ -0,0 +1,5 @@ +From "Romeo and Juliet": + +<%= block_format @text %> + +Good ol' Shakespeare. diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml index 96ec49d1..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml @@ -1,5 +0,0 @@ -From "Romeo and Juliet": - -<%= block_format @text %> - -Good ol' Shakespeare. diff --git a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_test_helper.rhtml b/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_test_helper.rhtml deleted file mode 100644 index 52ea9aa4..00000000 --- a/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_test_helper.rhtml +++ /dev/null @@ -1 +0,0 @@ -So, <%= test_format(@text) %> diff --git a/vendor/rails/actionmailer/test/fixtures/helpers/test_helper.rb b/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb similarity index 57% rename from vendor/rails/actionmailer/test/fixtures/helpers/test_helper.rb rename to vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb index f479820c..d66927aa 100644 --- a/vendor/rails/actionmailer/test/fixtures/helpers/test_helper.rb +++ b/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb @@ -1,5 +1,5 @@ -module TestHelper - def test_format(text) +module ExampleHelper + def example_format(text) "#{text}" end end diff --git a/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb b/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb new file mode 100644 index 00000000..897a5065 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb @@ -0,0 +1 @@ +Have a lovely picture, from me. Enjoy! \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml b/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml index 897a5065..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml @@ -1 +0,0 @@ -Have a lovely picture, from me. Enjoy! \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string b/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string new file mode 100644 index 00000000..99b00ea1 Binary files /dev/null and b/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string differ diff --git a/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string b/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string new file mode 100644 index 00000000..eacca525 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string @@ -0,0 +1 @@ +R0lGODlhSwF3APcAAP/////39/j29f/v7vfv7u/v7//m5f7k4vfl5f/e3vff3/Lh4f/a2PXb2N/f3/fW1v/V1PDU0/TTz/fPzv/MzO/OzfHLx/fHxv/Fw//Cv+7ExO/EwMzMzPi/vfW8tPG8vO28t/+3tee9vfe1svC1tb+/v+e1tfCzr/+uq+izrO+urueurv+mpt+ureerpe6lpeilpf+ZzOaknd2lpK+vr/+Zme+dneadnOCdnOealv+Rjd+alu+VleaVlN2VlPeNi8yZmdeUk/CLi+aNjN+PjeaMh8GUlNaPjf+ChfiDg9+Kgs+NivCEhJmZmfd/etGKh+aDg/97e96Dg92Eeu99euZ8fNWBf/9zc917ePdzc+V5dtd8eo+Pj+51ctB9e+dzct91cL98fO9sbf9mZs9zbNZxceZsauhqZN1rZt9qatRtZexkZdBtYtdqan9/f8JubuhiX95kYdZkYcxmZt9hWqpsbN5cWd5aU+VXUNRZWbxgYOBSS8lYTtRTUsBZV8dUSd1LUaVaWtxKQ85LS2ZmZtVHRN9DO71KStlCOtBAPb5ERMRCQtg7M+U0PMk9PdQ5OZVHR98xMdgxMdsvKrI6OswzM7s2MNsqKk9PT7Y1K6o3N90nHtYpIdApKbQvL9ckLN4hIcwnI7MtIt4gG+gdHdYiGbspJtMgILIpKc4gF9ccGLUkH84bG80dEL8gIMIfGD8/P8QbG4sqKqwiGcwYD4QpKcYYEKchGc4TD7MaFsUUFNcQBr0WEuANDaYdEuAKAMQQB7wREYwdGqAXEDMzM74OCbMQEM4JANYFA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nXBClww4QmbgAQk8AB6QfCBDRTZyEW2/4AGknwBDGCgwzwccZQPiIAfV/kEJ1iBCVCwZS53mcs1fq0NbGxj+4rXxCtQQZazbAI2e6ADb+6ACDSgZCVbwM4VsACe82yBCVDAzxkYqZQFXb0AfIAEhvbAj9HrXkY3utEjKPN9y3xiE1/5yj5mM5uHDGc40xnPFaiABEQtgQiQmtQPkAAFJAABCsR30K8e3QVUsIEP1HrTTcZ1rnU9ghOQwNJXHoGvq0yCIX8gvSIg8psv0IELNPsCFMgzqCMw7Qc8oAHXxja2GfCABDwAArAG99wS8IIOWOACRN4ABVjtZ3a3u92GPvShaz3vWtP6yM328wQuMAF+81vV045AA/8Cfm0FFLzgCDB4wROgAAbwNtwPN1oARjCCC1TgAkpmwAESkAAGdNzjH2dAAijAYWZ3QAMXMPLFL2DnfbO7396WQLUfsG2CN2ABClhAzhGwc57v3AAIOMABFOBwiBf9YxRAQQcmIIEKPGAATzfAAAwwdaobIOhXnwCfVz4Bi2e93+1etcwZ0ICxM0ABC094z3s+AAIggO0GIADcox5oo9edXgfoAAYoYG0DOAQAAQA84J8+eMIbQAITQPXhZe5txo+d42cv+NUlz/O2I4AAl8c8Adi+ec6z3e6fl9cA2q0Av5fe9KcHgAGqne2Nt37jChD61as+dalL/fKb1/zmBTBdgN0LIAC+/z3vBwBl0BdfVwmAAAMgcADUN9/0CJd80GdPdalHnfCEz33vf7994AM/8N8nvvHFP6gBZDwBAzC94AkfgOZX3/rWv378nx6A4Q8f8N4PvEMAP37+6ykgADs= \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/raw_email11 b/vendor/rails/actionmailer/test/fixtures/raw_email11 deleted file mode 100644 index 8af74b87..00000000 --- a/vendor/rails/actionmailer/test/fixtures/raw_email11 +++ /dev/null @@ -1,34 +0,0 @@ -From xxx@xxxx.com Wed Apr 27 14:15:31 2005 -Mime-Version: 1.0 (Apple Message framework v619.2) -To: xxxxx@xxxxx -Message-Id: <416eaebec6d333ec6939eaf8a7d80724@xxxxx> -Content-Type: multipart/alternative; - boundary=Apple-Mail-5-1037861608 -From: xxxxx@xxxxx -Subject: worse when you use them. -Date: Wed, 27 Apr 2005 14:15:31 -0700 - - - - ---Apple-Mail-5-1037861608 -Content-Transfer-Encoding: 7bit -Content-Type: text/plain; - charset=US-ASCII; - format=flowed - - -XXXXX Xxxxx - ---Apple-Mail-5-1037861608 -Content-Transfer-Encoding: 7bit -Content-Type: text/enriched; - charset=US-ASCII - - - -XXXXX Xxxxx - - ---Apple-Mail-5-1037861608-- - diff --git a/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type b/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type new file mode 100644 index 00000000..a8ff7ed4 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type @@ -0,0 +1,104 @@ +Return-Path: +Received: from some.isp.com by baci with ESMTP id 632BD5758 for ; Sun, 21 Oct 2007 19:38:21 +1000 +Date: Sun, 21 Oct 2007 19:38:13 +1000 +From: Mikel Lindsaar +Reply-To: Mikel Lindsaar +To: mikel.lindsaar@baci +Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> +Subject: Testing outlook +Mime-Version: 1.0 +Content-Type: multipart/alternative; boundary=----=_NextPart_000_0093_01C81419.EB75E850 +Delivered-To: mikel.lindsaar@baci +X-Mimeole: Produced By Microsoft MimeOLE V6.00.2900.3138 +X-Msmail-Priority: Normal + +This is a multi-part message in MIME format. + + +------=_NextPart_000_0093_01C81419.EB75E850 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: Quoted-printable + +Hello +This is an outlook test + +So there. + +Me. + +------=_NextPart_000_0093_01C81419.EB75E850 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: Quoted-printable + + + + + + + + +
Hello
+
This is an outlook=20 +test
+
 
+
So there.
+
 
+
Me.
+ + +------=_NextPart_000_0093_01C81419.EB75E850-- + + +Return-Path: +Received: from some.isp.com by baci with ESMTP id 632BD5758 for ; Sun, 21 Oct 2007 19:38:21 +1000 +Date: Sun, 21 Oct 2007 19:38:13 +1000 +From: Mikel Lindsaar +Reply-To: Mikel Lindsaar +To: mikel.lindsaar@baci +Message-Id: <009601c813c6$19df3510$0437d30a@mikel091a> +Subject: Testing outlook +Mime-Version: 1.0 +Content-Type: multipart/alternative; boundary=----=_NextPart_000_0093_01C81419.EB75E850 +Delivered-To: mikel.lindsaar@baci +X-Mimeole: Produced By Microsoft MimeOLE V6.00.2900.3138 +X-Msmail-Priority: Normal + +This is a multi-part message in MIME format. + + +------=_NextPart_000_0093_01C81419.EB75E850 +Content-Type: text/plain; charset=iso-8859-1 +Content-Transfer-Encoding: Quoted-printable + +Hello +This is an outlook test + +So there. + +Me. + +------=_NextPart_000_0093_01C81419.EB75E850 +Content-Type: text/html; charset=iso-8859-1 +Content-Transfer-Encoding: Quoted-printable + + + + + + + + +
Hello
+
This is an outlook=20 +test
+
 
+
So there.
+
 
+
Me.
+ + +------=_NextPart_000_0093_01C81419.EB75E850-- + + diff --git a/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment b/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment new file mode 100644 index 00000000..429c408c --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment @@ -0,0 +1,100 @@ +From jamis@37signals.com Thu Feb 22 11:20:31 2007 +Mime-Version: 1.0 (Apple Message framework v752.3) +Message-Id: <2CCE0408-10C7-4045-9B16-A1C11C31469B@37signals.com> +Content-Type: multipart/signed; + micalg=sha1; + boundary=Apple-Mail-42-587703407; + protocol="application/pkcs7-signature" +To: Jamis Buck +Subject: Testing attachments +From: Jamis Buck +Date: Thu, 22 Feb 2007 11:20:31 -0700 + + +--Apple-Mail-42-587703407 +Content-Type: multipart/mixed; + boundary=Apple-Mail-41-587703287 + + +--Apple-Mail-41-587703287 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=US-ASCII; + format=flowed + +Here is a test of an attachment via email. + +- Jamis + + +--Apple-Mail-41-587703287 +Content-Transfer-Encoding: base64 +Content-Type: image/png; + x-unix-mode=0644; + name=byo-ror-cover.png +Content-Disposition: inline; + filename=truncated.png + +iVBORw0KGgoAAAANSUhEUgAAAKUAAADXCAYAAAB7wZEQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz +AAALEgAACxIB0t1+/AAAABd0RVh0Q3JlYXRpb24gVGltZQAxLzI1LzIwMDeD9CJVAAAAGHRFWHRT +b2Z0d2FyZQBBZG9iZSBGaXJld29ya3NPsx9OAAAyBWlUWHRYTUw6Y29tLmFkb2JlLnhtcDw/eHBh +Y2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1l +dGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDQuMS1j +MDIwIDEuMjU1NzE2LCBUdWUgT2N0IDEwIDIwMDYgMjM6MTY6MzQiPgogICA8cmRmOlJERiB4bWxu +czpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAg +ICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4YXA9Imh0 +dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iPgogICAgICAgICA8eGFwOkNyZWF0b3JUb29sPkFk +b2JlIEZpcmV3b3JrcyBDUzM8L3hhcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhhcDpDcmVhdGVE +YXRlPjIwMDctMDEtMjVUMDU6Mjg6MjFaPC94YXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhhcDpN +b2RpZnlEYXRlPjIwMDctMDEtMjVUMDU6Mjg6MjFaPC94YXA6TW9kaWZ5RGF0ZT4KICAgICAgPC9y +ZGY6RGVzY3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AZUDanbJs3jQhITZEgdarZK+cO6ySlL13rut5nFaN23s7u3Snz6eRPTkCoc2/ +Vp1zHfZVFpZ87FiMVLV1iqyK5rlzfji2GzjfDsodlD+Weo5UD4h6PwKqzQMqID0tq2VjjFVSMpis +ZLRAs7sePZBZAHI+gIanB8I7MD+femAceeUe2Kxa5jS950kZ1p5eNEdeX1+jFmSpZ+1EdWCsDcne +NPNgUHNw3aYpnzv9PGTX0uo94EtN9qq1rOdxe3kc79T8ukeHJJ8Fnxej6qlylbLLsjQLOy6Xy2a1 +kefs/N+nM7+S7IG5/E5Yc7F003pWErLjbH0O5cGadiMptSB/DZ5U5DI9yeg5MFYyMj8lC/Y7/Xjq +OZlWcnpg9aQfXz2HRq+Wn5xOp6gN8tWq8R44e2pfyzLYemEgprst+XXk2Zj2nXlbsG05BprndTMv +C3QRaXczshhVsHnMgfYn80Y2g5JureA6wBasPeP7LkE/jvZMJAaf/g/U2RelHsisvan5FqweIAHg +Pwc7L68GxvVDAAAAAElFTkSuQmCC + +--Apple-Mail-41-587703287-- + +--Apple-Mail-42-587703407 +Content-Transfer-Encoding: base64 +Content-Type: application/pkcs7-signature; + name=smime.p7s +Content-Disposition: attachment; + filename=smime.p7s + +MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGJzCCAuAw +ggJJoAMCAQICEFjnFNYXwDEZRWY5EkfzopUwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx +JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ +ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MDkxMjE3MDExMloXDTA3MDkxMjE3MDEx +MlowRTEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEiMCAGCSqGSIb3DQEJARYTamFt +aXNAMzdzaWduYWxzLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO2A9JeOFIFJ +G6z8pTcAldrZ2nMe+Xb1tNrbHgoVzN/QhHXM4qst2Ml93cmFLjMmwG7P9RJeU4oNx+jTqVoBB7NV +Ne1/o56Do0KhfMZ9iUDQdPLbkZMq4EEpFMdm6PyM3muRKwPhj66iAWe/osCb8DowUK2f66vaRx0Z +Y0MQHIIrXE02Ta4IfAhIfPqBLkZ4WgTYBHN9vMdYea1jF0GO4gqGk1wqwb3yxv2QMYMbwJ6SI+k/ +ZjkSR/OilTCBhwYLKoZIhvcNAQkQAgsxeKB2MGIxCzAJBgNVBAYTAlpBMSUwIwYDVQQKExxUaGF3 +dGUgQ29uc3VsdGluZyAoUHR5KSBMdGQuMSwwKgYDVQQDEyNUaGF3dGUgUGVyc29uYWwgRnJlZW1h +aWwgSXNzdWluZyBDQQIQWOcU1hfAMRlFZjkSR/OilTANBgkqhkiG9w0BAQEFAASCAQCfwQiC3v6/ +yleRDGv3bJ4nQYQ+c3mz3+mn3Xi6uU35n3piwxZZaWRdmLyiXPvU+QReHpSf3l2qsEZM3sdE0XF9 +eRul/+QTFJcDNXOEAxG1zC2Gpz+6c6RrX4Ou12Pwkp+pNrZWTSY/mZgdqcArupOBcZi7qBjoWcy5 +wb54dfvSSjrjmqLbkH/E8ww/6gGQuU/xXpAUZgUrTmQHrNKeIdSh5oDkOxFaFWvnmb8Z/2ixKqW/ +Ux6WqamyvBtTs/5YBEtnpZOk+uVoscYEUBhU+DVJ2OSvTdXSivMtBdXmGTsG22k+P1NGUHi/A7ev +xPaO0uk4V8xyjNlN4HPuGpkrlXwPAAAAAAAA + +--Apple-Mail-42-587703407-- diff --git a/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb b/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb new file mode 100644 index 00000000..9a540106 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb @@ -0,0 +1 @@ +second mail diff --git a/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml b/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml index 9a540106..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml @@ -1 +0,0 @@ -second mail diff --git a/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb b/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb new file mode 100644 index 00000000..a85d5fa4 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb @@ -0,0 +1,3 @@ +Hello there, + +Mr. <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml b/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml index a85d5fa4..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml @@ -1,3 +0,0 @@ -Hello there, - -Mr. <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb new file mode 100644 index 00000000..3b4ba35f --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb @@ -0,0 +1 @@ +let's go! \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml b/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml new file mode 100644 index 00000000..847d065c --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml @@ -0,0 +1,6 @@ +%p Hello there, + +%p + Mr. + = @recipient + from haml \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml b/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml new file mode 100644 index 00000000..847d065c --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml @@ -0,0 +1,6 @@ +%p Hello there, + +%p + Mr. + = @recipient + from haml \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb new file mode 100644 index 00000000..6940419d --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb @@ -0,0 +1 @@ +Ignored when searching for implicitly multipart parts. diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml index 6940419d..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml @@ -1 +0,0 @@ -Ignored when searching for implicitly multipart parts. diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb new file mode 100644 index 00000000..946d99ed --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb @@ -0,0 +1,10 @@ + + + HTML formatted message to <%= @recipient %>. + + + + + HTML formatted message to <%= @recipient %>. + + diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml index 946d99ed..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml @@ -1,10 +0,0 @@ - - - HTML formatted message to <%= @recipient %>. - - - - - HTML formatted message to <%= @recipient %>. - - diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb new file mode 100644 index 00000000..a6c8d54c --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb @@ -0,0 +1,2 @@ +Plain text to <%= @recipient %>. +Plain text to <%= @recipient %>. diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml index a6c8d54c..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml @@ -1,2 +0,0 @@ -Plain text to <%= @recipient %>. -Plain text to <%= @recipient %>. diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb new file mode 100644 index 00000000..c14348c7 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb @@ -0,0 +1 @@ +yaml to: <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml index c14348c7..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml @@ -1 +0,0 @@ -yaml to: <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb new file mode 100644 index 00000000..a93c30ea --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb @@ -0,0 +1 @@ +Hey Ho, <%= render :partial => "subtemplate" %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder b/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder new file mode 100644 index 00000000..d566bd8d --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder @@ -0,0 +1,2 @@ +xml.instruct! +xml.test \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml b/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml new file mode 100644 index 00000000..d566bd8d --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml @@ -0,0 +1,2 @@ +xml.instruct! +xml.test \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb new file mode 100644 index 00000000..a85d5fa4 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb @@ -0,0 +1,3 @@ +Hello there, + +Mr. <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml index a85d5fa4..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml @@ -1,3 +0,0 @@ -Hello there, - -Mr. <%= @recipient %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb new file mode 100644 index 00000000..4c5806d3 --- /dev/null +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb @@ -0,0 +1,5 @@ +Hello there, + +Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> <%= welcome_url %> + +<%= image_tag "somelogo.png" %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml index e8fb65d4..e69de29b 100644 --- a/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +++ b/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml @@ -1,3 +0,0 @@ -Hello there, - -Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file diff --git a/vendor/rails/actionmailer/test/mail_helper_test.rb b/vendor/rails/actionmailer/test/mail_helper_test.rb index 19f3707d..70e5cb81 100644 --- a/vendor/rails/actionmailer/test/mail_helper_test.rb +++ b/vendor/rails/actionmailer/test/mail_helper_test.rb @@ -8,7 +8,7 @@ end class HelperMailer < ActionMailer::Base helper MailerHelper - helper :test + helper :example def use_helper(recipient) recipients recipient @@ -16,7 +16,7 @@ class HelperMailer < ActionMailer::Base from "tester@example.com" end - def use_test_helper(recipient) + def use_example_helper(recipient) recipients recipient subject "using helpers" from "tester@example.com" @@ -60,20 +60,24 @@ class MailerHelperTest < Test::Unit::TestCase end def setup - ActionMailer::Base.delivery_method = :test + set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @recipient = 'test@localhost' end - + + def teardown + restore_delivery_method + end + def test_use_helper mail = HelperMailer.create_use_helper(@recipient) assert_match %r{Mr. Joe Person}, mail.encoded end - def test_use_test_helper - mail = HelperMailer.create_use_test_helper(@recipient) + def test_use_example_helper + mail = HelperMailer.create_use_example_helper(@recipient) assert_match %r{emphasize me!}, mail.encoded end diff --git a/vendor/rails/actionmailer/test/mail_render_test.rb b/vendor/rails/actionmailer/test/mail_render_test.rb index 42454fef..475735e7 100644 --- a/vendor/rails/actionmailer/test/mail_render_test.rb +++ b/vendor/rails/actionmailer/test/mail_render_test.rb @@ -15,6 +15,25 @@ class RenderMailer < ActionMailer::Base body render(:file => "signed_up", :body => { :recipient => recipient }) end + def rxml_template(recipient) + recipients recipient + subject "rendering rxml template" + from "tester@example.com" + end + + def included_subtemplate(recipient) + recipients recipient + subject "Including another template in the one being rendered" + from "tester@example.com" + end + + def included_old_subtemplate(recipient) + recipients recipient + subject "Including another template in the one being rendered" + from "tester@example.com" + body render(:inline => "Hello, <%= render \"subtemplate\" %>", :body => { :world => "Earth" }) + end + def initialize_defaults(method_name) super mailer_name "test_mailer" @@ -39,13 +58,17 @@ end class RenderHelperTest < Test::Unit::TestCase def setup - ActionMailer::Base.delivery_method = :test + set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @recipient = 'test@localhost' end + def teardown + restore_delivery_method + end + def test_inline_template mail = RenderMailer.create_inline_template(@recipient) assert_equal "Hello, Earth", mail.body.strip @@ -55,17 +78,37 @@ class RenderHelperTest < Test::Unit::TestCase mail = RenderMailer.create_file_template(@recipient) assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip end + + def test_rxml_template + mail = RenderMailer.deliver_rxml_template(@recipient) + assert_equal "\n", mail.body.strip + end + + def test_included_subtemplate + mail = RenderMailer.deliver_included_subtemplate(@recipient) + assert_equal "Hey Ho, let's go!", mail.body.strip + end + + def test_deprecated_old_subtemplate + assert_raises ActionView::ActionViewError do + RenderMailer.deliver_included_old_subtemplate(@recipient) + end + end end class FirstSecondHelperTest < Test::Unit::TestCase def setup - ActionMailer::Base.delivery_method = :test + set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @recipient = 'test@localhost' end + def teardown + restore_delivery_method + end + def test_ordering mail = FirstMailer.create_share(@recipient) assert_equal "first mail", mail.body.strip diff --git a/vendor/rails/actionmailer/test/mail_service_test.rb b/vendor/rails/actionmailer/test/mail_service_test.rb index 31a871a0..eb408f96 100755 --- a/vendor/rails/actionmailer/test/mail_service_test.rb +++ b/vendor/rails/actionmailer/test/mail_service_test.rb @@ -172,6 +172,15 @@ class TestMailer < ActionMailer::Base body["recipient"] = recipient end + def custom_templating_extension(recipient) + recipients recipient + subject "[Signed up] Welcome #{recipient}" + from "system@loudthinking.com" + sent_on Time.local(2004, 12, 12) + + body["recipient"] = recipient + end + def various_newlines(recipient) recipients recipient subject "various newlines" @@ -201,6 +210,16 @@ class TestMailer < ActionMailer::Base attachment :content_type => "application/octet-stream",:filename => "test.txt", :body => "test abcdefghijklmnopqstuvwxyz" end + def nested_multipart_with_body(recipient) + recipients recipient + subject "nested multipart with body" + from "test@example.com" + content_type "multipart/mixed" + part :content_type => "multipart/alternative", :content_disposition => "inline", :body => "Nothing to see here." do |p| + p.part :content_type => "text/html", :body => "test HTML
" + end + end + def attachment_with_custom_header(recipient) recipients recipient subject "custom header in attachment" @@ -236,6 +255,14 @@ class TestMailer < ActionMailer::Base body "testing" end + def return_path + recipients "no.one@nowhere.test" + subject "return path test" + from "some.one@somewhere.test" + body "testing" + headers "return-path" => "another@somewhere.test" + end + class <", mail['return-path'].to_s + end + + def test_return_path_with_deliver + ActionMailer::Base.delivery_method = :smtp + TestMailer.deliver_return_path + assert_match %r{^Return-Path: }, MockSMTP.deliveries[0][0] end end +end # uses_mocha + class InheritableTemplateRootTest < Test::Unit::TestCase def test_attr expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" @@ -814,3 +911,29 @@ class InheritableTemplateRootTest < Test::Unit::TestCase assert_equal expected, FunkyPathMailer.template_root end end + +class MethodNamingTest < Test::Unit::TestCase + class TestMailer < ActionMailer::Base + def send + body 'foo' + end + end + + def setup + set_delivery_method :test + ActionMailer::Base.perform_deliveries = true + ActionMailer::Base.deliveries = [] + end + + def teardown + restore_delivery_method + end + + def test_send_method + assert_nothing_raised do + assert_emails 1 do + TestMailer.deliver_send + end + end + end +end diff --git a/vendor/rails/actionmailer/test/quoting_test.rb b/vendor/rails/actionmailer/test/quoting_test.rb index 77bd769b..14981571 100644 --- a/vendor/rails/actionmailer/test/quoting_test.rb +++ b/vendor/rails/actionmailer/test/quoting_test.rb @@ -3,6 +3,44 @@ require 'tmail' require 'tempfile' class QuotingTest < Test::Unit::TestCase + + # Move some tests from TMAIL here + def test_unquote_quoted_printable + a ="=?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?=" + b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') + assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b + end + + def test_unquote_base64 + a ="=?ISO-8859-1?B?WzE2NjQxN10gQmVrcuZmdGVsc2UgZnJhIFJlanNlZmViZXI=?=" + b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') + assert_equal "[166417] Bekr\303\246ftelse fra Rejsefeber", b + end + + def test_unquote_without_charset + a ="[166417]_Bekr=E6ftelse_fra_Rejsefeber" + b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') + assert_equal "[166417]_Bekr=E6ftelse_fra_Rejsefeber", b + end + + def test_unqoute_multiple + a ="=?utf-8?q?Re=3A_=5B12=5D_=23137=3A_Inkonsistente_verwendung_von_=22Hin?==?utf-8?b?enVmw7xnZW4i?=" + b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') + assert_equal "Re: [12] #137: Inkonsistente verwendung von \"Hinzuf\303\274gen\"", b + end + + def test_unqoute_in_the_middle + a ="Re: Photos =?ISO-8859-1?Q?Brosch=FCre_Rand?=" + b = TMail::Unquoter.unquote_and_convert_to(a, 'utf-8') + assert_equal "Re: Photos Brosch\303\274re Rand", b + end + + def test_unqoute_iso + a ="=?ISO-8859-1?Q?Brosch=FCre_Rand?=" + b = TMail::Unquoter.unquote_and_convert_to(a, 'iso-8859-1') + assert_equal "Brosch\374re Rand", b + end + def test_quote_multibyte_chars original = "\303\246 \303\270 and \303\245" @@ -18,7 +56,8 @@ class QuotingTest < Test::Unit::TestCase unquoted = TMail::Unquoter.unquote_and_convert_to(result, nil) assert_equal unquoted, original end - + + # test an email that has been created using \r\n newlines, instead of # \n newlines. def test_email_quoted_with_0d0a @@ -30,9 +69,19 @@ class QuotingTest < Test::Unit::TestCase mail = TMail::Mail.parse(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject")) assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject end - + + def test_decode + encoded, decoded = expected_base64_strings + assert_equal decoded, TMail::Base64.decode(encoded) + end + + def test_encode + encoded, decoded = expected_base64_strings + assert_equal encoded.length, TMail::Base64.encode(decoded).length + end + private - + # This whole thing *could* be much simpler, but I don't think Tempfile, # popen and others exist on all platforms (like Windows). def execute_in_sandbox(code) @@ -54,4 +103,9 @@ class QuotingTest < Test::Unit::TestCase File.delete(test_name) rescue nil File.delete(res_name) rescue nil end + + def expected_base64_strings + [ File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_encoded_string"), File.read("#{File.dirname(__FILE__)}/fixtures/raw_base64_decoded_string") ] + end end + diff --git a/vendor/rails/actionmailer/test/test_helper_test.rb b/vendor/rails/actionmailer/test/test_helper_test.rb new file mode 100644 index 00000000..eb17e3e8 --- /dev/null +++ b/vendor/rails/actionmailer/test/test_helper_test.rb @@ -0,0 +1,117 @@ +require File.dirname(__FILE__) + '/abstract_unit' + +class TestHelperMailer < ActionMailer::Base + def test + recipients "test@example.com" + from "tester@example.com" + body render(:inline => "Hello, <%= @world %>", :body => { :world => "Earth" }) + end +end + +class TestHelperMailerTest < ActionMailer::TestCase + + def test_setup_sets_right_action_mailer_options + assert_equal :test, ActionMailer::Base.delivery_method + assert ActionMailer::Base.perform_deliveries + assert_equal [], ActionMailer::Base.deliveries + end + + def test_setup_creates_the_expected_mailer + assert @expected.is_a?(TMail::Mail) + assert_equal "1.0", @expected.mime_version + assert_equal "text/plain", @expected.content_type + end + + def test_mailer_class_is_correctly_inferred + assert_equal TestHelperMailer, self.class.mailer_class + end + + def test_determine_default_mailer_raises_correct_error + assert_raises(ActionMailer::NonInferrableMailerError) do + self.class.determine_default_mailer("NotAMailerTest") + end + end + + def test_charset_is_utf_8 + assert_equal "utf-8", charset + end + + def test_encode + assert_equal "=?utf-8?Q?=0aasdf=0a?=", encode("\nasdf\n") + end + + def test_assert_emails + assert_nothing_raised do + assert_emails 1 do + TestHelperMailer.deliver_test + end + end + end + + def test_repeated_assert_emails_calls + assert_nothing_raised do + assert_emails 1 do + TestHelperMailer.deliver_test + end + end + + assert_nothing_raised do + assert_emails 2 do + TestHelperMailer.deliver_test + TestHelperMailer.deliver_test + end + end + end + + def test_assert_emails_with_no_block + assert_nothing_raised do + TestHelperMailer.deliver_test + assert_emails 1 + end + + assert_nothing_raised do + TestHelperMailer.deliver_test + TestHelperMailer.deliver_test + assert_emails 3 + end + end + + def test_assert_no_emails + assert_nothing_raised do + assert_no_emails do + TestHelperMailer.create_test + end + end + end + + def test_assert_emails_too_few_sent + error = assert_raises Test::Unit::AssertionFailedError do + assert_emails 2 do + TestHelperMailer.deliver_test + end + end + + assert_match /2 .* but 1/, error.message + end + + def test_assert_emails_too_many_sent + error = assert_raises Test::Unit::AssertionFailedError do + assert_emails 1 do + TestHelperMailer.deliver_test + TestHelperMailer.deliver_test + end + end + + assert_match /1 .* but 2/, error.message + end + + def test_assert_no_emails_failure + error = assert_raises Test::Unit::AssertionFailedError do + assert_no_emails do + TestHelperMailer.deliver_test + end + end + + assert_match /0 .* but 1/, error.message + end +end diff --git a/vendor/rails/actionmailer/test/tmail_test.rb b/vendor/rails/actionmailer/test/tmail_test.rb index 7d83a68a..b40d8945 100644 --- a/vendor/rails/actionmailer/test/tmail_test.rb +++ b/vendor/rails/actionmailer/test/tmail_test.rb @@ -10,4 +10,13 @@ class TMailMailTest < Test::Unit::TestCase assert_equal "something_with_underscores=\n", m.quoted_body assert_equal expected, m.body end + + def test_nested_attachments_are_recognized_correctly + fixture = File.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_nested_attachment") + mail = TMail::Mail.parse(fixture) + assert_equal 2, mail.attachments.length + assert_equal "image/png", mail.attachments.first.content_type + assert_equal 1902, mail.attachments.first.length + assert_equal "application/pkcs7-signature", mail.attachments.last.content_type + end end diff --git a/vendor/rails/actionmailer/test/url_test.rb b/vendor/rails/actionmailer/test/url_test.rb index ded343cf..56478696 100644 --- a/vendor/rails/actionmailer/test/url_test.rb +++ b/vendor/rails/actionmailer/test/url_test.rb @@ -1,6 +1,9 @@ require "#{File.dirname(__FILE__)}/abstract_unit" class TestMailer < ActionMailer::Base + + default_url_options[:host] = 'www.basecamphq.com' + def signed_up_with_url(recipient) @recipients = recipient @subject = "[Signed up] Welcome #{recipient}" @@ -37,22 +40,27 @@ class ActionMailerUrlTest < Test::Unit::TestCase end def setup - ActionMailer::Base.delivery_method = :test + set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @recipient = 'test@localhost' end + def teardown + restore_delivery_method + end + def test_signed_up_with_url ActionController::Routing::Routes.draw do |map| map.connect ':controller/:action/:id' + map.welcome 'welcome', :controller=>"foo", :action=>"bar" end expected = new_mail expected.to = @recipient expected.subject = "[Signed up] Welcome #{@recipient}" - expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting" + expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting http://www.basecamphq.com/welcome\n\n\"Somelogo\"" expected.from = "system@loudthinking.com" expected.date = Time.local(2004, 12, 12) diff --git a/vendor/rails/actionpack/CHANGELOG b/vendor/rails/actionpack/CHANGELOG index 082d6bae..d8a1cc75 100644 --- a/vendor/rails/actionpack/CHANGELOG +++ b/vendor/rails/actionpack/CHANGELOG @@ -1,28 +1,422 @@ -*1.13.5* (October 12th, 2007) +*2.0.2* (December 16th, 2007) -* Backport: allow array and hash query parameters. Array route parameters are converted/to/a/path as before. #6765, #7047, #7462 [bgipsy, Jeremy McAnally, Dan Kubb, brendan, Diego Algorta Casamayou] +* Added delete_via_redirect and put_via_redirect to integration testing #10497 [philodespotos] -* Fix in place editor's setter action with non-string fields. #7418 [Andreas] +* Allow headers['Accept'] to be set by hand when calling xml_http_request #10461 [BMorearty] + +* Added OPTIONS to list of default accepted HTTP methods #10449 [holoway] + +* Added option to pass proc to ActionController::Base.asset_host for maximum configurability #10521 [chuyeow]. Example: + + ActionController::Base.asset_host = Proc.new { |source| + if source.starts_with?('/images') + "http://images.example.com" + else + "http://assets.example.com" + end + } + +* Fixed that ActionView#file_exists? would be incorrect if @first_render is set #10569 [dbussink] + +* Added that Array#to_param calls to_param on all it's elements #10473 [brandon] + +* Ensure asset cache directories are automatically created. #10337 [Josh Peek, Cheah Chu Yeow] + +* render :xml and :json preserve custom content types. #10388 [jmettraux, Cheah Chu Yeow] + +* Refactor Action View template handlers. #10437, #10455 [Josh Peek] + +* Fix DoubleRenderError message and leave out mention of returning false from filters. Closes #10380 [Frederick Cheung] + +* Clean up some cruft around ActionController::Base#head. Closes #10417 [ssoroka] -*1.13.4* (October 4th, 2007) +*2.0.1* (December 7th, 2007) -* Only accept session ids from cookies, prevents session fixation attacks. [bradediger] +* Fixed send_file/binary_content for testing #8044 [tolsen] -* Change the resource seperator from ; to / change the generated routes to use the new-style named routes. e.g. new_group_user_path(@group) instead of group_new_user_path(@group). [pixeltrix] +* When a NonInferrableControllerError is raised, make the proposed fix clearer in the error message. Closes #10199 [danger] -* Integration tests: introduce methods for other HTTP methods. #6353 [caboose] +* Update Prototype to 1.6.0.1. [sam] -* Improve performance of action caching. Closes #8231 [skaes] +* Update script.aculo.us to 1.8.0.1. [madrobby] + +* Add 'disabled' attribute to