Ruby Icon

Ruby

Ruby is a scripting language designed for simplified object-oriented programming.
289 Stories
All Topics

CSS github.com

A truly monstrous async web chat using no JS whatsoever on the front end

This is a truly glorious hack. How do they do it? Background-images loaded via pseudoselectors + a forever-loading index page (remember Comet?). There’s a more detailed explanation of what’s going on here in the README. Hopefully doesn’t need to be said, but I’ll say it anyway just in case: don’t try this at $HOME

read more

Vladimir Dementyev Evil Martians

Rails 6: B-sides and rarities

Discover the lesser-known parts of the next major framework upgrade, appealing to mature applications that have been around for a while. Instead of focusing on “greatest hits,” we will walk you through B-sides and rarities that make this new release enjoyable in subtler ways. What B-sides and rarities are Vladimir speaking of? While the most-advertised Rails 6 features like Action Mailbox and Action Text steal all the spotlight, it is unlikely that a real-life Rails application that has been around for a while will benefit from the ease of building WYSIWYG text editors right after the upgrade. At the same time, less flashy features like multiple databases support or parallel testing can bring immediate gains to your productivity—and Rails 6 has enough of those to offer if you know where to look.

read more

Stripe Icon Stripe

Sorbet – a static type checker for Ruby

Some interesting new open source coming out of the team at Stripe. It appears they’ve stolen a few (good) tricks from TypeScript’s playbook: Sorbet is 100% compatible with Ruby. It type checks normal method definitions, and introduces backwards-compatible syntax for method signatures. Explicit method signatures make Sorbet useful for anyone reading the code too (not just the author). Type annotations serve as a tool for understanding long after they’re written. Sorbet is designed to be useful, not burdensome. Explicit annotations are repaid with clear error messages, increased safety, and increased productivity. There’s docs, a demo, and a talk from Strange Loop 2018, but you’ll have to wait to get your hands on the source. It’s advertised as Coming Summer 2019.

read more

Rails chanind.github.io

Why I miss Rails

David Chanin: I know Rails isn’t universally beloved by developers, and I’m not suggesting that we give up React and es7 and go back to writing server-templated web-apps like it’s 2012 again. There’s a false dichotomy here. You don’t have to give up React to write server-templated web-apps. That being said, I understand what he’s trying to say. However, I do think that in the transition to the modern web stack (something like React / nodejs / graphql / etc), we’ve unsolved some of what tools like Rails made easy 10 years ago - and I don’t think it needs to be that way. This post is less a love song to Rails as it is a pitch for the value of unified frameworks in web development.

read more

Thoughtbot Icon Thoughtbot

Templating tmux with tmuxinator

If you’re a tmux user, but you’ve never heard of tmuxinator… it’s time to fix that. Simon van Dyk has a solid intro to it on Thoughtbot’s blog: tmuxinator is a ruby gem that allows you to easily manage tmux sessions by using yaml files to describe the layout of a tmux session, and open up that session with a single command. I’ve been using tmuxinator for years and highly recommend it. 👌

read more

Ruby github.com

Elixir/Unix style pipe operations in Ruby

This is a proof of concept, but oh what a concept! I freakin’ 💚 Elixir’s pipe operator, hope they’ll add it to JavaScript, and would trade half my kingdom to have it in Ruby. "https://api.github.com/repos/ruby/ruby".pipe do URI.parse Net::HTTP.get JSON.parse.fetch("stargazers_count") yield_self { |n| "Ruby has #{n} stars" } Kernel.puts end #=> Ruby has 15120 stars

read more

Floor DrEES Phusion Blog

Using GitHub Actions to build and publish a Ruby gem

Follow along as our friends at Phusion walk us through the process of creating a GitHub Actions workflow to build and publish a Ruby gem to the RubyGems registry. One of the actions featured in the version that’s currently exclusively available to GitHub employees and a selected and undisclosed group of Beta testers, is the ‘GitHub Action for npm’, which wraps the npm CLI to enable common npm commands. We set out to instead make an example workflow to build and publish a Ruby library (or: gem) to the default public registry, and created a GitHub repository, with a Docker container for a ‘Rubygems’ action: github.com/scarhand/actions-ruby

read more

Ruby bundler.io

Announcing Bundler 2.0

Congrats to the Bundler team (and entire Ruby community) for shipping an awesome update to this critical piece of infrastructure! Bundler truly changed the game for Rubyists around the world and we continue to benefit from its goodness. What’s new in 2.0? A lot, but I’ll cherry pick a minor change that made me smile: Changed the github: 'some/repo' gem source to use the https schema by default Finally! That’s worth the price of admission from where I’m sitting. Also: With the release of Bundler 2, the core team now kicks off a new release schedule for Bundler: we’re going to aim for one major version release per year, so we can drop support for older Ruby and RubyGems versions around the same time that the Ruby core team does. Being able to stop supporting Ruby 1.8.7 is a huge relief! To the future!

read more

David Heinemeier Hansson Ruby on Rails blog

Action Mailbox for Rails 6

