raki 0.0.3 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab3397c01504c3d1377e3677fd9ab6e96bd008483439b67d5aec2470d148d8a7
4
- data.tar.gz: 1c9785b4be9430e556cc5493864c9e8147fa161122275a11c3f37805f335e12f
3
+ metadata.gz: 44d1c46c2049a9ce58482fd1142eeb6bb7918389231e86eef6fea8ad8ec00653
4
+ data.tar.gz: 36f8ebea936c45decc39f7d93493132c029be5c9320498491e719ead1b2bc5c7
5
5
  SHA512:
6
- metadata.gz: be5079c7ae71b350f7e46190153bbe6b2f75c00d998dfa8ed87e80be9c28f908ea8da0aa161ee6ec1666ae0ba840ab3243d693c23aafe63e88fd4bae03a0d445
7
- data.tar.gz: ffe994cb549ef1edc9456afa5e3017d886118a0a95bd90ff6db678a0a112c6902d8abd7009953a5bbb3585368ad2a95393fc114a948a822e5fb72790360d8b86
6
+ metadata.gz: eda887ab0b6504e8879a3f771e649cf3490f69240a384dedba908092d0fdb2043f80db7a7f7bc99421e177e0acb466b49810643cc2055b5dd836068a5d01c87c
7
+ data.tar.gz: f8c2e6802a753cf4f52d5264395679221cffb41746a55953f1db3a3c000eadea7a7f52d6607a6aa581ac03774d5da16d44b18e493d270af0ad6ec7e40bad6dfc
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- MIT License
1
+ The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Dittmar Krall - www.matique.com
3
+ Copyright (c) 2020-2023 Dittmar Krall (www.matiq.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,3 +1,148 @@
1
- # raki
1
+ # Raki
2
+ [![Gem Version](https://badge.fury.io/rb/raki.png)](http://badge.fury.io/rb/raki)
2
3
 
3
- Under heavy construction
4
+ The Raki specification enables a kind of piping objects.
5
+
6
+ The composing is done by Raki::Chain and Raki::Builder.
7
+
8
+ ## Installation
9
+
10
+ As usual:
11
+ ```ruby
12
+ # Gemfile
13
+ gem "raki"
14
+ ```
15
+ and run "bundle install".
16
+
17
+ ## Specification
18
+
19
+ A Raki is a Ruby object (not a class) that responds to "call".
20
+ It takes exactly one argument, a Hash, and returns a result, again a Hash.
21
+
22
+ Rakis are stackable due to the generality of its argument and result.
23
+
24
+ Sometimes it is expected that a Raki delivers an array of strings as
25
+ part of the result.
26
+ The convention is that this array is accessed as "result[:body]".
27
+
28
+ ## Simple Raki
29
+
30
+ A simple Raki (a proc/lambda can be a Raki):
31
+
32
+ ~~~
33
+ raki = ->(hsh) { {body: ["Hello World!"]} }
34
+ ~~~
35
+
36
+ and a little more complex:
37
+
38
+ ~~~
39
+ raki = ->(hsh) { {body: ["Hi #{hsh[:name]!", "Nice to meet you."] } }
40
+ ~~~
41
+
42
+ ## Middleware
43
+
44
+ A Raki::Middleware is a Raki that calls another Raki enabling
45
+ "before" and "after" code, i.e. operations around the second Raki.
46
+
47
+ A Raki middleware is ready to be stacked.
48
+
49
+ A sample for a Raki middleware:
50
+
51
+ ~~~ruby
52
+ # already included in "gem raki"
53
+ module Raki
54
+ class Middleware
55
+ def initialize(app)
56
+ @app = app
57
+ end
58
+ end
59
+ end
60
+
61
+
62
+ # your sample
63
+ class SampleMiddleware < Raki::Middleware
64
+ def call(env)
65
+ # do something before
66
+ result = @app.call(env) # if @app
67
+ # do something after
68
+ result[:body] << "My grain of salt."
69
+ result
70
+ end
71
+ end
72
+ ~~~
73
+
74
+ ## Composing
75
+
76
+ ### Raki::Chain
77
+
78
+ Raki::Chain chains Rakis.
79
+ In particular, it will forward the result of a previous Raki
80
+ as the argument of the next one.
81
+ The argument for the first Raki is the arguent of the "call".
82
+ The return value is the result of the last Raki.
83
+
84
+ A sample:
85
+
86
+ ~~~
87
+ class Cl < Raki::Base
88
+ def call(env)
89
+ env + @args.first
90
+ end
91
+ end
92
+
93
+ proca = ->(env) { env + "a" }
94
+ app = Raki::Chain.new do
95
+ add Cl, "C"
96
+ add proca
97
+ add { |env| env + "b" }
98
+ add ->(env) { env + "c" }
99
+ end
100
+
101
+ app.call("") # --> "Cabc"
102
+ ~~~
103
+
104
+ ### Raki::Builder
105
+
106
+ Raki::Builder chains Raki::Middleware.
107
+ In particular, the "@app" is initialized for each middleware.
108
+ The last middleware "@app" is initialized to "nil".
109
+
110
+ It is expected that each middleware takes care to call the next one.
111
+
112
+ A sample:
113
+
114
+ ~~~
115
+ class MW < Raki::Middleware
116
+ def call(env)
117
+ result = env + @args.first
118
+ return result unless @app
119
+
120
+ @app.call(result)
121
+ end
122
+ end
123
+
124
+ app = Raki::Builder.new do
125
+ add MW, "a"
126
+ add MW, "b"
127
+ end
128
+
129
+ app.call("") # --> "ab"
130
+
131
+ ~~~
132
+
133
+ ### Recommendations
134
+
135
+ Implement a Raki as idempotent, i.e. same arguments delivers same results.
136
+
137
+ It is always a good idea to avoid side-effects.
138
+
139
+ Frozen arguments may avoid some strange behaviour.
140
+
141
+ ## Miscellaneous
142
+
143
+ Heavily inspired by Rack.
144
+
145
+ Copyright (c) 2020-2023 Dittmar Krall (www.matiq.com),
146
+ released under the MIT license:
147
+
148
+ * https://opensource.org/licenses/MIT
data/lib/raki/builder.rb CHANGED
@@ -1,59 +1,45 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # see also
4
- # cat ~/test/rack/lib/rack/builder.rb
5
-
6
- # inspired by Rack::Builder
7
3
  module Raki
8
- class Builder
9
- def initialize(default_app = nil, &block)
10
- @added = []
11
- @runs = [default_app].compact
12
- instance_eval(&block) if block_given?
13
- end
4
+ class Builder < Raki::Base
5
+ # attr_accessor :stack
14
6
 
15
- # Create a new Raki::Builder instance and return the Raki application
16
- # generated from it.
17
- def self.app(default_app = nil, &block)
18
- new(default_app, &block).to_app
7
+ def initialize(&block)
8
+ @stack = []
9
+ instance_eval(&block) if block
10
+ chain
19
11
  end
20
12
 
21
13
  def add(middleware, *args, &block)
22
- raise 'No add allowed after a run' if @runs.size.positive?
23
-
24
- @added <<
14
+ @stack <<
25
15
  if middleware.instance_of?(Class)
26
- proc { |app| middleware.new(app, *args, &block) }
16
+ middleware.new(*args, &block)
27
17
  else
28
- proc { |_app| middleware }
18
+ middleware
29
19
  end
30
20
  end
31
- ruby2_keywords(:add) if respond_to?(:ruby2_keywords, true)
32
21
 
33
- def run(app)
34
- @runs << app
22
+ def chain
23
+ previous = nil
24
+ @stack.each do |app|
25
+ previous.app = app if previous
26
+ previous = app
27
+ end
35
28
  end
36
29
 
37
- def to_app
38
- app = fake_parallel(@runs)
39
- @added.reverse.inject(app) { |a, e| e[a] }
30
+ def call(hsh = {})
31
+ @stack.first&.call(hsh)
40
32
  end
41
33
 
42
- private
43
- def fake_parallel(runs)
44
- return runs.first if runs.size < 2
45
-
46
- app = lambda do |env|
47
- status, hsh, body = [200, {}, []]
48
- runs.shuffle.each { |run|
49
- s, h, b = run.call(env)
50
- status = s unless s == 200
51
- hsh.merge! h
52
- body << b unless b.empty?
53
- }
54
-
55
- [status, hsh, body.flatten]
56
- end
57
- end
34
+ # def to_s(pre = "")
35
+ # next_pre = pre + " "
36
+ # res = []
37
+ # res << "#{pre}#{self.class.name} #{object_id}"
38
+ # res << "#{pre}@stack.length #{@stack.length}"
39
+ # @stack.each_with_index { |mv, idx|
40
+ # res << "#{pre}[#{idx}] #{mv.to_s(next_pre)}"
41
+ # }
42
+ # res.flatten.join("\n")
43
+ # end
58
44
  end
59
45
  end
data/lib/raki/chain.rb ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Raki
4
+ class Chain < Base
5
+ def initialize(*args, &block)
6
+ super
7
+ @stack = []
8
+ instance_eval(&block) if block
9
+ end
10
+
11
+ def add(middleware = nil, *args, &block)
12
+ middleware ||= block
13
+ @stack <<
14
+ if middleware.instance_of?(Class)
15
+ middleware.new(*args, &block)
16
+ else
17
+ middleware
18
+ end
19
+ end
20
+
21
+ def call(hsh)
22
+ my_hsh = hsh
23
+ @stack.each { |app| my_hsh = app.call(my_hsh) }
24
+ my_hsh
25
+ end
26
+
27
+ # def to_s(pre = "")
28
+ # next_pre = pre + " "
29
+ # res = []
30
+ # res << "#{pre}#{self.class.name} #{object_id}"
31
+ # res << "#{pre}args #{@args}"
32
+ # # res << @app.to_s(next_pre) if @app
33
+ # res << "#{pre}@app #{@app.object_id}" if @app
34
+ # @stack.each_with_index { |mv, idx|
35
+ # res << "#{pre}[#{idx}] #{mv.to_s(next_pre)}"
36
+ # }
37
+ # res.flatten.join("\n")
38
+ # end
39
+ end
40
+ end
data/lib/raki/idem.rb CHANGED
@@ -1,13 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Middleware just passing over or returning the params.
3
+ # Rreturns "env" (doing nothing)
4
4
  module Raki
5
- class Idem < Raki::MiddlewareBase
5
+ class Idem < Raki::Middleware
6
6
  def call(env)
7
- return env unless @app
8
-
9
- @block&.call(env)
10
- @app.call(env)
7
+ env
11
8
  end
12
9
  end
13
10
  end
data/lib/raki/lint.rb CHANGED
@@ -1,31 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Raki::AssertRequest validates your requests according to Raki spec.
4
-
5
- # see also:
6
- # cat ~/test/rack/lib/rack/lint.rb
7
- # cat ~/test/rack/SPEC.rdoc
3
+ # validates according to Raki definition.
8
4
  module Raki
9
5
  class LintError < RuntimeError; end
10
6
 
11
- class Lint < Raki::MiddlewareBase
7
+ class Lint < Raki::Middleware
12
8
  def call(env)
13
- assert('No env given') { env }
14
- assert('Block complained') { @block.call(env) } if @block
15
-
16
- @block&.call(env)
17
- response = @app.call(env)
9
+ assert("No env given") { env }
10
+ # assert("Run complained") { @block.call(env) } if @block
18
11
 
19
- assert('Expected array') { response.class == Array }
20
- assert('Expected array of 3 items') { response.size == 3 }
21
- assert('First item must be an Integer') { response[0].class == Integer }
22
- assert('Second item must be a Hash') { response[1].class == Hash }
23
- assert('Third item must be an Array') { response[2].class == Array }
24
-
25
- response
12
+ result = @app&.call(env)
13
+ assert("Expected hash") { result.instance_of?(Hash) }
14
+ result
26
15
  end
27
16
 
28
- private
17
+ private
18
+
29
19
  def assert(message)
30
20
  return if yield
31
21
 
data/lib/raki/merge.rb CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Middleware Merge.
4
4
  module Raki
5
- class Merge < Raki::MiddlewareBase
5
+ class Merge < Raki::Middleware
6
6
  def call(env)
7
7
  my_env = env.merge(*@args)
8
- @block&.call(my_env)
9
- @app.call(my_env)
8
+ app = @block || @app
9
+ app.call(my_env)
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Base for middleware
4
+ module Raki
5
+ class Middleware
6
+ attr_accessor :app
7
+
8
+ def initialize(*args, &block)
9
+ @app = nil
10
+ @args = args
11
+ @block = block
12
+ end
13
+
14
+ def call(env)
15
+ my_env = env
16
+ result = ZERO
17
+ app = @block || @app
18
+ return result unless app
19
+
20
+ app.call(my_env)
21
+ end
22
+
23
+ # def to_s(pre = "")
24
+ # # next_pre = pre + " "
25
+ # res = []
26
+ # res << "#{pre}#{self.class.name} #{object_id}"
27
+ # res << "#{pre}args #{@args}"
28
+ # # res << @app.to_s(next_pre) if @app
29
+ # res << "#{pre}@app #{@app.object_id}" if @app
30
+ # res.flatten.join("\n")
31
+ # end
32
+ end
33
+ end
data/lib/raki/require.rb CHANGED
@@ -4,14 +4,13 @@
4
4
  module Raki
5
5
  class RequireError < RuntimeError; end
6
6
 
7
- class Require < Raki::MiddlewareBase
7
+ class Require < Raki::Middleware
8
8
  def call(env)
9
9
  expected = @args.flatten.sort
10
10
  bool = env.keys.sort == expected
11
11
  raise(RequireError, "Expected <#{expected.join}>") unless bool
12
12
 
13
- @block&.call(env)
14
- @app.call(env)
13
+ @app&.call(env)
15
14
  end
16
15
  end
17
16
  end
data/lib/raki/slice.rb CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Middleware Slice.
4
4
  module Raki
5
- class Slice < Raki::MiddlewareBase
5
+ class Slice < Raki::Middleware
6
6
  def call(env)
7
7
  my_env = env.slice(*@args.flatten)
8
- @block&.call(my_env)
9
- @app.call(my_env)
8
+ app = @block || @app
9
+ app.call(my_env)
10
10
  end
11
11
  end
12
12
  end
data/lib/raki/version.rb CHANGED
@@ -1,6 +1,8 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Raki
4
- VERSION = '0.0.3' # 2020-07-14
5
- # VERSION = '0.0.2'
2
+ VERSION = "0.1.1" # 2023-04-26
3
+ # VERSION = "0.1.0" # 2021-11-03
4
+ # VERSION = "0.0.5" # 2021-07-01
5
+ # VERSION = '0.0.4' # 2021-06-25
6
+ # VERSION = '0.0.3' # 2020-07-14
7
+ # VERSION = '0.0.2'
6
8
  end
@@ -1,14 +1,8 @@
1
- # frozen_string_literal: true
2
-
3
- # Raki is freely distributable under the terms of an MIT-style license.
4
- # See MIT-LICENSE or https://opensource.org/licenses/MIT.
5
-
6
- # The Raki main module, serving as a namespace for all core Raki
7
- # modules and classes.
8
- #
9
- # All modules meant for use in your application are <tt>autoload</tt>ed here,
10
- # so it should be enough just to <tt>require 'rack'</tt> in your code.
11
-
12
1
  module Raki
13
- VERSION = '0.0.2'
2
+ VERSION = "0.1.1" # 2023-04-26
3
+ # VERSION = "0.1.0" # 2021-11-03
4
+ # VERSION = "0.0.5" # 2021-07-01
5
+ # VERSION = '0.0.4' # 2021-06-25
6
+ # VERSION = '0.0.3' # 2020-07-14
7
+ # VERSION = '0.0.2'
14
8
  end
data/lib/raki.rb CHANGED
@@ -1,15 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raki
4
- autoload :Block, 'raki/block'
5
- autoload :Builder, 'raki/builder'
6
- autoload :Cache, 'raki/cache'
7
- autoload :Idem, 'raki/idem'
8
- autoload :Lint, 'raki/lint'
9
- autoload :Merge, 'raki/merge'
10
- autoload :MiddlewareBase, 'raki/middleware_base'
11
- autoload :Nil, 'raki/nil'
12
- autoload :Params, 'raki/params'
13
- autoload :Require, 'raki/require'
14
- autoload :Slice, 'raki/slice'
4
+ autoload :Builder, "raki/builder"
5
+ autoload :Chain, "raki/chain"
6
+ autoload :Idem, "raki/idem"
7
+ autoload :Lint, "raki/lint"
8
+ autoload :Merge, "raki/merge"
9
+ autoload :Middleware, "raki/middleware"
10
+ autoload :Params, "raki/params"
11
+ autoload :Require, "raki/require"
12
+ autoload :Slice, "raki/slice"
13
+
14
+ ZERO = {body: []}
15
+
16
+ class Base
17
+ def initialize(*args)
18
+ @args = args
19
+ end
20
+
21
+ def call(env)
22
+ ZERO
23
+ end
24
+ end
15
25
  end
metadata CHANGED
@@ -1,75 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-14 00:00:00.000000000 Z
11
+ date: 2023-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '13'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '13'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1'
26
+ version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: minitest
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - "~>"
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
- version: '5.0'
33
+ version: '0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - "~>"
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
- version: '5.0'
40
+ version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: minitest-global_expectations
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - "~>"
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
- version: '1'
47
+ version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - "~>"
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: '1'
69
- description: 'Raki is under construction
54
+ version: '0'
55
+ description: |
56
+ Raki enables chaining of objects.
57
+ It is based on the definition of an interface and
58
+ some builders.
70
59
 
71
- '
72
- email: dittmar.krall@matique.de
60
+ Chained Rakis must conforms to the Raki definition.
61
+ email: dittmar.krall@matiq.com
73
62
  executables: []
74
63
  extensions: []
75
64
  extra_rdoc_files: []
@@ -77,22 +66,21 @@ files:
77
66
  - LICENSE
78
67
  - README.md
79
68
  - lib/raki.rb
80
- - lib/raki/block.rb
81
69
  - lib/raki/builder.rb
82
- - lib/raki/cache.rb
70
+ - lib/raki/chain.rb
83
71
  - lib/raki/idem.rb
84
72
  - lib/raki/lint.rb
85
73
  - lib/raki/merge.rb
86
- - lib/raki/middleware_base.rb
87
- - lib/raki/nil.rb
74
+ - lib/raki/middleware.rb
88
75
  - lib/raki/require.rb
89
76
  - lib/raki/slice.rb
90
77
  - lib/raki/version.rb
91
78
  - lib/raki/version.rb.bak
92
- homepage: https://matique.com
79
+ homepage: https://matiq.com
93
80
  licenses:
94
81
  - MIT
95
- metadata: {}
82
+ metadata:
83
+ source_code_uri: https://github.com/matique/raki
96
84
  post_install_message:
97
85
  rdoc_options: []
98
86
  require_paths:
@@ -101,15 +89,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
89
  requirements:
102
90
  - - ">="
103
91
  - !ruby/object:Gem::Version
104
- version: '2.6'
92
+ version: '0'
105
93
  required_rubygems_version: !ruby/object:Gem::Requirement
106
94
  requirements:
107
95
  - - ">="
108
96
  - !ruby/object:Gem::Version
109
97
  version: '0'
110
98
  requirements: []
111
- rubygems_version: 3.0.8
99
+ rubygems_version: 3.4.10
112
100
  signing_key:
113
101
  specification_version: 4
114
- summary: A modular hash interface.
102
+ summary: Kind of chaining objects
115
103
  test_files: []
data/lib/raki/block.rb DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Middleware to execute a Block.
4
- module Raki
5
- class Block < Raki::MiddlewareBase
6
- def call(env)
7
- my_env = env
8
- @block.call(my_env)
9
- @app.call(my_env)
10
- end
11
- end
12
- end
data/lib/raki/cache.rb DELETED
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'crimp'
4
-
5
- # not yet finished
6
- # requires a Rails environment! (see Rails below)
7
- # middleware for caching.
8
-
9
- module Raki
10
- class Cache < Raki::MiddlewareBase
11
- def call(env)
12
- @block&.call(env)
13
- kache(Crimp.signature(env)) {
14
- @app.call(env)
15
- }
16
- end
17
-
18
- private
19
- def kache(key)
20
- # raise 'Missing Rails environment' unless defined?(Rails.cache)
21
- return yield unless defined?(Rails.cache)
22
-
23
- Rails.cache.fetch(key, expires_in: 1.hour) {
24
- yield
25
- }
26
- end
27
- end
28
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Middleware just passing over or returning the params.
4
- module Raki
5
- class MiddlewareBase
6
- def initialize(app = nil, *args, &block)
7
- @app = app
8
- @args = args
9
- @block = block
10
- end
11
-
12
- def call(_env)
13
- raise '#call must be overwritten by a middleware raki'
14
- end
15
- end
16
- end
data/lib/raki/nil.rb DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Returns a Raki zero.
4
- module Raki
5
- class Nil < Raki::MiddlewareBase
6
- def call(_env)
7
- @block&.call(env)
8
- @app&.call(env)
9
-
10
- [200, {}, []]
11
- end
12
- end
13
- end