Sha256: 739db7fa907fbbe2493c9ab0b1d0eee5a96ce5b1071ce423cde3551e7b56bbee
Contents?: true
Size: 868 Bytes
Versions: 10
Compression:
Stored size: 868 Bytes
Contents
require 'net/protocol' require 'envjs/net' class Envjs::Net::File < Net::Protocol class Get attr_accessor :path def initialize path @path = path end end def initialize host, port end def self.start host, port new( host, port ).start end def start self end def finish end def request request Response.new request.path end class Response def initialize path @path = path @file = File.new @path @body = @file.read @code = @file.nil? ? "404" : "200"; @file.close end def [] *args nil end def each &block end def getHeaderFields [] end def getContentEncoding nil end def getResponseCode @file.nil? ? 404 : 200; end def getInputStream self end attr_reader :body, :code end end
Version data entries
10 entries across 10 versions & 2 rubygems