Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Drifting Ruby 

Ruby on Rails 6.0 Beta 1 Deprecations

About this time last year, I covered Ruby on Rails 5.2 Deprecations and got lots of appreciative feedback. With the upcoming next major update of Ruby on Rails, I’d figure that I would do a new article and make it a tradition.

NOTE: Ruby on Rails 6.0 will require Ruby 2.5.0. So if you’re stuck on an older version of Ruby for whatever reason, you may want to consider holding off on updating your application to 6.0.

I will likely update this article as later betas and release candidates come.

ActionMailer

Deprecate ActionMailer::Base.receive in favor of Action Mailbox.

Add MailDeliveryJob for delivering both regular and parameterized mail. Deprecate using DeliveryJob and Param…

Riding Rails 

Rails 6.0.0 beta1: Action Mailbox, Action Text, Multiple DBs, Parallel Testing, Webpacker by default

The first beta release of Rails 6 is here! It’s absolutely packed with amazing new stuff that we’re so excited to share. There are two major new frameworks – Action Mailbox and Action Text – and two important scalable-by-default upgrades in great multiple database support and parallel testing.

Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Amazon SES, Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses. The foundational work on Action Mailbox was done by George Claghorn and yours truly.

Action Text brings rich text content and…

Test Double | Our Blog 

Running Node on Raspberry Pi

Last Christmas I received a gift so diabolical it ruined many weekends and kept me up at night. It was a brand new Raspberry Pi Zero. The possibilities were too endless for my finite brain to handle, so I took the only obvious course of action. I threw it in a drawer and slowly backed away. A couple months later I read an awesome post by fellow double agent Adam Lukens. That post gave me the kick in the pants I needed to roll up my sleeves, dust off the Pi and get to work. For an extra challenge I decided to build my project on top of node. I call it Tot Tunes.

I built a working prototype in just an hour or two and felt like a super hero for a few minutes. Then I discovered a bug. I fixed…

Remote Ruby 

Personal Life, Turbolinks Android 1.x Deprecation, & Autoloading

Hanami 

Announcing Hanami v1.3.1

Hello wonderful community!

Today we're happy to announce v1.3.1 🙌.

Enhancements 🆙

  • Support for Ruby 2.6
  • Support for bundler 2+

Bug Fixes 🐞

  • Make optional nested assets feature to maintain backward compatibility with 1.2.x
  • Remove from app generator support for deprecated force_ssl setting
  • Remove from app generator support for deprecated body_parsers setting
  • Fix Hash serialization for Hanami::Utils::Logger
  • Make app generator to work when code in config/enviroment.rb uses double quotes
  • Add missing pathname require in lib/hanami/utils.rb

Released Gems 💎

  • hanami-1.3.1
  • hanami-model-1.3.1
  • hanami-a…
Appfolio Engineering 

A Short Speed History of Rails "Hello, World"

I’ve enjoyed working on Rails Ruby Bench, and I’m sure I’ll continue doing so for years yet. At the very least, Ruby 3x3 isn’t done and RRB has more to say before it’s finished. But…

RRB is very “real world.” It’s complicated. It’s hard to set up and run. It takes a very long time to produce results — I often run larger tests all day, even for simple things like how fast Ruby 2.6 is versus 2.5. Setting up larger tests across many Ruby versions is a huge amount of work. Now and then it’s nice to sit back and do something different.

I’m working on a simpler benchmark, something to give quicker results and be easier for other people to run. But that’s not something to just write and call done -…

Search Results for “ruby” – via @codeship 

Use CloudBees CodeShip Pro for CI and Traefik for ASP.NET Applications

Reading Time: 7 minutes

Editor’s Note: This post is a follow-on blog post to Setting up Traefik as a Reverse Proxy for ASP.NET Applications.

In this article, we will see how we can Traefik as a reverse proxy for ASP.NET core applications. We will be using Docker containers as our deployment mechanism and use CloudBees Codeship Pro for setting up continuous integration (CI). Let’s get started!


Tips for using CodeShip Pro and Traefik” via @codeship @echorand
Click To Tweet


Software setup

We will be using Dot Net Core 2.2 for our project and you can obtain the SDK from here. We will be using Linux as our deployment operating system and assume that it has the Docker engine installed, has access…

The Bike Shed 

184: Fun, Interesting, and I Wouldn't Recommend It

On this week's episode, Chris is joined by Eebs Kobeissi, a developer in our Boston studio, for a discussion encompassing the front end, back end, and everything in between. They start by discussing Eebs' recent work with both Elm & TypeScript, and the relative merits of these two strongly typed languages for the front end. From there they move on to a discussion around the different communities and rates of change in each.

Shifting gears, Chris then asks Eebs about his experience with more distributed systems and technologies like JSON Web Tokens, ElasitcSearch, RabbitMQ, Kafka, and more.

They round out the conversation with a discussion around some recent security discussions…

Awesome Ruby Newsletter 

Issue 139 - Extracting Text From Images Using Ruby

Glauco Custódio 

Unleash Object-Oriented Programming When Consuming APIs

Suppose we are building a Single Page Application and have the following classes (or models in a Angular app):

// user.ts
import { Profile } from './profile';

export class User {
  id: number;
  first_name: string;
  last_name: string;
  profile: Profile;

  fullName() {
    return `${this.first_name} ${this.last_name}`
  }
}
// profile.ts
export class Profile {
  id: number;
  score: number;

  goodScore() {
    return this.score > 100
  }
}

Now, you gotta consume the user api, which returns the following json:

response = `{
  "id": 1,
  "first_name": "Elon",
  "last_name": "Musk",
  "profile": {
    "id": 10,
    "score": 200
  }
}`

As soon as you parse your response json, you will…

Code with Jason 

The Difference Between Integration Tests and Controller Tests in Rails

I recently came across a Reddit post asking about the difference between integration tests and controller tests. Some of the comments were interesting:

“I always write controller tests. I only write integration tests if there’s some JavaScript interacting with the controller or if the page is really fucking valuable.”

“In this case I would say it depends if you are building a full rails app (front-end and back-end) or only and API (back-end). For the first I would say an integration test should go through the front-end (which eventually calls the controllers). If you are doing an API, integration and controller tests would be the same.”

“Controller tests attempt to test the controller in…

Ruby Weekly 

Three ActiveRecord mistakes that slow down Rails apps

#433 — January 17, 2019

Read on the Web

Ruby Weekly

3 ActiveRecord Mistakes That Slow Down Rails Apps — The culprits are count, where, and present?, and here’s advice that you will, no doubt, use from someone who literally wrote a book on Rails performance.

Nate Berkopec

Using Ruby in 2019 — If you need a few reasons to be excited about being a Rubyist this year (or fight off the yearly “Ruby is Dead” posts) then this is for you.

Jason Charnes

eBook: Best Practices for Optimizing Postgres Query Performance — Learn how to get a 3x performance improvement on your Postgres database and 500x…

pganal…

GoRails Screencasts 

Server Administration with Cockpit

Linux server administration can be a pain. You can use cockpit to monitor your servers and keep an eye on long running processes like Sidekiq and Puma without having to SSH into your servers.
RubyMine Blog 

RubyMine 2018.3.3 is Available

RubyMine 2018.3.3 (build 183.5153.41) has just been released.

What’s new in this build:

  • Darcula 2018.2 is back in the list of color schemes [RUBY-23348]
  • Fixed installing gems on Ruby 2.6 / RubyGems 3.0+ [RUBY-23318]
  • Other bug-fixes

