Skip to content

Instantly share code, notes, and snippets.

View nateberkopec's full-sized avatar

Nate Berkopec nateberkopec

View GitHub Profile
@nateberkopec
nateberkopec / gist:11dbcf0ee7f2c08450ea
Last active March 24, 2023 21:59
RubySpec is dead, long live RubySpec!

Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.

When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me

unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.1.8'
#gem 'rails', '4.2.0.rc2'
gem 'sqlite3'
gem 'pg'
gem 'byebug'
gem 'benchmark-ips'
GEMFILE
class Order < ActiveRecord::Base
has_one :payment
def complete
payment.complete
end
end
class Payment < ActiveRecord::Base
belongs_to :gateway_transaction
def complete
def prepare_bodies(message)
messages = message.scan(/.{1,130}\b/)
return messages if messages.length == 1
messages.each_with_index.map do |s, i|
"(#{i + 1}/#{messages.length}) #{s}"
end
end
Add Sentry to your Gemfile:
gem "sentry-raven", :require => 'raven', :git => "https://github.com/getsentry/raven-ruby.git"
Add a config/initializers/raven.rb containing:
Raven.configure do |config|
config.dsn = 'https://ee561c4bd99f45c6bb2a442b1af04677:[email protected]/31964'
end
food idea list
tortillas
peanut butter
instant coffee
instant oatmeal
foil packet: potatoes, chicken, fish
ramen
canned chicken, turkey
mac and cheese
class Admin::BaseController < ApplicationController
end
$ bundle exec rake guides:generate WARNINGS=1; bundle exec rake guides:validate
.../.rbenv/versions/2.1.0/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
Generating 2_3_release_notes.md as 2_3_release_notes.html
Generating 3_0_release_notes.md as 3_0_release_notes.html
Generating 3_1_release_notes.md as 3_1_release_notes.html
Generating 3_2_release_notes.md as 3_2_release_notes.html
Generating 4_0_release_notes.md as 4_0_release_notes.html
Generating 4_1_release_notes.md as 4_1_release_notes.html
Generating _license.html.erb as _license.html
$ bundle exec rake guides:generate
.../.rbenv/versions/2.1.0/bin/ruby rails_guides.rb
Generating 2_2_release_notes.md as 2_2_release_notes.html
Generating 2_3_release_notes.md as 2_3_release_notes.html
Generating 3_0_release_notes.md as 3_0_release_notes.html
Generating 3_1_release_notes.md as 3_1_release_notes.html
Generating 3_2_release_notes.md as 3_2_release_notes.html
Generating 4_0_release_notes.md as 4_0_release_notes.html
Generating 4_1_release_notes.md as 4_1_release_notes.html
Generating _license.html.erb as _license.html
RUBY_GC_HEAP_FREE_SLOTS: 600000
RUBY_GC_HEAP_GROWTH_FACTOR: 1.25
RUBY_GC_HEAP_GROWTH_MAX_SLOTS: 200000
RUBY_GC_HEAP_INIT_SLOTS: 600000
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR: 1.3
RUBY_GC_MALLOC_LIMIT: 16000000
RUBY_GC_MALLOC_LIMIT_MAX: 32000000
RUBY_GC_OLDMALLOC_LIMIT: 16000000
RUBY_GC_OLDMALLOC_LIMIT_MAX: 32000000