[fantasdic] Ruby 1.9 compatibility fixes. (#599848)
- From: Mathieu Blondel <mblondel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fantasdic] Ruby 1.9 compatibility fixes. (#599848)
- Date: Thu, 15 Apr 2010 01:51:09 +0000 (UTC)
commit dd439e830f9f64f31d6bd2279a4910349403b00a
Author: Mathieu Blondel <mathieu mblondel org>
Date: Thu Apr 15 10:33:19 2010 +0900
Ruby 1.9 compatibility fixes. (#599848)
lib/fantasdic/net/dict.rb | 2 +-
lib/fantasdic/pre-setup.rb | 6 ++++++
lib/fantasdic/source_base.rb | 2 +-
lib/fantasdic/text/metaphone.rb | 2 ++
4 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/lib/fantasdic/net/dict.rb b/lib/fantasdic/net/dict.rb
index cfbb05d..df7b71f 100644
--- a/lib/fantasdic/net/dict.rb
+++ b/lib/fantasdic/net/dict.rb
@@ -18,7 +18,7 @@
# Highly modified version of Ruby/DICT, by Ian Macdonald <ian caliban org>
require 'socket'
-require 'md5'
+require 'digest/md5'
class DICTClient
diff --git a/lib/fantasdic/pre-setup.rb b/lib/fantasdic/pre-setup.rb
index 44de4f2..eb20557 100644
--- a/lib/fantasdic/pre-setup.rb
+++ b/lib/fantasdic/pre-setup.rb
@@ -58,6 +58,8 @@ File.open('authors.rb', 'w') do |file|
begin
authors = IO.readlines('../../AUTHORS').join.chomp.split("\n")
file.print <<EOS
+# coding:utf-8
+
# This file is automatically generated by the installer.
# Do not edit by hands.
@@ -84,6 +86,8 @@ File.open('translators.rb', 'w') do |file|
end
end
file.print <<EOS
+# coding:utf-8
+
# This file is automatically generated by the installer.
# Do not edit by hands.
@@ -100,6 +104,8 @@ File.open('documenters.rb', 'w') do |file|
documenters = IO.readlines('../../data/gnome/help/fantasdic/AUTHORS').
join.chomp.split("\n")
file.print <<EOS
+# coding:utf-8
+
# This file is automatically generated by the installer.
# Do not edit by hands.
diff --git a/lib/fantasdic/source_base.rb b/lib/fantasdic/source_base.rb
index bb0a487..bb1be9e 100644
--- a/lib/fantasdic/source_base.rb
+++ b/lib/fantasdic/source_base.rb
@@ -34,7 +34,7 @@ module Source
names.each do |name|
define_method(name) do |*args|
case args.size
- when 0: instance_variable_get("@#{name}")
+ when 0 then instance_variable_get("@#{name}")
else instance_variable_set("@#{name}", *args)
end
end
diff --git a/lib/fantasdic/text/metaphone.rb b/lib/fantasdic/text/metaphone.rb
index ad6308d..b9de551 100644
--- a/lib/fantasdic/text/metaphone.rb
+++ b/lib/fantasdic/text/metaphone.rb
@@ -1,3 +1,5 @@
+# coding:utf-8
+
#
# An implementation of the Metaphone phonetic coding system in Ruby.
#
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]