Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Drivy Engineering 

Sorbet: A Ruby type checker

This article is aimed at beginner Rubyists who want to understand what the fuss around type checking is all about. It can also be relevant for more experienced developers who might be interested in using Sorbet and learning why it’s a bit special.

First I need to say that Sorbet has not been released yet (a preview version is available). Stripe is improving it internally and some other companies are testing it. We can still talk about it because it should be open-sourced in the coming future (they said summer 2019) and it’s nonetheless very interesting. This blogpost is the result of watching talks, and reading articles, Twitter feeds and the official website. It may contain some small…

Riding Rails 

Performance improvements, collection cache versioning and more

Hello. This is Wojtek reporting on recent changes from Rails world.

Collection cache versioning

Add cache_version on relation to support recyclable cache keys via the versioned entries in ActiveSupport::Cache. This also means that cache_key will now return a stable key that does not include the max timestamp or count any more.

Speed up dirty tracking

Reports 2x ~ 30x faster execution time compared to original implementation.

Add dirty methods for store accessors

It is now possible to use methods defined by Dirty module on store accessors.

Add after_save_commit callback shortcut

Adds shortcut for very common case:

after_commit :hook, on: [ :create, :update ]

Notes tags registration

The Bike Shed 

195: WebAssembly & WASI (Lin Clark & Till Schneidereit)

On this week's episode, Chris is joined by Lin Clark and Till Schneidereit of Mozilla to discuss all things WebAssembly. Lin and Clark are helping to lead the development and advocacy around WebAssembly and in this conversation they discuss the current state of WASM, new developments like the WebAssembly System Interface (WASI), and the longer term possibilities and goals for WASM.

Ruby on Rails Podcast 

268: Origins of Discourse & Changing Your Developer Mindset with Sam Saffron

Sam Saffron is the co-founder of Discourse and previously a developer at Stack Overflow. He loves writing software, especially performance improvements in Ruby. Sam joined Brittany from Australia to discuss his blog post, "Why I stuck with Windows for 6 years while developing Discourse".

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.…
Awesome Ruby Newsletter 

Issue 152 - Ruby 2.7 — Pattern Matching — First Impressions

katafrakt's site 

Ruby – Pattern Matching – Second Impressions

Since I published A quest for pattern-matching in Ruby 3 years ago, I’ve been called “pattern matching guy” more than once. So obviously, when I learned that PM is inevitably coming to the Ruby core, I was curious to check it out. First Impressions have already been published, so this is “Second Impressions”, from my point of view.

Heads up: it’s very subjective.

I’m mostly judging it by examples provided in the original Redmine ticket, such as:

class Array
  alias deconstruct itself
end

case [1, 2, 3, d: 4, e: 5, f: 6]
in a, *b, c, d:, e: Integer | Float => i, **f
  p a #=> 1
  p b #=> [2]
  p c #=> 3
  p d #=> 4
  p i #=> 5
  p f #=> {f: 6}
  e   #=> NameError
end

First of all, the…

OmbuLabs Blog 

Submit Great Pull Requests

Pull Requests let developers tell other team members about changes they've made to a project repository. Once a pull request is created, team members can review the set of changes, discuss potential modifications and even push follow-up commits before the changes are merged into the repository. Therefore, it is important to make sure that your pull requests are easily understandable to the reviewers.

Fellow developers need to be able to understand what the pull request is trying to achieve, what approach is being taken, and how all of the changed files relate to each other. In short, a great pull request will:

  • Be short, have a clear title and description, and do only one thing
  • Be…
Ruby Weekly 

First Impressions of Ruby 2.7's Pattern Matching

#446 — April 18, 2019

Read on the Web

Ruby Weekly

First Impressions of Ruby 2.7's Pattern Matching — Enjoy this ‘sneak peek’ at what pattern matching looks like in the forthcoming Ruby 2.7. It’s essentially an extension to case using in instead of when.

Brandon Weaver

Approximating “Prettier for Ruby” with RuboCop — The folks at Flexport have open-sourced some “cops” (RuboCop plugins) to bring Prettier-style autocorrection to Ruby. (Although, as we’ve reported recently, there is also a Ruby plugin for Prettier itself.)

Max Heinritz

Automate Your Code Reviews — Take the hassle out of shipping…

Semaphore 

When SREs and Kubernetes Are Worth It — And When They Aren’t

Seth Vargo is a developer relations engineer at Google. He previously held software-development roles at HashiCorp, Chef Software, CustomInk and a few Pittsburgh-based startups. Passionate about reducing inequality in technology, Vargo is also the author of “Learning Chef.”

In this interview, we discuss Google’s site reliability engineering (SRE), Kubernetes hype and what to focus on when deploying reliable software on a massive scale.

You spend a lot of time explaining and preaching the difference between the roles of an SRE, a DevOps engineer and a systems administrator. On the Google SRE landing page one can read, “SRE is what you get when you treat operations as if it’s a…

code.dblock.org | tech blog 

How to BCC

In his 2001 memoir “How to Lose Friends & Alienate People” Toby Young proposed a universal theorem.

Some people are lucky enough to stumble across the right path straight away; most of us only discover what the right one is by going down the wrong one first.

He may have been talking about one of my former colleagues who made a career limiting move by hitting Reply All to a team re-org announcement and saying out loud what everybody already thought: “I cannot believe you have promoted that idiot.”

The corollary of Toby Young’s theorem is that you should never write anything you don’t want to be read.

That said, such incidents can be avoided with a bit of discipline from the e-mail…

Ruby News 

Ruby 2.6.3 Released

Ruby 2.6.3 has been released.

