123
 123

Sat 21 March, 2009

Click here to bookmark this link.Channel Image09:01 This Week in Edge Rails» Riding Rails - home

March 14, 2009 – March 20, 2009

The big news in Rails this week, of course, was the release of Rails 2.3. But that certainly doesn’t mean the Rails edge story is over! To the contrary, we’re embarking on one of the more ambitious and exciting Rails projects of all: the creation of Rails 3.0. Read on to see where things stand.

Final 2.3 Changes

A few things went in to Rails 2.3 in the days leading up to release. These include:

  • DDL transactions for SQLite databases commit
  • Compatibility between render :file and Pathname commit
  • ActionController class naming conventions for Metal commit

Rails 2.3.2.1

Shortly after the release of Rails 2.3, which was version 2.3.2, it became necessary to make a Rails 2.3.2.1 tag. This is because the tagged 2.3.2 version in the Rails repository is actually missing an important fix (the installable gem version of Rails has the fix). The net result is that rake rails:freeze:edge RELEASE=2.3.2 would freeze a bad version of Rails into your application.

To fix this, the Rails team has re-tagged the master tree at a safer spot, after the critical fix. This new tag is for release 2.3.2.1. So if you’re freezing Rails 2.3 into your applications (as opposed to running it from gems) be sure to use rake rails:freeze:edge RELEASE=2.3.2.1. That .1 makes all the difference.

The Road to Rails 3.0

Now that 2.3 is out, what’s next? Rails 3.0, which has been a distant speck on the horizon for a while, is rapidly getting closer. The Rails core team is discussing exactly how to proceed, but the bottom line is that you are shortly going to see a lot of changes on edge Rails, as work that’s been going on in various forks gets merged back into the master branch. You’ll want to be cautious about using edge on existing applications. In particular, changes to the Rails internals may result in many plugins needing to be rewritten. Rails edge will continue to be the cutting-edge solution, but you’ll need to keep up with the changes and be prepared to work with them if you choose to run on edge.

But this doesn’t mean that Rails 2 is frozen in time either. There’s a new 2-3-stable branch in the Rails repository which will host any maintenance releases to the current release version. There will continue to be some work on making sure the 2.x releases of Rails work well, though the center of gravity of Rails framework development will shift quickly to Rails 3.0.

So stay tuned. We’ll continue to keep you posted with Rails 3.0 developments as they happen: the process will continue, as always, to be transparent and to welcome ideas and feedback.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Fri 20 March, 2009

Click here to bookmark this link.Channel Image04:24 Get Paid to Work on Rails» Riding Rails - home

Last year, as you may recall, Rails got thread safety and a new core committer thanks to our participation in the Google Summer of Code program under the auspices of Ruby Central. This year, we’re pleased to announce, Ruby on Rails has been accepted into Google Summer of Code as a sponsoring organization in its own right.

What does this mean to you? Potentially, if you’re the right person, you can get paid to work on the Rails core code this summer!

The “right person” in this case is one who is at least 18 years old (sorry, Google’s rule, not ours!), a full- or part-time college student, and passionate about improving Rails. We’re building a potential list of project ideas on the Rails wiki, but we welcome other interesting proposals. We’re especially interested in work that meshes well with the plans for Rails 3.0, which will be in full swing by the time GSoC launches. If your proposal gets accepted, Google will pay you $4500 over the course of three months to work on the code.

If you’re interested, head over to the GSoC site and start reading about the process. Student applications can be submitted starting March 23.

What if you’re not a student? You can still help out by brainstorming ideas on the Rails wiki. Or if you’re a Rails guru and ready to make a strong commitment to help out the next generation of developers, you can apply to be a mentor.

We’re looking forward to working with this year’s students, and expecting some outstanding contributions to Rails as a result!


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Thu 19 March, 2009

Click here to bookmark this link.Channel Image12:03 validates_uniqueness_of 对中文验证无效» Suave's Blog
用 restful_authutication 遇到一个奇怪的问题, validates_uniqueness_of 对中文验证无效, 搜索一下发现有人报告过, 看上去已经解决了, 但是在 2.2.2 中仍然不行, patch 中修改的是 --- a/activerecord/lib/active_record...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:34 The Adhearsion Demo From Mountain West Ruby Conf» { |one, step, back| }

