<commit_before>require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui"
require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"

module EasyOpen
  module UI
    def open_menu(infos)
      infos = [infos].flatten
      if infos.size == 0
        puts "not found"
        return
      end
      
      if infos.size == 1
        go_to(infos[0]) 
        return infos[0]
      end
      
      displays = infos.map { |info| info[:display] }
      selected  = TextMate::UI.menu(displays)
      return unless selected
      go_to(infos[selected])
      return infos[selected]
    end
    
    def go_to(options = {})
      ri = "txmt://open?url=file://#{e_url options[:file]}"
      ri = ri + "&line=#{options[:line]}" if options[:line]
      ri = ri + "&column=#{options[:column]}" if options[:column]
      `open "#{ri}"`
    end
  end
end<commit_msg>変数名を変更した resource_identifier<commit_after>require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui"
require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate"

module EasyOpen
  module UI
    def open_menu(infos)
      infos = [infos].flatten
      if infos.size == 0
        puts "not found"
        return
      end
      
      if infos.size == 1
        go_to(infos[0]) 
        return infos[0]
      end
      
      displays = infos.map { |info| info[:display] }
      selected  = TextMate::UI.menu(displays)
      return unless selected
      go_to(infos[selected])
      return infos[selected]
    end
    
    def go_to(options = {})
      resource_identifier = "txmt://open?url=file://#{e_url options[:file]}"
      resource_identifier = resource_identifier + "&line=#{options[:line]}" if options[:line]
      resource_identifier = resource_identifier + "&column=#{options[:column]}" if options[:column]
      `open "#{resource_identifier}"`
    end
  end
end
{'fraction_non_alphanumeric': 0.1411631846414455, 'fraction_numerical': 0.004517221908526256, 'mean_word_length': 2.6163265306122447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3595286', 'n_tokens_mistral': 597, 'n_tokens_neox': 595, 'n_words': 120}