diff --git a/Commands/CodeCompletion HTML Attributes.tmCommand b/Commands/CodeCompletion HTML Attributes.tmCommand
index ed85dea..0e399bc 100644
--- a/Commands/CodeCompletion HTML Attributes.tmCommand
+++ b/Commands/CodeCompletion HTML Attributes.tmCommand
@@ -7,7 +7,7 @@
bundleUUID
467B298F-6227-11D9-BFB1-000D93589AF6
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
TextmateCodeCompletion.go!
fallbackInput
diff --git a/Commands/CodeCompletion HTML Tags.tmCommand b/Commands/CodeCompletion HTML Tags.tmCommand
index 99838a6..bfecbfe 100644
--- a/Commands/CodeCompletion HTML Tags.tmCommand
+++ b/Commands/CodeCompletion HTML Tags.tmCommand
@@ -7,7 +7,7 @@
bundleUUID
467B298F-6227-11D9-BFB1-000D93589AF6
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "#{ENV['TM_SUPPORT_PATH']}/lib/codecompletion"
TextmateCodeCompletion.go!
diff --git a/Commands/Convert Line : Selection to URL Escapes.plist b/Commands/Convert Line : Selection to URL Escapes.plist
index fa2d474..ba69abb 100644
--- a/Commands/Convert Line : Selection to URL Escapes.plist
+++ b/Commands/Convert Line : Selection to URL Escapes.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
print STDIN.read.gsub(/([^a-zA-Z0-9_.-]+)/n) {
'%' + $1.unpack('H2' * $1.size).join('%').upcase
diff --git a/Commands/Convert to HTML Entities.plist b/Commands/Convert to HTML Entities.plist
index d740df5..eee8851 100644
--- a/Commands/Convert to HTML Entities.plist
+++ b/Commands/Convert to HTML Entities.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
$KCODE = 'U'
$char_to_entity = { }
diff --git a/Commands/Convert to named entities excl tags.plist b/Commands/Convert to named entities excl tags.plist
index 1f70d47..7d45c8b 100644
--- a/Commands/Convert to named entities excl tags.plist
+++ b/Commands/Convert to named entities excl tags.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
$KCODE = 'U'
$char_to_entity = { }
diff --git a/Commands/Decode HTML Entities.plist b/Commands/Decode HTML Entities.plist
index 726e818..fe1a3df 100644
--- a/Commands/Decode HTML Entities.plist
+++ b/Commands/Decode HTML Entities.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
$KCODE = 'U'
$entity_to_char = { }
diff --git a/Commands/Decode Numeric URL Escapes in Line : Selection.plist b/Commands/Decode Numeric URL Escapes in Line : Selection.plist
index 38a6dff..c3d52c5 100644
--- a/Commands/Decode Numeric URL Escapes in Line : Selection.plist
+++ b/Commands/Decode Numeric URL Escapes in Line : Selection.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require 'cgi'
print CGI.unescape(STDIN.read)
diff --git a/Commands/Documentation for Tag.plist b/Commands/Documentation for Tag.plist
index 4a5a5ae..0ffdf46 100644
--- a/Commands/Documentation for Tag.plist
+++ b/Commands/Documentation for Tag.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
#
# Lookup current word as a tag name on w3c.org
#
diff --git a/Commands/Encrypt Line : Selection (ROT 13).tmCommand b/Commands/Encrypt Line : Selection (ROT 13).tmCommand
index 469ed8f..9dba1b2 100644
--- a/Commands/Encrypt Line : Selection (ROT 13).tmCommand
+++ b/Commands/Encrypt Line : Selection (ROT 13).tmCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
def e_js(str)
str.gsub(/(?=[\\"])/, '\\').gsub(/\n/, '\n').gsub(/[@.\/]/) { |ch| sprintf('\\%03o', ch[0]) }
diff --git a/Commands/Insert Close Tag.plist b/Commands/Insert Close Tag.plist
index 376af0d..fb6ab4d 100644
--- a/Commands/Insert Close Tag.plist
+++ b/Commands/Insert Close Tag.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
doc = STDIN.read
line = ENV['TM_LINE_NUMBER'].to_i
diff --git "a/Commands/Insert Entity\342\200\246.plist" "b/Commands/Insert Entity\342\200\246.plist"
index b2d5c3e..d9d1d36 100644
--- "a/Commands/Insert Entity\342\200\246.plist"
+++ "b/Commands/Insert Entity\342\200\246.plist"
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -w
+ #!/usr/bin/env ruby18 -w
require "#{ENV['TM_SUPPORT_PATH']}/lib/osx/plist"
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
diff --git a/Commands/Insert Tag Pair.plist b/Commands/Insert Tag Pair.plist
index 2875936..7518ef3 100644
--- a/Commands/Insert Tag Pair.plist
+++ b/Commands/Insert Tag Pair.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
+ #!/usr/bin/env ruby18 -wKU
#
# This script will expand the current word into: <word></word>
# It will recognize HTML 4.0 tags that need no close tag.
diff --git a/Commands/Persistent Include.tmCommand b/Commands/Persistent Include.tmCommand
index d9a39cc..a47854b 100644
--- a/Commands/Persistent Include.tmCommand
+++ b/Commands/Persistent Include.tmCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb"
TextMate::Includes.instance.include_command
diff --git a/Commands/Preview in All Active Browsers.plist b/Commands/Preview in All Active Browsers.plist
index 3b2e55d..cbf91d3 100644
--- a/Commands/Preview in All Active Browsers.plist
+++ b/Commands/Preview in All Active Browsers.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
saveActiveFile
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
+ #!/usr/bin/env ruby18 -wKU
#
# Open Document in Running Browser(s)
#
diff --git a/Commands/Tidy.plist b/Commands/Tidy.plist
index f5d70a8..4185723 100644
--- a/Commands/Tidy.plist
+++ b/Commands/Tidy.plist
@@ -9,7 +9,7 @@
capturePattern
line (\d+) column (\d+) - (.*?)$
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
+ #!/usr/bin/env ruby18 -wKU
require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes.rb'
diff --git a/Commands/Update Includes.tmCommand b/Commands/Update Includes.tmCommand
index 9935c68..09be7cc 100644
--- a/Commands/Update Includes.tmCommand
+++ b/Commands/Update Includes.tmCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb"
TextMate::Includes.instance.process_persistent_includes
diff --git a/Commands/Update Project.tmCommand b/Commands/Update Project.tmCommand
index 597e089..47ace8b 100644
--- a/Commands/Update Project.tmCommand
+++ b/Commands/Update Project.tmCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb"
TextMate::Includes.instance.process_persistent_includes_for_project
diff --git a/Commands/W3C validation.plist b/Commands/W3C validation.plist
index 2d30f23..f2b8812 100644
--- a/Commands/W3C validation.plist
+++ b/Commands/W3C validation.plist
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
+ #!/usr/bin/env ruby18 -wKU
STDOUT.sync = true
page = STDIN.read
diff --git a/DragCommands/Image Tag.plist b/DragCommands/Image Tag.plist
index 259f517..1b05426 100644
--- a/DragCommands/Image Tag.plist
+++ b/DragCommands/Image Tag.plist
@@ -3,7 +3,7 @@
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU
+ #!/usr/bin/env ruby18 -wKU
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
require "shellwords"
require "cgi"
diff --git a/DragCommands/Insert Flash Movie (Swf).tmDragCommand b/DragCommands/Insert Flash Movie (Swf).tmDragCommand
index 8b5edb1..987a016 100644
--- a/DragCommands/Insert Flash Movie (Swf).tmDragCommand
+++ b/DragCommands/Insert Flash Movie (Swf).tmDragCommand
@@ -5,7 +5,7 @@
beforeRunningCommand
nop
command
- #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
+ #!/usr/bin/env ruby18
require "zlib"