This release adds support for New Japanese Era “令和” (Reiwa). It updates the Unicode version to 12.1 beta (#15195), and updates date library (#15742).

This release also includes some bug fixes. See details commit logs.

Download

BigBinary Blog 

Rails 6 adds ActiveRecord::Relation#extract_associated

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

Before Rails 6, if we want to extract associated records from an ActiveRecord::Relation, we would use preload and collect.

For example, we want to fetch subscriptions of some users. The query would look as shown below.

Rails 5.2

User.where(blocked: false).preload(:subscriptions).collect(&:subscriptions)

=> # returns collection of subscription records

ActiveRecord::Relation#extract_associated provides a shorthand to acheive same result and is more readable than former.

Rails 6.0.0.beta3

User.where(blocked: false).extract_associated(:subscriptions)

=> # returns the same collection of subscription records
Paweł U. | Ruby on Rails Web Development Consultant Full Stack Blog 

Validate and Fix Ruby on Rails ActiveRecord PostgreSQL Data Integrity

Most Ruby developers work with Rails and Active Record for PostgreSQL database interactions. It provides a ton of magic and is simple to start with. Data integrity problems start creeping up once the code base and database structure gets older. In this blog post, I will describe a couple of techniques for ensuring data integrity and validation in Ruby on Rails web apps.

Your Rails app data integrity can get out of sync for various reasons. Active Record approach to database modeling encourages a developer to keep most of the logic in the app layer Ruby code. Let’s list some example actions that could corrupt your data state:

  • update object attribute using update_column method
  • delete a…
All Ruby Podcasts by Devchat.tv 

RR 409: Turning Fat Models Into Skinny POROs with Jason Swett

Sponsors

Panel

  • Charles Max Wood
  • Dave Kimura

Special Guest: Jason Swett

Episode Summary

Jason Swett is a former host on Ruby Rogues. Now he has his own show, Ruby Testing Podcast and runs the site codewithjason.com where he teaches Rails testing. Today, Jason discusses turning fat models into skinny POROs (Plain Old Ruby Objects). He once read an article that said you don’t have to put all your code into active record models, that you can create plain ruby objects. These can go into active models if you want, but you’re not limited to active record models, you can make your own classes. This…

Drifting Ruby Screencasts 

Interview with Frank Rietta

In this interview, Frank Rietta, a security expert in web applications, talks about various recommendations for securing a Ruby on Rails application. Many areas are explored from code, staff, servers and infrastructure.
BigBinary Blog 

Rails 6 adds implicit_order_column

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

Rails 6 added implicit_order_column on ActiveRecord::ModelSchema which allows us to define a custom column for implicit ordering on model level. If there is no implicit_order_column defined, Rails takes primary key as implicit order column. Before Rails 6 too, primary key is used to order records implicitly by default.

This has impact on methods like first , last and many more where implicit ordering is used.

Let’s checkout how it works.

Rails 5.2

>> class User < ApplicationRecord
>>   validates :name, presence: true
>> end

=> {:presence=>true}

>> User.first
SELECT "users".* FROM "users" ORDER BY "users"
GoRails Screencasts 

How to install TailwindCSS 1.0 with Rails 6

With TailwindCSS 1.0 just around the corner and some changes in Rails 6 to Webpacker, we take a look at how to install and setup the latest version of TailwindCSS with Rails 6.0
Semaphore 

Two Key Docker Benefits and How to Attain Them

In 2013, Solomon Hykes showed a demo of the first version of Docker during the PyCon conference in Santa Clara. Since then, the benefits of Docker containers have spread to seemingly every corner of the software industry. While Docker (the project and the company) made containers so popular, they were not the first project to leverage containers out there; and they are definitely not the last either.

jpetazzo

Editor’s note: This is a guest article by Jérôme Petazzoni, a former Docker engineer, speaker and creator of container.training.

Five years later, we can hopefully see beyond the hype as some powerful, efficient patterns emerged to leverage containers to develop and ship better…

All Ruby Podcasts by Devchat.tv 

RR 408: Zeitwerk with Xavier Noria

Sponsors

Panel

  • David Kumira
  • Eric Berry
  • Andrew Mason

Joined by special guest: Xavier Noria

Episode Summary

This episode of Ruby Rogues features Xavier Noria, who has a background in mathematics, but started software in 2000. He has been freelancing for the past 10 years, working especially in open source. He received the Ruby Hero award in 2010. His latest work is with his own creation, Zeitwerk, a more efficient code loader for Ruby. Zeitwerk will be included in Rails 6, but is an independent gym for now. Xavier talks about his inspiration for Zeitwerk and his desire to improve constant…

RubyGuides 

An Overview of Data Structures For Ruby Developers

What is a data structure? A data structure is a specific way to organize & access data. Examples include: Arrays Binary trees Hashes Different data structures excel at different tasks. For example, hashes are great if you’re looking to store data that looks like a dictionary (word & definition), or a phone book (person name […]

The post An Overview of Data Structures For Ruby Developers appeared first on RubyGuides. Don't miss your free gift here :)

BigBinary Blog 

Bulk insert support in Rails 6

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

Rails 6 has added support for bulk inserts similar to how bulk update is supported using update_all and bulk delete is supported using delete_all.

Bulk inserts can be performed using newly added methods: insert_all, insert_all! and upsert_all.

All of these new methods allow the insertion of multiple records of the same model into the database. A single INSERT SQL query is prepared by these methods and a single sql statement is sent to the database, without instantiating the model or invoking Active Record callbacks or validations.

During bulk insertion, violation of primary key, violation of unique…

OmbuLabs Blog 

Rails Girls: Growing as a Community

In a previous article we talked about one of the Rails Girls events that we sponsored and co-organized in 2018. Fast forward one year to our first event of 2019 at A3, a new coworking space located in Buenos Aires, we were once again sponsors and volunteers at another successful Rails Girls event.

Our goal this year was to go further and try to reach around 50 participants (almost double that of previous years). Fortunately we had a good number of volunteer coaches that were willing to help us make that possible.

Some of the coaches were women who had participated in a previous event and came back to take on the role of coach. They aimed to share the knowledge that they had acquired…

Paweł U. | Ruby on Rails Web Development Consultant Full Stack Blog 

Screencast - Sublime Text Mouse-Free Development Advanced Productivity Tips

Sublime Text is my editor of choice for developing Ruby on Rails and JavaScript web apps. In this screencast, I present a couple of more advanced productivity tips and configs that let you minimize the usage of mouse during development.

Some of the shortcuts I describe are available by default others need to be customized. You can check out my Sublime Text config files here:

User settings

Key mappings

[Duration] 12m


Links and Resources

Sublime Text Plugins

Open Search Result

TestRSpec

Vintage Mode

Rails Go To Spec

Package Resource Viewer

RailsCasts Colour Scheme

Other

Map CapsLock to ESC in MacOS

tmux 2 Productive Mouse - Free Development ebook

Notes to self 

Phoenix CSRF protection in HTML forms, React forms, and APIs

Let’s see how Phoenix implements CSRF for standard HTML multipart forms and how to use CSRF tokens outside these forms in React forms or API calls.

Cross-Site Request Forgery (CSRF) is exactly what it sounds like – an ability to do make a request on behalf of a user from a different site. This is possible when the authorization of the request derives from the authentication that happened automatically by the browser. There are two common scenarios for this; session cookies and HTTP Basic scheme authentication. In both cases the browser sends the authentication details (cookie or login/password combination) with every request to the particular domain name automatically.

To make it…

Michael Cordell's Blog 

Bulk Org-Mode to Github Flavored Markdown

I wanted to move my raw notes for blog post entries from org-mode into a markdown format suitable for ingestion by Jekyll. While you could do single exports of each org file, and then copy-paste as posts are written, this seemed inefficient and difficult to make after-conversion changes. So, I set about a way to convert a set of org files into a corresponding set of markdown files. My initial approach was to use elisp to bulk script the org-mode export. I then wrapped this in a shell script which moved the files to the destination folder. However, I ended up settling on an approach of using pandoc to convert the files wrapped in a shell script. This appears to be the superior approach since…

avdi.codes 

SIGAVDI #49 – Space Vodka Edition

Hello friends,

I can’t brain today and I’m not sure why. I haven’t drunk much alcohol in the last few days, I have received more than adequate cuddles, and I slept way in this morning. Maybe it’s the weather? I’m writing this on the porch in the windy sun between two storm systems.

Last week was back-to-back conferences, both of which I got to enjoy as an attendee rather than as a speaker, which was relaxing.

First was DevopsDays/ServerlessDays/MapCamp Atlanta, which was held, delightfully, inside the Atlanta aquarium. I 100% endorse this conference venue.

The MapCamp track was easily the most interesting. We got a lightning tour of Wardley Mapping from Simon Wardley himself, and then…

Andy Croll 

Prevent Links in Text Fields to Foil Spammers

Your application most likely sends email—in the form of invites, notifications, or forgotten password reminders—even if that is not a primary function of the product.

As soon as you allow user-generated content in those emails, your application becomes an interesting target for email spammers. This is due to these nefarious people, and their robot armies, abusing the free text you allow legitimate users to enter.

Email clients like Apple Mail and Gmail automatically highlight strings of text that look like web addresses, so by simply inserting strings that resemble web addresses, hackers can use text fields to direct users to nefarious websites. They don’t even have to inject HTML.

Inste…

code.dblock.org | tech blog 

Using Strava Webhook Events API

Strava Webhook Events API seems to give developers trouble. Last year I wrote a new Strava Ruby client that made things significantly easier and came with some handy tools.

Here is how to run a full loop locally using strava-webhooks from strava-ruby-client.

Install

Install any recent version of Ruby to get started, then install the gem.

$ gem install strava-ruby-client
Successfully installed strava-ruby-client-0.3.1

Settings

Get a client ID and secret from Strava Settings, My API Application and set these as environment variables. You can also create a .env file in the current directory with these settings and the strava-webhooks tool will pick that up, export or specify these on the…

Show Existing…

Ruby Together News 

March 2019 Monthly Update

Hello! Welcome to the monthly update. During March, our work was supported by Handshake, Stripe, Triplebyte, DigitalOcean, and many others.

ruby together news

In March, Ruby Together was supported by 61 different companies, including Sapphire member Stripe. 2 companies joined as new members. On top of those companies, 2 new developers signed up as members or friends of Ruby Together, including Michael Jacobson. In total, we were supported by 66 individual members and 64 friends of Ruby Together. Thanks to all of our members for making everything that we do possible. <3

The response to our job posting for a Head of Growth was amazing, with over 175 applications submitted. We've been…

Code with Jason 

Common causes of flickering/flapping/flaky tests

A flapping test is a test that sometimes passes and sometimes fails even though the application code being tested hasn’t changed. Flapping tests can be hard to reproduce, diagnose, and fix. Here are some of the common causes I know of for flapping tests. If you know the common causes of flapping tests it can go a long way toward diagnosis. Once diagnosis is out of the way, the battle is half over.

Race conditions

Let’s say you have a Capybara test that clicks a page element that fires off an AJAX request. The AJAX request completes, making some other page element clickable. Sometimes the AJAX request beats the test runner, meaning the test works fine. Sometimes the test runner beats the…

Appfolio Engineering 

Learn by Benchmarking Ruby App Servers Badly

(Hey! I usually post about learning important, quotable things about Ruby configuration and performance. THIS POST IS DIFFERENT, in that it is LESSONS LEARNED FROM DOING THIS BADLY. Please take these graphs with a large grain of salt, even though there are some VERY USEFUL THINGS HERE IF YOU’RE LEARNING TO BENCHMARK. But the title isn’t actually a joke - these aren’t great results.)

What’s a Ruby App Server? You might use Unicorn or Thin, Passenger or Puma. You might even use WEBrick, Ruby’s built-in application server. The application server parses HTTP requests into Rack, Ruby’s favored web interface. It also runs multiple processes or threads for your app, if you use them.

Usually I write…

GoRails Screencasts 

How to use Javascript via Webpacker in Rails 6

Rails 6 defaults to using Webpacker for Javascript instead of the asset pipeline. We'll learn how everything is structured and laid out and see how to add Flatpickr to Rails 6 including both the Javascript and CSS for it.
Ruby on Rails Podcast 

267: The Evolution of RubyMotion/DragonRuby with Lori Olson

RubyMotion, soon to be DragonRuby, empowers developers to write cross-platform apps for iOS, Android and OS X in Ruby. Lori Olson joined Brittany on the show to discuss the evolution of the framework, her mobile development courses and her (potentially) controversial opinions of Javascript.

Links for this episode:

Remote Ruby 

Jumpstart Pro and Building a SaaS App with Hanami

Hi, we're Arkency 

Using streams to build read models

Building read models sometimes pose a technical challenge, especially if given infrastructure doesn’t provide order guarantee and the model has to be eventually consistent. Read models are considered the easy part, so we would like to be able to implement them quickly and move to the more interesting tasks. One of the simplest ways to ensure order is to use dedicated read model streams. Thanks to them, we will be able to spare ourselves a migration of data, so our implementation will be ready as soon as we will finish the code.

Let’s assume that our read model is meant to keep track of some information about football match participants. To build dedicated stream for a read model, we…

The Bike Shed 

194: My PGP Shame

On this week's episode, Chris is joined by Mike Burns, developer in our New York studio, to discuss the ins and outs of application security. Mike recently added a comprehensive Application Security Guide to the thoughtbot guides, and in this chat they discuss some of the high points of the guide, some of the low points of common security holes, and some of the fantastically specific workflows and approaches Mike has for his personal information and security management.

Awesome Ruby Newsletter 

Issue 151 - Approximating “Prettier for Ruby” with RuboCop

The Miners - Medium 

My Journey Discovering Design Patterns I Didn’t Even Know I Use

My Journey Discovering Design Patterns I Didn't Even Know I Use

Getting started with the decorator and service patterns

When I started my internship at CodeMiner 42 last October, I felt overwhelmed by information. So much new stuff to learn, and so much old stuff that I was doing wrong and had to improve on. It’s been a great way to improve myself as a person and mostly as a developer.

Usually, my workflow would go along these lines:

  • I’d get a task and think about how to do it;
  • I’d do it;
  • I’d ask one of my coworkers to make sure it’s all according to the convention;
  • I’d submit it for code review to get shredded by other people;
  • I’d address the code review and submit it again.

I repeated the last two…

Ruby Weekly 

'Beginless' ranges, using React.js with Rails, and building a chat app

#445 — April 11, 2019

Read on the Web

Ruby Weekly

Let's Build a Chat App from Scratch using Rails and WebSockets — Our Step-by-Step Tutorial of the Week™! A thorough look at using ActionCable to create a nice looking real-time chat app.

Lazarus Lazaridis

React-Rails 2.5: Easily Integrate React.js into Rails Apps — Are you a React developer who likes a bit of Rails on the backend? React-Rails is for you and makes it easy to integrate React with the Rails asset pipeline, views, and controllers. Docs here.

React Community

eBook: How to Get a 3x Performance Improvement on Your Postgres Database —…

Semaphore 

A mgmt Contributor on His Lifework

James Shubin is a DevOps/config-management hacker and physiologist from Canada. He writes “The Technical Blog of James.” He also works on a next-generation config-management project he started called “mgmt.”

In this interview, we discuss Shubin’s open source project and how it can contribute to the cloud-native landscape.

You’re the lead developer behind mgmt, which is a “next-generation distributed, event-driven, parallel config management” tool. Could you tell me a bit more about the project, and why you think it stands out from other configuration automation tools available on the market?

Historically, people have thought of infrastructure as pretty static, that it doesn’t…

iridakos - ruby articles 

Linux shell navigation to aliased directories with autocomplete

I use the terminal a lot and in my day to day work I tend to navigate to the same bunch of directories.

There are some awesome tools out there (like autojump or z) but sometimes, especially when the directories are similarly named, there is a need to be explicit to navigate to the proper one.

I decided to write a script to overcome this issue and to avoid having to edit my .bash* files to manage aliases each time I wanted to add or remove a directory.

goto

goto is a shell utility to quickly navigate to aliased directories with autocomplete (tab completion).

goto at GitHub

goto gif

User registers directory aliases, for example:

goto --register dev /home/iridakos/development

and then cds…

Depfu 

Depfu on your premises

When we started Depfu, there were a couple of questions we were getting a lot. One of them was “Do you have an enterprise/on premise solution”.

We have long ignored that topic, because we knew that having to support a version of Depfu that more or less runs completely outside of our control is much more work than just packaging the application up in some fancy docker containers, burn them on a DVD or whatever and hand them over to a surprised admin.

Last year, after a couple of potential clients didn’t stop bugging us, we finally caved in and started to test on premise operation with these clients. After more than half a year of running and adapting we now feel confident enough to…

BigBinary Blog 

Rails 6 drops support for PostgreSQL version less than 9.3

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

Before Rails 6, Rails was supporting PostgreSQL from version 9.1 and above. But in Rails 6, support for versions less than 9.3 is dropped. If your PostgreSQL version is less than 9.3 then an error is shown as follows.

Your version of PostgreSQL (90224) is too old. Active Record supports PostgreSQL >= 9.3.

Travis CI uses PostgreSQL 9.2 by default in their images. So this error can occur while testing the app on Travis CI with Rails 6. It can be resolved by using an addon for PostgreSQL.

All Ruby Podcasts by Devchat.tv 

MRS 085: Pedro Cavalheiro

Sponsors

  • Sentryuse the code “devchat” for 2 months free on Sentry small plan
  • .TECH– tech/MRSand use the coupon code “TECH” and get a 1 year .TECH Domain at $9.99 and 5 Year Domain at $49.99. Hurry!
  • CacheFly

Host: Charles Max Wood

Special Guest: Pedro Cavalheiro

Episode Summary

In this episode of My Ruby Story, Charles hosts Pedro Cavalheiro a software engineer at Xing from Brazil, currently residing in Hamburg, Germany. He has been working with Ruby and PHP languages, and since 2015 has been working full-time with Ruby on Rails.

Listen to Pedro on the podcast Ruby Rogues on this episode.

Pedro has been interested in computers and video games since he was a child. Upon advice…

Everyday Rails 

Replace chromedriver-helper with webdrivers (a public service announcement)

My recommended setup for testing JavaScript in Rails has changed. Read on to learn about the switch to webdrivers.
Sam Saffron 

My i3 window manager setup

I have been a long time i3 window manager user. But not really.

My old Windows 10 based setup involved doing all my console work in an Ubuntu VM running i3. However, the lion’s share of the non console work was still done in Windows, including browsing and more.

For multiple years now I only partially experienced i3, it showed. My i3 setup was almost vanilla.

My move to Arch Linux changed everything.

This move completely shifted the way I think about my relationship with my desktop environment. Previously, my relationship with Windows was very simplistic. Windows works the way it works, I simply adapted to that. Sometimes I learned a new shortcut, but the majority of my Windows day-to-day…

JRuby.org News 

JRuby 9.2.7.0 Released

The JRuby community is pleased to announce the release of JRuby 9.2.7.0

JRuby 9.2.x is compatible with Ruby 2.5.x and stays in sync with C Ruby. This version offers significant improvements to refinements. It also has a big performance gain for Rational#/. As always there is a mix of miscellaneous fixes so be sure to read the issue list below. All users are encouraged to upgrade.

If you do find issues then report them on using our issue tracker at http://bugs.jruby.org. We also encourage users to join our IRC channel (#jruby on Freenode) and mailing lists. You may also follow @jruby on Twitter for updates.

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Ruby Conference Cracow @ Cracow, Poland - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Ruby Conference Cracow
May/14+15 (2d) Tue+Wed @ Cracow, Poland

See all Conferences 'n' Camps in 2019».

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Saint P Rubyconf @ Saint Petersburg, Russia - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Saint P Rubyconf
Jun/1+2 (2d) Sat+Sun @ Saint Petersburg, Russia • (Updates)

See all Conferences 'n' Camps in 2019».

Martian Chronicles, Evil Martians’ team blog 

Try Astrograph: Your GraphQL lens for Stellar blockchain

Authors: Viktor Sokolov, Lead Developer at Evil Martians and Sergey Nebolsin, Lead Developer at Evil Martians

Blockchain meets GraphQL with the beta release of Astrograph—a robust Node/TypeScript server that provides a single endpoint to explore the entirety of Stellar network. It also offers reliable WebSocket-based subscriptions, allowing you to build real-time tools for the mature distributed ecosystem faster and with less effort. You can check out the new tool right now in our dedicated playground.

A non-profit Stellar Development Foundation is on a mission to develop the new world’s economy with a blockchain-based infrastructure that is designed to integrate naturally with…

Valentino Gagliardi 

What is Type Coercion in JavaScript? A Re-Introduction

A re-introduction to type coercion in JavaScript.

What is type coercion in JavaScript?

Enjoy the reading!

What is type coercion in JavaScript? JavaScript primitives

JavaScript builds upon a bunch of fundamental units. You should already be familiar with some of them, like strings and numbers:

var greet = "Hello";
var year = 89;

Strings and numbers are part of the so called “primitives” of the language. The complete list is:

  • String
  • Number
  • Boolean
  • Null
  • Undefined
  • Object
  • Symbol (added in ES6, won’t be covered here)

Booleans represent values that could be either true or false. null on the other hand is the intentional absence of a value. It is usually assigned to a variable for signalling that the binding…

Code with Jason 

A Rails model test “hello world”

The following is an excerpt from my book, Rails Testing for Beginners.

What we’re going to do

What we’re going to do in this post is:

  1. Initialize a new Rails application
  2. Install RSpec using the rspec-rails gem
  3. Generate a User model
  4. Write a single test for that User model

The test we’ll write will be a trivial one. The user will have both a first and last name. On the User model we’ll define a full_name method that concatenates first and last name. Our test will verify that this method works properly. Let’s now begin the first step, initializing the Rails application.

Initializing the Rails application

Let’s initialize the application using the -T flag meaning “no test…

iridakos - ruby articles 

Shell navigation to aliased directories with autocomplete

I use the terminal a lot and in my day to day work I tend to navigate to the same bunch of directories. There are some awesome tools out there (like autojump) but sometimes, especially when the directories are similarly named, there is a need to be more explicit to navigate to the proper one.

I decided to write a script to overcome this issue and to avoid having to edit my .bash* files to manage aliases each time I wanted to add or remove a directory.

Introducing goto

goto is a shell utility to quickly navigate to aliased directories with autocomplete (tab completion).

goto at GitHub

goto gif

User registers directory aliases, for example:

goto --register dev /home/iridakos/development

and…

BigBinary Blog 

Rails 6 requires Ruby 2.5 or newer

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

As per rails/rails#34754, a Rails 6 app requires Ruby version 2.5 or newer.

Let’s discuss what we need to know if we are dealing with Rails 6.

Ensuring a valid Ruby version is set while creating a new Rails 6 app

While creating a new Rails 6 app, we need to ensure that the current Ruby version in the shell is set to 2.5 or newer.

If it is set to an older version then the same version will be used by the rails new command to set the Ruby version in .ruby-version and in Gemfile respectively in the created Rails app.

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

$ rails new…
Semaphore 

Eddie Zaneski from DigitalOcean on DevRel best practices and building intuitive products for software developers.

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 the first episode with a guest appearance, we were chatting with Eddie Zaneski, Developer Relations Manager at DigitalOcean.

This chat was recorded on April 3rd, 2019.

Full transcription below.

Darko: [00:00:06] Hello everyone. Welcome to Semaphore Uncut. This is the first episode where we have a guest. We plan to talk about developer tools, people who are making them and about people who are helping developers to embrace those tools. My name is Darko Fabijan and today I have Eddie Zaneski…

All Ruby Podcasts by Devchat.tv 

RR 407: Functional Programming in Ruby using Dry Gems with Igor Morozov

Sponsors

Panel

  • Charles Max Wood

  • Andrew Mason

  • Nate Hopkins

  • Dave Kimura

  • Eric Berry

Joined by Special Guest: Igor Morozov

Summary

The panel interviews Igor Morozov about functional programming in ruby. Igor Morozov is a lifelong software programmer from Moscow who focuses on functional programming. The panel considers other languages to use for functional programming and the different aspects of ruby that makes it unique for object oriented programming and functional programming. Igor Morozov explains the…

Search Results for “ruby” – via @codeship 

Optimize CI Using a Strong Testing Suite with Ruby on Rails

Reading Time: 4 minutes

When it comes to testing suites, it’s imperative to have a strong suite with all the tools to make your teams life easier. Once your team has a strong testing suite, automating the suite with continuous integration (CI) will bring less defects in your production environments. Currently, the industry has some best practices for testing: BDD, TDD, etc. – although the question in hand – is writing tests before or after development a good approach? We’re going to talk about test driven development; which goes over the methodology to WHY writing tests before we develop is efficient.


Optimize CI with a strong Ruby on Rails testing suite @evan_glazer via @codeship
Click To…


I will also discuss some of the necessity’s in Ruby on Rails for making a…

code.dblock.org | tech blog 

How to Hire a VP of Engineering

I recently wrote about dividing CTO and VP of Engineering responsibilities. That post is only useful if you actually have a VP of Engineering. So how does one hire such an animal? Is the process different from hiring any other team member?

What’s Different?

While much of the hiring process remains the same, a VP hire differs from hiring individual contributors, leads or managers in some important ways.

  • The price of getting this hire wrong is higher, because a VP of Engineering inherits the entire Engineering team and can have an out-sized impact on breaking things that work well.
  • The hiring process is more demanding, because it engages folks across all of Engineering and across the…

Get Executive Alignment

You must prepare…

Code with Jason 

Reader Q&A: Kaemon’s question about test-first vs. test-after

Recently reader Kaemon L wrote me with the following question:

“As a beginner, is it better to write tests before you code to make it pass? or is it better to code first, write tests for the code to pass, and then add more tests as you come across bugs? In my experience so far learning RSpec, I’ve found it easier to code first and then write tests afterwards. Only because when I would try to write tests first I wasn’t exactly sure what needed to be tested, or how I was planning to write the code.

This is a great question. In addressing this question I find it useful to realize that when you’re learning testing you’re actually embarking on two parallel endeavors:

1. Writing tests…

Code with Jason 

Reader Q&A: Tommy’s question about testing legacy code

Code with Jason subscriber Tommy C. recently wrote in with the following question:

Jason,

So I have found that one of the hurdles to testing beginners face is that the code they are trying to test is not always very testable. This is either because they themselves have written it that way or because they have inherited it. So, this presents a sort of catch 22. You have code with no tests that is hard to test. You can’t refactor the code because there are no tests in place to ensure you have not changed the behavior of the code.

I noticed that you have said that you don’t bother to test controllers or use request specs. I agree that in your situation, since you write really thin…

Code with Jason 

Taming legacy Ruby code using the “Sprout Method” technique (example 2)

Note: this post is titled “example 2” because some time ago I wrote another Sprout Method example, but after I wrote that post I decided I could come up with a better example.

The Sprout Method technique

If a project was developed without testing in mind, the code will often involve a lot of tight coupling (objects that depend closely on other objects) which makes test setup difficult.

The solution to this problem is simple in concept – just change the tightly coupled objects to loosely coupled ones – but the execution of this solution is often not simple or easy.

The challenge with legacy projects is that you often don’t want to touch any of this mysterious code before it has some test…

RubyGuides 

How to Use The Ruby Select Method (With Examples)

You can use the select method in Ruby to filter an array of objects. For example, you can find all the even numbers in a list. Without select that looks like this: even_numbers = [] [1,2,3,4,5,6].each do |n| if n.even? even_numbers 1 } # {:apples=>10, :oranges=>5} Where k represents the key & v represent the […]

The post How to Use The Ruby Select Method (With Examples) appeared first on RubyGuides. Don't miss your free gift here :)

Drifting Ruby Screencasts 

Introduction to Kubernetes

In this episode, we take a tour of what Kubernetes is, how to install and configure a local development instance, and deploying a sample application.
Karol Galanciak - Ruby on Rails and Ember.js consultant 

Messages on Rails Part 2: Kafka

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. Let’s focus this time entirely on the latter.

What Is Kafka?

Kafka is a distributed streaming platform which allows the implementation of a publish-subscribe model between producers and consumers. However, what is unique about Kafka, is the fact that it’s somewhat closer to a storage system than a message queue. Unlike in a typical message queue, the messages are not removed…

iridakos - ruby articles 

Dockerizing a Rails application

Hey!

In this post we are going to:

  • create a docker image for the Rails chat application that we created in the previous post
  • configure the Docker environment and run the application by:
    • creating a container for the PostgreSQL database
    • creating a container for the Redis server
    • creating a container with the required configuration from the image we built

Rails chat application gif

Prerequisites

Install docker

The first thing you need in order to follow this tutorial is to install Docker on your machine.

We are going to use the Docker Community Edition. Follow the installation instructions matching your system.

I’m on Ubuntu 18.04 LTS so following the instructions, I had to:

avdi.codes 

SIGAVDI #48 – Smoking Goat Edition

Hello friends,

This week I've been thinking about the tension between catching errors at compile time and catching them at runtime. On the surface level this one seems like a no-brainer: the early you catch a problem, the better.

But in my [mumblemumble] years of static-language experience, what I observed was that the more you focus on pushing all errors into the the realm of static compile-time verification, the more catastrophic and difficult-to-debug the runtime errors become. And there are always runtime errors. Even after you've eliminated null from your programming language.

The resilience engineering community has a counter-intuitive approach: instead of trying to eliminate errors…

avdi.codes 

Faking Method Inputs with OpenStruct feat. Kerri Miller

During my RubyTapas script review with upcoming guest chef Kerri Miller, we spent some time refactoring a method toward lower complexity. In the process we needed to isolate it from its dependencies, and we used Ruby's OpenStruct library to quickly accomplish it.

This is video is an extract from a much longer meeting recording. The full script review (over an hour of video) is available on my Patreon. If you're interested in the editing process that goes into my technical screencasts, check it out!

RubyMine Blog 

RubyMine 2019.1 Released!

RubyMine 2019.1 is now released!

Update to this new major version to:

  • Speed up your work with Docker in RubyMine
  • Use Recent Locations popup for better code navigation
  • Profile Ruby and Rails applications
  • Get full support for Factory Bot
  • Investigate method calls with Call Hierarchy
  • Enjoy new UI themes

The new version also features TruffleRuby support, improved JavaScript and database tools, and fixes many bugs.

Check out the What’s new page to learn more about all these new features, and download the new version.

See the release notes for the full list of improvements and please report any issues you encounter. We also encourage you to join RubyMine in Slack.

Cheers,
Your RubyMine team

The Bike Shed 

193: A Thing I Know Almost Nothing About

On this week's episode, Chris is joined by Edward Loveall, former thoughtbot design apprentice and now thoughtbot developer. After a quick chat about Edward's thoughtbot origin story, podcasts, and DNS, they dig into the heart of the conversation talking about their respective "must have" developer tools on new machines.

Thank you to CircleCI for sponsoring this episode.

Awesome Ruby Newsletter 

Issue 150 - Moving on from Rails and what's next (@sgrif)

iridakos - ruby articles 

Creating a chat application from scratch using Rails and WebSockets

Hey! It’s been a while since my last post.

I recently familiarized myself with the awesomeness of WebSockets and I finally found the time to write a tutorial about it. I hope you find it helpful.

Update: I also published another post for dockerizing the application of this tutorial, you can find it here.

Introduction

In this tutorial we are going to create a chat web application from scratch using Rails and WebSockets.

Rails chat tutorial gif

Code and comments
You can find the code of this tutorial on GitHub.
For feedback, comments, typos etc. please open an issue in the repository.

What are WebSockets

WebSocket is actually a protocol that enables bidirectional communication between the…

Ruby Weekly 

Bye Ruby 2.3, and a backdoor in a popular gem

#444 — April 4, 2019

Read on the Web

Ruby Weekly

Malicious Remote Code Execution Backdoor Discovered in a Popular Gem — Last week, a malicious version (v3.2.0.3) of the bootstrap-sass package was published with a backdoor that could allow third parties to run arbitrary Ruby code passed via cookie. If you are using bootstrap-sass, check the version you’re using and upgrade if appropriate.

Liran Tal

The Missing Ruby Code Formatter — There’s no “one true formatter” but there are several options, where are evaluated here. Bozhidar clearly has a favorite, which makes a lot of sense.

Bozhidar Batsov

Ruby News 

Support of Ruby 2.3 has ended

We announce that all support of the Ruby 2.3 series has ended.

After the release of Ruby 2.3.7 on March 28, 2018, the support of the Ruby 2.3 series was in the security maintenance phase. Now, after one year has passed, this phase has ended. Therefore, on March 31, 2019, all support of the Ruby 2.3 series ends. Security and bug fixes from more recent Ruby versions will no longer be backported to 2.3. There won’t be any patches of 2.3 either. We highly recommend that you upgrade to Ruby 2.6 or 2.5 as soon as possible.

About currently supported Ruby versions

Ruby 2.6 series

Currently in normal maintenance phase. We will backport bug fixes and release with the fixes whenever…

GoRails Screencasts 

The Rails db:system:change command

Changing the database adapter for a Rails app has always been an annoying, manual change to make. Rails 6.0 introduces the "rails db:system:change" command to make this easier using all the built-in generators for database.yml and more.
Ruby on Rails Podcast 

266: Dodging Ubuntu End of Life & Ruby on Rails DevOps with Justin Snair

Ubuntu 14.04, a common Ruby on Rails hosting environment, reached its end of life on April 30, 2019. Brittany brought on Justin Snair, Director of Cloud Infrastructure for the Pittsburgh Cultural Trust, to discuss his custom script for upgrading their hosting environments and his tips for earning AWS certifications.

Links for this episode:

OmbuLabs Blog 

Processing a CSV file in batch with Sidekiq

Sidekiq Pro comes with a great feature to process a collection of jobs as a batch, allowing them to be monitored as a group and executing a callback function when all the jobs are finished. This is useful when you need to load a lot of spreadsheet files into your database.

Recently, that was the case of one of Ombu Labs' clients. They needed to upload a CSV file with over 10 thousand rows of loans data, which makes processing the file synchronously impossible because the browser will time out after a few seconds. Breaking the file into smaller ones wasn't a good idea either, because it would take an unacceptable amount of time to finish. So we decided to use the Sidekiq's batch logic.

S…

BigBinary Blog 

Database seeding task uses inline Active Job adapter in Rails 6

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

We use the db:seed task to seed the database in Rails apps. Recently an issue was reported on Rails issue tracker where the db:seed task was not finishing.

In development environment, Rails uses async adapter as the default Active Job adapter. The Async adapter runs jobs with an in-process thread pool.

This specific issue was happening because the seed task was trying to attach a file using Active Storage. Active Storage adds a job in the background during the attachment process. This task was not getting executed properly using the async adapter and it was causing the seed task to hang without exiting.

It…

All Ruby Podcasts by Devchat.tv 

MRS 084: Justin Searls

Sponsors

  • Sentry use the code “devchat” for 2 months free on Sentry small plan
  • .TECH– tech/MRS and use the coupon code “MRS.TECH” and get a 1 year .TECH Domain at $9.99 and 5 Year Domain at $49.99. Hurry!
  • CacheFly

Host: Charles Max Wood

Special Guest: Justin Searls

Episode Summary

In this episode of My Ruby Story, Charles hosts Justin Searls, co-founder of Test Double, a software agency which helps developers improve their quality of the software.

Listen to Justin on the podcast JavaScript Jabber on this episode and this episode.

Justin got into programming playing with his Casio Calculator when he was 10 years old. He came up with little games such as guessing the number. Later…

Riding Rails 

New versions of Rails, optimizer hints, ROFL, and more

Hi there! This is Daniel reporting from Brooklyn, NY.

New versions of Rails released

Rails 5.2.3 and Rails 5.1.7 were released last week. Check out the CHANGELOG and upgrade today!

Optimizer Hints and Annotations

These two related PRs were opened within a couple hours of each other. The new optimizer_hints method offers a simple way to include optimizer hints in your queries. The new annotate method offers a simple way to annotate your queries with comments.

The best PR that I saw this year!

This PR elegantly ensures that ActiveSupport::SafeBuffer’s sub, sub!, gsub, and gsub! methods set back references. I learned a lot about Ruby by reading through this code and the review comments.

BigBinary Blog 

Rails 6 adds ActiveRecord::Relation#reselect

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

Rails have rewhere and reorder methods to change the previously set conditions attributes to new attributes which are given as an argument to method.

Before Rails 6, if you want to change the previously set select statement attributes to new attributes, it was done as follows.

>> Post.select(:title, :body).unscope(:select).select(:views)

   SELECT "posts"."views" FROM "posts" LIMIT ? ["LIMIT", 1]]

