This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def unique_methods | |
self.methods - Object.new.methods | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def word_slice(range, max_extra_chars = 20) | |
offset = range.max + 1 | |
string = self.slice(range) | |
if self[offset,max_extra_chars] =~ /(^[a-zA-Z0-9_-]+)/ | |
string << $1 | |
end | |
string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -up ruby-1.9.1-p378/ext/openssl/ossl.c.ossl10 ruby-1.9.1-p378/ext/openssl/ossl.c | |
--- ruby-1.9.1-p378/ext/openssl/ossl.c.ossl10 2007-02-13 00:01:19.000000000 +0100 | |
+++ ruby-1.9.1-p378/ext/openssl/ossl.c 2009-08-26 12:29:41.000000000 +0200 | |
@@ -92,7 +92,7 @@ ossl_x509_ary2sk(VALUE ary) | |
#define OSSL_IMPL_SK2ARY(name, type) \ | |
VALUE \ | |
-ossl_##name##_sk2ary(STACK *sk) \ | |
+ossl_##name##_sk2ary(STACK_OF(type) *sk) \ | |
{ \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Photo | |
def photo_filename= filename | |
if (self.photo = File.read(filename) rescue nil) | |
save! | |
end | |
end | |
end | |
# ... |
NewerOlder