search for: to_io

Displaying 4 results from an estimated 4 matches for "to_io".

Did you mean: to_i
2013 Mar 22
0
Should to_io be added to ActionDispatch::Http::UploadedFile?
In rest-client/rest-client#144<https://github.com/rest-client/rest-client/issues/144#issuecomment-14876580> we''re trying to handle objects that behave like IO. Some have suggested that respond_to?(:read) is a poor test of this and have suggested using IO.try_covert(obj) instead. My counter example for this is ActionDispatch::Http::UploadedFile. I''m wondering if there
2013 Dec 09
2
[PATCH] rework master-to-worker signaling to use a pipe
...::UNIXServer or Kgio::TCPServer diff --git a/lib/unicorn/worker.rb b/lib/unicorn/worker.rb index 1fb6a4a..e74a1c9 100644 --- a/lib/unicorn/worker.rb +++ b/lib/unicorn/worker.rb @@ -12,6 +12,7 @@ class Unicorn::Worker # :stopdoc: attr_accessor :nr, :switched attr_writer :tmp + attr_reader :to_io # IO.select-compatible PER_DROP = Raindrops::PAGE_SIZE / Raindrops::SIZE DROPS = [] @@ -23,6 +24,66 @@ class Unicorn::Worker @raindrop[@offset] = 0 @nr = nr @tmp = @switched = false + @to_io, @master = Unicorn.pipe + end + + def atfork_child # :nodoc: + # we _must_ cl...
2009 Oct 03
2
Looking for a good resource on open-uri and FileUtils
...# Returns representation of the data of the file assigned to the given # style, in the format most representative of the current storage. def to_file style = default_style @queued_for_write[style] || (File.new(path(style)) if exists?(style)) end alias_method :to_io, :to_file def flush_writes #:nodoc: @queued_for_write.each do |style, file| FileUtils.mkdir_p(File.dirname(path(style))) result = file.stream_to(path(style)) file.close result.close end @queued_for_write = {} end de...
2011 Oct 06
5
Simple ActiveRecord serialise problem
When I create a table with the following SQL: # create table foos (id SERIAL, content VARCHAR(255)); And define a class as follows: class Foo < ActiveRecord::Base serialize :content, JSON end Creating a new instance of the class gives an error: > f = Foo.new NoMethodError: undefined method `read'' for nil:NilClass from