Try Jay’s demo at home.

Jay Phillip’s Adhearsion Demo at the Moutain West Ruby Conf

Jay Phillip’s talk at MWRC attempted to get the audience involved in actually running an Adhearsion demo on their own laptops. Unfortunately, the demo at MWRC was plagued with firewall and network problems, but eventually I was able to get it working. Here are the steps needed.

Go ahead, try this at home. It’s a lot of fun.

Step 1—Sign up for an Adhearsion account.

You can do that here: http://adhearsion.com/signup

You will need a skype account to complete the sign-up. After signing up, you should get an email with a link that you need to click before your account is activated. Go ahead and activate the account now.

Step 2—Install the Adhearsion Gem

Run:

   gem install adhearsion

I’m running the 0.8.2 version of the gem.

Step 3—Create an Adhearsion project

Run:

  ahn create project_name

Step 4—Enable the Sandbox

Run:

  cd project_name
  ahn enable component sandbox

Step 5—Edit Your Credentials

Edit the file: components/sandbox/sandbox.yml and update the username and password you used when you created the Adhearsion account in step 1.

Step 6—Create a Dial Plan for the Sandbox

Edit the dialplan.rb file to contain the following:

adhearsion {
  simon_game
}

sandbox {
  play "hello-world" 
}

The adhearsion section should alread be in the file. You will be adding the sandbox section.

Step 7—Star the Adhearsion Server

Run:

  cd ..
  ahn start project_name
You should see:
INFO ahn: Adhearsion initialized!

Errors at this stage might mean that your adhearsion account isn’t setup properly, you don’t have the right user name and password (in step 5), or that you have firewall issues preventing you from connecting to the Adhearsion server.

Step 8—Call The Sandbox

Using Skype, call the Skype user named sandbox.adhearsion.com. You should hear a hello world message.

Step 9—Change the Dial Plan

Just for fun, change the dialplan.rb file to contain:

adhearsion {
  simon_game
}

sandbox {
  play "hello-world" 
  play "tt-monkeys" 
}

(Add the tt-monkeys line to the sandbox dial plan).

Now call the sandbox again (skyping user sandbox.adhearsion.com) to hear the change in the dial plan. Monkeys FTW.

More Examples

Here’s a example of what can be done in a dial plan. I was just goofing around with my dial plan.

adhearsion {
  simon_game
}

sandbox {
  play "vm-enter-num-to-call" 
  digits = input 1, :timeout => 10.seconds
  case digits
  when '1'
    play "hello-world" 
  when '2'
    play "tt-monkeys" 
  when '3'
    play "what-are-you-wearing" 
  when '4'
    play 'conf-unmuted'
  when '5'
    play 'tt-weasels'
  when '6'
    play "pbx-invalidpark" 
  when '7'
    play "1000", "dollars" 
  when '8'
    play "followme/sorry" 
  when '9'
    simon_game
  when '0'
    play Time.now
  else
    play "demo-nomatch" 
  end
  sleep 1
  play "demo-thanks" 
}

See http://adhearsion.com/examples for more dialplan examples.

That’s It

Think about what you are doing. You are calling the Adhearsion server and controlling how that remote server responds by the adhearsion program running on your own local box. That is wild.

The adhearsion sandbox makes it easy to play around with telephony programming without any investment in the associated hardware.

I hope this demo encourages you to give Adhearsion a try.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Wed 18 March, 2009

Click here to bookmark this link.Channel Image23:22 当版本管理遇到敏捷» 梦想风暴

为什么我们要放弃Subversion

很早就知道Cruise团队在使用Mercurial(Hg),直到现在这个项目上,我才有机会第一次近距离接触分布式版本管理工具。

客户的版本管理工具是ClearCase。我们所到的项目组,版本管理工具就变成了Hg。

