Skip to content

Instantly share code, notes, and snippets.

View tbuehlmann's full-sized avatar

Tobias Bühlmann tbuehlmann

View GitHub Profile
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activerecord", "7.1.3.4"
gem "sqlite3"
gem "benchmark-ips"
end
source "https://rubygems.org"
ruby "3.2.0"
gem "debug"
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(false) do
source 'https://rubygems.org'
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(false) do
source 'https://rubygems.org'
@tbuehlmann
tbuehlmann / comment.rb
Last active February 13, 2021 15:18
Flaky!
class Comment < ActiveRecord::Base
belongs_to :post, counter_cache: true
end
# config/deploy.rb
# …
# Puma tasks are in lib/capistrano/tasks/puma.rake
after 'deploy:finished', 'puma:restart'
# Sidekiq tasks are in lib/capistrano/tasks/sidekiq.rake
after 'deploy:starting', 'sidekiq:quiet'
after 'deploy:updated', 'sidekiq:stop'
#!/usr/bin/env ruby
puts ARGV[0]
def some_method
some_variable = 42
yield some_variable
end
some_method do |that_variable|
puts that_variable
end
$ bundle exec ruby spec.rb 1 ↵
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 1.17.3
Using diff-lcs 1.3
Using rspec-support 3.8.0
Using rspec-core 3.8.0
Using rspec-expectations 3.8.2
Using rspec-mocks 3.8.0
# app/controllers/owner/reservations_controller.rb
class Owner::ReservationsController < ApplicationController
def create
# …
end
end