eval使わないなら、こんな感じ?
配列が頑張るなら、こんな感じ?
[target_dir]. select_recent. reverse[0..7]. delete_current_file. collect_view_paths. open_menu
微妙かなw
require File.dirname(__FILE__) + '/open_from_menu' include Mate::OpenFromMenu module Mate module OpenRecent def open_recent(target_dir = ENV["TM_PROJECT_DIRECTORY"]) [target_dir]. select_recent. reverse[0..7]. delete_current_file. collect_view_paths. open_menu end end end class Array include Mate::OpenFromMenu def select_recent root = self[0] root = ENV["HOME"] if root == nil Dir.glob("#{ root }/**/*.*").sort_by { |f| File.mtime(f) } end def delete_current_file self.select { |e| e != ENV["TM_SELECTED_FILE"] } end def collect_view_paths self.collect { |e| dir_base = File.split(e) [dir_base[1], e] } end def open_menu open_from_menu(self) end end __END__ #!/usr/bin/env ruby require ENV['TM_BUNDLE_SUPPORT'] + "/lib/mate/open_recent" include Mate::OpenRecent open_recent