为什么是Hg?因为这是先行几个同事的选择,所以,一开始,我并没有仔细考虑过这个问题,我只是下意识的不喜欢ClearCase这种重量级的版本管理工具。随着工作的深入,包括最近开始做一些跨项目组的工作时,我逐渐开始意识到,正是因为当初选择了Hg,我们的工作才得以顺利开展。

就从ClearCase说起吧!

如果你用过ClearCase(SourceSafe也一样),你就会知道,要想修改一个文件,你必须先把这个文件Checkout,修改,然后再Checkin。在你Checkout这段时间,别人是不能对这个文件做任何修改的。ClearCase这种工作方式称为悲观锁,道理上来说,它最大程度上限制了文件冲突。但实际上,这种做法极大限度阻碍人们向库中提交代码。

一个人修改时,其他人是不能修改的,这会把我们本应并行的工作改成串行。当然,我们都是有职业道德的,所以,我们可能选择的一种工作方式是把这些文件复制到另外一个目录,在那个目录里面工作,然后,要提交了,再把代码复制回来。无论如何,这是一种费力的做法。一旦一件事做起来比较麻烦,人们就会倾向于不做,或少做。所以,其结果就是本地堆积了一大堆代码,很长一段时间才提交一次。显然,这与敏捷中提倡的频繁提交是相背离的。

别以为我为赋新词强说愁,这是我亲眼所见。换上Hg的项目组,提交的频率明显大幅度提高了。基于悲观锁的版本管理工具在敏捷面前成了绊脚石。

在使用Hg之前,我最熟悉的版本管理工具是SVN,在我经历的项目中,一直也用的很好。甚至我加入这个项目很长时间之后,我一直为这个项目选用Hg而非SVN耿耿于怀。分布式版本管理最让我喜欢的一点是,可以在没有网络的情况下,进行提交,满足我——一个ThoughtWorker频繁提交的心理需求,要知道,我经常会偷偷自己编一些代码。而这个项目,这一点是完全没有必要的,因为大家的开发肯定都是在一个局域网内。加之,分布式版本管理既要提交到本地版本库,又要推送到服务器上,比起集中式管理要多敲一条命令。你知道,我一直以自己是个懒程序员为荣的。

但是,我们最近进入到跨项目组的工作,分布式管理工具的价值就体现无遗了。因为整个的开发团队有太大的规模,让大家工作在一个服务器上,冲突的概率太大。所以,我们给出了一个分级的方案,也就是说每个项目组有自己的服务器,一段时间把每个项目组的工作同步到整个团队的服务器上。使用分布式版本管理,在不同的服务器上同步代码相对容易很多。有兴趣的话,你可以想想,如果采用集中式的版本管理,这个问题该如何解决。

原本我想写一篇关于Hg的文章,但胡凯的文章让我觉得没有这个必要了。唯一需要补充的一点是,Hg本身有很强的扩展功能,我在这个项目上就写了一个扩展,使得CC中的符号链接在Hg中得以保持,所以,如果对Hg有更高的要求,自己动手写一个扩展就好了。






add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image23:00 You Are Invited» { |one, step, back| }

All Rails Conf 2009 speakers are invited to a special event.

Who?

Anyone speaking at RailsConf 2009

When?

Sunday, May 3, 4:00PM – 6:00PM
(The day before RailsConf 2009 officially begins)

Where?

Las Vegas Hilton in Pavilion 1

What?

Presentations for Presenters.

Why?

You’ve come all the way to Las Vegas to tell the world about your latest Ruby/Rails project or idea. You want to make sure that you really get your message across. So, how do you do that?

The Presentations for Presenters session will give you practical tips for improving your RailsConf presentation. We will cover all aspects of planning, preparing, creating and delivering your talk, so that your unique message will get across to your audience.

Plus we will have a lot of fun. Hope to see you there.

What do I need to do?

Start planning now to attend. Since this session is actually the day before RailsConf officially begins, make sure that your travel plans gets you there in time.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:11 MWRC 2009 after-thoughts» James Britt - Code, Content, Caffiene

I had a blast at MountainWest RubyConf 2009.

Some random thoughts:

