web_pipe 0.9.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -1
  3. data/.rubocop.yml +15 -0
  4. data/.travis.yml +5 -4
  5. data/CHANGELOG.md +33 -0
  6. data/Gemfile +5 -0
  7. data/README.md +40 -37
  8. data/docs/composing_applications.md +2 -2
  9. data/docs/connection_struct.md +12 -1
  10. data/docs/connection_struct/configuring_the_connection_struct.md +2 -2
  11. data/docs/extensions/dry_schema.md +1 -1
  12. data/docs/extensions/dry_view.md +1 -1
  13. data/docs/extensions/params.md +4 -3
  14. data/docs/extensions/rails.md +116 -0
  15. data/docs/extensions/router_params.md +1 -1
  16. data/docs/introduction.md +5 -5
  17. data/docs/plugging_operations.md +1 -1
  18. data/docs/recipes/dry_rb_integration.md +2 -2
  19. data/docs/recipes/hanami_router_integration.md +1 -1
  20. data/docs/recipes/using_all_restful_methods.md +1 -1
  21. data/docs/using_rack_middlewares.md +1 -1
  22. data/lib/web_pipe.rb +6 -2
  23. data/lib/web_pipe/conn_support/builder.rb +2 -1
  24. data/lib/web_pipe/conn_support/composition.rb +2 -2
  25. data/lib/web_pipe/conn_support/errors.rb +6 -6
  26. data/lib/web_pipe/conn_support/headers.rb +2 -4
  27. data/lib/web_pipe/dsl/builder.rb +1 -0
  28. data/lib/web_pipe/dsl/class_context.rb +1 -0
  29. data/lib/web_pipe/dsl/dsl_context.rb +1 -1
  30. data/lib/web_pipe/dsl/instance_methods.rb +2 -0
  31. data/lib/web_pipe/extensions/container/container.rb +1 -0
  32. data/lib/web_pipe/extensions/cookies/cookies.rb +1 -0
  33. data/lib/web_pipe/extensions/dry_schema/dry_schema.rb +1 -0
  34. data/lib/web_pipe/extensions/dry_view/dry_view.rb +5 -2
  35. data/lib/web_pipe/extensions/flash/flash.rb +1 -0
  36. data/lib/web_pipe/extensions/params/params.rb +4 -3
  37. data/lib/web_pipe/extensions/params/params/transf.rb +4 -3
  38. data/lib/web_pipe/extensions/rails/rails.rb +154 -0
  39. data/lib/web_pipe/extensions/redirect/redirect.rb +1 -0
  40. data/lib/web_pipe/extensions/session/session.rb +1 -0
  41. data/lib/web_pipe/extensions/url/url.rb +1 -0
  42. data/lib/web_pipe/plug.rb +3 -3
  43. data/lib/web_pipe/rack_support/middleware_specification.rb +4 -3
  44. data/lib/web_pipe/version.rb +1 -1
  45. data/web_pipe.gemspec +7 -4
  46. metadata +49 -28
  47. data/docs/_config.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc647eb09c8b7eb1d3bcfb910cc55e840285c6b1ab9bd9c69ea9b630f7a116fd
4
- data.tar.gz: 6b667b8e71f1fac8d7c46a8160cbff273c70042bf1cc9b06da60c82a83fea5b2
3
+ metadata.gz: 1a993e68cff01cb6b0ef493b6bdf3207e62a7baca650302c9f65024f3981c18a
4
+ data.tar.gz: dc94f7dfabc97ad712a058f725e85831c38fe2658f42adeca3243b29f10273f9
5
5
  SHA512:
6
- metadata.gz: f52d9d4c5b381d13de8f27ae03e8fc8bfb2cfe7e020d507f934341c9823f7c2cb2d94ebddc500d9337a59c2437c8ae3899e1b7ef942ed5e1cfc073591f8ac56f
7
- data.tar.gz: 0be15319332d738f2b8ff07d7cb9d73583d00bf907e8787a2b8ab0fadc88d235f441b08e546bf162a6fb6fca8953ab68c34077cf300c0d6c1bb26aa37fe8f964
6
+ metadata.gz: 2e5925278ef21f20b3c9b8ae25f7bd614c7e17b278693f3521f018cefe1acd1ef63116aba61a9722bc1f4d5b98bfbeb56a6e03d0d246ac359aa595e4c451f6eb
7
+ data.tar.gz: baf191023d9a19ed7facfc77f3107db45e2adb1949a25e4fc306b0a9f85e061e474fc557848beb469aaf0c5ad0446918b9c285b63cc5501bf21d31c19229878c
data/.gitignore CHANGED
@@ -10,4 +10,8 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
 
