summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/matrix.rb1
-rw-r--r--lib/mkmf.rb91
-rw-r--r--lib/parsedate.rb16
3 files changed, 11 insertions, 97 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb
index f5c8491146..4d4ca343fd 100644
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1,4 +1,3 @@
-#!/usr/local/bin/ruby
#
# matrix.rb -
# $Release Version: 1.0$
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 50920a0cda..5df77bd3ab 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -8,29 +8,7 @@ include Config
SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
-$cache_mod = false
-$lib_cache = {}
-$lib_found = {}
-$func_cache = {}
-$func_found = {}
-$hdr_cache = {}
-$hdr_found = {}
-
$config_cache = CONFIG["compile_dir"]+"/ext/config.cache"
-if File.exist?($config_cache) then
- f = open($config_cache, "r")
- while f.gets
- case $_
- when /^lib: (.+) (yes|no)/
- $lib_cache[$1] = $2
- when /^func: ([\w_]+) (yes|no)/
- $func_cache[$1] = $2
- when /^hdr: (.+) (yes|no)/
- $hdr_cache[$1] = $2
- end
- end
- f.close
-end
$srcdir = CONFIG["srcdir"]
$libdir = CONFIG["libdir"]+"/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
@@ -160,16 +138,6 @@ end
def have_library(lib, func="main")
printf "checking for %s() in -l%s... ", func, lib
STDOUT.flush
- if $lib_cache[lib]
- if $lib_cache[lib] == "yes"
- $libs = append_library($libs, lib)
- print "(cached) yes\n"
- return true
- else
- print "(cached) no\n"
- return false
- end
- end
if func && func != ""
libs = append_library($libs, lib)
@@ -195,8 +163,6 @@ int t() { #{func}(); return 0; }
SRC
end
unless r
- $lib_cache[lib] = 'no'
- $cache_mod = true
print "no\n"
return false
end
@@ -205,8 +171,6 @@ SRC
end
$libs = libs
- $lib_cache[lib] = 'yes'
- $cache_mod = true
print "yes\n"
return true
end
@@ -236,16 +200,6 @@ end
def have_func(func)
printf "checking for %s()... ", func
STDOUT.flush
- if $func_cache[func]
- if $func_cache[func] == "yes"
- $defs.push(format("-DHAVE_%s", func.upcase))
- print "(cached) yes\n"
- return true
- else
- print "(cached) no\n"
- return false
- end
- end
libs = $libs
@@ -271,14 +225,10 @@ int t() { #{func}(); return 0; }
SRC
end
unless r
- $func_found[func] = 'no'
- $cache_mod = true
print "no\n"
return false
end
$defs.push(format("-DHAVE_%s", func.upcase))
- $func_found[func] = 'yes'
- $cache_mod = true
print "yes\n"
return true
end
@@ -286,30 +236,15 @@ end
def have_header(header)
printf "checking for %s... ", header
STDOUT.flush
- if $hdr_cache[header]
- if $hdr_cache[header] == "yes"
- header.tr!("a-z./\055", "A-Z___")
- $defs.push(format("-DHAVE_%s", header))
- print "(cached) yes\n"
- return true
- else
- print "(cached) no\n"
- return false
- end
- end
unless try_cpp(<<"SRC")
#include <#{header}>
SRC
- $hdr_found[header] = 'no'
- $cache_mod = true
print "no\n"
return false
end
- $hdr_found[header] = 'yes'
header.tr!("a-z./\055", "A-Z___")
$defs.push(format("-DHAVE_%s", header))
- $cache_mod = true
print "yes\n"
return true
end
@@ -493,32 +428,6 @@ EOMF
end
mfile.close
- if $cache_mod
- begin
- f = open($config_cache, "w")
- for k,v in $lib_cache
- f.printf "lib: %s %s\n", k, v.downcase
- end
- for k,v in $lib_found
- f.printf "lib: %s %s\n", k, v.downcase
- end
- for k,v in $func_cache
- f.printf "func: %s %s\n", k, v.downcase
- end
- for k,v in $func_found
- f.printf "func: %s %s\n", k, v.downcase
- end
- for k,v in $hdr_cache
- f.printf "hdr: %s %s\n", k, v.downcase
- end
- for k,v in $hdr_found
- f.printf "hdr: %s %s\n", k, v.downcase
- end
- f.close
- rescue
- end
- end
-
if RUBY_PLATFORM =~ /beos/
if RUBY_PLATFORM =~ /^powerpc/ then
deffilename = "ruby.exp"
diff --git a/lib/parsedate.rb b/lib/parsedate.rb
index 6afec0ff06..ff41d162ad 100644
--- a/lib/parsedate.rb
+++ b/lib/parsedate.rb
@@ -27,7 +27,7 @@ module ParseDate
if date.sub!(/(#{DAYPAT})[a-z]*,?/i, ' ')
wday = DAYS[$1.downcase]
end
- if date.sub!(/(\d+):(\d+)(?::(\d+))?\s*(am|pm)?\s*(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})?|[-+]\d{4}))?/i, ' ')
+ if date.sub!(/(\d+):(\d+)(?::(\d+))?(?:\s*(am|pm))?(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4})?|[-+]\d{4}))?/i, ' ')
hour = $1.to_i
min = $2.to_i
if $3
@@ -62,6 +62,16 @@ module ParseDate
mday = $1.to_i
mon = MONTHS[$2.downcase]
year = $3.to_i
+ elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ')
+ mday = $1.to_i
+ mon = MONTHS[$2.downcase]
+ year = $3.to_i
+ end
+ p date
+ if date.sub!(/\d{4}/i, ' ')
+ year = $&.to_i
+ elsif date.sub!(/\d\d/i, ' ')
+ year = $&.to_i
end
if guess
if year < 100
@@ -71,10 +81,6 @@ module ParseDate
year += 2000
end
end
- elsif date.sub!(/(\d+)-(#{MONTHPAT})-(\d+)/i, ' ')
- mday = $1.to_i
- mon = MONTHS[$2.downcase]
- year = $3.to_i
end
return year, mon, mday, hour, min, sec, zone, wday
end