Consider a small donation to rubyland.news?
Bibliographic Wilderness
by jrochkind
5M ago
I started rubyland.news a few years ago because it was a thing I wanted to see for the Ruby community. I had been feeling a shrinking of the ruby open source collaborative community, it felt like the room was emptying out. If you find value in Rubyland News, just a few dollars contribution on my Github Sponsors page would be so appreciated. I wanted to make people writing about ruby and what they were doing with it visible to each other and to the community, in order to try to (re)build/preserve/strengthen a self-conception as a community, connect people to each other, provide entry to newcome ..read more
Visit website
Beware sinatra, rails 7.1, rack 3, resque bundler dependency resolution
Bibliographic Wilderness
by jrochkind
5M ago
tldr practical advice for google: If you use resque 3.6.0 or less, and Rails 7.1, and are getting an error: cannot load such file -- rack/showexceptions — you probably need to add rack "~> 2.0" to your Gemfile! The latest version of the ruby gem sinatra, as I write this, is 3.1.0, and it does not yet support the recently released rack 3. It correctly specifies that in it’s gemspec, with gem "rack", "~> 2.2", ">= 2.2.4” [And as of this writing, that is true in sinatra github main branch too, no work has been done to allow rack 3.x] The new Rails 7.1 does work with and allow Rack 3.x ..read more
Visit website
S3 CORS headers proxied by CloudFront require HEAD not just GET?
Bibliographic Wilderness
by jrochkind
6M ago
I’m not totally sure what happened, but the tldr is that at the end of last week, our video.js-played HLS videos served from an S3 bucket — via CloudFront — appears to have started requiring us to list “HEAD” in the “AllowedMethods” for CORS configuraton, in addition to pre-existing “GET”. I’m curious if anyone else has any insight into what’s going on there… I have some vague guesses at the end, but still don’t really have a handle on it. Our setup: HLS video from S3 buckets We use the open-source video.js to display some video, in the HLS format. Which involves linking to a .m3u8 manifest fi ..read more
Visit website
Investigating OCR and Text PDFs from Digital Collections
Bibliographic Wilderness
by jrochkind
9M ago
At the Science History Institute Digital Collections, we have a fairly small collection compared to some peers (~70,000 images) of historical materials. Many of those images are of text: Books, pamphlets, advertisements, memos, etc. We haven’t previously done any OCR (Optical Character Recognition), but started thinking about doing that. In addition to using captured text for the site-wide search, it made sense to us to look to providing: “search inside the book/work”, with results highlighted on in-browser page images, such as provided by this example from Internet Archive using their own vi ..read more
Visit website
Escaping/encoding URI components in ruby 3.2
Bibliographic Wilderness
by jrochkind
1y ago
Thanks to zverok_kha’s awesome writeup of Ruby changes, I noticed a new method released in ruby 3.2: CGI.escapeURIComponent This is the right thing to use if you have an arbitrary string that might include characters not legal in a URI/URL, and you want to include it as a path component or part of the query string: require 'cgi' url = "https://example.com/some/#{ CGI.escapeURIComponent path_component }" + "?#{CGI.escapeURIComponent my_key}=#{CGI.escapeURIComponent my_value}" The docs helpfully refer us to RFC3986, a rare citation in the wild world of confusing and vaguely-described imp ..read more
Visit website
Attr_json 2.0 release: ActiveRecord attributes backed by JSON column
Bibliographic Wilderness
by jrochkind
1y ago
attr_json is a gem to provide attributes in ActiveRecord that are serialized to a JSON column, usually postgres jsonb, multiple attributes in a json hash. In a way that can be treated as much as possible like any other “ordinary” (database column) ActiveRecord. It supports arrays and nested models as hashes, and the embedded nested models can also be treated much as an ordinary “associated” record — for instance CI build tests with cocoon , and I’ve had a report that it works well with stimulus nested forms, but I don’t currently know how to use those. (PR welcome for a test in build?) An exam ..read more
Visit website
A tiny donation to rubyland.news would mean a lot
Bibliographic Wilderness
by jrochkind
1y ago
I started rubyland.news in 2016 because it was I thing I wanted to see for the ruby community. I had been feeling a shrinking of the ruby open source collaborative community, it felt like the room was emptying out. If you find value in Rubyland News, just a few dollars contribution on my Github Sponsors page would be so appreciated. I wanted to make people writing about ruby and what they were doing with it visible to each other and to the community, in order to try to (re)build/preserve/strengthen a self-conception as a community, connect people to each other, provide entry to newcomers, and ..read more
Visit website
Vite-ruby for JS/CSS asset management in Rails
Bibliographic Wilderness
by jrochkind
1y ago
I recently switched to vite and vite-ruby for managing my JS and CSS assets in Rails. I was switching from a combinatin of Webpacker and sprockets — I moved all of my Webpacker and most of my sprockets to vite. Note that vite-ruby has smooth ready-made integrations for Padrino, Hanami, and jekyll too, and possibly hook points for integrations with arbitrary ruby, plus could always just use vite without vite-ruby — but I’m using vite-ruby with Rails. I am finding it generally pretty agreeble, so I thought I’d write up some of the things I like about it for others. And a few other notes. I am ..read more
Visit website
Using engine_cart with Rails 6.1 and Ruby 3.1
Bibliographic Wilderness
by jrochkind
2y ago
Rails does not seem to generally advertise ruby version compatibility, but it seems to be the case taht Rails 6.1, I believe, works with Ruby 3.1 — as long as you manually add three dependencies to your Gemfile. gem "net-imap" gem "net-pop" gem "net-smtp" (Here’s a somewhat cryptic gist from one (I think) Rails committer with some background. Although it doens’t specifically and clearly tell you to add these dependencies for Rails 6.1 and ruby 3.1… it won’t work unless you do. You can find other discussion of this on the net.) Or you can instead add one line to your Gemfile, opting in to us ..read more
Visit website
Rails7 connection.select_all is stricter about it’s arguments in backwards incompat way: TypeError: Can’t Cast Array
Bibliographic Wilderness
by jrochkind
2y ago
I have code that wanted to execute some raw SQL against an ActiveRecord database. It is complicated and weird multi-table SQL (involving a postgres recursive CTE), so none of the specific-model-based API for specifying SQL seemed appropriate. It also needed to take some parameters, that needed to be properly escaped/sanitized. At some point I decided that the right way to do this was with Model.connection.select_all , which would create a parameterized prepared statement. Was I right? Is there a better way to do this? The method is briefly mentioned in the Rails Guide (demonstrating it is publ ..read more
Visit website

Follow Bibliographic Wilderness on FeedSpot

Continue with Google
Continue with Apple
OR