Jon Leighton jonleighton

View issue5717.rb
1 2 3 4 5 6 7 8 9 10
gem "rails", "~> 3.2.0"
require "active_record"
require "logger"
 
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: ":memory:"
)
 
puts ActiveRecord::VERSION::STRING
View test.rb
1 2 3 4 5 6 7 8
class Foo
def to_io
puts "to_io"
IO.pipe.first
end
end
 
IO.select([Foo.new])
View 3-2-stable.txt
1 2 3 4 5 6 7 8 9 10
Generating data...
Inserting 20000 users and exhibits...
Calculating -------------------------------------
Model#id 6634 i/100ms
Model.new (instantiation)
1592 i/100ms
Model.new (setting attributes)
764 i/100ms
Model.first 147 i/100ms
Model.all limit(100) 4 i/100ms
View gist:5147785
1 2 3 4 5 6 7 8 9 10
 
.*** buffer overflow detected ***: spring app | rails-3-2 | started 2 secs ago | test mode terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7faab4882807]
/lib/x86_64-linux-gnu/libc.so.6(+0x109700)[0x7faab4881700]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a7be)[0x7faab48827be]
/home/travis/.rvm/rubies/ruby-2.0.0-p0/bin/../lib/libruby.so.2.0(rb_fd_set+0x7b)[0x7faab4cdf2eb]
/home/travis/.rvm/rubies/ruby-2.0.0-p0/bin/../lib/libruby.so.2.0(+0x8f0de)[0x7faab4bc70de]
/home/travis/.rvm/rubies/ruby-2.0.0-p0/bin/../lib/libruby.so.2.0(rb_ensure+0xdb)[0x7faab4ba508b]
/home/travis/.rvm/rubies/ruby-2.0.0-p0/bin/../lib/libruby.so.2.0(+0x8be7d)[0x7faab4bc3e7d]
View gist:5092937
1 2 3 4 5 6 7
# This style of code is a complete abomination and you should never do it!
 
my_var = if whatever?
thing
else
other_thing
end
View foo.diff
1 2 3 4 5 6 7 8 9 10
diff --git a/lib/spring/application.rb b/lib/spring/application.rb
index 6e241a8..69ef383 100644
--- a/lib/spring/application.rb
+++ b/lib/spring/application.rb
@@ -22,9 +22,6 @@ module Spring
@stdout = IO.new(STDOUT.fileno)
@stderr = IO.new(STDERR.fileno)
- @stdin = File.open('/dev/null', 'r')
-
View foo.diff
1 2 3 4 5 6 7 8 9 10
diff --git a/lib/spring/application.rb b/lib/spring/application.rb
index 6e241a8..c726a24 100644
--- a/lib/spring/application.rb
+++ b/lib/spring/application.rb
@@ -20,11 +20,11 @@ module Spring
@watcher = watcher
@setup = Set.new
- @stdout = IO.new(STDOUT.fileno)
- @stderr = IO.new(STDERR.fileno)
View foo.diff
1 2 3 4 5 6 7 8 9 10
diff --git a/lib/spring/application.rb b/lib/spring/application.rb
index 6e241a8..614f5f5 100644
--- a/lib/spring/application.rb
+++ b/lib/spring/application.rb
@@ -62,6 +62,8 @@ module Spring
def serve(client)
redirect_output(client) do
+ stdin = client.gets.chomp
+
View foo.diff
1 2 3 4 5 6 7 8 9 10
diff --git a/lib/spring/application.rb b/lib/spring/application.rb
index 6e241a8..c1e9f66 100644
--- a/lib/spring/application.rb
+++ b/lib/spring/application.rb
@@ -62,6 +62,8 @@ module Spring
def serve(client)
redirect_output(client) do
+ stdin = client.recv_io
+
View foo.diff
1 2 3 4 5 6 7 8 9 10
diff --git a/lib/spring/application.rb b/lib/spring/application.rb
index 6e241a8..2e60965 100644
--- a/lib/spring/application.rb
+++ b/lib/spring/application.rb
@@ -62,6 +62,8 @@ module Spring
def serve(client)
redirect_output(client) do
+ stdin = client.recv_io
+
Something went wrong with that request. Please try again.