Sha256: 73f4424a6fa6868b21faee234bbd1b7c4299dd567693eb8ea9ef33104d425af2

Contents?: true

Size: 906 Bytes

Versions: 69

Compression:

Stored size: 906 Bytes

Contents

module Debugger
  if RUBY_PLATFORM =~ /darwin/
    class TextMateCommand < Command # :nodoc:
      def regexp
        /^\s*tm(?:ate)?(?:\s*(\d+))?$/
      end

      def execute
        if @match[1]
          frm_n = @match[1].to_i
          if frm_n > @state.context.stack_size || frm_n == 0
            print "Wrong frame number\n"
            return
          end
          file, line = @state.context.frame_file(frm_n-1), @state.context.frame_line(frm_n-1)
        else
          file, line = @state.file, @state.line
        end
        %x|open 'txmt://open?url=file://#{File.expand_path(file)}&line=#{line}'|
      end

      class << self
        def help_command
          'tmate'
        end

        def help(cmd)
          %{
            tm[ate] n\topens a current file in TextMate. 
            \t\tIt uses n-th frame if arg (n) is specifed.
          }
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 11 rubygems

Version Path
ruby-debug-0.11.0 cli/ruby-debug/commands/tmate.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/ruby-debug-0.10.6/cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.6 cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc9 cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc8 cli/ruby-debug/commands/tmate.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc7 cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc5 cli/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc4 cli/ruby-debug/commands/tmate.rb
debugger2-1.0.0.beta2 lib/ruby-debug/commands/tmate.rb
debugger2-1.0.0.beta1 lib/ruby-debug/commands/tmate.rb
needy_debugger-1.4.0 lib/ruby-debug/commands/tmate.rb
debugger-1.4.0 lib/ruby-debug/commands/tmate.rb
debugger-1.3.3 lib/ruby-debug/commands/tmate.rb
debugger-1.3.2 lib/ruby-debug/commands/tmate.rb
debugger-1.3.1 lib/ruby-debug/commands/tmate.rb
debugger-1.3.0 lib/ruby-debug/commands/tmate.rb
debugger-1.2.4 lib/ruby-debug/commands/tmate.rb
debugger-1.2.3 lib/ruby-debug/commands/tmate.rb
ruby-debug-0.10.5.rc3 cli/ruby-debug/commands/tmate.rb