Skip to content

Instantly share code, notes, and snippets.

View jballanc's full-sized avatar

Joshua Ballanco jballanc

View GitHub Profile
diff --git a/lib/timeout.rb b/lib/timeout.rb
index 297b769..8399639 100644
--- a/lib/timeout.rb
+++ b/lib/timeout.rb
@@ -40,21 +40,22 @@ module Timeout
# Note that this is both a method of module Timeout, so you can 'include Timeout'
# into your classes so they have a #timeout method, as well as a module method,
# so you can call it directly as Timeout.timeout().
- def timeout(sec, klass = nil) #:yield: +sec+
+ def timeout(sec, klass = nil, &block) #:yield: +sec+
Dir['*'].inject({}) {|h, f| k = f.gsub(/\d*\.tab$/, ''); h[k] ||= []; h[k] << f; h}.each {|k, v| File.open("#{k}.csv", 'w') {|o| v.each {|i| File.open(i, 'r') {|f| f.each_line {|l| l.gsub!(/[ |\t]+/, ','); o << l unless l[/\d+,\d+,(\d+),/,1] == '0' } } } } }
diff -r -u ./base.rb /Volumes/Data/Users/joshua1/Source/sinatra/lib/sinatra/base.rb
--- ./base.rb 2010-07-22 13:58:58.000000000 -0700
+++ /Volumes/Data/Users/joshua1/Source/sinatra/lib/sinatra/base.rb 2010-07-23 18:41:46.000000000 -0700
@@ -36,7 +36,7 @@
# Override Rack < 1.1's Request#params implementation (see lh #72 for
# more info) and add a Request#user_agent method.
# XXX remove when we require rack > 1.1
- if Rack.version < '1.1'
+ if Rack.release < '1.1'
def params
diff --git a/encoding.c b/encoding.c
index 82ffb39..2fe275d 100644
--- a/encoding.c
+++ b/encoding.c
@@ -484,6 +484,12 @@ rb_enc_set_default_external(VALUE encoding)
default_external = RENC(encoding);
}
+rb_encoding *
+rb_default_internal_encoding(void)
diff --git a/bin/control_tower b/bin/control_tower
index b9f4968..e911b0b 100755
--- a/bin/control_tower
+++ b/bin/control_tower
@@ -8,21 +8,21 @@ require 'optparse'
# Some default values
@options = {
:rackup => './config.ru',
- :port => '8080',
+ :port => '3000',
diff --git a/lib/control_tower/rack_socket.rb b/lib/control_tower/rack_socket.rb
index a173627..94b23bd 100644
--- a/lib/control_tower/rack_socket.rb
+++ b/lib/control_tower/rack_socket.rb
@@ -40,7 +40,7 @@ module ControlTower
'rack.run_once' => false,
'rack.version' => VERSION }
resp = nil
- x_sendfile_header = "X-Sendfile"
+ x_sendfile_header = 'X-Sendfile'
diff --git a/encoding.c b/encoding.c
index 2ea8c65..02f8d93 100644
--- a/encoding.c
+++ b/encoding.c
@@ -516,7 +516,7 @@ rb_to_encoding_index(VALUE enc)
return -1;
}
else {
- int idx = index_of_encoding(rb_enc_get(enc));
+ int idx = index_of_encoding((rb_encoding_t *)enc);
win = NSWindow.alloc.initWithContentRect [10,20,300,300],
:styleMask => (NSTitledWindowMask |
NSClosableWindowMask |
NSMiniaturizableWindowMask |
NSResizableWindowMask)
require 'c'
class Arriving
def say
puts "Hello, #{C.new.place}"
end
end
diff --git a/bin/rubyc b/bin/rubyc
index c14de80..cbb9448 100644
--- a/bin/rubyc
+++ b/bin/rubyc
@@ -16,6 +16,7 @@ class Compiler
@archs = []
@internal = argv.delete('--internal')
@frameworks = %w{Foundation}
+ @linkf = []