Ph values

Stephan on testing, software (good and bad), Ruby and the world at large

Posts Tagged ‘Ruby’

TextMate 1.5.10 … and Ruby 1.9.2

Posted by Stephan on 13. November 2010

There’s a new version of Textmate available. Cool, thanks! However after installing … I couldn’t run Rake tasks anymore (the keyboard short cut to remember: Shift-Ctrl-R).

In ‘rake_mate.rb’ (line 49, /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RakeMate/rake_mate.rb). I inserted “.lines” to make it look like this:

tasks = [DEFAULT_TASK] + tasks.lines.grep(/^rake\s+(\S+)/) { |t| t.split[1] }

Additionally I had to ‘re-copy’ the plist.bundle as described on the rvm site.
Now everything works fine again.

Addendum: As mentioned in the rvm guide to using TextMate, I had to (re) move TextMate’s own Builder.rb out of the way:

cd /Applications/TextMate.app/Contents/SharedSupport/Support/lib/ ; mv Builder.rb Builder.rb.backup

Posted in Programming, Uncategorized | Tagged: , | Leave a Comment »

More RVM, TextMate, Ruby and (!) Rails godness

Posted by Stephan on 9. November 2010

Here’s another article on the topic of rvm, Textmate, Ruby & Rails: Blended Musings (http://blendedmusings.blogspot.com/2010/10/getting-rvm-textmate-ruby-187-and-192.html)

Posted in Programming, Ruby, Uncategorized | Tagged: , , , | Leave a Comment »

Another note to self: RVM, TextMate and Ruby 1.9.2

Posted by Stephan on 8. November 2010

Getting rvm and Ruby 1.9.2 and TextMate can be a bit of work, especially if you’re using rake as well inside TextMate.

Good Thing there’s a solution already: Jim blogged about it at “RVM, ruby 1.9 and TextMate“. Thanks Jim!

 

Posted in Programming, Ruby | Tagged: , , , | Leave a Comment »

Ruby, Sequel and Trees

Posted by Stephan on 28. July 2009

While working on some tree structure a couple of unit tests failed, when creating some form of summary of said tree structure. First of all here’s a condensed form of the code:

require 'sequel'

DB = Sequel.sqlite
DB.create_table :items do
  primary_key :id
  String :name
  String :foo, :default => 'NOT SET'
  Integer :item_id
end

class Item < Sequel::Model
  one_to_many :items
  def summary
    if items.empty?
      return [ { self.name => self.foo } ]
    else
      items.inject( [] ){ | r, sub_res | r << sub_res.summary }
    end
  end
end

r1 = Item.create :name => 'R1'
r2 = Item.create :name => 'R2'

r1.add_item r2
r2.foo = 'Ding'
#r2.save

[ r1, r2 ].each{ |i|
  puts "Item    : #{ i.id }"
  puts "Direct Foo: #{ i.foo.inspect }"
  puts "Summary   : #{ i.summary.inspect }"
  puts
}

Notice, that I’ve commented out saving r2. The output is:

Item    : 1
Direct Foo: "NOT SET"
Summary   : [[{"R2"=>"NOT SET"}]]

Item    : 2
Direct Foo: "Ding"
Summary   : [{"R2"=>"Ding"}]

What I didn’t expect – and why the unit tests failed – is the ‘NOT SET’ in the r1 summary.

One way to end up with what I originally expected is to save r2. Another way is to set r2.foo before adding r1 to r1:

r2.foo = 'Ding'
r1.add_item r2

How ever I’m still not sure whether this is intended behaviour and why it should behave like this. (If it is, I’d like to know why.)
What do you think?

Posted in Ruby, testing, Uncategorized | Tagged: , , | Leave a Comment »

A Pure Ruby Readline

Posted by Stephan on 18. May 2009

 

As found on Github via RubyCorner on DEV_MEM.dump_to(:blog) – Multimedia systems blog.

For all of those who a running Ruby on a Windows machine (known not to be the ideal place to use the readline library) or on some flavour of Unix (where the library might not be available, at least not from scratch), there is now a pure Ruby implementation available: The pure Ruby readline on Github.

Posted in Ruby | Tagged: , , | Leave a Comment »

Euruko 2009 – back from Barcelona

Posted by Stephan on 12. May 2009

These two days with Ruby enthusiasts form all over the world not just Europe was great. Nicely located at citilab, with very good public transportation to the city centre of Barcelona, there was enough space inside as well as out side the building to talk to the other attendees, just relax in the sun or work with the notebook. Two wi-fi networks inside and outside the building could deal well with all the notebooks and mobile phones connected to it. This worked very good indeed.

The presentations I liked most where the ones introducing really exciting and new stuff. First and foremost there’s Rhodes, which enables the creation of native mobile applications with Ruby and HTML. And of course Matz’ keynote was very entertaining as well. More really new stuff was about Adhearsion a way to build voice enabled application with Ruby (and Rails). Then some of the presentations were a really good show. Most notably Javier’s talk about gosu, a framework for games and Pablo’s presentation about Archaeopteryx which was probably the loudest presentation I’ve ever heard. :-)

The only thing that was a tad bit disturbing for me was that I didn’t have one of the mobile microphones available and was kind of stuck behind the table as well as the phones themselves, as they seemed to go silent now and then. Aslak dealt with this best I think, repeatedly saying “Hello?” directly into the microphone whenever it went silent.

I think this year was the first time Twitter was heavily used during Euruko, reusing a bot made for Scotland on Rails. and this helped enhancing the communication and connecting people even more than in previous years. A special “Thank you” to all for the other attendees who gave me direct feedback about the presentation as well as the corresponding discussion about it, including but not limited to: Andrew Miller, Tim Becker, Mike Just, Dave Frey. Thanks a lot, indeed.

