123
 123

Sun 29 August, 2010

Click here to bookmark this link.Channel Image05:54 Rails Has Great Documentation» Riding Rails - home

To this day I still hear people complain that Rails has poor documentation. From where I’m sitting this seems far from the truth. Let me lay out the evidence piece by piece:

RailsTutorial.org

To learn Rails from scratch Michael Hartl recently finished his book Ruby on Rails Tutorial: Learn Rails by Example. The book teaches Rails 3 from the ground up and it’s available for FREE online. If you’d rather have a PDF or a book you can grab that as well (and he’s even working on some screencasts).

The source for the finalized book will be pushed to GitHub and released under a Creative Commons License shortly after Rails 3 is done. If you’d like to help translate the book to your language of choice, feel free to contact Michael and he’ll get in touch when it’s time to make it happen.

Rails Guides

If you’re not a Rails newbie don’t forget about the Rails Guides, which have been updated for Rails 3.

Rails API Docs

There are two main websites I use to do API lookups. The first is Rails Searchable API Doc, which has online and offline searchable documentation. The second is APIdock which is online only, but has the ability to comment and easily compare different versions of documentation.

Rails 3 Free Screencasts

If you’re more of a visual learner (like me) then there are plenty of free screencasts to teach you about Rails 3. About 2 months ago I produced the Rails 3 Screencasts, which will get you started.

Ryan Bates has also produced an incredible amount of Rails 3 screencasts over on Railscasts.com. Ryan has been producing Railscasts for over 3 1/2 years, isn’t that crazy?

There’s also a few good free screencasts over on Teach me to Code by Charles Max Wood.

Keeping on the Edge

If you find yourself wondering how to keep up with all of the newest features / libraries for Rails 3, both the Ruby5 Podcast and the Ruby Show are going strong. Don’t listen to audio? It doesn’t matter, just subscribe to the Ruby5 RSS feed and get links with descriptions to all the newest libraries, tutorials, and more. You might also want to checkout Peter Cooper’s new Ruby Weekly, a Ruby email newsletter.

Need to upgrade a big app to Rails 3?

Jeremy McAnnaly’s Rails 3 Upgrade Handbook PDF is just $12. There’s also a few paid screencasts for the upgrade over on Thinkcode.tv and BDDCasts.

Need a Book?

There’s a bunch of books that will be coming out after the release, most of which you can start reading now. The Rails 3 Way by Obie Fernandez, Rails 3 In Action by Ryan Bigg and Yehuda Katz, Beginning Rails by Cloves Carneiro Jr and Rida Al Barazi, and of course the Agile Web Development with Rails:fourth edition by Sam Ruby, Dave Thomas, and David Heinemeier Hansson.

In conclusion

No more complaining about lack of good documentation! Seriously. If you want even more Rails 3 content, check out the blog post by Kevin Faustino on 34 Ruby on Rails 3 resources to get you started.


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 Image05:54 Rails 3.0: Release candidate 2» Riding Rails - home

The release candidate process is progressing as planned. This second candidate has very few changes over the first, which means that unless any blockers are discovered with this release, we’re targeting the final release of Rails 3.0 for this week(!!!).

So please do help us weed out any blockers. Especially in our two new main dependencies: Bundler and ARel. They’ve both progressed into release candidacy for their 1.0 releases and will be sharing the same 1.0-final release date as Rails 3.0.

You can see a complete list of all the dotted t’s and crossed i’s on the new fabulous Github comparo view of RC1 and RC2.

As always, you install this latest version with: gem install rails --pre

Also note that Rails 3.0 now has it’s own stable branch. The master branch is now reserved for Rails 3.1 development. (That’s right, we’re already going there and it’s going to be M-A-G-I-C-A-L!).


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

Sat 28 August, 2010

Click here to bookmark this link.Channel Image13:43 Rawr 1.4.3 » James Britt - Code, Content, Caffiene

So it turns out that the option logic I put in place was, um, flawed. So I fixed it, and now the current version of rawr is 1.4.3.

It also turned out that rubygems.org had a bug that prevented the use of certain handles. That’s been fixed (thanks, Nick!) so I now have an account their. However, when I tried to push the new rawr gem I got an error message saying I didn’t have permission.

Seems there’s already an older rawr gem there (apparently copied over from rubyforge.org), and while the gem info has my name among those responsible for the project, I have no access to it (my rubyforge account doesn’t exist on rubygems.org).

I’ve reported this on the rubygems.org help site, but as of yet have no resolution, so I’m pushing rawr gems to neurogami.com.

So, once again, see http://gems.neurogami.com/gems/ for installation details


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 Image13:43 Looking for Rubyists while it still makes sense.» James Britt - Code, Content, Caffiene