In Rails 6, ActiveRecord::Relation#reselect method is added.

The reselect method is similar to rewhere and reorder. reselect is a short-hand for unscope(:select).select(fields).

Here is how reselect method…

All Ruby Podcasts by Devchat.tv 

RR 406: How Hard is Ruby on Rails to Learn?

Sponsors

Panel

  • Charles Max Wood

  • Nate Hopkins

  • David Richards

  • Dave Kimura

Summary

Charles Max Wood puts the question to the panel, how hard is it to learn ruby on rails? This leads them on an discussion of the evolution of ruby on rails. The simplicity of rails is a theme through their discussion of learning and teaching rails. The panel talks about the importance of collaboration and using the rails community to learn and to avoid messy architecture. The panel shares tips and resources for learning ruby on rails…

Ruby Magic by AppSignal 

Learning by building, a Background Processing System in Ruby

In today's post, we are going to implement a naive background processing system for fun! We might learn some things along the way as a peek into the internals of popular background processing systems like Sidekiq. The product of this fun is by no means intended for production use.

Let’s imagine we have a task in our application that loads one or more websites and extracts their titles. As we don’t have any influence on the performance of these websites, we’d like to perform the task outside our main thread (or the current request—if we’re building a web application), but in the background.

Encapsulating a Task

Before we get into background processing, let’s build a service object to…

