The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
The Rails presence Method
A quick dive into a lesser used, but useful Rails method.
Semaphore Boosters - automated parallel testing for Rails available to all
A feature that helps you to automate parallelizing your RSpec and Cucumber tests in a few clicks is now available to everyone. It has helped many teams to reduce their Rails CI build times by as much as 2 hours. Learn how it works and try it: https://semaphoreci.com/blog/2018/06/07/automated-parallel-testing-for-rails-available-to-all.html
Tell Don't Ask Principle in Ruby
In this video you’ll learn how to use the Tell Don’t Ask Principle to write better Ruby code! https://www.youtube.com/watch?v=3BaKc-hWGmA
A Simple Way to Decrease Complexity of Routes in Rails
Sometimes, when you are working with a large codebase, your routes.rb files grow really fast and become very dirty. [more inside]
Lessons learnt in the fourth year running a Ruby consultancy
Hi all! Àlex from MarsBased here, a 100%-remote Ruby & Angular consultancy from Barcelona. After four excellent years, we wanted to share some lessons learnt in the last one with all of you: most of them are good for freelancers and business owners, irrespective of the technologies and sectors. [more inside]
Match stream
Hi! Recently I had to handle large files in memory using lazy enumerators. When I was testing I realized that there is no built in matcher in RSpec to test if two enums are the same, so I built a custom matcher for this. [more inside]
Should you break up your monolithic application?
Marco Palladino of Kong discusses the whens and hows of how to break up a monolithic application into #microservices
Upgrade Your JS Debugging In Capybara w/ Browser Extensions
Debugging client code in integration tests can be difficult. Our usual workflows are broken because we don’t have the right tools at our disposal, but it doesn’t have to be this way! Here is how to use the browser extensions you know and love in your tests. [more inside]
world-cup.json - Open world cup in Russia 2018 football data in json
Hello, using the sportdb machinery (gems, command line tools and build scripts in ruby) I’ve put together a new free public domain dataset for the (football) world cup in Russia 2018. The world’s biggest (sport) event kicking off in about a week. Enjoy the beautiful game with ruby and datasets in json or sql :-). PS: Find the (activerecord) sql to json script in the yorobot automation repo.
Errata release for Everyday Rails Testing with RSpec now available
I was hesitant to post this here, but Leanpub has disabled email notifications of new releases as they transition to GDPR (for good reason). I released a large, errata-focused release of Everyday Rails Testing with RSpec this evening, as a free update to anyone who’s ever bought the book over its six-plus year run. Help me get the word out? https://leanpub.com/everydayrailsrspec/
Use “barewords” to embrace the true power of late-binding in Ruby
This is the RubyTapas episode most often-cited as a fan favorite, and it’s now free for everyone!
Ruby's redo, retry and next keywords
Wrote a primer on Ruby’s little known redo keyword.
Removing the @ Hack in Rails Controllers
Wrote up a quick article explaining a technique I have found used for loading data in controllers in a way that I find more maintainable then before_action hooks. Interested in feedback.
MiniTest + swagger = MiniApivore
API testing rails-free gem for swagger documented APIs: https://github.com/alekseyl/mini-apivore [more inside]
My Favorite Ruby Community Resources
Following a conversation with a fellow developer, I decided to expand a private message into a full post https://schwad.github.io/ruby/rails/community/resources/2018/05/03/my-favorite-ruby-community-resources.html
[Screencast] User Notifications
Using the Notifications Rails Engine, we are able to add notifications to our applications based on certain events. The engine provides the schema and necessary controls and associations to seamlessly integrate into your app. https://www.driftingruby.com/episodes/user-notifications
Setup ELK for NGINX logs with Elasticsearch, Logstash, and Kibana
ELK Elastic stack is a popular open-source solution for analyzing weblogs. In this blog post, I describe how to setup Elasticsearch, Logstash and Kibana on a barebones VPS to analyze NGINX access logs. I don’t dwell on details but instead focus on things you need to get up and running with ELK-powered log analysis quickly. [more inside]
Deep Learning with Apache MXNet and Ruby
Insights on using Apache MXNet by Kenta Murata with Ruby in a RubyKaigi presentation: https://speakerdeck.com/mrkn/deep-learning-programming-on-ruby [more inside]
Introducing highlightjs-turbolinks, a turbolinks 5 compatible fork of highlight.js
Highlightjs-turbolinks is a Turbolinks 5 compatible fork of Highlight.js, and is up to date with v9.12.0. [more inside]
Http.rb is Great
Http.rb is a very nice HTTP client gem with impressive features. In this article I talk about some of http.rb’s capabilities that make it stand out for me, and compare them with Net::HTTP.
Dynamically setting default_url_options in Capybara
If you’re developing a full-stack Rails app with a link-based hypermedia API then you may find incorrect URLs breaking your system/feature Capybara specs. Find out what’s going on and how to fix it by dynamically setting default_url_options in Capybara.
teletype - create command line apps the easy way!
tty now includes the teletype executable for scaffolding command line applications. Generating new application is a simple as running the teletype new my-app-name in your console. You can then add new commands and subcommands with integration and unit tests baked in. Let me know about your terminal creations built with teletype! Everything you need to know is in a readme document.