README.md in modularity-rails-0.15.0 vs README.md in modularity-rails-0.16.0

- old
+ new

@@ -1,6 +1,6 @@ -# Modularity::Rails [![Build Status](https://secure.travis-ci.org/kevgo/modularity-rails.png)](http://travis-ci.org/#!/kevgo/modularity-rails) <a href="https://codeclimate.com/github/kevgo/modularity-rails" target="_blank"><img src="https://codeclimate.com/badge.png" /></a> +# Modularity::Rails [![Build Status](https://travis-ci.org/kevgo/modularity-rails.png?branch=master)](https://travis-ci.org/kevgo/modularity-rails) Makes the [Modularity CoffeeScript](http://github.com/kevgo/modularity-coffeescript) library and related modules available to Rails 3.1 applications. Modularity is a framework for lightweight component-oriented CoffeeScript. @@ -14,11 +14,11 @@ # Installation Load modularity in your application's Gemfile: - + ```ruby gem 'modularity-rails' ``` And then execute: @@ -37,24 +37,24 @@ # Usage Modularity is a lightweight framework for building powerful AJAX applications. -Modularity avoids magic and heavyness. It focusses on providing a pragmatic and interoperable foundation -for clean hand-written code bases. -Modularity provides practices to create code bases of incredible complexity that are still -nicely manageable and perform very well. +Modularity avoids magic and heavyness. It focusses on providing a pragmatic and interoperable foundation +for clean hand-written code bases. +Modularity provides practices to create code bases of incredible complexity that are still +nicely manageable and perform very well. ## Modules -Modules are native CoffeeScript classes that are specialized for doing what most JavaScript running in browsers does: -managing a UI consisting of DOM elements, reacting to events that happen within that section, +Modules are native CoffeeScript classes that are specialized for doing what most JavaScript running in browsers does: +managing a UI consisting of DOM elements, reacting to events that happen within that section, representing application logic specific to that section, and providing high-level APIs for others to interact with the section. -Each module has a container. The container is the outermost DOM element of a section. -Everything the module does must happen inside this container. +Each module has a container. The container is the outermost DOM element of a section. +Everything the module does must happen inside this container. The module is responsible for managing the inner DOM-structure of the container. ## Mixins @@ -64,20 +64,20 @@ myMixin = # This will be called when an instance of a class that includes this mixin is created. constructor: -> - # This method will be available in every class that includes + # This method will be available in every class that includes myMethod: -> class MyModule extends Module @mixin myMixin constructor: (container) -> - + # The super constructor will call the mixin constructors here. super # ... ``` @@ -95,11 +95,11 @@ and must be explicitly required in your Rails files using the `require` commands of the asset pipeline. ## Modules -* __button.coffee__: A simple button. Fires the `clicked` event when anything inside the container is clicked. Uses the `clickable` mixin. +* __button.coffee__: A simple button. Fires the `clicked` event when anything inside the container is clicked. Uses the `clickable` mixin. * __counter_button.coffee__: Similar to button, but includes the click count as data payload in the fired event. ## Mixins @@ -108,11 +108,11 @@ ###closable Including this mixin makes a module closable. The mixin searches for an embedded DOM element with the class 'CloseButton'. When it is clicked, the following things happen: * The _closable_closing_ hook of the closable class is called. - This hook could be used to display confirmation dialogs (and abort the close process) or to fire custom events that depend on the DOM still being present. + This hook could be used to display confirmation dialogs (and abort the close process) or to fire custom events that depend on the DOM still being present. If this method returns a falsy value, the closing process is aborted. * The closable module fires a local 'closing' event (with the DOM still present). * The whole module including its container is removed from the DOM. * The _closable_closed_ hook of the closable class is called. @@ -122,11 +122,11 @@ ### Loader A generic cached loader for parallel and repeated GET requests. Prevents duplicate requests, caches the responses. The first request triggers the ajax request. Subsequent requests while the resquest is running are accumulated without causing new requests. -Once the response arrives, all currently requesting clients are answered. Subsequent requests are answered immediately using the cached data. +Once the response arrives, all currently requesting clients are answered. Subsequent requests are answered immediately using the cached data. ```coffeescript Module.loader.get '/test.json', (data) -> # Use data here. ``` @@ -157,6 +157,7 @@ * Run the evergreen server: ```$ evergreen run``` * Run the guard server: ``` $ bundle exec guard ``` * Start the LiveReload plugin in Chrome (button in address bar). * Navigate to the test page that you want to observe. * Change and save code and see the browser reload. +