13
- Gemfile.lock
13
+ Gemfile.lock
14
+
15
+ Dockerfile
16
+ docker-compose.yml
17
+ .dockerignore
@@ -0,0 +1,15 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7.2
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+ Exclude:
6
+ - "*.gemspec"
7
+ - vendor/**/*
8
+ - Gemfile
9
+
10
+ Metrics/BlockLength:
11
+ Exclude:
12
+ - spec/**/*
13
+
14
+ Naming/AccessorMethodName:
15
+ Enabled: false
@@ -1,10 +1,11 @@
1
- sudo: false
2
1
  language: ruby
2
+ cache: bundler
3
3
  rvm:
4
- - 2.4
5
- - 2.5
6
4
  - 2.6
5
+ - 2.7
6
+ - 3.0
7
7
  before_install:
8
8
  - gem update --system --no-doc
9
9
  script:
10
- - bundle exec rspec
10
+ - bundle exec rspec
11
+ - bundle exec rubocop
@@ -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
- 1. [Introduction](/docs/introduction.md)
14
- 1. [Design model](/docs/design_model.md)
15
- 1. [Building a rack application](/docs/building_a_rack_application.md)
16
- 1. [Plugging operations](/docs/plugging_operations.md)
17
- 1. [Resolving operations](/docs/plugging_operations/resolving_operations.md)
18
- 1. [Injecting operations](/docs/plugging_operations/injecting_operations.md)
19
- 1. [Composing operations](/docs/plugging_operations/composing_operations.md)
20
- 1. [Using rack middlewares](/docs/using_rack_middlewares.md)
21
- 1. [Injecting middlewares](/docs/using_rack_middlewares/injecting_middlewares.md)
22
- 1. [Composing middlewares](/docs/using_rack_middlewares/composing_middlewares.md)
23
- 1. [Composing applications](/docs/composing_applications.md)
24
- 1. [Connection struct](/docs/connection_struct.md)
25
- 1. [Sharing data downstream](/docs/connection_struct/sharing_data_downstream.md)
26
- 1. [Halting the pipe](/docs/connection_struct/halting_the_pipe.md)
27
- 1. [Configuring the connection struct](/docs/connection_struct/configuring_the_connection_struct.md)
28
- 1. [DSL free usage](/docs/dsl_free_usage.md)
29
- 1. [Plugs](/docs/plugs.md)
30
- 1. [Config](/docs/plugs/config.md)
31
- 1. [ContentType](/docs/plugs/content_type.md)
32
- 1. [Extensions](/docs/extensions.md)
33
- 1. [Container](/docs/extensions/container.md)
34
- 1. [Cookies](/docs/extensions/cookies.md)
35
- 1. [Flash](/docs/extensions/flash.md)
36
- 1. [Dry Schema](/docs/extensions/dry_schema.md)
37
- 1. [Dry View](/docs/extensions/dry_view.md)
38
- 1. [Params](/docs/extensions/params.md)
39
- 1. [Redirect](/docs/extensions/redirect.md)
40
- 1. [Router params](/docs/extensions/router_params.md)
41
- 1. [Session](/docs/extensions/session.md)
42
- 1. [URL](/docs/extensions/url.md)
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](/docs/recipes/dry_rb_integration.md)
45
- 1. [hanami-router integration](/docs/recipes/hanami_router_integration.md)
46
- 1. [Using all RESTful methods](/docs/recipes/using_all_restful_methods.mb)
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. The very basic features to build
92
- a rack application are all available. However, very necessary
93
- conveniences to build a production application, for example a session
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](/docs/plugging_operations/composing_operations.md) and how to [compose
5
- rack middlewares](/docs/using_rack_middlewares/composing_middlewares.md). The logical
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
 
@@ -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)[/docs/extensions.md] which will make your life much easier.
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](/docs/extensions.md) add extra behaviour to the connection struct.
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](/docs/plugs/config.md).
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](/docs/extensions/params.md),
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
@@ -37,7 +37,7 @@ end
37
37
  ```
38
38
 
39
39
  However, you can resolve a view from a container if you also use (`:container`
40
- extension)[/docs/extensions/container.md]:
40
+ extension)[container.md]:
41
41
 
42
42
  ```ruby
43
43
  require 'dry_view'
@@ -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 [`transproc`
16
- gem](https://github.com/solnic/transproc) (you have to add it yourself to your
17
- Gemfile). All hash transformations in `transproc` are available by default.
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](/docs/extensions/params.md) (which is
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
@@ -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](/docs/design_model.md) on an [immutable
16
- struct](/docs/connection_struct.md). The struct is automatically created
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](/docs/connection_struct/halting_the_pipe.md) at any moment,
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](/docs/extensions.md) to make your life easier.
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
+ ```
@@ -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](/docs/plugging_operations/injecting_operations.md) on
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`](/docs/extensions/dry_view.md) or
8
- [`:dry-schema`](/docs/extensions/dry_schema.md) extensions).
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](/docs/extensions/router_params.md).
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](docs/using_rack_middlewares.md)) it will have no effect.
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](/docs/using_rack_middlewares/injecting_middlewares.md) on
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
 