Semaphore 

A Docker Product Manager on What the Future Holds for Containers

Gareth Rushgrove is an experienced software and operations engineer, working as a product manager at Docker. Additionally, he’s the editor of one of the most widely read newsletters in the DevOps community, “DevOps Weekly.”

In this interview, we talk with Rushgrove about his current work at Docker, what is the Cloud Native Application Bundle (CNAB), the importance of  CI/CD pipelines and DevOps trends predictions for 2019 (which are mostly focused on costs).

Your job title is product manager at Docker. That puts you (and your team) directly behind the success of a product that is now the cloud software industry standard. Could you let us know what your regular day at work looks like,…

avdi.codes 

SIGAVDI #47 – Pear Pizza Edition

Hello friends,

It's been a couple of weeks. Since last Tuesday I've been in St. Louis. Jessica and I paired on some Docker & Kubernetes stuff. It was highly educational.

And we went to the symphony.

And the art museum.

But mostly we ate really good food.

Some of it highbrow.

Some of it less so.

That is an authentic St. Louis “slinger“, a $6.50 pile of sloppy late-night goodness.


A mistake I have made over and over again: thinking of life in terms of forks in the road. Big choices on which everything hinges.

The truth is, there are few choices in life that can’t be a “yes, and…” with some creativity. And most choices can be amended.