I’m trying to find Ruby developers. Rails developers, really (though preferably Rails developers who actually know Ruby). I’ve got work for them.

However, they’re hard to find in my neck of the woods, (i.e., approximately Phoenix, AZ). And, based on calls from folks out of state, I’m not alone.

It’s not that there are no Ruby people around here; there are some. The Phoenix Ruby User Group meeting gets around a dozen people on average (plus there are some who can’t, or don’t want to, partake in the group’s monthly edutaintment festivities).

But I regularly get calls from people looking to hire Rails developers, and I’m having a hard time finding people who are available, qualified, and reliable.

It’s a funny sort of problem. Apparently (at least around here), if you are already a Ruby consultant, you’ve got plenty of work. So busy you don’t return calls or answer E-mail. If you’re a client looking for a Ruby developer, though, you may start questioning the wisdom of that choice. To make things worse, I’ve gotten calls from people who had a Ruby shop looking after them, but have gotten the nudge to go find someone else to look after their project. There could be all sorts of reasons for this; a client starts asking for more attention than expected, or a contractor or consulting shop finds more lucrative clients so they give the heave-ho to some existing ones.

The upshot to this may be that clients start questioning the practicality of having their apps built on Rails. I used to scoff when people suggested that picking Ruby as your business technology was risky because you might end up with trouble hiring skilled people, but there seems to be some truth in that. And not only might it be hard to get Ruby people to look after your project, but even if you find one they may lose interest and you’ll be on the hunt again.

All this, of course, is anecdotal. It might be exactly the same for people looking for Java or PHP consultants (whom are in abundance here). Maybe it’s just how the market plays itself out. My sense, though, is that market ebbs and flows are more of a problem when there are fewer players. These shifts just matter less when there are a lot of people skilled in Foo and a lot of people looking for Foo hackers.

For busy Ruby consultants the current balance is great. But we can’t be short-sighted. If you’re asked to take on some work, but don’t have the resources, make an effort to find someone who does. Pass on names and numbers. The last thing you want is to pull your head up after the end of some engrossing project only to find that no one is calling you anymore because they’re tired of getting burned or tired of relying on a scarce resource and went down the PHP|Java|ASP.net path.

In any event, if you’re in the Scottsdale/Phoenix area, and you’re good with Ruby, and you’re looking for some work, drop me a line: james+jobs@neurogami.com. Or if you know someone who might be interested, have them get in touch with me. I’m at the point where I feel awkward encouraging people to bet their business on Ruby, but I’m also optimistic people will prove me wrong.

And if you’re a local Rubyist not looking for work, please make the time to come to the monthly meeting, help support the community, and help each of us keep up-to-date on who’s doing what.


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

Fri 27 August, 2010

Click here to bookmark this link.Channel Image06:24 My imagination makes me hum...» Projectionist
My imagination makes me human and makes me a fool. It gives me all the world, and exiles me from it.

Ursula K. LeGuin


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 Image06:24 Reflections After Jane R...» Projectionist

Reflections After Jane – The Clientele


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

Thu 26 August, 2010