See What’s new in RubyMine 2018.3 for the major improvements made in v2018.3.

Download RubyMine 2018.3.3

As usual, see the release notes for the full list of improvements. Please report any issues to our bug tracker.

Cheers,
Your RubyMine Team

BigBinary Blog 

Rails 6 adds ActiveRecord::Relation#pick

Before Rails 6, selecting only the first value for a column from a set of records was cumbersome. Let’s say we want only the first name from all the posts with category “Rails 6”.

>> Post.where(category: "Rails 6").limit(1).pluck(:name).first
   SELECT "posts"."name"
   FROM "posts"
   WHERE "posts"."category" = ?
   LIMIT ?  [["category", "Rails 6"], ["LIMIT", 1]]
=> "Rails 6 introduces awesome shiny features!"

In Rails 6, the new ActiveRecord::Relation#pick method has been added which provides a shortcut to select the first value.

>> Post.where(category: "Rails 6").pick(:name)
   SELECT "posts"."name"
   FROM "posts"
   WHERE "posts"."category" = ?
   LIMIT ?  [["category", "Rails 6"],

This method internally applies limit(1) on the relation…

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

Working With Legacy Code — How Refactoring Let Us Escape The Black Hole

Steering in the RIGHT direction

I’m pretty much sure that sooner or later every developer finds themselves working on a project that makes them face the issue of legacy code. For those lucky dogs who still haven’t experienced it firsthand—legacy code is code with a past. It’s code that someone else wrote and you inherit it for further work. But unlike your family inheritance, legacy code is not exactly something to look forward to. Why?

Greater Than Code 

113: Privilege as Legacy Code with Amr

In this episode, Amr talks about the fact that it’s not just code: people need to own their privilege and use it for good by calling out others, being good allies, and avoiding biases.   If you like Greater Than Code, you should check out The Transatlantic Cable Podcast from Kaspersky Lab. They condense the most interesting InfoSec and Cybersecurity news in 20 minutes or less! Check it out and subscribe wherever you get your podcasts. Panelists: John K. Sawers | Christina Morillo | Coraline Ada Ehmke Special Guest: Amr: @amrAbdelwahab Amr is an African Egyptian native who crossed continents to work with his passion in digital environments. Amr's interests span technology,…
Code with Jason 

In Which I Dissect and Improve a Rails Test File I Found on Reddit

I recently found a Reddit post which shared the code of a test and basically asked, “Am I doing this right?”

I’m going to dissect this test and make suggestions for improvement. Here’s the original code as shared in the post.

The original code

require 'test_helper'
class UserTest < ActiveSupport::TestCase

  let(:user) { FactoryBot.build :user}

  it "must be valid" do
    value(user).must_be :valid?
  end

  it "can be saved" do
    assert_difference "User.count", 1 do
      user.save
    end
    assert user.persisted?
  end

  describe "won't be valid" do
    it "with an duplicated email" do
      user.save
      user2 = FactoryBot.build :user
      user2.wont_be :valid?
     …
All Ruby Podcasts by Devchat.tv 

RR 395: Ruby in the Forbidden Land with Nathan Ruehs

Sponsors

avdi.codes 

SIGAVDI #39: Bird and Book Edition

Hello friends,

It's been a couple weeks. I just got back from visiting Jessica Kerr in St. Louis. We saw the St. Louis City Museum, which I can only describe as like crawling around inside Neil Gaiman's mind.

We also recorded some live coding videos in which we, as two aging mostly-backend developers attempt to create a new web application using modern JavaScript technologies. While drinking beer. They were a lot of fun to make. Let me know if you'd like to see more video in this vein.

One thing those pairing sessions reinforced: we really, really like Glitch. It's a phenomenal leveling technology. It removes a number of barriers to learning to code web apps. You don't have to…

Mike Perham 

Using Faktory with JavaScript

Faktory is my new polyglot background job system, allowing any programming language to use background jobs. I've documented how to use Faktory with Ruby and Go as I'm an expert in both languages. Today I wanted to step outside my comfort zone and try Faktory with a language I barely know: JavaScript. Let's see how easy it is for me, a noob, to get JavaScript jobs running with Faktory!

We need three pieces for any background job system:

  1. The client pushes jobs to the server.
  2. The server (i.e. Faktory) manages the queues and jobs.
  3. The worker pulls jobs from the server and executes them.

Server Setup

Most importantly, you'll need the faktory server installed:

brew tap…
Ruby Tuesday 

Issue #15

  • It has already been some time, but I cannot not mention it. Ruby 2.6 has been released on Christmas. And one very serious bug with Net::Protocol has already been found.
  • Speaking of bugs, do you know how to crash Ruby 2.5 virtual machine in very few lines of code? Paweł Pacana certainly knows. It’s as simple as those six lines of code:
def doh
  raise
ensure
  123 if false
end
doh
  • Back to the good things. I have two concurrency-related posts for you:
    • First one is about Task monad, coming from excellent dry-monads gem. I never knew such solution existed there. A very interested read.
    • Second presents more traditional, yet frequently overlooked, approach: Fibers Are…
  • Law of Demeter, one on the foundations of SOLID principles, is a very misunderstood one. Many people…
Ilija Eftimov 

Understanding the basics of Elixir’s concurrency model

If you come from an object-oriented background, you might have tried concurrency in your favourite OO language before. Your mileage will vary, but in general OO languages are harder to work with when it comes to concurrency. This is due to their nature - they are designed to keep state in memory and require more expertise and experience to be successful with.

How does Elixir stand up to other languages when it comes to concurrency? Well, for starters just being functional and immutable is a big win - no state to manage. But also, Elixir has more goodies packing under the hood and in its standard library.

Being based on Erlang’s virtual machine (a.k.a. the BEAM), Elixir uses processes to…

EquiValent 

How to upload remote file from url with ActiveStorage Rails

class Medium < ActiveRecord::Base
  has_one_attached :image
end

Attach remote file

with ‘require open-uri’

require 'open-uri'
file = open('https://eq8.eu/some-image.jpg')

medium = Medium.last
medium.image.attach(io: file, filename: 'some-image.jpg')

# or
medium.image.attach(io: file, filename: 'some-image.jpg', content_type: 'image/jpg')

Or without require

require 'uri'

file = URI.open('https://eq8.eu/some-image.jpg')

medium = Medium.last
medium.image.attach(io: file, filename: 'some-image.jpg')

# or
medium.image.attach(io: file, filename: 'some-image.jpg', content_type: 'image/jpg')

Attach local file

medium = Medium.last
medium.image.attach(io:…
Drivy Engineering 

Lambda composition in ruby 2.6

What are we talking about?

We recently updated a sizeable application to ruby 2.5, which opened up some nice features for us, such as the yield_self feature.

But I also wanted to have a quick look at 2.6 for comparison purposes, and I found a small feature that can easily be overlooked: the new proc composition operators: << and >>.

You can find the original request (from 2012!) here.

This is a way to compose a new proc by “appending” several other procs together.

Note: all the code that is present in this article can also be found in this gist

A simple example

# This lambda takes one argument and returns the same prefixed by "hello"
greet = ->(val) { "hello #{val}" }
# This lambda…
RubyGuides 

How to Control a Web Browser From Ruby With Watir

Did you know that you can control a web browser with Ruby? The Watir gem allows you to do this. And it comes with the full power of modern browsers: You can take a screenshot of the visible area of the page You can run javascript on any page, without having to manually open the […]

The post How to Control a Web Browser From Ruby With Watir appeared first on RubyGuides. Don't miss your free gift here :)

Depfu 

Now with more changelog contents

In our pull requests, we try to cram in as much useful information about the dependency update as possible. One obviously important bit is “What did actually change?” Up until now, we’ve presented that in the following order:

  • Link to the changelog
  • Release information from GitHub releases
  • Commit titles

The most useful part here has always been the release text - As it’s the actual “changelog entry” right within the pull request. The link to the changelog was always a bit of a letdown - We know where you’ll find the information, but you’ll have to go to it yourself and read through the whole thing on your own.

From now on, we’re displaying information directly from the changelog…

BigBinary Blog 

Target Tracking Policy for Auto Scaling

In July 2017, AWS introduced Target Tracking Policy for Auto Scaling in EC2. It helps to autoscale based on the metrics like Average CPU Utilization, Load balancer request per target, and so on. Simply stated it scales up and down the resources to keep the metric at a fixed value. For example, if the configured metric is Average CPU Utilization and the value is 60%, the Target Tracking Policy will launch more instances if the Average CPU Utilization goes beyond 60%. It will automatically scale down when the usage decreases. Target Tracking Policy works using a set of CloudWatch alarms which are automatically set when the policy is configured.

It can be configured in EC2 -> Auto Scaling…

The way is long but you can make it easy on me 

Questions for a prospective employer about on call (2/3)

Hi Folks,

This is part two in my series about talking to prospective employers about on call. In the first part we covered a bunch of general questions. In this part, we'll dig down in to specific questions about incidents and how they function. An incident is something that happens that causes you to get paged when you're on call, and so asking questions around this is pretty important.

Specific questions related to incidents

How many people are on the smallest team that is on call, how frequently do they paged for out of hours incidents? Are you doing anything to help alleviate their pain?

By definition the smallest on-call team has their engineers rotate most frequently. If you get an…

Andy Croll 

Use Multiple Migrations When Adding Database Constraints

Adding constraints to your application at the database level is a good idea as it provides an extra layer of quality control on top of the data powering your application.

One way to do that is to add default values or constraints—like making sure a field can’t be blank. This is easy to do with Rails’ migrations. But beware…

Instead of…

…adding a column and stipulating a default non-null value all in one go:

class AddComposerToSongs < ActiveRecord::Migration[5.2]
  def change
    add_column :songs, :composer, :string, default: "Lin-Manuel Miranda", null: false
  end
end

Use…

…a ‘multiple migration’ strategy to add a field with a constraint to your databases.

Add a column

class AddCo…
Ruby on Rails Podcast 

256: Empowering Founders with Emily Wazlak from Shine Registry

Emily is the CEO of Shine Registry, a startup built on Rails that’s working on reshaping tradition to increase gender equity in entrepreneurship. Brittany has been consulting on the project so she invited Emily on to discuss prototyping an application quickly in RoR, being a non-technical founder and how our listeners can get involved with Shine Registry.

Links for this episode:

Brought to you by:

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

Ruby by the Bay (Ruby for Good, West Coast Edition) @ Marin Headlands (near San Francisco), California, United States - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

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

Ruby by the Bay (Ruby for Good, West Coast Edition)
Mar/29-Apr/1 (4d) Fri-Mon @ Marin Headlands (near San Francisco), California, United States • (Updates)

See all Conferences 'n' Camps in 2019».

Igor writing about things 

Partial application in Ruby

Ruby is a multi-paradigm language with a strong bias towards object-oriented programming. You can argue that its design is influenced by Alan Kay and Smalltalk, as opposed to C++/Java-style object-oriented languages. Thankfully, this object-oriented design doesn’t mean we can’t use ideas from functional programming. There’s a small list of functional traits in Ruby:

  • Expression-oriented syntax
  • Geeky names for Enumerable methods: filter, map, reduce, flat_map
  • Idiomatic monads
  • Railway oriented programming
  • lambdas and procs
  • … I can go on and on

There’s also one specific empowering feature: built-in support for partial application. In this article, I want to talk about…

Remote Ruby 

Joined by Luca Guidi

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

wroclove.rb @ Wrocław, Poland - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

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

wroclove.rb
Mar/22-24 (3d) Fri-Sun @ Wrocław, Poland • (Updates)

See all Conferences 'n' Camps in 2019».

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

Balkan Ruby @ Sofia, Bulgaria - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

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

Balkan Ruby
May/17+18 (2d) Fri+Sat @ Sofia, Bulgaria • (Updates)

See all Conferences 'n' Camps in 2019».

Drivy Engineering 

Why we've chosen Snowflake ❄️ as our Data Warehouse

In the first of this series of blog posts about Data-Warehousing, I’ve been talking about how we use and manage our Amazon Redshift cluster at Drivy.

One of the most significant issues we had at this time was: how to isolate the compute from the storage to ensure maximum concurrency on read in order to do more and more data analysis and on-board more people in the team.

I briefly introduced Amazon Spectrum and promised to talk about how we were going to use it in a second blog post… But, that turned out not to be the case, because we ultimately decided to choose another data-warehousing technology (Snowflake Computing) which addresses the issue mentioned above, among other things, that…

Wh…

RubyGuides 

What is Inheritance in Ruby?

Inheritance is a fundamental OOP feature that allows you to create a more specific & specialized version of a class. Here’s an example: Food -> Fruit -> Orange There’s a relationship between these classes… We can say that an orange is a fruit, but fruits are also food. The parent class (also called superclass or […]

The post What is Inheritance in Ruby? appeared first on RubyGuides. Don't miss your free gift here :)

The Bike Shed 

183: Former Robots Smashing Into Other Giant Robots (Ben Orenstein)

On this episode of the Bike Shed, Chris is joined by former thoughtbotter Ben Orenstein. Ben & team are currently feverishly working towards launching Tuple.app, an app for remote pair programming. The conversation covers the unique technical challenges inherent to building this sort of app (WebRTC & firewalls, oh my), as well as a discussion around the merits and value of pair programming. To round out the conversation, Ben checks in on whether Chris is still "nerding out hard on Vim".

Thank you to One Month for sponsoring this episode.

Awesome Ruby Newsletter 

Issue 138 - TensorStream: Bringing Machine Learning to Ruby

OmbuLabs Blog 

Tools We Use at Ombu Labs

At Ombu Labs, we have a number of tools that help us to keep organized, write better code and communicate more effectively with our clients.

Daily Work

  • We use Slack to chat with Ombu Labs team members while working. We also like to use it to chat with clients and their teams, we prefer this over email.
  • We use Trello to manage the status of our sales pipeline and client projects.
  • We use Freckle to track our time. -We use Pecas as an add-on to Freckle.

Code

  • We use Atom, Sublime Text, Vim and a number of other editors to write code. Since there are so many good options, we encourage team members to use whichever editor they are most comfortable using.
  • We use GitHub to backup and…

So…

Speedshop - Ruby on Rails performance consulting 

3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present


“When does ActiveRecord execute queries? No one knows!”

ActiveRecord is great. Really, it is. But it’s an abstraction, intended to insulate you from the actual SQL queries being run on your database. And, if you don’t understand how ActiveRecord works, you may be causing SQL queries to run that you didn’t intend to.

Unfortunately, the performance costs of many features of ActiveRecord means we can’t afford to ignore unnecessary usage or treat our ORM as just an implementation detail. We need to understand exactly what queries are being run on our performance-sensitive endpoints. Freedom isn’t free, and neither is ActiveRecord.

One particular case of ActiveRecord misuse that I find is…

Ruby Weekly 

Ruby 2.6.0p0 has a sneaky HTTP related bug

#432 — January 10, 2019

Read on the Web

Ruby Weekly

Exploring a Critical Net::Protocol Issue in Ruby 2.6.0p0 — It seems Ruby 2.6.0p0 introduced a serious bug if you do any HTTP communication from Ruby (using libraries like Net::HTTP, say) where certain payloads are getting corrupted. Luckily, a fix is in but we await a new official release so you may want to put off your production upgrades just for now.

Maciej Mensfeld

You Can Use Bundler Without a Gemfile — Did you know that it’s possible to use Bundler within a single Ruby script and without an external Gemfile? For some reason this had never occurred…

Running with Ruby 

Exploring a critical Net::Protocol issue in Ruby 2.6.0p0 and how it can lead to a security problem

TL;DR

If you do any HTTP communication (HTTP requests, Elasticsearch, etc) do not upgrade to 2.6.0p0 or apply the patch below as soon as possible.

Ruby is eating up characters when pushed over HTTP

Ruby 2.6.0 has been released not long ago. Not many are unfortunately aware of a major bug that was introduced with these release.

This bug can affect you in many ways, some of which you may not even be aware. All may run well up until you decide to send a particular type of payload and then, things will get interesting.

What am I talking about?

This. What does it even mean? Well in the best scenario it means, that you will end up having a critical error like so:


Net::HTTP.post(URI('http://htt…
Mike Perham 

Using Faktory with Python

Faktory is my new polyglot background job system, allowing any programming language to use background jobs. I've documented how to use Faktory with Ruby and Go as I'm an expert in both languages. Today I wanted to step outside my comfort zone and try Faktory with a language I don't know: Python. Let's see how easy it is for me, a noob, to get Python jobs running with Faktory!

We need three pieces for any background job system:

  1. The client pushes jobs to the server.
  2. The server (i.e. Faktory) manages the queues and jobs.
  3. The worker pulls jobs from the server and executes them.

Server Setup

Most importantly, you'll need the faktory server installed:

brew tap contribsys/faktory
brew…
Greater Than Code 

112: Dancing About Vulnerability with Marcel Byrd

In this episode, Marcel Byrd talks about the intersection of public health and art, authenticity and vulnerability, reading a room and determining safety, and the beauty of dance. Panelists: Avdi Grimm | Astrid Countee | Coraline Ada Ehmke | Jessica Kerr Special Guest: Marcel Byrd: LinkedIn Marcel Byrd is a public health and arts advocate originally from Atlanta, Georgia, but currently residing in D.C. Through his work, Marcel is curious to further articulate and foster the relationship between public health, systems-level social change, and dance. Show Notes: 00:53 – Marcel’s Superpower: An Explosive Relationship with Laughter 01:45 – The Intersection of Public Health and Art 06:36…
rossta.net 

Vue.js is omakase

I'm borrowing from David Heinemeier Hansson here. Six years ago, he wrote Rails is omakase to capture his notion of what makes a delicious software framework: it is heavily curated and borne of experience. I think of Vue.js the same way.

Here's an excerpt from DHH's post:

There are lots of à la carte software environments in this world... I want this for my ORM, I want that for my template language, and let's finish it off with this routing library... It's a very popular way of consuming software. Rails is not that. Rails is omakase. A team of chefs picked out the ingredients, designed the APIs, and arranged the order of consumption on your behalf according to their idea of what would…

Search Results for “ruby” – via @codeship 

How to Run CodeShip Parallel Test Pipelines Efficiently for Optimal CI Parallelization

Reading Time: 3 minutes

Editor’s Note: This guest blog post was reprinted with permission from the author.

When you use CloudBees CodeShip as your continuous integration (CI) server you can significantly increase the speed of your CI builds with parallel test pipelines. Pipelines allow you to run multiple commands at the same time, for instance, you can split the test suite across a few pipelines and complete the CI build much faster.


Run your CloudBees CodeShip CI builds faster with parallel test pipelines by @arturtrzop via…
Click To Tweet


How to run parallel commands on CodeShip

Setup via CodeShip interface

One way is to define commands via the CodeShip interface. Once parallel test…

Ruby Magic by AppSignal 

Bindings and Lexical Scope in Ruby

Happy new year, and welcome back to Ruby Magic! In this winter episode, we'll dive into bindings and scopes. So put on your skis and follow us deep into the woods.

Last time, we looked at closures in Ruby by comparing blocks, procs and lambdas. Aside from the differences between the three types, we touched on what defines a closure.

A closure is a first-class function with an environment. The environment is a mapping to the variables that existed when the closure was created. The closure retains its access to these variables, even if they’re defined in another scope.

We've explored Ruby's equivalent to first-class functions, but we conveniently skipped over environments. In this episode,…

Code with Jason 

My Vim Setup for Rails

Vim is my favorite editor because using Vim I can edit circles around anyone using Atom, Visual Studio, Sublime Text or any other non-keyboard-based editor. If “computers are a bicycle for the mind”, then using Vim is like shifting that bicycle into high gear. I like to shift that gear even higher using a few certain plugins:

vim-rspec lets me run my tests with a keystroke.

vim-rails takes advantage of the common structure of all Rails applications to let me navigate any Rails application super quickly.

ctrlp.vim allows me to quickly search for and open files (not earth-shattering or unique but of course very useful).

The post My Vim Setup for Rails appeared first on Code with Jason.

Ruby on Rails – frontdeveloper.pl 

Common mistakes that cause Ruby on Rails apps outages

Everybody makes mistakes. Some of them are caught early in a deployment pipeline: during writing code, testing it locally or code review process. Unfortunately, some hide cleverly and pop up on the production environment. The above is true also for Ruby on Rails applications. In this article, I would like to share mistakes which I

The post Common mistakes that cause Ruby on Rails apps outages appeared first on frontdeveloper.pl.

Passenger - Phusion Blog 

Passenger 6.0.1: fixes runaway CPU issue

Passenger 6.0.1: fixes runaway CPU issue

Version 6.0.1 of the Passenger application server has been released. Most notably, this release fixes a startup issue when supporting generic apps.

Passenger 6, introduces Generic Language Support, or: the ability to support all and every arbitrary app.

Runaway CPU issue fixed

A GitHub issue submitted by @anamba, a long-time Passenger user excited to be able to use Passenger 6 for his Crystal applications. Experiencing a runaway CPU issue on Ubuntu 18.04 (Bionic), and with neither the Crystal app nor Passenger's error output being any help (even at log-level=7), anamba put together a demo with a Docker config. After a little back and forth we were able to reproduce the issue where ephemeral…

The way is long but you can make it easy on me 

Questions for a prospective employer about on call (1/3)

Hi Folks,

This is the first in a series of three blog posts. These contain questions that I asked prospective employers when I was interviewing recently and why I asked them. On-call is one of the biggest determiners in whether or not a job is particularly painful. It also seems to me to be becoming a more "normalized" practice. These questions are designed to give you a feel for how seriously engineers, and, importantly, engineering leadership take their on-call responsibilities.

The reason you want to determine how engineering leaders think about on-call is that they're ultimately responsible for how well or badly on-call will go. Things like how much engineering pain they're aware of,…

Martian Chronicles, Evil Martians’ team blog 

My Ruby 2018: Around the world in nine conferences

Author: Vladimir Dementyev, Back-end Developer at Evil Martians

Here is my travel diary as I roamed the world of Ruby conferences in 2018: in Poland, Belarus, US, France, Bulgaria, Russia, and Japan. In the past year, I gave nine talks, and listened to countless others, while also doing an ultimate Ruby hat-trick: speaking at RailsConf, RubyKaigi, and RubyConf. Here is what I learned at each event, and how they all differ from each other.

Usually, I don’t do “how I spent my summer” texts (unless we remember good old LiveJournal days a decade ago), and I haven’t written a single non-technical blog post since I’ve taken up programming and tech writing. So, why am I doing this now?

Recen…

RubyGuides 

How Do You Use Environment Variables in Ruby?

An environment variable is a key/value pair, it looks like this: KEY=VALUE We use these variables to share configuration between programs. Examples: Setting your default editor Telling Ruby where to find gems Passing API keys into your application, without having to commit them to source control (git) Defining where your operating system should look for […]

The post How Do You Use Environment Variables in Ruby? appeared first on RubyGuides. Don't miss your free gift here :)

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

Active Admin Tips and Performance Optimizations for Rails Apps

Active Admin gem is a popular tool for building admin interfaces in Ruby on Rails apps. In this blog post, I will describe a couple of less obvious tips and performance optimization techniques.

Active Admin should probably never be used for client-facing parts of the interface because it’s a bit clunky. But it can hardly be matched for an internal admin user interface development speed and simplicity.

For a great intro about how to start using Active Admin with modern Rails check out this article and the official docs.

Here comes the first tip:

Add query persistence to filters

Filters are one of my favorite features of Active Admin. They let you mix various search conditions with a…

Drifting Ruby Screencasts 

Using Action Text in a Rails 5.2 Application

With Rails 6.0 is around the corner, Action Text has been merged into the Rails repository. However, it can still be used on a Rails 5.2 application while we wait for its official release.
https://victorafanasev.info/ 

Did you know that you can use Bundler without Gemfile?

Did you know that you can use Bundler inside single Ruby script (without Gemfile) and automatically install required dependencies for it?

# example.rb

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'rest-client'
  gem 'nokogiri'
end

###

body = RestClient.get("https://www.reddit.com/r/ruby/").body

puts "Posts from r/ruby front page:"
Nokogiri::HTML(body).xpath("//div[contains(@class, 'scrollerItem')]//h2").each do |h2|
  puts h2.text.strip
end

Run ruby example.rb (without bundle exec), and enjoy!

This is a nice feature that I wasn’t aware of. Best to use for small scripts and quick sketches.

Bonus: use Sublime Text snippet to paste bundler inline

Drifting Ruby 

Audio Upgrades

I’ve been using the same audio equipment for a few years now and initially they were exactly what I needed at the time. I posted my set up on how I screencast a few years ago https://blog.driftingruby.com/how-i-screencast/ which gives a pretty thorough insight of the “behind the scenes”.

The mixer that I used, the Peavey PV6 USB, had a built-in analog to digital converter which recently started to give out. During a recording at 11PM, I realized that the audio was corrupted. When I’m recording, reliability is an absolute must. I decided to upgrade and remove the mixer from the equation. In order to do so, I needed to get a few different components. I needed a way to equalize the audio,…

Remote Ruby 

Joined by Jason Swett

Appfolio Engineering 

How Fast is the Released Ruby 2.6.0?

If you’ve been following me recently, there won’t be a lot of big shocks here.

I generally run Rails Ruby Bench, a big concurrent Rails benchmark based on Discourse, a high-quality piece of open-source forum software that uses Rails. I run 10 processes and 60 threads on an Amazon EC2 m4.2xlarge dedicated instance, then seen how fast I can run a lot of pseudorandom generated HTTP requests through it. This will all be familiar to you if you’ve read much here in the last couple of years.

Later this year there will be some new benchmark that doesn’t work that way. But for right now, let’s check out Ruby 2.6 with good old RRB and see how it stacks up.

On Christmas, Ruby 2.6.0 was released,…

The Bike Shed 

182: What's it in the Service Of?

Chris is joined by Eric Bailey, thoughtbot designer and champion for all things accessibility on the web. Chris & Eric chat about how Eric approaches accessibility and works to include it throughout the design process, design systems, functional CSS, CSS in JS, and more.

Bundler Blog 

An update on the Bundler 2 release

Yesterday I released Bundler 2.0 that introduced a number of breaking changes. One of the those changes was setting Bundler to require RubyGems v3.0.0. After making the release, it has become clear that lots of our users are running into issues with Bundler 2 requiring a really new version of RubyGems.

We have been listening closely to feedback from users and have decided to relax the RubyGems requirement to v2.5.0 at minimum. We have released a new Bundler version, v2.0.1, that adjusts this requirement.

I apologise to our users for the disruption this has caused.

Important Note

Bundler 2 introduced a new feature that will automatically switch between Bundler v1 and v2 based on the…

Awesome Ruby Newsletter 

Issue 137 - Using Ruby in 2019

Ruby on Rails Podcast 

255: Submit Your Railsconf CFP with Marty Haught

On December 28th, the CFP opened for Railsconf 2019. This year’s conference will be from April 30 to May 2 in Minneapolis, Minnesota. Marty Haught, one of the Directors of Ruby Central, came on to answer your burning Railsconf questions.

Links for this episode:

Ruby Weekly 

Ruby 2.6 and Bundler 2.0 Released

#431 — January 3, 2019

Read on the Web

Ruby Weekly

Ruby 2.6 Released — As is traditional, the latest major release of Ruby came out on Christmas Day. The much awaited 2.6 includes an initial implementation of a JIT compiler (which needs to be enabled manually), the then alias for yield_self, RubyVM::AbstractSyntaxTree, endless ranges, and a lot more (see next item).

Yui Naruse

The Changes in Ruby 2.6 — A comprehensive ‘changelog’ of what’s new in Ruby 2.6 (complete with examples for most items) if you want to really dig deep into the new release.

Zverok

Redis Data Types in 2019 — An overview of…

RubyGuides 

What is A Matrix & How to Use It in Ruby?

A matrix is a 2D (2-dimensional) array that can be used to store & work with spreadsheet-like data. They can be used for: Representing a board in a table game (chess, checkers, etc.) Statistics & data analysis Generating plots & graphs Because this is a powerful data structure it’s helpful to learn how to use […]

The post What is A Matrix & How to Use It in Ruby? appeared first on RubyGuides. Don't miss your free gift here :)

Bundler Blog 

Announcing Bundler 2.0

The Bundler team is excited to announce the release of Bundler 2.0 🎉!

This release focuses on removing offical support of versions of Ruby and RubyGems that have reached their end of life, with a few other small breaking changes.

The following is the full list of changes to Bundler 2:

  • Removed support for Ruby < 2.3
  • Removed support for RubyGems < 3.0.0
  • Changed the github: 'some/repo' gem source to use the https schema by default
  • Errors/warnings will now print to STDERR
  • Bundler now auto-switches between version 1 and 2 based on the Lockfile

Update

We’ve posted an update on the release of Bundler 2

What is version autoswitching?

Version autoswitching means that Bundler will…

Drifting Ruby 

Default Ruby on Rails Options

A lot of times, we will create a new Ruby on Rails application and go through the process of our normal configuration setup. Sometimes, we will create a template to expedite our setup like in a recent screencast episode. https://www.driftingruby.com/episodes/templating-ruby-on-rails-applications

Other times, we will need to create a new Ruby on Rails application and we have a list of things that we want to skip. It can be annoying to remember or script out these things. When we create a new application, we can skip something like Turbolinks.

rails new testapp --skip-turbolinks

If this is a common occurrence, then this isn’t something we want to have to remember every time.…

Kir Shatrov 

The State of Background Jobs in 2019

In 2018, my work at Shopify was hugely focused around the Job Patterns team. The team owns all kinds of asynchronous units of work, things like background jobs and database migrations. The tech we’ve built helped to power 10% of e-commerce last Black Friday. The job-iteration gem is one example of what we’ve released.

After a year of consulting so many developers about how to design background jobs that scale, while being on-call for all infrastructure related to jobs processing, it seems clear to me that currently common architecture of Redis + set of queues + application-level library like Sidekiq or Resque to process serialized payloads is not going to scale well, especially for…

Andy Croll 

Year in Review 2018

Reflection time again. Seems I travelled a lot.

January—February

Spent most of this part of the year sick as a dog. Had a flu that just wouldn’t shift. Sadly this same soft of long-running sickness also marred December this year.

Didn’t stop me heading to Ruby on Ice in Germany in late January. I should’ve pulled out really, but it would’ve been really late notice. I did not partake in as much of the conference as I normally like to, but I managed my energy enough to give a decent version of the talk.

Deployed a major change to the infrastructure of CoverageBook. An entire new data-collection platform we call “The Vault”, we migrated the main application away from it’s haphazard…

Code with Jason 

Unlike Real Debt, Technical Debt is Unavoidable

I’ve always been a big fan of the “technical debt” analogy. The parallels to real debt are amusingly spot-on. For example, technical debt, like financial debt, incurs interest. If an organization accumulates too much technical debt, the organization ends up in a situation where productivity is impossible—technical bankruptcy.

I’ve recently noticed some ways in which the technical debt analogy isn’t perfect, though. I also have another analogy that I think is more fitting in certain ways.

You can’t just “not use the credit card”

In real life it’s possible not to go into debt. Just don’t use a credit card, get a mortgage, buy a car on a loan, etc.

In software it’s not possible to live…

Code with Jason 

The Five Benefits of Automated Testing

Why do I bother writing tests? I can think of exactly five reasons why writing tests is helpful. There are more sub-reasons under these reasons, but I think any other benefit of testing can be traced back to one of these five.

Testing helps prevent bugs

I personally find that the process of writing tests gets me into a mindset of trying to think of all the paths through a piece of code, including all the ways the feature I’m writing could be abused. This means that a feature I’ve written tests for is less likely to be buggy than a feature I haven’t written tests for.

Testing helps prevent regressions

It never ceases to amaze me (and humble me and embarrass me) how frequently I’ll write a…

OmbuLabs Blog 

Notes from The Complete Guide to Rails Performance’s Workshop

If you are interested in Ruby and Rails performance, you have definitely read articles by Nate Berkopec from Speedshop. At Ombu Labs we are big fans of his work, his Complete Guide to Rails Performance book and Slack community.

When Nate announced a series of public workshops I didn't hesitate and signed up as quickly as possible. Here are my notes from my experience at the workshop on October 17th.

Pareto: The 80/20 Rule

The workshop mentioned a lot of the concepts outlined in his book. The 80/20 rule is a good guiding principle for doing performance optimization.

80% of the work performed in an application will come from 20% of the code. This is a good rule to prioritize performance…

rossta.net 

Seven reasons choose Vue.js in 2019

I love building applications in Vue.js and here's why I think the future is looking bright for the framework and its community.

1. No build step required

A critical aspect of the Vue philosophy is it be easy to get started. Unlike some other popular frameworks, it's not necessary to use a complex build tool like Webpack to build an application with it. Just include a script tag pointing to the latest release for development or production, and you have access to the Vue runtime.

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.js"></script>

Having a low barrier to entry makes Vue a worthy consideration as a first JS…

Sam Saffron 

Logster and our error logging strategy at Discourse

I have always been somewhat fascinated with logs. I tend to see the warning and error logs in production as a valuable heartbeat of an application. Proper handling of error logs is a very strong complement to a robust test suite. It shows us what really happens when real world data meets our application.

9 years ago, at Stack Overflow we had a daily ritual where we would open up our fork of ELMAH every morning and fish through our logs for problems. This had a dramatic positive effect on Stack Overflow.

Almost 7 years into our journey building Discourse, every single week we find and fix issues in our application thanks to our error logs and Logster. Error logs are the pulse of our…

avdi.codes 

SIGAVDI #38: New Years edition

Hello, friends.

You know, the only problem with writing these is that it immediately shifts me toward a pensive mood. Like, OK, correspondence mode, time to reflect on existential ennui. Of course, that could just be the fact that I'm in an airport after having dropped off my kids in Pennsylvania.

On the other hand (writing this 20 minutes later), it's the 1st of the year and I just got upgraded to first class, so maybe this is gonna be a good year.


This week I said some things on Twitter about the question “why”. I don't think this question is the panacea some people think it is.

A while back I realized that every time I ask one of my kids “why did that seem like a good idea?!” I'm not…

Greater Than Code 

111: Thermodynamics of Emotion with Thomas Perry

In this episode, Thomas Perry talks about thermodynamics of emotion. Observing animal and human behavior is also discussed, as well as organizational restructuring, Flow and how it moves through systems, and alignment in appetite and emotion. Panelists: John K. Sawers | Janelle Klein | Rein Henrichs | Jessica Kerr Special Guest: Thomas Perry: @tlperry | LinkedIn | agiletools.wordpress.com Tom has been working as a transformation agent in software development for over 20 years. He has worked on teams at startup companies, large corporations in the Fortune 100 and the State and Federal Government. His background includes testing, development, project/program management, agile…
bogdanvlviv / Bogdan 

My 2018

RubyGems Blog 

3.0.2 Released

RubyGems 3.0.2 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:

  • Use Bundler-1.17.3. Pull request #2556 by SHIBATA Hiroshi.
  • Fix document flag description. Pull request #2555 by Luis Sagastume.

Bug fixes:

  • Fix tests when ruby –program-suffix is used without rubygems –format-executable. Pull request #2549 by Jeremy Evans.
  • Fix Gem::Requirement equality comparison when ~> operator is used. Pull request #2554 by Grey Baker.
  • Unset…

SHA256 Checksums:

  • rubygems-3.0.2.tgz
    7bacd882b258a4efbfdc1e56f34f85ce0ac2e8…
rossta.net 

Refactoring to nested abstract components

To add a preview pane to the Vue.js PDF viewer, I wanted it to have very similar behavior to the document pane. In this post, I'll demonstrate how I extracted this behavior with a set of components, as opposed to alternatives, like a mixin.

The project

This post is part of ongoing series, Building a PDF Viewer with Vue.js. The source code for this project is on Github at rossta/vue-pdfjs-demo. The source code for the behavior described in this post can be found in the tutorial/part-4-shared-behavior-components branch on Github.

Here's the latest project demo.

Catching up from last…

So far…

Toxic Elephant 

Opinions about Ruby gem development, 2018 edition

  • Your next release should nearly always come from the master branch.
  • When updating your feature branch, prefer git rebase master over git merge master.
  • When merging your feature into master, prefer merge bubbles over squash merges and fast-forwards.
  • bundle exec rake should run your tests.
  • You still should not check in Gemfile.lock.
  • Use RuboCop. Running just rubocop should do the right thing. If you need a specific version, add it to the Gemfile. In that case, bundle exec rubocop should do the right thing.
Ilija Eftimov 

A deeper dive in Elixir’s Plug

Being new to Elixir and Phoenix, I spend quite some time in the projects’ documentation. One thing that stood out for me recently is the first sentence of Phoenix’s Plug documentation:

Plug lives at the heart of Phoenix’s HTTP layer and Phoenix puts Plug front and center.

So naturally, I felt compelled to take a deeper dive into Plug and understand it better. I hope the following article will help you out in understanding Plug.

What’s Plug?

As the readme puts it, Plug is:

  1. A specification for composable modules between web applications
  2. Connection adapters for different web servers in the Erlang VM

But, what does this mean? Well, it basically states that Plug 1) defines the way

Rebased Blog 

101: Actual refactoring - real life story

This blog note is next in our cycle aimed at less-experienced developers. This time we will start with real-life code, that I’ve found in one of our projects. Through a series of steps, we will refactor it to excellent object structure, separated from other parts of the application. Introduction Our...
Julia Evans 

Some nonparametric statistics math

MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});

I’m trying to understand nonparametric statistics a little more formally. This post may not be that intelligible because I’m still pretty confused about nonparametric statistics, there is a lot of math, and I make no attempt to explain any of the math notation. I’m working towards being able to explain this stuff in a much more accessible way but first I would like to understand some of the math!

There’s some MathJax in this post so the math may or may not render in an RSS reader.

Some questions I’m interested in:

  • what is nonparametric statistics exactly?
  • what guarantees can we make? are there formulas we…
Remote Ruby 

Joined by Noah Gibbs

RubyGuides 

How to Create Ruby Objects That Describe Themselves

When you print a string or array you see its contents. Example: puts [1,2,3] 1 2 3 But when you print your own objects… You see this: #<Cat:0x29458e0> Why? Because you haven’t told Ruby how to display this class in a way that makes sense. You can change this if you define a method like […]

The post How to Create Ruby Objects That Describe Themselves appeared first on RubyGuides. Don't miss your free gift here :)

Julia Evans 

2018: Year in review

I wrote these in 2015 and 2016 and 2017 and it’s always interesting to look back at them, so here’s a summary of what went on in my side projects in 2018.

ruby profiler!

At the beginning of this year I wrote rbspy (docs: https://rbspy.github.io/). It inspired a Python version called py-spy and a PHP profiler called phpspy, both of which are excellent. I think py-spy in particular is probably better than rbspy which makes me really happy.

Writing a program that does something innovative (top for your Ruby program’s functions!) and inspiring other people to make amazing new tools is something I’m really proud of.

started a side business!

A very surprising thing that happened in 2018 is…

GoRails Screencasts 

How to use the Ruby 2.6 Just-in-Time (JIT) Compiler

Learn how to enable the experimental new Just-in-time compiler for Ruby 2.6
rossta.net 

Why RSpec users should care about Rails 5.1 and system tests

I get the feeling a lot of RSpec users don’t know about the advantages of Rails 5.1 changes as part of the introduction of system tests. RSpec has had feature tests for a long time? What’s the big deal?

Background

For context, RSpec has supported high level testing through feature tests for many years. Like Cucumber, feature tests are designed to exercise application functionality through the user interface. There are many merits to feature tests as a way to document core business logic and catch regressions. There are drawbacks as well, including the fact that they can be very expensive, i.e., slow, to maintain and execute. I'm…

Awesome Ruby Newsletter 

Issue 136 - 2018: A year of blogging about Ruby

Ruby on Rails Podcast 

254: Ruby Support for AWS Lambda with Alex Wood

Now it’s possible to write Lambda functions as idiomatic Ruby code, and run them on AWS. Joining Brittany is Alex Wood, the software engineer working on the AWS SDK for Ruby and author of the AWS Lambda Ruby runtime.

Links for this episode:

Bandwidth sponsored by:

Code with Jason 

Testing Private Methods

A question that has befuddled many developers, including myself for a long time, is: how do I test private methods? Should I test private methods?

My opinion is no. I don’t test private methods. At least not directly. I test the behavior of a class’s private methods indirectly through the class’s public methods.

The reasoning has to do with the reason why private methods exist. In my mind the value of private methods is that since a private method is hidden from the outside world I can feel free to refactor the private methods at any time and in any way, knowing that I’m not going to mess up any of the code that uses my class.

Here’s a concrete example of a class makes what I think is…

The way is long but you can make it easy on me 

How I organise my VIM hotkeys

Intermediate to advanced VIM users love to extract common workflows to hotkeys. You might want to optimise workflows like running tests, adding files to git/doing a commit, or reformatting text. The thing is, as you add more and more workflows, organising these hotkeys can become a nightmare. For the past several years, I've had a philosophy to organising mine that has really helped me.

The leader key

For me it all starts with the leader key, \ by default, but some people use ,. In a VIM setup that isn't at all customised, no hotkeys follow the leader key, and this makes it an excellent place to hang functionality from. In my .vimrc there's a whole section filled with lines that look like…

map…
RubyMine Blog 

RubyMine 2018.3.2 is Available

Hi there,

RubyMine 2018.3.2 (build 183.4886.48) has just been released. This new update brings support for Ruby 2.6 and its newly added endless ranges:

The new version also fixes a number of code insight and other issues.

See What’s new in RubyMine 2018.3 for the major improvements made in v2018.3.

Download RubyMine 2018.3.2

As always, see the release notes for the full list of improvements. Please report any issues you encounter.

Cheers,
Your RubyMine Team

The way is long but you can make it easy on me 

Rack middlewares that have saved me literally hours of my life

In Ruby, Rack is our webserver baseline. It is an incredibly simple interface. A rack app is any object which has a public #call method that takes a single argument, typically called env, which represents the environment of a HTTP request (params, headers, etc) and returns a three item array containing:

  1. An integer containing a response code
  2. The response headers
  3. An object responding to #each that emits strings to build the response body

which represents the response to the request.

The cool thing about this interface, is that it's very easy to insert an intermediate object between the request and the app generating the response, "wrapping" it, to modify the behaviour of request processing. These…

The way is long but you can make it easy on me 

Tensorflow journal, part 1

Hi Folks. This is a little post where I'm leaving a bunch of single line notes of things I've found useful in tensorflow, for image based tasks. I mostly have no idea what I'm doing, but I've found some things while working on it that work well for me. Maybe you'll find this useful!

  1. The RMSPropOptimizer seems to be very good for a wide range of tasks. 0.001 seems to be a good default learning rate
  2. Deeper networks need more training rounds to converge. Anecdotally, doubling the number of training rounds per layer (1000, 2000, 4000, etc) seems to be good
  3. The inception module is a very good tool for image discrimination tasks (e.g. recognition, the discriminator in a GAN, the encoder layer in a…
All Ruby Podcasts by Devchat.tv 

RR 394: Cables, Concurrency, and Ruby 3x3 with Vladimir Dem

Panel:

  • Eric Berry
  • Dave Kimura
  • Nate Hopkins
  • Charles Max Wood

Special Guest: Vladimir Dem

In this episode of Ruby Rogues, the panel talks with Vladimir Dem who is a Ruby developer and currently lives in Brooklyn, New York. Today, the panelists and guest talk about cables, concurrency, and Ruby. Check it out!

Show Topics:

0:00 – Advertisement: Sentry.io

1:02 – Chuck: Hello! The panel today is Eric, Dave, Nate, and myself! Our guest is Vlad!

1:30 – Guest: My name is Vladimir, but people call me Vlad. I have been writing Ruby since 2013 for about 4.5 years. Before that I was a PHP, JavaScript developer among other languages. I am mostly Erlang and Ruby now.

2:29 – Panel asks Vlad…

Ruby News 

Ruby 2.6.0 Released

We are pleased to announce the release of Ruby 2.6.0.

It introduces a number of new features and performance improvements, most notably:

  • A new JIT compiler.
  • The RubyVM::AbstractSyntaxTree module.

JIT [Experimental]

Ruby 2.6 introduces an initial implementation of a JIT (Just-In-Time) compiler.

The JIT compiler aims to improve the performance of Ruby programs. Unlike traditional JIT compilers which operate in-process, Ruby’s JIT compiler writes out C code to disk and spawns a common C compiler to generate native code. For more details about it, see the MJIT organization by Vladimir Makarov.

In order to enable the JIT compiler, specify --jit on the command line or in the $RUBYOPT

Ruby Inside - Medium 

The Top Ruby Weekly links of 2018

We’re closing out the year by looking back at some of the biggest developments from across the Ruby landscape.

Here’s what Ruby devs clicked on in 2018, based on data from the Ruby Weekly newsletter. You can also see our email roundup of 2018 right here.

Introducing Action Text for Rails 6

DHH | Shared in October’s Issue 419

The most popular link in 2018 was about Action Text, a new framework coming to Rails 6 to make it easier to edit and display rich text content. It leans upon Basecamp’s Trix editor and DHH recorded a screencast showing how it works.

weblog.rubyonrails.org

A Future for Serverless Ruby?

Justin Halsall| Shared in Issue 417

Ruby has been a long overlooked language when it comes to…

Ilija Eftimov 

Validate your passwords using Elixir and haveibeenpwned.com’s API

Unless you’ve been living under a rock for the last couple of years, you probably know what two-factor authentication (2FA) is. It’s quite a neat trick actually - you have a password that you have to (obviously) enter correctly (first factor), but you also have to receive a second (random) code through a different medium, sometimes on a different device, that you have to enter to log in (second factor).

Now, obviously this adds quite a bit of overhead to logging in, but it adds a disproportionate value when it comes to security. If you work in any sort of organisation it was probably no surprise when you were asked to turn on 2FA for all your accounts. If you haven’t been asked to (or…

avdi.codes 

SIGAVDI #37: Reheated gas station coffee edition

Hello friends,

Hey look I'm still doing this on a weekly basis!

I am still liking this week-planning approach to SIGAVDI. One thing I constantly struggle for is perspective. Sitting down on a rainy Sunday and writing to you is an exercise in perspective.

It reminds me a little of one of the reasons I like Instagram, and particularly the ephemeral Stories feature (if you follow me on IG but you don't watch Stories you're probably missing most of what I post). Often I see people say something along the lines of “stop documenting your life and just LIVE it”. And sure. Yes. This is a thing I can get behind. In fact it's the sort of thing I'd probably say.

But. As often as not, thinking “I'd…

RubyGems Blog 

3.0.1 Released

RubyGems 3.0.1 includes 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.

Bug fixes:

  • Ensure globbed files paths are expanded. Pull request #2536 by Tony Ta.
  • Dup the Dir.home string before passing it on. Pull request #2545 by Charles Oliver Nutter.
  • Added permissions to installed files for non-owners. Pull request #2546 by SHIBATA Hiroshi.
  • Restore release task without hoe. Pull request #2547 by SHIBATA Hiroshi.

SHA256 Checksums:

  • rubygems-3.0.1.tgz
    c0666847b5c5f6a15e0fdaabfaac6ba35f7f75…
Sinatra 

Sinatra 2.0.5

We would like to inform you that we have released Sinatra v2.0.5.

Before we begin, I want to thank everyone who contributed, and continued to use and support the project.

Releases

This release includes the release of the following gems:

  • sinatra: v2.0.5
  • sinatra-contrib: v2.0.5
  • rack-protection: v2.0.5

Erubi Support

We officially began supporting Erubi. Please report something when combining Sinatra and Erubi if there is something wrong.

Thanks for the suggestion, @tkmru!

Changes

Find out what’s new in v2.0.5 in CHANGELOG

Thank you

Thank you everyone who has contributed over the years to this project, and continues to ensure it lives on. In addition, want to give a special…

The Thoughtnotes | Ruby 

Transparent compression of RabbitMQ messages with Sneakers

When you’re sending a lot of messages into RabbitMQ message broker and have started to experience RabbitMQ slowdowns, maybe it’s time to think about message compression. Good news: if you’re using Sneakers, you can do it without any ado!

The main idea is to reduce the amount of data RabbitMQ operates by compressing and decompressing messages on the client’s side.

The great thing about Sneakers is that it allows us to define our own content type and implement serializer and deserializer causing the work to be as easy as a pie.

In the code snippet below we define a custom content type application/json+gzip and two lambdas, one to convert data string into its compressed representation and…

rossta.net 

Everything is Enumerated

In Ruby, some methods expect a block as a callback yielding elements of some internal data structure.

Imagine a method paginated_results on some client object that yields individual pages.

client.paginated_results(params) { |page| puts page.contents }

The method may hide away some complexity in retrieving pages.

def paginated_results(params = {})
  before  = nil
  max     = 1000
  limit   = 50
  results = []

  loop do
    page = fetch_page(params.merge(before: before, limit: limit)) # imaginary request

    results += page

    yield page

    break if results.length >= max

    before = page.last["id"]
  end
end

To callers of this method, there is an implicit data structure. Being…

Ruby – AWS Developer Blog 

Announcing Ruby build support for AWS SAM CLI

At AWS re:Invent 2018, we announced Ruby support in AWS Lambda. The Ruby runtime in Lambda has built-in logic to make packaging your dependencies simple.

AWS SAM CLI is a CLI tool currently in beta for local development and testing of serverless applications. It encapsulates several build, test, and deployment patterns for Lambda functions. Today, we’ve launched support for Ruby builds in the SAM CLI tool.

How to build AWS Lambda functions with dependencies in Ruby

In most cases, vendoring your dependencies for deployment to Lambda is simple. Using Ruby 2.5, you can run bundle install to create a Gemfile.lock file if you don’t have one, then vendor and zip your dependencies.

bundle…
Drifting Ruby 

Setting up Ruby on Rails Development Environment on Mojave 10.14.2

Forward

Previously, I posted My Ruby on Rails Development Environment on how I set up my development environment. This article is still mostly correct as far as my checklist goes, but some of the steps have changed with time. I’ve copied most of the content from that article to this one with the updated steps as well as updated some of the text.

Sometimes we have to configure a new development machine, whether it is for ourselves or a friend. We often find that there are some little pieces of our environment that we have forgotten about or have neglected to document. This is my documentation for a ready-to-work development environment for Ruby on Rails.

About Me

I have been…

Awesome Ruby Newsletter 

Issue 135 - Ruby 2.6 JIT - Progress and Future – k0kubun

Riding Rails 

Timeline for the release of Rails 6.0

We’ve made enough progress towards the vision for Rails 6.0 that it makes sense to share our aspirational timeline for release. “Aspirational” being the key word, more so than “release” 😄. Software rarely ships on time, and we’ve had plenty of aspirational release dates that came and went in the past. But if optimism isn’t part of the fun of open source, then where would we be?

So. This is the timeline as we currently hope to see it:

  • January 15: Beta 1. We’ll merge the two new frameworks, Action Mailbox and Action Text, for this release.
  • February 1: Beta 2. We’ll make sure any other major improvements are included by then.
  • March 1: Release Candidate 1. We go feature complete by…
  • April 1: Release…

It always looks so…