1. seydar
  2. chitin

Commits

seydar  committed 8c51f07

no more unnecessary touches to the rc file, plus sweet internals for command timing

  • Participants
  • Parent commits eebf73a
  • Branches default

Comments (0)

Files changed (2)

File bin/chitin

View file
 require File.join(File.dirname(follow_link(__FILE__)), "..", "lib", "chitin")
 
 rc = ARGV[0] || File.expand_path('~/.chitinrc')
-FileUtils.touch rc
 
-Chitin::Builtins.class_eval File.read(rc)
+Chitin::Builtins.class_eval File.read(rc) if rc
+
+if rc && File.exists?(rc)
+  Chitin::Builtins.class_eval File.read(rc)
+end
 
 SESSION = Chitin::Session.new Chitin::Builtins
 SESSION.start

File lib/chitin/session.rb

View file
       while (val = read)
         next if val.empty?
   
+        # a little bit of infrastructure for timing purposes
+        $timing = Time.now
+
         begin
           res = evaluate val
           display res unless val.lstrip[0, 1] == '#'