Click here to bookmark this link.Channel Image04:16 Let Them Build The Mosque» Joey Gibson's Blog
Unless you are living under a rock, you have heard the controversy surrounding the “ground zero mosque.” Essentially, a group of Muslims want to build an “Islamic community center,” that will house a mosque, two blocks away from the former World Trade Center. This has sparked a firestorm of protest from the right, claiming it [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Tue 24 August, 2010

Click here to bookmark this link.Channel Image15:38 Rails 3.0: Release candidate!» Riding Rails - home

High off Baltimore Pandemic and Yellow Tops, I believe we promised a release candidate shortly after RailsConf. As things usually go in open source, we gorged ourselves on fixes and improvements instead. But all to your benefit. We’ve had 842 commits by 125 authors since the release of the last beta!

Now it’s time to just say good is good enough, otherwise we could keep on with this forever. So please welcome the Rails 3 release candidate! You install, as always, with gem install rails --pre.

Most of the fixes have been of minor significance, but we did manage to dramatically speed up Rails 3 development and startup speed for larger applications (Basecamp went from insufferable to about 2.3 levels of enjoyment).

Speed is now pretty good across the board except for part of Arel that Active Record now depends on. We’ll be making sure we get performance of Active Record back to at least 2.3 levels before release.

A few more highlights:

Indulge yourself in the delights of all the glorious details from the commit logs or checkout the slightly less pedantic summaries in the CHANGELOGs.

This release candidate of Rails 3 also concides with the release candidate of Bundler 1.0. Huge strides were made with Bundler and it should both be much faster and have most of the edge cases sawed off.

I’ve said “we’re almost there” so many times that I’m almost exhausted. But really, guys, WE’RE ALMOST THERE!!!1

1 Just a few weeks before final is out?


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

Mon 23 August, 2010

Click here to bookmark this link.Channel Image22:10 搭建Scala工程——测试» 梦想风暴

作为一个ThoughtWorker,缺少测试会让我内心充满不安,面对Scala也不例外。书接上文。有了Buildr,在工程里组织测试也很容易。

具体了解之前,先来看看Scala的测试框架。《Programming Scala》中介绍了JUnit和ScalaTest,其中ScalaTest是个纯粹的Scala的框架。不过,书中只介绍了非常基本的用法。如今,ScalaTest已然变化了许多。

ScalaTest支持很多种测试风格,从最传统的Assert到BDD,再到FDD。所以,选择ScalaTest,先要选择一种风格,以便统一,至少在同一类测试中应该遵循同一种风格。即便是选择了一条路,有时,也会有分叉路。比如BDD,有三种风格可选SpecWordSpecFlatSpec

Spec是受Ruby的Rspec影响而产生的,用过Rspec的人,看到describe、it这样的字眼会倍感亲切。WordSpec的灵感来自specs——另一个Scala测试框架,字符串放在前面让这个DSL看上去更有感觉。如果不喜欢太多缩进,那FlatSpec是个另外一个选择。

选择太多未必是件好事,作为一个团队,将风格统一是最重要的。ScalaTest让人想起了C++,够强大,但选择太多,花了大量精力学习之后,才会发现很多东西应该避免混合使用。

Buildr对Scala提供了内建的支持,只要我们把代码放到src/test/scala即可。下面是一个采用了Spec风格编写的测试:
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers

class AddSuite extends Spec with ShouldMatchers {
  describe("plus") {
    it("should return 2 for 1 plus 1") {
      1 + 1 should be === 2
    }
  }
}
(src/test/scala/AddSuite.scala)

然后,运行测试:
  buildr test

Buildr 1.4.1支持的ScalaTest版本是1.0.1,而ScalaTest的新版已经发布了,如果想采用新版本的ScalaTest可以自行设定版本。
require 'buildr/scala'

Buildr.settings.build['scala.version'] = "2.7.7"
Buildr.settings.build['scala.test'] = '1.1'

define 'demo' do
  project.version = '0.0.1'
  package :jar
end
(buildfile)

Buildr还对specs提供了内建的支持,只要把代码放到src/spec/scala下。


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

Sun 22 August, 2010

Click here to bookmark this link.Channel Image23:54 搭建Scala工程» 梦想风暴

搭建Scala工程,一个比较简单的做法是选择Buildr。

Buildr是构建工具,类似于Ant和Maven,它的构建脚本是用Ruby编写的,对于不喜欢XML配置文件的人来说,这是一个福音。就这里而言,我们最需要的是它对Scala的支持。顺便说一下,它也对Groovy提供了内建支持。

安装Buildr,可以参考
http://buildr.apache.org/installing.html

Buildr缺省的构建文件叫做buildfile,下面是一个最简单的支持Scala的buildfile:
require 'buildr/scala'

define 'demo'
(buildfile)

我们把Scala源程序放到src/main/scala下:
class Person
(src/main/scala/Person.scala)

熟悉Maven的人可能会发现,这个文件布局方式类似于Maven,没错,在Buildr主页上有这样一段描述:
A drop-in replacement for Maven 2.0, Buildr uses the same file layout, artifact specifications, local and remote repositories.

接下来,我们就可以进行编译了:
  buildr compile

如果是第一次编译,buildr会自动去下载项目相关的库,这和Maven的行为是一致的。

如果要把自己编写程序打成一个JAR包,只要稍微修改一下buildfile
require 'buildr/scala'

define 'demo' do
  project.version = '0.0.1'
  package :jar
end
(buildfile)

然后,运行命令:
  buildr package

缺省情况下,Buildr会尝试使用Scala最新的稳定版本,如今,Scala 2.8已经发布,所以,最新的稳定版本已经成了2.8,但并不是所有库的支持都升级到了2.8。所以,有时候我们需要指定Scala的版本。
require 'buildr/scala'

Buildr.settings.build['scala.version'] = "2.7.7"

define 'demo' do
  project.version = '0.0.1'
  package :jar
end
(buildfile)

使用Buildr,还可以生成IDE的工程文件,当然,请在IDE中安装好对应的插件。比如为了在IntelliJ IDEA中使用我们的工程,只要:
  buildr idea

要想了解当前buildfile所支持的任务,可以:
  buildr -T
或者
  buildr help:tasks


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