Just move. Direction is always…

Code with Jason 

What if I want to do test-first but I find it easier to do test-after?

Recently Code with Jason reader Kaemon L. wrote me with the following question:

“As a beginner, is it better to write tests before you code to make it pass? or is it better to code first, write tests for the code to pass, and then add more tests as you come across bugs? In my experience so far learning RSpec, I’ve found it easier to code first and then write tests afterwards.​ Only because when I would try to write tests first I wasn’t exactly sure what needed to be tested, or how I was planning to write the code.​”

This is a great question. In addressing this question I find it useful to realize that when you’re learning testing you’re actually embarking on two parallel endeavors.

RubyMine Blog 

RubyMine Navigation: Recent Locations Popup


RubyMine 2019.1
is filled with features and options to help you navigate around your projects quickly without a mouse or touchpad. For example, you can quickly switch between tool windows, go to classes or actions, and open recently edited files. In our Navigate in RubyMine Like a Pro blog post, we show you how to get around using these features.

With v2019.1, we’ve added one more capability to your arsenal of convenient navigation. It is now possible to return to recently visited or changed code parts using the new Recent Locations popup. This can be extremely useful if you can only remember what the code was about, but you don’t have any idea where you put it. To invoke the Recent…

BigBinary Blog 

Rails 6 adds ActiveModel::Errors#of_kind?

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

