Skip to content

Instantly share code, notes, and snippets.


Christophe Philemotte toch

Block or report user

Report or block toch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
toch / ensure_teardown.rb
Created Jul 12, 2016
Test how we can release resources or processes when an exception is raised during test
View ensure_teardown.rb
require "minitest/autorun"
def raise_an_exception
raise "Raised!"
module Minitest
module Ensure
def ensure_to_call_after(name)
old_test_method = instance_method("test_#{name}")
toch / pg_jsonb.rb
Created May 26, 2016
A Hanami Coercer for PG JSONB Datatype
View pg_jsonb.rb
require "hanami/model/coercer"
require "sequel"
require "sequel/extensions/pg_json"
class PGJsonB < Hanami::Model::Coercer
def self.dump(hash_map)
def self.load(jsonb)
toch /
Created Apr 26, 2016
a Bash script to generate docset for Zeal from a group of gems
# rubygem is required
# yard is required: gem install yard
# doc_to_dash is required: gem install doc_to_dash
TMP_DIR=$(mktemp -d)
toch / Rakefile
Created Jan 19, 2016
mruby minimum Rakefile
View Rakefile
# avoid redefining constants in mruby Rakefile
mruby_root=File.expand_path(ENV["MRUBY_ROOT"] || "#{APP_ROOT}/mruby")
mruby_config=File.expand_path(ENV["MRUBY_CONFIG"] || "build_config.rb")
ENV['MRUBY_ROOT'] = mruby_root
ENV['MRUBY_CONFIG'] = mruby_config
Rake::Task[:mruby].invoke unless Dir.exist?(mruby_root)
load "#{mruby_root}/Rakefile"
toch / define_method_vs_module_eval.rb
Last active Dec 12, 2015
Example of usage of benchmark-lab on JuanitoFatas/fast-ruby
View define_method_vs_module_eval.rb
require 'benchmark/lab'
def method_names(number) do
10.times.inject("") { |e| e << ('a'..'z').to_a.sample}
class DefineMethod
def self.def_methods(_methods)
toch /
Last active Nov 25, 2015
A message to mruby contributors

Hi all,

It's the second year that me and Tyler are organizing the Ruby devroom at fosdem 2016. It focuses on Ruby internals and implementations. It's more about how Ruby is implemented than how it can be used. Last year we had great devs for MRI, Jruby, Rubinius, or Rubymotion. It would be wonderful to have a talk about mruby.

The CFP is open and ends on the 1st December.

Thanks for sharing it with other mruby contributors.

You can’t perform that action at this time.