aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2014-11-13 00:30:39 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2014-11-13 00:30:39 +0100
commit853dc8b41fc70b3fc85930481bf95e1dfcaba90c (patch)
treec217614fbd3707b921408065e30869e8f1e08238
parentdaaa0829051485d0c34f773ddfaeb71be9072158 (diff)
port to ruby2.1
-rwxr-xr-xabout.cgi2
-rwxr-xr-xauthorization_required.cgi2
-rwxr-xr-xcheck.cgi2
-rw-r--r--config_defaults.rb4
-rwxr-xr-xcustomize.rb2
-rw-r--r--date_locale.rb21
-rw-r--r--dudle.rb10
-rwxr-xr-xerror.cgi2
-rwxr-xr-xexample.cgi2
-rwxr-xr-xindex.cgi2
-rwxr-xr-xnot_found.cgi2
-rw-r--r--poll.rb6
-rw-r--r--timepollhead.rb2
-rw-r--r--vcs_bzr.rb2
-rw-r--r--vcs_git.rb2
15 files changed, 22 insertions, 41 deletions
diff --git a/about.cgi b/about.cgi
index 6483a33..f1994a4 100755
--- a/about.cgi
+++ b/about.cgi
@@ -21,7 +21,7 @@
if __FILE__ == $0
-require "dudle"
+require_relative "dudle"
$d = Dudle.new
diff --git a/authorization_required.cgi b/authorization_required.cgi
index dbfff70..c93d85a 100755
--- a/authorization_required.cgi
+++ b/authorization_required.cgi
@@ -19,7 +19,7 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
-require "dudle"
+require_relative "dudle"
if $cgi.include?("poll")
if File.directory?($cgi["poll"])
diff --git a/check.cgi b/check.cgi
index a526523..c893ca0 100755
--- a/check.cgi
+++ b/check.cgi
@@ -33,7 +33,7 @@ begin
hints << "You might want to config your environment within the file 'config.rb' (see 'config_sample.rb' for a starting point)" unless File.exists?("config.rb")
begin
- require "dudle"
+ require_relative "dudle"
#require "rubygems"
#require "atom" FIXME: rename atom.rb
rescue LoadError => e
diff --git a/config_defaults.rb b/config_defaults.rb
index c6e2b8e..77a5e9a 100644
--- a/config_defaults.rb
+++ b/config_defaults.rb
@@ -61,8 +61,8 @@ $conf.default_css = "default.css"
if File.exists?("config.rb") || File.exists?("../config.rb")
- require "config"
+ require_relative "config"
end
-require "vcs_#{$conf.vcs}"
+require_relative "vcs_#{$conf.vcs}"
diff --git a/customize.rb b/customize.rb
index 0b00c72..3dcbdf1 100755
--- a/customize.rb
+++ b/customize.rb
@@ -23,7 +23,7 @@
if __FILE__ == $0
$:.push("..")
-require "dudle"
+require_relative "dudle"
$d = Dudle.new
diff --git a/date_locale.rb b/date_locale.rb
index 6839b58..9108084 100644
--- a/date_locale.rb
+++ b/date_locale.rb
@@ -7,7 +7,6 @@
#
-require 'iconv'
require 'date'
#
@@ -165,20 +164,6 @@ module Date_locale
return DATE_TEXTS[lang]
end
- #Set default converter
- #~ @@encoding_converter = Iconv.new( 'iso-8859-1', 'utf-8' )
-
- #
- #The daynames are encoded in UTF (I hope ;-) ).
- #With this method you can define a global converter.
- #
- #Example:
- # Date_locale.set_target_encoding( 'iso-8859-1')
- #
- def self.set_target_encoding( enc )
- @@encoding_converter = Iconv.new( enc, 'utf-8' )
- end
-
#
#Get the key for the wanted language.
@@ -245,11 +230,7 @@ module Date_locale
end
}
)
- if defined? @@encoding_converter
- @@encoding_converter.iconv(result)
- else
- result
- end
+ result.encode("utf-8")
end #strftime_locale(format = '%F', lang = :en )
end #module Date_locale
diff --git a/dudle.rb b/dudle.rb
index 5acafef..a0089eb 100644
--- a/dudle.rb
+++ b/dudle.rb
@@ -40,12 +40,12 @@ else
end
$:.push("..")
-require "date_locale"
+require_relative "date_locale"
-require "html"
-require "poll"
-require "config_defaults"
-require "charset"
+require_relative "html"
+require_relative "poll"
+require_relative "config_defaults"
+require_relative "charset"
class Dudle
attr_reader :html, :table, :urlsuffix, :css, :user_css, :title, :tab
diff --git a/error.cgi b/error.cgi
index 026fbee..92bc9e1 100755
--- a/error.cgi
+++ b/error.cgi
@@ -19,7 +19,7 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
-require "dudle"
+require_relative "dudle"
# check for trailing slash
if ENV["REDIRECT_URL"] =~ /#{$cgi["poll"]}$/
$d = Dudle.new(:title => _("Error"), :hide_lang_chooser => true, :relative_dir => "#{$cgi["poll"]}/")
diff --git a/example.cgi b/example.cgi
index 2122bb7..d9a0f5e 100755
--- a/example.cgi
+++ b/example.cgi
@@ -21,7 +21,7 @@
if __FILE__ == $0
-require "dudle"
+require_relative "dudle"
$d = Dudle.new
diff --git a/index.cgi b/index.cgi
index 905ddae..e0e1464 100755
--- a/index.cgi
+++ b/index.cgi
@@ -22,7 +22,7 @@
if __FILE__ == $0
-require "dudle"
+require_relative "dudle"
$d = Dudle.new
diff --git a/not_found.cgi b/not_found.cgi
index 21ae67e..5ffb37b 100755
--- a/not_found.cgi
+++ b/not_found.cgi
@@ -19,7 +19,7 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
-require "dudle"
+require_relative "dudle"
if File.exists?(Dir.pwd + File.dirname(ENV["REDIRECT_URL"]))
$d = Dudle.new(:hide_lang_chooser => true)
else
diff --git a/poll.rb b/poll.rb
index 9170c49..8f4669d 100644
--- a/poll.rb
+++ b/poll.rb
@@ -17,11 +17,11 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
-require "hash"
+require_relative "hash"
require "yaml"
require "time"
-require "pollhead"
-require "timepollhead"
+require_relative "pollhead"
+require_relative "timepollhead"
$KCODE = "u" if RUBY_VERSION < '1.9.0'
class String
diff --git a/timepollhead.rb b/timepollhead.rb
index 32efc45..6341537 100644
--- a/timepollhead.rb
+++ b/timepollhead.rb
@@ -26,7 +26,7 @@ class << Time
end
end
-require "timestring"
+require_relative "timestring"
class TimePollHead
def initialize
diff --git a/vcs_bzr.rb b/vcs_bzr.rb
index 9f15527..f3b367c 100644
--- a/vcs_bzr.rb
+++ b/vcs_bzr.rb
@@ -18,7 +18,7 @@
############################################################################
require "time"
-require "log"
+require_relative "log"
class VCS
BZRCMD="export LC_ALL=de_DE.UTF-8; bzr"
diff --git a/vcs_git.rb b/vcs_git.rb
index 4a51dfd..3c3ec0b 100644
--- a/vcs_git.rb
+++ b/vcs_git.rb
@@ -18,7 +18,7 @@
############################################################################
require "time"
-require "log"
+require_relative "log"
require "open3"
def runcmd *args