Rails 6 added of_kind? on ActiveModel::Errors. It returns true if ActiveModel::Errors object has provided key and message associated with it. The default message is :invalid.

of_kind? is same as ActiveModel::Errors#added? but it doesn’t take extra options as parameter.

Let’s checkout how it works.

Rails 6.0.0.beta2

>> class User < ApplicationRecord
>>   validates :name, presence: true
>> end

>> user = User.new

=> => #<User id: nil, name: nil, password: nil, created_at: nil, updated_at: nil>

>> user.valid?

=> false

>> user.errors

=> #<ActiveModel::Errors:0x00007fc462a1d140 @base=#<User id: nil, name:…
Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Deccan RubyConf @ Pune, Maharashtra, India - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Deccan RubyConf
Aug/3 (1d) Sat @ Pune, Maharashtra, India • (Updates)

See all Conferences 'n' Camps in 2019».

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

RubyConf Colombia @ Medellín, Colombia - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

RubyConf Colombia
Sep/20+21 (2d) Fri+Sat @ Medellín, Colombia • (Updates)

See all Conferences 'n' Camps in 2019».

RubyGuides 

The Ultimate Guide to Rails Rendering

The ultimate goal of your Ruby on Rails application is to render a view. A view is what the user sees. It’s the culmination of all the work your app has to do, combining logic, data & view templates to serve the user’s request. Even returning a JSON response can be considered a view. That’s […]

