diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2014-11-13 00:30:39 +0100 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2014-11-13 00:30:39 +0100 |
commit | 853dc8b41fc70b3fc85930481bf95e1dfcaba90c (patch) | |
tree | c217614fbd3707b921408065e30869e8f1e08238 | |
parent | daaa0829051485d0c34f773ddfaeb71be9072158 (diff) |
port to ruby2.1
-rwxr-xr-x | about.cgi | 2 | ||||
-rwxr-xr-x | authorization_required.cgi | 2 | ||||
-rwxr-xr-x | check.cgi | 2 | ||||
-rw-r--r-- | config_defaults.rb | 4 | ||||
-rwxr-xr-x | customize.rb | 2 | ||||
-rw-r--r-- | date_locale.rb | 21 | ||||
-rw-r--r-- | dudle.rb | 10 | ||||
-rwxr-xr-x | error.cgi | 2 | ||||
-rwxr-xr-x | example.cgi | 2 | ||||
-rwxr-xr-x | index.cgi | 2 | ||||
-rwxr-xr-x | not_found.cgi | 2 | ||||
-rw-r--r-- | poll.rb | 6 | ||||
-rw-r--r-- | timepollhead.rb | 2 | ||||
-rw-r--r-- | vcs_bzr.rb | 2 | ||||
-rw-r--r-- | vcs_git.rb | 2 |
15 files changed, 22 insertions, 41 deletions
@@ -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"]) @@ -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
@@ -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 @@ -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 @@ -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 @@ -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 @@ -18,7 +18,7 @@ ############################################################################ require "time" -require "log" +require_relative "log" class VCS BZRCMD="export LC_ALL=de_DE.UTF-8; bzr" @@ -18,7 +18,7 @@ ############################################################################ require "time" -require "log" +require_relative "log" require "open3" def runcmd *args |