Sha256: 54fcad4497870726c493e3b934f39d5cda5dc3e56d0a62a35feb7c3bfce05ee6

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 Bytes

Contents

require "rulers/version"
require "rulers/routing"

module Rulers
  class Application
    def call(env)
      if env['PATH_INFO'] == '/favicon.ico'
        return [404,
          {'Content-Type' => 'text/html'}, []]
      end

      if env['PATH_INFO'] == '/'
        return [204, {'Content-Type'=> 'text/html'},["Incorrect URL!!!!"]]
      end

      klass, act = get_controller_and_action(env)
      controller = klass.new(env)
      text = controller.send(act)
      [200, {'Content-Type' => 'text/html'},
      [text]]
    end
  end

  class Controller
    def initialize(env)
      @env = env
    end

    def env
      @env
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erik_rulers-0.0.3 lib/rulers.rb