Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Paweł U. | Ruby on Rails Web Development Consultant Full Stack Blog 

How to Backup Heroku PostgreSQL Database to an Encrypted AWS S3 Bucket

Heroku offers a robust backups system for it’s PostgreSQL database plugin. Unfortunately, you can irreversibly lose all your data and backups just by typing a single command. It might seem improbable, but still, I would rather not bet my startup’s existence on a single faulty bash line. In this tutorial, I will describe how to set up a proprietary Heroku PostgreSQL backups system to a secure AWS S3 bucket.

I will be covering various tools including AWS CLI, OpenSSL, GPG, Heroku buildpacks, and scheduler but you don’t need to be familiar with any of those. By following this guide, you will set up a reliable, custom backups system for Heroku PostgreSQL database even if you don’t have much…

RubyMine Blog 

YARD support in RubyMine

YARD is a popular Ruby documentation generation tool that is used in multiple libraries for documenting code. RubyMine helps you to work with YARD tags and documentation in various ways, for example, you can view the documentation using Quick Documentation Lookup, create missing YARD tags, and check the validity of a YARD tag. RubyMine can also utilize the YARD annotations for better code insight, it uses them to help suggest more relevant results in code completion and parameter hints for methods.
In this blog post, we’ll remind ourselves about the existing capabilities available in RubyMine for YARD and look at the new ones we’ve added.

View documentation

First…

All Ruby Podcasts by Devchat.tv 

MRS 091: Kurtis Rainbolt-Greene

Sponsors

  • Sentry use the code “devchat” for 2 months free on Sentry small plan
  • CacheFly

Host: Charles Max Wood

Joined By Special Guest: Kurtis Rainbolt-Greene

Episode Summary

Links

Picks

Kurtis Rainbolt-Greene:

Charles Max Wood:

All Ruby Podcasts by Devchat.tv 

RR 418: The Life and Death of a Rails App with Olivier Lacan

Sponsors

Panel

  • Charles Max Wood

  • David Kimura

  • Nate Hopkins

  • Andrew Mason

With Special Guest: Olivier Lacan

Episode Summary

Olivier Lacan joins the panel again. He currently works for Pluralsight. Today they are talking about the spectrum of creating a Rails app, or any app, from the birth of the idea to the death of the project. They stress the importance of planning for updates. Olivier talks about his experience in creating CodeSchool, which has now been incorporated into Pluralsight. David also shares his experience with the life and death of a project.…

The Bike Shed 

203: A Blessed Monkeypatch (Eileen M. Uchitelle)

On this week's episode, we revisit RailsConf 2019 for another live recording, this time with Eileen M. Uchitelle, GitHubber and rails core team member. Eileen joins Chris to discuss her RailsConf talk on how GitHub maintained a custom fork of Rails for years, how they finally moved off it, and what lessons we can take away from their experience. They also discussed Eileen's recent work on automatic database switching coming in Rails 6, microservices and monoliths, and getting into working on Rails.

Test Double | Our Blog 

Things I Wish I Knew Before Going Remote

The video above was recorded at RailsConf 2019 in Minneapolis, Minnesota.

Remote work is just like working in an office—minus the soul-crushing commute. How hard could it be?

Spoiler: it's actually pretty hard.

When I went remote, I was so excited to not pack a lunch that I didn't consider the implications of a quasi-reliable Internet connection or the psychological impact of spending so much time at home.

As it turns out, going remote isn't just trading a highway commute for a hallway one. It requires new skills and a mindset shift. In this talk, you'll learn how to assess your needs as a remote worker and gain a set of tools to help you succeed for the long term.

If you liked this talk,…

RubyGuides 

How to Use The Ruby Begin & Rescue Keywords (With Examples)

Let’s talk about the begin keyword in Ruby.

What is it?

First, you need to understand something.

Your Ruby programs may trigger an error state at multiple points while they’re running.

Examples include:

  • You’re trying to read a non-existing file
  • You divide a number by zero
  • A web server you’re working with has an outdated SSL certificate

When that happens…

Ruby doesn’t crash right away!

You get a chance to handle & recover from the error.

We call this “exception handling”.

Ruby gives you a few keywords to implement error recovery in your code.

These keywords are begin & rescue.

Let’s discover how to use them!

How to Handle Ruby Exceptions

How do you handle these exceptions?

You can wrap the…

BigBinary Blog 

Rails 6 adds Array#extract!

This blog is part of our Rails 6 series. Rails 6.0.0.rc1 was recently released.

Rails 6 added extract! on Array class. extract! removes and returns the elements for which the given block returns true.

extract! is different from reject! in the way that reject! returns the array after removing the elements whereas extract! returns removed elements from the array.

Let’s checkout how it works.

Rails 6.0.0.beta2

Let’s pluck all the user emails and then extract emails which include gmail.com.

>> emails = User.pluck(:email)
SELECT "users"."email" FROM "users"

=> ["amit.choudhary@bigbinary.com", "amit@gmail.com", "mark@gmail.com", "sam@gmail.com"]

