Real HTTP caching for Ruby web apps.
Fast Markdown libraries for Ruby: two for the price of one.
So you've decided to start a weblog and have a really clever idea for titling it based on a snippet of code you find particularly novel. Rad!
What I'd like to do is run Firefox/Gecko on the server. It would load up the report, render it with the print stylesheet and then output the PDF. The concept is not unlike khtml2png or webkit2png but instead of outputting a raster image, it would output a PDF: gecko2pdf, if you will.
On Dreamhost freaking out because they can’t get Rails deployed reliably.
Cheap branches make for new uses.
It’s not Rails’s problem.
Charles Nutter on the possibility of a Rails support announcement in February 2007.
A prediction piece on the possibility of a Ruby backed coup d'état on the JVM and what that might mean to the pragmatic web developer.
Time Travel vs. ESP
Wherein we avoid a Python vs. Ruby flamewar by changing the subject to Object vs. RDMS persistence.
Just keep talking.
The web as currently imagined by the tech. industry is quite different from the web that actually exists.
What does Ruby on Rails have that we don’t and why?
Markus Prinz with a nice review of important Ruby 1.9 changes.
Finally, a sane looking sanitization lib that doesn’t try to do too much.
Interesting looking HTTP client library for Ruby with support for HTTP caching (with pluggable backends), basic and digest auth, intelligent redirect handling. It’s been around for a while and looks like it could eventually become similar in feature set to Python’s httplib2.
A much more sober but constructive take on the plan to merge Rails and Merb.
Mailing list for Rack::Cache users and hackers. Come on in, the water’s warm.
Jon Crosby’s RESTful JSON-based data store with OpenID and OAuth support. It does versioning and produces HTTP cache friendly responses all in a Rack middleware component. Jon’s been working on this for some time and it shows in the code and docs. Awesome.
Peter Cooper: “Lots of awesome articles about Sinatra, Sinatra apps, and various links and resources have cropped up over the past few months. The remainder of this post links to the best we've found – most of which you should find useful as you start to explore Sinatra in detail.”
David Heinemeier Hansson: “Rails Edge adopted Rack a while back and we’ve been exploring ways to expose that better. The first thing we did was to make it really easy to hook up any piece of Rack middleware in front of a Rails request. In your config/environment.rb file, you can do: config.middlewares.use(Rack::Cache, :verbose => true)”
Oh hell yes.
Rails riding on Rack is going to be a big deal.
Bad-ass ActiveRecord extension that does read-through and write-through caching to memcached in a way that’s fairly transparent. This is one of the strategies the Twitter folks put in place recently to improve their response time and availability.
Rafe Colburn: “On the other hand, I find programming in Ruby enjoyable and educational, so it’s not like I’m looking to give up. It’s just that even after a couple of years of doing it, I still feel like we’re dating rather than married.”
It seems like a lot of people are down on Ruby at the moment. Odd. I'm actually more excited about Ruby than I've ever been. Things seem to be moving along nicely, especially on the web tooling front.
Adam Wiggins and Blake Mizerany’s presentation on Sinatra and RestClient.
Nicely done. I have to take a serious look at iUI one of these days. It sounds like you can get really close to a native app experience.
Pratik continues his series on Rack with a deep dive into Rack::Builder.
Pratik’s first in a series of pieces on Rack: how it came to be, why you need to understand it, along with some simple examples. Future installments will cover Rack::Builder and Middleware.
Interesting approach to setting cache related headers using a Rack middleware component.
An interesting RubyGems mod by Fabien Franzen that seems to fix the memory hit a process takes on require 'rubygems'. Unfortunately, you have to code for it in your app and apply it to installed ruby commands explicitly. Fabien has submitted a ticket and patch to the RubyGems project, however. You should +1 it (after reviewing the code, of course).
Pretty good introduction to building pieces of Rack middleware and using Rack::Builder.
Much nicer, IMO. I'm interested to see if someone can get Rails + Rack::Cache working together so that you can maximize the benefits of generating these validators.
Interesting Rails plugin from Viget Labs that adds ActiveRecord attribute helpers for various humane markup languages. The markdown variation supports both rdiscount and rpegmarkdown. Cool. Not sure how I missed it when it was released in August.
So I've been skeptical about Merb but I really like the world-view Ezra puts forth here: core framework code should be simple (no/little meta-programming), fast is good, Rack is awesome, etc.
Tom Preston-Werner on how GitHub came into being and leaving Powerset after the Microsoft acquisition: “When I’m old and dying, I plan to look back on my life and say ‘wow, that was an adventure,’ not ‘wow, I sure felt safe.’”
Same here. I'm still looking for techniques that would make my Ruby libs and apps as simple to follow, debug, and maintain as equivalent Python versions are naturally. Ruby’s module system and cowboy shit (instance_eval, modifying Object, Class, Module, etc.) can go to hell. Python + blocks + class scope + large community and I'm sold.
Ola Bini: “Using instance_eval changes the rules for the language in a way that is not obvious when reading a block. You need to think an extra step to figure out exactly why a method call that you can lexically see around the block can actually not be called from inside of the block.”
Having abused instance_eval in the past, I can say with absolute clarity that it’s usually The Wrong Thing. It can make DSLish code look really cool in controlled and scoped demos but it greatly increases cognitive complexity, making things hard to read and maintain.
Bill Burcham applies the technique of making form controls inherit style from their container in the Air Budd Form Builder Rails plugin. Cool.
… is a Ruby library suitable for use as a drop-in Net::HTTP replacement or with event frameworks like EventMachine and Rev.
Aristotle Pagaltzis on eating PHP’s lunch: “It will have to be more than just a programming language, because PHP itself is really more than a programming language. It includes a crude web framework (an invocation model reminiscent of CGI, with extensions) plus a crude deployment solution (just make all the libraries part of the language and let the sysadmin worry about it – who in turn often defers to his operating system vendor). This is PHP’s way of taking the worse-is-better philosophy to dazzling new depths …”
I was having this conversation at work the other day and came away with the conclusion that even if something were to reach feature / ease of use parity with PHP today, it would be many years before it actually surpassed the language in real deployments. PHP is everywhere.
Dump the stack trace of all threads in a running ruby process by signaling with -QUIT. Requires patching the ruby interpreter, which sucks because I need it for a process running right now.
Yep. Rubygems’s system of security is really very lax compared to any Linux distro or other system-level package management system I've come across. I think the bigger problem, though, is that there’s a cultural acceptance to running gem as root. You don’t really think before installing a gem, you just “sudo gem install FOO”. There’s an attack waiting to happen any time you’re using sudo out of convention like that.
Chris Wanstrath: “Side projects are less masturbatory than reading RSS, often more useful than MobileMe, more educational than the comments on Reddit, and usually more fun than listening to keynotes.”
I just totally love this kid. Chris explains the future and past of, uh, everything that matters, and gives good, solid, practical reasons for why contributing to free and open source software projects is something worth dedicating a large chunk of your time to.
Adam Wiggins on Sinatra’s blasphemous approach to controllers and routing. AKA: the thing that makes Sinatra my web layer of choice (well, that and throw :halt).
Still too much work but it’s nice to see some support for conditional GET making its way into the framework.
Christian Neukirchen announces Bacon, a ground up reimplementation of test/spec + test/unit. (EDIT: this is not test/spec as I had previously reported. Sorry.)
Not sure how I've never stumbled on this before. You can remove items from the list to cause require to reload a file.
“Jim Meyer, manager of LED says that Rails scales like any other web application: ‘That is to say you need to take into account all the components from the moment the request is received at the load balancer all the way down and all the way back again.’”
Agreed. I've been a lurker for going on a year now. Solid mailing list.
Good idea. Solve the “concurrency problem” for dynamic/scripting languages and the “language syntax problem” for Erlang, without sacrificing the benefits of either. Someone needs to keep an eye on this.
There’s way more new stuff in here than I thought. 20%-30% of ActiveSupport’s core extensions, Enumerator support everywhere, Object#instance_exec, byte vs. char stuff, documentation, and more…
If you move the slides quickly, it feels a bit like playing Desktop Tower Defense.
“… the fact that [Twitter has] a nifty error page is a bonus really.”
cschneid has been helping me get the collection of hacks I've come to call a weblog into shape for some kind of release. He’s also been writing a lot of great Sinatra tips and tricks here. Check it out.
This is the template used to generate the HAML RDoc. It’s a massive improvement over the default template shipped with rdoc. I can almost stomach rdoc with this — almost.
Support for HTML4/HTML5 output, more control over whitespace, option for implicit HTML encoding, and now faster than ERB.
Ola Bini on def vs. define_method vs. eval for defining methods in Ruby. There really ought to be a simple way of getting stuff like this from blogs and into the standard Ruby doc.
“I still haven’t found anyone who knows how you implement Scaling in a language, so I guess that LRM will never have it… Anyone who care to enlighten me, please send me a detailed email with an implementation of Scaling.”
A gem for your project is automatically built each time the project_name.gemspec file is changed on your master branch.
Matt Chisholm evaluates Ruby against Python for an upcoming project and determines that it’s a big pile of doodoo. I can’t agree with the conclusion but he details a lot of Ruby’s warts really quite well.
This was a really great lesscode.org piece by Aristotle. The follow-up discussion in the comments was superb as well. Being in the middle of everything really warped my view of what was going on back then, I think.
David Heinemeier Hansson: “PHP scales down like no other package for the web and it deserves more credit for tackling that scope.”
Agreed!
Yukihiro (Matz) Matsumoto, David Flanagan, _why the lucky stiff, David A. Black, Charles Oliver Nutter, and Shyouhei Urabe: that’s what I call a writing team. Wow.
I repackaged mongrel_proctitle as a GemPlugin so that all mongrels on use it automatically. This is the first chance I've had to play with GitHub, too. Lovin' it.
Constantly updates the the process title ($0) with something like: “mongrel_rails [10010/2/358]: handling 127.0.0.1: HEAD /feed/calendar/global/91/6de4”. Let’s you monitor backends with ps and top.
Seriously interesting web based git browser and collaboration tool from the folks at Engine Yard. If anyone has a spare invite laying around, hook me up: rtomayko@gmail.com. I have a bunch of stuff sitting in bzr repos that I'd like to flip over to git.
A “Hello World” Rails webapp in fewer LOC than a Java console app that System.out.println(“Hello World”). The routes and controller DSLs look pretty interesting as well.
Nice Ruby assertion library that’s block based. Shows block contents when the assertion fails. Much cleaner than Test::Unit assertions and without the retarded RSpec non-sense. This really ought to be rolled into the stdlib Test::Unit, IMO.
“Cameltoe is a set of utility functions for making Ruby objects more like camel toes.” — You've piqued my interest :) It looks like this adds a String#cameltoeize method, amongst other things…
Evan Weaver: “These leaks tend to grow slowly. Your Rails app definitely has this kind of leak, especially if it uses the ActiveRecord session store.”
Peter Cooper scratches the deployment problem itch.
Dion Almaer sits down with Yegge to talk about his JavaScript/Rails port. Nice one-on-one video, candid, and thick in technical detail.
Ian takes a look at some of the attributes of PHP’s deployment model, why they work so well (for PHP), and why other environments have such a hard time duplicating them.
“The constraints, the instability, and the unpredictability of a shared hosting environment are a big part of the reason why the web hosting business is moving towards virtualization everywhere you look. Big kids need their own sandboxes to play in.”
Like khtml2png but using the gtkmozembed Ruby extension library (which I haven’t been able to build yet).
something to dig into during a 1 hour conference call or whatever …
Brings ActiveRecord’s transactions toward sanity and adds savepoints. The methods added to Object must go! — transaction, commit!, and rollback! will clash with existing libraries. e.g., PDF::Writer and Transaction::Simple.
“Every time some Rails fanboy starts peddling their hype, the approved thing to do is to respond with Erlang.” – Brilliant idea! That will bring some real substance to the argument.
“I'm getting more and more convinced that for the people that don’t need the things Java infrastructure can give you, Rubinius is the most important project around, in Ruby-land. More than that, Rubinius is MRI done right.”
“What matters a lot more than choice of programming language is the ability to get the project done, meaning tested and correct and launched. Apparently for Derek, PHP is the way to get that done, and Rails ain’t.” — it really is that simple. Period.
“But at every step, it seemed our needs clashed with Rails’ preferences. (Like trying to turn a train into a boat. It’s do-able with a lot of glue. But it’s damn hard. And certainly makes you ask why you’re really doing this.)”
“Maybe I’ll start to believe when they start promoting Ruby on Rails at JavaOne, as opposed to promoting JRuby on Rails at RailsConf.”
Comprehensive look at common Rails security concerns with links out to in-depth articles.
“I'm not really much into evangelizing Ruby and Rails much nowadays. You know, since we won, I have to admit that it became boring and besides the point.” :)
“‘Why are they doing all this?’, that’s a common concern with most Ruby folks … A Sun that’s heavily involved with Rails on the software side is a Sun that’s much better positioned to sell loads of hardware …”
Do not try to measure APIs vs site traffic… that’s impossible. Instead, only try to realize the truth… There is no APIs.
“We’re not trying to bend Ruby on Rails to fit the enterprise, we’re encouraging enterprises to bend to Ruby on Rails,” he said. “Come if you like it, stay away if you don’t.”
Bill Burke is an idiot. Wow. And then, after being an idiot, he actually calls someone “gay” in the comments when they dare suggest that Ruby is a strongly typed language. Huh? I thought Red Hat had better taste.
Java becomes 100% more viable. So simple — why didn’t someone do this in the very beginning?
I must say, I'm a bit bummed that we’re having this conversation at all.
Nice. This is going to save me some serious time.
“The general thrust of this argument is that having a full-fledge rich-windowing experience in the browser is going to put a stop to all that amateurish mucking around with JavaScript and the DOM. … that’s hogwash.”
“And yes, I've seen the Microsoft news … If Sun did something like this I'd resign.”
I no longer think applet support should be dropped from all major browsers. I've got links for anyone who produces a Jython version.
Pppkkkeeeewwwww.. The happy universe explodes. This is turning into one hell of a discussion.
Wow. Pretty solid anti dynamic language advocacy piece. It’s been a while since I've written anything longish so maybe I’ll try to put together something of response to this.
I've been using this technique for some time with great success. Oh, and this site’s design is bordering on perfection.
“Well if Ruby developers are so damn productive, why can’t they write a faster ruby?”
These people are still around? Amazing. Ooohhh, “tens of thousands of simultaneous users” — scary! scary!
“… the results for YARV/Rite are still streets ahead in terms of raw performance, and where I'm placing my bets for the next de facto Ruby interpreter.”
Wow.I shudder to even observe the brilliance that is _why. There’s an actual Cut-out Adventure Beard here.
Interesting concept. I’ll have to check this out once it comes out of “pre-pre-pre alpha” (which doesn’t really make sense, btw. There’s nothing more alpha than alpha).
“All you have to do is change the internal processing, add 200 more methods to the HTTP parser, serve Bittorrent over Ethernet, and have it save Korean orphans while eating a Mango in the back seat of an El Camino driven by twenty midget clowns.”
“I would rather take an easily modifiable, open platform that I can make do what I need in a specific environment.”
Sam with a very simple, step by step tutorial on using your site as an OpenID identity provider.
This looks promising: handles all of Markdown proper plus various extensions.
Danny Coward Q/A on invokedynamic and “hot swapping” (method replacement). Pretty good piece until the end where we enter into some scary Java-static-typing-is-good-because-it-let’s-you-publish-APIs non-sense.
Wherein the author lists 8 reasons (maybe 3 of which are approaching objective or even valid) and also spells Adrian’s name wrong: “Adrian Zolovaty”. Ruby/Python flame-bait is exactly what we need.
I take back everything bad I've ever said about Java Applets ;)
The best attempt I've seen at splicing multiple API references together. This uses the external documentation but provides indexing and browsing features.
why on rebinding blocks to specific objects.. I had to do the same thing a little while ago. Using instance_method seemed like a hack but if it’s good enough for why, it’s good enough for me.
Decent looking ruby library that implements a fair bit of an Atom Publishing Protocol client.
Holy crap this is the coolest language book I've ever seen. No seriously, you have to flip through the chapters – there’s regular comic strips and other crazy non-sense.
That’s because they don’t have shithead analyst speculation driving feature development…
HARDYFUCKINGHARHAR! Laugh it up you dumb shits. This might have been funny were Ruby and PHP not eating your lunch.
The line forms to the left people..
Author of “Better, Faster, Lighter Java” compares building MVC webapps in Java to building them in Rails. I wish I could say I was surprised at the results but I'm not…
Well written line-of-though writeup on the decision process leading up to a language selection when the sky is blue and you’re building a new app. Hint: Python :)