mirror of
https://github.com/atom/atom.git
synced 2026-02-12 23:55:10 -05:00
42 lines
1.1 KiB
XML
42 lines
1.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>beforeRunningCommand</key>
|
|
<string>nop</string>
|
|
<key>command</key>
|
|
<string>#!/usr/bin/env ruby
|
|
|
|
file_path = ENV['TM_DROPPED_FILE'].gsub(/\.rb$/, '')
|
|
full_file_path = File.expand_path(file_path)
|
|
relative_path = nil
|
|
known_load_path = %w[app/controllers app/models app/helpers app config lib]
|
|
known_load_path.each do |path|
|
|
if full_file_path =~ %r{^#{File.join(ENV['TM_PROJECT_DIRECTORY'], path)}/(.*)}
|
|
relative_path = $1
|
|
break
|
|
end
|
|
end
|
|
if relative_path
|
|
puts "require '#{relative_path}'"
|
|
else
|
|
puts "require File.dirname(__FILE__) + '/#{file_path}'"
|
|
end
|
|
</string>
|
|
<key>draggedFileExtensions</key>
|
|
<array>
|
|
<string>rb</string>
|
|
</array>
|
|
<key>input</key>
|
|
<string>selection</string>
|
|
<key>name</key>
|
|
<string>Require Rails File</string>
|
|
<key>output</key>
|
|
<string>insertAsSnippet</string>
|
|
<key>scope</key>
|
|
<string>source.ruby.rails</string>
|
|
<key>uuid</key>
|
|
<string>56151E60-589F-4CE7-8062-3E087732E2F1</string>
|
|
</dict>
|
|
</plist>
|