Ruby and Rails Most Recent Stories http://ruby.feedables.com :feeding_you => now en-us bdb: Improved Ruby Bindings for Berkeley DB http://ruby.feedables.com/go/1903342/bdb-Improved-Ruby-Bindings-for-Berkeley-DB <p><img src="http://www.rubyinside.com/wp-content/uploads/2009/01/berkdb.png" width="137" height="67" alt="berkdb.png" style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 solid;" /> <a href="http://en.wikipedia.org/wiki/Berkeley_DB">Berkeley DB</a> is a high performance database system initially developed in the early 1990s. It's not an SQL driven database engine - it just stores data in key/value pairs - but BDB is very fast, available to use on most operating systems, and is <a href="http://www.oracle.com/technology/software/products/berkeley-db/htdocs/licensing.html">dual licensed</a> for open source and commercial use. It has several benefits to just using a flat file or a <a href="http://www.ruby-doc.org/stdlib/libdoc/pstore/rdoc/classes/PStore.html">PStore</a>: transactions, fine-grained locking, replication, and hot backups, for starters.</p> <p>While Ruby bindings already exist for BDB, Matt Bauer&#8230;</p> [via http://www.rubyinside.com/ @ January 9, 2009 @ 6:28pm] Fri, 09 Jan 2009 18:28:29 +0000 http://ruby.feedables.com/story/1903342/bdb-Improved-Ruby-Bindings-for-Berkeley-DB Rails Envy Podcast - Episode #062: 01/07/2009 http://ruby.feedables.com/go/1887400/Rails-Envy-Podcast--Episode-062-01072009 [via http://www.railsenvy.com/ @ January 8, 2009 @ 5:15am] Thu, 08 Jan 2009 05:15:52 +0000 http://ruby.feedables.com/story/1887400/Rails-Envy-Podcast--Episode-062-01072009 DebGem - Ruby Libraries Packaged for Debian and Ubuntu http://ruby.feedables.com/go/1872552/DebGem--Ruby-Libraries-Packaged-for-Debian-and-Ubuntu <p><a href="http://www.debgem.com/"><img src="http://www.rubyinside.com/wp-content/uploads/2009/01/debgem.png" width="162" height="49" alt="debgem.png" style="float:left; margin-right:12px; margin-bottom:12px;" /></a> <a href="http://www.phusion.nl/">Phusion</a>, the company responsible for <a href="http://www.modrails.com/">Passenger</a> - the Rails deployment system, has today <a href="http://blog.phusion.nl/2009/01/06/announcing-debgem-beta-the-rubygem-to-apt-conversion-service/">announced</a> <a href="http://www.debgem.com/">DebGem</a>, a "RubyGem to APT conversion service."</p> <p>Many Debian (and Ubuntu, which is compatible) sysadmins and users prefer to use the <a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool">APT</a> (as in <em>apt-get</em>) package management system for handling the installation of everything on their system. With its separate RubyGems packaging system, however, Ruby can cause a dilemma. While some Ruby stuff is available through the regular repositories, it can be out of date and unreliable. No longer.. DebGem&#8230;</p> [via http://www.rubyinside.com/ @ January 6, 2009 @ 4:34pm] Tue, 06 Jan 2009 16:34:53 +0000 http://ruby.feedables.com/story/1872552/DebGem--Ruby-Libraries-Packaged-for-Debian-and-Ubuntu Generate random password in Rails http://ruby.feedables.com/go/1877226/Generate-random-password-in-Rails <a href="http://railsgeek.com/2009/1/6/generate-random-password-in-rails">http://railsgeek.com/2009/1/6/generate-random-password-in-rails</a> <br /> <br />I am using Restful_authentication plugin for one of my projects. <br />As part of my user creation workflow, system should to generate a random password for the new user. <br />So, look at my password creation behaviour: <br /> <br /> * generate uncrypted password <br /> * send this with e-mail notification <br /> * crypt the password <br /> <br /><controller> <br />class CandidatesController < ApplicationController <br /> ... <br /> if @candidate.valid? <br /> candidate.save <br /> Notifier.deliver_inv(candidate.email, candidate.crypted_password) <br /> candidate.encrypt_password <br /> end <br />end <br /> <br /><model> <br />require 'digest/sha1' <br />class User < ActiveRecord::Base <br /> ... <br /> def encrypt_password <br /> self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{name}--") <br /> self.crypted_password = encrypt(self.crypted_password) <br /> save(false) <br /> end <br /> protected <br /> def save_password <br /> (self.crypted_password = password) unless self.crypted_password <br /> end <br />... <br />end <br /> <br />class Candidate < User <br /> # Callbacks: <br /> before_save :save_password <br /> before_validation_on_create Proc.new do |u| <br /> u.password = Array.new(12) { (rand(122-97) + 97).chr }.join <br /> u.password_confirmation = u.password <br /> end <br /> <br />end <br /> <br /> [via http://snippets.dzone.com/tag/rails @ January 6, 2009 @ 12:50pm] Tue, 06 Jan 2009 12:50:32 +0000 http://ruby.feedables.com/story/1877226/Generate-random-password-in-Rails XmlNuts http://ruby.feedables.com/go/1875698/XmlNuts Ruby <-> XML mapping made easy. <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=XPANcH"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=XPANcH" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ January 6, 2009 @ 8:53am] Tue, 06 Jan 2009 08:53:08 +0000 http://ruby.feedables.com/story/1875698/XmlNuts Statelogic http://ruby.feedables.com/go/1875699/Statelogic A state machine for ActiveRecord models. <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=e6YDOM"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=e6YDOM" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ January 6, 2009 @ 8:49am] Tue, 06 Jan 2009 08:49:35 +0000 http://ruby.feedables.com/story/1875699/Statelogic Announcing the Rails activists http://ruby.feedables.com/go/1863575/Announcing-the-Rails-activists [via http://weblog.rubyonrails.org/ @ January 5, 2009 @ 7:18pm] Mon, 05 Jan 2009 19:18:06 +0000 http://ruby.feedables.com/story/1863575/Announcing-the-Rails-activists Introducing the Rails Activist Team http://ruby.feedables.com/go/1863563/Introducing-the-Rails-Activist-Team [via http://www.railsenvy.com/ @ January 5, 2009 @ 7:16pm] Mon, 05 Jan 2009 19:16:47 +0000 http://ruby.feedables.com/story/1863563/Introducing-the-Rails-Activist-Team Little Known Ways to Ruby Mastery by Josh Susser http://ruby.feedables.com/go/1863585/Little-Known-Ways-to-Ruby-Mastery-by-Josh-Susser A weekly series from the Ruby Masters Welcome to the next installment of the weekly interview series on the RL blog - &#8220;Path to Ruby Mastery&#8221; - by top trainers and developers in the Ruby community, from across the globe. The interview series will provide insight and commentary from these notable Ruby trainers and developers, with [...] [via http://rubylearning.com/ @ January 5, 2009 @ 6:31pm] Mon, 05 Jan 2009 18:31:01 +0000 http://ruby.feedables.com/story/1863585/Little-Known-Ways-to-Ruby-Mastery-by-Josh-Susser option_tags_will_disable http://ruby.feedables.com/go/1875700/option_tags_will_disable Enhances Form helpers making it easy to disable option tags in select fields. <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=dAnsDO"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=dAnsDO" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ January 5, 2009 @ 6:24pm] Mon, 05 Jan 2009 18:24:58 +0000 http://ruby.feedables.com/story/1875700/option_tags_will_disable Reverse SSH Tunnel http://ruby.feedables.com/go/1877227/Reverse-SSH-Tunnel Create a Reverse SSH Tunnel back to you development application from a public facing server. <br /> <br />In config/tunnel.yml <br /><code> <br /> <br />development: <br /> public_host_username: SSH_USERNAME <br /> public_host_password: SSH_PASSWORD <br /> public_host: SSH_SERVER_HOST_NAME <br /> public_port: 8868 <br /> local_port: 3000 <br /> <br /></code> <br /> <br /> <br />In lib/tasks/tunnel.rake <br /><code> <br /> <br />namespace :tunnel do <br /> desc "Start a ssh tunnel" <br /> task :start => :environment do <br /> SSH_TUNNEL = YAML.load_file("#{RAILS_ROOT}/config/tunnel.yml")[RAILS_ENV] <br /> <br /> public_host_username = SSH_TUNNEL['public_host_username'] <br /> public_host = SSH_TUNNEL['public_host'] <br /> public_port = SSH_TUNNEL['public_port'] <br /> <br /> local_port = SSH_TUNNEL['local_port'] <br /> <br /> puts "Starting tunnel #{public_host}:#{public_port} \ <br /> to 0.0.0.0:#{local_port}" <br /> <br /> exec "ssh -nNT -g -R *:#{public_port}:0.0.0.0:#{local_port} \ <br /> #{public_host_username}@#{public_host}" <br /> end <br />end <br /> <br /></code> [via http://snippets.dzone.com/tag/rails @ January 5, 2009 @ 3:49pm] Mon, 05 Jan 2009 15:49:10 +0000 http://ruby.feedables.com/story/1877227/Reverse-SSH-Tunnel SourceClassifier: Identifying Programming Languages Quickly http://ruby.feedables.com/go/1861736/SourceClassifier-Identifying-Programming-Languages-Quickly <p>If you're developing a <a href="http://snippets.dzone.com/">snippets</a> or <a href="http://pastie.org/">pastie</a>-type system or another form of CMS where source code might be stored, it'd be incredibly useful to automatically detect what language a provided source is in so that you can style it appropriately.</p> <p>Chris Lowis' <a href="http://blog.chrislowis.co.uk/2009/01/04/identify-programming-languages-with-source-classifier.html">SourceClassifier</a> (or <a href="http://github.com/chrislo/sourceclassifier/tree/master">Github repo</a>) library does just that, using a Bayesian classifier trained on source code from the <a href="http://shootout.alioth.debian.org/">Alioth Shootouts</a>. Out of the box it has support for C, Java, JavaScript, Perl, Python and Ruby, but you can train it to&#8230;</p> [via http://www.rubyinside.com/ @ January 5, 2009 @ 2:44pm] Mon, 05 Jan 2009 14:44:20 +0000 http://ruby.feedables.com/story/1861736/SourceClassifier-Identifying-Programming-Languages-Quickly Episode 143: PayPal Security http://ruby.feedables.com/go/1859965/Episode-143-PayPal-Security This episode shows how to encrypt the variables passed to PayPal and verify the authenticity of the payment notifications (IPN). [via http://railscasts.com/ @ January 5, 2009 @ 8:00am] Mon, 05 Jan 2009 08:00:00 +0000 http://ruby.feedables.com/story/1859965/Episode-143-PayPal-Security New Book: &quot;Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2&quot; http://ruby.feedables.com/go/1842620/New-Book-quotFlex-on-Rails-Building-Rich-Internet-Applications-with-Adobe-Flex-3-and-Rails-2quot [via http://onrails.org/ @ January 3, 2009 @ 5:14am] Sat, 03 Jan 2009 05:14:48 +0000 http://ruby.feedables.com/story/1842620/New-Book-quotFlex-on-Rails-Building-Rich-Internet-Applications-with-Adobe-Flex-3-and-Rails-2quot pluralized_models http://ruby.feedables.com/go/1837325/pluralized_models pluralized_models is a Rails plugin for automatic pluralized AR models generation. For instance, if you have a Post ActiveRecord model, you will automatically get Posts class proxy to use in for Posts.all/find()/scoped(). <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=09saWa"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=09saWa" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ January 2, 2009 @ 2:59pm] Fri, 02 Jan 2009 14:59:18 +0000 http://ruby.feedables.com/story/1837325/pluralized_models meta_on_rails http://ruby.feedables.com/go/1831338/meta_on_rails MetaOnRails DRYs up your page meta tags. It is a very simple Rails plugin to help you customize your pages' meta tags a little bit easier. <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=orzP1w"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=orzP1w" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ January 1, 2009 @ 1:23pm] Thu, 01 Jan 2009 13:23:35 +0000 http://ruby.feedables.com/story/1831338/meta_on_rails How to Sanitize HTML and CSS in Ruby http://ruby.feedables.com/go/1827596/How-to-Sanitize-HTML-and-CSS-in-Ruby <p><img src="http://www.rubyinside.com/wp-content/uploads/2009/01/sanitize.png" width="98" height="97" alt="sanitize.png" style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 solid;" /></p> <p>If you've developed an application that displays user-supplied text in a Web browser, it's always possible that the user has entered some crazy HTML (or even CSS) that will break your site's layout. While it's easy to remove <em>all</em> HTML from a piece of text, you might <em>want</em> them to use certain subsets of HTML to format their content, so you need to <em>sanitize</em> the user supplied HTML and CSS. Luckily, two Ruby libraries have been released in the last couple of days&#8230;</p> [via http://www.rubyinside.com/ @ January 1, 2009 @ 7:41am] Thu, 01 Jan 2009 07:41:12 +0000 http://ruby.feedables.com/story/1827596/How-to-Sanitize-HTML-and-CSS-in-Ruby How to Sanitize HTML and CSS in Ruby http://ruby.feedables.com/go/1855926/How-to-Sanitize-HTML-and-CSS-in-Ruby <p><img style="float:left; margin-right:12px; margin-bottom:12px; border:1px #000000 solid;" src="http://www.rubyinside.com/wp-content/uploads/2009/01/sanitize.png" alt="sanitize.png" width="98" height="97" /></p> <p>If you've developed an application that displays user-supplied text in a Web browser, it's always possible that the user has entered some crazy HTML (or even CSS) that will break your site's layout. While it's easy to remove <em>all</em> HTML from a piece of text, you might <em>want</em> them to use certain subsets of HTML to format their content, so you need to <em>sanitize</em> the user supplied HTML and CSS. Luckily, two Ruby libraries have been released in the last couple of days&#8230;</p> [via http://www.rubyinside.com/ @ January 1, 2009 @ 7:41am] Thu, 01 Jan 2009 07:41:12 +0000 http://ruby.feedables.com/story/1855926/How-to-Sanitize-HTML-and-CSS-in-Ruby Allowing custom CSS in your app http://ruby.feedables.com/go/1823949/Allowing-custom-CSS-in-your-app [via http://blog.caboo.se/ @ December 31, 2008 @ 10:34pm] Wed, 31 Dec 2008 22:34:12 +0000 http://ruby.feedables.com/story/1823949/Allowing-custom-CSS-in-your-app Rails Envy Podcast - Episode #061: 12/31/2008 http://ruby.feedables.com/go/1822753/Rails-Envy-Podcast--Episode-061-12312008 [via http://www.railsenvy.com/ @ December 31, 2008 @ 6:15pm] Wed, 31 Dec 2008 18:15:35 +0000 http://ruby.feedables.com/story/1822753/Rails-Envy-Podcast--Episode-061-12312008 Top Ruby Presenter of 2008 - Giles Bowkett http://ruby.feedables.com/go/1821933/Top-Ruby-Presenter-of-2008--Giles-Bowkett <p><img src="http://www.rubyinside.com/wp-content/uploads/2008/12/rubytop10-giles.gif" width="400" height="129" alt="rubytop10-giles.gif" style="border:1px #000000 solid;" /></p> <p><em>Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read <a href="http://www.rubyinside.com/rubys-top-10-of-2008-thanking-those-whove-made-ruby-great-this-year-1393.html">this introductory post.</a></em></p> <h3>Giles Bowkett - Controversy, Excitement, and Awesomeness in 2008</h3> <p><img src="http://www.rubyinside.com/wp-content/uploads/2008/12/giles-is-more-fucking-awesome-than-zed.jpg" width="128" height="96" alt="giles-is-more-fucking-awesome-than-zed.jpg" style="float:right; margin-bottom:12px; margin-left:12px; border:1px #000000 solid;" />Giles simply <em>had</em> to feature in Ruby Inside's Top 10 of 2008 and since there's no <em>Top Crazy Mofo</em> category, he instead scores for <a href="http://www.infoq.com/presentations/archaeopteryx-bowkett">this excellent presentation at RubyFringe</a> (yes, it's all there to watch online, thanks to InfoQ!) Despite nominatively being about his "semi-autonomous Ruby musical instrument" <a href="http://github.com/gilesbowkett/archaeopteryx/wikis/home">Archaeopteryx</a>, the&#8230;</p> [via http://www.rubyinside.com/ @ December 31, 2008 @ 2:58pm] Wed, 31 Dec 2008 14:58:18 +0000 http://ruby.feedables.com/story/1821933/Top-Ruby-Presenter-of-2008--Giles-Bowkett Top Ruby Presenter of 2008 - Giles Bowkett http://ruby.feedables.com/go/1855927/Top-Ruby-Presenter-of-2008--Giles-Bowkett <p><img src="http://www.rubyinside.com/wp-content/uploads/2008/12/rubytop10-giles.gif" width="400" height="129" alt="rubytop10-giles.gif" style="border:1px #000000 solid;" /></p> <p><em>Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read <a href="http://www.rubyinside.com/rubys-top-10-of-2008-thanking-those-whove-made-ruby-great-this-year-1393.html">this introductory post.</a></em></p> <h3>Giles Bowkett - Controversy, Excitement, and Awesomeness in 2008</h3> <p><img src="http://www.rubyinside.com/wp-content/uploads/2008/12/giles-is-more-fucking-awesome-than-zed.jpg" width="128" height="96" alt="giles-is-more-fucking-awesome-than-zed.jpg" style="float:right; margin-bottom:12px; margin-left:12px; border:1px #000000 solid;" />Giles simply <em>had</em> to feature in Ruby Inside's Top 10 of 2008 and since there's no <em>Top Crazy Mofo</em> category, he instead scores for <a href="http://www.infoq.com/presentations/archaeopteryx-bowkett">this excellent presentation at RubyFringe</a> (yes, it's all there to watch online, thanks to InfoQ!) Despite nominatively being about his "semi-autonomous Ruby musical instrument" <a href="http://github.com/gilesbowkett/archaeopteryx/wikis/home">Archaeopteryx</a>, the&#8230;</p> [via http://www.rubyinside.com/ @ December 31, 2008 @ 2:58pm] Wed, 31 Dec 2008 14:58:18 +0000 http://ruby.feedables.com/story/1855927/Top-Ruby-Presenter-of-2008--Giles-Bowkett Ruby 1.9.1 Release Candidate 1 Released http://ruby.feedables.com/go/1814063/Ruby-191-Release-Candidate-1-Released <p>Yuki Sonoda has <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/323668">just announced the release</a> of Ruby 1.9.1 Release Candidate 1 on the ruby-talk mailing list:</p> <blockquote> <p>This is a release candidate of Ruby 1.9.1, which will be the first stable version of Ruby 1.9 series. Try it early and have a experience of modern, faster, with clearer syntax, multilingualized and much improved Ruby world.</p> <p>We have <a href="http://redmine.ruby-lang.org/projects/ruby-19/issues?query_id=9">fixed 72 bugs and implemented some features.</a> If you encounter a bug or a problem, please let us know it via <a href="http://redmine.ruby-lang.org">the official issue tracking system.</a></p></blockquote> [via http://www.rubyinside.com/ @ December 30, 2008 @ 6:44pm] Tue, 30 Dec 2008 18:44:25 +0000 http://ruby.feedables.com/story/1814063/Ruby-191-Release-Candidate-1-Released Ruby 1.9.1 Release Candidate 1 Released http://ruby.feedables.com/go/1855928/Ruby-191-Release-Candidate-1-Released <p>Yuki Sonoda has <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/323668">just announced the release</a> of Ruby 1.9.1 Release Candidate 1 on the ruby-talk mailing list:</p> <blockquote> <p>This is a release candidate of Ruby 1.9.1, which will be the first stable version of Ruby 1.9 series. Try it early and have a experience of modern, faster, with clearer syntax, multilingualized and much improved Ruby world.</p> <p>We have <a href="http://redmine.ruby-lang.org/projects/ruby-19/issues?query_id=9">fixed 72 bugs and implemented some features.</a> If you encounter a bug or a problem, please let us know it via <a href="http://redmine.ruby-lang.org">the official issue tracking system.</a></p></blockquote> [via http://www.rubyinside.com/ @ December 30, 2008 @ 6:44pm] Tue, 30 Dec 2008 18:44:25 +0000 http://ruby.feedables.com/story/1855928/Ruby-191-Release-Candidate-1-Released localization_scopes http://ruby.feedables.com/go/1813539/localization_scopes This plugin adds the helper methods t_scope, t_context_scope and tc for scope management of the Rails core I18n. <p><a href="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?a=aWjMUu"><img src="http://feeds.feedburner.com/~a/RubyOnRailsPlugins?i=aWjMUu" border="0"></img></a></p> [via http://agilewebdevelopment.com/plugins @ December 30, 2008 @ 6:24pm] Tue, 30 Dec 2008 18:24:08 +0000 http://ruby.feedables.com/story/1813539/localization_scopes