Skip to content

Instantly share code, notes, and snippets.

@banister
Created June 26, 2012 14:06
Show Gist options
  • Select an option

  • Save banister/2995973 to your computer and use it in GitHub Desktop.

Select an option

Save banister/2995973 to your computer and use it in GitHub Desktop.
[7] (pry) main: 0> require 'sqlite3'
=> true
[8] (pry) main: 0> cd SQLite3
[9] (pry) main / SQLite3: 1> ls -M
[10] (pry) main / SQLite3: 1> ls -m
SQLite3.methods: const_missing libversion
[11] (pry) main / SQLite3: 1> ls -c
constants: AbortException AuthorizationException Backup Blob BusyException CantOpenException Constants ConstraintException CorruptException Database EmptyException Exception FormatException FullException InternalException InterruptException IOException LockedException MemoryException MismatchException MisuseException NotADatabaseException NotFoundException PermissionException Pragmas ProtocolException RangeException ReadOnlyException ResultSet SchemaChangedException SQLException SQLITE_VERSION SQLITE_VERSION_NUMBER Statement TooBigException Translator UnsupportedException Value VERSION VersionProxy
[12] (pry) main / SQLite3: 1> ls -M Backup
SQLite3::Backup#methods: finish pagecount remaining step
[13] (pry) main / SQLite3: 1> $ Backup#finish
Scanning and caching *.c files...
From: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/ext/sqlite3/backup.c (C Method):
Number of lines: 10
Owner: SQLite3::Backup
Visibility: public
static VALUE finish(VALUE self)
{
sqlite3BackupRubyPtr ctx;
Data_Get_Struct(self, sqlite3BackupRuby, ctx);
REQUIRE_OPEN_BACKUP(ctx);
(void)sqlite3_backup_finish(ctx->p);
ctx->p = NULL;
return Qnil;
}
[14] (pry) main / SQLite3: 1> cd ../Binding
[15] (pry) main / Binding: 1> ls -M
BindingOfCaller#methods: callers frame_count frame_description frame_type of_caller
Binding#methods: clone dup eval
[16] (pry) main / Binding: 1> $ frame_type
Scanning and caching *.c files...
From: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/binding_of_caller-0.6.7/ext/binding_of_caller/binding_of_caller.c (C Method):
Number of lines: 5
Owner: BindingOfCaller
Visibility: public
static VALUE
frame_type(VALUE self)
{
return rb_iv_get(self, "@frame_type");
}
[17] (pry) main / Binding: 1> require 'rdiscount'
=> true
[18] (pry) main / Binding: 1> cd /RDiscount
[19] (pry) main / RDiscount: 1> ls -m
Object.methods: yaml_tag
[20] (pry) main / RDiscount: 1> ls -M
RDiscount#methods: autolink autolink= filter_html filter_html= filter_styles filter_styles= fold_lines fold_lines= generate_toc generate_toc= no_image no_image= no_links no_links= no_pseudo_protocols no_pseudo_protocols= no_tables no_tables= safelink safelink= smart smart= strict strict= text to_html toc_content
[21] (pry) main / RDiscount: 1> $ toc_content
Scanning and caching *.c files...
From: /Users/john/.rvm/gems/ruby-1.9.3-p194/gems/rdiscount-1.6.8/ext/rdiscount.c (C Method):
Number of lines: 29
Owner: RDiscount
Visibility: public
static VALUE
rb_rdiscount_toc_content(int argc, VALUE *argv, VALUE self)
{
char *res;
int szres;
int flags = rb_rdiscount__get_flags(self);
/* grab char pointer to markdown input text */
VALUE text = rb_funcall(self, rb_intern("text"), 0);
Check_Type(text, T_STRING);
/* allocate a ruby string buffer and wrap it in a stream */
VALUE buf = rb_str_buf_new(4096);
MMIOT *doc = mkd_string(RSTRING_PTR(text), RSTRING_LEN(text), flags);
if ( mkd_compile(doc, flags) ) {
szres = mkd_toc(doc, &res);
if ( szres != EOF ) {
rb_str_cat(buf, res, szres);
rb_str_cat(buf, "\n", 1);
}
}
mkd_cleanup(doc);
return buf;
}
[22] (pry) main / RDiscount: 1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment