Search the top Ruby & Rails sites with Google Ruby Search

Official Ruby for Symbian Released

November 19th, 2006

spacer

While there have been attempts at porting Ruby to the Symbian (mobile devices) platform before, Symbian have now released an official build of Ruby for Symbian OS (S60 to be precise). This brings Ruby to a vast universe of cellphones. Symbian are providing the project with libraries for rendering, messaging, and persistence on their platforms.

Posted in Miscellaneous, Cool | 3 Comments »

World's Largest Index of Rails Developers, WorkingWithRails, Launches

November 17th, 2006

spacer

DSC, a London based technology consultancy, has today launched Working With Rails, the biggest index of Ruby on Rails developers seen on the Web so far. Quietly launched to a small group of developers several days ago, the site has now gone live for everyone to play with.

I caught up with DSC developer Martin Sadler to learn a little more about the site.

Ruby Inside: What was the motiviation behind developing WorkingWithRails for DSC?

Martin Sadler: At DSC we tend to use Ruby (on Rails) for the majority of our projects and so it seemed fitting that we contribute back in some way for all the benefits ROR has given us.

For me the Wiki is great but has it's limitations when you want to do more complex queries or cross reference against other data sets. The Working With Rails page was one such example. I saw potential and so WWR was born.

RI: What tools and techniques did you use to get the initial data of the 1000+ Rails developers?

MS: I evaluated a number of Ruby tools for getting the data but Hpricot came out tops. I'd love to say we are doing some further fancy stuff under the hood but other than Hpricot it's just standard Rails and a few plugins. (and lots of Mongrels!)

RI: How has the response been from the beta testers so far?

MS: Very enthusiastic and encouraging so far with lots of good suggestions and ideas! Most have commented on the clean and easy to use layout and the ease of finding / browsing people. Also noted has been the neat little features such as being able to find more information about a developer from their profile page through a Google code search, Technorati, etc.

Initial feedback suggests that people will be using it for a number of different reasons, some just curious about other developers in their area / field of influence, others are freelancers hoping to get noticed, and of course companies looking for developers.

There are lots of possibilities as to where this site will go, we've got a few more ideas of our own but we are looking to the wider community for feedback and suggestions first.

Posted in Miscellaneous | 4 Comments »

Simple, fast, full-text search library in 200 lines of Ruby

November 17th, 2006

Mauricio Fernandez continues to extend his Ruby God status with this excellent article about a search library he just developed using pure Ruby. It's simple (mere hundreds of lines), fast (queries in the milliseconds), and practical (he's already using it to index Ruby documentation).

Read about how it works and the techniques he used or just get straight to the source.

Posted in Miscellaneous | No Comments »

Google Video API for Ruby

November 14th, 2006

In the same vein as Shane Vitarana's YouTube library comes a Google Video API for Ruby developed by Walter Korman. The API uses Hpricot to do its dirty work and has a RubyForge project page and in-depth documentation.

Posted in Ruby Tricks, News, Tools | No Comments »

Recursive Descent Parser for Ruby

November 13th, 2006

Sometimes strange things happen. I've been developing a small, basic recursive descent parser for Ruby called RDParse. Just before writing this post I decided to Google that name, and lo and behold the first result is a Ruby recursive descent parser called RDParse, created by Dennis Ranke, that I posted to Code Snippets for posterity several months ago. Since both of these libraries are unlikely to be used at once and that Dennis doesn't seem to be maintaining his version, I've decided to stick with RDParse as the name of mine for now.

You can download my RDParse as rdparse.rb.txt, just rename it at your end if you want to use it. To use it, you'd do something like this (no syntax coloring as the Syntax gem doesn't appear to cope with the complexity):

require 'rdparser'

