stacko 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b62a1d92c1a77f285fe53695f11d533580c7044b
4
- data.tar.gz: 974017ed573402b6cfed18e058f230a14a284d40
3
+ metadata.gz: d11c5dbe5962879586d74327596b1f0935d58b64
4
+ data.tar.gz: 6198422f47fe9135063d5940a79b54c355b339ea
5
5
  SHA512:
6
- metadata.gz: c35b59995fe7decf5e81e2e41aa52eb347e42487c10445ad18a22fdc707fc98741afeeca0bcbb1adff104a48de8b4598f0e5d20efb92c8bde3543d43f6b5ff58
7
- data.tar.gz: 2b72e21c8a1791d4ca7a45017e857229a042a10ad2f47cf9c7654039521a7ea23eda5c165ef82da27a42113c4252027cde5a2cd42047ca274a44dbe7d546e010
6
+ metadata.gz: 27912cb34bda0f34d3612b37c9b57c22f717e46f2ef61049d1e5dbc256786c852c71daaacf4f00808484ce7088fd1451a0d86c120f99cf25cab05fd3a833499d
7
+ data.tar.gz: 154a7dc56bc4a7fd5fe0002d23251520d7cb81a2998361a214b9a5432a0e2202e40156245f68a966c6004d856a9444ebb7360e53b05e6ab3f401b446b3659788
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stacko
2
2
 
3
- TODO: Write a gem description
3
+ 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.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,32 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ```ruby
22
+
23
+ class Application < Stacko::Application
24
+ use LoggingMiddleware
25
+
26
+ map(:login) do
27
+ run login_use_case
28
+ end
29
+
30
+ use AuthenticationMiddleware
31
+
32
+ map(:get_current_user) do
33
+ run login_use_case
34
+ end
35
+
36
+ map(:create_user) do
37
+ run create_user_use_case
38
+ end
39
+ end
40
+
41
+ app = Application.new
42
+ app.get_current_user(:token => user_session_token) # => returns current user entity
43
+ app.login(:username => 'johndoe', :password => 'password123') #=> 'user-session-23wm4n0oidsf9874kjjhg4j5g3mb234bm234b2'
44
+
45
+ ```
46
+
22
47
 
23
48
  ## Contributing
24
49
 
@@ -1,5 +1,9 @@
1
1
  module Stacko
2
2
  class Builder
3
+ def self.app(default_app = nil, &block)
4
+ self.new(default_app, &block).to_app
5
+ end
6
+
3
7
  def initialize(default_app = nil, &block)
4
8
  @run = default_app
5
9
  @use = []
@@ -1,3 +1,3 @@
1
1
  module Stacko
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stacko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Lott