The installer again -- further tests.

Hugh Sasse Staff Elec Eng hgs at dmu.ac.uk
Tue Jan 4 06:29:06 EST 2005


OK, here is the diff with the extra diagnostic print statements
removed.  this is against the CVS as grabbed with wget from 
http://rubyforge.org/cgi-bin/viewcvs.cgi/vim-ruby/bin/vim-ruby-install.rb?cvsroot=vim-ruby

today.

You don't need to worry about the change from env ruby on the first
line of course...

         Hugh

--- vim-ruby-install.rb?rev=1.1&cvsroot=vim-ruby	2005-01-04 11:13:23.648722000 +0000
+++ vim-ruby-install.rb.new	2005-01-04 11:22:34.639925000 +0000
@@ -1,6 +1,7 @@
-#!/usr/bin/env ruby
+#!/usr/local/bin/ruby

  # vim-ruby-install: install the Vim config files for Ruby editing
+# vim:set sw=2 et:
  #
  #  * scope out the target directry and get user to confirm
  #    * if no directory found, ask user
@@ -52,6 +53,8 @@
        # 1. Try the current directory.
      if SOURCE_FILES.all? { |path| FileTest.file?(path) }
        return '.'
+    elsif SOURCE_FILES.map{|f| File.join(File.dirname($0), '..',f)}.all? { |path| FileTest.file?(path) }
+      return File.join(File.dirname($0), '..')
      end
        # 2. Try the gem 'vim-ruby'.
      begin
@@ -231,6 +233,9 @@
      # will be copied.  Both are strings.
    def initialize(source, target)
      @source_dir = source
+    unless FileTest.directory?(@source_dir)
+      raise "Automatically determined source directory ('#{@source_dir}') doesn't exist"
+    end
      unless FileTest.directory?(target)
        raise "Chosen target directory ('#{target}') doesn't exist"
      end
@@ -366,6 +371,7 @@
  op.parse!(ARGV)

  source_dir = Env.determine_source_directory
+if source_dir.nil? then raise "source_dir is Nil"; end
  target_dir = $options[:target_dir] || TargetDirectory.finder.find_target_directory
  VimRubyInstaller.new(source_dir, target_dir).install




More information about the vim-ruby-devel mailing list