Class: Unicorn::App::Inetd

Inherits:
Struct
  • Object
show all
Defined in:
lib/unicorn/app/inetd.rb

Defined Under Namespace

Classes: CatBody

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*cmd) ⇒ Inetd

Returns a new instance of Inetd.



95
96
97
# File 'lib/unicorn/app/inetd.rb', line 95

def initialize(*cmd)
  self.cmd = cmd
end

Instance Attribute Details

#cmdObject

Returns the value of attribute cmd

Returns:

  • (Object)

    the current value of cmd



9
10
11
# File 'lib/unicorn/app/inetd.rb', line 9

def cmd
  @cmd
end

Instance Method Details

#call(env) ⇒ Object



99
100
101
102
103
104
105
# File 'lib/unicorn/app/inetd.rb', line 99

def call(env)
  /\A100-continue\z/i =~ env[Unicorn::Const::HTTP_EXPECT] and
      return [ 100, {} , [] ]

  [ 200, { 'Content-Type' => 'application/octet-stream' },
   CatBody.new(env, cmd) ]
end