Author: | Baiju Muthukadan |
---|---|
Email: | baiju.m.mail AT gmail.com |
Version: | 0.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import with_statement # needed for python 2.5 | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
from fabric.contrib import files | |
USAGE = """ | |
================================================================ | |
NOTE: | |
using this fabfile expects that you have the python utility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ns | |
def initialize | |
use.each do |pkg, method_names| | |
method_names.each do |name| | |
self.class.send(:define_method, name) do |*args| | |
pkg.method(name).call(*args) | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix. | |
;; | |
;; * :use makes functions available without a namespace prefix | |
;; (i.e., refers functions to the current namespace). | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; |
Gist to describe the process of adding a namespaced isolated Rails Engine
to a typical Rails application and adding methods to one of the Rails Engine's
controller and model.
- Rails applicaiton all by itself.
- Rails application with the Rails Engine (FooBar) mounted.
- Rails applicaiton partially extending a controller/model from the Rails Engine.