More summaries are available from Javier and Tomasz

Next year Euruko will take place in Krakow, Poland and I’m already looking forward to going there.

Posted in EURUKO, Programming, Ruby | Tagged: , , , , , | Leave a Comment »

Euruko 2009

Posted by Stephan on 9. March 2009

Over at euruko.org the registration is now open. The conference is on the 9. & 10. of May 2009 in Barcelona, Spain. It seems they collected quite a few exciting talks – and mine. ;-)

Really looking forward to going there.

Posted in EURUKO, Ruby | Tagged: , , , | Leave a Comment »

Ruby And Rails In Munich

Posted by Stephan on 12. November 2008

The Ruby & Rails people in Munich will meet on Thursday 13th November 2008 19:00 (CET) at the traditional place, the “Augustiner am Dom”. It’s also entered to the Ruby on Rails UG Wiki. Also see the German rubyforen site.

Posted in Ruby, Ruby on Rails | Tagged: , , , | Leave a Comment »

Citation of the Day

Posted by Stephan on 3. September 2008

In his keynote this morning David Heinemeier-Hansson described legacy software as ‘a thing of the past, we don’t like’. For now that’s my favourite quotation of this RailsConfEurope.

Other than that: Roderick van Domburg of Nedforce gave interesting hints at a metric reporting tool for Rails and Saikuro, a cyclomatic complexity analyzer written in Ruby.

Posted in Ruby, Ruby on Rails | Tagged: , , | Leave a Comment »

Ruby in Munich

Posted by Stephan on 6. April 2008

It’s time for a new Ruby (and Rails) meeting in Munich. We’ll meet on Wednesday 9th of April starting at 19:00 (CEST) in the Pizzeria Michelangelo.

If youre’ coming, please answer via e-mail or comment by Tuesday (08.04.2008) 12:00 CEST (in order to make a reservation for enough tables). 

Possible topics are: A short report from Euruko2008 which happened in Prague in late March, actually any other Ruby related topics.

Posted in Ruby | Tagged: , , | 2 Comments »

Euruko 2008 – Favourite Quotes

Posted by Stephan on 30. March 2008

My favourite quotes of the conference: “…the nasty snake language…” (Matz about Python) and “I don’t know how to use Ruby” (Koichi on Ruby). 

Posted in Uncategorized | Tagged: , , | 1 Comment »

Ruby and Rails in Munich, Germany

Posted by Stephan on 20. November 2007

There’s a “Ruby and Rails” meeting in Munich on Monday 26th November, starting at 19:30. The location is the “Augustiner am Dom”.
In case you’re coming for a beer or two, some Bavarian food etc. please drop me an e-mail at phvalue ät mac point com, so we can arrange a reservation.

Posted in Uncategorized | Tagged: , , , | Leave a Comment »

EURUKO 2007 is over…

Posted by Stephan on 13. November 2007

So the European Ruby Conference is over for 2007 — a big “Thank you!” to everyone involved: Organisers, the Universitiy of Vienna for the great lecture hall and network we were allowed to use, the Viennese who did a great job getting it done, the speakers — keynote or not — and of course all the attendees.

Euruko 2007 - lecture hall entry I was not very surprised to see that Testing, Quality and Beauty of code was a topic again, as was meta programming and really interesting new applications. For more on that including links to the available slides please see the Euruko 2007 Wiki.

If you like to stay connected and watch the photos we shot in Vienna sign up at Facebook and join the “Eurukobackweb” group. There we’ll also try to get “Euruko 2008″ organised. Up to know it’s all open: If you’d like to see it happen in your city or country: Join the group. If you prefer a more sunny season: Join the group. Should you think it should be more organised: Join the group. Or is you “only” like to get in touch with Ruby programmers: Join the group. :)

Hope to see as many of you as possible again next year. And a few more new Eurukoristas. It’s fun, interesting and the coffee was excellent (remember? We were in Vienna).

Posted in Uncategorized | Tagged: , , | Leave a Comment »

TextMate, Ruby & String Interpolation

Posted by Stephan on 7. November 2007

While preparing some code example for the Euruko 2007 I noticed a somewhat strange behaviour of TextMate while editing Ruby code. With the Ruby bundle being active, I expect CMD-R (“Apple-R”) to execute the Ruby code a hand. Which it does, unless the text cursor is inside a string interpolation expression.

An example: The first screen shot shows the example code, the cursor being positioned outside the #{ … }.

cursor_outside_srint_interpol.png

After CMD-R is hit, the output is the expected Ruby output as shown below.

outside_result.png

However, if the cursor is inside the string interpolation expression as below

cursor_inside_print_interpol.png

the result of hitting CMD-R doesn’t meet my expectation:


inside_result.png

I wonder why this happens. Apparently the behaviour has to do the the scope the cursor is in. A hint about how to avoid this is greatly appreciated.

Posted in Uncategorized | Tagged: , , | 3 Comments »

One week with Leopard

Posted by Stephan on 1. November 2007

The (at the time of this writing) new Mac OS X 10.5 Leopard is now installed on my MacBook for a week. Time enough to find the way through a few of the new features. Time Machine is of course an easy way for backing up the system.

Anyway, to me Spaces (virtual desktops) are a lot more important, since I missed this feature before. Of course there was VirtueDesktops (which even featured desktop switching via the motion sensors). However with Spaces you can assign an application to a certain Space.

Terminal now comes with tabs instead of many windows, which also helps keeping the desktops clean. And last but not least Mac OS X now also includes Subversion, Ruby and of course Ruby on Rails, including – but not limited to – gems and Rake.

Only issue: The background image of the login screen needs to be replaced. In case you also like another picture, LoginWindow Manager might be useful for you.

Posted in Ruby | Tagged: , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.