Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shot_mvc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shot_mvc

  • 1.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Introduction

The Shot MVC implements a Model, View, Controller architecture on top of the base Shot Framework through a series of Loaders and Routers. Additionally, the MVC gem allows you to use the MVCApplication class, which will automatically set up all required MVC loaders and routers.

Installation

gem install shot_mvc

Usage Example

require 'shot_mvc'

app = MVCApplication.new

app.run do
    app.on 'load' do |instance|
        instance.get 'controller', 'Home'
    end
end

app.start

Components

The Shot MVC is made up of a few different parts, which collectively make up a Model, View, Controller structure.

Model

At the time of writing, Models are not yet finished, but coming soon!

View

The View portion of the MVC is made up of Elements and Templates.

Elements correspond to an actual HTML element on the user's screen. Elements have an assigned jQuery selector, and can trigger any jQuery function on the corresponding element on the page.

Elements are capable of rendering Templates, which are nothing more than an ERB file, with some special sauce.

body = get 'element', 'body'

body.html = 'Hello World'
body.jq 'css', ['background-color', 'red']

body.render 'some_template'

Controllers

Controllers are just as you'd expect. All controllers inherit from the base Controller class, and they can be loaded using the built in Loader.

home_controller = get 'controller', 'Home'
home_controller.index

License

Licensed under the MIT License. For full licensing information, please see LICENSE.md.

FAQs

Package last updated on 16 Jul 2013

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc