From 01104f4a929dbbf37366f40e5f45227304f3d7d6 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 3 Jul 2009 14:16:24 +0200 Subject: put options where they belong. in a config file --- code/directory.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'code/directory.rb') diff --git a/code/directory.rb b/code/directory.rb index 01634ca0..c738b995 100644 --- a/code/directory.rb +++ b/code/directory.rb @@ -27,7 +27,7 @@ class Directory @mtime = File.mtime(@path) log @path @files = Dir.new(@path).to_a rescue [] - if OPTIONS['hidden'] + if Option.show_hidden @files -= ['.', '..', 'lost+found'] else @files.reject!{|x| x[0] == ?. or x == 'lost+found'} @@ -160,7 +160,7 @@ class Directory # def refresh() # @files = Dir.new(@path).to_a -# if OPTIONS['hidden'] +# if Option.hidden # @files -= ['.', '..', 'lost+found'] # else # @files.reject!{|x| x[0] == ?. or x == 'lost+found'} @@ -203,7 +203,7 @@ class Directory end def sort_sub(x, y) - case OPTIONS['sort'] + case Option.sort when :name x.basename <=> y.basename when :ext @@ -223,7 +223,7 @@ class Directory def sort() @files = @files.sort {|x,y| - if OPTIONS['dir_first'] + if Option.dir_first if x.dir? if y.dir? then sort_sub(x, y) else -1 end else @@ -233,7 +233,7 @@ class Directory sort_sub(x, y) end } - @files.reverse! if OPTIONS['sort_reverse'] + @files.reverse! if Option.sort_reverse @files_raw = @files.map{|x| x.to_s} end end -- cgit 1.4.1-2-gfad0