The post The Ultimate Guide to Rails Rendering appeared first on RubyGuides. Don't miss your free gift here :)

Semaphore 

Introducing Quantum Job Processing with Semaphore Qujobs

We are happy to announce a new way of job processing in Semaphore 2.0!

Combining Quantum computing theorems and best practices of creating CI/CD pipelines we introduce Qujobs – a groundbreaking way of job processing inside our platform. No longer will you have to worry about the tedious binary outcome of the jobs inside the blocks of your CI pipeline.

With Qujobs the traditional laws of physics no longer apply and you will be able to process more complex jobs faster and in a more ambiguous way.

A lot of our customers reached out to us hoping that we would be able to answer the following question: “If a tree falls in the forest and no one is there, does it still make a sound?”
Si…

Ruby News 

Ruby 2.4.6 Released

Ruby 2.4.6 has been released.

This release includes about 20 bug fixes after the previous release, and also includes several security fixes. Please check the topics below for details.

See the commit log for details.

After this release, we will end the normal maintenance phase of Ruby 2.4, and start the security maintenance phase of it. This means that after the release of 2.4.6 we will never backport any bug fixes to 2.4 except security fixes. The term of the security maintenance phase is scheduled for 1 year. By the end of this term, official support of Ruby 2.4 will be over. Therefore, we recommend that you start planning to upgrade to Ruby 2.6…

Sam Saffron 

Why I stuck with Windows for 6 years while developing Discourse

I made this tweet that got reasonably popular:

We benchmarked how long it takes to run the Ruby test suite for Discourse across our various dev machines. I can not believe what a crazy tax I have paid over the years insisting on sticking with Windows, highlighted results mine.

https://twitter.com/samsaffron/status/1111511735851081728

This evoked a lot of extremely strong emotions from various people out there. Ranging from “Sam is a fool what kind of insane benchmark is this”, “the real story is MacOS has bad Ruby perf” to a general “Oh no”.

The core point I was trying to make was that I was paying a pretty high tax for deciding to “stick with with Windows”.…

Notes to self 

Basic HTTP authentication in Elixir/Phoenix

Let’s look on what HTTP Basic authentication is and how to implement and test the HTTP Basic authentication in a Phoenix web application.

Basic is one of the authentication schemes we can use to authenticate access on the web (other is for example a Bearer scheme for OAuth 2.0 tokens). Using the Basic scheme is very simple. If our server responds with 401 Unauthorized response including WWW-Authenticate response header with a Basic challenge as follows:

WWW-Authenticate: Basic realm="Access to the application"

the browser can automatically ask the user for login credentials (login and password). The browser then connects the user and password together (separated by colon) and…

Appfolio Engineering 

Rails Ruby Bench Speed Roundup, 2.0 Through 2.6

Back in 2017, I gave a RubyKaigi talk tracing Ruby’s performance on Rails Ruby Bench up to that point. I’m still pretty proud of that talk!

But I haven’t kept the information up to date, and there was never a simple go-to blog post with the same information. So let’s give the (for now) current roundup - how well do all the various Rubies do at big concurrent Rails performance? How far has performance come in the last few years?

Plus, this now exists where I can link to it 😀

How I Measure