@@ -14,8 +14,8 @@ module WebPipe
14
14
  klass.include(call)
15
15
  end
16
16
 
17
- def self.call(*args)
18
- DSL::Builder.new(*args)
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
- <<~eos
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
- eos
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
- <<~eos
11
+ <<~MSG
12
12
  Bag does not contain a key with name +#{key}+.
13
- eos
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
- <<~eos
24
+ <<~MSG
25
25
  Config does not contain a key with name +#{key}+.
26
- eos
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
- <<~eos
39
+ <<~MSG
40
40
  In order to use #{feature} you must use #{middleware} middleware:
41
41
  https://rubygems.org/gems/#{gem}
42
- eos
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..-1], v) }
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
- Hash[
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
@@ -25,6 +25,7 @@ module WebPipe
25
25
  def initialize(container: EMPTY_CONTAINER)
26
26
  @container = Types::Container[container]
27
27
  @class_context = ClassContext.new(container: container)
28
+ super()
28
29
  end
29
30
 
30
31
  def included(klass)
@@ -33,6 +33,7 @@ module WebPipe
33
33
  @dsl_context = DSLContext.new([], [])
34
34
  define_container
35
35
  define_dsl
36
+ super()
36
37
  end
37
38
 
38
39
  private
@@ -66,7 +66,7 @@ module WebPipe
66
66
  spec
67
67
  else
68
68
  block_spec
69
- end
69
+ end
70
70
 
71
71
  plugs << Plug.new(name: name, spec: plug_spec)
72
72
  end
@@ -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
  #
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'web_pipe'
4
4
 
5
+ #:nodoc:
5
6
  module WebPipe
6
7
  # Extension adding a `#container` method which returns {Conn#config}
7
8
  # `:container` key.
@@ -4,6 +4,7 @@ require 'web_pipe'
4
4
  require 'web_pipe/types'
5
5
  require 'rack/utils'
6
6
 
7
+ #:nodoc:
7
8
  module WebPipe
8
9
  # Extension to help dealing with request and response cookies.
9
10
  #
@@ -4,6 +4,7 @@ require 'web_pipe'
4
4
 
5
5
  WebPipe.load_extensions(:params)
6
6
 
7
+ #:nodoc:
7
8
  module WebPipe
8
9
  # Integration with `dry-schema` validation library.
9
10
  #
@@ -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(VIEW_CONTEXT_KEY, DEFAULT_VIEW_CONTEXT).call(self)
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/conn'
4
4
  require 'web_pipe/conn_support/errors'
5
5
 
6
+ #:nodoc:
6
7
  module WebPipe
7
8
  # Provides with a typical flash messages functionality.
8
9
  #
@@ -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 `transproc` gem (you
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 `transproc` are available:
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/solnic/transproc
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 'transproc'
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 Transproc::Registry
9
+ extend Dry::Transformer::Registry
9
10
 
10
- import Transproc::HashTransformations
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
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'web_pipe/types'
4
4
 
5
+ #:nodoc:
5
6
  module WebPipe
6
7
  # Helper method to create redirect responses.
7
8
  #
@@ -4,6 +4,7 @@ require 'web_pipe/conn'
4
4
  require 'web_pipe/types'
5
5
  require 'rack'
6
6
 
7
+ #:nodoc:
7
8
  module WebPipe
8
9
  # Wrapper around Rack::Session middlewares.
9
10
  #
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #:nodoc:
3
4
  module WebPipe
4
5
  # Adds helper methods related to the request URL.
5
6
  #
@@ -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
- <<~eos
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
- eos
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]&.respond_to?(:call)
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..-1] || Types::EMPTY_ARRAY
64
- if klass.is_a?(WebPipe)
63
+ options = spec[1..] || Types::EMPTY_ARRAY
64
+ case klass
65
+ when WebPipe
65
66
  klass.middlewares
66
- elsif klass.is_a?(Class)
67
+ when Class
67
68
  [Middleware.new(middleware: klass, options: options)]
68
69
  end
69
70
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebPipe
4
- VERSION = '0.9.0'
4
+ VERSION = '0.13.0'
5
5
  end
@@ -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', '~> 1.17'
43
+ spec.add_development_dependency 'bundler'
45
44
  spec.add_development_dependency 'dry-schema', '~> 1.0'
46
- spec.add_development_dependency 'dry-view', '~> 0.7'
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', '~> 10.0'
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.9.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: 2019-08-31 00:00:00.000000000 Z
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: '1.17'
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: '1.17'
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-view
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.7'
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.7'
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: '10.0'
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: '10.0'
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
- rubyforge_project:
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.
@@ -1 +0,0 @@
1
- theme: jekyll-theme-slate