Friday Nov 20, 2009
Monday Apr 20, 2009
By Erno Mononen on Apr 20, 2009
from /usr/lib/ruby/gems/1.8/gems/rspec-1.2.4/lib/spec/runner/options.rb:119:in `run_examples' from /usr/lib/ruby/gems/1.8/gems/rspec-1.2.4/lib/spec/runner/command_line.rb:9:in `run' from /usr/lib/ruby/gems/1.8/gems/rspec-1.2.4/bin/spec:4 ...The good news is that the issue is fixed in 6.7 builds and for 6.5.1 you can fix it by downloading this file and copying it to the netbeans_install_dir/ruby2 directory. You may want to make a backup of the existing nb_rspec_mediator.rb file in that directory first.
Update: There was still an issue with running focused tests as reported by Asfand Yar Qazi. I've now changed the link to point to a newer version that should fix that problem.
Friday Apr 17, 2009
By Erno Mononen on Apr 17, 2009
Thursday Apr 16, 2009
By Erno Mononen on Apr 16, 2009
-Djruby.compat.version=RUBY1_9switch. If you have a plain Ruby project, you can add it to the JVM Arguments field in Project Properties -> Run. For a Rails project, you need to add
path_to_your_project dir/nbproject/project.properties.(Obviously, there needs to be a more user friendly way to do this). Note that if you want to run JRuby in 1.9 mode from the command line, it is as easy as
jruby --1.9 ...If you use MRI, it is enough to point the project to use a MRI 1.9 platform and the parser will be switched to the 1.9 mode automatically. Now, time for a screenshot of the 1.9 parser in action (see e.g. this document for changes in 1.9): The notable thing in the above screenshot is of course the lack of error stripes in the editor. As always, please give it a try and let me know how it works for you (see here for instructions on how to get a dev build). Also, please note the debugging support for 1.9 is still not there.
Tuesday Apr 14, 2009
By Erno Mononen on Apr 14, 2009
Tuesday Mar 10, 2009
By Erno Mononen on Mar 10, 2009
Monday Mar 09, 2009
By Erno Mononen on Mar 09, 2009
Friday Jan 23, 2009
By Erno Mononen on Jan 23, 2009
In the project logical view, under the platform node, you can now see the gems installed for that platform:
At least I find myself often wanting to look at sources for gems, so this should make it a bit more convenient to open gem source files in the IDE.
The Rake Runner dialog now maintains a list of previously entered task parameters (instead of just the last one entered):
For db:migrate tasks it also prepopulates the combo box with the migrations found in the project:
It'd be nice if the combo box had autocomplete, something I'll need to look at that still.
There are also a couple of testing related enhancements, one is Run Focused test and Run again/Debug support for Shoulda and another one a visual diff viewer for assert_equals failures.
There's a View Differences action on the test method node for assert_equals failures:
(And as you can see the test runner's got a new set of icons too).
When you invoke it, you get the following viewer:
There is more of course, but I'll leave something for the next entry too. Comments / ideas for improvements / bug reports are welcomed as always!
Wednesday Dec 10, 2008
By Erno Mononen on Dec 10, 2008
Chris Kutler and Brian Leonard have finished their NetBeans Ruby book. I had the pleasure to be the book's technical reviewer. I think Chris and Brian did a great job, the book should be a good resource for anyone using (or thinking about using) NetBeans for Ruby development. Congrats Chris and Brian!
Tuesday Oct 21, 2008
By Erno Mononen on Oct 21, 2008
Tuesday Aug 26, 2008
By Erno Mononen on Aug 26, 2008
Since the initial introduction of the new test runner in the NetBeans Ruby IDE it has gone through some changes and improvements that I thought I should document somewhere. Eventually I'll turn this into a wiki page. I'll explain here a bit what it does under the hoods; it might not be that interesting for all users as it should just work, but I'm sure many users like to understand what exactly it runs.
Test actions in the project context menu
There are at most three test related actions in the menu: Test, RSpec Test and AutoTest:
What actions are displayed depends on what gems you have installed; if the target platform of the project has the RSpec gem installed, the RSpec Test action is visible. Similarly for AutoTest, just that it requires the ZenTest gem.
By default, the Test and RSpec Test actions try to invoke the corresponding Rake task and run that. So if your project has a 'test' Rake task, that will be run by the Test action. For RSpec Test action the respective Rake task is 'spec'. So in effect these actions are just shortcuts for rake 'test' and 'spec' tasks, if the project has such tasks. If not, they will run all tests found in the test folders of the project; the RSpec Test actions runs all \*spec.rb files in those folders and the Test action in turn all \*test.rb and test\*.rb files.
The AutoTest action basically just runs the autotest command on the project. It was integrated with the new test runner just recently, in 6.5 Beta AutoTest results are displayed just in the output window.
Rake tasksBy default the test runner is associated with the following tasks:
- Test/Unit: 'test' and all tasks starting with 'test:'
- RSpec: 'spec'
The test runner now checks for project.properties (and/or private.properties) for the following properties:
- 'test.tasks' for test/unit tests
- 'spec.tasks' for rspec tests
If those properties are not defined, the test runner will run by default the following tasks:
- 'test' and all tasks starting with 'test:' for test/unit
- 'spec' for rspec
test.tasks=test,my_tests,yet_another_test_task spec.tasks=spec,my_test_specsIf you define the property but leave the value empty, no tasks will be associated with the test runner. So if you for some reason don't want to run any tasks through the test runner, you can do:
By Erno Mononen on Aug 26, 2008
RailsConf Europe is taking place next week in Berlin and we'll be present there too. I have a session with Petr Jiricka on developing Ruby and Rails applications with the NetBeans IDE on Thursday. Those interested in NetBeans and/or JRuby might find also the following sessions of interest:
- Rails Powered by GlassFish
- Take the JRuby Challenge: Deploy Your Rails Application with JRuby
- JRuby: The Other Red Meat
If you have any particular things that you'd like to see covered in our session, let me know and we'll try to fit it in the presentation.
The conference seems to be full of interesting sessions, I'm looking forward to learning what's happening in the Rails world and speaking to people there. We'll have a NetBeans booth there somewhere, so if you'll be there and want to have a chat about NetBeans or anything just come by the booth, or let me know and we can arrange a meetup somewhere.
Monday Jul 21, 2008
By Erno Mononen on Jul 21, 2008
Based on a couple of postings I've seen on the various Ruby and Rails forums on the internet, there seems to be some confusion about how exactly NetBeans and JRuby are integrated. One source of confusion is probably the term we use for the JRuby version bundled with the IDE, i.e. "built-in". It does not mean that the bundled version is modified in any way to work with the IDE; in fact it is just the standard JRuby distribution and the IDE works fine without it. We do bundle some additional gems, e.g. Rails and activerecord-jdbc-adapter for a better out-of-the-box experience, but the JRuby bits themselves are untouched. You can (and generally should) upgrade to a newer version of JRuby whenever one is available; if you add the new version to your PATH environment variable it will be even autodetected by the IDE -- if not, just add it manually using the Platform manager by pointing it to
Adding a new platform, Tools -> Ruby PlatformsIn addition to JRuby we naturally support Matz's Ruby (MRI) too, and thanks to Martin in the upcoming 6.5 also Rubinius is supported. Managing them is equally straightforward as for JRuby, and the same goes for autodetection. If you run into an issue you don't seem to figure out what could be causing it and suspect it must be the IDE, it is a good idea to try out running the problematic piece of code on another platform to make sure you're not seeing an issue specific to MRI/JRuby/Rubinius -- if that's the case, best to file an issue directly into the issue tracker of that Ruby platform. If unsure, it is perfectly fine to file such issues to our IZ too, eventually they'll be dispatched to the right place.
That said, the IDE does still in fact need a JRuby version that is specific to the IDE, namely the internal one that is used for providing editor features. However, this is not the same JRuby as the user visible one (i.e. the "built-in" version visible in the menus), instead it is completely hidden from the user.
PS. In related news, JRuby 1.1.3 was just released -- so go get it!
Sunday May 25, 2008
By Erno Mononen on May 25, 2008
- What's New in NetBeans 6.8?
- NetBeans 6.5 and RSpec 1.2
- Type Inference for Constants
- Ruby 1.9 Support
- Browser not launched with Rails 2.3.2 and NetBeans 6.5
- Output Window in Test Runner
- Code Completion for Dynamic Finders
- New Ruby Features in 7.0 M2
- NetBeans Ruby IDE book is out!
- 6.5 RC1 out of the oven.. time to get ready for 7.0!