Davis W. Frank's blog
Jasmine user Roy Kolak gave a presentation last night at BSCamp in Chicago. His slides are here
As you can see, we now have a blog just for Jasmine and want to talk more about people and projects using it. Let us know.
Ask for Help
"What's the best way to use Bundler and Rubymine?"
Rubymine 2.5 supposedly supports Bundler. Our default workstation install now uses RVM to manage Ruby interpreters & Gemsets, Rubymine 2.0 sees each interpreter/gemset as a separate Ruby SDK. So RVM manages our gem bundles.
Interesting Things
- Nokogiri v1.4.2, really needs JRuby 1.5.1 to work properly
A JRuby project had an issue where they upgraded Nokogiri, but got a "Can't find this function pointer" message. It turns out that the issue was an out-of-date libxml. The solution was to upgrade JRuby to 1.5.1, which they did with this addition to their Chef scripts:
execute "install_libxml2_2.7.6" do
command 'ACCEPT_KEYWORDS="~amd64 ~x86" emerge =libxml2-2.7.6'
not_if { FileTest.directory?("/var/db/pkg/dev-libs/libxml2-2.7.6") }
end
Interesting Things
iOS3 and hardware-accelerated CSS
CSS 3D Transforms are accelerated with hardware on iOS (3.2), but not the 2D ones. So if you want to take advantage of hardware, break out your linear algebra and add an extra dimension:
div {
-webkit-transition: -webkit-transform 1s ease-in;
-webkit-transform: translate(10, 0); /* NOT ACCELERATED */
}
...will be slow. While this:
div {
-webkit-transition: -webkit-transform 1s ease-in;
-webkit-transform: translate3d(10, 0, 0); /* ACCELERATED */
}
...will be crazy fast and smooth.
Also of note, the opacity CSS property is accelerated on iOS 3.2 and greater, iPhone and iPad.
BOOM!
Cached Taggings
Using act_as_taggable_on? There is an un/poorly-documented option for caching your taggings:
Say you have tv_shows tagged with genres. If you add a migration like this:
add_column :tv_shows, :cached_genre_list, :string
The acts_as_taggable_on looks for this column and on save updates it with a comma separated list of the associated tags. Thus when you're then reference in your view you can reference:
tv_show.cached_genre_list
BOOM!
Restart Rubymine to find your new specs
If you're using the latest Rubymine EAP, and you create a new spec file but can't seem to get Rubymine to execute it, just restart Rubymine. BOOM! And you'll be able to run your specs.
S3, Net::HTTP and JRuby
A project on has workers that manipulate PDF files in a pipeline. Each processing step stores its result on Amazon S3. Subsequent processing steps start by fetching the previously stored pdf using net/https. Occasionally the fetched PDFs are truncated and invalid.
After much digging and headscratching, the problem appears to have been JRuby 1.3.1. Moving the app over to JRuby 1.5.1 BOOM! fixed the issue and the PDFs are now all fine.
Ask for Help
"Does anyone have experience with Google Custom Search v. Google Site Search?"
The results sets appear to be different and I don't expect them to be...
Interesting Things
Heroku's Console runs in production mode
This means that, unlike script/console on your local box, the Rails Environment doesn't reload completely before you start hacking away. So if you're expecting changes to be live, like migrations, they won't be until you redeploy, restart your app heroku restart, and then run the console.
Request Log Analyzer & Rack::Bug
If you're doing some performance tuning on your Rails app make sure to check out Request Log Analyzer. It's great for helping show you all the stupid things you didn't realize you were doing that was making your requests slow. Another great tool for this type of analysis is Rack::Bug.
