From: Ralph Amissah <ralph@amissah.com>
Date: Fri, 29 Jun 2012 23:30:10 -0400
Subject: retain changes needed for diakonos 0.8.14, including explicit call
of ruby1.9.1
---
bin/diakonos | 2 +-
lib/diakonos.rb | 76 ++++++++++++++++++++++++++------------------------
lib/diakonos/help.rb | 5 ++--
3 files changed, 43 insertions(+), 40 deletions(-)
diff --git a/bin/diakonos b/bin/diakonos
index c6a20b8..b122603 100755
--- a/bin/diakonos
+++ b/bin/diakonos
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/ruby1.9.1
require 'diakonos'
diff --git a/lib/diakonos.rb b/lib/diakonos.rb
index f862a6b..7e4a112 100755
--- a/lib/diakonos.rb
+++ b/lib/diakonos.rb
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/ruby1.9.1
# == Diakonos
#
@@ -259,9 +259,11 @@ module Diakonos
when '--test', '--testing'
@testing = true
when '--uninstall'
- uninstall
+ puts "use Debian installer to uninstall Diakonos"
+ #uninstall
when '--uninstall-without-confirmation'
- uninstall false
+ puts "use Debian installer to uninstall Diakonos"
+ #uninstall false
when '--version'
puts "Diakonos #{::Diakonos::VERSION} (#{::Diakonos::LAST_MODIFIED})"
exit 0
@@ -280,7 +282,7 @@ module Diakonos
puts "\t-m, --open-matching <regular expression>\tOpen all matching files under current directory"
puts "\t-ro <file>\tLoad file as read-only"
puts "\t-s, --load-session <session identifier>\tLoad a session"
- puts "\t--uninstall[-without-confirmation]\tUninstall Diakonos"
+ #puts "\t--uninstall[-without-confirmation]\tUninstall Diakonos"
end
def clear_non_movement_flag
@@ -400,39 +402,39 @@ module Diakonos
end
def uninstall( confirm = true )
- inst = ::Diakonos::INSTALL_SETTINGS[ :installed ]
-
- if confirm
- puts inst[ :files ].sort.join( "\n" )
- puts
- puts inst[ :dirs ].sort.map { |d| "#{d}/" }.join( "\n" )
- puts
- puts "The above files will be removed. The above directories will be removed if they are empty. Proceed? (y/n)"
- answer = $stdin.gets
- case answer
- when /^y/i
- puts "Deleting..."
- else
- puts "Uninstallation aborted."
- exit 1
- end
- end
-
- require 'fileutils'
- inst[ :files ].each do |f|
- FileUtils.rm f
- end
- inst[ :dirs ].sort { |d1,d2| d2.length <=> d1.length }.each do |d|
- begin
- FileUtils.rmdir d
- rescue Errno::ENOTEMPTY
- end
- if File.exists? d
- $stderr.puts "(#{d} not removed)"
- end
- end
-
- exit 0
+ #inst = ::Diakonos::INSTALL_SETTINGS[ :installed ]
+
+ #if confirm
+ # puts inst[ :files ].sort.join( "\n" )
+ # puts
+ # puts inst[ :dirs ].sort.map { |d| "#{d}/" }.join( "\n" )
+ # puts
+ # puts "The above files will be removed. The above directories will be removed if they are empty. Proceed? (y/n)"
+ # answer = $stdin.gets
+ # case answer
+ # when /^y/i
+ # puts "Deleting..."
+ # else
+ # puts "Uninstallation aborted."
+ # exit 1
+ # end
+ #end
+
+ #require 'fileutils'
+ #inst[ :files ].each do |f|
+ # FileUtils.rm f
+ #end
+ #inst[ :dirs ].sort { |d1,d2| d2.length <=> d1.length }.each do |d|
+ # begin
+ # FileUtils.rmdir d
+ # rescue Errno::ENOTEMPTY
+ # end
+ # if File.exists? d
+ # $stderr.puts "(#{d} not removed)"
+ # end
+ #end
+
+ #exit 0
end
def get_language_from_name( name )
diff --git a/lib/diakonos/help.rb b/lib/diakonos/help.rb
index b5102ab..450597a 100644
--- a/lib/diakonos/help.rb
+++ b/lib/diakonos/help.rb
@@ -24,7 +24,8 @@ module Diakonos
else
terms = str.gsub( /[^a-zA-Z0-9-]/, ' ' ).split.join( '|' )
file_grep = `egrep -i -l '^Tags.*\\b(#{terms})\\b' #{@help_dir}/*`
- files = file_grep.split( /\s+/ )
+ files = file_grep.scan( /\/\S+.dhf/ )
+ #files = file_grep.split( /\s+/ )
end
files.each do |file|
@@ -44,4 +45,4 @@ module Diakonos
end
end
-end
\ No newline at end of file
+end