Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removes .rb from dragged filename

  • Loading branch information...
commit 41831ff0c90f3c8d5f25f3b75f085d238a07c5b4 1 parent 2313ae1
@drnic authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 DragCommands/Require Ruby Files.tmDragCommand
View
5 DragCommands/Require Ruby Files.tmDragCommand
@@ -5,7 +5,10 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string>echo "require File.dirname(__FILE__) + '/$TM_DROPPED_FILE'"</string>
+ <string>#!/usr/bin/env ruby
+
+file_path = ENV['TM_DROPPED_FILE'].gsub(/\.rb$/, '')
+puts "require File.dirname(__FILE__) + '/#{file_path}'"</string>
<key>draggedFileExtensions</key>
<array>
<string>rb</string>
Please sign in to comment.
Something went wrong with that request. Please try again.