>> emails.extract! { |email| email.include?(
Semaphore 

Steve Peak from Storyscript on the future of software development and creating a new language focused on data flow

We invite software industry professionals to Semaphore Uncut YouTube show to discuss what problems they’re currently solving and what excites them about the emerging technologies.

In this episode, we were chatting with Steve Peak, Founder & CEO at Storyscript.

This chat was recorded on June 5th, 2019 and is also available in the form of a podcast.

Full transcription below.

Darko [00:11:23] Welcome to Semaphore Uncut, a place where we talk about cutting edge technologies and people who build them. My name is Darko. I’m your host for today, and with us we have Steve Peak. Steve, please go ahead and introduce yourself.

Steve [00:11:39] Hi. Thank you, Darko, for having me…

Julia Evans 

What does debugging a program look like?

I was debugging with a friend who’s a relatively new programmer yesterday, and showed them a few debugging tips. Then I was thinking about how to teach debugging this morning, and mentioned on Twitter that I’d never seen a really good guide to debugging your code. (there are a ton of really great replies by Anne Ogborn to that tweet if you are interested in debugging tips)

As usual, I got a lot of helpful answers and now I have a few ideas about how to teach debugging skills / describe the process of debugging.

a couple of debugging resources

I was hoping for more links to debugging books/guides, but here are the 2 recommendations I got:

“Debugging” by David Agans: Several people…

Karol Galanciak - Ruby on Rails and Ember.js consultant 

Messages on Rails Part 3: RabbitMQ

In the first part of this series, we were exploring some potential options for communication between services – what their advantages and disadvantages are, why HTTP API is not necessarily the best possible choice and suggesting that asynchronous messaging might be a better solution, using, e.g. RabbitMQ and Kafka. We’ve already covered Kafka in the part 2, now it’s the time for RabbitMQ.

What is RabbitMQ, and how does it work?

RabbitMQ is a general purpose message broker supporting multiple protocols, yet, we are going to focus mostly on AMQP, which is the one that is the most typically used. It implements a smart broker/dumb consumer model. Unlike Kafka, it means that the broker is…

Notes to self 

Automating tasks and improving developer workflow with pre-commit git hooks

Probably the most usual git workflow is adding changes to the staging area, committing them, and pushing them to the remote repository. Depending on the project we are working on there are some things that we should be checking, validating or generating before heading for the commit. That’s where pre-commit hooks come in.

What’s pre-commit hook? Git has various checkpoints that we can hook into by providing an executable in .git/hooks/ with the name of the hook. One of them is the pre-commit hook that is ran automatically by git before commiting changes to the repository. If we want git to run arbitrary code before each and every commit we simply create .git/hooks/pre-commit

avdi.codes 

Tools for turning descriptions into diagrams

Sometimes I have a picture of a software design in my head and I just want to draw it. If I don't need to collaborate with anyone remotely I might just draw it freehand. For collaborations and for diagrams I might want to iterate on, a tool like LucidChart can be really handy.

But sometimes I just want to list concepts as I hear them, fill in the connections between them, and let a computer worry about layout. That's what the tools below are all about. The particulars of each tool differ, but all of them let you enter a simple text description, e.g.:

[Chili]-->[Beans]
[Chili]-->[Tomatoes]
[Chili]-->[Onions]

And they will turn it into a visual diagram, like so:

A diagram of chili ingredients

(This diagram was generated…

Appfolio Engineering 

Why is Ruby Slower on Mac? An Early Investigation

Sam Saffron has been investigating Discourse test run times on different platforms. While he laments spending so much extra time by running Windows, what strikes me most is the extra time on Mac — which many, many Rubyists use as their daily driver.

So which bits are slow? This is just a preliminary investigation, and I’m sure I’ll do more looking into it. But at first blush, what seems slow?

I’m curious for multiple reasons. One: is Mac is so slow, is it better to run under Docker, or with an external VM, rather than the Mac? Two: why is it slow? Can we characterize what is so slow and either do less of it or fix it?

First, let’s look at some tools and what they can or can’t tell us.

Ruby-Prof

avdi.codes 

How to relax your Ruby version specification in your Gemfile

Have you ever run into this error?

Your Ruby version is 2.6.1, but your Gemfile specified 2.6.3

Annoying, right? You know your Ruby version is new enough to run this application, but the Gemfile is so fussy.

Turns out, Gemfiles don't have to be so picky. Just like you can relax version dependencies for gems, you can also make your Ruby version specifier less specific. As with gems, the secret is using the tiddly-waka (~>) operator:

ruby '~> 2.6.0'

Now this project will run with any patch version of Ruby 2.6 without complaint.

Awesome Ruby Newsletter 

Issue 161 - I'm worried about Ruby future

Ruby Weekly 

A production-optimized alternative distribution of MRI

#455 — June 20, 2019

Read on the Web

Ruby Weekly

▶  Progress on Compacting GC in Ruby 2.7 — No, this is not a short talk (indeed, it’s an hour long, but the actual technical part starts at 15 minutes in) but Aaron, both a member of the Ruby and Rails core teams, explains what work is taking place to improve Ruby’s garbage collector by essentially ‘defragging’ (or ‘compacting’) the memory that Ruby uses at runtime.

Aaron Patterson

Fullstaq Ruby: An Alternative CRuby Distribution, Optimized for Production — A CRuby/MRI-based Ruby distribution that’s optimized for production environments out of the box,…

Hongli…

Drifting Ruby Screencasts 

Teaching at Bootcamps with Ed Toro

Ed Toro speaks to his experience at bootcamps from a teacher's perspective. We gain a different perspective of what bootcamps are like. Ed shares valuable information whether you're considering getting into coding or currently at a bootcamp.
Ruby on Rails Podcast 

275: ITP 2.1, Github is on Fire and Mechanical Keyboards with Brittany & Nick

Nick Schwaderer and Brittany Martin talk about all of the cool things that are happening in their worlds. Tune in to dive into robots, the great cookie debate, Github acquisitions and new features and, of course, keyboards.

Links for this episode:

Brought to you by:

Whether you…

Semaphore 

Python Continuous Integration and Deployment From Scratch

Python is the oldie-but-goodie of programming languages. Since the ’80s, it has provided developers with reliability and ease-of-use.

No matter how reliable your coding language is, however, you need to implement continuous integration and delivery (CI/CD) to detect and remedy errors quickly. When you have confidence in the accuracy of your code, you can ship updates faster and with fewer mistakes.

By the end of this hands-on guide, you’ll understand how to build, test and deploy a Python website. We’ll then show you how to use a continuous integration and delivery platform, Semaphore, to automate the whole process. The final CI/CD pipeline will look like this:

What we’re…
Code with Jason 

How I test JavaScript-heavy Rails applications

A common question I get is how to test JavaScript in Rails applications. My approach is almost radically simple and unsophisticated.

My Rails + JavaScript testing approach

I think of the fact that the application uses JavaScript like an inconsequential and irrelevant implementation detail. I test JavaScript-heavy applications using just RSpec + Capybara integration tests, the same exact way I’d test an application that has very little JavaScript or no JavaScript at all.

I don’t really have anything more to say about it since I literally don’t do anything different from my regular RSpec + Capybara tests.

Single-page applications

What about single-page applications? I still use the same…

OmbuLabs Blog 

Code Conventions and Rubocop

Everyone has had the experience of working on a gnarly, difficult to understand code-base. The sort of code base that makes you hate your job. Often it comes down to poor design, but code conventions also play a large part in whether you wake up dreading your job in the morning. The overall design (choice of design patterns and how modules and classes are organized and factored) is the long range, big picture strategy of how an application will be made. Code conventions, by contrast, come down to the choices you make about which constructs of a language you use, which you don't, and when.

How you name variables, functions, classes, and how you organize and implement control logic…

Martian Chronicles, Evil Martians’ team blog 

GraphQL on Rails: updating the data

Authors: Dmitry Tsepelev, Back-end Developer at Evil Martians and Polina Gurtovaya, Front-end Developer at Evil Martians

A hitchhiker’s guide to developing GraphQL applications with Rails on the back-end side and React/Apollo on the front-end side. The second part of this tutorial will cover mutations (the way to update data) and advanced topics about client caching.

In the first part of the guide we learned about what GraphQL is, and created a very first version of the Martian Library application. If you haven’t read the article yet, now’s the perfect time to take a look.

We have already configured graphql-ruby gem and Apollo framework to make sure they play well together and…

A Year of Commits 

Ruby Processes and Threads - Configuring a Web Server

Multiple popular Ruby web servers exist. Each Ruby application is different and the ultimate tl;dr for configuring a web server is: it depends. This post will not prescribe one web server or configuration over another and will instead explain internal components most popular servers contain.

In order to facilitate more than one request at a time, a Ruby web server implements Threads, Processes, or both. These tools are used to enable concurrency and are beneficial in different ways.

Threads

Threads in Ruby are a solution for concurrent programming and can alleviate slow downs due to blocking code. This blocking is usually referred to as “I/O” or Input/Output blocking and occurs when a…

All Ruby Podcasts by Devchat.tv 

RR 417: The Devchat.tv Mission and Journey with Charles Max Wood

Sponsors

Panel

  • Charles Max Wood

Episode Summary

Charles talks about his journey as a podcaster and his mission with Devchat.tv. Devchat.tv  is designed to home podcasts that speak to all developer communities. Charles also plans Devchat.tv to host shows for technologies that are on the verge of a breakthrough and will be a lot more widely available in the near future such as Artificial Intelligence (AI), Internet of Things (IoT), Virtual Reality (VR) and Augmented Reality (AR). There are new shows being added continuously to reach out to new…

Valentino Gagliardi 

The Secret Life of JavaScript Objects: a Tale of Prototypes

Entire books have been written on JavaScript objects and the prototype system. Yet beginners and even experienced developers struggle to learn and remember what the stuff is about. Here’s a refresher for you!

The secret life of JavaScript objects

Prelude: JavaScript fundamentals

JavaScript builds on seven lego bricks called “types” of the language. The complete list is:

  • String
  • Number
  • Boolean
  • Object
  • Symbol
  • Null
  • Undefined

These types are also called “primitives”, except Object which is considered a type on its own. Object in JavaScript is the backbone of the language. JavaScript objects are containers for keys and values. Think of an object as a phone book:

var obj = {
  alex: "333335685454",
  valentino:…
The Bike Shed 

202: I Left it All on The Dance Floor

In this week's episode, Chris and Steph discuss how working with typed-languages influences their work with dynamic languages. They also chat about the benefits of pair programming, tracking performance events using Rails' Instrumentation API and respond to a listener's question about how to structure code that doesn't fit neatly within the default Rails' structure.

Test Double | Our Blog 

Debrief: RailsConf 2019

A few weeks ago, several Test Double agents attended RailsConf 2019 in Minneapolis. They had a great time, so we asked them to share their favorite talks. Here's what a few of us took away from the conference:

Marla B Zeschin (twitter)

This year's RailsConf had a number of standout sessions for me—everything from Rails at scale to frank discussions on the real-world implications of ethics and diversity in technology. However, one session in particular stuck with me: Amy Newell's talk, Failure, Risk, and Shame: Approaching Suffering at Work.

Amy covered a heavy topic with an impressive blend of honesty, openness, grace, and humor. In the talk, Amy posits that some degree of shame and…

Code with Jason 

A repeatable, step-by-step process for writing Rails integration tests with Capybara

Many Rails developers who are new to writing tests struggle with the question of what to write tests for and how.

I’m about to share with you a repeatable formula that you can use to write an integration test for almost any Rails feature. It’s nothing particularly profound, it won’t result in 100% test coverage, and it won’t work in all cases, but it will certainly get you started if you’re stuck.

The three integration test cases I write for any Rails CRUD feature

Most features in most Rails applications are, for better or worse, some slight variation on CRUD operations. Here are the tests I almost always write for every CRUD feature.

  1. Creating a record with valid inputs
  2. Trying to create a…
Code with Jason 

The difference between RSpec, Capybara and Cucumber

If you’re new to Rails testing you’ve probably come across the terms RSpec, Capybara and Cucumber.

All three are testing tools. What are they for? Do you need all of them? Here are some answers.

RSpec

RSpec is a testing framework. It’s what allows you to write and run your tests.

An analogous tool would be MiniTest. In my experience, most commercial Rails projects use RSpec and most open-source Ruby projects use MiniTest. At any Rails job you’re more likely to be using RSpec than MiniTest. (I’m not sure why this is the way it is.)

Capybara

Some Rails tests operate at a “low level”, meaning no browser interaction is involved. Other “high level” tests do actually spin up a browser and click…

BigBinary Blog 

Rails 6 adds Enumerable#index_with

This blog is part of our Rails 6 series. Rails 6.0.0.rc1 was recently released.

Rails 6 added index_with on Enumerable module. This will help in creating a hash from an enumerator with default or fetched values.

Before Rails 6, we can achieve this by calling map along with to_h.

index_with takes both value or a block as a parameter.

Let’s checkout how it works.

Rails 5.2

Let’s create a hash from an array in Rails 5.2 using map and to_h.

>> address = Address.first
SELECT "addresses".* FROM "addresses"
ORDER BY "addresses"."id" ASC LIMIT $1  [["LIMIT", 1]]

=> #<Address id: 1, first_name: "Amit", last_name: "Choudhary", state: "California", created_at: "2019-03-21 10:03:57",…
RubyGuides 

How to Use The Ruby Sequel Gem (With Examples)

What is Sequel?

Sequel is a gem that allows you to access your database, no Rails required.

You can connect to your database in different ways.

Mostly two:

  • By sending raw SQL commands
  • By using an ORM

Here’s an example, using raw SQL & the MySQL database.

require 'mysql2'

client  = Mysql2::Client.new(host: "localhost")

results = client.query("SELECT * FROM users WHERE age > 21")

The results?

An array of hashes with the data.

Now:

If we want to work with the data in an Object-Oriented way, we will need to make the results into objects.

That’s a big part of what an ORM does.

What’s an ORM?

ORM stands for “Object-Relational-Mapping”.

Sequel, named after the vocalization of SQL (a query…

GoRails Screencasts 

Building a product in under 10 minutes with Jumpstart Pro

Jumpstart Pro is finally out today! We'll take a look at out to build a subscription content business with it in under 10 minutes
Speedshop - Ruby on Rails performance consulting 

Why Your Rails App is Slow: Lessons Learned from 3000+ Hours of Teaching


“What I do have is a particular set of skills, a set of skills which makes me a nightmare for slow Rails applications like you.”

For the last 4 years, I’ve been working on making Rails applications faster and more scalable. I teach workshops, I sell a course, and I consult. If you do anything for a long period of time, you start to see patterns. I’ve noticed four different factors that prevent software organizations from improving the performance of their Rails applications, and I’d like to share them here.

Performance becomes a luxury good, especially when no one is watching

Often times at my Rails Performance Workshop, I discover that an attendee simply has no visiblity into what their…

Riding Rails 

Direct upload mirroring, multiple databases overview and more

Hi there. This is Wojtek bringing you goodies from the Rails world.

Document multiple databases

Gives a great overview of available multiple database features coming in Rails 6.

Mirror direct uploads

Tells the mirror service to copy the blob from the primary service to any secondary service where it doesn’t already exist.

Fix preloading on ActiveRecord::Relation

Fixes a case where records are duplicated by a join by using a less known Hash method compare_by_identity.

Improve on_rotation in MessageEncryptor

Allow on_rotation option in MessageEncryptor to be passed in constructor.

Make rescues layout responsive

Debugging on small devices got a lot easier by adjusting default errors…

katafrakt's site 

I'm worried about Ruby future

Last year at Grill.rb conference Bozhidar Batsov (you may know him as Rubocop creator) gave a talk “Ruby.next”, in which he presented his views about current state of Ruby. The landscape was pretty grim: no clear roadmap for Ruby 3, old issues still present, recent changes are insignificant. It is clear that other languages, such as C#, JavaScript or even Java, see more structured development and Ruby is kind of stuck for years.

But the point of the presentation was rather optimistic: we are the community, we are supposed to lead a change and press core team to steer the language development in a direction we want.

Almost a year later, I’m not that optimistic anymore. Let me show you why…

Remote Ruby 

Open Source Government Development in Rails with Charley Stran

RubyGems Blog 

2.7.10 Released

RubyGems 2.7.10 includes minor enhancements.

To update to the latest RubyGems you can run:

gem update --system

If you need to upgrade or downgrade please follow the how to upgrade/downgrade RubyGems instructions. To install RubyGems by hand see the Download RubyGems page.

Minor enhancements:

  • Fix bundler rubygems binstub not properly looking for bundler. Pull request #2426 by David Rodríguez.
  • [BudlerVersionFinder] set .filter! and .compatible? to match only on major versions. Pull request #2515 by Colby Swandale.
  • Update for compatibilty with new minitest. Pull request #2118 by MSP-Greg.

SHA256 Checksums:

  • rubygems-2.7.10.tgz
    d81dda6d8c54849cda16a95ae0216516deaa0f59ed3c1232…
RubyGems Blog 

3.0.4 Released

RubyGems 3.0.4 includes minor enhancements and bug fixes.

To update to the latest RubyGems you can run:

gem update --system

If you need to upgrade or downgrade please follow the how to upgrade/downgrade RubyGems instructions. To install RubyGems by hand see the Download RubyGems page.

Minor enhancements:

  • Add support for TruffleRuby #2612 by Benoit Daloze
  • Serve a more descriptive error when –no-ri or –no-rdoc are used #2572 by Grey Baker
  • Improve test compatibility with CMake 2.8. Pull request #2590 by Vít Ondruch.
  • Restore gem build behavior and introduce the “-C” flag to gem build. Pull request #2596 by Luis Sagastume.
  • Enabled block call with util_set_arch. Pull request…
Awesome Ruby Newsletter 

Issue 160 - Building a Sinatra Clone in 23 Lines of Ruby

Ruby Weekly 

dry-validation 1.0.0 released

#454 — June 13, 2019

Read on the Web

Ruby Weekly

The Ruby Style Guide Gets a Major Facelift — This is truly a one-stop-shop for how to write Ruby code that can be easily read and maintained by other Rubyists.

Bozhidar Batsov

Introducing ActionView::Component: View Components Are Coming to Rails? — This pull request introduces ActiveView::Component based on work done at GitHub, bringing the popular concept of view components into Rails.

Ruby on Rails

Powerful CI/CD Pipelines. Pay Only For What You Use — Built for developer productivity, Semaphore 2.0 allows you to model any CI/CD workflow with…

Ruby Together News 

May 2019 Monthly Update

Hello! Welcome to the monthly update. During May, our work was supported by Ruby member Handshake, and Sapphire members Stripe, DigitalOcean, and Triplebyte, as well as many others. 1 company and 1 developer signed up as new members during the month. In total, we were supported by 59 companies and 119 developers. Thanks to all of our members for making everything that we do possible. <3

ruby together news

It's been a busy month! We launched the new Ruby Me handbook, and the second group of apprentices and mentors began their work. This session, there are 5 apprentices and 5 mentors. They’re working on a wide variety of Ruby open source projects, and some are even already seeing PRs…

Ruby on Rails Podcast 

274: Investing In Your Side Hustle with Scott Pio

Roller Derby Nation is a growing network, dedicated to serving roller derby fans and their skaters. Brittany (Norma Skates) invited its founder, Scott Pio (Veggie Delight), on to the show to discuss dedication to your side hustle and how multi-tenancy can extend your application's reach.

Links for this episode:

Brought to you by:

Whether you want to learn in-person or online, Flatiron School helps students change careers with confidence with 1:1 career coaching and a tuition-back guarantee—follow their proven job…

Semaphore 

Continuous Integration and Delivery to AWS Kubernetes

Kubernetes is a fantastic platform to run resilient applications and services at scale. But let’s face it, getting started with Kubernetes can be challenging. The path that code must take from the repository to a Kubernetes cluster can be dark and full of terrors.

But fear not! Continuous integration and delivery (CI/CD) comes to the rescue. In this article, we’ll learn how to combine Semaphore with AWS Elastic Container Registry (ECR) and Kubernetes Service (EKS) to get a fully managed cluster in a few minutes.

What we’re building

We’re going to set up CI/CD pipelines to fully automate container creation and deployment. By the end of the article, our pipeline will be able to:

RailsApps 

RailsApps Tutorials Now Free

I’m offering all the Capstone Rails Tutorials, plus the Learn Ruby on Rails books, for free. Until now, the combination of the books, the advanced tutorials and the videos were available for a one-time purchase of $95. Over 800 developers have purchased the RailsApps Tutorials in the previous four years. But Rails moves fast with major releases every two years. Rails 6.0 will soon be released. Though the Learn Ruby on Rails books have been updated for Rails 5.1 and the RailsApps example applications are up to date for Rails 5.0, the tutorials are written for Rails 4.2. I’d like to update all the material but until I’ve done so, I’m going to make access free for all the material.

Test Double | Our Blog 

Designing an interview process that works

At Test Double, we want to fix the problems with how the world writes software. One of those problems is often how developers are selected in the first place. Think about the last time you went to an interview. Were the questions asked relevant to the role you were hoping to fill? Was the process streamlined, organized, and efficient? Did it give you a good idea of whether you’d fit as a member of the team? In most tech interviews the answer to many of these questions is 'no'.

The interview process for a developer is often more of a hoop (okay, a series of really, really arbitrary hoops) to jump through rather than a mutually beneficial process. Technical interviews often feel more like pop…

The Miners - Medium 

The Dark Side of Flutter: What Frustrations Should You Expect?

Recently, I had the opportunity to lead a mobile app development project where we decided to use the Flutter framework. In this post, I want to share my experience with Flutter in a real project, focusing on the disappointments I faced.

Why did I choose Flutter?

Truth is we had the freedom to choose any mobile technology we wanted, from native to cross-platform, and we were almost choosing the popular React Native framework if it weren’t for an unsolved issue. We ended up choosing Flutter due to development speed and ease of accessing native features.

The dark side…

Despite being a Flutter enthusiast, it is up to a good software engineer to accept that there is no language, framework, or…

All Ruby Podcasts by Devchat.tv 

RR 416: The Difference between Devise and Warden with Leonardo Tegon

Sponsors

Panel

  • Charles Max Wood

  • David Kimura

  • David Richards

  • Andrew Mason

With Special Guest: Leonardo Tegon

Episode Summary

Leonardo Tegon is a software developer at Plataformatec, the company that created Devise. Leonardo talks about how he ended up at Plataformatec and shares a little bit about the talk he gave about alternative authentication methods. He talks about the difference between Devise and Warden. Some of the panelists have had some issues…

The Bike Shed 

201: Artisanally Indented Code (Kevin Deisz)

On this week's episode, Chris is joined by Kevin Deisz, CTO of CultureHQ, live from RailsConf. They discuss Kevin's RailsConf talk on preevalution in Ruby, but dig further into Kevin's core philosophies that drive his work on tools like preval. They round out the discussion with Kevin's work on prettier-plugin Ruby, an automated code formatter to finally tame the wild west of Ruby syntax, and the hopeful path to a v1.0 in the not too distant future.

Code with Jason 

Stuck on a programming problem? These tactics will get you unstuck about 99% of the time

Being stuck is possibly the worst state to be in when programming. And the longer you allow yourself to stay stuck, the harder it is to finally get unstuck. That’s why I find it important to try never to allow myself to get stuck. And in fact, I very rarely do get stuck for any meaningful length of time. Here are my favorite tactics for getting unstuck.

Articulate the problem

I teach corporate training classes. Often, my students get stuck. When they’re stuck, it’s usually because the problem they’re trying to solve is ill-defined. It’s not possible to solve a problem or achieve a goal when you don’t even know what the problem or goal is.

So when you get stuck, a good first question to ask…

BigBinary Blog 

Rails 6 adds private option to delegate method

This blog is part of our Rails 6 series. Rails 6.0.0.rc1 was recently released.

Rails 6 adds :private option to delegate method. After this addition, we can delegate methods in the private scope.

Let’s checkout how it works.

Rails 6.0.0.beta2

Let’s create two models named as Address and Order. Let’s also delegate validate_state method in Order to Address.

class Address < ApplicationRecord
  validates :first_name, :last_name, :state, presence: true

  DELIVERABLE_STATES = ['New York']

  def validate_state
    unless DELIVERABLE_STATES.include?(state)
      errors.add(:state, :invalid)
    end
  end
end

class Order < ApplicationRecord
  belongs_to :address

  delegate :validate_state, 
RubyGuides 

Understanding Ruby Methods & Writing Your Own

What is a Ruby method?

A method is made of lines of Ruby code grouped together with one specific goal.

The goal can be to:

  • GET information
  • CHANGE or CREATE objects
     

Example 1:

The size method on an Array object gives you a count of elements (information).

Example 2:

The pop method removes the last element from the array (change).

When you understand the relationship between objects, classes & methods everything starts to make sense.

relationship between objects, classes and methods

Let’s keep learning!

How to Define Methods

Ruby has many powerful built-in methods you can use, but you can also create your own.

How?

You can define your own Ruby method using the def keyword.

Here’s the syntax:

def gimme_bacon
  puts "Bacon plz."
end

Wha…

Valentino Gagliardi 

Svelte 3 Tutorial for The Impatient (React) Developer

Learn the new kid in town with this Svelte 3 tutorial. Everything you need to know to start building with Svelte!

Svelte 3 Tutorial For The Impatient Developer (2019)

What is Svelte?

Svelte is a JavaScript UI library created by Rich Harris. Rich thinks that virtual DOM is just overhead and came up with Svelte which is now at its third incarnation.

But why you would want to learn Svelte? Aren’t React or Vue enough? Well, there are some interesting selling points:

  • Svelte is a compiler, not a dependency like React or Vue
  • Svelte seems to need less code for the same things that with React require 40% more LOC (source: Rich Harris)
  • Svelte has no virtual DOM, compiles to minimal “vanilla” JavaScript and seems more performing than…

I didn’t do any benchmark to backup those assumption, take it with a grain of salt. In the following tutorial I’ll rather focus on the core concepts of Svelte 3.

EquiValent 

Rails sequence error on postgresql db

Recently my staging DB start throwing ActiveRecord::RecordNotUnique PG::UniqueViolation: ERROR: duplicate key value violates unique constraint error.

I don’t fully understand how the error happened (maybe it was because I trigger copy production to staging DB script) but result was that postgresql database went out of sync on information: “was the last ID inserted”

or maybe that’s Rails to blame source

That means that last ID was 358878 but for some reason Rails or Postgres thinks it’s 358871

Example error

ActiveRecord::RecordNotUnique PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "puppies_pkey" DETAIL: Key (id)=(358871) already exists. : INSERT INTO…
dry-rb news 

dry-validation 1.0.0 released

We’re very happy to announce the release of dry-validation 1.0.0!

This is a big release: it includes a rewritten schema DSL, released as dry-schema, and a completely redesigned validation system. If you’re interested to know the reasoning behind these changes, please refer to the “Plans for dry-validation + dry-schema (a new gem!)” post on our forum. Yes, it’s from February 2017, this took a while, but it was totally worth the wait. Continue reading to see why.

New-old schema DSL

The schema DSL has been rewritten from scratch and not only did it fix dozens of known issues, it also introduced a couple of new features. That said, some complex features that didn’t fit anymore were removed.…

Appfolio Engineering 

JIT Performance with a Simpler Benchmark

There have been some JIT performance improvements in Ruby 2.7, which is still prerelease. And lately I’m using a new, simpler benchmark lately for researching Ruby performance.

Hey - wasn’t JIT supposed to be easier to make work on simpler code? Let’s see how JIT, including the prerelease code, works with that new benchmark.

(Just wanna see graphs? These are fairly simple graphs, but graphs are always good. Scroll down for the graphs.)

The Setup - Methodology

You may remember that Rails Simpler Bench currently uses “hello, world”-type very simple routes that just return a static string. That’s probably the best possible Rails use case for JIT. I’m starting with no concurrency, just a single…

Remote Ruby 

Joined by Josh Wood

Hi, we're Arkency 

How many Ruby programmers are there in the world?

According to JetBrains research (as of 2019), there is 300.000 professional Ruby programmers, while there is over a 1.000.000 programmers who use Ruby.

A few days ago, I’ve had a chance to sit with Artem Sarkisov, a product marketing manager from JetBrains, responsible for the RubyMine IDE.

Artem’s perspective on the Ruby community is quite unique, as he looks at it from the marketing perspective.

Here is this part of the conversation where we talk about the size of the Ruby community:

Awesome Ruby Newsletter 

Issue 159 - dry-rb 1.0: upgrading validations, types and schemas

Test Double | Our Blog 

Interview them where they are.

The video above was recorded at the RailsConf 2019 in Minneapolis, Minnesota.

As engineers, we've spent years mastering the art of conducting technical interviews—or have we? Despite being on both sides of the table dozens of times, how often have we come away feeling that the interview didn't work as well as it could have? How many of our interviews have been just plain bad? How much time do we spend designing and improving our own interview processes, and what signals should we be looking for when it comes to making those improvements?

This talk examines the technical interview in depth, developing a framework for interviewing candidates "where they are" by focusing on answering two major…

Giant Robots Smashing Into Other Giant Robots 

Using doobie; Scala with PostgreSQL vs ActiveRecord

Some context

I joined thoughtbot as a Rails developer. Ruby on Rails was my first web framework and my introduction to building web applications. From this, I’ve been lucky enough to write applications in a variety of technologies, and each one shows me features I take for granted in Rails and features I wish I had. I want to talk a bit about my last Scala client project, and I’d like to talk mostly about the database.

ActiveRecord is one of my favourite parts of Rails. I learnt the DSL first and SQL second so I’ve always been comfortable thinking in terms of ActiveRecord. Rolling onto a Scala project, I found myself in a situation where ActiveRecord was not an option and, at…

Universe Engineering - Medium 

Improving Browser Performance 10x

We recently improved the performance of the Universe.com homepage by more than ten times. Let’s explore the techniques we used to achieve this result.

But first, let’s find out why website performance is important (there are links to the case studies at the end of the blog post):

  • User experience: poor performance leads to unresponsiveness, which may be frustrating for users from a UI and UX perspective.
  • Conversion and revenue: very often slow websites can lead to lost customers and have a negative impact on conversion rates and revenue.
  • SEO: Starting July 1, 2019, Google will enable mobile-first indexing by default for all new websites. Websites will be ranked lower if they are slow on mobile…

In this blog post, we will briefly cover these main areas, which helped us to improve the performance on our pages:

  • Performance measurement: lab and field instruments.
  • Rendering: client-side and server-side rendering,…
Ruby Weekly 

The first preview release of Ruby 2.7

#453 — June 6, 2019

Read on the Web

Ruby Weekly

Ruby 2.7.0 Preview 1 Released — The “preview” stage of 2.7.0 is upon us and is now in good shape to be tested by the wider community. Features include:

  • Heap compaction in the garbage collector (a win for long-running and multithreaded apps).
  • Pattern matching.
  • Multi-line editing support and rdoc integration in irb.
  • The .: method reference operator.
  • Enumerable#tally for counting the occurrence of elements in an enumerable.
  • Beginless ranges, numbered parameters, JIT imrovements, and more.

The…

Depfu 

Reasonably up-to-date

Let’s face it, sometimes the amount of pull requests you get with Depfu, or automated dependency updates in general, can get a bit overwhelming and annoying. Especially on projects with a large amount of dependencies and especially in the JS ecosystem (which moves quite fast).

There are a few patterns we’ve seen happening over and over again:

  • Stabilization releases: A new version (often a major release) is followed by at least one, sometimes several bugfix releases within hours as people discover critical bugs with the new version. These cause a lot of churn and noise in your PRs and notifications.
  • High frequency packages: Some libraries just release new versions very often. There…

It’s called bleeding edge for a reason

Depfu now supports a new update strategy called “reasonably up-to-date”. There is a lot of value in…

Code with Jason 

Logging the user in before Capybara feature specs

Logging in

If you’re building an app that has user login functionality, you’ll at some point need to write some tests that log the user in before performing the test steps.

One approach I’ve seen is to have Capybara actually navigate to the sign in page, fill_in the email and password fields, and hit submit. This works but, if you’re using Devise, it’s a little more complicated than necessary. There’s a better way.

The Devise docs have a pretty good solution. Just add this to spec/rails_helper:

RSpec.configure do |config|
  config.include Warden::Test::Helpers
end

Then, any place you need to log in, you can do login_as(FactoryBot.create(:user)).

Log in before each test or log in once before…

Scott Watermasysk 

👩‍💻 How to Execute a Terminal Command in VSCode

VSCode has a good story for using the terminal within the IDE. However, there is no built in way to execute a command via a keyboard shortcut.

Thankfully, I found an extension which easily enables this, Command Runner.

Run custom shell command defined in vs code configuration and node module package.json

With this in place, I was able to add keyboard shortcut which will execute Standard’s fix commmand.

{
    "key": "ctrl+alt+s",
    "command": "command-runner.run",
    "args" : {"command": "standardrb ${file} --fix"}
}
Ruby on Rails Podcast 

273: GraphQL Migration: A Use Case for Metaprogramming with Shawnee Gao

Shawnee is a Fullstack Software Engineer on Square’s Business Operations Platform team. As a maintainer of a platform codebase, her work focuses on creating robust and scalable APIs and abstracting away lower level framework code. Which is what lead to her interest in ruby meta-programming and GraphQL!

Links for this episode:

Brought to you by:

  • OSCON is ground zero to find out what you need to be in the know about in the open source community for 20 years. Listeners to the Ruby on Rails podcast can get 20% off of most* passes to OSCON when you go to oscon.com/ruby and use code RUBY20 during registration.
avdi.codes 

SIGAVDI #55: Lavender Yogurt Edition

Hello friends,

I just got back to Tennessee after a wonderful couple of weeks in St. Louis. Hey look, here's another pairing video with Jess! I wanted to deepen my understanding of TypeScript, so we started implementing one of my go-to “learn a language” programs: a text adventure game.

TypeScript is boring, but that's kind of the point. And it has some nice type inferencing.

BTW, Jess has a newsletter and if you like this one you will love hers.


Something I realized in conversation with Jess this past week: technologies and practices often act as proxies for culture.

You want to adopt microservices but really you want small feature teams to be able to act independently and quickly.

BigBinary Blog 

Rails 6 allows spaces in postgres table names

This blog is part of our Rails 6 series. Rails 6.0.0.rc1 was recently released.

Rails 6 allows spaces in tables names in PostgreSQL. Before Rails 6, if we try to create a table named as user reviews, Rails tries to create a table named as reviews in schema named as user.

Let’s checkout how it works.

Rails 5.2

Let’s create a table user reviews in Rails 5.2.

>> class CreateUserReviews < ActiveRecord::Migration[5.2]
>>   def change
>>     create_table 'user reviews' do |t|
>>       t.string :value
>>
>>       t.timestamps
>>     end
>>   end
>> end

=> :change

>> CreateUserReviews.new.change
-- create_table("user reviews")
CREATE TABLE "user"."reviews" ("id" bigserial primary key, "value"
RubySec 

XSS Vulnerability in Chartkick Ruby Gem

Drivy Engineering 

Design system and API-Driven UI

Why?

For some time now, we have been heavily relying on our API to display formatted content on our apps API Driven Apps. It enables us to be more agile, by shipping new features faster and easily iterating on them without updates. Recently, we pushed this paradigm even further, generating complete native views from the API with our design system.

There are several advantages to this, you can:

  • Build a brand new screen with almost no mobile development if all the visual components already exist
  • Easily add or remove components on a given screen without the need of an app update
  • Run A/B testing on your screens to see what works best, by moving or adding/removing component

Plus, you…

Martian Chronicles, Evil Martians’ team blog 

GraphQL on Rails: from zero to the first query

Authors: Dmitry Tsepelev, Back-end Developer at Evil Martians and Polina Gurtovaya, Front-end Developer at Evil Martians

A hitchhiker’s guide to developing GraphQL applications with Rails on the back-end side and React/Apollo on the front-end side. Follow this multi-part tutorial to learn both the basics and the advanced topics by example and feel the power of this modern technology.

GraphQL is one of those new shiny things we’ve been seeing here, there and everywhere: blog posts, conferences, podcasts, maybe, even newspapers. It sounds like you should hurry up and start rewriting your application in GraphQL instead of REST as soon as possible, right? Not exactly. Remember: there is no…

All Ruby Podcasts by Devchat.tv 

RR 415: Code Free Developer Interview with Pete Holiday

Sponsors

Panel

  • Charles Max Wood
  • Dave Kimura
  • Andrew Mason
  • Nate Hopkins

With Special Guest: Pete Holiday

Episode Summary

Special Guest Pete Holiday is the director of engineering at a company called Samsara and specializes interviewing software engineers. The panel begins by talking about some of the trends they see in tech interviews, specifically the move towards code-heavy interviews. Pete does not think take home tests accurately simulate a work environment, and shares his…

All Ruby Podcasts by Devchat.tv 

MRS 090: Charles Max Wood

Sponsors

  • Sentry use the code “devchat” for 2 months free on Sentry small plan
  • CacheFly

Host: Charles Max Wood

Episode Summary

Charles talks about his journey as a podcaster and his mission with Devchat.tv. Devchat.tv  is designed to home podcasts that speak to all developer communities. Charles also plans Devchat.tv to host shows for technologies that are on the verge of a breakthrough and will be a lot more widely available in the near future such as Artificial Intelligence (AI), Internet of Things (IoT), Virtual Reality (VR) and Augmented Reality (AR). There are new shows being added continuously to reach out to new communities, some examples of which are: a Data Science show, a…

Semaphore 

Peter Steinberger from PSPDFKit on his startup journey, quirks of PDF and what’s exciting about WWDC19

We invite software industry professionals to Semaphore Uncut YouTube show to discuss what problems they’re currently solving and what excites them about the emerging technologies.

In this episode, we were chatting with Peter Steinberger, Founder & CEO at PSPDFKit.

This chat was recorded on May 29th, 2019 and is also available in the form of a podcast.

Full transcription below.

Darko [00:09:42] Welcome to Semaphore Uncut, a show where we explore cutting edge developer tools and meet people behind them. My name is Darko. I am the co-founder of Semaphore and your host today. Today with me is Peter – Peter, thank you so much for joining us today. Please go ahead and introduce…

Code with Jason 

All my best programming tips

What follows is a running list of all the programming tips I can think of that are worth sharing.

Many of these tips may seem so obvious they go without saying, but every single one of these tips is here because I’ve seen programmers fail to take advantage of these tips on multiple occasions, even very experienced programmers.

I’ve divided the tips into two sections: development tips and debugging tips. I’ve arranged them in no particular order.

Development tips

Articulate the goal

Before you sit down and start typing, clearly articulate in writing what it is you’re trying to accomplish. This will help you avoid going down random paths which will dilute…

RubyGuides 

What Are Rails Parameters & How to Use Them Correctly

Let’s talk about Rails parameters!

Why are they useful?

Users can send data to your web application in three different ways.

These three ways are:

  1. Using a query parameter ("example.com/?q=bacon")
  2. Submitting a form ("/users/sign_in")
  3. Within the URL itself ("/books/1")

How do you access this data from Rails?

With params.

Inside your controller action’s you can call params to access form & URL query data.

What is params, exactly?

It’s a method that returns an ActionController::Parameters object, in practice it behaves a lot like a hash.

Now.

Let’s say that you want to read one value from this params hash.

Here’s how:

params[:id]

You get the value if it exists.

Or nil if it doesn’t.

Few…

RubyMine Blog 

RubyMine 2019.2 EAP is Open!

Hi everyone,

RubyMine 2019.2 EAP (build 192.4205.37) is now open! The first EAP build adds support for new things in Rails 6, improves YARD and Factory Bot support, and fixes many bugs. Here’s a short version of the completed tasks:

JetBrains Runtime 11

RubyMine 2019.2 uses JetBrains Runtime 11 (the fork of OpenJDK 11 with fixes from the JetBrains team). This transition addresses a range of issues and hopefully will make…

Test Double | Our Blog 

Enumerate your enums.

Some people say "e-noom". Others say "e-numb". But for some reason, Rails calls its enums "integer". That decision—dating back to the feature's introduction in Rails 4.1—has caused no end of problems for developers and teams that aren't hyper-vigilant about managing the impedance mismatch between ActiveRecord objects that marshal enum attributes as strings and the underlying database schema that represents enum columns as integers.

If you've been using Rails enum attributes and have never had an issue with them, then feel free to stop reading and go about your day. But if you've ever run into a tricky gotcha when trying to populate an enum field in a test fixture or when submitting a form,…

Rebased Blog 

Testing Locally Running App Inside VirtualBox

Until now I used VirtualBox for two things – running Windows apps that didn’t run on macOS and checking production issues that happened only in specific environments – but everytime I was accessing an existing, Internet-facing domain. Yesterday I had to fix one of such occurs-only-in-this-browser issues – so I...
Drifting Ruby Screencasts 

Inline Editing Records

Using Rails UJS, we create an interactive row editing solution without using any kind of Javascript frameworks.
Andy Croll 

Don’t Email From Active Record Callbacks

One of the first things you often want to do within your Rails application is send email.

A frequent pattern is that an email is sent after a change to, or creation of, an instance of one of your models.

Instead of…

…sending email inside a callback in your model:

class BookReview < ApplicationRecord
  after_create :send_email_to_author

  private

  def send_email_to_author
    AuthorMailer.
      with(author: author).
      review_notification.
      deliver_now
  end
end

Use…

…the controller to send your email.

class BookReviewsController < ApplicationController
  def create
    BookReview.create(comment_params)
    AuthorMailer.
      with(author: author).
      review_notificati…

Why?

This is all about clarity and preventing surprises when you come back to the code.

Dustin Zeisler 

AWS Lambda + Ruby = Podcast [tutorial]

Learn how to write a Lambda function in Ruby to create a Podcast feed.

As of Nov 29, 2018 you can write server-less functions with Ruby! You can now use your favorite Ruby tools and libraries when developing lambda functions.

In case your not familiar with lambda here is how amazon describes it.

“AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time you consume - there is no charge when your code is not running. With AWS Lambda, you can run code for virtually any type of application or…

Search Results for “ruby” – via @codeship 

Set Up CloudBees CodeShip Basic with Node JS, Step-by-Step

Reading Time: 6 minutes

Recently, I wrote an article on how you can set up CodeShip Basic with Ruby on Rails where I focused on how you can set up a mini continuous integration (CI) pipeline. My goal for this article is to show you how to quickly set up a mini CI pipeline and to expose you to the next items that are essential to a powerful CI build.


Learn the steps to setting up CloudBees CodeShip Basic wth NodeJS by @evan_glazer via @codeship
Click To Tweet


When it comes to development – in general – we want to write fast and effective code and deploy without any defects (So we hope =D). Testing the code we write manually and then have to save the sha and then merge the commits…and then…
Remote Ruby 

Joined by Lee Richmond

Igor writing about things 

dry-rb 1.0: upgrading validations, types and schemas

I’m enthusiastic about dry-rb gems. Actually, I’ve never worked on Ruby projects without a dry-rb gem. However, some people are sceptical, as a lot of core dry-rb gems are still in their 0.x phase, which leads to a lot of breaking changes and hours of refactoring.

I’m happy to see dry-rb mature: dry-monads entered 1.0 phase in Summer 2018, and now two more libraries hit v1.0 milestones: dry-types and dry-struct; and dry-validation is in its 1.0 RC phase.

I haven’t updated my dry-rb gems for a couple of months, so I’ve missed a lot of breaking changes. Finally, I decided to upgrade the gems and write about the process. I’ll take a swing at automating my upgrade process as much as I can.

Awesome Ruby Newsletter 

Issue 158 - Accessing Google Sheets with Ruby

Ruby News 

Ruby 2.7.0-preview1 Released

We are pleased to announce the release of Ruby 2.7.0-preview1.

A preview version is released to gather feedback for the final release planned to release on December. It introduces a number of new features and performance improvements, most notably:

  • Compaction GC
  • Pattern Matching
  • REPL improvement

Compaction GC

This release introduces Compaction GC which can defragment a fragmented memory space.

Some multithread Ruby programs may cause memory fragmentation, leading to high memory usage and degraded speed.

The GC.compact method is introduced for compacting the heap. This function compacts live objects in the heap so that fewer pages may be used, and the heap may be more CoW…

Ruby Weekly 

The RailsConf 2019 videos are here

#452 — May 30, 2019

Read on the Web

Ruby Weekly

Working with Tests That Sometimes Fail — Nothing is certain but death and taxes.. and tests that begin to fail over time in mature software projects! Sam, who works on the popular Discourse forum project, looks at how Discourse’s tests have failed over time and how they handle them.

Sam Saffron

▶  RailsConf 2019 Videos — Confreaks have done their usual fantastic job in recording RailsConf (which was 4 weeks ago) and already have 67 videos up for us to enjoy. We'll be linking to more talks in future issues, but a particular highlight was Chris Salzberg's 'Th…

Semaphore 

Launching Semaphore Podcast: The Uncut Chats

I’m very excited to announce the launch of the Semaphore Podcast which is a natural continuation of the Semaphore Uncut Chats that I’ve started a few months ago.

We, as leaders in the software development space and mentors for our technical teams, are all on the same mission to build great software products, ship them fast and provide an excellent service to our clients.

Exchanging our experiences live can only help us to move the needle forwards. This is exactly the mission of our Uncut chats on youtube and podcast.

So far, I’ve had a great pleasure to introduce you to Eddie Zaneski from Digital Ocean, Jacob Smith from Packet, and Lee Skillen from Cloudsmith. As you have seen,…

And this…

EquiValent 

How to launch Rails console in specific Docker image or Docker container

docker-compose run

Given you have docker-compose e.g.

# docker-compose.yml
version: '3'
services:
  my_application:
    image: name_of_my_image:latest
    build:
      context: .
      dockerfile: Dockerfile
    # ...

docker-compose run will start docker image as a container. So you are able to do:

# launch interactive bash
docker-compose run -it my_application  bash

# launch interactive rails console on that rails image
docker-compose run -it my_application rails c

# or if you don't have global bundler in that rails docker image
docker-compose run -it my_application bin/rails c

# to run daemonized rake task in that rails docker image
docker-compose run -d my_application bin/rake…
EquiValent 

Why you should consider Bounded Contexts in Rails

This TIL note is extension of arguments for my article Ruby on Rails - Bounded contexts via interface objects

In traditional Ruby on Rails application you organize code in this way:

app
  controllers
    works_controller.rb
    lessons_controller.rb
  model
    teacher.rb
    work.rb
    lesson.rb
    student.rb
    comment.rb
  mailer
    student_mailer.rb
    teacher_mailer.rb
  services
    lesson_creation_service.rb
    work_upload_service.rb
  jobs
    reprocess_work_thumbnail_job.rb
lib
  generate_thumbnail_from_pdf.rb

Let’s not argue if service objects are “traditional” for Rails. As was pointed out by article How DHH Organizes His Rails Controllers well organized job…

Valentino Gagliardi 

Django tips: Recovering Gracefully From ORM Errors

How do you handle ORM errors in Django? Learn how to make your Django function views more robust with try/except (or with a neat shortcut).

Django: Recovering Gracefully From ORM Errors

Django views are the glue between your users and the underlying database. When a user visits an url Django can map that url with a view. And most of the times the view is also responsible for fetching some data from the database.

Django views and the ORM

Consider the following example. There is a model named Workshop which among the others has a slug field:

"""
models.py
"""

from django.db import models


class Workshop(models.Model):
    """
    ... some other field here
    """
    slug = models.SlugField(max_length=20)
    """
 …
Semaphore 

Define your CI/CD environment with Docker

The range of applications that you can run on Semaphore keeps growing. After native support for iOS, today we’re happy to announce that you can run your CI/CD in any Docker image. This means that Semaphore now supports any technology stack that works with Docker out of the box.

Docker has become a standard for packaging and deploying cloud applications, APIs and microservices. Semaphore has supported building and running containers via full access to the Docker CLI for a long time. However, we’ve heard loud and clear from developers who wanted to use the same environment in development, CI/CD and production: it should be easier than running raw Docker commands.

Here’s an example how…

The Bike Shed 

200: FOMO for Hallway Track (200th Episode!)

On this very special Bike Shed, Steph and Chris celebrate reaching the 200th episode. They discuss the origins of the show and thank some of the wonderful folks who helped make it happen (thanks Derek, Sean, Amanda, Laila, and of course Thom!). They discuss Chris's recent trip to RailsConf and some strategies for making the most of conference attendance. Also, Steph's recent work hosting an intro to web development course. They wrap things up with a series of questions captured live from RailsConf at the community meetup covering career growth, naming, graphql, joy, and more.

avdi.codes 

SIGAVDI #54: Watermelon Salad Edition

Hello friends,

This week I am in St. Louis, visiting Jess. As usual, we’ve been yelling at code together and streaming it (video 1, video 2).

Oh oh oh before I get into the rest of this email, I just wanna say I’ve been working super hard on getting my new chatbots video ready for sale. It has a proper name now: Let’s Build a Chatbot in Ruby!

And I made a cover graphic!

And you can buy it in beta for $15! I’d love to get some more beta customers to give me feedback on it 😁

OK, shameless self-promotion out of the way…


Once I was employee #1 in a funded, incubated startup. The investor/advisors made sure that the founders had all their ducks in a row. Accounting! Payroll! Legal!…

Ruby Magic by AppSignal 

Inside Enumeration in Ruby

Welcome back to another edition of Ruby Magic! A year ago, we learned about Ruby’s Enumerable module, which provides the methods you use when working with enumerable objects like arrays, ranges, and hashes.

Back then, we created a LinkedList class to show how to make an object enumerable by implementing the #each method on it. By including the Enumerable module, we were able to call methods like #count, #map and #select on any linked list without having to implement them ourselves.

We've learned how to use enumerables, but how do they work? Part of the magic in enumerables in Ruby comes from their internal implementation, which is all based on the single #each method, and even allows…

All Ruby Podcasts by Devchat.tv 

RR 414: Docker Talk

Sponsors

Panel

  • Charles Max Wood

  • Andrew Mason

  • Dave Kimura

  • David Richards

Episode Summary

Today the panel is talking about the many applications of Docker. They talk about where Docker fits into the development lifestyle and what kind of applications Docker can help with. Dave goes over some of the some of the Docker terminology, how to set up some basic scenarios, and some of the difficulties often encountered by first time users. They talk about how to…

Semaphore 

Lee Skillen from Cloudsmith on streamlined software packaging, building startups and the promise of on-premise

We invite software industry professionals to Semaphore Uncut YouTube show to discuss what problems they’re currently solving and what excites them about the emerging technologies.

In this episode, we were chatting with Lee Skillen, Founder & CTO at Cloudsmith.

This chat was recorded on May 15th, 2019 and is also available in the form of a podcast.

Full transcription below.

Darko [00:00:02] Hello and welcome to Semaphore Uncut – a show where we explore cutting edge technologies and meet people behind them. My name is Darko. I’m the co-founder of Semaphore and I’m going to be your host today. With me today I have Lee Skillen. Thanks very much for joining us and please go…

Sam Saffron 

Tests that sometimes fail

A liar will not be believed, even when he speaks the truth. : Aesop

Once you have a project that is a few years old with a large test suite an ugly pattern emerges.

Some tests that used to always work, start “sometimes” working. This starts slowly, “oh that test, yeah it sometimes fails, kick the build off again”. If left unmitigated it can very quickly snowball and paralyze an entire test suite.

Most developers know about this problem and call these tests “non deterministic tests”, “flaky tests”,“random tests”, “erratic tests”, “brittle tests”, “flickering tests” or even “heisentests”.

Naming is hard, it seems that this toxic pattern does not have a well…

Test Double | Our Blog 

What happens when you extract a function anyway?

Imagine you've got this snippet of code: (If this looks scary, try reading the original code from testdouble.js—I've made some changes to it here that make it a bit uglier)

function explainFunction (testDouble) {
  if (store.for(testDouble, false) == null) { return explainNonTestDouble(testDouble) }
  const calls = callsStore.for(testDouble)
  const stubs = stubbingsStore.for(testDouble)
  const { children } = explainChildren(testDouble)

  const stubbingDescription = stubs.length > 0
    ? _.reduce(stubs, (desc, stub) =>
      desc + `\n  - when called with \`(${stringifyArgs(stub.args)})\`, then ${planFor(stub)} ${argsFor(stub)}.`
    , '\n\nStubbings:')
    : ''

  const callDescription…
RubyGuides 

Understanding Ruby: String Encoding, ASCII & Unicode

How can strings of characters exist in a world where computers only understand ones & zeros?

Well…

Just like we can map a domain name to an IP address.

Or a barcode to a specific product.

We can…

Map numbers to characters!

Like 97 to "a".

Or 122 to "z".

That’s exactly how we can have characters in a world of numbers.

But what numbers go with what characters?

To answer that question we have invented different character mapping systems.

Starting with ASCII.

ASCII stands for “American Standard Code for Information Interchange”.

You can find an ASCII table, or you can ask Ruby to convert characters to their ASCII value.

Like this:

"a".ord
# 97

For multiple characters:

"abc".bytes
# [97, 98,…
Appfolio Engineering 

Measuring Rails Overhead

We all know that using Ruby on Rails is slower than just plain Rack. After all, Rack is the simplest, most bare-bones web interface in Ruby, unless you’re willing to do without compatibility between app servers (or unless you’re writing your own.)

But how much overhead does Rails add? Is it getting less as Ruby gets faster?

I’m working with a new, simpler Rails benchmark lately. Let’s see what it can tell us on this topic.

Easy Does It

If we want to measure Rails overhead, let’s start simple - no concurrency (one thread, one process) and a simple Rails “hello, world”-style app, meaning a single route that returns a static string.

That’s pretty easy to measure in RSB. I’ll assume Puma is a solid…

Ruby on Rails Podcast 

272: Terrific Tech Bets with Sean Devine

Brittany welcomed back Sean Devine, former host of the Ruby on Rails podcast , and now CEO of XBE. Along with catching up, Sean and Brittany discussed betting on solid technologies and his advice for technical CEOs.

Links for this episode:

Brought to you by:

  • OSCON is ground zero to find out what you need to be in the know about in the open source community for 20…
Remote Ruby 

Live with Nate Berkopec

Awesome Ruby Newsletter 

Issue 157 - RailsConf 2019 Videos

Test Double | Our Blog 

Enumerate your enums.

Some people say "e-noom". Others say "e-numb". But for some reason, Rails calls its enums "integer". That decision—dating back to the feature's introduction in Rails 4.1—has caused no end of problems for developers and teams that aren't hyper-vigilant about managing the impedance mismatch between ActiveRecord objects that marshal enum attributes as strings and the underlying database schema that represents enum columns as integers.

If you've been using Rails enum attributes and have never had an issue with them, then feel free to stop reading and go about your day. But if you've ever run into a tricky gotcha when trying to populate an enum field in a test fixture or when submitting a form,…

Ruby Weekly 

The one where Haml and RMagick return from the dead?

#451 — May 23, 2019

Read on the Web

Ruby Weekly

httplog: Log Outgoing HTTP Requests in Ruby — If you want to debug pesky API integrations or just get a feel for what’s going on under the hood with certain libraries you’re using, this hooks into the popular ways to fetch HTTP from Ruby and logs everything for you. Version 1.3.0 just came out.

Thilo Rusche

Google Cloud Run on Rails: A Real Life Example — A four-part series on creating a Rails application and deploying it using Google Cloud Run, which brings “serverless to containers.”

Laurent Julliard

Get the Fastest RoR Deployments. Get Started…

Code with Jason 

My experience speaking at 7 tech conferences in 9 months including RailsConf, RubyHACK and RubyConf India

Why I wanted to speak at tech conferences

On and off since 2011 I’ve been a freelancer—or, to use the term that I think sounds better, consultant. The vast majority of the work I’ve done as a “consultant” has just been full-time-ish staff-aug contracting. In other words, I worked a lot of contract jobs where I was paid hourly as opposed to salary but by every other measure I was just another developer on my client’s development team, and my client was basically my employer.

Ever since the time I started freelancing it’s been my desire to move on the freelancer-consultant spectrum from the “freelance” end of the spectrum to the “consultant” end of the spectrum. My understanding is that…

Test Double | Our Blog 

I'm ashamed to say it.

When I was in college and job searching, I had an interviewing experience that still haunts my nightmares.

The process involved a series of onsite conversations and activities that was meant to last all day. While the conversations were going well, I misunderstood some instructions in the coding interview and completely bombed it. It was so bad that my next interviewer came in and let me know that obviously I didn't have any sort of web experience whatsoever (I did), and they definitely weren't offering me the job. They invited me to stay for the dinner at the end regardless.

Now, there is a correct order of operations here for recovery. The company—in retrospect—handled this poorly, but…