summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-18 00:02:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-18 00:02:35 +0000
commit70f03998c098c430f489b71b8bd59f5ebc0974f8 (patch)
treeca98e5f2a342f2618266a47f0ae9bde73b7f343b
parent263abf2963fe089db9a7870be72f30edec13448e (diff)
* lib/rdoc/rdoc.rb (RDoc::RDoc#parse_files): emacs local variables
are delimited by a semicolon. supported Vim style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/rdoc/rdoc.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a0d8ff213b..b795ff16a8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Sep 18 09:02:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/rdoc.rb (RDoc::RDoc#parse_files): emacs local variables
+ are delimited by a semicolon. supported Vim style.
+
Fri Sep 18 07:06:41 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/fileutils/test_fileutils.rb: add a test for [ruby-dev:39345]
diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb
index ce1cb1a93f3..9ddece89e0b 100644
--- a/lib/rdoc/rdoc.rb
+++ b/lib/rdoc/rdoc.rb
@@ -209,8 +209,8 @@ module RDoc
File.read filename
end
- if defined? Encoding then
- if /coding:\s*(\S+)/ =~ content[/\A(?:.*\n){0,2}/]
+ if defined?(::Encoding) then
+ if /coding[=:]\s*([^\s;]+)/ =~ content[/\A(?:!.*\n)?(.*\n)/, 1]
if enc = ::Encoding.find($1)
content.force_encoding(enc)
end