Big thanks to Yehuda Katz for taking the time to explain the changed planed for Rails 3. (I copped to not fully paying attention to his talk because I was still hacking on my own presentation.) Things look really interesting.

A lengthy dinner with Jim Wierich, David Brady, and Matthew Nielsen. Aside from the top-notch geekery, there was much laughter watching oddball videos and discussion favorite TV shows. I also learned that goofy off-the-cuff remarks can find their way on Twitter very quickly. :) Monster props to Dana Gray for picking up our tab, too.

Dinner with Brain Marick and associates the night before was a treat as well. I mean that in multiple ways, as Kay Johansen grabbed the check that night. Be sure to watch Brian’s lightning talk on Micro-scale Retro-futurist Anarcho-syndicalism when the video comes around.

The talks were amazing. The shorter format made for punchier content, with more topics covered. Mike Moore and Pat Eyler did a great job of keeping things running and on time.

The hackfest was great. Big thanks to Engine Yard

Remi Taylor did a remarkable lightning talk on rackbox After losing time due to video hookup issues, he still managed to blaze though without complete composure. True lightning. The crowd was quite impressed.

I more or less made a point of not hanging with folks from Phoenix. Nothing personal, but conferences such as these are the among the few chances to meet new people or to hang with folks I’ve only interacted with on-line.

I need to re-think my presentation style. Many people whose opinion I respect had good things to say, and I had a nice chat with James Edward Gray II about ways to fix some issues in my code. Still, I felt I was too stiff, and the talk lacked a clear focus. I’m thinking I need to drop the slides and do more live coding with more demonstration apps.

There was a discussion on the back channel about talks and slides, and a few people (including me) seemed to think that having no slides at all would be a good thing. Dave Brady, for example, was too sick to give his talk at the schedule time, but he came to the conference the next day and gave his talk right at the start of the lunch break. Without having brought his slides, he demoed his code and used Emacs to show a few text notes to reinforce his words. It was great.

It would be nice to have a conference along those lines. 20-30 minute talks, with no slides. Use your editor to display text if needed, but focus on what is said and code being run. Might need a catchy name. RawCamp. RawConf. LiveConf. SomethingSomething. Or something like that.

PS: Videos are starting to appear! http://mwrc2009.confreaks.com


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Tue 17 March, 2009

Click here to bookmark this link.Channel Image14:02 Wii! Playing with Ruby» James Britt - Code, Content, Caffiene

At MountainWest RubyConf 2009 I gave a talk on using the Wii controllers to drive Ruby code.

PDF version of the slides

Video should be appearing on the Confreaks site before too long.

The code for the Wii libraries are on GItorious: http://gitorious.org/users/neurogami


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:13 Rails 2.3: Templates, Engines, Rack, Metal, much more!» Riding Rails - home

Rails 2.3 is finally done and out the door. This is one of the most substantial upgrades to Rails in a very long time. A brief rundown of the top hitters:

  • Templates: Allows your new skeleton Rails application to be built your way with your default stack of gems, configs, and more.
  • Engines: Share reusable application pieces complete with routes that Just Work, models, view paths, and the works.
  • Rack: Rails now runs on Rack which gives you access to all the middleware goodness.
  • Metal: Write super fast pieces of optimized logic that routes around Action Controller.
  • Nested forms: Deal with complex forms so much easier.

And that’s just the tip of the iceberg. We’ve put together a complete guide for the Rails 2.3 release notes with much more information. Be sure to checkout the section on what was deprecated when you’re ready to upgrade your application.

You install 2.3 with (the final version is marked 2.3.2):

gem install rails

If you’re running on Passenger, be sure to upgrade to 2.1.2 as well. Rails 2.3 doesn’t run on older versions of Passenger!

