Ruby 1.9.2 released
Johan Vermeulen do 19 aug 10
Yuki Sonoda (Yugui) just announced the release of Ruby 1.9.2
Ruby 1.9.2 has the following changes:
- Many new methods
- New socket API (IPv6 support)
- New encodings
- Random class that supports various random number generators
- Time is reimplemented. There is no longer the year 2038 problem.
- some regexp enhancements
- $: no longer includes the current directory.
- dl is reimplemented on top of libffi.
- new psych library that wraps libyaml. You can use the library instead
of syck.
Gepost in hor | 0 reacties
Reverse search in IRB
Roy van der Meij ma 16 aug 10
I just noticed this blog post: improve irb and fix it on mac osx
The first part had my most interest: Reverse searching in irb
And I have to say: WOHOOO :)
In terminal I use reverse searching with ctrl-R a lot.
In case you don’t know, with reverse searching you can easily search in your history of commands.
It’s definitely my choice of weapon in stead of bashing the up key.
Gepost in hor | 1 reactie
I 'Tweet' this
Jeroen Bulters ma 16 aug 10
Although I have a deep-rooted and sincere hatred towards Facebook ‘like’ buttons, I do like “Tweet this” buttons. I just prefer twitter over facebook (at least untill farmville introduces twitter integration).
The guys at Intridea were thinking the same and created a gem to make it easy to incorporate Twitter’s own Tweet buttons into your Rails applications.
Setup is as straightforward as can be. Install the tweet-button gem, include the TweetButton module in your ApplicationHelper (or any other for finer-grained accessibility) and you’re all set.
The only thing left to do is put the button right where you want it.
<%= tweet_button :text => "Pure awesomeness!", :via => "bulters" -%>
Clicking the resulting button will open up a popup which will allow you to tweet the text, followed by the url of the page (which, in turn, will be shortened automatically by Twitter’s future t.co service) and the associated user.
Of course, it is possible to set some preferences globally. This is done by setting the default_tweet_button_options variable of the TweetButton module. For example:
TweetButton.default_tweet_button_options = {:via => "bulters" }
Incorporating tweet button’s can’t get any easier than this.
Gepost in hor | 0 reacties
The misconception on Ruby threads
Dax Huiberts ma 16 aug 10
Yehuda Katz talks about the misconception of Ruby threads and that they are not as bad as they seem.
This misconception is partly based on the fact that a multithreaded Rails app is not comparable to a higly concurrent application which most Ruby thread tests are based on.
The other part is that most problems date back to old Rails versions, old mongrel versions and the old mysql gem, which did not supply the required environment for correctly working threads in a Rails application.
The only ‘problem’ left remaining is that Ruby 1.9’s YARV VM doesn’t allow a Ruby process to run simultaneously on multiple cores, thus requiring one process per CPU core. This is not the case with JRuby and work is underway for Rubinius to use only one process for all CPU cores.
Read Yehuda’s article on Ruby threads for a extended overview of this information.
Gepost in hor | 0 reacties
New kid in town: Mongomatic
Paul Engel ma 16 aug 10
Untill a few weeks ago, there were two popular libraries to use MongoDB from Ruby: Mongoid and MongoMapper.
But there’s a new kid in town: Mongomatic!. This gem is created by Ben Myles and John West. Mongomatic as described on their website:
Mongomatic is a Ruby library that lets you easily model your MongoDB documents in your applications.
The primary design goals of Mongomatic are simplicity and adherence to MongoDB conventions. Mongomatic is not an ActiveRecord clone and has been designed to fit nicely with the document-oriented nature of MongoDB.
Features include cursors, hash access to your document and embedded documents, validations, callbacks and conventions for creating indexes and relationships.
In case you wonder whether Mongomatic is used in production: it is! Meta+Level Games does with the social game Shadelight.
Interested? Check out the Mongomatic website. It is easy to read as it describes all aspects very clear and simple.
Gepost in hor | 0 reacties
Placeholder.it
Daniel Willemse wo 11 aug 10
Recently, i discovered this website that generates placeholders for you on the fly like so:
It will generate an image for you, where you specify attributes like size, color and text in the url.
Like:
placehold.it/100x100&text=like this
To make things even better, Matt Darby came up with a gem that lets you generate placeholders with ruby code.
Simply install the gem Placeholder
and use it like this:
Placeholder.new(:size => 300, :fg_color => "aa0000", :bg_color => "00aa00", :text => "see how easy it is?")
and you’re done.
check it out at: http://github.com/mdarby/placeholder
and see what more you can specify.
Gepost in hor | 0 reacties
Git tip: Removing remote tags
Johan Vermeulen vr 06 aug 10
Last week I needed to delete some tags from a remote Git repository. You probably won’t need to do this often, but just in case:
If you have a tag called ‘release-1.0.1’ which you would like to delete, this is howto remove it:
git tag -d release-1.0.1 git push origin :refs/tags/release-1.0.1
This will remove the ‘release-1.0.1’ tag from the remote repository.
Gepost in hor | 2 reacties
OpenGem
Stephan Kaag wo 04 aug 10
You might be familiar with GemEdit. This is a great gem that lets you quickly open up the source for a gem in your favorite editor.
In the same category OpenGem is now available.
If you install OpenGem, you’ll have two handy commands available:
- gem open rails will open the gem’s source code in an editor of your choice, and
- gem read rails will open a browser pointed to the gem’s documentation.
That’s one extra feature compared with GemEdit. Wicked!
Gepost in hor | 0 reacties
Browsing Git in Ruby
Jeroen Bulters di 03 aug 10
Recently I’ve been working on a project which involves a lot of interaction with git repositories. When I started hacking around, all interaction with the repository was performed through `shell` commands which – of course – works; but can not really be called idiomatic Ruby.
Luckily I’m not the only one who thinks so. During a presentation by Chris Wanstrath (detailing the stack GitHub uses) I was pointed to Scott Chacon’s GRIT.
Grit is an object oriented wrapper for interacting with any git repository and has only one dependency, git itself (which you have installed… RIGHT?).
Through grit it is possible to walk through a repository in a way we are all quite familiar with. For example, the following snippet gives me all commits made by me during the past 14 days in a repository.
require 'rubygems' require 'grit' require 'optparse' # OptParse code omitted for brevity # The option hash is supposed to have a committer, branch and days # (number of days to check) value. options = {} options[:committer] = 'Jeroen Bulters' options[:branch] = 'master' options[:days] = 14 repo = Grit::Repo.new(Dir.pwd) # Collect commits # Ok, I admit, this is rancid, should use rails' fixnum ext. start_date = (Time.now - (options[:days] * 60 * 60 * 24)) commits = repo.commits.select{|c| c.date > start_date} filtered_commits = commits.select{|c| c.committer.to_s == options[:committer]} puts "Found #{filtered_commits.size} commits..."
Although this is a fairly straightforward example, we should not forget that a git repository is a ‘simple’ directed acyclic graph. So get out your favorite graph traversal algorithm and apply it in some
way to your repositories (shortest path between root-commit and master anyone?), it’s easy, it’s fun and it doesn’t hurt!
Gepost in hor | 0 reacties
Ruby5
Daniel Willemse do 29 jul 10
This week, when looking for an answer to one of my ruby issues, I stumbled across
an awesome website called ruby5.envylabs.com
Where you can listen to, and get updated on the latest ruby news in a couple of minutes.
You can subscribe to it via iTunes, and it also has an RSS-feed.
Pretty easy to keep updated now, as you can just listen to it while doing your daily ruby business.
Check it out!
Gepost in hor | 0 reacties
Welkom op Holland On Rails
Het startpunt voor Ruby On Rails in Nederland. Vind de laatste technieken, meningen en nieuwtjes.Recente Jobs
Gezocht: Ruby On Rails ontwikkelaar (junior of senior)
Eet, drink en droom jij over Ruby On Rails? Wil jij het liefste dag en nacht bezig zijn met jehobby; super coole webapplicaties ontwikkelen in Ruby On Rails?
Dan willen wij jou graag een podium bieden om je Ruby skills te vertonen aan onze nationale en internationale klanten!
@ Internetbureau Holder, Obdam
Bekijk alle jobs »»
Gereedschapskist
Onmisbare tools vooriedere developer!
- Ruby On Rails
Framework voor de web 2.0 developer. Eindelijk vooruitgang! - TextMate
Editor for true pro's
Typ, tab, top :-)
Nee, niet voor Win. - Made On A Mac
En nou is het over met die saaie grijze Windows bak van je!
Auteurs op deze site
Chris Obdam
'Less is more' evangelist, past dit ook dagelijks toe op zijn tandenborstel.Chiel Wester
Snelheidswonder op Ruby wielen. Leuk om mee te pair-programmen ;-)