Stacko

Stacko provides a simple way to layer middleware functionality around your Ruby application core use cases. Although Stacko uses a dsl inspired by Rack, it is not a server interface.

Installation

Add this line to your application's Gemfile:

gem 'stacko'

And then execute:

$ bundle

Or install it yourself as:

$ gem install stacko

Usage


class Application < Stacko::Application
  use LoggingMiddleware

  map(:login) do
    run 
  end

  use AuthenticationMiddleware

  map(:get_current_user) do
    run 
  end

  map(:create_user) do
    run create_user_use_case
  end
end

app = Application.new
app.get_current_user(:token => user_session_token) # => returns current user entity
app.(:username => 'johndoe', :password => 'password123') #=> 'user-session-23wm4n0oidsf9874kjjhg4j5g3mb234bm234b2' 

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request