Skip to content

Instantly share code, notes, and snippets.

View methodmissing's full-sized avatar

Lourens Naudé methodmissing

View GitHub Profile
213-138-231-67:matzruby lourens$ sudo ./instrument/gc.d -c "./ruby instrument/gc.rb"
ELAPSED TIME DISTRIBUTION,
calloc
value ------------- Distribution ------------- count
2048 | 0
4096 |@@@@@@@@ 182
8192 | 1
16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 678
32768 | 0
module Rake
class Task
def remove_prerequisite(task_name)
name = task_name.to_s
@prerequisites.delete(name)
end
end
end
desc "Raises an error if there are pending migrations"
task :abort_if_pending_migrations => :environment do
if defined? ActiveRecord
pending_migrations = ActiveRecord::Migrator.new(:up, 'db/migrate').pending_migrations
if pending_migrations.any?
puts "You have #{pending_migrations.size} pending migrations:"
pending_migrations.each do |pending_migration|
puts ' %4d %s' % [pending_migration.version, pending_migration.name]
end
def initialize(direction, migrations_path, target_version = nil)
raise StandardError.new("This database does not yet support migrations") unless Base.connection.supports_migrations?
Base.connection.initialize_schema_migrations_table
@direction, @migrations_path, @target_version = direction, migrations_path, target_version
end
module Rails
# The Plugin class should be an object which provides the following methods:
#
# * +name+ - Used during initialisation to order the plugin (based on name and
# the contents of <tt>config.plugins</tt>).
# * +valid?+ - Returns true if this plugin can be loaded.
# * +load_paths+ - Each path within the returned array will be added to the <tt>$LOAD_PATH</tt>.
# * +load+ - Finally 'load' the plugin.
#
# These methods are expected by the Rails::Plugin::Locator and Rails::Plugin::Loader classes.
static void free_mysqlres(struct mysql_res* resp)
{
if (resp->freed == Qfalse) {
mysql_free_result(resp->res);
store_result_count--;
}
xfree(resp);
}
static VALUE mysqlres2obj(MYSQL_RES* res)
{
VALUE obj;
struct mysql_res* resp;
obj = Data_Make_Struct(cMysqlRes, struct mysql_res, 0, free_mysqlres, resp);
rb_iv_set(obj, "colname", Qnil);
rb_iv_set(obj, "tblcolname", Qnil);
resp->res = res;
resp->freed = Qfalse;
rb_obj_call_init(obj, 0, NULL);
213-138-232-223:matzruby lourens$ sudo ./instrument/compile_and_lex.d -c "./ruby instrument/compile_and_lex.rb"
ELAPSED TIME DISTRIBUTION,
lex
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
# sudo ./instrument/clear_cache.d -c "./ruby instrument/clear_cache.rb"
module A
def to_s
super + "A"
end
end
# sudo ./instrument/clear_cache.d -c "./ruby instrument/clear_cache.rb"
module A
def to_s
super + "A"
end
end