about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-11-08 02:28:50 +0100
committerhut <hut@lavabit.com>2009-11-08 02:28:50 +0100
commit0a4dcff69ff92c5e6449fb6b79d1f2274067fc66 (patch)
treebae9529c0c19a62a34e662b69bd3db14a9b4bc08
parent61b68fd5f68d3e978a4d51452bdf1233156b2693 (diff)
downloadranger-0a4dcff69ff92c5e6449fb6b79d1f2274067fc66.tar.gz
added compatibility to ruby 1.9.1
-rw-r--r--code/directory.rb6
-rw-r--r--code/draw.rb8
-rwxr-xr-xranger1
3 files changed, 11 insertions, 4 deletions
diff --git a/code/directory.rb b/code/directory.rb
index 3e10a466..094835d4 100644
--- a/code/directory.rb
+++ b/code/directory.rb
@@ -2,7 +2,10 @@ require 'code/extensions/basic'
 
 class Directory
 	@@filter = nil
-	BAD_TIME = Time.at(1)
+	# The timestamp 1 has a special meaning.
+	# I hope no directory will ever have this timestamp :).
+	# If it does, you will have to load the directory yourself by pressing R
+	BAD_TIME = Time.at(1) 
 
 	def initialize(path, allow_delay=false)
 		@path = path
@@ -11,6 +14,7 @@ class Directory
 		@file_size = 0
 		@pointed_file = nil
 		@sort_time = BAD_TIME
+		@mtime = BAD_TIME
 		@width = 1000
 		@read = false
 		@free_space = nil
diff --git a/code/draw.rb b/code/draw.rb
index 37eb8e61..ce552575 100644
--- a/code/draw.rb
+++ b/code/draw.rb
@@ -62,11 +62,13 @@ module Fm
 
 
 		offset = get_offset(d, lines)
-		(lines - 1).times do |l|
+
+		l = 0
+		(lines - 1).times do
 			lpo = l + offset
 			l += 1
 
-			break if (f = d.files[lpo]) == nil
+			break if (f = d.files[lpo]).nil?
 
 			mycolor = if lpo == d.pos
 				if infos
@@ -295,7 +297,7 @@ module Fm
 				puti btm, "Edit (a)pplications file(t)ypes"
 			when 'f'
 				puti btm, "Find by (r)egexp (s)ize (h)andler (m)time (c)time"
-			else
+			when cf && //
 				if cf.stat
 					owner = "#{Etc.getpwuid(cf.stat.uid).name}:#{Etc.getgrgid(cf.stat.gid).name}"
 				else
diff --git a/ranger b/ranger
index cd342e96..e4bde8d3 100755
--- a/ranger
+++ b/ranger
@@ -203,6 +203,7 @@ CLI.init_mouse( Option.mouse_interval )
 # run the shit & clean up afterwards
 
 begin
+	log "starting ranger #{version} with ruby #{RUBY_VERSION}"
 	Fm.initialize( pwd )
 	Fm.main_loop