metropolis.git  about / heads / tags
key-value store for Rack
blob 334caf6d0ac677da2462ca7f1e125e910b42fb54 352 bytes (raw)
$ git show HEAD:lib/metropolis/input_wrapper.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
# -*- encoding: binary -*-

class Metropolis::InputWrapper
  include Metropolis::Constants

  def initialize(env)
    @input = env[Rack_Input]
    env[Rack_Input] = self
  end

  def read(*args)
    args.empty? and return read_all
    ni
  end

  def ni(*args)
    raise NotImplementedError
  end

  alias gets ni
  alias each ni
  alias rewind ni
end

git clone https://yhbt.net/metropolis.git