0.0.1 • Published 12 years ago

realize v0.0.1

Weekly downloads
12
License
-
Repository
github
Last release
12 years ago

npm install -g realize

Version 0.0.2 (unstable)

realize

An actualizer.

example

the realizer file realizer.coffee

title: 'Generic Realizer'
uuid:  'universally unique identifier for boring example that needs attention'
realize: (step) -> 

    before all: ->
        @count = 0
        @notice.use (msg, next) -> 

            #
            # integrated middleware message bus
            # 

            if msg.event.match /^run::/
                console.log msg.event, msg.progress
                return next()
            
            console.log msg.event, msg
            next()
            

    before each: -> 

        @count++

        #
        # @ (this) - References to the running `job` context
        #            in all `hooks` and `phrases`.
        #


    step 'A', (done) -> @arbitraryResult = 42; done()
    step 'B', (done) -> done()
    step 'C', (done) -> 

        #
        # this is a `phrase`, it has access to 
        # the message bus
        #

        @notice.event 'RUNNING step C', count: @count
        done()

to run it realize -xf realizer.coffee

pending functionality

title: 'Another Realizer'
uuid:  'universally unique identifier too'

realize: (step) -> 

    step 'get records', (done, https) -> 

        #
        # use injected node module (https) to get stuff
        # 

        @records = ['array']
        done()

    step 'do some thing with them', (done, LocalModule) -> 

        #
        # CamelCase injections are loaded from local modules 
        # 
        #    ie. 'lib/local_module'
        #

        LocalModule.process record for record in @records
        done()