[DRE-commits] [ruby-rubymail] 01/04: Imported Upstream version 1.0.1
Per Andersson
avtobiff at moszumanska.debian.org
Thu Oct 16 19:24:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
avtobiff pushed a commit to branch master
in repository ruby-rubymail.
commit 2fc0c339f33c1ad8786ac02436e6c0e343baf6ce
Author: Per Andersson <avtobiff at gmail.com>
Date: Thu Oct 16 21:22:37 2014 +0200
Imported Upstream version 1.0.1
---
.emacs-dirvars | 9 +++++++++
.gitignore | 3 +++
NEWS | 4 ++++
Rakefile | 10 ++++------
lib/rmail/address.rb | 20 ++++++++++++++++----
lib/rmail/header.rb | 2 +-
makedoc | 8 ++++++++
test/testaddress.rb | 20 ++++++++++++++++----
version | 2 +-
9 files changed, 62 insertions(+), 16 deletions(-)
diff --git a/.emacs-dirvars b/.emacs-dirvars
new file mode 100644
index 0000000..f327c3d
--- /dev/null
+++ b/.emacs-dirvars
@@ -0,0 +1,9 @@
+;; -*- emacs-lisp -*-
+;;
+;; This file is processed by the dirvars emacs package. Each variable
+;; setting below is performed when this dirvars file is loaded.
+;;
+indent-tabs-mode: nil
+tab-width: 8
+show-trailing-whitespace: t
+indicate-empty-lines: t
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bacf91a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+_scratch_*
+html
+pkg
diff --git a/NEWS b/NEWS
index 4fdac78..fafa21c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+= Changes in RubyMail 1.0.1 (released 2013-09-04)
+
+- Fix encoding of regexps for ruby 1.9.1+
+
= Changes in RubyMail 1.0.0 (released 2008-01-05)
- This version differs *only* in the changes required for Ruby 1.9
diff --git a/Rakefile b/Rakefile
index 55246d0..cd843cd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -139,7 +139,7 @@ end
#
if defined?(Gem)
spec = Gem::Specification.new do |s|
- s.name = 'rmail'
+ s.name = 'rmail-sup'
s.version = PKG_VERSION + if can_release_package
''
else
@@ -163,11 +163,9 @@ if defined?(Gem)
s.test_files = FileList['test/tc_*.rb'].to_a
- s.author = "Matt Armstrong"
- s.email = "matt at rfc20.org"
- s.homepage = "http://www.rfc20.org/rubymail"
-
- s.rubyforge_project = "rubymail"
+ s.author = "Sup maintainers"
+ s.email = "sup-devel at rubyforge.org"
+ s.homepage = "http://supmua.org"
end
#
diff --git a/lib/rmail/address.rb b/lib/rmail/address.rb
index 8227841..8265823 100644
--- a/lib/rmail/address.rb
+++ b/lib/rmail/address.rb
@@ -1,5 +1,5 @@
#--
-# Copyright (C) 2001, 2002, 2003 Matt Armstrong. All rights
+# Copyright (C) 2001, 2002, 2003, 2008 Matt Armstrong. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,6 @@ module RMail
# is parsed for mail addresses and if one is found, it is used to
# initialize this object.
def initialize(string = nil)
-
@local = @domain = @comments = @display_name = nil
if string.kind_of?(String)
@@ -421,7 +420,6 @@ module RMail
# local-part ':' -> it is a display-name of a group
# display-name '<' -> it is a mailbox display name
# display-name ':' -> it is a group display name
- #
# set lookahead to '@' '<' or ':' (or another value for
# invalid input)
@@ -472,6 +470,20 @@ module RMail
@addresses.last.local = get_text
expect(SYM_AT_SIGN)
domain
+
+ if @sym == SYM_LESS_THAN
+ # Workaround for invalid input. Treat 'foo at bar <foo at bar>' as if it
+ # were '"foo at bar" <foo at bar>'. The domain parser will eat
+ # 'bar' but stop at '<'. At this point, we've been
+ # parsing the display name as if it were an address, so we
+ # throw the address into display_name and parse an
+ # angle_addr.
+ @addresses.last.display_name =
+ format("%s@%s", @addresses.last.local, @addresses.last.domain)
+ @addresses.last.local = nil
+ @addresses.last.domain = nil
+ angle_addr
+ end
end
end
@@ -691,7 +703,7 @@ module RMail
@sym = SYM_DOMAIN_LITERAL
@lexeme = $1.gsub(/(^|[^\\])[\r\n\t ]+/, '\1').gsub(/\\(.)/, '\1')
break
- when /\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+/m
+ when /\A[\200-\377\w!$%&\'*+\/=?^_\`{\}|~#-]+/nm
# This is just like SYM_ATOM, but includes all characters
# with high bits. This is so we can allow such tokens in
# the display name portion of an address even though it
diff --git a/lib/rmail/header.rb b/lib/rmail/header.rb
index 9102f28..ca4d0b6 100644
--- a/lib/rmail/header.rb
+++ b/lib/rmail/header.rb
@@ -73,7 +73,7 @@ module RMail
class Field # :nodoc:
# fixme, document methadology for this (RFC2822)
- EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/o
+ EXTRACT_FIELD_NAME_RE = /\A([^\x00-\x1f\x7f-\xff :]+):\s*/no
class << self
def parse(field)
diff --git a/makedoc b/makedoc
new file mode 100644
index 0000000..f40c134
--- /dev/null
+++ b/makedoc
@@ -0,0 +1,8 @@
+#!/bin/sh
+rm -rf doc
+version=${1:-UNRELEASED}
+rdoc --title "RubyMail Documentation (version $version)" \
+ --exclude SCCS \
+ --show-hash \
+ --main README \
+ README NEWS THANKS TODO guide/*.txt lib/rmail lib/rmail.rb
diff --git a/test/testaddress.rb b/test/testaddress.rb
index 71026d0..5a4e22f 100644
--- a/test/testaddress.rb
+++ b/test/testaddress.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#--
-# Copyright (C) 2001, 2002, 2003, 2007 Matt Armstrong. All rights reserved.
+# Copyright (C) 2001, 2002, 2003, 2007, 2008 Matt Armstrong. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -419,7 +419,7 @@ class TestRMailAddress < TestBase
:format => '"Jason @ Tibbitts" <tibbs at uh.edu>' } ] ]
# Majordomo II parses all of these with an error. We have deleted
- # some of the tests since when they are actually legal.
+ # some of the tests when they are actually legal.
validate_case ['tibbs at uh.edu Jason Tibbitts', [] ]
validate_case ['@uh.edu', [] ] # Can't start with @
validate_case ['J <tibbs>', [] ] # Not FQDN
@@ -644,7 +644,6 @@ class TestRMailAddress < TestBase
end
def test_rfc_822
-
validate_case\
['":sysmail"@ Some-Group. Some-Org, Muhammed.(I am the greatest) Ali @(the)Vegas.WBA',
[ { :name => nil,
@@ -664,7 +663,6 @@ class TestRMailAddress < TestBase
end
def test_misc_addresses()
-
# Make sure that parsing empty stuff works
assert_equal([], RMail::Address.parse(nil))
assert_equal([], RMail::Address.parse(""))
@@ -794,6 +792,20 @@ class TestRMailAddress < TestBase
} ] ]
end
+ def test_bug_23043
+ # http://rubyforge.org/tracker/?func=detail&atid=1754&aid=23043&group_id=446
+ validate_case\
+ ['=?iso-8859-1?Q?acme at example.com?= <acme at example.com>',
+ [ { :name => '=?iso-8859-1?Q?acme at example.com?=',
+ :display_name => '=?iso-8859-1?Q?acme at example.com?=',
+ :address => 'acme at example.com',
+ :comments => nil,
+ :domain => 'example.com',
+ :local => 'acme',
+ :format => '"=?iso-8859-1?Q?acme at example.com?=" <acme at example.com>',
+ } ] ]
+ end
+
def test_invalid_addresses()
# The display name isn't encoded -- bad, but we parse it.
validate_case\
diff --git a/version b/version
index 3eefcb9..7dea76e 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-1.0.0
+1.0.1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rubymail.git
More information about the Pkg-ruby-extras-commits
mailing list