我是 Aptana 的新手,所以我可能会遗漏一些明显的东西。我创建的那个包中的问题在加载 Aptana 时没有被激活。我必须更新 rubble.rb 文件的日期才能正常工作。
touch ~/Documents/Aptana Rubles/ioncubeEncode.ruble
在我这样做之后,在 Aptana 会话的其余部分中,一切都很顺利。
我不认为这是相关的,但这里是捆绑代码,它工作得很好(当它工作时):
require 'ruble'
#Ruble::Logger.log_level = :trace
bundle do |bundle|
bundle.author = "Sasha"
bundle.copyright = "None"
bundle.display_name = "Ioncube Encode"
bundle.description = "Encode just saved php file form base_local to base folder"
end
command "Ioncube Encode" do |cmd|
cmd.input = :document
cmd.output = :output_to_console
cmd.trigger = :execution_listener , "org.eclipse.ui.file.save"
cmd.invoke do |ctx|
source_path = ENV['TM_FILEPATH']
ext = File.extname(source_path)
if ext == '.php'
if ( source_path =~ /base_local/)
destination_path = source_path.sub('/base_local/','/base/')
#CONSOLE.puts "Ioncube Encoding: " + source_path + " to " + destination_path
exec="/usr/local/ioncube/ioncube_encoder5 -v --optimize more --without-loader-check " + source_path + " -o " +destination_path + " 2>&1"
IO.popen(exec, 'r+') do |io|
io.close_write
CONSOLE.puts io.read
end
end
end
end
end
这可能看起来没什么大不了的,但它困扰着我 - 很多。