Skip to content

Instantly share code, notes, and snippets.

View rafaelfranca's full-sized avatar
🚆
Focused on Rails

Rafael Mendonça França rafaelfranca

🚆
Focused on Rails
View GitHub Profile
@rafaelfranca
rafaelfranca / deprecation.rb
Last active March 12, 2024 14:33
Examples of `ActiveSupport::Deprecation`
require 'active_support'
class Foo
def foo
"foo"
end
def bar
ActiveSupport::Deprecation.warn("bar is deprecated")
@rafaelfranca
rafaelfranca / 28718.rb
Last active July 4, 2022 20:11 — forked from alexcameron89/28718.rb
A Reproduction Script for Rails issue #28718
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(true) do
source "https://rubygems.org"
gem "rails", "5.0.2"
"Running Initializer: set_load_path"
"Running Initializer: set_load_path"
"Running Initializer: set_load_path"
"Running Initializer: set_load_path"
"Running Initializer: set_load_path"
"Running Initializer: set_autoload_paths"
"Running Initializer: set_autoload_paths"
"Running Initializer: set_autoload_paths"
"Running Initializer: set_autoload_paths"
"Running Initializer: set_autoload_paths"
@rafaelfranca
rafaelfranca / talks.md
Created February 19, 2016 19:26
Shopifolk talks
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
class CurrencyInput < SimpleForm::Inputs::Base

  def input
    input_html_classes.unshift("string currency")
    input_html_options[:type] ||= input_type if html5?

    template.content_tag(:span, "$", class: "add-on") +
    @builder.text_field(attribute_name, input_html_options)
 end
@font-face {
font-family: "Carnevalee-Freakshow";
// File at `app/assets/fonts/Carnevalee-Freakshow.ttf
src: font-url('Carnevalee-Freakshow.ttf') format('truetype');
}
[2.2.2 rails (4-2-stable)]$ bench=1 version=4-2 ruby scope.rb
Calculating -------------------------------------
scope 717.000 i/100ms
-------------------------------------------------
scope 7.539k (± 6.6%) i/s - 38.001k
[2.2.2 rails (4-2-stable)]$ g co 4-1-stable
Switched to branch '4-1-stable'
Your branch is up-to-date with 'origin/4-1-stable'.
[2.2.2 rails (4-1-stable)]$ bench=1 version=4-2 ruby scope.rb
Calculating -------------------------------------
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 2c6eda0..012a562 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -268,6 +268,18 @@ class TestBignum < Test::Unit::TestCase
assert_equal(2**180, (2**80) * o)
end
+ def test_positive_p
+ assert_predicate(T_ONE, :positive?)
source 'https://rubygems.org'
gem 'rails', '4.1.9'