My primary M.O. has been pretty similar for a couple of years. I run Rails Ruby Bench, a big concurrent Rails benchmark based on Discourse, commonly-deployed open-source forum software that uses Rails. I run 10…

Remote Ruby 

Joined by Nobody

Chris and Jason put together an "old school" episode without any guests. The two talk about Chris' PR intro Rails for a rich_text field generator, top secrets plans (all the details) for Southeast Ruby, the Interactor gem, and constraints.
The Bike Shed 

192: I Don't Want to Think That Hard

On this week's episode, Chris is joined by Sid Raval, developer in our New York studio. Chris and Sid chat about functional programming, strong types, and accessibility. Along the way they touch on TypeScript, Haskell, Scala, Elm, and plenty in between. They round out the conversation with a discussion around accessibility and developer tools.

Thank you to CircleCI for…

Awesome Ruby Newsletter 

Issue 149 - Sonic Pi Stranger Things Cover (Programming/Making music in Ruby)

Search Results for “ruby” – Journeys of a young Software Engineer 

Released: benchee 0.99, 1.0 & friends

It’s finally here – benchee 1.0! 🎉🎉🎉 The first benchee release was almost 3 years ago – it started a mission to improve benchmarking tooling in the elixir eco system. And now we’re not at the goal – after all it’s never done and we’re not short of ideas of what to do. What’s in […]
Ruby Weekly 

Why RubyMotion?

#443 — March 28, 2019

Read on the Web

Ruby Weekly

Why RubyMotion? — When a very long standing Ruby developer cheerleads for a particular technology, it’s worth seeing what they have to say! Here Lori Olson looks at RubyMotion, a toolkit for writing cross-platform native apps with Ruby. Its been around for several years but is continuing to move forward as a project at a healthy pace.

Lori Olson

Rails 5.2.3 Released — Until Rails 6 arrives, Rails 5.2 is still the latest version and 5.2.3 is mostly a lot of minor fixes rather than anything new (with the exceptions of HashWithIndifferentAccess#assoc now…

Riding Rails 

Rails 5.1.7 has been released

Hi everyone,

I am happy to announce that Rails 5.1.7 has been released.

CHANGES since 5.1.6

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:

5.1.7 CHANGELOG

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256 hashes.

Here are the checksums…

Riding Rails 

Rails 5.2.3 has been released

Hi everyone,

I am happy to announce that Rails 5.2.3 has been released.

CHANGES since 5.2.2

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:

5.2.3 CHANGELOG

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256…

ruby – Bibliographic Wilderness 

very rough benchmarking of Solr update batching performance characteristics

In figuring out how I want to integrate a synchronized Solr index into my Rails application, I am doing some very rough profiling/benchmarking of batching Solr adds vs not, just to get a general sense of it.

(This is all _very rough estimates_ and may depend a lot on your environment and Solr setup, including how many records you have in Solr, if Solr is being simultaneously used for queries, etc).

One thing some Solr (or ElasticSearch) integration packages sometimes end up concentrating on is batching multiple index-change-needed events into fewer Solr update requests.

Based on my observations, I think it’s not actually the separate HTTP requests that are expensive. (although I’m…

RubyMine Blog 

How to work with Docker/Docker Compose from RubyMine


RubyMine 2019.1
has a bunch of capabilities which allow you to work with Docker and Docker Compose. You can inspect existing images and containers, quickly edit Docker files using autocompletion, create new images and start services directly from the IDE, and run or debug your application using Docker SDK. Let’s take a look at how to do all this.

You can play with RubyMine Docker features using the following application containing Dockerfile and docker-compose.yml:
https://bitbucket.org/rubyminedoc/sample_rails_app_…

Enable Docker support

RubyMine provides Docker support by means of the Ruby Docker and Docker Integration plugin…

BigBinary Blog 

Rails 6 shows routes in expanded format

The output of rails routes is in the table format.

$ rails routes
   Prefix Verb   URI Pattern               Controller#Action
    users GET    /users(.:format)          users#index
          POST   /users(.:format)          users#create
 new_user GET    /users/new(.:format)      users#new
edit_user GET    /users/:id/edit(.:format) users#edit
     user GET    /users/:id(.:format)      users#show
          PATCH  /users/:id(.:format)      users#update
          PUT    /users/:id(.:format)      users#update
          DELETE /users/:id(.:format)      users#destroy

If we have long route names, they don’t fit on the terminal window as the output lines wrap with each other.

Example of overlapping routes

Rails 6 has…

Blog About Web & Mobile App Development, Product Management, And IoT · Monterail 

How we Built a Highly Performant App with Ruby on Rails and Phoenix

So there you are: a backend developer with a few years’ experience in developing Ruby on Rails applications. Lucky for you, Ruby on Rails seems to be versatile enough to solve pretty much any problem you encountered along the way way. How good life is!

All Ruby Podcasts by Devchat.tv 

MRS 083: Stefan Wintermeyer

Sponsors

  • Sentry use the code “devchat” for 2 months free on Sentry small plan
  • .TECH– tech/MRS and use the coupon code “MRS.TECH” and get a 1 year .TECH Domain at $9.99 and 5 Year Domain at $49.99. Hurry!
  • CacheFly

Host: Charles Max Wood

Special Guest: Stefan Wintermeyer

Episode Summary

In this episode of My Ruby Story, Charles hosts Stefan Wintermeyer, a freelancer developer from Germany focused on Ruby on Rails, Phoenix Framework, and web performance.

Listen to Stefan on the podcast Ruby Rogues here.

Stefan got into programming when he was 8 years old. He started with Basic and Pascal and moved onto other languages. Even though he never received a formal programming education,…

Julia Evans 

Why are monoidal categories interesting?

Hello! Someone on Twitter asked a question about tensor categories recently and I remembered “oh, I know something about that!! These are a cool thing!“. Monoidal categories are also called “tensor categories” and I think that term feels a little more concrete: one of the biggest examples of a tensor category is the category of vector spaces with the tensor product as the way you combine vectors / functions. “Monoidal” means “has an associative binary operation with an identity”, and with vector spaces the tensor product is the “associative binary operation” it’s referring to. So I’m going to mostly use “tensor categories” in this post instead.

So here’s a quick stab at explaining why…

Giant Robots Smashing Into Other Giant Robots 

Ruby under the influence [of Scala]

I recently rolled off of a Scala project and onto a Rails project. I noticed that the Rails that I’ve been writing has changed as a result of learning Scala, so I thought it would be interesting to document some of these changes.

Types Systems

The most obvious differences are due to Scala’s static type system. Scala is typed language meaning that all variables have a defined or inferred type, and those types are verified for correctness at compile time. Moving from Scala’s type system back to Ruby’s dynamic types has made me more thoughtful about the types that I am passing around.

In Scala function definitions are often written in the form of:

def add(x: Int, y: Int): Int

X,…

Honeybadger Developer Blog 

Account Security Updates

Have you wanted to throw away your expensive internet bill and use your neighbor's insecure wifi? Was the only thing holding you back the Honeybadger single-factor auth flow? Well, have I got news for you.

Announcing: Two Factor Authentication (2FA)

All kidding aside, we take security very seriously. We are thrilled to be able to provide an important tool to help keep our users and their data more secure.

I figure I could just explain how to enable 2FA, but what's the fun in that? How about we take a light-hearted glimpse into the wild world of cryptography and figure out how 2FA works.

If fun's not your thing, you can totally go straight to How to enable, my feelings won't be hurt.

⚠️…