Apotomo

From HandWiki

Apotomo is a platform-specific widget framework for Ruby on Rails, designed to simplify the components and code of the view section of the MVC design pattern. Apotomo is built on, and was built by the same engineer as, the Cells Project.[1]

Design goals and overview

Apotomo assists developers by reducing the amount of dynamic code needed to build the view component of a Ruby on Rails project, as well as making the view component code re-usable.

View Code Reduction: Apotomo usage is based upon Apotomo widgets (which are Ruby classes), and all Apotomo widgets inherit from the Apotomo:Widget base class. Even though these Apotomo widgets are rendered in and utilized for the view components, Apotomo widgets move conventional view code into the Apotomo widget class, thus "clearing up" and reducing the code in the view component.

Code Re-usability: Apotomo widgets improve code re-usability by moving code from the view files into newly created "mini-controllers" for the Apotomo widgets. These "mini-controllers" can be used in an endless number of views in a website. For example, consider an implementation project for an E-Commerce site. Each page of the E-Commerce site would need a "# of items in shopping bag" widget on each page, with some dynamic elements or behaviors. Without Apotomo, a developer may need to have repeated code in all views for pages with the "# of items in shopping bag" widget. But, with Apotomo, the developer could simply create a Shoppingtrolly > Apotomo:Widget "mini-controller" class, and then reference the class repeatedly in endless number(s) of controller actions and views.

Configuration

  • Install Ruby 1.9.3/2.0.0 and Rails 3/4 as a prerequisite.
  • Clone the source code located at GitHub.[2]
  • Install the Apotomo gem by running gem install apotomo
  • Modify the Gemfile in your project by adding the below line if not added gem 'apotomo'
  • You can find the sample tutorial at the official Apotomo site.[3]

Version history

Some of the important release versions have been listed below:

  • v1.3.2 Latest Bug fix release Jun 11, 2015
  • v1.3.0 Version release Jun 3, 2014
  • v1.2.0 Version release Oct 12, 2011
  • v1.1.0 Version release Mar 1, 2011
  • v1.0.0 Version release Nov 17, 2010
  • v0.1.0 Initial Apotomo GEM release

For details and packages, refer to releases page in the Apotomo website.[2]

Usage

Apotomo can be utilized to create modern rich application based widgets. It provides a component-based application on which widgets can be built. These widgets can directly respond to Ruby events and the development is hassle free. Just a small amount of code can give us a great deal of functionality with Apotomo, e.g. a small blog entry widget, tweeting from your website, status updates, etc.

A dummy of how your <<Widget_name>>.rb file could look like:

class <<YourWidget>> < Apotomo::Widget
  responds_to_event :<<event_name>>
  def <<process>>
    ...
  end
end

The text inside << >> can be replaced with the appropriate names and events as desired by the user and required as per the application. Do not use the << >> when replacing with the original text.

Licenses

Apotomo is an open source tool copyrighted to Nick Sutterer under MIT license. The source code is stored at the GitHub repository location.[3]

References