Socket
Book a DemoInstallSign in
Socket

maveric

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maveric

1.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source
  • Maveric

Maveric is a MVC overlay for Rack.

The dominant idea behind Maveric is as little magic as possible, being as flexible as possible.

The use of a Maveric is simple.

class MyApp < Maveric def get render {'

Hello World!

'} end end

env['PATH_INFO'] # => '/' MyApp.call(env)[0] # => 200

env['PATH_INFO'] # => '/index' MyApp.call(env)[0] # => 200

By default the method used to generate a response is the lower case form of the http method. GET requests call #get, POST requests call #post, and so on. A 404 is returned if a the appropriate method is not defined.

-- Actions

To override this you may redefine #action= as needed.

class MyApp < Maveric def action= method if method == :get and @request.path_info == '/' @action = :index else super end end def index render {'

Hello World!

'} end end

-- The Render Method

Provides a simple way to format data.

class MyApp < Maveric module Views def html data '

'+data.to_s+'

' end end def get render :html { 'Hello World!' } end end

FAQs

Package last updated on 15 Dec 2009

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.