DHH announced on the Ruby on Rails blog the details behind Action Mailbox, the second brand new framework coming to Rails 6 (the first was Action Text). Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. The framework was, like Action Text and Active Storage, extracted from Basecamp 3. We’ve been using a related approach to route everything from forwarded emails to email replies to messages and discussions. After extracting the ideas into Action Mailbox, we reintegrated the framework into Basecamp, and we’ve been running the code we’re sharing today for over a month in production.

read more

German Velasco Thoughtbot

Is Elixir a scripting language?

Finally, an article that breaks Betteridge’s law of headlines! Elixir is known for being a language made for building distributed applications that scale, are massively concurrent, and have self-healing properties. All of these adjectives paint Elixir in a grandiose light. And for good reasons! But is Elixir also a language that can be used for the more mundane tasks of this world like scripting? I think the answer is a definite yes. I’ve been writing Elixir for a few years now, but when it comes time to script something I still reach for Ruby. Case in point, our data import routines for changelog.com (which y’all know is an Elixir app) are written in Ruby. Why do I do this? Familiarity plays a big part. Also I find Ruby to be highly ergonomic for such tasks. Having said that, this article will make me consider trying Elixir for my next script.

read more

David Heinemeier Hansson weblog.rubyonrails.org

Rails 6 will provide a built-in rich text editor

DHH announces Action Text, a big new feature coming to Rails 6: It’s an integration between the Trix editor, Active Storage-backed file and image processing, and a text-processing flow that ties it all together. With Action Text, you really shouldn’t ever have to impoverish your users with a vanilla textarea ever again! I’m a bit torn on this. On one hand, Trix is a good tool and many (most?) web apps need rich text editing at some point in their lifespan. On the other hand, it’s difficult to build general purpose features like this that span both the front and back ends of the stack. Rails 6 is a ways away (with betas starting in early 2019), so we’ll have to wait and see. Regardless of whether this particular feature pans out, it’s great to see the Rails team continue to innovate and try new things.

read more

Miguel Michelson Martinez github.com

Stories — a self hosted Medium platform built with Ruby on Rails

Looks-wise, this is an exact design clone too. Hope that doesn’t get anyone who uses this “as is” in any trouble with the real Medium. This project is a fork of a Medium clone which began as Ken Hibino’s personal side project to learn Rails and React. I upgraded and refactored parts of the Rails app and integrated Dante2 wysiwyg editor. If you’re looking for commentary around the project or Rails, check Hacker News.

read more

Rails medium.com

Powering your Ruby & Rails development with Pry

I use Pry (a runtime developer console) all the time and I still learned a few tricks from this post. Here’s a doozy for working in Rails apps: there’s show-routes , which does what the name implies, and also takes a -G flag for grepping. No more starting up a new shell to execute rake routes | grep login and wait for it to boot up Rails just to give us the routes on the side! This is the one and only tool that i miss when working with Elixir and Phoenix. Yes, I know there’s IEX.pry built in, but it doesn’t offer as smooth a workflow as Ruby’s pry. Maybe someday…

read more

Lyndsey github.com

🎯 The best fastlane plugin to understand and tame misbehaving iOS tests

Lyndsey Ferguson: Unit testing and the tests themselves are written by humans. Humans are prone to error. Unit tests and the testing infrastructure can be imperfect. The test_center plugin includes tools that remove (or alleviate) the effects of an imperfect test infrastructure. (fastlane is a popular way to automate building/releasing iOS and Android apps.)

read more

Joseph Emmanuel DL Dayo github.com

A pure Ruby implementation of a TensorFlow-like library with provisions for hardware acceleration

A reimplementation of TensorFlow for Ruby. This is a ground up implementation with no dependency on TensorFlow. Effort has been made to make the programming style as near to TensorFlow as possible, comes with a pure Ruby evaluator by default with support for an opencl evaluator for large models and datasets.

read more

Mauricio Gomes github.com

Stealth – a Ruby framework for creating conversational bots

This is a lot like Ruby on Rails (even with ActiveSupport & ActiveRecord built-in), but instead of views you have replies. It works for both voice-based and text-based bots and has NLP offerings baked in too. 🍰 The only bummer is that service integrations are currently limited to Facebook Messenger and Twilio SMS. That’s pretty normal for a new open source offering, though, and it’s a great place to hop in and contribute. ✊

read more

Tom Black blacktm.com

A guide to getting started with Ruby on WebAssembly

Tom Black: With the advent of WebAssembly, the race is on to bring new languages to the web. This is the first example (I think!) of a Ruby interpreter running in the browser. The path to get there is circuitous. Ruby script → MRuby bytecode → C → emcc → LLVM → Binaryen → WebAssembly The good news is access to that path is just a gem install wasm away. Read the entire post for some great context and history around these efforts.

read more

Rails rollbar.com

Top 10 errors from 1000+ Ruby on Rails projects (and how to avoid them)

Nice post by our friends at Rollbar: We looked at our database of thousands of projects and found the top 10 errors in Ruby on Rails projects. We’re going to show you what causes them and how to prevent them from happening. If you avoid these “gotchas,” it’ll make you a better developer. I know many of these like the back of my hand. 🤣…😭

read more

0:00 / 0:00