We hope you’ll love it.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:12 Fixing a problem with hald on Ubuntu 8.10» halostatue
Saved for my own reference as much as anything. I was having a problem this morning on my Ubuntu x86-64 where I was getting nothing but a spinning cursor (the busy cursor) where I should have seen gdm. The problem was the HAL daemon (hald) wasn’t starting and I couldn’t figure out why. After digging [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sun 15 March, 2009

Click here to bookmark this link.Channel Image23:17 敏捷 != 敏捷实践» 梦想风暴

说起敏捷,会让人想起什么?
TDD、持续集成、结对编程、Standup、回顾会议……

当人们谈论起敏捷,首先进入大脑的词汇便是这些敏捷实践的名字。

所以,与人交流的过程,经常会有人告诉我们,我们已经敏捷了,我们搞过TDD,我们做过持续集成等等。然后,语重心长的说,敏捷不行啊!我们遇到了这样那样的问题,总之,都是敏捷惹得祸。

这个时侯,我们会耐心的与他们交流一下,问他们一下具体的情况。下面就是一些经常得到的答案:
* TDD就是测试,浪费时间。
* 测试不好写,为了测一个函数需要设置好多东西,太麻烦了。
* 我们的持续集成每天都给我们发报告的。
* 结对编程就是两个坐在一起,太浪费时间了。
* ……

有时,我们会饶有兴致让他们打开一段他们的测试代码给我们看,我们经常可以看到一个一屏都无法容纳的测试用例。

看到这里,我相信,单以敏捷实践而言,他们已经开始做了,但他们却并没有理解敏捷。

曾经,我读Kent Beck的那本书《Extreme Programming Explained: Embrace Change》,我记住的只是那些实践。现在,我开始理解,真正更具价值的部分,实际是那些价值观:沟通、反馈、简单、勇气和尊重:
* 当我们经常发现自己的理解和其他人存在不一致的情况时,也许沟通是最好的解决办法
* 当我们每天才得到一个报告时,我们也就失去了持续集成应有的快速反馈
* 当我们编写一个长长的测试用例时,我们如何还能保证简单
* 当我们准备放弃重构代码的念头时,我们是否需要勇气
* 当我们和pair争执得不可开交时,我们有没有想过尊重

对于敏捷而言,相比于敏捷具体实践的“形”,这些价值观才是“神”。正是有了这些价值观的驱动,我们才会考虑:
* 把测试和代码写得清晰易懂,因为复杂了,就不容易理解
* 不断重构代码,因为一旦腐烂,再想回到干净,就是一件困难重重的任务
* 代码提交了就会在持续集成中验证,出了错,肯定最新提交代码的人破坏的,而不是把大家的工作混杂在一起。
* 选择尽可能的自动化,因为人工是繁琐的
* ……






add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:05 Joggle 0.1.0 Released: Jabber to Twitter Relay» Pablotron: News

I just released Joggle version 0.1.0. Joggle is a Jabber to Twitter relay; tweets show up as instant messages, and instant messages are posted as tweets.

Setting up Joggle is easy; all you need is Ruby, five minutes, and a spare Jabber account:

# install joggle, create joggle directory
sudo gem install joggle
mkdir ~/.joggle

# create joggle config file 
# (replace joggle@example.com and abc123 with your spare jabber 
# account and password, respectively)
echo -e "jabber.user joggle@example.com\njabber.pass abc123" > ~/.joggle/joggle.cfg

# run joggle in the background
joggle --daemon --config ~/.joggle/joggle.cfg

Next, add the specified Jabber account (joggle@example.com, in the example above) to the buddy list in your Jabber client.

Finally, register your twitter username and password with Joggle by sending an instant message like this: .register TWITTER_USER TWITTER_PASS (replace TWITTER_USER and TWITTER_PASS with your Twitter username and password).

You can also share your Joggle installation with your friends; have them add the Jabber account to their buddy list and send a .register command.

See the README file for detailed installation instructions and a full list of configuration options.

Files:

Update: Comments for this site are still broken, but I've cross-posted this release announcement on Reddit, so feel free to post a comment over there.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sat 14 March, 2009

Click here to bookmark this link.Channel Image02:49 ExportToArchive *Does* Work With iPhoto ‘09» Joey Gibson's Blog
I just installed the iLife ‘09 suite, which includes version 8.0 of iPhoto. While I haven’t had time to try out any of the new features, I did check to see if my ExportToArchive plugin still worked. I’m happy to report that it does still work. If you already had it installed, you don’t have [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Sources