Sha256: edd8e364c24103b953bac3d9aa68ffedfe1de9bad5e5431f563d5198ba7d9b75

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

require "anypow/version"
require "anypow/app"

module Anypow
  def self.ruby_18?
    defined?(RUBY_VERSION) and RUBY_VERSION =~ /^1\.8\.\d+/
  end

  def run(app)
    if is_pow?
      super(app) if app.class == Anypow::App
    else
      super(app) if app.class != Anypow::App
    end
  end

  def run_pow(command)
    require 'rack'
    use Rack::Chunked
    use Rack::ContentLength
    run Anypow::App.new(command) if is_pow?
  end

  def is_pow?
    self.class.to_s == "Nack::Builder"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
anypow-0.0.3 lib/anypow.rb