parser = RDParser.new do |g|
  g.main                'line(s)'
  g.line                'expression separator(?) comment(?)'
  g.comment             '"#" rest_of_line'
  g.rest_of_line        /.+$/
  g.separator           /;/
  g.expression          'term operation expression | term'
  g.term                'number | variable | string | brkt_expression'
  g.brkt_expression     '"(" expression ")"'
  g.number              /d+(.d+)?/
  g.operation           /[+-*/]/
  g.variable            /[a-z][a-z0-9]*/
  g.string              %r(["'](.*?[^\]|.*?)["'])
end

content = %q{
  (34 - 3) * 42;   # Comment here..
  "a" + "bcd"
}

syntax_tree = parser.parse(:main, content)
puts RDParser.text_syntax_tree(syntax_tree)

Here, a grammar is defined within the RDParser.new block, although it can also be passed in as a parameter in a hash. This grammar (for a nonsense language that can only perform basic expressions) is used to fuel a parser that generates the following syntax tree from the code in the content variable:

line
  expression
    term
      brkt_expression
        "(" => (
        expression
          term
            number => 34
          operation => -
          expression
            term
              number => 3
        ")" => )
    operation => *
    expression
      term
        number => 42
  separator => ;
  comment
    "#" => #
    rest_of_line => Comment here..
line
  expression
    term
      string => "a"
    operation => +
    expression
      term
        string => "bcd"

It's simple but effective. My initial version had callbacks and some other features that I discovered I didn't really need (and which I'd poorly implemented anyway). This version just does the basics, lexing and enough parsing to get a tree.

I'm not releasing it as a Gem or on RubyForge yet as it has a long way to go, but for anyone interested in this stuff, see what grammars you can knock up! Next step.. error reporting.

Posted in Miscellaneous, Ruby Tricks | 1 Comment »

Announcing: From .NET to Rails - January 13, Chicago

November 11th, 2006

Softies on Rails is a popular Rails blog that looks at Ruby on Rails from the perspective of .NET developers. They've just announced that they're holding a special one-day workshop where they cover how they went from .NET to Ruby on Rails for Web development and how other .NET developers can do the same.

It's in Chicago, at the Hilton Garden Inn hotel, on Saturday, January 13, 2007, and costs $249 for a whopping 11.5 hours of discussion, presentations, lunch, beverages and snacks. Places are limited to just 20 seats so everyone can get the most value out of it, so if you want to get a ".NET to Ruby" perspective and you can get to Chicago in January, register now!

Posted in News, Ruby on Rails, Windows Specific | No Comments »

Ruby Goes From 13th to 12th Most Popular Language

November 9th, 2006

spacer

Only a month ago Curt Hibbs was celebrating Ruby hitting #13 on the TIOBE Programming Community Index. Well, the November index has been released and it's up another place to #12. As I said to someone the other day, Ruby's a slow burner, but it's persistently upward and slow and steady can win the race.

Posted in News | 1 Comment »

JRuby + SWT = Future Cross Platform Ruby Desktop App Development?

November 9th, 2006

spacer

(Disclaimer: I'm no Java wiz, so if I get anything wrong about Java or its libraries, post comments!)

The SWT (Standard Widget Toolkit) is a GUI widget toolkit for the Java platform. Unlike AWT and Swing, it uses the local operating system's own controls. This means you can develop Java apps that 'look native' on multiple platforms. The popular Eclipse IDE uses SWT to work and looks graphically native on multiple platforms (as does Azureus). SWT is also, reputedly, faster than the other alternatives. Sounds great for developers, right? Java developers.. sure.

I decided SWT was too good an idea to not investigate, so I downloaded JRuby 0.9.1 (a Ruby interpreter written in Java and which provides access to Java classes from Ruby) and set to work. All I had to do was copy the swt.jar and supporting files for my platform into the jruby/lib folder, add "-Djava.library.path=$JRUBY_BASE/lib" \ into the Java call in the bin/jruby helper script.. and then I could write and run code like this:

require 'java'

module SWTTest

  include_package 'org.eclipse.swt'
  include_package 'org.eclipse.swt.layout'
  include_package 'org.eclipse.swt.widgets'

  Display.setAppName "Ruby SWT Test"

  display = Display.new
  shell = Shell.new display
  shell.setSize(450, 200)

  layout = RowLayout.new
  layout.wrap = true

  shell.setLayout layout
  shell.setText "Ruby SWT Test"

  label = Label.new(shell, SWT::CENTER)
  label.setText "Ruby SWT Test"

  Button.new(shell, SWT::PUSH).setText("Test Button 1")

  shell.pack
  shell.open

  while (!shell.isDisposed) do
	  display.sleep unless display.readAndDispatch
  end

  display.dispose
end

This works on OS X (screenshot of result is at the top of this post) but it's all generic so if you can get JRuby and the SWT JAR and support files for your platform, this same code will render a native looking window with a label and button control on whatever platform you're running. The major downsides so far are that it's a bit unstable (if I move the window much, the app crashes) and I can't seem to create events for the controls, although I think this might be due to my lack of Java nous. Also.. it's an experimental piece of software running on an experimental compiler, so it's far from ready for real use, and there are undoubtedly better solutions, but if you like to hack...

Posted in Miscellaneous, Ruby Tricks, JRuby | 18 Comments »

Announcing the Ruby Advent Calendar 2006

November 8th, 2006

spacer

This year Ruby Inside will be presenting a Ruby Advent Calendar. The site's already up but doors won't appear until December 1st. So why am I posting about it already? Well, you can subscribe to the feed right now, so that as soon as December 1st hits, you'll be ready to open the door, and then every day thereafter till Christmas.

Also, I want to see if anyone else wants to create some of the "days". If you want to write / draw / make something that's cool and Ruby related for one of the days, get in touch at rubyinside -/at/- bigbold.com. Of course, you'll get credit for your day, so it might be worth doing if you have a Rails site, Ruby blog, cool tool or something else you want to plug. There are only 25 days and it'll stay up as long as Ruby Inside is around.

Roll on December!

Posted in News | No Comments »

19 Random Rails Tutorials

November 8th, 2006

spacer
RailsForum.com has just announced the winners of their October Tutorial Contest. A lot of cool tutorials came out of the contest, so I wanted to link to them here.

1st place -
HOWTO: Make a Rails Plugin From Scratch by Danger Stevens.

2nd place -
Refactoring on Rails: Move to Model and Refactoring on Rails: Multiple Scopes in Controller by Ryan Bates.

3rd place -
HOWTO: Send Instant Messages in Rails

Other entries
Image uploads and resizing for Rails models with mini-magick
XSS and when h() just ain't enough
Creating Two Models in One Form
Editing Multiple Models in One Form
Test Helper: Clean, Custom Assertion Messages
Debugging on Rails: Reading Stack Traces
Introduction to Form Helpers
Programming Best Practices
Advice to Rails Beginners: Follow Conventions
Handy RJS Tips
Using Autotest with Rails on Windows XP machines
Creating Many Models in One Form
Creating a Variable Number of Models in One Form
Getting Started With RESTful Rails
Rails Migration For Beginners

Posted in Elsewhere, Tutorials, News, Cool | No Comments »

« Previous Entries

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.