web_pipe 0.9.0 → 0.13.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 +4 -4
- data/.gitignore +5 -1
- data/.rubocop.yml +15 -0
- data/.travis.yml +5 -4
- data/CHANGELOG.md +33 -0
- data/Gemfile +5 -0
- data/README.md +40 -37
- data/docs/composing_applications.md +2 -2
- data/docs/connection_struct.md +12 -1
- data/docs/connection_struct/configuring_the_connection_struct.md +2 -2
- data/docs/extensions/dry_schema.md +1 -1
- data/docs/extensions/dry_view.md +1 -1
- data/docs/extensions/params.md +4 -3
- data/docs/extensions/rails.md +116 -0
- data/docs/extensions/router_params.md +1 -1
- data/docs/introduction.md +5 -5
- data/docs/plugging_operations.md +1 -1
- data/docs/recipes/dry_rb_integration.md +2 -2
- data/docs/recipes/hanami_router_integration.md +1 -1
- data/docs/recipes/using_all_restful_methods.md +1 -1
- data/docs/using_rack_middlewares.md +1 -1
- data/lib/web_pipe.rb +6 -2
- data/lib/web_pipe/conn_support/builder.rb +2 -1
- data/lib/web_pipe/conn_support/composition.rb +2 -2
- data/lib/web_pipe/conn_support/errors.rb +6 -6
- data/lib/web_pipe/conn_support/headers.rb +2 -4
- data/lib/web_pipe/dsl/builder.rb +1 -0
- data/lib/web_pipe/dsl/class_context.rb +1 -0
- data/lib/web_pipe/dsl/dsl_context.rb +1 -1
- data/lib/web_pipe/dsl/instance_methods.rb +2 -0
- data/lib/web_pipe/extensions/container/container.rb +1 -0
- data/lib/web_pipe/extensions/cookies/cookies.rb +1 -0
- data/lib/web_pipe/extensions/dry_schema/dry_schema.rb +1 -0
- data/lib/web_pipe/extensions/dry_view/dry_view.rb +5 -2
- data/lib/web_pipe/extensions/flash/flash.rb +1 -0
- data/lib/web_pipe/extensions/params/params.rb +4 -3
- data/lib/web_pipe/extensions/params/params/transf.rb +4 -3
- data/lib/web_pipe/extensions/rails/rails.rb +154 -0
- data/lib/web_pipe/extensions/redirect/redirect.rb +1 -0
- data/lib/web_pipe/extensions/session/session.rb +1 -0
- data/lib/web_pipe/extensions/url/url.rb +1 -0
- data/lib/web_pipe/plug.rb +3 -3
- data/lib/web_pipe/rack_support/middleware_specification.rb +4 -3
- data/lib/web_pipe/version.rb +1 -1
- data/web_pipe.gemspec +7 -4
- metadata +49 -28
- data/docs/_config.yml +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a993e68cff01cb6b0ef493b6bdf3207e62a7baca650302c9f65024f3981c18a
|
4
|
+
data.tar.gz: dc94f7dfabc97ad712a058f725e85831c38fe2658f42adeca3243b29f10273f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e5925278ef21f20b3c9b8ae25f7bd614c7e17b278693f3521f018cefe1acd1ef63116aba61a9722bc1f4d5b98bfbeb56a6e03d0d246ac359aa595e4c451f6eb
|
7
|
+
data.tar.gz: baf191023d9a19ed7facfc77f3107db45e2adb1949a25e4fc306b0a9f85e061e474fc557848beb469aaf0c5ad0446918b9c285b63cc5501bf21d31c19229878c
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [0.13.0] - 2021-01-15
|
8
|
+
### Added
|
9
|
+
- **BREAKING**. Ruby 2.5 deprecated.
|
10
|
+
[#40](https://github.com/waiting-for-dev/web_pipe/pull/40)
|
11
|
+
- Ruby 3.0 supported.
|
12
|
+
[#41](https://github.com/waiting-for-dev/web_pipe/pull/41)
|
13
|
+
|
14
|
+
## [0.12.1] - 2019-03-18
|
15
|
+
### Fixed
|
16
|
+
- Update rake to fix security alert
|
17
|
+
|
18
|
+
## [0.12.0] - 2019-12-30
|
19
|
+
### Added
|
20
|
+
- **BREAKING**. Ruby 2.4 deprecated.
|
21
|
+
- Ruby 2.7 supported.
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
- Ruby 2.7 argument warnings.
|
25
|
+
[[#38]](https://github.com/waiting-for-dev/web_pipe/pull/38)
|
26
|
+
|
27
|
+
## [0.11.0] - 2019-12-28
|
28
|
+
### Added
|
29
|
+
- **BREAKING**. `dry-transformer` (former `transproc`) dependency is now
|
30
|
+
optional.
|
31
|
+
[[#37]](https://github.com/waiting-for-dev/web_pipe/pull/37)
|
32
|
+
- Switch `transproc` dependency to `dry-transformer`.
|
33
|
+
[[#37]](https://github.com/waiting-for-dev/web_pipe/pull/37)
|
34
|
+
|
35
|
+
## [0.10.0] - 2019-11-15
|
36
|
+
### Added
|
37
|
+
- `:rails` extension integrating with Ruby On Rails.
|
38
|
+
[[#36]](https://github.com/waiting-for-dev/web_pipe/pull/36)
|
39
|
+
|
7
40
|
## [0.9.0] - 2019-08-31
|
8
41
|
### Added
|
9
42
|
- Comprehensive documentation.
|
data/Gemfile
CHANGED
@@ -6,3 +6,8 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
|
7
7
|
# Specify your gem's dependencies in web_pipe.gemspec
|
8
8
|
gemspec
|
9
|
+
|
10
|
+
# TODO: Remove when dry-rb 0.8 is released (ruby 3.0 support)
|
11
|
+
group :development do
|
12
|
+
gem 'dry-view', github: 'dry-rb/dry-view', ref: 'a048e32'
|
13
|
+
end
|
data/README.md
CHANGED
@@ -10,40 +10,44 @@ In order to use in conjunction with [dry-rb](https://dry-rb.org/)
|
|
10
10
|
ecosystem, see also
|
11
11
|
[`dry-web-web_pipe`](https://github.com/waiting-for-dev/dry-web-web_pipe).
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
1. [
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
1. [
|
21
|
-
1. [Injecting
|
22
|
-
1. [Composing
|
23
|
-
1. [
|
24
|
-
1. [
|
25
|
-
1. [
|
26
|
-
|
27
|
-
|
28
|
-
1. [
|
29
|
-
1. [
|
30
|
-
1. [
|
31
|
-
|
32
|
-
1. [
|
33
|
-
1. [
|
34
|
-
1. [
|
35
|
-
|
36
|
-
1. [
|
37
|
-
1. [
|
38
|
-
1. [
|
39
|
-
1. [
|
40
|
-
1. [
|
41
|
-
1. [
|
42
|
-
1. [
|
13
|
+
If you want to use it with a Rails project, don't miss docs for the [rails
|
14
|
+
extension](docs/extensions/rails.md).
|
15
|
+
|
16
|
+
1. [Introduction](docs/introduction.md)
|
17
|
+
1. [Design model](docs/design_model.md)
|
18
|
+
1. [Building a rack application](docs/building_a_rack_application.md)
|
19
|
+
1. [Plugging operations](docs/plugging_operations.md)
|
20
|
+
1. [Resolving operations](docs/plugging_operations/resolving_operations.md)
|
21
|
+
1. [Injecting operations](docs/plugging_operations/injecting_operations.md)
|
22
|
+
1. [Composing operations](docs/plugging_operations/composing_operations.md)
|
23
|
+
1. [Using rack middlewares](docs/using_rack_middlewares.md)
|
24
|
+
1. [Injecting middlewares](docs/using_rack_middlewares/injecting_middlewares.md)
|
25
|
+
1. [Composing middlewares](docs/using_rack_middlewares/composing_middlewares.md)
|
26
|
+
1. [Composing applications](docs/composing_applications.md)
|
27
|
+
1. [Connection struct](docs/connection_struct.md)
|
28
|
+
1. [Sharing data downstream](docs/connection_struct/sharing_data_downstream.md)
|
29
|
+
1. [Halting the pipe](docs/connection_struct/halting_the_pipe.md)
|
30
|
+
1. [Configuring the connection struct](docs/connection_struct/configuring_the_connection_struct.md)
|
31
|
+
1. [DSL free usage](docs/dsl_free_usage.md)
|
32
|
+
1. [Plugs](docs/plugs.md)
|
33
|
+
1. [Config](docs/plugs/config.md)
|
34
|
+
1. [ContentType](docs/plugs/content_type.md)
|
35
|
+
1. [Extensions](docs/extensions.md)
|
36
|
+
1. [Container](docs/extensions/container.md)
|
37
|
+
1. [Cookies](docs/extensions/cookies.md)
|
38
|
+
1. [Flash](docs/extensions/flash.md)
|
39
|
+
1. [Dry Schema](docs/extensions/dry_schema.md)
|
40
|
+
1. [Dry View](docs/extensions/dry_view.md)
|
41
|
+
1. [Params](docs/extensions/params.md)
|
42
|
+
1. [Rails](docs/extensions/rails.md)
|
43
|
+
1. [Redirect](docs/extensions/redirect.md)
|
44
|
+
1. [Router params](docs/extensions/router_params.md)
|
45
|
+
1. [Session](docs/extensions/session.md)
|
46
|
+
1. [URL](docs/extensions/url.md)
|
43
47
|
1. Recipes
|
44
|
-
1. [dry-rb integration](
|
45
|
-
1. [hanami-router integration](
|
46
|
-
1. [Using all RESTful methods](
|
48
|
+
1. [dry-rb integration](docs/recipes/dry_rb_integration.md)
|
49
|
+
1. [hanami-router integration](docs/recipes/hanami_router_integration.md)
|
50
|
+
1. [Using all RESTful methods](docs/recipes/using_all_restful_methods.md)
|
47
51
|
|
48
52
|
```ruby
|
49
53
|
# config.ru
|
@@ -88,10 +92,9 @@ run HelloApp.new
|
|
88
92
|
|
89
93
|
## Current status
|
90
94
|
|
91
|
-
`web_pipe` is in active development
|
92
|
-
|
93
|
-
|
94
|
-
mechanism, are still missing.
|
95
|
+
`web_pipe` is in active development but ready to be used in any environment.
|
96
|
+
Common needs are covered and while you can expect some API changes, they won't
|
97
|
+
be very important and everything will be properly documented.
|
95
98
|
|
96
99
|
## Contributing
|
97
100
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Composing applications
|
2
2
|
|
3
3
|
Previously, we have seen how to [compose plugged
|
4
|
-
operations](
|
5
|
-
rack middlewares](
|
4
|
+
operations](plugging_operations/composing_operations.md) and how to [compose
|
5
|
+
rack middlewares](using_rack_middlewares/composing_middlewares.md). The logical
|
6
6
|
next step is thinking about composing `web_pipe` applications, which is exactly
|
7
7
|
the same as composing both operations and middlewares at the same time.
|
8
8
|
|
data/docs/connection_struct.md
CHANGED
@@ -69,9 +69,20 @@ run DummyApp.new
|
|
69
69
|
|
70
70
|
As you can see, default available features are the very minimal to read from a
|
71
71
|
request and to write a response. However, you can pick from several
|
72
|
-
(extensions)[
|
72
|
+
(extensions)[extensions.md] which will make your life much easier.
|
73
73
|
|
74
74
|
Immutability is a core design principle in `web_pipe`. All methods in
|
75
75
|
`WebPipe::Conn` which are used to add data to it (both in core behaviour and
|
76
76
|
extensions) return a fresh new instance. It also makes possible chaining
|
77
77
|
methods in a very readable way.
|
78
|
+
|
79
|
+
You can use ruby 2.7 pattern matching on a `WebPipe::Conn` struct, as in:
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
# GET http://example.org
|
83
|
+
conn in { request_method:, host: }
|
84
|
+
request_method
|
85
|
+
# :get
|
86
|
+
host
|
87
|
+
# 'example.org'
|
88
|
+
```
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Configuring the connection struct
|
2
2
|
|
3
|
-
[Extensions](
|
3
|
+
[Extensions](../extensions.md) add extra behaviour to the connection struct.
|
4
4
|
Sometimes they need some user provided value to work properly or they may allow
|
5
5
|
some tweak depending on user needs.
|
6
6
|
|
@@ -10,7 +10,7 @@ what they need is `#config` attribute, which is very similar to `#bag` except
|
|
10
10
|
for its more private intention.
|
11
11
|
|
12
12
|
In order to interact with `#config`, you can use the method `#add_config(key,
|
13
|
-
value)` or [`Config` plug](
|
13
|
+
value)` or [`Config` plug](../plugs/config.md).
|
14
14
|
|
15
15
|
```ruby
|
16
16
|
class MyApp
|
@@ -9,7 +9,7 @@ pipe of operations. It takes as arguments a `dry-schema` schema and a handler.
|
|
9
9
|
On success, it makes output available at `WebPipe::Conn#sanitized_params`. On
|
10
10
|
error, it calls given handler with the connection struct and validation result.
|
11
11
|
|
12
|
-
This extension automatically loads [`:params` extension](
|
12
|
+
This extension automatically loads [`:params` extension](params.md),
|
13
13
|
as it takes `WebPipe::Conn#params` as input for the validation schema.
|
14
14
|
|
15
15
|
Instead of providing an error handler as the second argument for the plug, you
|
data/docs/extensions/dry_view.md
CHANGED
data/docs/extensions/params.md
CHANGED
@@ -12,9 +12,10 @@ conn.params # => { 'foo' => 'bar' }
|
|
12
12
|
```
|
13
13
|
|
14
14
|
You can configure a stack of transformations to be applied to the
|
15
|
-
parameter hash. For that, we lean on [`
|
16
|
-
gem](https://github.com/
|
17
|
-
Gemfile). All hash transformations in `
|
15
|
+
parameter hash. For that, we lean on [`dry-transformer`
|
16
|
+
gem](https://github.com/dry-rb/dry-transformer) (you have to add it yourself to
|
17
|
+
your Gemfile). All hash transformations in `dry-transformer` are available by
|
18
|
+
default.
|
18
19
|
|
19
20
|
Transformations must be configured under `:param_transformations`
|
20
21
|
key:
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# Rails
|
2
|
+
|
3
|
+
The first two things to keep in mind in order to integrate with Rails is
|
4
|
+
that `WebPipe` instances are Rack applications and that rails router can
|
5
|
+
perfectly [dispatch to a rack application](https://guides.rubyonrails.org/routing.html#routing-to-rack-applications). For example:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
# config/routes.rb
|
9
|
+
get '/my_route', to: MyRoute.new
|
10
|
+
|
11
|
+
# app/controllers/my_route.rb
|
12
|
+
class MyRoute
|
13
|
+
include WebPipe
|
14
|
+
|
15
|
+
plug :set_response_body
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def set_response_body(conn)
|
20
|
+
conn.set_response_body('Hello, World!')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
In order to do something like the previous example you don't need to enable
|
26
|
+
this extension. Notice that rails took care of dispatching the request to our
|
27
|
+
`WebPipe` rack application, which was then responsible for generating the
|
28
|
+
response. In this case, it used a simple call to `#set_response_body`.
|
29
|
+
|
30
|
+
It's quite possible that you don't need more than that in terms of rails
|
31
|
+
integration. Of course, surely you want something more elaborate to generate
|
32
|
+
responses. For that, you can use the view or template system you like. One
|
33
|
+
option that will play specially well here is
|
34
|
+
[`dry-view`](https://dry-rb.org/gems/dry-view/), which
|
35
|
+
[integrates](https://github.com/dry-rb/dry-view/tree/master/examples/rails)
|
36
|
+
itself easily with Rails. Furthermore, we have a tailored `dry_view`
|
37
|
+
[extension](https://waiting-for-dev.github.io/web_pipe/docs/extensions/dry_view.html).
|
38
|
+
|
39
|
+
You need to use `:rails` extension if:
|
40
|
+
|
41
|
+
- You want to use `action_view` as rendering system.
|
42
|
+
- You want to use rails url helpers from your `WebPipe` application.
|
43
|
+
- You want to use controller helpers from your `WebPipe` application.
|
44
|
+
|
45
|
+
Rails responsibilities for controlling the request/response cycle and the
|
46
|
+
rendering process are a little bit tangled. For this reason, even if you
|
47
|
+
want to use `WebPipe` applications instead of Rails controller actions you
|
48
|
+
still have to use the typical top `ApplicationController` in order to define
|
49
|
+
some behaviour for the view layer:
|
50
|
+
|
51
|
+
- Which layout is applied to the template.
|
52
|
+
- Which helpers will become available to the templates.
|
53
|
+
|
54
|
+
By default, the controller in use is `ActionController::Base`, which means that
|
55
|
+
no layout is applied and only built-in helpers (for example,
|
56
|
+
`number_as_currency`) are available. You can change it via the
|
57
|
+
`:rails_controller` configuration option.
|
58
|
+
|
59
|
+
The main method that this extension adds to `WebPipe::Conn` is `#render`,
|
60
|
+
which just delegates to the [Rails
|
61
|
+
implementation](https://api.rubyonrails.org/v6.0.1/classes/ActionController/Renderer.html)
|
62
|
+
as you'd do in a typical rails controller. Remember that you can provide
|
63
|
+
template instance variables through the keyword `:assigns`.
|
64
|
+
|
65
|
+
```ruby
|
66
|
+
# config/routes.rb
|
67
|
+
get '/articles', to: ArticlesIndex.new
|
68
|
+
|
69
|
+
# app/controllers/application_controller.rb
|
70
|
+
class ApplicationController < ActionController::Base
|
71
|
+
# By default uses the layout in `layouts/application`
|
72
|
+
end
|
73
|
+
|
74
|
+
# app/controllers/articles_index.rb
|
75
|
+
require 'web_pipe/plugs/config'
|
76
|
+
|
77
|
+
WebPipe.load_extensions(:rails) # You can put it in an initializer
|
78
|
+
|
79
|
+
class ArticlesIndex
|
80
|
+
include WebPipe
|
81
|
+
|
82
|
+
plug :config, WebPipe::Plugs::Config.(
|
83
|
+
rails_controller: ApplicationController
|
84
|
+
)
|
85
|
+
|
86
|
+
def render(conn)
|
87
|
+
conn.render(
|
88
|
+
template: 'articles/index',
|
89
|
+
assigns: { articles: Article.all }
|
90
|
+
)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
Notice that we used the keyword `template:` instead of taking advantage of
|
96
|
+
automatic template lookup. We did that way so that we don't have to create also
|
97
|
+
an `ArticlesController`, but it's up to you. In the case of having an
|
98
|
+
`ArticlesController` we could just do `conn.render(:index, assigns: {
|
99
|
+
articles: Article.all })`.
|
100
|
+
|
101
|
+
Besides, this extension provides with two other methods:
|
102
|
+
|
103
|
+
- `url_helpers` returns Rails router [url
|
104
|
+
helpers](https://api.rubyonrails.org/v6.0.1/classes/ActionView/Helpers/UrlHelper.html).
|
105
|
+
- `helpers` returns the associated [controller
|
106
|
+
helpers](https://api.rubyonrails.org/classes/ActionController/Helpers.html).
|
107
|
+
|
108
|
+
In all the examples we have supposed that we are putting `WebPipe` applications
|
109
|
+
within `app/controllers/` directory. However, remember you can put them
|
110
|
+
wherever you like as long as you respect rails [`autoload_paths`](https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths).
|
111
|
+
|
112
|
+
Here you have a link to a very simple and contrived example of a rails
|
113
|
+
application integrating `web_pipe`:
|
114
|
+
|
115
|
+
https://github.com/waiting-for-dev/rails-web_pipe
|
116
|
+
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
This extension can be used in order to merge placeholder parameters
|
4
4
|
that usually routers support (like `get /users/:id`) to the parameters hash
|
5
|
-
added through [`:params` extension](
|
5
|
+
added through [`:params` extension](params.md) (which is
|
6
6
|
automatically loaded).
|
7
7
|
|
8
8
|
What this extension does is adding a transformation function to the registry
|
data/docs/introduction.md
CHANGED
@@ -12,17 +12,17 @@ with [dry-rb](https://dry-rb.org/) ecosystem. If it helps, you can think of it
|
|
12
12
|
as a decoupled web controller (as the C in MVC).
|
13
13
|
|
14
14
|
`web_pipe` applications are built as a [pipe of
|
15
|
-
operations](
|
16
|
-
struct](
|
15
|
+
operations](design_model.md) on an [immutable
|
16
|
+
struct](connection_struct.md). The struct is automatically created
|
17
17
|
with data from an HTTP request, and it contains methods to
|
18
18
|
incrementally add data to generate an HTTP response. The pipe can
|
19
|
-
be [halted](
|
19
|
+
be [halted](connection_struct/halting_the_pipe.md) at any moment,
|
20
20
|
taking away from all operations downstream any chance to modify the
|
21
21
|
response.
|
22
22
|
|
23
23
|
`web_pipe` has a modular design, with only the minimal functionalities needed
|
24
24
|
to build a web application enabled by default. However, it ships with several
|
25
|
-
[extensions](
|
25
|
+
[extensions](extensions.md) to make your life easier.
|
26
26
|
|
27
27
|
Following there is a simple example. It is a web application that will check
|
28
28
|
the value of a `user` parameter. When it is `Alice` or `Joe`, it will kindly
|
@@ -70,4 +70,4 @@ class HelloApp
|
|
70
70
|
end
|
71
71
|
|
72
72
|
run HelloApp.new
|
73
|
-
|
73
|
+
```
|
data/docs/plugging_operations.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
You can plug operations to your application with the DSL method `plug`. The
|
4
4
|
first argument it always takes is a symbol with the name you want
|
5
5
|
to give to the operation (which is needed to allow
|
6
|
-
[injection](
|
6
|
+
[injection](plugging_operations/injecting_operations.md) on
|
7
7
|
initialization).
|
8
8
|
|
9
9
|
```ruby
|
@@ -4,8 +4,8 @@
|
|
4
4
|
[dry-rb](https://dry-rb.org/) ecosystem. It shares same design
|
5
5
|
principles and it ships with some extensions which even make this
|
6
6
|
integration tighter (like
|
7
|
-
[`:dry-view`](
|
8
|
-
[`:dry-schema`](
|
7
|
+
[`:dry-view`](../extensions/dry_view.md) or
|
8
|
+
[`:dry-schema`](../extensions/dry_schema.md) extensions).
|
9
9
|
|
10
10
|
If you want to use `web_pipe` with the rest of dry-rb libraries,
|
11
11
|
your best bet is to use
|
@@ -22,4 +22,4 @@ end
|
|
22
22
|
run router
|
23
23
|
```
|
24
24
|
|
25
|
-
In order to perform [string matching with variables](https://github.com/hanami/router#string-matching-with-variables) you just need to load [`:router_params` extension](
|
25
|
+
In order to perform [string matching with variables](https://github.com/hanami/router#string-matching-with-variables) you just need to load [`:router_params` extension](../extensions/router_params.md).
|
@@ -9,7 +9,7 @@ request method in rack's env if a magical `_method` parameter or
|
|
9
9
|
|
10
10
|
You have to be aware that if you use this middleware within a
|
11
11
|
`web_pipe` application (through [`use` DSL
|
12
|
-
method](
|
12
|
+
method](../using_rack_middlewares.md)) it will have no effect.
|
13
13
|
When your `web_pipe` application takes control of the request it
|
14
14
|
has already gone through the router, which is the one who should
|
15
15
|
read the request method set by rack.
|
@@ -9,7 +9,7 @@ encapsulate them in your application definition.
|
|
9
9
|
In order to add rack middlewares to the stack, you have to use the DSL method
|
10
10
|
`use`. The first argument it takes is a `Symbol` with the name you want to
|
11
11
|
assign to it (which is needed to allow
|
12
|
-
[injection](
|
12
|
+
[injection](using_rack_middlewares/injecting_middlewares.md) on
|
13
13
|
initialization). Then, it must follow the middleware class and any option it
|
14
14
|
may need:
|
15
15
|
|
data/lib/web_pipe.rb
CHANGED
@@ -14,8 +14,8 @@ module WebPipe
|
|
14
14
|
klass.include(call)
|
15
15
|
end
|
16
16
|
|
17
|
-
def self.call(
|
18
|
-
DSL::Builder.new(
|
17
|
+
def self.call(**opts)
|
18
|
+
DSL::Builder.new(**opts)
|
19
19
|
end
|
20
20
|
|
21
21
|
register_extension :cookies do
|
@@ -51,6 +51,10 @@ module WebPipe
|
|
51
51
|
require 'web_pipe/extensions/params/params'
|
52
52
|
end
|
53
53
|
|
54
|
+
register_extension :rails do
|
55
|
+
require 'web_pipe/extensions/rails/rails'
|
56
|
+
end
|
57
|
+
|
54
58
|
register_extension :session do
|
55
59
|
require 'web_pipe/extensions/session/session'
|
56
60
|
end
|
@@ -15,12 +15,12 @@ module WebPipe
|
|
15
15
|
# @param env [Types::Env] Rack's env
|
16
16
|
#
|
17
17
|
# @return [Conn::Ongoing]
|
18
|
+
# rubocop:disable Metrics/MethodLength
|
18
19
|
def self.call(env)
|
19
20
|
rr = Rack::Request.new(env)
|
20
21
|
Conn::Ongoing.new(
|
21
22
|
request: rr,
|
22
23
|
env: env,
|
23
|
-
|
24
24
|
scheme: rr.scheme.to_sym,
|
25
25
|
request_method: rr.request_method.downcase.to_sym,
|
26
26
|
host: rr.host,
|
@@ -33,6 +33,7 @@ module WebPipe
|
|
33
33
|
request_headers: Headers.extract(env)
|
34
34
|
)
|
35
35
|
end
|
36
|
+
# rubocop:enable Metrics/MethodLength
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
@@ -28,11 +28,11 @@ module WebPipe
|
|
28
28
|
# @param returned [Any] What was returned from the {Operation}
|
29
29
|
def initialize(returned)
|
30
30
|
super(
|
31
|
-
<<~
|
31
|
+
<<~MSG
|
32
32
|
An operation returned +#{returned.inspect}+. To be valid,
|
33
33
|
an operation must return whether a
|
34
34
|
WebPipe::Conn::Ongoing or a WebPipe::Conn::Halted.
|
35
|
-
|
35
|
+
MSG
|
36
36
|
)
|
37
37
|
end
|
38
38
|
end
|
@@ -8,9 +8,9 @@ module WebPipe
|
|
8
8
|
# @param key [Any] Key not found in the bag
|
9
9
|
def initialize(key)
|
10
10
|
super(
|
11
|
-
<<~
|
11
|
+
<<~MSG
|
12
12
|
Bag does not contain a key with name +#{key}+.
|
13
|
-
|
13
|
+
MSG
|
14
14
|
)
|
15
15
|
end
|
16
16
|
end
|
@@ -21,9 +21,9 @@ module WebPipe
|
|
21
21
|
# @param key [Any] Key not found in config
|
22
22
|
def initialize(key)
|
23
23
|
super(
|
24
|
-
<<~
|
24
|
+
<<~MSG
|
25
25
|
Config does not contain a key with name +#{key}+.
|
26
|
-
|
26
|
+
MSG
|
27
27
|
)
|
28
28
|
end
|
29
29
|
end
|
@@ -36,10 +36,10 @@ module WebPipe
|
|
36
36
|
# @param gem [String] Gem name for the middleware
|
37
37
|
def initialize(feature, middleware, gem)
|
38
38
|
super(
|
39
|
-
<<~
|
39
|
+
<<~MSG
|
40
40
|
In order to use #{feature} you must use #{middleware} middleware:
|
41
41
|
https://rubygems.org/gems/#{gem}
|
42
|
-
|
42
|
+
MSG
|
43
43
|
)
|
44
44
|
end
|
45
45
|
end
|
@@ -25,7 +25,7 @@ module WebPipe
|
|
25
25
|
Hash[
|
26
26
|
env
|
27
27
|
.select { |k, _v| k.start_with?('HTTP_') }
|
28
|
-
.map { |k, v| pair(k[5
|
28
|
+
.map { |k, v| pair(k[5..], v) }
|
29
29
|
.concat(
|
30
30
|
env
|
31
31
|
.select { |k, _v| HEADERS_AS_CGI.include?(k) }
|
@@ -99,9 +99,7 @@ module WebPipe
|
|
99
99
|
#
|
100
100
|
# @see #normalize_key
|
101
101
|
def self.normalize(headers)
|
102
|
-
|
103
|
-
headers.map { |k, v| [normalize_key(k), v] }
|
104
|
-
]
|
102
|
+
headers.transform_keys { |k| normalize_key(k) }
|
105
103
|
end
|
106
104
|
end
|
107
105
|
end
|
data/lib/web_pipe/dsl/builder.rb
CHANGED
@@ -48,6 +48,7 @@ module WebPipe
|
|
48
48
|
# @return [Array<RackSupport::Middlewares>]
|
49
49
|
attr_reader :middlewares
|
50
50
|
|
51
|
+
# rubocop:disable Metrics/AbcSize
|
51
52
|
def initialize(injects = EMPTY_INJECTIONS)
|
52
53
|
@injections = Injections[injects]
|
53
54
|
container = self.class.container
|
@@ -60,6 +61,7 @@ module WebPipe
|
|
60
61
|
app = App.new(operations)
|
61
62
|
@rack_app = RackSupport::AppWithMiddlewares.new(middlewares, app)
|
62
63
|
end
|
64
|
+
# rubocop:enable Metrics/AbcSize
|
63
65
|
|
64
66
|
# Expected interface for rack.
|
65
67
|
#
|
@@ -4,6 +4,7 @@ require 'web_pipe/types'
|
|
4
4
|
require 'web_pipe/conn'
|
5
5
|
require 'dry/view'
|
6
6
|
|
7
|
+
#:nodoc:
|
7
8
|
module WebPipe
|
8
9
|
# Integration with `dry-view` rendering system.
|
9
10
|
#
|
@@ -125,7 +126,7 @@ module WebPipe
|
|
125
126
|
|
126
127
|
set_response_body(
|
127
128
|
view_instance.call(
|
128
|
-
view_input
|
129
|
+
**view_input
|
129
130
|
).to_str
|
130
131
|
)
|
131
132
|
end
|
@@ -145,7 +146,9 @@ module WebPipe
|
|
145
146
|
.config
|
146
147
|
.default_context
|
147
148
|
.with(
|
148
|
-
fetch_config(
|
149
|
+
**fetch_config(
|
150
|
+
VIEW_CONTEXT_KEY, DEFAULT_VIEW_CONTEXT
|
151
|
+
).call(self)
|
149
152
|
)
|
150
153
|
kwargs.merge(context: context)
|
151
154
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'web_pipe/types'
|
4
4
|
require 'web_pipe/extensions/params/params/transf'
|
5
5
|
|
6
|
+
#:nodoc:
|
6
7
|
module WebPipe
|
7
8
|
# Adds a {Conn#params} method which can perform any number of
|
8
9
|
# transformations to the request parameters.
|
@@ -14,9 +15,9 @@ module WebPipe
|
|
14
15
|
# # http://www.example.com?foo=bar
|
15
16
|
# conn.params #=> { 'foo' => 'bar' }
|
16
17
|
#
|
17
|
-
# Further processing can be specified thanks to `
|
18
|
+
# Further processing can be specified thanks to `dry-transformer` gem (you
|
18
19
|
# need to add it yourself to the Gemfile). All hash transformations
|
19
|
-
# in `
|
20
|
+
# in `dry-transformer` are available:
|
20
21
|
#
|
21
22
|
# @example
|
22
23
|
# # http://www.example.com?foo=bar
|
@@ -65,7 +66,7 @@ module WebPipe
|
|
65
66
|
# conn.
|
66
67
|
# params(fake) #=> { fake: :params }
|
67
68
|
#
|
68
|
-
# @see https://github.com/
|
69
|
+
# @see https://github.com/dry-rb/dry-transformer
|
69
70
|
module Params
|
70
71
|
# Key where configured transformations are set
|
71
72
|
PARAM_TRANSFORMATION_KEY = :param_transformations
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'dry/transformer'
|
4
4
|
|
5
5
|
module WebPipe
|
6
6
|
module Params
|
7
|
+
# Parameter transformations from dry-transformer.
|
7
8
|
module Transf
|
8
|
-
extend
|
9
|
+
extend Dry::Transformer::Registry
|
9
10
|
|
10
|
-
import
|
11
|
+
import Dry::Transformer::HashTransformations
|
11
12
|
|
12
13
|
def self.id(params)
|
13
14
|
params
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'web_pipe/conn'
|
4
|
+
|
5
|
+
#:nodoc:
|
6
|
+
module WebPipe
|
7
|
+
# Integrates with Rails framework.
|
8
|
+
#
|
9
|
+
# The first two things to keep in mind in order to integrate with Rails is
|
10
|
+
# that {WebPipe} instances are Rack applications and that rails router can
|
11
|
+
# perfectly dispatch to a rack application. For example:
|
12
|
+
#
|
13
|
+
# ```ruby
|
14
|
+
# # config/routes.rb
|
15
|
+
# get '/my_route', to: MyRoute.new
|
16
|
+
#
|
17
|
+
# # app/controllers/my_route.rb
|
18
|
+
# class MyRoute
|
19
|
+
# include WebPipe
|
20
|
+
#
|
21
|
+
# plug :set_response_body
|
22
|
+
#
|
23
|
+
# private
|
24
|
+
#
|
25
|
+
# def set_response_body(conn)
|
26
|
+
# conn.set_response_body('Hello, World!')
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
# ```
|
30
|
+
#
|
31
|
+
# In order to do something like the previous example you don't need to enable
|
32
|
+
# this extension. Notice that rails took care of dispatching the request to
|
33
|
+
# our {WebPipe} rack application, which was then responsible for generating the
|
34
|
+
# response. In this case, it used a simple call to
|
35
|
+
# {WebPipe::Conn#set_response_body}.
|
36
|
+
#
|
37
|
+
# It's quite possible that you don't need more than that in terms of rails
|
38
|
+
# integration. Of course, surely you want something more elaborate to generate
|
39
|
+
# responses. For that, you can use the view or template system you like. One
|
40
|
+
# option that will play specially well here is `dry-view`, which integrates
|
41
|
+
# itself easily with Rails. Furthermore, we have a tailored `dry_view`
|
42
|
+
# extension.
|
43
|
+
#
|
44
|
+
# You need to use `:rails` extension if:
|
45
|
+
#
|
46
|
+
# - You want to use `action_view` as rendering system.
|
47
|
+
# - You want to use rails url helpers from your {WebPipe} application.
|
48
|
+
# - You want to use controller helpers from your {WebPipe} application.
|
49
|
+
#
|
50
|
+
# Rails responsibilities for controlling the request/response cycle and the
|
51
|
+
# rendering process are a little bit tangled. For this reason, even if you
|
52
|
+
# want to use {WebPipe} applications instead of Rails controller actions you
|
53
|
+
# still have to use the typical top `ApplicationController` in order to define
|
54
|
+
# some behaviour for the view layer:
|
55
|
+
#
|
56
|
+
# - Which layout is applied to the template.
|
57
|
+
# - Which helpers will become available to the templates.
|
58
|
+
#
|
59
|
+
# By default, the controller in use is `ActionController::Base`, which means
|
60
|
+
# that no layout is applied and only built-in helpers (for example,
|
61
|
+
# `number_as_currency`) are available. You can change it via the
|
62
|
+
# `:rails_controller` configuration option.
|
63
|
+
#
|
64
|
+
# The main method that this extension adds to {WebPipe::Conn} is `#render`,
|
65
|
+
# which just delegates to the Rails implementation as you'd do in a typical
|
66
|
+
# rails controller. Remember that you can provide template instance variables
|
67
|
+
# through the keyword `:assigns`.
|
68
|
+
#
|
69
|
+
# ```ruby
|
70
|
+
# # config/routes.rb
|
71
|
+
# get '/articles', to: ArticlesIndex.new
|
72
|
+
#
|
73
|
+
# # app/controllers/application_controller.rb
|
74
|
+
# class ApplicationController < ActionController::Base
|
75
|
+
# # By default uses the layout in `layouts/application`
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# # app/controllers/articles_index.rb
|
79
|
+
# require 'web_pipe/plugs/config'
|
80
|
+
#
|
81
|
+
#
|
82
|
+
# WebPipe.load_extensions(:rails) # You can put it in an initializer
|
83
|
+
#
|
84
|
+
# class ArticlesIndex
|
85
|
+
# include WebPipe
|
86
|
+
#
|
87
|
+
# plug :config, WebPipe::Plugs::Config.(
|
88
|
+
# rails_controller: ApplicationController
|
89
|
+
# )
|
90
|
+
#
|
91
|
+
# def render(conn)
|
92
|
+
# conn.render(
|
93
|
+
# template: 'articles/index',
|
94
|
+
# assigns: { articles: Article.all }
|
95
|
+
# )
|
96
|
+
# end
|
97
|
+
# end
|
98
|
+
# ```
|
99
|
+
#
|
100
|
+
# Notice that we used the keyword `template:` instead of taking advantage of
|
101
|
+
# automatic template lookup. We did that way so that we don't have to create
|
102
|
+
# also an `ArticlesController`, but it's up to you. In the case of having an
|
103
|
+
# `ArticlesController` we could just do `conn.render(:index, assigns: {
|
104
|
+
# articles: Article.all })`.
|
105
|
+
#
|
106
|
+
# Besides, this extension provides with two other methods:
|
107
|
+
#
|
108
|
+
# - `url_helpers` returns Rails router url helpers.
|
109
|
+
# - `helpers` returns the associated controller helpers.
|
110
|
+
#
|
111
|
+
# In all the examples we have supposed that we are putting {WebPipe}
|
112
|
+
# applications within `app/controllers/` directory. However, remember you can
|
113
|
+
# put them wherever you like as long as you respect rails `autoload_paths`.
|
114
|
+
#
|
115
|
+
# Here you have a link to a very simple and contrived example of a rails
|
116
|
+
# application integrating `web_pipe`:
|
117
|
+
#
|
118
|
+
# https://github.com/waiting-for-dev/rails-web_pipe
|
119
|
+
#
|
120
|
+
# @see https://guides.rubyonrails.org/routing.html#routing-to-rack-applications
|
121
|
+
# @see https://dry-rb.org/gems/dry-view/
|
122
|
+
# @see https://github.com/dry-rb/dry-view/tree/master/examples/rails
|
123
|
+
# @see https://waiting-for-dev.github.io/web_pipe/docs/extensions/dry_view.html
|
124
|
+
# @see https://api.rubyonrails.org/v6.0.1/classes/ActionController/Renderer.html
|
125
|
+
# @see https://api.rubyonrails.org/v6.0.1/classes/ActionController/Renderer.html
|
126
|
+
# @see https://api.rubyonrails.org/v6.0.1/classes/ActionView/Helpers/UrlHelper.html
|
127
|
+
# @see https://api.rubyonrails.org/classes/ActionController/Helpers.html
|
128
|
+
# @see https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths
|
129
|
+
module Rails
|
130
|
+
def render(*args)
|
131
|
+
set_response_body(
|
132
|
+
rails_controller.renderer.render(*args)
|
133
|
+
)
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see https://devdocs.io/rails~6.0/actioncontroller/helpers
|
137
|
+
def helpers
|
138
|
+
rails_controller.helpers
|
139
|
+
end
|
140
|
+
|
141
|
+
# @see https://api.rubyonrails.org/v6.0.1/classes/ActionView/Helpers/UrlHelper.html
|
142
|
+
def url_helpers
|
143
|
+
::Rails.application.routes.url_helpers
|
144
|
+
end
|
145
|
+
|
146
|
+
private
|
147
|
+
|
148
|
+
def rails_controller
|
149
|
+
config.fetch(:rails_controller, ActionController::Base)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
Conn.include(Rails)
|
154
|
+
end
|
data/lib/web_pipe/plug.rb
CHANGED
@@ -25,11 +25,11 @@ module WebPipe
|
|
25
25
|
# @param name [Any] Name for the plug that can't be resolved
|
26
26
|
def initialize(name)
|
27
27
|
super(
|
28
|
-
<<~
|
28
|
+
<<~MSG
|
29
29
|
Plug with name +#{name}+ is invalid. It must be something
|
30
30
|
callable, an instance method when no operation is given,
|
31
31
|
or something callable registered in the container."
|
32
|
-
|
32
|
+
MSG
|
33
33
|
)
|
34
34
|
end
|
35
35
|
end
|
@@ -83,7 +83,7 @@ module WebPipe
|
|
83
83
|
spec
|
84
84
|
elsif spec.nil?
|
85
85
|
pipe.method(name)
|
86
|
-
elsif container[spec]
|
86
|
+
elsif container[spec].respond_to?(:call)
|
87
87
|
container[spec]
|
88
88
|
else
|
89
89
|
raise InvalidPlugError, name
|
@@ -60,10 +60,11 @@ module WebPipe
|
|
60
60
|
# @return [Array<RackSupport::Middleware>]
|
61
61
|
def call
|
62
62
|
klass = spec[0]
|
63
|
-
options = spec[1
|
64
|
-
|
63
|
+
options = spec[1..] || Types::EMPTY_ARRAY
|
64
|
+
case klass
|
65
|
+
when WebPipe
|
65
66
|
klass.middlewares
|
66
|
-
|
67
|
+
when Class
|
67
68
|
[Middleware.new(middleware: klass, options: options)]
|
68
69
|
end
|
69
70
|
end
|
data/lib/web_pipe/version.rb
CHANGED
data/web_pipe.gemspec
CHANGED
@@ -39,16 +39,19 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_runtime_dependency 'dry-struct', '~> 1.0'
|
40
40
|
spec.add_runtime_dependency 'dry-types', '~> 1.1'
|
41
41
|
spec.add_runtime_dependency 'rack', '~> 2.0'
|
42
|
-
spec.add_runtime_dependency 'transproc', '~> 1.1'
|
43
42
|
|
44
|
-
spec.add_development_dependency 'bundler'
|
43
|
+
spec.add_development_dependency 'bundler'
|
45
44
|
spec.add_development_dependency 'dry-schema', '~> 1.0'
|
46
|
-
spec.add_development_dependency 'dry-
|
45
|
+
spec.add_development_dependency 'dry-transformer', '~> 0.1'
|
46
|
+
# TODO: Readd when dry-rb 0.8 is released (ruby 3.0 support)
|
47
|
+
# spec.add_development_dependency 'dry-view', '~> 0.8'
|
47
48
|
spec.add_development_dependency 'pry-byebug'
|
48
49
|
spec.add_development_dependency 'rack-flash3', '~> 1.0'
|
49
50
|
spec.add_development_dependency 'rack-test', '~> 1.1'
|
50
|
-
spec.add_development_dependency 'rake', '~>
|
51
|
+
spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
|
51
52
|
spec.add_development_dependency 'redcarpet', '~> 3.4'
|
52
53
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
53
54
|
spec.add_development_dependency 'yard', '~> 0.9', '>= 0.9.20'
|
55
|
+
spec.add_development_dependency 'rubocop', '~> 1.8'
|
56
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.1'
|
54
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_pipe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Busqué
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|
@@ -66,34 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: transproc
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.1'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1.1'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: bundler
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
73
|
+
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '0'
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - "
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: dry-schema
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,19 +95,19 @@ dependencies:
|
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '1.0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: dry-
|
98
|
+
name: dry-transformer
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
103
|
+
version: '0.1'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
110
|
+
version: '0.1'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: pry-byebug
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +156,20 @@ dependencies:
|
|
170
156
|
requirements:
|
171
157
|
- - "~>"
|
172
158
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
159
|
+
version: '12.3'
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 12.3.3
|
174
163
|
type: :development
|
175
164
|
prerelease: false
|
176
165
|
version_requirements: !ruby/object:Gem::Requirement
|
177
166
|
requirements:
|
178
167
|
- - "~>"
|
179
168
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
169
|
+
version: '12.3'
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 12.3.3
|
181
173
|
- !ruby/object:Gem::Dependency
|
182
174
|
name: redcarpet
|
183
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,6 +218,34 @@ dependencies:
|
|
226
218
|
- - ">="
|
227
219
|
- !ruby/object:Gem::Version
|
228
220
|
version: 0.9.20
|
221
|
+
- !ruby/object:Gem::Dependency
|
222
|
+
name: rubocop
|
223
|
+
requirement: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - "~>"
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '1.8'
|
228
|
+
type: :development
|
229
|
+
prerelease: false
|
230
|
+
version_requirements: !ruby/object:Gem::Requirement
|
231
|
+
requirements:
|
232
|
+
- - "~>"
|
233
|
+
- !ruby/object:Gem::Version
|
234
|
+
version: '1.8'
|
235
|
+
- !ruby/object:Gem::Dependency
|
236
|
+
name: rubocop-rspec
|
237
|
+
requirement: !ruby/object:Gem::Requirement
|
238
|
+
requirements:
|
239
|
+
- - "~>"
|
240
|
+
- !ruby/object:Gem::Version
|
241
|
+
version: '2.1'
|
242
|
+
type: :development
|
243
|
+
prerelease: false
|
244
|
+
version_requirements: !ruby/object:Gem::Requirement
|
245
|
+
requirements:
|
246
|
+
- - "~>"
|
247
|
+
- !ruby/object:Gem::Version
|
248
|
+
version: '2.1'
|
229
249
|
description:
|
230
250
|
email:
|
231
251
|
- marc@lamarciana.com
|
@@ -235,6 +255,7 @@ extra_rdoc_files: []
|
|
235
255
|
files:
|
236
256
|
- ".gitignore"
|
237
257
|
- ".rspec"
|
258
|
+
- ".rubocop.yml"
|
238
259
|
- ".travis.yml"
|
239
260
|
- ".yardopts"
|
240
261
|
- CHANGELOG.md
|
@@ -244,7 +265,6 @@ files:
|
|
244
265
|
- _config.yml
|
245
266
|
- bin/console
|
246
267
|
- bin/setup
|
247
|
-
- docs/_config.yml
|
248
268
|
- docs/building_a_rack_application.md
|
249
269
|
- docs/composing_applications.md
|
250
270
|
- docs/connection_struct.md
|
@@ -260,6 +280,7 @@ files:
|
|
260
280
|
- docs/extensions/dry_view.md
|
261
281
|
- docs/extensions/flash.md
|
262
282
|
- docs/extensions/params.md
|
283
|
+
- docs/extensions/rails.md
|
263
284
|
- docs/extensions/redirect.md
|
264
285
|
- docs/extensions/router_params.md
|
265
286
|
- docs/extensions/session.md
|
@@ -298,6 +319,7 @@ files:
|
|
298
319
|
- lib/web_pipe/extensions/flash/flash.rb
|
299
320
|
- lib/web_pipe/extensions/params/params.rb
|
300
321
|
- lib/web_pipe/extensions/params/params/transf.rb
|
322
|
+
- lib/web_pipe/extensions/rails/rails.rb
|
301
323
|
- lib/web_pipe/extensions/redirect/redirect.rb
|
302
324
|
- lib/web_pipe/extensions/router_params/router_params.rb
|
303
325
|
- lib/web_pipe/extensions/session/session.rb
|
@@ -334,8 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
334
356
|
- !ruby/object:Gem::Version
|
335
357
|
version: '0'
|
336
358
|
requirements: []
|
337
|
-
|
338
|
-
rubygems_version: 2.7.8
|
359
|
+
rubygems_version: 3.2.3
|
339
360
|
signing_key:
|
340
361
|
specification_version: 4
|
341
362
|
summary: Rack application builder through a pipe of operations on an immutable struct.
|
data/docs/_config.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
theme: jekyll-theme-slate
|