ActiveState Community

All / Any

Debugging Ruby 1.9.1+ in Komodo 5.2

OS: All / Any | Product: Komodo | tags: debugging ruby 1.9
Question: 

How do I debug with Ruby 1.9 in Komodo?

Answer: 

We put the wrong gem install instructions in Komodo 5.2 -- it should be:

gem install ruby-debug-base19

First, the gem doesn't work with Ruby 1.9.0. As I write this, version 1.9.1 is the most recent, but I expect this gem will work with future 1.9 versions.

Second, you *can* use earlier versions of Komodo to debug Ruby 1.9 -- simply edit
/.../support/dbgp/rubylib/rdbgp.rb, and change this line:

elsif ver == 1 && subver == 9
elsif ver == 1 && subver == 9

to

elsif ver == 1 && subver == 9 && teeny == 0
elsif ver == 1 && subver == 9 && teeny == 0

Rails debugging triggers an internal error message

OS: All / Any | Product: Komodo | tags: rails debugging
Question: 

When I try to debug Rails apps or unit tests in Komodo, I get an error message "INTERNAL ERROR!!! You have a nil object when you didn't expect it!" instead of breaking.

Answer: 

The problem is that a couple of Rails files are now loading ruby-debug-base whether it's requested or not. The result is that a mixture of objects in the Debugging module are loaded, and they conflict.

I submitted a patch at https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2895 requesting that Rails loads the debugging environment only if it hasn't been loaded yet. I don't know if the patch has been applied to trunk yet, but it's an easy fix:

Find the two files in either your gem or vendor area:

actionpack/test/abstract_unit.rb
railties/lib/test_help.rb

Find these lines:

begin
  Debugger.start
rescue LoadError
  # Debugging disabled. `gem install ruby-debug` to enable.
end
begin
  Debugger.start
rescue LoadError
  # Debugging disabled. `gem install ruby-debug` to enable.
end

and change the 'end' to

end unless defined? Debugger
end unless defined? Debugger

Searching "single line" regex

OS: All / Any

How can I use regex in the search box with the "single line" modifier?

Any chance to do a super smart replace?

OS: All / Any

I run into the situation all the time that I have to replace text that's written in different cases.
E.g. GreaseMonkey, greaseMonkey, greasemonkey, GREASEMONKEY

I would suggest that the find/replace should be that clever that if I input

find: greasemonkey
replace: WindowWasher

it will replace:
GreaseMonkey -> WindowWasher
greaseMonkey -> windowWasher
greasemonkey -> windowwasher
GREASEMONKEY -> WINDOWWASHER

Simple, isn't it? Would save doing replace 2-3 times for the different cases.

Reproducable INTERNAL ERROR in Komodo debugger

OS: All / Any

I would like to debug model classes in Komodo without firing up a browser.
For example, to debug the Junk class below, I create a file that sets up
the Rails environment, then invokes a method from Junk for debugging.
When I do, I get an internal error from komodo.

Here are two simple files that reproduce the bug. Without breakpoints set,
the code runs fine to completion. When I set a break point, it blows up.

Any ideas from Active State?


########################### junk.rb #####################################
#!/usr/bin/env ruby

class Junk < ActiveRecord::Base

How to Debug from the Rails Console?

OS: All / Any

Newbie question:

I have a young rails app and I would like to debug some of the model methods within Komodo without going through the server.

Ideally this would mean setting a breakpoint in the source file in Komodo, then running code that will invoke that code from the console.

Also could put together a small file that has the same code as I'm suggesting for the console that I run from the debugger, but when I do that, none of the rails directories are found.

Do I need a magic header to get ruby to find all the files in my rails app tree?

possible to deserialize xmlc file from within a macro?

OS: All / Any

Is it possible to deserialize, inspect and reserialize an xmlc file from within a komodo macro? What is the format of an xmlc file?

TIA for any info.

[Extension] Fast Open under Projects

OS: All / Any

Integrates the Fast Open extension under the Projects pane.

What it does:

The built-in filter box under the Projects pane is out-of-date, slow and has issues with projects where Live Import is turned off. The new Fast Open extension in contrast is fast, works well with any type of project, and best of all it can index files from history.
This extension replaces the built-in filter box with an updated Fast Open box:

Suggestion: Edit trigger characters for "autocomplete fill-up"

OS: All / Any

While I, in general, like the autocomplete fill-up characters option, it creates a problem when working with CSS. Since '-' is a trigger character, and also a valid part of a name in CSS, it would be preferable to define, whether globally or language-specific, which characters would trigger the fill-up mechanism.

Can I change the temp. lint file location?

OS: All / Any

Hi,

I've seen it several times that the komodo lint/syntax checker generates a temporary file (in the originals file folder?) to do the syntax check. I dont know if its done this way one all files types, it doesn't really matter.

My problem is that I've files opened from either really slow network drives, or ftps mounted as windows share... and well, the I/O is very lagy, so the linting takes some time.

I found a already a place in some .py files where I can increase the interval how often to do it... but I think it would be better to change the actually location for the temp. file.