diff --git a/debian/gems-compat/actioncable-5.1.7/CHANGELOG.md b/debian/gems-compat/actioncable-5.1.7/CHANGELOG.md
deleted file mode 100644
index a4bff86f8d..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/CHANGELOG.md
+++ /dev/null
@@ -1,118 +0,0 @@
-## Rails 5.1.7 (March 27, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.2 (March 11, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.1 (November 27, 2018) ##
-
-* No changes.
-
-
-## Rails 5.1.6 (March 29, 2018) ##
-
-* No changes.
-
-
-## Rails 5.1.5 (February 14, 2018) ##
-
-* Support redis-rb 4.0.
-
- *Jeremy Daer*
-
-
-## Rails 5.1.4 (September 07, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.4.rc1 (August 24, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3 (August 03, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc3 (July 31, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc2 (July 25, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc1 (July 19, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.2 (June 26, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.1 (May 12, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.0 (April 27, 2017) ##
-
-* ActionCable socket errors are now logged to the console
-
- Previously any socket errors were ignored and this made it hard to diagnose socket issues (e.g. as discussed in #28362).
-
- *Edward Poot*
-
-* Redis subscription adapters now support `channel_prefix` option in `cable.yml`
-
- Avoids channel name collisions when multiple apps use the same Redis server.
-
- *Chad Ingram*
-
-* Permit same-origin connections by default.
-
- Added new option `config.action_cable.allow_same_origin_as_host = false`
- to disable this behaviour.
-
- *Dávid Halász*, *Matthew Draper*
-
-* Prevent race where the client could receive and act upon a
- subscription confirmation before the channel's `subscribed` method
- completed.
-
- Fixes #25381.
-
- *Vladimir Dementyev*
-
-* Buffer now writes to WebSocket connections, to avoid blocking threads
- that could be doing more useful things.
-
- *Matthew Draper*, *Tinco Andringa*
-
-* Protect against concurrent writes to a WebSocket connection from
- multiple threads; the underlying OS write is not always threadsafe.
-
- *Tinco Andringa*
-
-* Add `ActiveSupport::Notifications` hook to `Broadcaster#broadcast`.
-
- *Matthew Wear*
-
-* Close hijacked socket when connection is shut down.
-
- Fixes #25613.
-
- *Tinco Andringa*
-
-
-Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actioncable/CHANGELOG.md) for previous changes.
diff --git a/debian/gems-compat/actioncable-5.1.7/MIT-LICENSE b/debian/gems-compat/actioncable-5.1.7/MIT-LICENSE
deleted file mode 100644
index 1a0e653b69..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/MIT-LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2015-2017 Basecamp, LLC
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/debian/gems-compat/actioncable-5.1.7/README.md b/debian/gems-compat/actioncable-5.1.7/README.md
deleted file mode 100644
index e044f54b45..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/README.md
+++ /dev/null
@@ -1,567 +0,0 @@
-# Action Cable – Integrated WebSockets for Rails
-
-Action Cable seamlessly integrates WebSockets with the rest of your Rails application.
-It allows for real-time features to be written in Ruby in the same style
-and form as the rest of your Rails application, while still being performant
-and scalable. It's a full-stack offering that provides both a client-side
-JavaScript framework and a server-side Ruby framework. You have access to your full
-domain model written with Active Record or your ORM of choice.
-
-## Terminology
-
-A single Action Cable server can handle multiple connection instances. It has one
-connection instance per WebSocket connection. A single user may have multiple
-WebSockets open to your application if they use multiple browser tabs or devices.
-The client of a WebSocket connection is called the consumer.
-
-Each consumer can in turn subscribe to multiple cable channels. Each channel encapsulates
-a logical unit of work, similar to what a controller does in a regular MVC setup. For example,
-you could have a `ChatChannel` and an `AppearancesChannel`, and a consumer could be subscribed to either
-or to both of these channels. At the very least, a consumer should be subscribed to one channel.
-
-When the consumer is subscribed to a channel, they act as a subscriber. The connection between
-the subscriber and the channel is, surprise-surprise, called a subscription. A consumer
-can act as a subscriber to a given channel any number of times. For example, a consumer
-could subscribe to multiple chat rooms at the same time. (And remember that a physical user may
-have multiple consumers, one per tab/device open to your connection).
-
-Each channel can then again be streaming zero or more broadcastings. A broadcasting is a
-pubsub link where anything transmitted by the broadcaster is sent directly to the channel
-subscribers who are streaming that named broadcasting.
-
-As you can see, this is a fairly deep architectural stack. There's a lot of new terminology
-to identify the new pieces, and on top of that, you're dealing with both client and server side
-reflections of each unit.
-
-## Examples
-
-### A full-stack example
-
-The first thing you must do is define your `ApplicationCable::Connection` class in Ruby. This
-is the place where you authorize the incoming connection, and proceed to establish it,
-if all is well. Here's the simplest example starting with the server-side connection class:
-
-```ruby
-# app/channels/application_cable/connection.rb
-module ApplicationCable
- class Connection < ActionCable::Connection::Base
- identified_by :current_user
-
- def connect
- self.current_user = find_verified_user
- end
-
- private
- def find_verified_user
- if verified_user = User.find_by(id: cookies.signed[:user_id])
- verified_user
- else
- reject_unauthorized_connection
- end
- end
- end
-end
-```
-Here `identified_by` is a connection identifier that can be used to find the specific connection again or later.
-Note that anything marked as an identifier will automatically create a delegate by the same name on any channel instances created off the connection.
-
-This relies on the fact that you will already have handled authentication of the user, and
-that a successful authentication sets a signed cookie with the `user_id`. This cookie is then
-automatically sent to the connection instance when a new connection is attempted, and you
-use that to set the `current_user`. By identifying the connection by this same current_user,
-you're also ensuring that you can later retrieve all open connections by a given user (and
-potentially disconnect them all if the user is deleted or deauthorized).
-
-Next, you should define your `ApplicationCable::Channel` class in Ruby. This is the place where you put
-shared logic between your channels.
-
-```ruby
-# app/channels/application_cable/channel.rb
-module ApplicationCable
- class Channel < ActionCable::Channel::Base
- end
-end
-```
-
-The client-side needs to setup a consumer instance of this connection. That's done like so:
-
-```js
-// app/assets/javascripts/cable.js
-//= require action_cable
-//= require_self
-//= require_tree ./channels
-
-(function() {
- this.App || (this.App = {});
-
- App.cable = ActionCable.createConsumer("ws://cable.example.com");
-}).call(this);
-```
-
-The `ws://cable.example.com` address must point to your Action Cable server(s), and it
-must share a cookie namespace with the rest of the application (which may live under http://example.com).
-This ensures that the signed cookie will be correctly sent.
-
-That's all you need to establish the connection! But of course, this isn't very useful in
-itself. This just gives you the plumbing. To make stuff happen, you need content. That content
-is defined by declaring channels on the server and allowing the consumer to subscribe to them.
-
-
-### Channel example 1: User appearances
-
-Here's a simple example of a channel that tracks whether a user is online or not, and also what page they are currently on.
-(This is useful for creating presence features like showing a green dot next to a user's name if they're online).
-
-First you declare the server-side channel:
-
-```ruby
-# app/channels/appearance_channel.rb
-class AppearanceChannel < ApplicationCable::Channel
- def subscribed
- current_user.appear
- end
-
- def unsubscribed
- current_user.disappear
- end
-
- def appear(data)
- current_user.appear on: data['appearing_on']
- end
-
- def away
- current_user.away
- end
-end
-```
-
-The `#subscribed` callback is invoked when, as we'll show below, a client-side subscription is initiated. In this case,
-we take that opportunity to say "the current user has indeed appeared". That appear/disappear API could be backed by
-Redis or a database or whatever else. Here's what the client-side of that looks like:
-
-```coffeescript
-# app/assets/javascripts/cable/subscriptions/appearance.coffee
-App.cable.subscriptions.create "AppearanceChannel",
- # Called when the subscription is ready for use on the server
- connected: ->
- @install()
- @appear()
-
- # Called when the WebSocket connection is closed
- disconnected: ->
- @uninstall()
-
- # Called when the subscription is rejected by the server
- rejected: ->
- @uninstall()
-
- appear: ->
- # Calls `AppearanceChannel#appear(data)` on the server
- @perform("appear", appearing_on: $("main").data("appearing-on"))
-
- away: ->
- # Calls `AppearanceChannel#away` on the server
- @perform("away")
-
-
- buttonSelector = "[data-behavior~=appear_away]"
-
- install: ->
- $(document).on "turbolinks:load.appearance", =>
- @appear()
-
- $(document).on "click.appearance", buttonSelector, =>
- @away()
- false
-
- $(buttonSelector).show()
-
- uninstall: ->
- $(document).off(".appearance")
- $(buttonSelector).hide()
-```
-
-Simply calling `App.cable.subscriptions.create` will setup the subscription, which will call `AppearanceChannel#subscribed`,
-which in turn is linked to the original `App.cable` -> `ApplicationCable::Connection` instances.
-
-Next, we link the client-side `appear` method to `AppearanceChannel#appear(data)`. This is possible because the server-side
-channel instance will automatically expose the public methods declared on the class (minus the callbacks), so that these
-can be reached as remote procedure calls via a subscription's `perform` method.
-
-### Channel example 2: Receiving new web notifications
-
-The appearance example was all about exposing server functionality to client-side invocation over the WebSocket connection.
-But the great thing about WebSockets is that it's a two-way street. So now let's show an example where the server invokes
-an action on the client.
-
-This is a web notification channel that allows you to trigger client-side web notifications when you broadcast to the right
-streams:
-
-```ruby
-# app/channels/web_notifications_channel.rb
-class WebNotificationsChannel < ApplicationCable::Channel
- def subscribed
- stream_from "web_notifications_#{current_user.id}"
- end
-end
-```
-
-```coffeescript
-# Client-side, which assumes you've already requested the right to send web notifications
-App.cable.subscriptions.create "WebNotificationsChannel",
- received: (data) ->
- new Notification data["title"], body: data["body"]
-```
-
-```ruby
-# Somewhere in your app this is called, perhaps from a NewCommentJob
-ActionCable.server.broadcast \
- "web_notifications_#{current_user.id}", { title: 'New things!', body: 'All the news that is fit to print' }
-```
-
-The `ActionCable.server.broadcast` call places a message in the Action Cable pubsub queue under a separate broadcasting name for each user. For a user with an ID of 1, the broadcasting name would be `web_notifications_1`.
-The channel has been instructed to stream everything that arrives at `web_notifications_1` directly to the client by invoking the
-`#received(data)` callback. The data is the hash sent as the second parameter to the server-side broadcast call, JSON encoded for the trip
-across the wire, and unpacked for the data argument arriving to `#received`.
-
-
-### Passing Parameters to Channel
-
-You can pass parameters from the client side to the server side when creating a subscription. For example:
-
-```ruby
-# app/channels/chat_channel.rb
-class ChatChannel < ApplicationCable::Channel
- def subscribed
- stream_from "chat_#{params[:room]}"
- end
-end
-```
-
-If you pass an object as the first argument to `subscriptions.create`, that object will become the params hash in your cable channel. The keyword `channel` is required.
-
-```coffeescript
-# Client-side, which assumes you've already requested the right to send web notifications
-App.cable.subscriptions.create { channel: "ChatChannel", room: "Best Room" },
- received: (data) ->
- @appendLine(data)
-
- appendLine: (data) ->
- html = @createLine(data)
- $("[data-chat-room='Best Room']").append(html)
-
- createLine: (data) ->
- """
-
- #{data["sent_by"]}
- #{data["body"]}
-
- """
-```
-
-```ruby
-# Somewhere in your app this is called, perhaps from a NewCommentJob
-ActionCable.server.broadcast \
- "chat_#{room}", { sent_by: 'Paul', body: 'This is a cool chat app.' }
-```
-
-
-### Rebroadcasting message
-
-A common use case is to rebroadcast a message sent by one client to any other connected clients.
-
-```ruby
-# app/channels/chat_channel.rb
-class ChatChannel < ApplicationCable::Channel
- def subscribed
- stream_from "chat_#{params[:room]}"
- end
-
- def receive(data)
- ActionCable.server.broadcast "chat_#{params[:room]}", data
- end
-end
-```
-
-```coffeescript
-# Client-side, which assumes you've already requested the right to send web notifications
-App.chatChannel = App.cable.subscriptions.create { channel: "ChatChannel", room: "Best Room" },
- received: (data) ->
- # data => { sent_by: "Paul", body: "This is a cool chat app." }
-
-App.chatChannel.send({ sent_by: "Paul", body: "This is a cool chat app." })
-```
-
-The rebroadcast will be received by all connected clients, _including_ the client that sent the message. Note that params are the same as they were when you subscribed to the channel.
-
-
-### More complete examples
-
-See the [rails/actioncable-examples](https://github.com/rails/actioncable-examples) repository for a full example of how to setup Action Cable in a Rails app, and how to add channels.
-
-## Configuration
-
-Action Cable has three required configurations: a subscription adapter, allowed request origins, and the cable server URL (which can optionally be set on the client side).
-
-### Redis
-
-By default, `ActionCable::Server::Base` will look for a configuration file in `Rails.root.join('config/cable.yml')`.
-This file must specify an adapter and a URL for each Rails environment. It may use the following format:
-
-```yaml
-production: &production
- adapter: redis
- url: redis://10.10.3.153:6381
-development: &development
- adapter: redis
- url: redis://localhost:6379
-test: *development
-```
-
-You can also change the location of the Action Cable config file in a Rails initializer with something like:
-
-```ruby
-Rails.application.paths.add "config/cable", with: "somewhere/else/cable.yml"
-```
-
-### Allowed Request Origins
-
-Action Cable will only accept requests from specific origins.
-
-By default, only an origin matching the cable server itself will be permitted.
-Additional origins can be specified using strings or regular expressions, provided in an array.
-
-```ruby
-Rails.application.config.action_cable.allowed_request_origins = ['http://rubyonrails.com', /http:\/\/ruby.*/]
-```
-
-When running in the development environment, this defaults to "http://localhost:3000".
-
-To disable protection and allow requests from any origin:
-
-```ruby
-Rails.application.config.action_cable.disable_request_forgery_protection = true
-```
-
-To disable automatic access for same-origin requests, and strictly allow
-only the configured origins:
-
-```ruby
-Rails.application.config.action_cable.allow_same_origin_as_host = false
-```
-
-### Consumer Configuration
-
-Once you have decided how to run your cable server (see below), you must provide the server URL (or path) to your client-side setup.
-There are two ways you can do this.
-
-The first is to simply pass it in when creating your consumer. For a standalone server,
-this would be something like: `App.cable = ActionCable.createConsumer("ws://example.com:28080")`, and for an in-app server,
-something like: `App.cable = ActionCable.createConsumer("/cable")`.
-
-The second option is to pass the server URL through the `action_cable_meta_tag` in your layout.
-This uses a URL or path typically set via `config.action_cable.url` in the environment configuration files, or defaults to "/cable".
-
-This method is especially useful if your WebSocket URL might change between environments. If you host your production server via https, you will need to use the wss scheme
-for your Action Cable server, but development might remain http and use the ws scheme. You might use localhost in development and your
-domain in production.
-
-In any case, to vary the WebSocket URL between environments, add the following configuration to each environment:
-
-```ruby
-config.action_cable.url = "ws://example.com:28080"
-```
-
-Then add the following line to your layout before your JavaScript tag:
-
-```erb
-<%= action_cable_meta_tag %>
-```
-
-And finally, create your consumer like so:
-
-```coffeescript
-App.cable = ActionCable.createConsumer()
-```
-
-### Other Configurations
-
-The other common option to configure is the log tags applied to the per-connection logger. Here's an example that uses the user account id if available, else "no-account" while tagging:
-
-```ruby
-config.action_cable.log_tags = [
- -> request { request.env['user_account_id'] || "no-account" },
- :action_cable,
- -> request { request.uuid }
-]
-```
-
-For a full list of all configuration options, see the `ActionCable::Server::Configuration` class.
-
-Also note that your server must provide at least the same number of database connections as you have workers. The default worker pool is set to 4, so that means you have to make at least that available. You can change that in `config/database.yml` through the `pool` attribute.
-
-
-## Running the cable server
-
-### Standalone
-The cable server(s) is separated from your normal application server. It's still a Rack application, but it is its own Rack
-application. The recommended basic setup is as follows:
-
-```ruby
-# cable/config.ru
-require ::File.expand_path('../../config/environment', __FILE__)
-Rails.application.eager_load!
-
-run ActionCable.server
-```
-
-Then you start the server using a binstub in bin/cable ala:
-```sh
-#!/bin/bash
-bundle exec puma -p 28080 cable/config.ru
-```
-
-The above will start a cable server on port 28080.
-
-### In app
-
-If you are using a server that supports the [Rack socket hijacking API](http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking), Action Cable can run alongside your Rails application. For example, to listen for WebSocket requests on `/websocket`, specify that path to `config.action_cable.mount_path`:
-
-```ruby
-# config/application.rb
-class Application < Rails::Application
- config.action_cable.mount_path = '/websocket'
-end
-```
-
-For every instance of your server you create and for every worker your server spawns, you will also have a new instance of Action Cable, but the use of Redis keeps messages synced across connections.
-
-### Notes
-
-Beware that currently, the cable server will _not_ auto-reload any changes in the framework. As we've discussed, long-running cable connections mean long-running objects. We don't yet have a way of reloading the classes of those objects in a safe manner. So when you change your channels, or the model your channels use, you must restart the cable server.
-
-We'll get all this abstracted properly when the framework is integrated into Rails.
-
-The WebSocket server doesn't have access to the session, but it has access to the cookies. This can be used when you need to handle authentication. You can see one way of doing that with Devise in this [article](http://www.rubytutorial.io/actioncable-devise-authentication).
-
-## Dependencies
-
-Action Cable provides a subscription adapter interface to process its pubsub internals. By default, asynchronous, inline, PostgreSQL, evented Redis, and non-evented Redis adapters are included. The default adapter in new Rails applications is the asynchronous (`async`) adapter. To create your own adapter, you can look at `ActionCable::SubscriptionAdapter::Base` for all methods that must be implemented, and any of the adapters included within Action Cable as example implementations.
-
-The Ruby side of things is built on top of [websocket-driver](https://github.com/faye/websocket-driver-ruby), [nio4r](https://github.com/celluloid/nio4r), and [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby).
-
-
-## Deployment
-
-Action Cable is powered by a combination of WebSockets and threads. All of the
-connection management is handled internally by utilizing Ruby’s native thread
-support, which means you can use all your regular Rails models with no problems
-as long as you haven’t committed any thread-safety sins.
-
-The Action Cable server does _not_ need to be a multi-threaded application server.
-This is because Action Cable uses the [Rack socket hijacking API](http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking)
-to take over control of connections from the application server. Action Cable
-then manages connections internally, in a multithreaded manner, regardless of
-whether the application server is multi-threaded or not. So Action Cable works
-with all the popular application servers -- Unicorn, Puma and Passenger.
-
-Action Cable does not work with WEBrick, because WEBrick does not support the
-Rack socket hijacking API.
-
-## Frontend assets
-
-Action Cable's frontend assets are distributed through two channels: the
-official gem and npm package, both titled `actioncable`.
-
-### Gem usage
-
-Through the `actioncable` gem, Action Cable's frontend assets are
-available through the Rails Asset Pipeline. Create a `cable.js` or
-`cable.coffee` file (this is automatically done for you with Rails
-generators), and then simply require the assets:
-
-In JavaScript...
-
-```javascript
-//= require action_cable
-```
-
-... and in CoffeeScript:
-
-```coffeescript
-#= require action_cable
-```
-
-### npm usage
-
-In addition to being available through the `actioncable` gem, Action Cable's
-frontend JS assets are also bundled in an officially supported npm module,
-intended for usage in standalone frontend applications that communicate with a
-Rails application. A common use case for this could be if you have a decoupled
-frontend application written in React, Ember.js, etc. and want to add real-time
-WebSocket functionality.
-
-### Installation
-
-```
-npm install actioncable --save
-```
-
-### Usage
-
-The `ActionCable` constant is available as a `require`-able module, so
-you only have to require the package to gain access to the API that is
-provided.
-
-In JavaScript...
-
-```javascript
-ActionCable = require('actioncable')
-
-var cable = ActionCable.createConsumer('wss://RAILS-API-PATH.com/cable')
-
-cable.subscriptions.create('AppearanceChannel', {
- // normal channel code goes here...
-});
-```
-
-and in CoffeeScript...
-
-```coffeescript
-ActionCable = require('actioncable')
-
-cable = ActionCable.createConsumer('wss://RAILS-API-PATH.com/cable')
-
-cable.subscriptions.create 'AppearanceChannel',
- # normal channel code goes here...
-```
-
-## Download and Installation
-
-The latest version of Action Cable can be installed with [RubyGems](#gem-usage),
-or with [npm](#npm-usage).
-
-Source code can be downloaded as part of the Rails project on GitHub
-
-* https://github.com/rails/rails/tree/master/actioncable
-
-## License
-
-Action Cable is released under the MIT license:
-
-* http://www.opensource.org/licenses/MIT
-
-
-## Support
-
-API documentation is at:
-
-* http://api.rubyonrails.org
-
-Bug reports can be filed for the Ruby on Rails project here:
-
-* https://github.com/rails/rails/issues
-
-Feature requests should be discussed on the rails-core mailing list here:
-
-* https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
diff --git a/debian/gems-compat/actioncable-5.1.7/actioncable.gemspec b/debian/gems-compat/actioncable-5.1.7/actioncable.gemspec
deleted file mode 100644
index e1a14cf728..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/actioncable.gemspec
+++ /dev/null
@@ -1,42 +0,0 @@
-#########################################################
-# This file has been automatically generated by gem2tgz #
-#########################################################
-# -*- encoding: utf-8 -*-
-# stub: actioncable 5.1.7 ruby lib
-
-Gem::Specification.new do |s|
- s.name = "actioncable".freeze
- s.version = "5.1.7"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
- s.metadata = { "changelog_uri" => "https://github.com/rails/rails/blob/v5.1.7/actioncable/CHANGELOG.md", "source_code_uri" => "https://github.com/rails/rails/tree/v5.1.7/actioncable" } if s.respond_to? :metadata=
- s.require_paths = ["lib".freeze]
- s.authors = ["Pratik Naik".freeze, "David Heinemeier Hansson".freeze]
- s.date = "2019-03-28"
- s.description = "Structure many real-time application concerns into channels over a single WebSocket connection.".freeze
- s.email = ["pratiknaik@gmail.com".freeze, "david@loudthinking.com".freeze]
- s.files = ["CHANGELOG.md".freeze, "MIT-LICENSE".freeze, "README.md".freeze, "lib/action_cable.rb".freeze, "lib/action_cable/channel.rb".freeze, "lib/action_cable/channel/base.rb".freeze, "lib/action_cable/channel/broadcasting.rb".freeze, "lib/action_cable/channel/callbacks.rb".freeze, "lib/action_cable/channel/naming.rb".freeze, "lib/action_cable/channel/periodic_timers.rb".freeze, "lib/action_cable/channel/streams.rb".freeze, "lib/action_cable/connection.rb".freeze, "lib/action_cable/connection/authorization.rb".freeze, "lib/action_cable/connection/base.rb".freeze, "lib/action_cable/connection/client_socket.rb".freeze, "lib/action_cable/connection/identification.rb".freeze, "lib/action_cable/connection/internal_channel.rb".freeze, "lib/action_cable/connection/message_buffer.rb".freeze, "lib/action_cable/connection/stream.rb".freeze, "lib/action_cable/connection/stream_event_loop.rb".freeze, "lib/action_cable/connection/subscriptions.rb".freeze, "lib/action_cable/connection/tagged_logger_proxy.rb".freeze, "lib/action_cable/connection/web_socket.rb".freeze, "lib/action_cable/engine.rb".freeze, "lib/action_cable/gem_version.rb".freeze, "lib/action_cable/helpers/action_cable_helper.rb".freeze, "lib/action_cable/remote_connections.rb".freeze, "lib/action_cable/server.rb".freeze, "lib/action_cable/server/base.rb".freeze, "lib/action_cable/server/broadcasting.rb".freeze, "lib/action_cable/server/configuration.rb".freeze, "lib/action_cable/server/connections.rb".freeze, "lib/action_cable/server/worker.rb".freeze, "lib/action_cable/server/worker/active_record_connection_management.rb".freeze, "lib/action_cable/subscription_adapter.rb".freeze, "lib/action_cable/subscription_adapter/async.rb".freeze, "lib/action_cable/subscription_adapter/base.rb".freeze, "lib/action_cable/subscription_adapter/channel_prefix.rb".freeze, "lib/action_cable/subscription_adapter/evented_redis.rb".freeze, "lib/action_cable/subscription_adapter/inline.rb".freeze, "lib/action_cable/subscription_adapter/postgresql.rb".freeze, "lib/action_cable/subscription_adapter/redis.rb".freeze, "lib/action_cable/subscription_adapter/subscriber_map.rb".freeze, "lib/action_cable/version.rb".freeze, "lib/assets/compiled/action_cable.js".freeze, "lib/rails/generators/channel/USAGE".freeze, "lib/rails/generators/channel/channel_generator.rb".freeze, "lib/rails/generators/channel/templates/application_cable/channel.rb".freeze, "lib/rails/generators/channel/templates/application_cable/connection.rb".freeze, "lib/rails/generators/channel/templates/assets/cable.js".freeze, "lib/rails/generators/channel/templates/assets/channel.coffee".freeze, "lib/rails/generators/channel/templates/assets/channel.js".freeze, "lib/rails/generators/channel/templates/channel.rb".freeze]
- s.homepage = "http://rubyonrails.org".freeze
- s.licenses = ["MIT".freeze]
- s.required_ruby_version = Gem::Requirement.new(">= 2.2.2".freeze)
- s.rubygems_version = "2.7.6.2".freeze
- s.summary = "WebSocket framework for Rails.".freeze
-
- if s.respond_to? :specification_version then
- s.specification_version = 4
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, ["~> 2.0"])
- s.add_runtime_dependency(%q.freeze, ["~> 0.6.1"])
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, ["~> 0.6.1"])
- end
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, ["~> 0.6.1"])
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable.rb
deleted file mode 100644
index c2d3550acb..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#--
-# Copyright (c) 2015-2017 Basecamp, LLC
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#++
-
-require "active_support"
-require "active_support/rails"
-require "action_cable/version"
-
-module ActionCable
- extend ActiveSupport::Autoload
-
- INTERNAL = {
- message_types: {
- welcome: "welcome".freeze,
- ping: "ping".freeze,
- confirmation: "confirm_subscription".freeze,
- rejection: "reject_subscription".freeze
- },
- default_mount_path: "/cable".freeze,
- protocols: ["actioncable-v1-json".freeze, "actioncable-unsupported".freeze].freeze
- }
-
- # Singleton instance of the server
- module_function def server
- @server ||= ActionCable::Server::Base.new
- end
-
- autoload :Server
- autoload :Connection
- autoload :Channel
- autoload :RemoteConnections
- autoload :SubscriptionAdapter
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel.rb
deleted file mode 100644
index 7ae262ce5f..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module ActionCable
- module Channel
- extend ActiveSupport::Autoload
-
- eager_autoload do
- autoload :Base
- autoload :Broadcasting
- autoload :Callbacks
- autoload :Naming
- autoload :PeriodicTimers
- autoload :Streams
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/base.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/base.rb
deleted file mode 100644
index 718f630f58..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/base.rb
+++ /dev/null
@@ -1,301 +0,0 @@
-require "set"
-
-module ActionCable
- module Channel
- # The channel provides the basic structure of grouping behavior into logical units when communicating over the WebSocket connection.
- # You can think of a channel like a form of controller, but one that's capable of pushing content to the subscriber in addition to simply
- # responding to the subscriber's direct requests.
- #
- # Channel instances are long-lived. A channel object will be instantiated when the cable consumer becomes a subscriber, and then
- # lives until the consumer disconnects. This may be seconds, minutes, hours, or even days. That means you have to take special care
- # not to do anything silly in a channel that would balloon its memory footprint or whatever. The references are forever, so they won't be released
- # as is normally the case with a controller instance that gets thrown away after every request.
- #
- # Long-lived channels (and connections) also mean you're responsible for ensuring that the data is fresh. If you hold a reference to a user
- # record, but the name is changed while that reference is held, you may be sending stale data if you don't take precautions to avoid it.
- #
- # The upside of long-lived channel instances is that you can use instance variables to keep reference to objects that future subscriber requests
- # can interact with. Here's a quick example:
- #
- # class ChatChannel < ApplicationCable::Channel
- # def subscribed
- # @room = Chat::Room[params[:room_number]]
- # end
- #
- # def speak(data)
- # @room.speak data, user: current_user
- # end
- # end
- #
- # The #speak action simply uses the Chat::Room object that was created when the channel was first subscribed to by the consumer when that
- # subscriber wants to say something in the room.
- #
- # == Action processing
- #
- # Unlike subclasses of ActionController::Base, channels do not follow a RESTful
- # constraint form for their actions. Instead, Action Cable operates through a
- # remote-procedure call model. You can declare any public method on the
- # channel (optionally taking a data argument), and this method is
- # automatically exposed as callable to the client.
- #
- # Example:
- #
- # class AppearanceChannel < ApplicationCable::Channel
- # def subscribed
- # @connection_token = generate_connection_token
- # end
- #
- # def unsubscribed
- # current_user.disappear @connection_token
- # end
- #
- # def appear(data)
- # current_user.appear @connection_token, on: data['appearing_on']
- # end
- #
- # def away
- # current_user.away @connection_token
- # end
- #
- # private
- # def generate_connection_token
- # SecureRandom.hex(36)
- # end
- # end
- #
- # In this example, the subscribed and unsubscribed methods are not callable methods, as they
- # were already declared in ActionCable::Channel::Base, but #appear
- # and #away are. #generate_connection_token is also not
- # callable, since it's a private method. You'll see that appear accepts a data
- # parameter, which it then uses as part of its model call. #away
- # does not, since it's simply a trigger action.
- #
- # Also note that in this example, current_user is available because
- # it was marked as an identifying attribute on the connection. All such
- # identifiers will automatically create a delegation method of the same name
- # on the channel instance.
- #
- # == Rejecting subscription requests
- #
- # A channel can reject a subscription request in the #subscribed callback by
- # invoking the #reject method:
- #
- # class ChatChannel < ApplicationCable::Channel
- # def subscribed
- # @room = Chat::Room[params[:room_number]]
- # reject unless current_user.can_access?(@room)
- # end
- # end
- #
- # In this example, the subscription will be rejected if the
- # current_user does not have access to the chat room. On the
- # client-side, the Channel#rejected callback will get invoked when
- # the server rejects the subscription request.
- class Base
- include Callbacks
- include PeriodicTimers
- include Streams
- include Naming
- include Broadcasting
-
- attr_reader :params, :connection, :identifier
- delegate :logger, to: :connection
-
- class << self
- # A list of method names that should be considered actions. This
- # includes all public instance methods on a channel, less
- # any internal methods (defined on Base), adding back in
- # any methods that are internal, but still exist on the class
- # itself.
- #
- # ==== Returns
- # * Set - A set of all methods that should be considered actions.
- def action_methods
- @action_methods ||= begin
- # All public instance methods of this class, including ancestors
- methods = (public_instance_methods(true) -
- # Except for public instance methods of Base and its ancestors
- ActionCable::Channel::Base.public_instance_methods(true) +
- # Be sure to include shadowed public instance methods of this class
- public_instance_methods(false)).uniq.map(&:to_s)
- methods.to_set
- end
- end
-
- private
- # action_methods are cached and there is sometimes need to refresh
- # them. ::clear_action_methods! allows you to do that, so next time
- # you run action_methods, they will be recalculated.
- def clear_action_methods! # :doc:
- @action_methods = nil
- end
-
- # Refresh the cached action_methods when a new action_method is added.
- def method_added(name) # :doc:
- super
- clear_action_methods!
- end
- end
-
- def initialize(connection, identifier, params = {})
- @connection = connection
- @identifier = identifier
- @params = params
-
- # When a channel is streaming via pubsub, we want to delay the confirmation
- # transmission until pubsub subscription is confirmed.
- #
- # The counter starts at 1 because it's awaiting a call to #subscribe_to_channel
- @defer_subscription_confirmation_counter = Concurrent::AtomicFixnum.new(1)
-
- @reject_subscription = nil
- @subscription_confirmation_sent = nil
-
- delegate_connection_identifiers
- end
-
- # Extract the action name from the passed data and process it via the channel. The process will ensure
- # that the action requested is a public method on the channel declared by the user (so not one of the callbacks
- # like #subscribed).
- def perform_action(data)
- action = extract_action(data)
-
- if processable_action?(action)
- payload = { channel_class: self.class.name, action: action, data: data }
- ActiveSupport::Notifications.instrument("perform_action.action_cable", payload) do
- dispatch_action(action, data)
- end
- else
- logger.error "Unable to process #{action_signature(action, data)}"
- end
- end
-
- # This method is called after subscription has been added to the connection
- # and confirms or rejects the subscription.
- def subscribe_to_channel
- run_callbacks :subscribe do
- subscribed
- end
-
- reject_subscription if subscription_rejected?
- ensure_confirmation_sent
- end
-
- # Called by the cable connection when it's cut, so the channel has a chance to cleanup with callbacks.
- # This method is not intended to be called directly by the user. Instead, overwrite the #unsubscribed callback.
- def unsubscribe_from_channel # :nodoc:
- run_callbacks :unsubscribe do
- unsubscribed
- end
- end
-
- private
- # Called once a consumer has become a subscriber of the channel. Usually the place to setup any streams
- # you want this channel to be sending to the subscriber.
- def subscribed # :doc:
- # Override in subclasses
- end
-
- # Called once a consumer has cut its cable connection. Can be used for cleaning up connections or marking
- # users as offline or the like.
- def unsubscribed # :doc:
- # Override in subclasses
- end
-
- # Transmit a hash of data to the subscriber. The hash will automatically be wrapped in a JSON envelope with
- # the proper channel identifier marked as the recipient.
- def transmit(data, via: nil) # :doc:
- logger.debug "#{self.class.name} transmitting #{data.inspect.truncate(300)}".tap { |m| m << " (via #{via})" if via }
-
- payload = { channel_class: self.class.name, data: data, via: via }
- ActiveSupport::Notifications.instrument("transmit.action_cable", payload) do
- connection.transmit identifier: @identifier, message: data
- end
- end
-
- def ensure_confirmation_sent # :doc:
- return if subscription_rejected?
- @defer_subscription_confirmation_counter.decrement
- transmit_subscription_confirmation unless defer_subscription_confirmation?
- end
-
- def defer_subscription_confirmation! # :doc:
- @defer_subscription_confirmation_counter.increment
- end
-
- def defer_subscription_confirmation? # :doc:
- @defer_subscription_confirmation_counter.value > 0
- end
-
- def subscription_confirmation_sent? # :doc:
- @subscription_confirmation_sent
- end
-
- def reject # :doc:
- @reject_subscription = true
- end
-
- def subscription_rejected? # :doc:
- @reject_subscription
- end
-
- def delegate_connection_identifiers
- connection.identifiers.each do |identifier|
- define_singleton_method(identifier) do
- connection.send(identifier)
- end
- end
- end
-
- def extract_action(data)
- (data["action"].presence || :receive).to_sym
- end
-
- def processable_action?(action)
- self.class.action_methods.include?(action.to_s) unless subscription_rejected?
- end
-
- def dispatch_action(action, data)
- logger.info action_signature(action, data)
-
- if method(action).arity == 1
- public_send action, data
- else
- public_send action
- end
- end
-
- def action_signature(action, data)
- "#{self.class.name}##{action}".tap do |signature|
- if (arguments = data.except("action")).any?
- signature << "(#{arguments.inspect})"
- end
- end
- end
-
- def transmit_subscription_confirmation
- unless subscription_confirmation_sent?
- logger.info "#{self.class.name} is transmitting the subscription confirmation"
-
- ActiveSupport::Notifications.instrument("transmit_subscription_confirmation.action_cable", channel_class: self.class.name) do
- connection.transmit identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:confirmation]
- @subscription_confirmation_sent = true
- end
- end
- end
-
- def reject_subscription
- connection.subscriptions.remove_subscription self
- transmit_subscription_rejection
- end
-
- def transmit_subscription_rejection
- logger.info "#{self.class.name} is transmitting the subscription rejection"
-
- ActiveSupport::Notifications.instrument("transmit_subscription_rejection.action_cable", channel_class: self.class.name) do
- connection.transmit identifier: @identifier, type: ActionCable::INTERNAL[:message_types][:rejection]
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/broadcasting.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/broadcasting.rb
deleted file mode 100644
index 23ed4ec943..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/broadcasting.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require "active_support/core_ext/object/to_param"
-
-module ActionCable
- module Channel
- module Broadcasting
- extend ActiveSupport::Concern
-
- delegate :broadcasting_for, to: :class
-
- class_methods do
- # Broadcast a hash to a unique broadcasting for this model in this channel.
- def broadcast_to(model, message)
- ActionCable.server.broadcast(broadcasting_for([ channel_name, model ]), message)
- end
-
- def broadcasting_for(model) #:nodoc:
- case
- when model.is_a?(Array)
- model.map { |m| broadcasting_for(m) }.join(":")
- when model.respond_to?(:to_gid_param)
- model.to_gid_param
- else
- model.to_param
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/callbacks.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/callbacks.rb
deleted file mode 100644
index c740132c94..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/callbacks.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require "active_support/callbacks"
-
-module ActionCable
- module Channel
- module Callbacks
- extend ActiveSupport::Concern
- include ActiveSupport::Callbacks
-
- included do
- define_callbacks :subscribe
- define_callbacks :unsubscribe
- end
-
- class_methods do
- def before_subscribe(*methods, &block)
- set_callback(:subscribe, :before, *methods, &block)
- end
-
- def after_subscribe(*methods, &block)
- set_callback(:subscribe, :after, *methods, &block)
- end
- alias_method :on_subscribe, :after_subscribe
-
- def before_unsubscribe(*methods, &block)
- set_callback(:unsubscribe, :before, *methods, &block)
- end
-
- def after_unsubscribe(*methods, &block)
- set_callback(:unsubscribe, :after, *methods, &block)
- end
- alias_method :on_unsubscribe, :after_unsubscribe
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/naming.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/naming.rb
deleted file mode 100644
index b565cb3cac..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/naming.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-module ActionCable
- module Channel
- module Naming
- extend ActiveSupport::Concern
-
- class_methods do
- # Returns the name of the channel, underscored, without the Channel ending.
- # If the channel is in a namespace, then the namespaces are represented by single
- # colon separators in the channel name.
- #
- # ChatChannel.channel_name # => 'chat'
- # Chats::AppearancesChannel.channel_name # => 'chats:appearances'
- # FooChats::BarAppearancesChannel.channel_name # => 'foo_chats:bar_appearances'
- def channel_name
- @channel_name ||= name.sub(/Channel$/, "").gsub("::", ":").underscore
- end
- end
-
- # Delegates to the class' channel_name
- delegate :channel_name, to: :class
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/periodic_timers.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/periodic_timers.rb
deleted file mode 100644
index c9daa0bcd3..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/periodic_timers.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-module ActionCable
- module Channel
- module PeriodicTimers
- extend ActiveSupport::Concern
-
- included do
- class_attribute :periodic_timers, instance_reader: false
- self.periodic_timers = []
-
- after_subscribe :start_periodic_timers
- after_unsubscribe :stop_periodic_timers
- end
-
- module ClassMethods
- # Periodically performs a task on the channel, like updating an online
- # user counter, polling a backend for new status messages, sending
- # regular "heartbeat" messages, or doing some internal work and giving
- # progress updates.
- #
- # Pass a method name or lambda argument or provide a block to call.
- # Specify the calling period in seconds using the every:
- # keyword argument.
- #
- # periodically :transmit_progress, every: 5.seconds
- #
- # periodically every: 3.minutes do
- # transmit action: :update_count, count: current_count
- # end
- #
- def periodically(callback_or_method_name = nil, every:, &block)
- callback =
- if block_given?
- raise ArgumentError, "Pass a block or provide a callback arg, not both" if callback_or_method_name
- block
- else
- case callback_or_method_name
- when Proc
- callback_or_method_name
- when Symbol
- -> { __send__ callback_or_method_name }
- else
- raise ArgumentError, "Expected a Symbol method name or a Proc, got #{callback_or_method_name.inspect}"
- end
- end
-
- unless every.kind_of?(Numeric) && every > 0
- raise ArgumentError, "Expected every: to be a positive number of seconds, got #{every.inspect}"
- end
-
- self.periodic_timers += [[ callback, every: every ]]
- end
- end
-
- private
- def active_periodic_timers
- @active_periodic_timers ||= []
- end
-
- def start_periodic_timers
- self.class.periodic_timers.each do |callback, options|
- active_periodic_timers << start_periodic_timer(callback, every: options.fetch(:every))
- end
- end
-
- def start_periodic_timer(callback, every:)
- connection.server.event_loop.timer every do
- connection.worker_pool.async_exec self, connection: connection, &callback
- end
- end
-
- def stop_periodic_timers
- active_periodic_timers.each { |timer| timer.shutdown }
- active_periodic_timers.clear
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/streams.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/streams.rb
deleted file mode 100644
index dbba333353..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/channel/streams.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-module ActionCable
- module Channel
- # Streams allow channels to route broadcastings to the subscriber. A broadcasting is, as discussed elsewhere, a pubsub queue where any data
- # placed into it is automatically sent to the clients that are connected at that time. It's purely an online queue, though. If you're not
- # streaming a broadcasting at the very moment it sends out an update, you will not get that update, even if you connect after it has been sent.
- #
- # Most commonly, the streamed broadcast is sent straight to the subscriber on the client-side. The channel just acts as a connector between
- # the two parties (the broadcaster and the channel subscriber). Here's an example of a channel that allows subscribers to get all new
- # comments on a given page:
- #
- # class CommentsChannel < ApplicationCable::Channel
- # def follow(data)
- # stream_from "comments_for_#{data['recording_id']}"
- # end
- #
- # def unfollow
- # stop_all_streams
- # end
- # end
- #
- # Based on the above example, the subscribers of this channel will get whatever data is put into the,
- # let's say, comments_for_45 broadcasting as soon as it's put there.
- #
- # An example broadcasting for this channel looks like so:
- #
- # ActionCable.server.broadcast "comments_for_45", author: 'DHH', content: 'Rails is just swell'
- #
- # If you have a stream that is related to a model, then the broadcasting used can be generated from the model and channel.
- # The following example would subscribe to a broadcasting like comments:Z2lkOi8vVGVzdEFwcC9Qb3N0LzE.
- #
- # class CommentsChannel < ApplicationCable::Channel
- # def subscribed
- # post = Post.find(params[:id])
- # stream_for post
- # end
- # end
- #
- # You can then broadcast to this channel using:
- #
- # CommentsChannel.broadcast_to(@post, @comment)
- #
- # If you don't just want to parlay the broadcast unfiltered to the subscriber, you can also supply a callback that lets you alter what is sent out.
- # The below example shows how you can use this to provide performance introspection in the process:
- #
- # class ChatChannel < ApplicationCable::Channel
- # def subscribed
- # @room = Chat::Room[params[:room_number]]
- #
- # stream_for @room, coder: ActiveSupport::JSON do |message|
- # if message['originated_at'].present?
- # elapsed_time = (Time.now.to_f - message['originated_at']).round(2)
- #
- # ActiveSupport::Notifications.instrument :performance, measurement: 'Chat.message_delay', value: elapsed_time, action: :timing
- # logger.info "Message took #{elapsed_time}s to arrive"
- # end
- #
- # transmit message
- # end
- # end
- # end
- #
- # You can stop streaming from all broadcasts by calling #stop_all_streams.
- module Streams
- extend ActiveSupport::Concern
-
- included do
- on_unsubscribe :stop_all_streams
- end
-
- # Start streaming from the named broadcasting pubsub queue. Optionally, you can pass a callback that'll be used
- # instead of the default of just transmitting the updates straight to the subscriber.
- # Pass coder: ActiveSupport::JSON to decode messages as JSON before passing to the callback.
- # Defaults to coder: nil which does no decoding, passes raw messages.
- def stream_from(broadcasting, callback = nil, coder: nil, &block)
- broadcasting = String(broadcasting)
-
- # Don't send the confirmation until pubsub#subscribe is successful
- defer_subscription_confirmation!
-
- # Build a stream handler by wrapping the user-provided callback with
- # a decoder or defaulting to a JSON-decoding retransmitter.
- handler = worker_pool_stream_handler(broadcasting, callback || block, coder: coder)
- streams << [ broadcasting, handler ]
-
- connection.server.event_loop.post do
- pubsub.subscribe(broadcasting, handler, lambda do
- ensure_confirmation_sent
- logger.info "#{self.class.name} is streaming from #{broadcasting}"
- end)
- end
- end
-
- # Start streaming the pubsub queue for the model in this channel. Optionally, you can pass a
- # callback that'll be used instead of the default of just transmitting the updates straight
- # to the subscriber.
- #
- # Pass coder: ActiveSupport::JSON to decode messages as JSON before passing to the callback.
- # Defaults to coder: nil which does no decoding, passes raw messages.
- def stream_for(model, callback = nil, coder: nil, &block)
- stream_from(broadcasting_for([ channel_name, model ]), callback || block, coder: coder)
- end
-
- # Unsubscribes all streams associated with this channel from the pubsub queue.
- def stop_all_streams
- streams.each do |broadcasting, callback|
- pubsub.unsubscribe broadcasting, callback
- logger.info "#{self.class.name} stopped streaming from #{broadcasting}"
- end.clear
- end
-
- private
- delegate :pubsub, to: :connection
-
- def streams
- @_streams ||= []
- end
-
- # Always wrap the outermost handler to invoke the user handler on the
- # worker pool rather than blocking the event loop.
- def worker_pool_stream_handler(broadcasting, user_handler, coder: nil)
- handler = stream_handler(broadcasting, user_handler, coder: coder)
-
- -> message do
- connection.worker_pool.async_invoke handler, :call, message, connection: connection
- end
- end
-
- # May be overridden to add instrumentation, logging, specialized error
- # handling, or other forms of handler decoration.
- #
- # TODO: Tests demonstrating this.
- def stream_handler(broadcasting, user_handler, coder: nil)
- if user_handler
- stream_decoder user_handler, coder: coder
- else
- default_stream_handler broadcasting, coder: coder
- end
- end
-
- # May be overridden to change the default stream handling behavior
- # which decodes JSON and transmits to the client.
- #
- # TODO: Tests demonstrating this.
- #
- # TODO: Room for optimization. Update transmit API to be coder-aware
- # so we can no-op when pubsub and connection are both JSON-encoded.
- # Then we can skip decode+encode if we're just proxying messages.
- def default_stream_handler(broadcasting, coder:)
- coder ||= ActiveSupport::JSON
- stream_transmitter stream_decoder(coder: coder), broadcasting: broadcasting
- end
-
- def stream_decoder(handler = identity_handler, coder:)
- if coder
- -> message { handler.(coder.decode(message)) }
- else
- handler
- end
- end
-
- def stream_transmitter(handler = identity_handler, broadcasting:)
- via = "streamed from #{broadcasting}"
-
- -> (message) do
- transmit handler.(message), via: via
- end
- end
-
- def identity_handler
- -> message { message }
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection.rb
deleted file mode 100644
index 902efb07e2..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-module ActionCable
- module Connection
- extend ActiveSupport::Autoload
-
- eager_autoload do
- autoload :Authorization
- autoload :Base
- autoload :ClientSocket
- autoload :Identification
- autoload :InternalChannel
- autoload :MessageBuffer
- autoload :Stream
- autoload :StreamEventLoop
- autoload :Subscriptions
- autoload :TaggedLoggerProxy
- autoload :WebSocket
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/authorization.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/authorization.rb
deleted file mode 100644
index 989a67d6df..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/authorization.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module ActionCable
- module Connection
- module Authorization
- class UnauthorizedError < StandardError; end
-
- # Closes the \WebSocket connection if it is open and returns a 404 "File not Found" response.
- def reject_unauthorized_connection
- logger.error "An unauthorized connection attempt was rejected"
- raise UnauthorizedError
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/base.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/base.rb
deleted file mode 100644
index ac5f405dea..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/base.rb
+++ /dev/null
@@ -1,258 +0,0 @@
-require "action_dispatch"
-
-module ActionCable
- module Connection
- # For every WebSocket connection the Action Cable server accepts, a Connection object will be instantiated. This instance becomes the parent
- # of all of the channel subscriptions that are created from there on. Incoming messages are then routed to these channel subscriptions
- # based on an identifier sent by the Action Cable consumer. The Connection itself does not deal with any specific application logic beyond
- # authentication and authorization.
- #
- # Here's a basic example:
- #
- # module ApplicationCable
- # class Connection < ActionCable::Connection::Base
- # identified_by :current_user
- #
- # def connect
- # self.current_user = find_verified_user
- # logger.add_tags current_user.name
- # end
- #
- # def disconnect
- # # Any cleanup work needed when the cable connection is cut.
- # end
- #
- # private
- # def find_verified_user
- # User.find_by_identity(cookies.signed[:identity_id]) ||
- # reject_unauthorized_connection
- # end
- # end
- # end
- #
- # First, we declare that this connection can be identified by its current_user. This allows us to later be able to find all connections
- # established for that current_user (and potentially disconnect them). You can declare as many
- # identification indexes as you like. Declaring an identification means that an attr_accessor is automatically set for that key.
- #
- # Second, we rely on the fact that the WebSocket connection is established with the cookies from the domain being sent along. This makes
- # it easy to use signed cookies that were set when logging in via a web interface to authorize the WebSocket connection.
- #
- # Finally, we add a tag to the connection-specific logger with the name of the current user to easily distinguish their messages in the log.
- #
- # Pretty simple, eh?
- class Base
- include Identification
- include InternalChannel
- include Authorization
-
- attr_reader :server, :env, :subscriptions, :logger, :worker_pool, :protocol
- delegate :event_loop, :pubsub, to: :server
-
- def initialize(server, env, coder: ActiveSupport::JSON)
- @server, @env, @coder = server, env, coder
-
- @worker_pool = server.worker_pool
- @logger = new_tagged_logger
-
- @websocket = ActionCable::Connection::WebSocket.new(env, self, event_loop)
- @subscriptions = ActionCable::Connection::Subscriptions.new(self)
- @message_buffer = ActionCable::Connection::MessageBuffer.new(self)
-
- @_internal_subscriptions = nil
- @started_at = Time.now
- end
-
- # Called by the server when a new WebSocket connection is established. This configures the callbacks intended for overwriting by the user.
- # This method should not be called directly -- instead rely upon on the #connect (and #disconnect) callbacks.
- def process #:nodoc:
- logger.info started_request_message
-
- if websocket.possible? && allow_request_origin?
- respond_to_successful_request
- else
- respond_to_invalid_request
- end
- end
-
- # Decodes WebSocket messages and dispatches them to subscribed channels.
- # WebSocket message transfer encoding is always JSON.
- def receive(websocket_message) #:nodoc:
- send_async :dispatch_websocket_message, websocket_message
- end
-
- def dispatch_websocket_message(websocket_message) #:nodoc:
- if websocket.alive?
- subscriptions.execute_command decode(websocket_message)
- else
- logger.error "Ignoring message processed after the WebSocket was closed: #{websocket_message.inspect})"
- end
- end
-
- def transmit(cable_message) # :nodoc:
- websocket.transmit encode(cable_message)
- end
-
- # Close the WebSocket connection.
- def close
- websocket.close
- end
-
- # Invoke a method on the connection asynchronously through the pool of thread workers.
- def send_async(method, *arguments)
- worker_pool.async_invoke(self, method, *arguments)
- end
-
- # Return a basic hash of statistics for the connection keyed with identifier, started_at, subscriptions, and request_id.
- # This can be returned by a health check against the connection.
- def statistics
- {
- identifier: connection_identifier,
- started_at: @started_at,
- subscriptions: subscriptions.identifiers,
- request_id: @env["action_dispatch.request_id"]
- }
- end
-
- def beat
- transmit type: ActionCable::INTERNAL[:message_types][:ping], message: Time.now.to_i
- end
-
- def on_open # :nodoc:
- send_async :handle_open
- end
-
- def on_message(message) # :nodoc:
- message_buffer.append message
- end
-
- def on_error(message) # :nodoc:
- # log errors to make diagnosing socket errors easier
- logger.error "WebSocket error occurred: #{message}"
- end
-
- def on_close(reason, code) # :nodoc:
- send_async :handle_close
- end
-
- # TODO Change this to private once we've dropped Ruby 2.2 support.
- # Workaround for Ruby 2.2 "private attribute?" warning.
- protected
- attr_reader :websocket
- attr_reader :message_buffer
-
- private
- # The request that initiated the WebSocket connection is available here. This gives access to the environment, cookies, etc.
- def request # :doc:
- @request ||= begin
- environment = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
- ActionDispatch::Request.new(environment || env)
- end
- end
-
- # The cookies of the request that initiated the WebSocket connection. Useful for performing authorization checks.
- def cookies # :doc:
- request.cookie_jar
- end
-
- def encode(cable_message)
- @coder.encode cable_message
- end
-
- def decode(websocket_message)
- @coder.decode websocket_message
- end
-
- def handle_open
- @protocol = websocket.protocol
- connect if respond_to?(:connect)
- subscribe_to_internal_channel
- send_welcome_message
-
- message_buffer.process!
- server.add_connection(self)
- rescue ActionCable::Connection::Authorization::UnauthorizedError
- respond_to_invalid_request
- end
-
- def handle_close
- logger.info finished_request_message
-
- server.remove_connection(self)
-
- subscriptions.unsubscribe_from_all
- unsubscribe_from_internal_channel
-
- disconnect if respond_to?(:disconnect)
- end
-
- def send_welcome_message
- # Send welcome message to the internal connection monitor channel.
- # This ensures the connection monitor state is reset after a successful
- # websocket connection.
- transmit type: ActionCable::INTERNAL[:message_types][:welcome]
- end
-
- def allow_request_origin?
- return true if server.config.disable_request_forgery_protection
-
- proto = Rack::Request.new(env).ssl? ? "https" : "http"
- if server.config.allow_same_origin_as_host && env["HTTP_ORIGIN"] == "#{proto}://#{env['HTTP_HOST']}"
- true
- elsif Array(server.config.allowed_request_origins).any? { |allowed_origin| allowed_origin === env["HTTP_ORIGIN"] }
- true
- else
- logger.error("Request origin not allowed: #{env['HTTP_ORIGIN']}")
- false
- end
- end
-
- def respond_to_successful_request
- logger.info successful_request_message
- websocket.rack_response
- end
-
- def respond_to_invalid_request
- close if websocket.alive?
-
- logger.error invalid_request_message
- logger.info finished_request_message
- [ 404, { "Content-Type" => "text/plain" }, [ "Page not found" ] ]
- end
-
- # Tags are declared in the server but computed in the connection. This allows us per-connection tailored tags.
- def new_tagged_logger
- TaggedLoggerProxy.new server.logger,
- tags: server.config.log_tags.map { |tag| tag.respond_to?(:call) ? tag.call(request) : tag.to_s.camelize }
- end
-
- def started_request_message
- 'Started %s "%s"%s for %s at %s' % [
- request.request_method,
- request.filtered_path,
- websocket.possible? ? " [WebSocket]" : "[non-WebSocket]",
- request.ip,
- Time.now.to_s ]
- end
-
- def finished_request_message
- 'Finished "%s"%s for %s at %s' % [
- request.filtered_path,
- websocket.possible? ? " [WebSocket]" : "[non-WebSocket]",
- request.ip,
- Time.now.to_s ]
- end
-
- def invalid_request_message
- "Failed to upgrade to WebSocket (REQUEST_METHOD: %s, HTTP_CONNECTION: %s, HTTP_UPGRADE: %s)" % [
- env["REQUEST_METHOD"], env["HTTP_CONNECTION"], env["HTTP_UPGRADE"]
- ]
- end
-
- def successful_request_message
- "Successfully upgraded to WebSocket (REQUEST_METHOD: %s, HTTP_CONNECTION: %s, HTTP_UPGRADE: %s)" % [
- env["REQUEST_METHOD"], env["HTTP_CONNECTION"], env["HTTP_UPGRADE"]
- ]
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/client_socket.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/client_socket.rb
deleted file mode 100644
index c7e30e78c8..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/client_socket.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-require "websocket/driver"
-
-module ActionCable
- module Connection
- #--
- # This class is heavily based on faye-websocket-ruby
- #
- # Copyright (c) 2010-2015 James Coglan
- class ClientSocket # :nodoc:
- def self.determine_url(env)
- scheme = secure_request?(env) ? "wss:" : "ws:"
- "#{ scheme }//#{ env['HTTP_HOST'] }#{ env['REQUEST_URI'] }"
- end
-
- def self.secure_request?(env)
- return true if env["HTTPS"] == "on"
- return true if env["HTTP_X_FORWARDED_SSL"] == "on"
- return true if env["HTTP_X_FORWARDED_SCHEME"] == "https"
- return true if env["HTTP_X_FORWARDED_PROTO"] == "https"
- return true if env["rack.url_scheme"] == "https"
-
- return false
- end
-
- CONNECTING = 0
- OPEN = 1
- CLOSING = 2
- CLOSED = 3
-
- attr_reader :env, :url
-
- def initialize(env, event_target, event_loop, protocols)
- @env = env
- @event_target = event_target
- @event_loop = event_loop
-
- @url = ClientSocket.determine_url(@env)
-
- @driver = @driver_started = nil
- @close_params = ["", 1006]
-
- @ready_state = CONNECTING
-
- # The driver calls +env+, +url+, and +write+
- @driver = ::WebSocket::Driver.rack(self, protocols: protocols)
-
- @driver.on(:open) { |e| open }
- @driver.on(:message) { |e| receive_message(e.data) }
- @driver.on(:close) { |e| begin_close(e.reason, e.code) }
- @driver.on(:error) { |e| emit_error(e.message) }
-
- @stream = ActionCable::Connection::Stream.new(@event_loop, self)
- end
-
- def start_driver
- return if @driver.nil? || @driver_started
- @stream.hijack_rack_socket
-
- if callback = @env["async.callback"]
- callback.call([101, {}, @stream])
- end
-
- @driver_started = true
- @driver.start
- end
-
- def rack_response
- start_driver
- [ -1, {}, [] ]
- end
-
- def write(data)
- @stream.write(data)
- rescue => e
- emit_error e.message
- end
-
- def transmit(message)
- return false if @ready_state > OPEN
- case message
- when Numeric then @driver.text(message.to_s)
- when String then @driver.text(message)
- when Array then @driver.binary(message)
- else false
- end
- end
-
- def close(code = nil, reason = nil)
- code ||= 1000
- reason ||= ""
-
- unless code == 1000 || (code >= 3000 && code <= 4999)
- raise ArgumentError, "Failed to execute 'close' on WebSocket: " \
- "The code must be either 1000, or between 3000 and 4999. " \
- "#{code} is neither."
- end
-
- @ready_state = CLOSING unless @ready_state == CLOSED
- @driver.close(reason, code)
- end
-
- def parse(data)
- @driver.parse(data)
- end
-
- def client_gone
- finalize_close
- end
-
- def alive?
- @ready_state == OPEN
- end
-
- def protocol
- @driver.protocol
- end
-
- private
- def open
- return unless @ready_state == CONNECTING
- @ready_state = OPEN
-
- @event_target.on_open
- end
-
- def receive_message(data)
- return unless @ready_state == OPEN
-
- @event_target.on_message(data)
- end
-
- def emit_error(message)
- return if @ready_state >= CLOSING
-
- @event_target.on_error(message)
- end
-
- def begin_close(reason, code)
- return if @ready_state == CLOSED
- @ready_state = CLOSING
- @close_params = [reason, code]
-
- @stream.shutdown if @stream
- finalize_close
- end
-
- def finalize_close
- return if @ready_state == CLOSED
- @ready_state = CLOSED
-
- @event_target.on_close(*@close_params)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/identification.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/identification.rb
deleted file mode 100644
index c91a1d1fd7..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/identification.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require "set"
-
-module ActionCable
- module Connection
- module Identification
- extend ActiveSupport::Concern
-
- included do
- class_attribute :identifiers
- self.identifiers = Set.new
- end
-
- class_methods do
- # Mark a key as being a connection identifier index that can then be used to find the specific connection again later.
- # Common identifiers are current_user and current_account, but could be anything, really.
- #
- # Note that anything marked as an identifier will automatically create a delegate by the same name on any
- # channel instances created off the connection.
- def identified_by(*identifiers)
- Array(identifiers).each { |identifier| attr_accessor identifier }
- self.identifiers += identifiers
- end
- end
-
- # Return a single connection identifier that combines the value of all the registered identifiers into a single gid.
- def connection_identifier
- unless defined? @connection_identifier
- @connection_identifier = connection_gid identifiers.map { |id| instance_variable_get("@#{id}") }.compact
- end
-
- @connection_identifier
- end
-
- private
- def connection_gid(ids)
- ids.map do |o|
- if o.respond_to? :to_gid_param
- o.to_gid_param
- else
- o.to_s
- end
- end.sort.join(":")
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/internal_channel.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/internal_channel.rb
deleted file mode 100644
index 8f0ec766c3..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/internal_channel.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-module ActionCable
- module Connection
- # Makes it possible for the RemoteConnection to disconnect a specific connection.
- module InternalChannel
- extend ActiveSupport::Concern
-
- private
- def internal_channel
- "action_cable/#{connection_identifier}"
- end
-
- def subscribe_to_internal_channel
- if connection_identifier.present?
- callback = -> (message) { process_internal_message decode(message) }
- @_internal_subscriptions ||= []
- @_internal_subscriptions << [ internal_channel, callback ]
-
- server.event_loop.post { pubsub.subscribe(internal_channel, callback) }
- logger.info "Registered connection (#{connection_identifier})"
- end
- end
-
- def unsubscribe_from_internal_channel
- if @_internal_subscriptions.present?
- @_internal_subscriptions.each { |channel, callback| server.event_loop.post { pubsub.unsubscribe(channel, callback) } }
- end
- end
-
- def process_internal_message(message)
- case message["type"]
- when "disconnect"
- logger.info "Removing connection (#{connection_identifier})"
- websocket.close
- end
- rescue Exception => e
- logger.error "There was an exception - #{e.class}(#{e.message})"
- logger.error e.backtrace.join("\n")
-
- close
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/message_buffer.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/message_buffer.rb
deleted file mode 100644
index 4ccd322644..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/message_buffer.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-module ActionCable
- module Connection
- # Allows us to buffer messages received from the WebSocket before the Connection has been fully initialized, and is ready to receive them.
- class MessageBuffer # :nodoc:
- def initialize(connection)
- @connection = connection
- @buffered_messages = []
- end
-
- def append(message)
- if valid? message
- if processing?
- receive message
- else
- buffer message
- end
- else
- connection.logger.error "Couldn't handle non-string message: #{message.class}"
- end
- end
-
- def processing?
- @processing
- end
-
- def process!
- @processing = true
- receive_buffered_messages
- end
-
- # TODO Change this to private once we've dropped Ruby 2.2 support.
- # Workaround for Ruby 2.2 "private attribute?" warning.
- protected
- attr_reader :connection
- attr_reader :buffered_messages
-
- private
- def valid?(message)
- message.is_a?(String)
- end
-
- def receive(message)
- connection.receive message
- end
-
- def buffer(message)
- buffered_messages << message
- end
-
- def receive_buffered_messages
- receive buffered_messages.shift until buffered_messages.empty?
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream.rb
deleted file mode 100644
index e620b93845..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require "thread"
-
-module ActionCable
- module Connection
- #--
- # This class is heavily based on faye-websocket-ruby
- #
- # Copyright (c) 2010-2015 James Coglan
- class Stream # :nodoc:
- def initialize(event_loop, socket)
- @event_loop = event_loop
- @socket_object = socket
- @stream_send = socket.env["stream.send"]
-
- @rack_hijack_io = nil
- @write_lock = Mutex.new
-
- @write_head = nil
- @write_buffer = Queue.new
- end
-
- def each(&callback)
- @stream_send ||= callback
- end
-
- def close
- shutdown
- @socket_object.client_gone
- end
-
- def shutdown
- clean_rack_hijack
- end
-
- def write(data)
- if @stream_send
- return @stream_send.call(data)
- end
-
- if @write_lock.try_lock
- begin
- if @write_head.nil? && @write_buffer.empty?
- written = @rack_hijack_io.write_nonblock(data, exception: false)
-
- case written
- when :wait_writable
- # proceed below
- when data.bytesize
- return data.bytesize
- else
- @write_head = data.byteslice(written, data.bytesize)
- @event_loop.writes_pending @rack_hijack_io
-
- return data.bytesize
- end
- end
- ensure
- @write_lock.unlock
- end
- end
-
- @write_buffer << data
- @event_loop.writes_pending @rack_hijack_io
-
- data.bytesize
- rescue EOFError, Errno::ECONNRESET
- @socket_object.client_gone
- end
-
- def flush_write_buffer
- @write_lock.synchronize do
- loop do
- if @write_head.nil?
- return true if @write_buffer.empty?
- @write_head = @write_buffer.pop
- end
-
- written = @rack_hijack_io.write_nonblock(@write_head, exception: false)
- case written
- when :wait_writable
- return false
- when @write_head.bytesize
- @write_head = nil
- else
- @write_head = @write_head.byteslice(written, @write_head.bytesize)
- return false
- end
- end
- end
- end
-
- def receive(data)
- @socket_object.parse(data)
- end
-
- def hijack_rack_socket
- return unless @socket_object.env["rack.hijack"]
-
- @socket_object.env["rack.hijack"].call
- @rack_hijack_io = @socket_object.env["rack.hijack_io"]
-
- @event_loop.attach(@rack_hijack_io, self)
- end
-
- private
- def clean_rack_hijack
- return unless @rack_hijack_io
- @event_loop.detach(@rack_hijack_io, self)
- @rack_hijack_io = nil
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream_event_loop.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream_event_loop.rb
deleted file mode 100644
index 2d1af0ff9f..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/stream_event_loop.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-require "nio"
-require "thread"
-
-module ActionCable
- module Connection
- class StreamEventLoop
- def initialize
- @nio = @executor = @thread = nil
- @map = {}
- @stopping = false
- @todo = Queue.new
-
- @spawn_mutex = Mutex.new
- end
-
- def timer(interval, &block)
- Concurrent::TimerTask.new(execution_interval: interval, &block).tap(&:execute)
- end
-
- def post(task = nil, &block)
- task ||= block
-
- spawn
- @executor << task
- end
-
- def attach(io, stream)
- @todo << lambda do
- @map[io] = @nio.register(io, :r)
- @map[io].value = stream
- end
- wakeup
- end
-
- def detach(io, stream)
- @todo << lambda do
- @nio.deregister io
- @map.delete io
- io.close
- end
- wakeup
- end
-
- def writes_pending(io)
- @todo << lambda do
- if monitor = @map[io]
- monitor.interests = :rw
- end
- end
- wakeup
- end
-
- def stop
- @stopping = true
- wakeup if @nio
- end
-
- private
- def spawn
- return if @thread && @thread.status
-
- @spawn_mutex.synchronize do
- return if @thread && @thread.status
-
- @nio ||= NIO::Selector.new
-
- @executor ||= Concurrent::ThreadPoolExecutor.new(
- min_threads: 1,
- max_threads: 10,
- max_queue: 0,
- )
-
- @thread = Thread.new { run }
-
- return true
- end
- end
-
- def wakeup
- spawn || @nio.wakeup
- end
-
- def run
- loop do
- if @stopping
- @nio.close
- break
- end
-
- until @todo.empty?
- @todo.pop(true).call
- end
-
- next unless monitors = @nio.select
-
- monitors.each do |monitor|
- io = monitor.io
- stream = monitor.value
-
- begin
- if monitor.writable?
- if stream.flush_write_buffer
- monitor.interests = :r
- end
- next unless monitor.readable?
- end
-
- incoming = io.read_nonblock(4096, exception: false)
- case incoming
- when :wait_readable
- next
- when nil
- stream.close
- else
- stream.receive incoming
- end
- rescue
- # We expect one of EOFError or Errno::ECONNRESET in
- # normal operation (when the client goes away). But if
- # anything else goes wrong, this is still the best way
- # to handle it.
- begin
- stream.close
- rescue
- @nio.deregister io
- @map.delete io
- end
- end
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/subscriptions.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/subscriptions.rb
deleted file mode 100644
index 44bce1e195..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/subscriptions.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-require "active_support/core_ext/hash/indifferent_access"
-
-module ActionCable
- module Connection
- # Collection class for all the channel subscriptions established on a given connection. Responsible for routing incoming commands that arrive on
- # the connection to the proper channel.
- class Subscriptions # :nodoc:
- def initialize(connection)
- @connection = connection
- @subscriptions = {}
- end
-
- def execute_command(data)
- case data["command"]
- when "subscribe" then add data
- when "unsubscribe" then remove data
- when "message" then perform_action data
- else
- logger.error "Received unrecognized command in #{data.inspect}"
- end
- rescue Exception => e
- logger.error "Could not execute command from (#{data.inspect}) [#{e.class} - #{e.message}]: #{e.backtrace.first(5).join(" | ")}"
- end
-
- def add(data)
- id_key = data["identifier"]
- id_options = ActiveSupport::JSON.decode(id_key).with_indifferent_access
-
- return if subscriptions.key?(id_key)
-
- subscription_klass = id_options[:channel].safe_constantize
-
- if subscription_klass && ActionCable::Channel::Base >= subscription_klass
- subscription = subscription_klass.new(connection, id_key, id_options)
- subscriptions[id_key] = subscription
- subscription.subscribe_to_channel
- else
- logger.error "Subscription class not found: #{id_options[:channel].inspect}"
- end
- end
-
- def remove(data)
- logger.info "Unsubscribing from channel: #{data['identifier']}"
- remove_subscription subscriptions[data["identifier"]]
- end
-
- def remove_subscription(subscription)
- subscription.unsubscribe_from_channel
- subscriptions.delete(subscription.identifier)
- end
-
- def perform_action(data)
- find(data).perform_action ActiveSupport::JSON.decode(data["data"])
- end
-
- def identifiers
- subscriptions.keys
- end
-
- def unsubscribe_from_all
- subscriptions.each { |id, channel| remove_subscription(channel) }
- end
-
- # TODO Change this to private once we've dropped Ruby 2.2 support.
- # Workaround for Ruby 2.2 "private attribute?" warning.
- protected
- attr_reader :connection, :subscriptions
-
- private
- delegate :logger, to: :connection
-
- def find(data)
- if subscription = subscriptions[data["identifier"]]
- subscription
- else
- raise "Unable to find subscription with identifier: #{data['identifier']}"
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/tagged_logger_proxy.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/tagged_logger_proxy.rb
deleted file mode 100644
index aef549aa86..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/tagged_logger_proxy.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module ActionCable
- module Connection
- # Allows the use of per-connection tags against the server logger. This wouldn't work using the traditional
- # ActiveSupport::TaggedLogging enhanced Rails.logger, as that logger will reset the tags between requests.
- # The connection is long-lived, so it needs its own set of tags for its independent duration.
- class TaggedLoggerProxy
- attr_reader :tags
-
- def initialize(logger, tags:)
- @logger = logger
- @tags = tags.flatten
- end
-
- def add_tags(*tags)
- @tags += tags.flatten
- @tags = @tags.uniq
- end
-
- def tag(logger)
- if logger.respond_to?(:tagged)
- current_tags = tags - logger.formatter.current_tags
- logger.tagged(*current_tags) { yield }
- else
- yield
- end
- end
-
- %i( debug info warn error fatal unknown ).each do |severity|
- define_method(severity) do |message|
- log severity, message
- end
- end
-
- private
- def log(type, message) # :doc:
- tag(@logger) { @logger.send type, message }
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/web_socket.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/web_socket.rb
deleted file mode 100644
index 03eb6e2ea8..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/connection/web_socket.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require "websocket/driver"
-
-module ActionCable
- module Connection
- # Wrap the real socket to minimize the externally-presented API
- class WebSocket
- def initialize(env, event_target, event_loop, protocols: ActionCable::INTERNAL[:protocols])
- @websocket = ::WebSocket::Driver.websocket?(env) ? ClientSocket.new(env, event_target, event_loop, protocols) : nil
- end
-
- def possible?
- websocket
- end
-
- def alive?
- websocket && websocket.alive?
- end
-
- def transmit(data)
- websocket.transmit data
- end
-
- def close
- websocket.close
- end
-
- def protocol
- websocket.protocol
- end
-
- def rack_response
- websocket.rack_response
- end
-
- # TODO Change this to private once we've dropped Ruby 2.2 support.
- # Workaround for Ruby 2.2 "private attribute?" warning.
- protected
- attr_reader :websocket
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/engine.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/engine.rb
deleted file mode 100644
index 63a26636a0..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/engine.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require "rails"
-require "action_cable"
-require "action_cable/helpers/action_cable_helper"
-require "active_support/core_ext/hash/indifferent_access"
-
-module ActionCable
- class Engine < Rails::Engine # :nodoc:
- config.action_cable = ActiveSupport::OrderedOptions.new
- config.action_cable.mount_path = ActionCable::INTERNAL[:default_mount_path]
-
- config.eager_load_namespaces << ActionCable
-
- initializer "action_cable.helpers" do
- ActiveSupport.on_load(:action_view) do
- include ActionCable::Helpers::ActionCableHelper
- end
- end
-
- initializer "action_cable.logger" do
- ActiveSupport.on_load(:action_cable) { self.logger ||= ::Rails.logger }
- end
-
- initializer "action_cable.set_configs" do |app|
- options = app.config.action_cable
- options.allowed_request_origins ||= /https?:\/\/localhost:\d+/ if ::Rails.env.development?
-
- app.paths.add "config/cable", with: "config/cable.yml"
-
- ActiveSupport.on_load(:action_cable) do
- if (config_path = Pathname.new(app.config.paths["config/cable"].first)).exist?
- self.cable = Rails.application.config_for(config_path).with_indifferent_access
- end
-
- previous_connection_class = connection_class
- self.connection_class = -> { "ApplicationCable::Connection".safe_constantize || previous_connection_class.call }
-
- options.each { |k, v| send("#{k}=", v) }
- end
- end
-
- initializer "action_cable.routes" do
- config.after_initialize do |app|
- config = app.config
- unless config.action_cable.mount_path.nil?
- app.routes.prepend do
- mount ActionCable.server => config.action_cable.mount_path, internal: true
- end
- end
- end
- end
-
- initializer "action_cable.set_work_hooks" do |app|
- ActiveSupport.on_load(:action_cable) do
- ActionCable::Server::Worker.set_callback :work, :around, prepend: true do |_, inner|
- app.executor.wrap do
- # If we took a while to get the lock, we may have been halted
- # in the meantime. As we haven't started doing any real work
- # yet, we should pretend that we never made it off the queue.
- unless stopping?
- inner.call
- end
- end
- end
-
- wrap = lambda do |_, inner|
- app.executor.wrap(&inner)
- end
- ActionCable::Channel::Base.set_callback :subscribe, :around, prepend: true, &wrap
- ActionCable::Channel::Base.set_callback :unsubscribe, :around, prepend: true, &wrap
-
- app.reloader.before_class_unload do
- ActionCable.server.restart
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/gem_version.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/gem_version.rb
deleted file mode 100644
index d088e7faf2..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/gem_version.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module ActionCable
- # Returns the version of the currently loaded Action Cable as a Gem::Version.
- def self.gem_version
- Gem::Version.new VERSION::STRING
- end
-
- module VERSION
- MAJOR = 5
- MINOR = 1
- TINY = 7
- PRE = nil
-
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/helpers/action_cable_helper.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/helpers/action_cable_helper.rb
deleted file mode 100644
index f53be0bc31..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/helpers/action_cable_helper.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module ActionCable
- module Helpers
- module ActionCableHelper
- # Returns an "action-cable-url" meta tag with the value of the URL specified in your
- # configuration. Ensure this is above your JavaScript tag:
- #
- #
- # <%= action_cable_meta_tag %>
- # <%= javascript_include_tag 'application', 'data-turbolinks-track' => 'reload' %>
- #
- #
- # This is then used by Action Cable to determine the URL of your WebSocket server.
- # Your CoffeeScript can then connect to the server without needing to specify the
- # URL directly:
- #
- # #= require cable
- # @App = {}
- # App.cable = Cable.createConsumer()
- #
- # Make sure to specify the correct server location in each of your environment
- # config files:
- #
- # config.action_cable.mount_path = "/cable123"
- # <%= action_cable_meta_tag %> would render:
- # =>
- #
- # config.action_cable.url = "ws://actioncable.com"
- # <%= action_cable_meta_tag %> would render:
- # =>
- #
- def action_cable_meta_tag
- tag "meta", name: "action-cable-url", content: (
- ActionCable.server.config.url ||
- ActionCable.server.config.mount_path ||
- raise("No Action Cable URL configured -- please configure this at config.action_cable.url")
- )
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/remote_connections.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/remote_connections.rb
deleted file mode 100644
index d2856bc6ae..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/remote_connections.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-module ActionCable
- # If you need to disconnect a given connection, you can go through the
- # RemoteConnections. You can find the connections you're looking for by
- # searching for the identifier declared on the connection. For example:
- #
- # module ApplicationCable
- # class Connection < ActionCable::Connection::Base
- # identified_by :current_user
- # ....
- # end
- # end
- #
- # ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect
- #
- # This will disconnect all the connections established for
- # User.find(1), across all servers running on all machines, because
- # it uses the internal channel that all of these servers are subscribed to.
- class RemoteConnections
- attr_reader :server
-
- def initialize(server)
- @server = server
- end
-
- def where(identifier)
- RemoteConnection.new(server, identifier)
- end
-
- private
- # Represents a single remote connection found via ActionCable.server.remote_connections.where(*).
- # Exists solely for the purpose of calling #disconnect on that connection.
- class RemoteConnection
- class InvalidIdentifiersError < StandardError; end
-
- include Connection::Identification, Connection::InternalChannel
-
- def initialize(server, ids)
- @server = server
- set_identifier_instance_vars(ids)
- end
-
- # Uses the internal channel to disconnect the connection.
- def disconnect
- server.broadcast internal_channel, type: "disconnect"
- end
-
- # Returns all the identifiers that were applied to this connection.
- def identifiers
- server.connection_identifiers
- end
-
- private
- attr_reader :server
-
- def set_identifier_instance_vars(ids)
- raise InvalidIdentifiersError unless valid_identifiers?(ids)
- ids.each { |k, v| instance_variable_set("@#{k}", v) }
- end
-
- def valid_identifiers?(ids)
- keys = ids.keys
- identifiers.all? { |id| keys.include?(id) }
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server.rb
deleted file mode 100644
index 22f9353825..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module ActionCable
- module Server
- extend ActiveSupport::Autoload
-
- eager_autoload do
- autoload :Base
- autoload :Broadcasting
- autoload :Connections
- autoload :Configuration
-
- autoload :Worker
- autoload :ActiveRecordConnectionManagement, "action_cable/server/worker/active_record_connection_management"
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/base.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/base.rb
deleted file mode 100644
index 419eccd73c..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/base.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require "monitor"
-
-module ActionCable
- module Server
- # A singleton ActionCable::Server instance is available via ActionCable.server. It's used by the Rack process that starts the Action Cable server, but
- # is also used by the user to reach the RemoteConnections object, which is used for finding and disconnecting connections across all servers.
- #
- # Also, this is the server instance used for broadcasting. See Broadcasting for more information.
- class Base
- include ActionCable::Server::Broadcasting
- include ActionCable::Server::Connections
-
- cattr_accessor(:config, instance_accessor: true) { ActionCable::Server::Configuration.new }
-
- def self.logger; config.logger; end
- delegate :logger, to: :config
-
- attr_reader :mutex
-
- def initialize
- @mutex = Monitor.new
- @remote_connections = @event_loop = @worker_pool = @pubsub = nil
- end
-
- # Called by Rack to setup the server.
- def call(env)
- setup_heartbeat_timer
- config.connection_class.call.new(self, env).process
- end
-
- # Disconnect all the connections identified by `identifiers` on this server or any others via RemoteConnections.
- def disconnect(identifiers)
- remote_connections.where(identifiers).disconnect
- end
-
- def restart
- connections.each(&:close)
-
- @mutex.synchronize do
- # Shutdown the worker pool
- @worker_pool.halt if @worker_pool
- @worker_pool = nil
-
- # Shutdown the pub/sub adapter
- @pubsub.shutdown if @pubsub
- @pubsub = nil
- end
- end
-
- # Gateway to RemoteConnections. See that class for details.
- def remote_connections
- @remote_connections || @mutex.synchronize { @remote_connections ||= RemoteConnections.new(self) }
- end
-
- def event_loop
- @event_loop || @mutex.synchronize { @event_loop ||= ActionCable::Connection::StreamEventLoop.new }
- end
-
- # The worker pool is where we run connection callbacks and channel actions. We do as little as possible on the server's main thread.
- # The worker pool is an executor service that's backed by a pool of threads working from a task queue. The thread pool size maxes out
- # at 4 worker threads by default. Tune the size yourself with config.action_cable.worker_pool_size.
- #
- # Using Active Record, Redis, etc within your channel actions means you'll get a separate connection from each thread in the worker pool.
- # Plan your deployment accordingly: 5 servers each running 5 Puma workers each running an 8-thread worker pool means at least 200 database
- # connections.
- #
- # Also, ensure that your database connection pool size is as least as large as your worker pool size. Otherwise, workers may oversubscribe
- # the database connection pool and block while they wait for other workers to release their connections. Use a smaller worker pool or a larger
- # database connection pool instead.
- def worker_pool
- @worker_pool || @mutex.synchronize { @worker_pool ||= ActionCable::Server::Worker.new(max_size: config.worker_pool_size) }
- end
-
- # Adapter used for all streams/broadcasting.
- def pubsub
- @pubsub || @mutex.synchronize { @pubsub ||= config.pubsub_adapter.new(self) }
- end
-
- # All of the identifiers applied to the connection class associated with this server.
- def connection_identifiers
- config.connection_class.call.identifiers
- end
- end
-
- ActiveSupport.run_load_hooks(:action_cable, Base.config)
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/broadcasting.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/broadcasting.rb
deleted file mode 100644
index 7fcd6c6587..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/broadcasting.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-module ActionCable
- module Server
- # Broadcasting is how other parts of your application can send messages to a channel's subscribers. As explained in Channel, most of the time, these
- # broadcastings are streamed directly to the clients subscribed to the named broadcasting. Let's explain with a full-stack example:
- #
- # class WebNotificationsChannel < ApplicationCable::Channel
- # def subscribed
- # stream_from "web_notifications_#{current_user.id}"
- # end
- # end
- #
- # # Somewhere in your app this is called, perhaps from a NewCommentJob:
- # ActionCable.server.broadcast \
- # "web_notifications_1", { title: "New things!", body: "All that's fit for print" }
- #
- # # Client-side CoffeeScript, which assumes you've already requested the right to send web notifications:
- # App.cable.subscriptions.create "WebNotificationsChannel",
- # received: (data) ->
- # new Notification data['title'], body: data['body']
- module Broadcasting
- # Broadcast a hash directly to a named broadcasting. This will later be JSON encoded.
- def broadcast(broadcasting, message, coder: ActiveSupport::JSON)
- broadcaster_for(broadcasting, coder: coder).broadcast(message)
- end
-
- # Returns a broadcaster for a named broadcasting that can be reused. Useful when you have an object that
- # may need multiple spots to transmit to a specific broadcasting over and over.
- def broadcaster_for(broadcasting, coder: ActiveSupport::JSON)
- Broadcaster.new(self, String(broadcasting), coder: coder)
- end
-
- private
- class Broadcaster
- attr_reader :server, :broadcasting, :coder
-
- def initialize(server, broadcasting, coder:)
- @server, @broadcasting, @coder = server, broadcasting, coder
- end
-
- def broadcast(message)
- server.logger.debug "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect}"
-
- payload = { broadcasting: broadcasting, message: message, coder: coder }
- ActiveSupport::Notifications.instrument("broadcast.action_cable", payload) do
- encoded = coder ? coder.encode(message) : message
- server.pubsub.broadcast broadcasting, encoded
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/configuration.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/configuration.rb
deleted file mode 100644
index 17e0dee064..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/configuration.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-module ActionCable
- module Server
- # An instance of this configuration object is available via ActionCable.server.config, which allows you to tweak Action Cable configuration
- # in a Rails config initializer.
- class Configuration
- attr_accessor :logger, :log_tags
- attr_accessor :connection_class, :worker_pool_size
- attr_accessor :disable_request_forgery_protection, :allowed_request_origins, :allow_same_origin_as_host
- attr_accessor :cable, :url, :mount_path
-
- def initialize
- @log_tags = []
-
- @connection_class = -> { ActionCable::Connection::Base }
- @worker_pool_size = 4
-
- @disable_request_forgery_protection = false
- @allow_same_origin_as_host = true
- end
-
- # Returns constant of subscription adapter specified in config/cable.yml.
- # If the adapter cannot be found, this will default to the Redis adapter.
- # Also makes sure proper dependencies are required.
- def pubsub_adapter
- adapter = (cable.fetch("adapter") { "redis" })
- path_to_adapter = "action_cable/subscription_adapter/#{adapter}"
- begin
- require path_to_adapter
- rescue Gem::LoadError => e
- raise Gem::LoadError, "Specified '#{adapter}' for Action Cable pubsub adapter, but the gem is not loaded. Add `gem '#{e.name}'` to your Gemfile (and ensure its version is at the minimum required by Action Cable)."
- rescue LoadError => e
- raise LoadError, "Could not load '#{path_to_adapter}'. Make sure that the adapter in config/cable.yml is valid. If you use an adapter other than 'postgresql' or 'redis' add the necessary adapter gem to the Gemfile.", e.backtrace
- end
-
- adapter = adapter.camelize
- adapter = "PostgreSQL" if adapter == "Postgresql"
- "ActionCable::SubscriptionAdapter::#{adapter}".constantize
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/connections.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/connections.rb
deleted file mode 100644
index 5e61b4e335..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/connections.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-module ActionCable
- module Server
- # Collection class for all the connections that have been established on this specific server. Remember, usually you'll run many Action Cable servers, so
- # you can't use this collection as a full list of all of the connections established against your application. Instead, use RemoteConnections for that.
- module Connections # :nodoc:
- BEAT_INTERVAL = 3
-
- def connections
- @connections ||= []
- end
-
- def add_connection(connection)
- connections << connection
- end
-
- def remove_connection(connection)
- connections.delete connection
- end
-
- # WebSocket connection implementations differ on when they'll mark a connection as stale. We basically never want a connection to go stale, as you
- # then can't rely on being able to communicate with the connection. To solve this, a 3 second heartbeat runs on all connections. If the beat fails, we automatically
- # disconnect.
- def setup_heartbeat_timer
- @heartbeat_timer ||= event_loop.timer(BEAT_INTERVAL) do
- event_loop.post { connections.map(&:beat) }
- end
- end
-
- def open_connections_statistics
- connections.map(&:statistics)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker.rb
deleted file mode 100644
index 43639c27af..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-require "active_support/callbacks"
-require "active_support/core_ext/module/attribute_accessors_per_thread"
-require "concurrent"
-
-module ActionCable
- module Server
- # Worker used by Server.send_async to do connection work in threads.
- class Worker # :nodoc:
- include ActiveSupport::Callbacks
-
- thread_mattr_accessor :connection
- define_callbacks :work
- include ActiveRecordConnectionManagement
-
- attr_reader :executor
-
- def initialize(max_size: 5)
- @executor = Concurrent::ThreadPoolExecutor.new(
- min_threads: 1,
- max_threads: max_size,
- max_queue: 0,
- )
- end
-
- # Stop processing work: any work that has not already started
- # running will be discarded from the queue
- def halt
- @executor.shutdown
- end
-
- def stopping?
- @executor.shuttingdown?
- end
-
- def work(connection)
- self.connection = connection
-
- run_callbacks :work do
- yield
- end
- ensure
- self.connection = nil
- end
-
- def async_exec(receiver, *args, connection:, &block)
- async_invoke receiver, :instance_exec, *args, connection: connection, &block
- end
-
- def async_invoke(receiver, method, *args, connection: receiver, &block)
- @executor.post do
- invoke(receiver, method, *args, connection: connection, &block)
- end
- end
-
- def invoke(receiver, method, *args, connection:, &block)
- work(connection) do
- begin
- receiver.send method, *args, &block
- rescue Exception => e
- logger.error "There was an exception - #{e.class}(#{e.message})"
- logger.error e.backtrace.join("\n")
-
- receiver.handle_exception if receiver.respond_to?(:handle_exception)
- end
- end
- end
-
- private
-
- def logger
- ActionCable.server.logger
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker/active_record_connection_management.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker/active_record_connection_management.rb
deleted file mode 100644
index c1e4aa8103..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/server/worker/active_record_connection_management.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-module ActionCable
- module Server
- class Worker
- module ActiveRecordConnectionManagement
- extend ActiveSupport::Concern
-
- included do
- if defined?(ActiveRecord::Base)
- set_callback :work, :around, :with_database_connections
- end
- end
-
- def with_database_connections
- connection.logger.tag(ActiveRecord::Base.logger) { yield }
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter.rb
deleted file mode 100644
index 596269ab9b..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module ActionCable
- module SubscriptionAdapter
- extend ActiveSupport::Autoload
-
- autoload :Base
- autoload :SubscriberMap
- autoload :ChannelPrefix
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/async.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/async.rb
deleted file mode 100644
index 46819dbfec..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/async.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require "action_cable/subscription_adapter/inline"
-
-module ActionCable
- module SubscriptionAdapter
- class Async < Inline # :nodoc:
- private
- def new_subscriber_map
- AsyncSubscriberMap.new(server.event_loop)
- end
-
- class AsyncSubscriberMap < SubscriberMap
- def initialize(event_loop)
- @event_loop = event_loop
- super()
- end
-
- def add_subscriber(*)
- @event_loop.post { super }
- end
-
- def invoke_callback(*)
- @event_loop.post { super }
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/base.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/base.rb
deleted file mode 100644
index 796db5ffa3..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/base.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module ActionCable
- module SubscriptionAdapter
- class Base
- attr_reader :logger, :server
-
- def initialize(server)
- @server = server
- @logger = @server.logger
- end
-
- def broadcast(channel, payload)
- raise NotImplementedError
- end
-
- def subscribe(channel, message_callback, success_callback = nil)
- raise NotImplementedError
- end
-
- def unsubscribe(channel, message_callback)
- raise NotImplementedError
- end
-
- def shutdown
- raise NotImplementedError
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/channel_prefix.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/channel_prefix.rb
deleted file mode 100644
index 8b293cc785..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/channel_prefix.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module ActionCable
- module SubscriptionAdapter
- module ChannelPrefix # :nodoc:
- def broadcast(channel, payload)
- channel = channel_with_prefix(channel)
- super
- end
-
- def subscribe(channel, callback, success_callback = nil)
- channel = channel_with_prefix(channel)
- super
- end
-
- def unsubscribe(channel, callback)
- channel = channel_with_prefix(channel)
- super
- end
-
- private
- # Returns the channel name, including channel_prefix specified in cable.yml
- def channel_with_prefix(channel)
- [@server.config.cable[:channel_prefix], channel].compact.join(":")
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/evented_redis.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/evented_redis.rb
deleted file mode 100644
index eaddd450ee..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/evented_redis.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require "thread"
-
-gem "em-hiredis", "~> 0.3.0"
-gem "redis", ">= 3", "< 5"
-require "em-hiredis"
-require "redis"
-
-EventMachine.epoll if EventMachine.epoll?
-EventMachine.kqueue if EventMachine.kqueue?
-
-module ActionCable
- module SubscriptionAdapter
- class EventedRedis < Base # :nodoc:
- prepend ChannelPrefix
-
- @@mutex = Mutex.new
-
- # Overwrite this factory method for EventMachine Redis connections if you want to use a different Redis connection library than EM::Hiredis.
- # This is needed, for example, when using Makara proxies for distributed Redis.
- cattr_accessor(:em_redis_connector) { ->(config) { EM::Hiredis.connect(config[:url]) } }
-
- # Overwrite this factory method for Redis connections if you want to use a different Redis connection library than Redis.
- # This is needed, for example, when using Makara proxies for distributed Redis.
- cattr_accessor(:redis_connector) { ->(config) { ::Redis.new(url: config[:url]) } }
-
- def initialize(*)
- ActiveSupport::Deprecation.warn(<<-MSG.squish)
- The "evented_redis" subscription adapter is deprecated and
- will be removed in Rails 5.2. Please use the "redis" adapter
- instead.
- MSG
-
- super
- @redis_connection_for_broadcasts = @redis_connection_for_subscriptions = nil
- end
-
- def broadcast(channel, payload)
- redis_connection_for_broadcasts.publish(channel, payload)
- end
-
- def subscribe(channel, message_callback, success_callback = nil)
- redis_connection_for_subscriptions.pubsub.subscribe(channel, &message_callback).tap do |result|
- result.callback { |reply| success_callback.call } if success_callback
- end
- end
-
- def unsubscribe(channel, message_callback)
- redis_connection_for_subscriptions.pubsub.unsubscribe_proc(channel, message_callback)
- end
-
- def shutdown
- redis_connection_for_subscriptions.pubsub.close_connection
- @redis_connection_for_subscriptions = nil
- end
-
- private
- def redis_connection_for_subscriptions
- ensure_reactor_running
- @redis_connection_for_subscriptions || @server.mutex.synchronize do
- @redis_connection_for_subscriptions ||= self.class.em_redis_connector.call(@server.config.cable).tap do |redis|
- redis.on(:reconnect_failed) do
- @logger.error "[ActionCable] Redis reconnect failed."
- end
-
- redis.on(:failed) do
- @logger.error "[ActionCable] Redis connection has failed."
- end
- end
- end
- end
-
- def redis_connection_for_broadcasts
- @redis_connection_for_broadcasts || @server.mutex.synchronize do
- @redis_connection_for_broadcasts ||= self.class.redis_connector.call(@server.config.cable)
- end
- end
-
- def ensure_reactor_running
- return if EventMachine.reactor_running? && EventMachine.reactor_thread
- @@mutex.synchronize do
- Thread.new { EventMachine.run } unless EventMachine.reactor_running?
- Thread.pass until EventMachine.reactor_running? && EventMachine.reactor_thread
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/inline.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/inline.rb
deleted file mode 100644
index 81357faead..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/inline.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-module ActionCable
- module SubscriptionAdapter
- class Inline < Base # :nodoc:
- def initialize(*)
- super
- @subscriber_map = nil
- end
-
- def broadcast(channel, payload)
- subscriber_map.broadcast(channel, payload)
- end
-
- def subscribe(channel, callback, success_callback = nil)
- subscriber_map.add_subscriber(channel, callback, success_callback)
- end
-
- def unsubscribe(channel, callback)
- subscriber_map.remove_subscriber(channel, callback)
- end
-
- def shutdown
- # nothing to do
- end
-
- private
- def subscriber_map
- @subscriber_map || @server.mutex.synchronize { @subscriber_map ||= new_subscriber_map }
- end
-
- def new_subscriber_map
- SubscriberMap.new
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/postgresql.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/postgresql.rb
deleted file mode 100644
index 05d5a65c7e..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/postgresql.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-gem "pg", ">= 0.18", "< 2.0"
-require "pg"
-require "thread"
-
-module ActionCable
- module SubscriptionAdapter
- class PostgreSQL < Base # :nodoc:
- def initialize(*)
- super
- @listener = nil
- end
-
- def broadcast(channel, payload)
- with_connection do |pg_conn|
- pg_conn.exec("NOTIFY #{pg_conn.escape_identifier(channel)}, '#{pg_conn.escape_string(payload)}'")
- end
- end
-
- def subscribe(channel, callback, success_callback = nil)
- listener.add_subscriber(channel, callback, success_callback)
- end
-
- def unsubscribe(channel, callback)
- listener.remove_subscriber(channel, callback)
- end
-
- def shutdown
- listener.shutdown
- end
-
- def with_connection(&block) # :nodoc:
- ActiveRecord::Base.connection_pool.with_connection do |ar_conn|
- pg_conn = ar_conn.raw_connection
-
- unless pg_conn.is_a?(PG::Connection)
- raise "The Active Record database must be PostgreSQL in order to use the PostgreSQL Action Cable storage adapter"
- end
-
- yield pg_conn
- end
- end
-
- private
- def listener
- @listener || @server.mutex.synchronize { @listener ||= Listener.new(self, @server.event_loop) }
- end
-
- class Listener < SubscriberMap
- def initialize(adapter, event_loop)
- super()
-
- @adapter = adapter
- @event_loop = event_loop
- @queue = Queue.new
-
- @thread = Thread.new do
- Thread.current.abort_on_exception = true
- listen
- end
- end
-
- def listen
- @adapter.with_connection do |pg_conn|
- catch :shutdown do
- loop do
- until @queue.empty?
- action, channel, callback = @queue.pop(true)
-
- case action
- when :listen
- pg_conn.exec("LISTEN #{pg_conn.escape_identifier channel}")
- @event_loop.post(&callback) if callback
- when :unlisten
- pg_conn.exec("UNLISTEN #{pg_conn.escape_identifier channel}")
- when :shutdown
- throw :shutdown
- end
- end
-
- pg_conn.wait_for_notify(1) do |chan, pid, message|
- broadcast(chan, message)
- end
- end
- end
- end
- end
-
- def shutdown
- @queue.push([:shutdown])
- Thread.pass while @thread.alive?
- end
-
- def add_channel(channel, on_success)
- @queue.push([:listen, channel, on_success])
- end
-
- def remove_channel(channel)
- @queue.push([:unlisten, channel])
- end
-
- def invoke_callback(*)
- @event_loop.post { super }
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/redis.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/redis.rb
deleted file mode 100644
index e7e7f061c4..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/redis.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-require "thread"
-
-gem "redis", ">= 3", "< 5"
-require "redis"
-
-module ActionCable
- module SubscriptionAdapter
- class Redis < Base # :nodoc:
- prepend ChannelPrefix
-
- # Overwrite this factory method for redis connections if you want to use a different Redis library than Redis.
- # This is needed, for example, when using Makara proxies for distributed Redis.
- cattr_accessor(:redis_connector) { ->(config) { ::Redis.new(url: config[:url]) } }
-
- def initialize(*)
- super
- @listener = nil
- @redis_connection_for_broadcasts = nil
- end
-
- def broadcast(channel, payload)
- redis_connection_for_broadcasts.publish(channel, payload)
- end
-
- def subscribe(channel, callback, success_callback = nil)
- listener.add_subscriber(channel, callback, success_callback)
- end
-
- def unsubscribe(channel, callback)
- listener.remove_subscriber(channel, callback)
- end
-
- def shutdown
- @listener.shutdown if @listener
- end
-
- def redis_connection_for_subscriptions
- redis_connection
- end
-
- private
- def listener
- @listener || @server.mutex.synchronize { @listener ||= Listener.new(self, @server.event_loop) }
- end
-
- def redis_connection_for_broadcasts
- @redis_connection_for_broadcasts || @server.mutex.synchronize do
- @redis_connection_for_broadcasts ||= redis_connection
- end
- end
-
- def redis_connection
- self.class.redis_connector.call(@server.config.cable)
- end
-
- class Listener < SubscriberMap
- def initialize(adapter, event_loop)
- super()
-
- @adapter = adapter
- @event_loop = event_loop
-
- @subscribe_callbacks = Hash.new { |h, k| h[k] = [] }
- @subscription_lock = Mutex.new
-
- @raw_client = nil
-
- @when_connected = []
-
- @thread = nil
- end
-
- def listen(conn)
- conn.without_reconnect do
- original_client = conn.respond_to?(:_client) ? conn._client : conn.client
-
- conn.subscribe("_action_cable_internal") do |on|
- on.subscribe do |chan, count|
- @subscription_lock.synchronize do
- if count == 1
- @raw_client = original_client
-
- until @when_connected.empty?
- @when_connected.shift.call
- end
- end
-
- if callbacks = @subscribe_callbacks[chan]
- next_callback = callbacks.shift
- @event_loop.post(&next_callback) if next_callback
- @subscribe_callbacks.delete(chan) if callbacks.empty?
- end
- end
- end
-
- on.message do |chan, message|
- broadcast(chan, message)
- end
-
- on.unsubscribe do |chan, count|
- if count == 0
- @subscription_lock.synchronize do
- @raw_client = nil
- end
- end
- end
- end
- end
- end
-
- def shutdown
- @subscription_lock.synchronize do
- return if @thread.nil?
-
- when_connected do
- send_command("unsubscribe")
- @raw_client = nil
- end
- end
-
- Thread.pass while @thread.alive?
- end
-
- def add_channel(channel, on_success)
- @subscription_lock.synchronize do
- ensure_listener_running
- @subscribe_callbacks[channel] << on_success
- when_connected { send_command("subscribe", channel) }
- end
- end
-
- def remove_channel(channel)
- @subscription_lock.synchronize do
- when_connected { send_command("unsubscribe", channel) }
- end
- end
-
- def invoke_callback(*)
- @event_loop.post { super }
- end
-
- private
- def ensure_listener_running
- @thread ||= Thread.new do
- Thread.current.abort_on_exception = true
-
- conn = @adapter.redis_connection_for_subscriptions
- listen conn
- end
- end
-
- def when_connected(&block)
- if @raw_client
- block.call
- else
- @when_connected << block
- end
- end
-
- def send_command(*command)
- @raw_client.write(command)
-
- very_raw_connection =
- @raw_client.connection.instance_variable_defined?(:@connection) &&
- @raw_client.connection.instance_variable_get(:@connection)
-
- if very_raw_connection && very_raw_connection.respond_to?(:flush)
- very_raw_connection.flush
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/subscriber_map.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/subscriber_map.rb
deleted file mode 100644
index 4cce86dcca..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/subscription_adapter/subscriber_map.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-module ActionCable
- module SubscriptionAdapter
- class SubscriberMap
- def initialize
- @subscribers = Hash.new { |h, k| h[k] = [] }
- @sync = Mutex.new
- end
-
- def add_subscriber(channel, subscriber, on_success)
- @sync.synchronize do
- new_channel = !@subscribers.key?(channel)
-
- @subscribers[channel] << subscriber
-
- if new_channel
- add_channel channel, on_success
- elsif on_success
- on_success.call
- end
- end
- end
-
- def remove_subscriber(channel, subscriber)
- @sync.synchronize do
- @subscribers[channel].delete(subscriber)
-
- if @subscribers[channel].empty?
- @subscribers.delete channel
- remove_channel channel
- end
- end
- end
-
- def broadcast(channel, message)
- list = @sync.synchronize do
- return if !@subscribers.key?(channel)
- @subscribers[channel].dup
- end
-
- list.each do |subscriber|
- invoke_callback(subscriber, message)
- end
- end
-
- def add_channel(channel, on_success)
- on_success.call if on_success
- end
-
- def remove_channel(channel)
- end
-
- def invoke_callback(callback, message)
- callback.call message
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/version.rb b/debian/gems-compat/actioncable-5.1.7/lib/action_cable/version.rb
deleted file mode 100644
index d6081409f0..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/action_cable/version.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative "gem_version"
-
-module ActionCable
- # Returns the version of the currently loaded Action Cable as a Gem::Version
- def self.version
- gem_version
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/assets/compiled/action_cable.js b/debian/gems-compat/actioncable-5.1.7/lib/assets/compiled/action_cable.js
deleted file mode 100644
index 960f8516d3..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/assets/compiled/action_cable.js
+++ /dev/null
@@ -1,601 +0,0 @@
-(function() {
- var context = this;
-
- (function() {
- (function() {
- var slice = [].slice;
-
- this.ActionCable = {
- INTERNAL: {
- "message_types": {
- "welcome": "welcome",
- "ping": "ping",
- "confirmation": "confirm_subscription",
- "rejection": "reject_subscription"
- },
- "default_mount_path": "/cable",
- "protocols": ["actioncable-v1-json", "actioncable-unsupported"]
- },
- WebSocket: window.WebSocket,
- logger: window.console,
- createConsumer: function(url) {
- var ref;
- if (url == null) {
- url = (ref = this.getConfig("url")) != null ? ref : this.INTERNAL.default_mount_path;
- }
- return new ActionCable.Consumer(this.createWebSocketURL(url));
- },
- getConfig: function(name) {
- var element;
- element = document.head.querySelector("meta[name='action-cable-" + name + "']");
- return element != null ? element.getAttribute("content") : void 0;
- },
- createWebSocketURL: function(url) {
- var a;
- if (url && !/^wss?:/i.test(url)) {
- a = document.createElement("a");
- a.href = url;
- a.href = a.href;
- a.protocol = a.protocol.replace("http", "ws");
- return a.href;
- } else {
- return url;
- }
- },
- startDebugging: function() {
- return this.debugging = true;
- },
- stopDebugging: function() {
- return this.debugging = null;
- },
- log: function() {
- var messages, ref;
- messages = 1 <= arguments.length ? slice.call(arguments, 0) : [];
- if (this.debugging) {
- messages.push(Date.now());
- return (ref = this.logger).log.apply(ref, ["[ActionCable]"].concat(slice.call(messages)));
- }
- }
- };
-
- }).call(this);
- }).call(context);
-
- var ActionCable = context.ActionCable;
-
- (function() {
- (function() {
- var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
-
- ActionCable.ConnectionMonitor = (function() {
- var clamp, now, secondsSince;
-
- ConnectionMonitor.pollInterval = {
- min: 3,
- max: 30
- };
-
- ConnectionMonitor.staleThreshold = 6;
-
- function ConnectionMonitor(connection) {
- this.connection = connection;
- this.visibilityDidChange = bind(this.visibilityDidChange, this);
- this.reconnectAttempts = 0;
- }
-
- ConnectionMonitor.prototype.start = function() {
- if (!this.isRunning()) {
- this.startedAt = now();
- delete this.stoppedAt;
- this.startPolling();
- document.addEventListener("visibilitychange", this.visibilityDidChange);
- return ActionCable.log("ConnectionMonitor started. pollInterval = " + (this.getPollInterval()) + " ms");
- }
- };
-
- ConnectionMonitor.prototype.stop = function() {
- if (this.isRunning()) {
- this.stoppedAt = now();
- this.stopPolling();
- document.removeEventListener("visibilitychange", this.visibilityDidChange);
- return ActionCable.log("ConnectionMonitor stopped");
- }
- };
-
- ConnectionMonitor.prototype.isRunning = function() {
- return (this.startedAt != null) && (this.stoppedAt == null);
- };
-
- ConnectionMonitor.prototype.recordPing = function() {
- return this.pingedAt = now();
- };
-
- ConnectionMonitor.prototype.recordConnect = function() {
- this.reconnectAttempts = 0;
- this.recordPing();
- delete this.disconnectedAt;
- return ActionCable.log("ConnectionMonitor recorded connect");
- };
-
- ConnectionMonitor.prototype.recordDisconnect = function() {
- this.disconnectedAt = now();
- return ActionCable.log("ConnectionMonitor recorded disconnect");
- };
-
- ConnectionMonitor.prototype.startPolling = function() {
- this.stopPolling();
- return this.poll();
- };
-
- ConnectionMonitor.prototype.stopPolling = function() {
- return clearTimeout(this.pollTimeout);
- };
-
- ConnectionMonitor.prototype.poll = function() {
- return this.pollTimeout = setTimeout((function(_this) {
- return function() {
- _this.reconnectIfStale();
- return _this.poll();
- };
- })(this), this.getPollInterval());
- };
-
- ConnectionMonitor.prototype.getPollInterval = function() {
- var interval, max, min, ref;
- ref = this.constructor.pollInterval, min = ref.min, max = ref.max;
- interval = 5 * Math.log(this.reconnectAttempts + 1);
- return Math.round(clamp(interval, min, max) * 1000);
- };
-
- ConnectionMonitor.prototype.reconnectIfStale = function() {
- if (this.connectionIsStale()) {
- ActionCable.log("ConnectionMonitor detected stale connection. reconnectAttempts = " + this.reconnectAttempts + ", pollInterval = " + (this.getPollInterval()) + " ms, time disconnected = " + (secondsSince(this.disconnectedAt)) + " s, stale threshold = " + this.constructor.staleThreshold + " s");
- this.reconnectAttempts++;
- if (this.disconnectedRecently()) {
- return ActionCable.log("ConnectionMonitor skipping reopening recent disconnect");
- } else {
- ActionCable.log("ConnectionMonitor reopening");
- return this.connection.reopen();
- }
- }
- };
-
- ConnectionMonitor.prototype.connectionIsStale = function() {
- var ref;
- return secondsSince((ref = this.pingedAt) != null ? ref : this.startedAt) > this.constructor.staleThreshold;
- };
-
- ConnectionMonitor.prototype.disconnectedRecently = function() {
- return this.disconnectedAt && secondsSince(this.disconnectedAt) < this.constructor.staleThreshold;
- };
-
- ConnectionMonitor.prototype.visibilityDidChange = function() {
- if (document.visibilityState === "visible") {
- return setTimeout((function(_this) {
- return function() {
- if (_this.connectionIsStale() || !_this.connection.isOpen()) {
- ActionCable.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = " + document.visibilityState);
- return _this.connection.reopen();
- }
- };
- })(this), 200);
- }
- };
-
- now = function() {
- return new Date().getTime();
- };
-
- secondsSince = function(time) {
- return (now() - time) / 1000;
- };
-
- clamp = function(number, min, max) {
- return Math.max(min, Math.min(max, number));
- };
-
- return ConnectionMonitor;
-
- })();
-
- }).call(this);
- (function() {
- var i, message_types, protocols, ref, supportedProtocols, unsupportedProtocol,
- slice = [].slice,
- bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
- indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
-
- ref = ActionCable.INTERNAL, message_types = ref.message_types, protocols = ref.protocols;
-
- supportedProtocols = 2 <= protocols.length ? slice.call(protocols, 0, i = protocols.length - 1) : (i = 0, []), unsupportedProtocol = protocols[i++];
-
- ActionCable.Connection = (function() {
- Connection.reopenDelay = 500;
-
- function Connection(consumer) {
- this.consumer = consumer;
- this.open = bind(this.open, this);
- this.subscriptions = this.consumer.subscriptions;
- this.monitor = new ActionCable.ConnectionMonitor(this);
- this.disconnected = true;
- }
-
- Connection.prototype.send = function(data) {
- if (this.isOpen()) {
- this.webSocket.send(JSON.stringify(data));
- return true;
- } else {
- return false;
- }
- };
-
- Connection.prototype.open = function() {
- if (this.isActive()) {
- ActionCable.log("Attempted to open WebSocket, but existing socket is " + (this.getState()));
- return false;
- } else {
- ActionCable.log("Opening WebSocket, current state is " + (this.getState()) + ", subprotocols: " + protocols);
- if (this.webSocket != null) {
- this.uninstallEventHandlers();
- }
- this.webSocket = new ActionCable.WebSocket(this.consumer.url, protocols);
- this.installEventHandlers();
- this.monitor.start();
- return true;
- }
- };
-
- Connection.prototype.close = function(arg) {
- var allowReconnect, ref1;
- allowReconnect = (arg != null ? arg : {
- allowReconnect: true
- }).allowReconnect;
- if (!allowReconnect) {
- this.monitor.stop();
- }
- if (this.isActive()) {
- return (ref1 = this.webSocket) != null ? ref1.close() : void 0;
- }
- };
-
- Connection.prototype.reopen = function() {
- var error;
- ActionCable.log("Reopening WebSocket, current state is " + (this.getState()));
- if (this.isActive()) {
- try {
- return this.close();
- } catch (error1) {
- error = error1;
- return ActionCable.log("Failed to reopen WebSocket", error);
- } finally {
- ActionCable.log("Reopening WebSocket in " + this.constructor.reopenDelay + "ms");
- setTimeout(this.open, this.constructor.reopenDelay);
- }
- } else {
- return this.open();
- }
- };
-
- Connection.prototype.getProtocol = function() {
- var ref1;
- return (ref1 = this.webSocket) != null ? ref1.protocol : void 0;
- };
-
- Connection.prototype.isOpen = function() {
- return this.isState("open");
- };
-
- Connection.prototype.isActive = function() {
- return this.isState("open", "connecting");
- };
-
- Connection.prototype.isProtocolSupported = function() {
- var ref1;
- return ref1 = this.getProtocol(), indexOf.call(supportedProtocols, ref1) >= 0;
- };
-
- Connection.prototype.isState = function() {
- var ref1, states;
- states = 1 <= arguments.length ? slice.call(arguments, 0) : [];
- return ref1 = this.getState(), indexOf.call(states, ref1) >= 0;
- };
-
- Connection.prototype.getState = function() {
- var ref1, state, value;
- for (state in WebSocket) {
- value = WebSocket[state];
- if (value === ((ref1 = this.webSocket) != null ? ref1.readyState : void 0)) {
- return state.toLowerCase();
- }
- }
- return null;
- };
-
- Connection.prototype.installEventHandlers = function() {
- var eventName, handler;
- for (eventName in this.events) {
- handler = this.events[eventName].bind(this);
- this.webSocket["on" + eventName] = handler;
- }
- };
-
- Connection.prototype.uninstallEventHandlers = function() {
- var eventName;
- for (eventName in this.events) {
- this.webSocket["on" + eventName] = function() {};
- }
- };
-
- Connection.prototype.events = {
- message: function(event) {
- var identifier, message, ref1, type;
- if (!this.isProtocolSupported()) {
- return;
- }
- ref1 = JSON.parse(event.data), identifier = ref1.identifier, message = ref1.message, type = ref1.type;
- switch (type) {
- case message_types.welcome:
- this.monitor.recordConnect();
- return this.subscriptions.reload();
- case message_types.ping:
- return this.monitor.recordPing();
- case message_types.confirmation:
- return this.subscriptions.notify(identifier, "connected");
- case message_types.rejection:
- return this.subscriptions.reject(identifier);
- default:
- return this.subscriptions.notify(identifier, "received", message);
- }
- },
- open: function() {
- ActionCable.log("WebSocket onopen event, using '" + (this.getProtocol()) + "' subprotocol");
- this.disconnected = false;
- if (!this.isProtocolSupported()) {
- ActionCable.log("Protocol is unsupported. Stopping monitor and disconnecting.");
- return this.close({
- allowReconnect: false
- });
- }
- },
- close: function(event) {
- ActionCable.log("WebSocket onclose event");
- if (this.disconnected) {
- return;
- }
- this.disconnected = true;
- this.monitor.recordDisconnect();
- return this.subscriptions.notifyAll("disconnected", {
- willAttemptReconnect: this.monitor.isRunning()
- });
- },
- error: function() {
- return ActionCable.log("WebSocket onerror event");
- }
- };
-
- return Connection;
-
- })();
-
- }).call(this);
- (function() {
- var slice = [].slice;
-
- ActionCable.Subscriptions = (function() {
- function Subscriptions(consumer) {
- this.consumer = consumer;
- this.subscriptions = [];
- }
-
- Subscriptions.prototype.create = function(channelName, mixin) {
- var channel, params, subscription;
- channel = channelName;
- params = typeof channel === "object" ? channel : {
- channel: channel
- };
- subscription = new ActionCable.Subscription(this.consumer, params, mixin);
- return this.add(subscription);
- };
-
- Subscriptions.prototype.add = function(subscription) {
- this.subscriptions.push(subscription);
- this.consumer.ensureActiveConnection();
- this.notify(subscription, "initialized");
- this.sendCommand(subscription, "subscribe");
- return subscription;
- };
-
- Subscriptions.prototype.remove = function(subscription) {
- this.forget(subscription);
- if (!this.findAll(subscription.identifier).length) {
- this.sendCommand(subscription, "unsubscribe");
- }
- return subscription;
- };
-
- Subscriptions.prototype.reject = function(identifier) {
- var i, len, ref, results, subscription;
- ref = this.findAll(identifier);
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- subscription = ref[i];
- this.forget(subscription);
- this.notify(subscription, "rejected");
- results.push(subscription);
- }
- return results;
- };
-
- Subscriptions.prototype.forget = function(subscription) {
- var s;
- this.subscriptions = (function() {
- var i, len, ref, results;
- ref = this.subscriptions;
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- s = ref[i];
- if (s !== subscription) {
- results.push(s);
- }
- }
- return results;
- }).call(this);
- return subscription;
- };
-
- Subscriptions.prototype.findAll = function(identifier) {
- var i, len, ref, results, s;
- ref = this.subscriptions;
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- s = ref[i];
- if (s.identifier === identifier) {
- results.push(s);
- }
- }
- return results;
- };
-
- Subscriptions.prototype.reload = function() {
- var i, len, ref, results, subscription;
- ref = this.subscriptions;
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- subscription = ref[i];
- results.push(this.sendCommand(subscription, "subscribe"));
- }
- return results;
- };
-
- Subscriptions.prototype.notifyAll = function() {
- var args, callbackName, i, len, ref, results, subscription;
- callbackName = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
- ref = this.subscriptions;
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- subscription = ref[i];
- results.push(this.notify.apply(this, [subscription, callbackName].concat(slice.call(args))));
- }
- return results;
- };
-
- Subscriptions.prototype.notify = function() {
- var args, callbackName, i, len, results, subscription, subscriptions;
- subscription = arguments[0], callbackName = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
- if (typeof subscription === "string") {
- subscriptions = this.findAll(subscription);
- } else {
- subscriptions = [subscription];
- }
- results = [];
- for (i = 0, len = subscriptions.length; i < len; i++) {
- subscription = subscriptions[i];
- results.push(typeof subscription[callbackName] === "function" ? subscription[callbackName].apply(subscription, args) : void 0);
- }
- return results;
- };
-
- Subscriptions.prototype.sendCommand = function(subscription, command) {
- var identifier;
- identifier = subscription.identifier;
- return this.consumer.send({
- command: command,
- identifier: identifier
- });
- };
-
- return Subscriptions;
-
- })();
-
- }).call(this);
- (function() {
- ActionCable.Subscription = (function() {
- var extend;
-
- function Subscription(consumer, params, mixin) {
- this.consumer = consumer;
- if (params == null) {
- params = {};
- }
- this.identifier = JSON.stringify(params);
- extend(this, mixin);
- }
-
- Subscription.prototype.perform = function(action, data) {
- if (data == null) {
- data = {};
- }
- data.action = action;
- return this.send(data);
- };
-
- Subscription.prototype.send = function(data) {
- return this.consumer.send({
- command: "message",
- identifier: this.identifier,
- data: JSON.stringify(data)
- });
- };
-
- Subscription.prototype.unsubscribe = function() {
- return this.consumer.subscriptions.remove(this);
- };
-
- extend = function(object, properties) {
- var key, value;
- if (properties != null) {
- for (key in properties) {
- value = properties[key];
- object[key] = value;
- }
- }
- return object;
- };
-
- return Subscription;
-
- })();
-
- }).call(this);
- (function() {
- ActionCable.Consumer = (function() {
- function Consumer(url) {
- this.url = url;
- this.subscriptions = new ActionCable.Subscriptions(this);
- this.connection = new ActionCable.Connection(this);
- }
-
- Consumer.prototype.send = function(data) {
- return this.connection.send(data);
- };
-
- Consumer.prototype.connect = function() {
- return this.connection.open();
- };
-
- Consumer.prototype.disconnect = function() {
- return this.connection.close({
- allowReconnect: false
- });
- };
-
- Consumer.prototype.ensureActiveConnection = function() {
- if (!this.connection.isActive()) {
- return this.connection.open();
- }
- };
-
- return Consumer;
-
- })();
-
- }).call(this);
- }).call(this);
-
- if (typeof module === "object" && module.exports) {
- module.exports = ActionCable;
- } else if (typeof define === "function" && define.amd) {
- define(ActionCable);
- }
-}).call(this);
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/USAGE b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/USAGE
deleted file mode 100644
index dd109fda80..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/USAGE
+++ /dev/null
@@ -1,14 +0,0 @@
-Description:
-============
- Stubs out a new cable channel for the server (in Ruby) and client (in CoffeeScript).
- Pass the channel name, either CamelCased or under_scored, and an optional list of channel actions as arguments.
-
- Note: Turn on the cable connection in app/assets/javascripts/cable.js after generating any channels.
-
-Example:
-========
- rails generate channel Chat speak
-
- creates a Chat channel class and CoffeeScript asset:
- Channel: app/channels/chat_channel.rb
- Assets: app/assets/javascripts/channels/chat.coffee
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/channel_generator.rb b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/channel_generator.rb
deleted file mode 100644
index 984b78bc9c..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/channel_generator.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module Rails
- module Generators
- class ChannelGenerator < NamedBase
- source_root File.expand_path("../templates", __FILE__)
-
- argument :actions, type: :array, default: [], banner: "method method"
-
- class_option :assets, type: :boolean
-
- check_class_collision suffix: "Channel"
-
- def create_channel_file
- template "channel.rb", File.join("app/channels", class_path, "#{file_name}_channel.rb")
-
- if options[:assets]
- if behavior == :invoke
- template "assets/cable.js", "app/assets/javascripts/cable.js"
- end
-
- js_template "assets/channel", File.join("app/assets/javascripts/channels", class_path, "#{file_name}")
- end
-
- generate_application_cable_files
- end
-
- private
- def file_name
- @_file_name ||= super.gsub(/_channel/i, "")
- end
-
- # FIXME: Change these files to symlinks once RubyGems 2.5.0 is required.
- def generate_application_cable_files
- return if behavior != :invoke
-
- files = [
- "application_cable/channel.rb",
- "application_cable/connection.rb"
- ]
-
- files.each do |name|
- path = File.join("app/channels/", name)
- template(name, path) if !File.exist?(path)
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/channel.rb b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/channel.rb
deleted file mode 100644
index d672697283..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/channel.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module ApplicationCable
- class Channel < ActionCable::Channel::Base
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/connection.rb b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/connection.rb
deleted file mode 100644
index 0ff5442f47..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/application_cable/connection.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module ApplicationCable
- class Connection < ActionCable::Connection::Base
- end
-end
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/cable.js b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/cable.js
deleted file mode 100644
index 739aa5f022..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/cable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Action Cable provides the framework to deal with WebSockets in Rails.
-// You can generate new channels where WebSocket features live using the `rails generate channel` command.
-//
-//= require action_cable
-//= require_self
-//= require_tree ./channels
-
-(function() {
- this.App || (this.App = {});
-
- App.cable = ActionCable.createConsumer();
-
-}).call(this);
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.coffee b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.coffee
deleted file mode 100644
index 5467811aba..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.coffee
+++ /dev/null
@@ -1,14 +0,0 @@
-App.<%= class_name.underscore %> = App.cable.subscriptions.create "<%= class_name %>Channel",
- connected: ->
- # Called when the subscription is ready for use on the server
-
- disconnected: ->
- # Called when the subscription has been terminated by the server
-
- received: (data) ->
- # Called when there's incoming data on the websocket for this channel
-<% actions.each do |action| -%>
-
- <%= action %>: ->
- @perform '<%= action %>'
-<% end -%>
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.js b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.js
deleted file mode 100644
index ab0e68b11a..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/assets/channel.js
+++ /dev/null
@@ -1,18 +0,0 @@
-App.<%= class_name.underscore %> = App.cable.subscriptions.create("<%= class_name %>Channel", {
- connected: function() {
- // Called when the subscription is ready for use on the server
- },
-
- disconnected: function() {
- // Called when the subscription has been terminated by the server
- },
-
- received: function(data) {
- // Called when there's incoming data on the websocket for this channel
- }<%= actions.any? ? ",\n" : '' %>
-<% actions.each do |action| -%>
- <%=action %>: function() {
- return this.perform('<%= action %>');
- }<%= action == actions[-1] ? '' : ",\n" %>
-<% end -%>
-});
diff --git a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/channel.rb b/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/channel.rb
deleted file mode 100644
index 4bcfb2be4d..0000000000
--- a/debian/gems-compat/actioncable-5.1.7/lib/rails/generators/channel/templates/channel.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% module_namespacing do -%>
-class <%= class_name %>Channel < ApplicationCable::Channel
- def subscribed
- # stream_from "some_channel"
- end
-
- def unsubscribed
- # Any cleanup needed when channel is unsubscribed
- end
-<% actions.each do |action| -%>
-
- def <%= action %>
- end
-<% end -%>
-end
-<% end -%>
diff --git a/debian/gems-compat/actionmailer-5.1.7/CHANGELOG.md b/debian/gems-compat/actionmailer-5.1.7/CHANGELOG.md
deleted file mode 100644
index 580886da70..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/CHANGELOG.md
+++ /dev/null
@@ -1,101 +0,0 @@
-## Rails 5.1.7 (March 27, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.2 (March 11, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.1 (November 27, 2018) ##
-
-* No changes.
-
-
-## Rails 5.1.6 (March 29, 2018) ##
-
-* No changes.
-
-
-## Rails 5.1.5 (February 14, 2018) ##
-
-* Bring back proc with arity of 1 in `ActionMailer::Base.default` proc
- since it was supported in Rails 5.0 but not deprecated.
-
- *Jimmy Bourassa*
-
-
-## Rails 5.1.4 (September 07, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.4.rc1 (August 24, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3 (August 03, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc3 (July 31, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc2 (July 25, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc1 (July 19, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.2 (June 26, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.1 (May 12, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.0 (April 27, 2017) ##
-
-* Add `:args` to `process.action_mailer` event.
-
- *Yuji Yaginuma*
-
-* Add parameterized invocation of mailers as a way to share before filters and defaults between actions.
- See `ActionMailer::Parameterized` for a full example of the benefit.
-
- *DHH*
-
-* Allow lambdas to be used as lazy defaults in addition to procs.
-
- *DHH*
-
-* Mime type: allow to custom content type when setting body in headers
- and attachments.
-
- Example:
-
- def test_emails
- attachments["invoice.pdf"] = "This is test File content"
- mail(body: "Hello there", content_type: "text/html")
- end
-
- *Minh Quy*
-
-* Exception handling: use `rescue_from` to handle exceptions raised by
- mailer actions, by message delivery, and by deferred delivery jobs.
-
- *Jeremy Daer*
-
-Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionmailer/CHANGELOG.md) for previous changes.
diff --git a/debian/gems-compat/actionmailer-5.1.7/MIT-LICENSE b/debian/gems-compat/actionmailer-5.1.7/MIT-LICENSE
deleted file mode 100644
index ac810e86d0..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/MIT-LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (c) 2004-2017 David Heinemeier Hansson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/debian/gems-compat/actionmailer-5.1.7/README.rdoc b/debian/gems-compat/actionmailer-5.1.7/README.rdoc
deleted file mode 100644
index 397ebe4201..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/README.rdoc
+++ /dev/null
@@ -1,175 +0,0 @@
-= Action Mailer -- Easy email delivery and testing
-
-Action Mailer is a framework for designing email service layers. These layers
-are used to consolidate code for sending out forgotten passwords, welcome
-wishes on signup, invoices for billing, and any other use case that requires
-a written notification to either a person or another system.
-
-Action Mailer is in essence a wrapper around Action Controller and the
-Mail gem. It provides a way to make emails using templates in the same
-way that Action Controller renders views using templates.
-
-Additionally, an Action Mailer class can be used to process incoming email,
-such as allowing a blog to accept new posts from an email (which could even
-have been sent from a phone).
-
-== Sending emails
-
-The framework works by initializing any instance variables you want to be
-available in the email template, followed by a call to +mail+ to deliver
-the email.
-
-This can be as simple as:
-
- class Notifier < ActionMailer::Base
- default from: 'system@loudthinking.com'
-
- def welcome(recipient)
- @recipient = recipient
- mail(to: recipient,
- subject: "[Signed up] Welcome #{recipient}")
- end
- end
-
-The body of the email is created by using an Action View template (regular
-ERB) that has the instance variables that are declared in the mailer action.
-
-So the corresponding body template for the method above could look like this:
-
- Hello there,
-
- Mr. <%= @recipient %>
-
- Thank you for signing up!
-
-If the recipient was given as "david@loudthinking.com", the email
-generated would look like this:
-
- Date: Mon, 25 Jan 2010 22:48:09 +1100
- From: system@loudthinking.com
- To: david@loudthinking.com
- Message-ID: <4b5d84f9dd6a5_7380800b81ac29578@void.loudthinking.com.mail>
- Subject: [Signed up] Welcome david@loudthinking.com
- Mime-Version: 1.0
- Content-Type: text/plain;
- charset="US-ASCII";
- Content-Transfer-Encoding: 7bit
-
- Hello there,
-
- Mr. david@loudthinking.com
-
- Thank you for signing up!
-
-In order to send mails, you simply call the method and then call +deliver_now+ on the return value.
-
-Calling the method returns a Mail Message object:
-
- message = Notifier.welcome("david@loudthinking.com") # => Returns a Mail::Message object
- message.deliver_now # => delivers the email
-
-Or you can just chain the methods together like:
-
- Notifier.welcome("david@loudthinking.com").deliver_now # Creates the email and sends it immediately
-
-== Setting defaults
-
-It is possible to set default values that will be used in every method in your
-Action Mailer class. To implement this functionality, you just call the public
-class method +default+ which you get for free from ActionMailer::Base.
-This method accepts a Hash as the parameter. You can use any of the headers,
-email messages have, like +:from+ as the key. You can also pass in a string as
-the key, like "Content-Type", but Action Mailer does this out of the box for you,
-so you won't need to worry about that. Finally, it is also possible to pass in a
-Proc that will get evaluated when it is needed.
-
-Note that every value you set with this method will get overwritten if you use the
-same key in your mailer method.
-
-Example:
-
- class AuthenticationMailer < ActionMailer::Base
- default from: "awesome@application.com", subject: Proc.new { "E-mail was generated at #{Time.now}" }
- .....
- end
-
-== Receiving emails
-
-To receive emails, you need to implement a public instance method called
-+receive+ that takes an email object as its single parameter. The Action Mailer
-framework has a corresponding class method, which is also called +receive+, that
-accepts a raw, unprocessed email as a string, which it then turns into the email
-object and calls the receive instance method.
-
-Example:
-
- class Mailman < ActionMailer::Base
- def receive(email)
- page = Page.find_by(address: email.to.first)
- page.emails.create(
- subject: email.subject, body: email.body
- )
-
- if email.has_attachments?
- email.attachments.each do |attachment|
- page.attachments.create({
- file: attachment, description: email.subject
- })
- end
- end
- end
- end
-
-This Mailman can be the target for Postfix or other MTAs. In Rails, you would use
-the runner in the trivial case like this:
-
- rails runner 'Mailman.receive(STDIN.read)'
-
-However, invoking Rails in the runner for each mail to be received is very
-resource intensive. A single instance of Rails should be run within a daemon, if
-it is going to process more than just a limited amount of email.
-
-== Configuration
-
-The Base class has the full list of configuration options. Here's an example:
-
- ActionMailer::Base.smtp_settings = {
- address: 'smtp.yourserver.com', # default: localhost
- port: '25', # default: 25
- user_name: 'user',
- password: 'pass',
- authentication: :plain # :plain, :login or :cram_md5
- }
-
-
-== Download and installation
-
-The latest version of Action Mailer can be installed with RubyGems:
-
- $ gem install actionmailer
-
-Source code can be downloaded as part of the Rails project on GitHub
-
-* https://github.com/rails/rails/tree/master/actionmailer
-
-
-== License
-
-Action Mailer is released under the MIT license:
-
-* http://www.opensource.org/licenses/MIT
-
-
-== Support
-
-API documentation is at
-
-* http://api.rubyonrails.org
-
-Bug reports can be filed for the Ruby on Rails project here:
-
-* https://github.com/rails/rails/issues
-
-Feature requests should be discussed on the rails-core mailing list here:
-
-* https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
diff --git a/debian/gems-compat/actionmailer-5.1.7/actionmailer.gemspec b/debian/gems-compat/actionmailer-5.1.7/actionmailer.gemspec
deleted file mode 100644
index 845d546ed6..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/actionmailer.gemspec
+++ /dev/null
@@ -1,49 +0,0 @@
-#########################################################
-# This file has been automatically generated by gem2tgz #
-#########################################################
-# -*- encoding: utf-8 -*-
-# stub: actionmailer 5.1.7 ruby lib
-
-Gem::Specification.new do |s|
- s.name = "actionmailer".freeze
- s.version = "5.1.7"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
- s.metadata = { "changelog_uri" => "https://github.com/rails/rails/blob/v5.1.7/actionmailer/CHANGELOG.md", "source_code_uri" => "https://github.com/rails/rails/tree/v5.1.7/actionmailer" } if s.respond_to? :metadata=
- s.require_paths = ["lib".freeze]
- s.authors = ["David Heinemeier Hansson".freeze]
- s.date = "2019-03-28"
- s.description = "Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.".freeze
- s.email = "david@loudthinking.com".freeze
- s.files = ["CHANGELOG.md".freeze, "MIT-LICENSE".freeze, "README.rdoc".freeze, "lib/action_mailer.rb".freeze, "lib/action_mailer/base.rb".freeze, "lib/action_mailer/collector.rb".freeze, "lib/action_mailer/delivery_job.rb".freeze, "lib/action_mailer/delivery_methods.rb".freeze, "lib/action_mailer/gem_version.rb".freeze, "lib/action_mailer/inline_preview_interceptor.rb".freeze, "lib/action_mailer/log_subscriber.rb".freeze, "lib/action_mailer/mail_helper.rb".freeze, "lib/action_mailer/message_delivery.rb".freeze, "lib/action_mailer/parameterized.rb".freeze, "lib/action_mailer/preview.rb".freeze, "lib/action_mailer/railtie.rb".freeze, "lib/action_mailer/rescuable.rb".freeze, "lib/action_mailer/test_case.rb".freeze, "lib/action_mailer/test_helper.rb".freeze, "lib/action_mailer/version.rb".freeze, "lib/rails/generators/mailer/USAGE".freeze, "lib/rails/generators/mailer/mailer_generator.rb".freeze, "lib/rails/generators/mailer/templates/application_mailer.rb".freeze, "lib/rails/generators/mailer/templates/mailer.rb".freeze]
- s.homepage = "http://rubyonrails.org".freeze
- s.licenses = ["MIT".freeze]
- s.required_ruby_version = Gem::Requirement.new(">= 2.2.2".freeze)
- s.requirements = ["none".freeze]
- s.rubygems_version = "2.7.6.2".freeze
- s.summary = "Email composition, delivery, and receiving framework (part of Rails).".freeze
-
- if s.respond_to? :specification_version then
- s.specification_version = 4
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, [">= 2.5.4", "~> 2.5"])
- s.add_runtime_dependency(%q.freeze, ["~> 2.0"])
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, [">= 2.5.4", "~> 2.5"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- end
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, [">= 2.5.4", "~> 2.5"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer.rb
deleted file mode 100644
index 8e59f033d0..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Copyright (c) 2004-2017 David Heinemeier Hansson
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#++
-
-require "abstract_controller"
-require "action_mailer/version"
-
-# Common Active Support usage in Action Mailer
-require "active_support"
-require "active_support/rails"
-require "active_support/core_ext/class"
-require "active_support/core_ext/module/attr_internal"
-require "active_support/core_ext/string/inflections"
-require "active_support/lazy_load_hooks"
-
-module ActionMailer
- extend ::ActiveSupport::Autoload
-
- eager_autoload do
- autoload :Collector
- end
-
- autoload :Base
- autoload :DeliveryMethods
- autoload :InlinePreviewInterceptor
- autoload :MailHelper
- autoload :Parameterized
- autoload :Preview
- autoload :Previews, "action_mailer/preview"
- autoload :TestCase
- autoload :TestHelper
- autoload :MessageDelivery
- autoload :DeliveryJob
-end
-
-autoload :Mime, "action_dispatch/http/mime_type"
-
-ActiveSupport.on_load(:action_view) do
- ActionView::Base.default_formats ||= Mime::SET.symbols
- ActionView::Template::Types.delegate_to Mime
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/base.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/base.rb
deleted file mode 100644
index 4143ab4451..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/base.rb
+++ /dev/null
@@ -1,993 +0,0 @@
-require "mail"
-require "action_mailer/collector"
-require "active_support/core_ext/string/inflections"
-require "active_support/core_ext/hash/except"
-require "active_support/core_ext/module/anonymous"
-
-require "action_mailer/log_subscriber"
-require "action_mailer/rescuable"
-
-module ActionMailer
- # Action Mailer allows you to send email from your application using a mailer model and views.
- #
- # = Mailer Models
- #
- # To use Action Mailer, you need to create a mailer model.
- #
- # $ rails generate mailer Notifier
- #
- # The generated model inherits from ApplicationMailer which in turn
- # inherits from ActionMailer::Base. A mailer model defines methods
- # used to generate an email message. In these methods, you can setup variables to be used in
- # the mailer views, options on the mail itself such as the :from address, and attachments.
- #
- # class ApplicationMailer < ActionMailer::Base
- # default from: 'from@example.com'
- # layout 'mailer'
- # end
- #
- # class NotifierMailer < ApplicationMailer
- # default from: 'no-reply@example.com',
- # return_path: 'system@example.com'
- #
- # def welcome(recipient)
- # @account = recipient
- # mail(to: recipient.email_address_with_name,
- # bcc: ["bcc@example.com", "Order Watcher "])
- # end
- # end
- #
- # Within the mailer method, you have access to the following methods:
- #
- # * attachments[]= - Allows you to add attachments to your email in an intuitive
- # manner; attachments['filename.png'] = File.read('path/to/filename.png')
- #
- # * attachments.inline[]= - Allows you to add an inline attachment to your email
- # in the same manner as attachments[]=
- #
- # * headers[]= - Allows you to specify any header field in your email such
- # as headers['X-No-Spam'] = 'True'. Note that declaring a header multiple times
- # will add many fields of the same name. Read #headers doc for more information.
- #
- # * headers(hash) - Allows you to specify multiple headers in your email such
- # as headers({'X-No-Spam' => 'True', 'In-Reply-To' => '1234@message.id'})
- #
- # * mail - Allows you to specify email to be sent.
- #
- # The hash passed to the mail method allows you to specify any header that a Mail::Message
- # will accept (any valid email header including optional fields).
- #
- # The mail method, if not passed a block, will inspect your views and send all the views with
- # the same name as the method, so the above action would send the +welcome.text.erb+ view
- # file as well as the +welcome.html.erb+ view file in a +multipart/alternative+ email.
- #
- # If you want to explicitly render only certain templates, pass a block:
- #
- # mail(to: user.email) do |format|
- # format.text
- # format.html
- # end
- #
- # The block syntax is also useful in providing information specific to a part:
- #
- # mail(to: user.email) do |format|
- # format.text(content_transfer_encoding: "base64")
- # format.html
- # end
- #
- # Or even to render a special view:
- #
- # mail(to: user.email) do |format|
- # format.text
- # format.html { render "some_other_template" }
- # end
- #
- # = Mailer views
- #
- # Like Action Controller, each mailer class has a corresponding view directory in which each
- # method of the class looks for a template with its name.
- #
- # To define a template to be used with a mailer, create an .erb file with the same
- # name as the method in your mailer model. For example, in the mailer defined above, the template at
- # app/views/notifier_mailer/welcome.text.erb would be used to generate the email.
- #
- # Variables defined in the methods of your mailer model are accessible as instance variables in their
- # corresponding view.
- #
- # Emails by default are sent in plain text, so a sample view for our model example might look like this:
- #
- # Hi <%= @account.name %>,
- # Thanks for joining our service! Please check back often.
- #
- # You can even use Action View helpers in these views. For example:
- #
- # You got a new note!
- # <%= truncate(@note.body, length: 25) %>
- #
- # If you need to access the subject, from or the recipients in the view, you can do that through message object:
- #
- # You got a new note from <%= message.from %>!
- # <%= truncate(@note.body, length: 25) %>
- #
- #
- # = Generating URLs
- #
- # URLs can be generated in mailer views using url_for or named routes. Unlike controllers from
- # Action Pack, the mailer instance doesn't have any context about the incoming request, so you'll need
- # to provide all of the details needed to generate a URL.
- #
- # When using url_for you'll need to provide the :host, :controller, and :action:
- #
- # <%= url_for(host: "example.com", controller: "welcome", action: "greeting") %>
- #
- # When using named routes you only need to supply the :host:
- #
- # <%= users_url(host: "example.com") %>
- #
- # You should use the named_route_url style (which generates absolute URLs) and avoid using the
- # named_route_path style (which generates relative URLs), since clients reading the mail will
- # have no concept of a current URL from which to determine a relative path.
- #
- # It is also possible to set a default host that will be used in all mailers by setting the :host
- # option as a configuration option in config/application.rb:
- #
- # config.action_mailer.default_url_options = { host: "example.com" }
- #
- # You can also define a default_url_options method on individual mailers to override these
- # default settings per-mailer.
- #
- # By default when config.force_ssl is true, URLs generated for hosts will use the HTTPS protocol.
- #
- # = Sending mail
- #
- # Once a mailer action and template are defined, you can deliver your message or defer its creation and
- # delivery for later:
- #
- # NotifierMailer.welcome(User.first).deliver_now # sends the email
- # mail = NotifierMailer.welcome(User.first) # => an ActionMailer::MessageDelivery object
- # mail.deliver_now # generates and sends the email now
- #
- # The ActionMailer::MessageDelivery class is a wrapper around a delegate that will call
- # your method to generate the mail. If you want direct access to the delegator, or Mail::Message,
- # you can call the message method on the ActionMailer::MessageDelivery object.
- #
- # NotifierMailer.welcome(User.first).message # => a Mail::Message object
- #
- # Action Mailer is nicely integrated with Active Job so you can generate and send emails in the background
- # (example: outside of the request-response cycle, so the user doesn't have to wait on it):
- #
- # NotifierMailer.welcome(User.first).deliver_later # enqueue the email sending to Active Job
- #
- # Note that deliver_later will execute your method from the background job.
- #
- # You never instantiate your mailer class. Rather, you just call the method you defined on the class itself.
- # All instance methods are expected to return a message object to be sent.
- #
- # = Multipart Emails
- #
- # Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
- # multipart templates, where each template is named after the name of the action, followed by the content
- # type. Each such detected template will be added to the message, as a separate part.
- #
- # For example, if the following templates exist:
- # * signup_notification.text.erb
- # * signup_notification.html.erb
- # * signup_notification.xml.builder
- # * signup_notification.yml.erb
- #
- # Each would be rendered and added as a separate part to the message, with the corresponding content
- # type. The content type for the entire message is automatically set to multipart/alternative,
- # which indicates that the email contains multiple different representations of the same email
- # body. The same instance variables defined in the action are passed to all email templates.
- #
- # Implicit template rendering is not performed if any attachments or parts have been added to the email.
- # This means that you'll have to manually add each part to the email and set the content type of the email
- # to multipart/alternative.
- #
- # = Attachments
- #
- # Sending attachment in emails is easy:
- #
- # class NotifierMailer < ApplicationMailer
- # def welcome(recipient)
- # attachments['free_book.pdf'] = File.read('path/to/file.pdf')
- # mail(to: recipient, subject: "New account information")
- # end
- # end
- #
- # Which will (if it had both a welcome.text.erb and welcome.html.erb
- # template in the view directory), send a complete multipart/mixed email with two parts,
- # the first part being a multipart/alternative with the text and HTML email parts inside,
- # and the second being a application/pdf with a Base64 encoded copy of the file.pdf book
- # with the filename +free_book.pdf+.
- #
- # If you need to send attachments with no content, you need to create an empty view for it,
- # or add an empty body parameter like this:
- #
- # class NotifierMailer < ApplicationMailer
- # def welcome(recipient)
- # attachments['free_book.pdf'] = File.read('path/to/file.pdf')
- # mail(to: recipient, subject: "New account information", body: "")
- # end
- # end
- #
- # You can also send attachments with html template, in this case you need to add body, attachments,
- # and custom content type like this:
- #
- # class NotifierMailer < ApplicationMailer
- # def welcome(recipient)
- # attachments["free_book.pdf"] = File.read("path/to/file.pdf")
- # mail(to: recipient,
- # subject: "New account information",
- # content_type: "text/html",
- # body: "Hello there")
- # end
- # end
- #
- # = Inline Attachments
- #
- # You can also specify that a file should be displayed inline with other HTML. This is useful
- # if you want to display a corporate logo or a photo.
- #
- # class NotifierMailer < ApplicationMailer
- # def welcome(recipient)
- # attachments.inline['photo.png'] = File.read('path/to/photo.png')
- # mail(to: recipient, subject: "Here is what we look like")
- # end
- # end
- #
- # And then to reference the image in the view, you create a welcome.html.erb file and
- # make a call to +image_tag+ passing in the attachment you want to display and then call
- # +url+ on the attachment to get the relative content id path for the image source:
- #
- #
Please Don't Cringe
- #
- # <%= image_tag attachments['photo.png'].url -%>
- #
- # As we are using Action View's +image_tag+ method, you can pass in any other options you want:
- #
- #
Please Don't Cringe
- #
- # <%= image_tag attachments['photo.png'].url, alt: 'Our Photo', class: 'photo' -%>
- #
- # = Observing and Intercepting Mails
- #
- # Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
- # register classes that are called during the mail delivery life cycle.
- #
- # An observer class must implement the :delivered_email(message) method which will be
- # called once for every email sent after the email has been sent.
- #
- # An interceptor class must implement the :delivering_email(message) method which will be
- # called before the email is sent, allowing you to make modifications to the email before it hits
- # the delivery agents. Your class should make any needed modifications directly to the passed
- # in Mail::Message instance.
- #
- # = Default Hash
- #
- # Action Mailer provides some intelligent defaults for your emails, these are usually specified in a
- # default method inside the class definition:
- #
- # class NotifierMailer < ApplicationMailer
- # default sender: 'system@example.com'
- # end
- #
- # You can pass in any header value that a Mail::Message accepts. Out of the box,
- # ActionMailer::Base sets the following:
- #
- # * mime_version: "1.0"
- # * charset: "UTF-8"
- # * content_type: "text/plain"
- # * parts_order: [ "text/plain", "text/enriched", "text/html" ]
- #
- # parts_order and charset are not actually valid Mail::Message header fields,
- # but Action Mailer translates them appropriately and sets the correct values.
- #
- # As you can pass in any header, you need to either quote the header as a string, or pass it in as
- # an underscored symbol, so the following will work:
- #
- # class NotifierMailer < ApplicationMailer
- # default 'Content-Transfer-Encoding' => '7bit',
- # content_description: 'This is a description'
- # end
- #
- # Finally, Action Mailer also supports passing Proc and Lambda objects into the default hash,
- # so you can define methods that evaluate as the message is being generated:
- #
- # class NotifierMailer < ApplicationMailer
- # default 'X-Special-Header' => Proc.new { my_method }, to: -> { @inviter.email_address }
- #
- # private
- # def my_method
- # 'some complex call'
- # end
- # end
- #
- # Note that the proc/lambda is evaluated right at the start of the mail message generation, so if you
- # set something in the default hash using a proc, and then set the same thing inside of your
- # mailer method, it will get overwritten by the mailer method.
- #
- # It is also possible to set these default options that will be used in all mailers through
- # the default_options= configuration in config/application.rb:
- #
- # config.action_mailer.default_options = { from: "no-reply@example.org" }
- #
- # = Callbacks
- #
- # You can specify callbacks using before_action and after_action for configuring your messages.
- # This may be useful, for example, when you want to add default inline attachments for all
- # messages sent out by a certain mailer class:
- #
- # class NotifierMailer < ApplicationMailer
- # before_action :add_inline_attachment!
- #
- # def welcome
- # mail
- # end
- #
- # private
- # def add_inline_attachment!
- # attachments.inline["footer.jpg"] = File.read('/path/to/filename.jpg')
- # end
- # end
- #
- # Callbacks in Action Mailer are implemented using
- # AbstractController::Callbacks, so you can define and configure
- # callbacks in the same manner that you would use callbacks in classes that
- # inherit from ActionController::Base.
- #
- # Note that unless you have a specific reason to do so, you should prefer
- # using before_action rather than after_action in your
- # Action Mailer classes so that headers are parsed properly.
- #
- # = Previewing emails
- #
- # You can preview your email templates visually by adding a mailer preview file to the
- # ActionMailer::Base.preview_path. Since most emails do something interesting
- # with database data, you'll need to write some scenarios to load messages with fake data:
- #
- # class NotifierMailerPreview < ActionMailer::Preview
- # def welcome
- # NotifierMailer.welcome(User.first)
- # end
- # end
- #
- # Methods must return a Mail::Message object which can be generated by calling the mailer
- # method without the additional deliver_now / deliver_later. The location of the
- # mailer previews directory can be configured using the preview_path option which has a default
- # of test/mailers/previews:
- #
- # config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"
- #
- # An overview of all previews is accessible at http://localhost:3000/rails/mailers
- # on a running development server instance.
- #
- # Previews can also be intercepted in a similar manner as deliveries can be by registering
- # a preview interceptor that has a previewing_email method:
- #
- # class CssInlineStyler
- # def self.previewing_email(message)
- # # inline CSS styles
- # end
- # end
- #
- # config.action_mailer.preview_interceptors :css_inline_styler
- #
- # Note that interceptors need to be registered both with register_interceptor
- # and register_preview_interceptor if they should operate on both sending and
- # previewing emails.
- #
- # = Configuration options
- #
- # These options are specified on the class level, like
- # ActionMailer::Base.raise_delivery_errors = true
- #
- # * default_options - You can pass this in at a class level as well as within the class itself as
- # per the above section.
- #
- # * logger - the logger is used for generating information on the mailing run if available.
- # Can be set to +nil+ for no logging. Compatible with both Ruby's own +Logger+ and Log4r loggers.
- #
- # * smtp_settings - Allows detailed configuration for :smtp delivery method:
- # * :address - Allows you to use a remote mail server. Just change it from its default
- # "localhost" setting.
- # * :port - On the off chance that your mail server doesn't run on port 25, you can change it.
- # * :domain - If you need to specify a HELO domain, you can do it here.
- # * :user_name - If your mail server requires authentication, set the username in this setting.
- # * :password - If your mail server requires authentication, set the password in this setting.
- # * :authentication - If your mail server requires authentication, you need to specify the
- # authentication type here.
- # This is a symbol and one of :plain (will send the password Base64 encoded), :login (will
- # send the password Base64 encoded) or :cram_md5 (combines a Challenge/Response mechanism to exchange
- # information and a cryptographic Message Digest 5 algorithm to hash important information)
- # * :enable_starttls_auto - Detects if STARTTLS is enabled in your SMTP server and starts
- # to use it. Defaults to true.
- # * :openssl_verify_mode - When using TLS, you can set how OpenSSL checks the certificate. This is
- # really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name
- # of an OpenSSL verify constant ('none' or 'peer') or directly the constant
- # (OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER).
- # :ssl/:tls Enables the SMTP connection to use SMTP/TLS (SMTPS: SMTP over direct TLS connection)
- #
- # * sendmail_settings - Allows you to override options for the :sendmail delivery method.
- # * :location - The location of the sendmail executable. Defaults to /usr/sbin/sendmail.
- # * :arguments - The command line arguments. Defaults to -i with -f sender@address
- # added automatically before the message is sent.
- #
- # * file_settings - Allows you to override options for the :file delivery method.
- # * :location - The directory into which emails will be written. Defaults to the application
- # tmp/mails.
- #
- # * raise_delivery_errors - Whether or not errors should be raised if the email fails to be delivered.
- #
- # * delivery_method - Defines a delivery method. Possible values are :smtp (default),
- # :sendmail, :test, and :file. Or you may provide a custom delivery method
- # object e.g. +MyOwnDeliveryMethodClass+. See the Mail gem documentation on the interface you need to
- # implement for a custom delivery agent.
- #
- # * perform_deliveries - Determines whether emails are actually sent from Action Mailer when you
- # call .deliver on an email message or on an Action Mailer method. This is on by default but can
- # be turned off to aid in functional testing.
- #
- # * deliveries - Keeps an array of all the emails sent out through the Action Mailer with
- # delivery_method :test. Most useful for unit and functional testing.
- #
- # * deliver_later_queue_name - The name of the queue used with deliver_later. Defaults to +mailers+.
- class Base < AbstractController::Base
- include DeliveryMethods
- include Rescuable
- include Parameterized
- include Previews
-
- abstract!
-
- include AbstractController::Rendering
-
- include AbstractController::Logger
- include AbstractController::Helpers
- include AbstractController::Translation
- include AbstractController::AssetPaths
- include AbstractController::Callbacks
- include AbstractController::Caching
-
- include ActionView::Layouts
-
- PROTECTED_IVARS = AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES + [:@_action_has_layout]
-
- def _protected_ivars # :nodoc:
- PROTECTED_IVARS
- end
-
- helper ActionMailer::MailHelper
-
- class_attribute :default_params
- self.default_params = {
- mime_version: "1.0",
- charset: "UTF-8",
- content_type: "text/plain",
- parts_order: [ "text/plain", "text/enriched", "text/html" ]
- }.freeze
-
- class << self
- # Register one or more Observers which will be notified when mail is delivered.
- def register_observers(*observers)
- observers.flatten.compact.each { |observer| register_observer(observer) }
- end
-
- # Register one or more Interceptors which will be called before mail is sent.
- def register_interceptors(*interceptors)
- interceptors.flatten.compact.each { |interceptor| register_interceptor(interceptor) }
- end
-
- # Register an Observer which will be notified when mail is delivered.
- # Either a class, string or symbol can be passed in as the Observer.
- # If a string or symbol is passed in it will be camelized and constantized.
- def register_observer(observer)
- Mail.register_observer(observer_class_for(observer))
- end
-
- # Register an Interceptor which will be called before mail is sent.
- # Either a class, string or symbol can be passed in as the Interceptor.
- # If a string or symbol is passed in it will be camelized and constantized.
- def register_interceptor(interceptor)
- Mail.register_interceptor(observer_class_for(interceptor))
- end
-
- def observer_class_for(value) # :nodoc:
- case value
- when String, Symbol
- value.to_s.camelize.constantize
- else
- value
- end
- end
- private :observer_class_for
-
- # Returns the name of the current mailer. This method is also being used as a path for a view lookup.
- # If this is an anonymous mailer, this method will return +anonymous+ instead.
- def mailer_name
- @mailer_name ||= anonymous? ? "anonymous" : name.underscore
- end
- # Allows to set the name of current mailer.
- attr_writer :mailer_name
- alias :controller_path :mailer_name
-
- # Sets the defaults through app configuration:
- #
- # config.action_mailer.default(from: "no-reply@example.org")
- #
- # Aliased by ::default_options=
- def default(value = nil)
- self.default_params = default_params.merge(value).freeze if value
- default_params
- end
- # Allows to set defaults through app configuration:
- #
- # config.action_mailer.default_options = { from: "no-reply@example.org" }
- alias :default_options= :default
-
- # Receives a raw email, parses it into an email object, decodes it,
- # instantiates a new mailer, and passes the email object to the mailer
- # object's +receive+ method.
- #
- # If you want your mailer to be able to process incoming messages, you'll
- # need to implement a +receive+ method that accepts the raw email string
- # as a parameter:
- #
- # class MyMailer < ActionMailer::Base
- # def receive(mail)
- # # ...
- # end
- # end
- def receive(raw_mail)
- ActiveSupport::Notifications.instrument("receive.action_mailer") do |payload|
- mail = Mail.new(raw_mail)
- set_payload_for_mail(payload, mail)
- new.receive(mail)
- end
- end
-
- # Wraps an email delivery inside of ActiveSupport::Notifications instrumentation.
- #
- # This method is actually called by the Mail::Message object itself
- # through a callback when you call :deliver on the Mail::Message,
- # calling +deliver_mail+ directly and passing a Mail::Message will do
- # nothing except tell the logger you sent the email.
- def deliver_mail(mail) #:nodoc:
- ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
- set_payload_for_mail(payload, mail)
- yield # Let Mail do the delivery actions
- end
- end
-
- private
-
- def set_payload_for_mail(payload, mail)
- payload[:mailer] = name
- payload[:message_id] = mail.message_id
- payload[:subject] = mail.subject
- payload[:to] = mail.to
- payload[:from] = mail.from
- payload[:bcc] = mail.bcc if mail.bcc.present?
- payload[:cc] = mail.cc if mail.cc.present?
- payload[:date] = mail.date
- payload[:mail] = mail.encoded
- end
-
- def method_missing(method_name, *args)
- if action_methods.include?(method_name.to_s)
- MessageDelivery.new(self, method_name, *args)
- else
- super
- end
- end
-
- def respond_to_missing?(method, include_all = false)
- action_methods.include?(method.to_s) || super
- end
- end
-
- attr_internal :message
-
- # Instantiate a new mailer object. If +method_name+ is not +nil+, the mailer
- # will be initialized according to the named method. If not, the mailer will
- # remain uninitialized (useful when you only need to invoke the "receive"
- # method, for instance).
- def initialize
- super()
- @_mail_was_called = false
- @_message = Mail.new
- end
-
- def process(method_name, *args) #:nodoc:
- payload = {
- mailer: self.class.name,
- action: method_name,
- args: args
- }
-
- ActiveSupport::Notifications.instrument("process.action_mailer", payload) do
- super
- @_message = NullMail.new unless @_mail_was_called
- end
- end
-
- class NullMail #:nodoc:
- def body; "" end
- def header; {} end
-
- def respond_to?(string, include_all = false)
- true
- end
-
- def method_missing(*args)
- nil
- end
- end
-
- # Returns the name of the mailer object.
- def mailer_name
- self.class.mailer_name
- end
-
- # Allows you to pass random and unusual headers to the new Mail::Message
- # object which will add them to itself.
- #
- # headers['X-Special-Domain-Specific-Header'] = "SecretValue"
- #
- # You can also pass a hash into headers of header field names and values,
- # which will then be set on the Mail::Message object:
- #
- # headers 'X-Special-Domain-Specific-Header' => "SecretValue",
- # 'In-Reply-To' => incoming.message_id
- #
- # The resulting Mail::Message will have the following in its header:
- #
- # X-Special-Domain-Specific-Header: SecretValue
- #
- # Note about replacing already defined headers:
- #
- # * +subject+
- # * +sender+
- # * +from+
- # * +to+
- # * +cc+
- # * +bcc+
- # * +reply-to+
- # * +orig-date+
- # * +message-id+
- # * +references+
- #
- # Fields can only appear once in email headers while other fields such as
- # X-Anything can appear multiple times.
- #
- # If you want to replace any header which already exists, first set it to
- # +nil+ in order to reset the value otherwise another field will be added
- # for the same header.
- def headers(args = nil)
- if args
- @_message.headers(args)
- else
- @_message
- end
- end
-
- # Allows you to add attachments to an email, like so:
- #
- # mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg')
- #
- # If you do this, then Mail will take the file name and work out the mime type.
- # It will also set the Content-Type, Content-Disposition, Content-Transfer-Encoding
- # and encode the contents of the attachment in Base64.
- #
- # You can also specify overrides if you want by passing a hash instead of a string:
- #
- # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip',
- # content: File.read('/path/to/filename.jpg')}
- #
- # If you want to use encoding other than Base64 then you will need to pass encoding
- # type along with the pre-encoded content as Mail doesn't know how to decode the
- # data:
- #
- # file_content = SpecialEncode(File.read('/path/to/filename.jpg'))
- # mail.attachments['filename.jpg'] = {mime_type: 'application/gzip',
- # encoding: 'SpecialEncoding',
- # content: file_content }
- #
- # You can also search for specific attachments:
- #
- # # By Filename
- # mail.attachments['filename.jpg'] # => Mail::Part object or nil
- #
- # # or by index
- # mail.attachments[0] # => Mail::Part (first attachment)
- #
- def attachments
- if @_mail_was_called
- LateAttachmentsProxy.new(@_message.attachments)
- else
- @_message.attachments
- end
- end
-
- class LateAttachmentsProxy < SimpleDelegator
- def inline; _raise_error end
- def []=(_name, _content); _raise_error end
-
- private
- def _raise_error
- raise RuntimeError, "Can't add attachments after `mail` was called.\n" \
- "Make sure to use `attachments[]=` before calling `mail`."
- end
- end
-
- # The main method that creates the message and renders the email templates. There are
- # two ways to call this method, with a block, or without a block.
- #
- # It accepts a headers hash. This hash allows you to specify
- # the most used headers in an email message, these are:
- #
- # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will
- # ask the Rails I18n class for a translated +:subject+ in the scope of
- # [mailer_scope, action_name] or if this is missing, will translate the
- # humanized version of the +action_name+
- # * +:to+ - Who the message is destined for, can be a string of addresses, or an array
- # of addresses.
- # * +:from+ - Who the message is from
- # * +:cc+ - Who you would like to Carbon-Copy on this email, can be a string of addresses,
- # or an array of addresses.
- # * +:bcc+ - Who you would like to Blind-Carbon-Copy on this email, can be a string of
- # addresses, or an array of addresses.
- # * +:reply_to+ - Who to set the Reply-To header of the email to.
- # * +:date+ - The date to say the email was sent on.
- #
- # You can set default values for any of the above headers (except +:date+)
- # by using the ::default class method:
- #
- # class Notifier < ActionMailer::Base
- # default from: 'no-reply@test.lindsaar.net',
- # bcc: 'email_logger@test.lindsaar.net',
- # reply_to: 'bounces@test.lindsaar.net'
- # end
- #
- # If you need other headers not listed above, you can either pass them in
- # as part of the headers hash or use the headers['name'] = value
- # method.
- #
- # When a +:return_path+ is specified as header, that value will be used as
- # the 'envelope from' address for the Mail message. Setting this is useful
- # when you want delivery notifications sent to a different address than the
- # one in +:from+. Mail will actually use the +:return_path+ in preference
- # to the +:sender+ in preference to the +:from+ field for the 'envelope
- # from' value.
- #
- # If you do not pass a block to the +mail+ method, it will find all
- # templates in the view paths using by default the mailer name and the
- # method name that it is being called from, it will then create parts for
- # each of these templates intelligently, making educated guesses on correct
- # content type and sequence, and return a fully prepared Mail::Message
- # ready to call :deliver on to send.
- #
- # For example:
- #
- # class Notifier < ActionMailer::Base
- # default from: 'no-reply@test.lindsaar.net'
- #
- # def welcome
- # mail(to: 'mikel@test.lindsaar.net')
- # end
- # end
- #
- # Will look for all templates at "app/views/notifier" with name "welcome".
- # If no welcome template exists, it will raise an ActionView::MissingTemplate error.
- #
- # However, those can be customized:
- #
- # mail(template_path: 'notifications', template_name: 'another')
- #
- # And now it will look for all templates at "app/views/notifications" with name "another".
- #
- # If you do pass a block, you can render specific templates of your choice:
- #
- # mail(to: 'mikel@test.lindsaar.net') do |format|
- # format.text
- # format.html
- # end
- #
- # You can even render plain text directly without using a template:
- #
- # mail(to: 'mikel@test.lindsaar.net') do |format|
- # format.text { render plain: "Hello Mikel!" }
- # format.html { render html: "
Hello Mikel!
".html_safe }
- # end
- #
- # Which will render a +multipart/alternative+ email with +text/plain+ and
- # +text/html+ parts.
- #
- # The block syntax also allows you to customize the part headers if desired:
- #
- # mail(to: 'mikel@test.lindsaar.net') do |format|
- # format.text(content_transfer_encoding: "base64")
- # format.html
- # end
- #
- def mail(headers = {}, &block)
- return message if @_mail_was_called && headers.blank? && !block
-
- # At the beginning, do not consider class default for content_type
- content_type = headers[:content_type]
-
- headers = apply_defaults(headers)
-
- # Apply charset at the beginning so all fields are properly quoted
- message.charset = charset = headers[:charset]
-
- # Set configure delivery behavior
- wrap_delivery_behavior!(headers[:delivery_method], headers[:delivery_method_options])
-
- assign_headers_to_message(message, headers)
-
- # Render the templates and blocks
- responses = collect_responses(headers, &block)
- @_mail_was_called = true
-
- create_parts_from_responses(message, responses)
-
- # Setup content type, reapply charset and handle parts order
- message.content_type = set_content_type(message, content_type, headers[:content_type])
- message.charset = charset
-
- if message.multipart?
- message.body.set_sort_order(headers[:parts_order])
- message.body.sort_parts!
- end
-
- message
- end
-
- private
-
- # Used by #mail to set the content type of the message.
- #
- # It will use the given +user_content_type+, or multipart if the mail
- # message has any attachments. If the attachments are inline, the content
- # type will be "multipart/related", otherwise "multipart/mixed".
- #
- # If there is no content type passed in via headers, and there are no
- # attachments, or the message is multipart, then the default content type is
- # used.
- def set_content_type(m, user_content_type, class_default) # :doc:
- params = m.content_type_parameters || {}
- case
- when user_content_type.present?
- user_content_type
- when m.has_attachments?
- if m.attachments.detect(&:inline?)
- ["multipart", "related", params]
- else
- ["multipart", "mixed", params]
- end
- when m.multipart?
- ["multipart", "alternative", params]
- else
- m.content_type || class_default
- end
- end
-
- # Translates the +subject+ using Rails I18n class under [mailer_scope, action_name] scope.
- # If it does not find a translation for the +subject+ under the specified scope it will default to a
- # humanized version of the action_name.
- # If the subject has interpolations, you can pass them through the +interpolations+ parameter.
- def default_i18n_subject(interpolations = {}) # :doc:
- mailer_scope = self.class.mailer_name.tr("/", ".")
- I18n.t(:subject, interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))
- end
-
- # Emails do not support relative path links.
- def self.supports_path? # :doc:
- false
- end
-
- def apply_defaults(headers)
- default_values = self.class.default.map do |key, value|
- [
- key,
- compute_default(value)
- ]
- end.to_h
-
- headers_with_defaults = headers.reverse_merge(default_values)
- headers_with_defaults[:subject] ||= default_i18n_subject
- headers_with_defaults
- end
-
- def compute_default(value)
- return value unless value.is_a?(Proc)
-
- if value.arity == 1
- instance_exec(self, &value)
- else
- instance_exec(&value)
- end
- end
-
- def assign_headers_to_message(message, headers)
- assignable = headers.except(:parts_order, :content_type, :body, :template_name,
- :template_path, :delivery_method, :delivery_method_options)
- assignable.each { |k, v| message[k] = v }
- end
-
- def collect_responses(headers)
- if block_given?
- collector = ActionMailer::Collector.new(lookup_context) { render(action_name) }
- yield(collector)
- collector.responses
- elsif headers[:body]
- collect_responses_from_text(headers)
- else
- collect_responses_from_templates(headers)
- end
- end
-
- def collect_responses_from_text(headers)
- [{
- body: headers.delete(:body),
- content_type: headers[:content_type] || "text/plain"
- }]
- end
-
- def collect_responses_from_templates(headers)
- templates_path = headers[:template_path] || self.class.mailer_name
- templates_name = headers[:template_name] || action_name
-
- each_template(Array(templates_path), templates_name).map do |template|
- self.formats = template.formats
- {
- body: render(template: template),
- content_type: template.type.to_s
- }
- end
- end
-
- def each_template(paths, name, &block)
- templates = lookup_context.find_all(name, paths)
- if templates.empty?
- raise ActionView::MissingTemplate.new(paths, name, paths, false, "mailer")
- else
- templates.uniq(&:formats).each(&block)
- end
- end
-
- def create_parts_from_responses(m, responses)
- if responses.size == 1 && !m.has_attachments?
- responses[0].each { |k, v| m[k] = v }
- elsif responses.size > 1 && m.has_attachments?
- container = Mail::Part.new
- container.content_type = "multipart/alternative"
- responses.each { |r| insert_part(container, r, m.charset) }
- m.add_part(container)
- else
- responses.each { |r| insert_part(m, r, m.charset) }
- end
- end
-
- def insert_part(container, response, charset)
- response[:charset] ||= charset
- part = Mail::Part.new(response)
- container.add_part(part)
- end
-
- # This and #instrument_name is for caching instrument
- def instrument_payload(key)
- {
- mailer: mailer_name,
- key: key
- }
- end
-
- def instrument_name
- "action_mailer".freeze
- end
-
- ActiveSupport.run_load_hooks(:action_mailer, self)
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/collector.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/collector.rb
deleted file mode 100644
index d97a73d65a..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/collector.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require "abstract_controller/collector"
-require "active_support/core_ext/hash/reverse_merge"
-require "active_support/core_ext/array/extract_options"
-
-module ActionMailer
- class Collector
- include AbstractController::Collector
- attr_reader :responses
-
- def initialize(context, &block)
- @context = context
- @responses = []
- @default_render = block
- end
-
- def any(*args, &block)
- options = args.extract_options!
- raise ArgumentError, "You have to supply at least one format" if args.empty?
- args.each { |type| send(type, options.dup, &block) }
- end
- alias :all :any
-
- def custom(mime, options = {})
- options.reverse_merge!(content_type: mime.to_s)
- @context.formats = [mime.to_sym]
- options[:body] = block_given? ? yield : @default_render.call
- @responses << options
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_job.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_job.rb
deleted file mode 100644
index a617daa87e..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_job.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require "active_job"
-
-module ActionMailer
- # The ActionMailer::DeliveryJob class is used when you
- # want to send emails outside of the request-response cycle.
- #
- # Exceptions are rescued and handled by the mailer class.
- class DeliveryJob < ActiveJob::Base # :nodoc:
- queue_as { ActionMailer::Base.deliver_later_queue_name }
-
- rescue_from StandardError, with: :handle_exception_with_mailer_class
-
- def perform(mailer, mail_method, delivery_method, *args) #:nodoc:
- mailer.constantize.public_send(mail_method, *args).send(delivery_method)
- end
-
- private
- # "Deserialize" the mailer class name by hand in case another argument
- # (like a Global ID reference) raised DeserializationError.
- def mailer_class
- if mailer = Array(@serialized_arguments).first || Array(arguments).first
- mailer.constantize
- end
- end
-
- def handle_exception_with_mailer_class(exception)
- if klass = mailer_class
- klass.handle_exception exception
- else
- raise exception
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_methods.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_methods.rb
deleted file mode 100644
index bcc4ef03cf..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/delivery_methods.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-require "tmpdir"
-
-module ActionMailer
- # This module handles everything related to mail delivery, from registering
- # new delivery methods to configuring the mail object to be sent.
- module DeliveryMethods
- extend ActiveSupport::Concern
-
- included do
- class_attribute :delivery_methods, :delivery_method
-
- # Do not make this inheritable, because we always want it to propagate
- cattr_accessor :raise_delivery_errors
- self.raise_delivery_errors = true
-
- cattr_accessor :perform_deliveries
- self.perform_deliveries = true
-
- cattr_accessor :deliver_later_queue_name
- self.deliver_later_queue_name = :mailers
-
- self.delivery_methods = {}.freeze
- self.delivery_method = :smtp
-
- add_delivery_method :smtp, Mail::SMTP,
- address: "localhost",
- port: 25,
- domain: "localhost.localdomain",
- user_name: nil,
- password: nil,
- authentication: nil,
- enable_starttls_auto: true
-
- add_delivery_method :file, Mail::FileDelivery,
- location: defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"
-
- add_delivery_method :sendmail, Mail::Sendmail,
- location: "/usr/sbin/sendmail",
- arguments: "-i"
-
- add_delivery_method :test, Mail::TestMailer
- end
-
- # Helpers for creating and wrapping delivery behavior, used by DeliveryMethods.
- module ClassMethods
- # Provides a list of emails that have been delivered by Mail::TestMailer
- delegate :deliveries, :deliveries=, to: Mail::TestMailer
-
- # Adds a new delivery method through the given class using the given
- # symbol as alias and the default options supplied.
- #
- # add_delivery_method :sendmail, Mail::Sendmail,
- # location: '/usr/sbin/sendmail',
- # arguments: '-i'
- def add_delivery_method(symbol, klass, default_options = {})
- class_attribute(:"#{symbol}_settings") unless respond_to?(:"#{symbol}_settings")
- send(:"#{symbol}_settings=", default_options)
- self.delivery_methods = delivery_methods.merge(symbol.to_sym => klass).freeze
- end
-
- def wrap_delivery_behavior(mail, method = nil, options = nil) # :nodoc:
- method ||= delivery_method
- mail.delivery_handler = self
-
- case method
- when NilClass
- raise "Delivery method cannot be nil"
- when Symbol
- if klass = delivery_methods[method]
- mail.delivery_method(klass, (send(:"#{method}_settings") || {}).merge(options || {}))
- else
- raise "Invalid delivery method #{method.inspect}"
- end
- else
- mail.delivery_method(method)
- end
-
- mail.perform_deliveries = perform_deliveries
- mail.raise_delivery_errors = raise_delivery_errors
- end
- end
-
- def wrap_delivery_behavior!(*args) # :nodoc:
- self.class.wrap_delivery_behavior(message, *args)
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/gem_version.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/gem_version.rb
deleted file mode 100644
index 9e4e29f6d0..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/gem_version.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module ActionMailer
- # Returns the version of the currently loaded Action Mailer as a Gem::Version.
- def self.gem_version
- Gem::Version.new VERSION::STRING
- end
-
- module VERSION
- MAJOR = 5
- MINOR = 1
- TINY = 7
- PRE = nil
-
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/inline_preview_interceptor.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/inline_preview_interceptor.rb
deleted file mode 100644
index 980415afe0..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/inline_preview_interceptor.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-require "base64"
-
-module ActionMailer
- # Implements a mailer preview interceptor that converts image tag src attributes
- # that use inline cid: style urls to data: style urls so that they are visible
- # when previewing an HTML email in a web browser.
- #
- # This interceptor is enabled by default. To disable it, delete it from the
- # ActionMailer::Base.preview_interceptors array:
- #
- # ActionMailer::Base.preview_interceptors.delete(ActionMailer::InlinePreviewInterceptor)
- #
- class InlinePreviewInterceptor
- PATTERN = /src=(?:"cid:[^"]+"|'cid:[^']+')/i
-
- include Base64
-
- def self.previewing_email(message) #:nodoc:
- new(message).transform!
- end
-
- def initialize(message) #:nodoc:
- @message = message
- end
-
- def transform! #:nodoc:
- return message if html_part.blank?
-
- html_part.body = html_part.decoded.gsub(PATTERN) do |match|
- if part = find_part(match[9..-2])
- %[src="#{data_url(part)}"]
- else
- match
- end
- end
-
- message
- end
-
- private
- def message
- @message
- end
-
- def html_part
- @html_part ||= message.html_part
- end
-
- def data_url(part)
- "data:#{part.mime_type};base64,#{strict_encode64(part.body.raw_source)}"
- end
-
- def find_part(cid)
- message.all_parts.find { |p| p.attachment? && p.cid == cid }
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/log_subscriber.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/log_subscriber.rb
deleted file mode 100644
index 2c058ccf66..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/log_subscriber.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require "active_support/log_subscriber"
-
-module ActionMailer
- # Implements the ActiveSupport::LogSubscriber for logging notifications when
- # email is delivered or received.
- class LogSubscriber < ActiveSupport::LogSubscriber
- # An email was delivered.
- def deliver(event)
- info do
- recipients = Array(event.payload[:to]).join(", ")
- "Sent mail to #{recipients} (#{event.duration.round(1)}ms)"
- end
-
- debug { event.payload[:mail] }
- end
-
- # An email was received.
- def receive(event)
- info { "Received mail (#{event.duration.round(1)}ms)" }
- debug { event.payload[:mail] }
- end
-
- # An email was generated.
- def process(event)
- debug do
- mailer = event.payload[:mailer]
- action = event.payload[:action]
- "#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms"
- end
- end
-
- # Use the logger configured for ActionMailer::Base.
- def logger
- ActionMailer::Base.logger
- end
- end
-end
-
-ActionMailer::LogSubscriber.attach_to :action_mailer
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/mail_helper.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/mail_helper.rb
deleted file mode 100644
index e04fc08866..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/mail_helper.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-module ActionMailer
- # Provides helper methods for ActionMailer::Base that can be used for easily
- # formatting messages, accessing mailer or message instances, and the
- # attachments list.
- module MailHelper
- # Take the text and format it, indented two spaces for each line, and
- # wrapped at 72 columns:
- #
- # text = <<-TEXT
- # This is
- # the paragraph.
- #
- # * item1 * item2
- # TEXT
- #
- # block_format text
- # # => " This is the paragraph.\n\n * item1\n * item2\n"
- def block_format(text)
- formatted = text.split(/\n\r?\n/).collect { |paragraph|
- format_paragraph(paragraph)
- }.join("\n\n")
-
- # Make list points stand on their own line
- formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { " #{$1} #{$2.strip}\n" }
- formatted.gsub!(/[ ]*([#]+) ([^#]*)/) { " #{$1} #{$2.strip}\n" }
-
- formatted
- end
-
- # Access the mailer instance.
- def mailer
- @_controller
- end
-
- # Access the message instance.
- def message
- @_message
- end
-
- # Access the message attachments list.
- def attachments
- mailer.attachments
- end
-
- # Returns +text+ wrapped at +len+ columns and indented +indent+ spaces.
- # By default column length +len+ equals 72 characters and indent
- # +indent+ equal two spaces.
- #
- # my_text = 'Here is a sample text with more than 40 characters'
- #
- # format_paragraph(my_text, 25, 4)
- # # => " Here is a sample text with\n more than 40 characters"
- def format_paragraph(text, len = 72, indent = 2)
- sentences = [[]]
-
- text.split.each do |word|
- if sentences.first.present? && (sentences.last + [word]).join(" ").length > len
- sentences << [word]
- else
- sentences.last << word
- end
- end
-
- indentation = " " * indent
- sentences.map! { |sentence|
- "#{indentation}#{sentence.join(' ')}"
- }.join "\n"
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/message_delivery.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/message_delivery.rb
deleted file mode 100644
index cf7c57e6bf..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/message_delivery.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-require "delegate"
-
-module ActionMailer
- # The ActionMailer::MessageDelivery class is used by
- # ActionMailer::Base when creating a new mailer.
- # MessageDelivery is a wrapper (+Delegator+ subclass) around a lazy
- # created Mail::Message. You can get direct access to the
- # Mail::Message, deliver the email or schedule the email to be sent
- # through Active Job.
- #
- # Notifier.welcome(User.first) # an ActionMailer::MessageDelivery object
- # Notifier.welcome(User.first).deliver_now # sends the email
- # Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
- # Notifier.welcome(User.first).message # a Mail::Message object
- class MessageDelivery < Delegator
- def initialize(mailer_class, action, *args) #:nodoc:
- @mailer_class, @action, @args = mailer_class, action, args
-
- # The mail is only processed if we try to call any methods on it.
- # Typical usage will leave it unloaded and call deliver_later.
- @processed_mailer = nil
- @mail_message = nil
- end
-
- # Method calls are delegated to the Mail::Message that's ready to deliver.
- def __getobj__ #:nodoc:
- @mail_message ||= processed_mailer.message
- end
-
- # Unused except for delegator internals (dup, marshaling).
- def __setobj__(mail_message) #:nodoc:
- @mail_message = mail_message
- end
-
- # Returns the resulting Mail::Message
- def message
- __getobj__
- end
-
- # Was the delegate loaded, causing the mailer action to be processed?
- def processed?
- @processed_mailer || @mail_message
- end
-
- # Enqueues the email to be delivered through Active Job. When the
- # job runs it will send the email using +deliver_now!+. That means
- # that the message will be sent bypassing checking +perform_deliveries+
- # and +raise_delivery_errors+, so use with caution.
- #
- # Notifier.welcome(User.first).deliver_later!
- # Notifier.welcome(User.first).deliver_later!(wait: 1.hour)
- # Notifier.welcome(User.first).deliver_later!(wait_until: 10.hours.from_now)
- #
- # Options:
- #
- # * :wait - Enqueue the email to be delivered with a delay
- # * :wait_until - Enqueue the email to be delivered at (after) a specific date / time
- # * :queue - Enqueue the email on the specified queue
- def deliver_later!(options = {})
- enqueue_delivery :deliver_now!, options
- end
-
- # Enqueues the email to be delivered through Active Job. When the
- # job runs it will send the email using +deliver_now+.
- #
- # Notifier.welcome(User.first).deliver_later
- # Notifier.welcome(User.first).deliver_later(wait: 1.hour)
- # Notifier.welcome(User.first).deliver_later(wait_until: 10.hours.from_now)
- #
- # Options:
- #
- # * :wait - Enqueue the email to be delivered with a delay.
- # * :wait_until - Enqueue the email to be delivered at (after) a specific date / time.
- # * :queue - Enqueue the email on the specified queue.
- def deliver_later(options = {})
- enqueue_delivery :deliver_now, options
- end
-
- # Delivers an email without checking +perform_deliveries+ and +raise_delivery_errors+,
- # so use with caution.
- #
- # Notifier.welcome(User.first).deliver_now!
- #
- def deliver_now!
- processed_mailer.handle_exceptions do
- message.deliver!
- end
- end
-
- # Delivers an email:
- #
- # Notifier.welcome(User.first).deliver_now
- #
- def deliver_now
- processed_mailer.handle_exceptions do
- message.deliver
- end
- end
-
- private
- # Returns the processed Mailer instance. We keep this instance
- # on hand so we can delegate exception handling to it.
- def processed_mailer
- @processed_mailer ||= @mailer_class.new.tap do |mailer|
- mailer.process @action, *@args
- end
- end
-
- def enqueue_delivery(delivery_method, options = {})
- if processed?
- ::Kernel.raise "You've accessed the message before asking to " \
- "deliver it later, so you may have made local changes that would " \
- "be silently lost if we enqueued a job to deliver it. Why? Only " \
- "the mailer method *arguments* are passed with the delivery job! " \
- "Do not access the message in any way if you mean to deliver it " \
- "later. Workarounds: 1. don't touch the message before calling " \
- "#deliver_later, 2. only touch the message *within your mailer " \
- "method*, or 3. use a custom Active Job instead of #deliver_later."
- else
- args = @mailer_class.name, @action.to_s, delivery_method.to_s, *@args
- ::ActionMailer::DeliveryJob.set(options).perform_later(*args)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/parameterized.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/parameterized.rb
deleted file mode 100644
index 3acacc1f14..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/parameterized.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-module ActionMailer
- # Provides the option to parameterize mailers in order to share instance variable
- # setup, processing, and common headers.
- #
- # Consider this example that does not use parameterization:
- #
- # class InvitationsMailer < ApplicationMailer
- # def account_invitation(inviter, invitee)
- # @account = inviter.account
- # @inviter = inviter
- # @invitee = invitee
- #
- # subject = "#{@inviter.name} invited you to their Basecamp (#{@account.name})"
- #
- # mail \
- # subject: subject,
- # to: invitee.email_address,
- # from: common_address(inviter),
- # reply_to: inviter.email_address_with_name
- # end
- #
- # def project_invitation(project, inviter, invitee)
- # @account = inviter.account
- # @project = project
- # @inviter = inviter
- # @invitee = invitee
- # @summarizer = ProjectInvitationSummarizer.new(@project.bucket)
- #
- # subject = "#{@inviter.name.familiar} added you to a project in Basecamp (#{@account.name})"
- #
- # mail \
- # subject: subject,
- # to: invitee.email_address,
- # from: common_address(inviter),
- # reply_to: inviter.email_address_with_name
- # end
- #
- # def bulk_project_invitation(projects, inviter, invitee)
- # @account = inviter.account
- # @projects = projects.sort_by(&:name)
- # @inviter = inviter
- # @invitee = invitee
- #
- # subject = "#{@inviter.name.familiar} added you to some new stuff in Basecamp (#{@account.name})"
- #
- # mail \
- # subject: subject,
- # to: invitee.email_address,
- # from: common_address(inviter),
- # reply_to: inviter.email_address_with_name
- # end
- # end
- #
- # InvitationsMailer.account_invitation(person_a, person_b).deliver_later
- #
- # Using parameterized mailers, this can be rewritten as:
- #
- # class InvitationsMailer < ApplicationMailer
- # before_action { @inviter, @invitee = params[:inviter], params[:invitee] }
- # before_action { @account = params[:inviter].account }
- #
- # default to: -> { @invitee.email_address },
- # from: -> { common_address(@inviter) },
- # reply_to: -> { @inviter.email_address_with_name }
- #
- # def account_invitation
- # mail subject: "#{@inviter.name} invited you to their Basecamp (#{@account.name})"
- # end
- #
- # def project_invitation
- # @project = params[:project]
- # @summarizer = ProjectInvitationSummarizer.new(@project.bucket)
- #
- # mail subject: "#{@inviter.name.familiar} added you to a project in Basecamp (#{@account.name})"
- # end
- #
- # def bulk_project_invitation
- # @projects = params[:projects].sort_by(&:name)
- #
- # mail subject: "#{@inviter.name.familiar} added you to some new stuff in Basecamp (#{@account.name})"
- # end
- # end
- #
- # InvitationsMailer.with(inviter: person_a, invitee: person_b).account_invitation.deliver_later
- module Parameterized
- extend ActiveSupport::Concern
-
- included do
- attr_accessor :params
- end
-
- module ClassMethods
- # Provide the parameters to the mailer in order to use them in the instance methods and callbacks.
- #
- # InvitationsMailer.with(inviter: person_a, invitee: person_b).account_invitation.deliver_later
- #
- # See Parameterized documentation for full example.
- def with(params)
- ActionMailer::Parameterized::Mailer.new(self, params)
- end
- end
-
- class Mailer # :nodoc:
- def initialize(mailer, params)
- @mailer, @params = mailer, params
- end
-
- private
- def method_missing(method_name, *args)
- if @mailer.action_methods.include?(method_name.to_s)
- ActionMailer::Parameterized::MessageDelivery.new(@mailer, method_name, @params, *args)
- else
- super
- end
- end
-
- def respond_to_missing?(method, include_all = false)
- @mailer.respond_to?(method, include_all)
- end
- end
-
- class MessageDelivery < ActionMailer::MessageDelivery # :nodoc:
- def initialize(mailer_class, action, params, *args)
- super(mailer_class, action, *args)
- @params = params
- end
-
- private
- def processed_mailer
- @processed_mailer ||= @mailer_class.new.tap do |mailer|
- mailer.params = @params
- mailer.process @action, *@args
- end
- end
-
- def enqueue_delivery(delivery_method, options = {})
- if processed?
- super
- else
- args = @mailer_class.name, @action.to_s, delivery_method.to_s, @params, *@args
- ActionMailer::Parameterized::DeliveryJob.set(options).perform_later(*args)
- end
- end
- end
-
- class DeliveryJob < ActionMailer::DeliveryJob # :nodoc:
- def perform(mailer, mail_method, delivery_method, params, *args)
- mailer.constantize.with(params).public_send(mail_method, *args).send(delivery_method)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/preview.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/preview.rb
deleted file mode 100644
index b0152aff03..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/preview.rb
+++ /dev/null
@@ -1,119 +0,0 @@
-require "active_support/descendants_tracker"
-
-module ActionMailer
- module Previews #:nodoc:
- extend ActiveSupport::Concern
-
- included do
- # Set the location of mailer previews through app configuration:
- #
- # config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"
- #
- mattr_accessor :preview_path, instance_writer: false
-
- # Enable or disable mailer previews through app configuration:
- #
- # config.action_mailer.show_previews = true
- #
- # Defaults to true for development environment
- #
- mattr_accessor :show_previews, instance_writer: false
-
- # :nodoc:
- mattr_accessor :preview_interceptors, instance_writer: false
- self.preview_interceptors = [ActionMailer::InlinePreviewInterceptor]
- end
-
- module ClassMethods
- # Register one or more Interceptors which will be called before mail is previewed.
- def register_preview_interceptors(*interceptors)
- interceptors.flatten.compact.each { |interceptor| register_preview_interceptor(interceptor) }
- end
-
- # Register an Interceptor which will be called before mail is previewed.
- # Either a class or a string can be passed in as the Interceptor. If a
- # string is passed in it will be constantized.
- def register_preview_interceptor(interceptor)
- preview_interceptor = \
- case interceptor
- when String, Symbol
- interceptor.to_s.camelize.constantize
- else
- interceptor
- end
-
- unless preview_interceptors.include?(preview_interceptor)
- preview_interceptors << preview_interceptor
- end
- end
- end
- end
-
- class Preview
- extend ActiveSupport::DescendantsTracker
-
- class << self
- # Returns all mailer preview classes.
- def all
- load_previews if descendants.empty?
- descendants
- end
-
- # Returns the mail object for the given email name. The registered preview
- # interceptors will be informed so that they can transform the message
- # as they would if the mail was actually being delivered.
- def call(email)
- preview = new
- message = preview.public_send(email)
- inform_preview_interceptors(message)
- message
- end
-
- # Returns all of the available email previews.
- def emails
- public_instance_methods(false).map(&:to_s).sort
- end
-
- # Returns true if the email exists.
- def email_exists?(email)
- emails.include?(email)
- end
-
- # Returns true if the preview exists.
- def exists?(preview)
- all.any? { |p| p.preview_name == preview }
- end
-
- # Find a mailer preview by its underscored class name.
- def find(preview)
- all.find { |p| p.preview_name == preview }
- end
-
- # Returns the underscored name of the mailer preview without the suffix.
- def preview_name
- name.sub(/Preview$/, "").underscore
- end
-
- private
- def load_previews
- if preview_path
- Dir["#{preview_path}/**/*_preview.rb"].each { |file| require_dependency file }
- end
- end
-
- def preview_path
- Base.preview_path
- end
-
- def show_previews
- Base.show_previews
- end
-
- def inform_preview_interceptors(message)
- Base.preview_interceptors.each do |interceptor|
- interceptor.previewing_email(message)
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/railtie.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/railtie.rb
deleted file mode 100644
index 913df8cf93..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/railtie.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require "active_job/railtie"
-require "action_mailer"
-require "rails"
-require "abstract_controller/railties/routes_helpers"
-
-module ActionMailer
- class Railtie < Rails::Railtie # :nodoc:
- config.action_mailer = ActiveSupport::OrderedOptions.new
- config.eager_load_namespaces << ActionMailer
-
- initializer "action_mailer.logger" do
- ActiveSupport.on_load(:action_mailer) { self.logger ||= Rails.logger }
- end
-
- initializer "action_mailer.set_configs" do |app|
- paths = app.config.paths
- options = app.config.action_mailer
-
- if app.config.force_ssl
- options.default_url_options ||= {}
- options.default_url_options[:protocol] ||= "https"
- end
-
- options.assets_dir ||= paths["public"].first
- options.javascripts_dir ||= paths["public/javascripts"].first
- options.stylesheets_dir ||= paths["public/stylesheets"].first
- options.show_previews = Rails.env.development? if options.show_previews.nil?
- options.cache_store ||= Rails.cache
-
- if options.show_previews
- options.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
- end
-
- # make sure readers methods get compiled
- options.asset_host ||= app.config.asset_host
- options.relative_url_root ||= app.config.relative_url_root
-
- ActiveSupport.on_load(:action_mailer) do
- include AbstractController::UrlFor
- extend ::AbstractController::Railties::RoutesHelpers.with(app.routes, false)
- include app.routes.mounted_helpers
-
- register_interceptors(options.delete(:interceptors))
- register_preview_interceptors(options.delete(:preview_interceptors))
- register_observers(options.delete(:observers))
-
- options.each { |k, v| send("#{k}=", v) }
- end
-
- ActiveSupport.on_load(:action_dispatch_integration_test) { include ActionMailer::TestCase::ClearTestDeliveries }
- end
-
- initializer "action_mailer.compile_config_methods" do
- ActiveSupport.on_load(:action_mailer) do
- config.compile_methods! if config.respond_to?(:compile_methods!)
- end
- end
-
- config.after_initialize do |app|
- options = app.config.action_mailer
-
- if options.show_previews
- app.routes.prepend do
- get "/rails/mailers" => "rails/mailers#index", internal: true
- get "/rails/mailers/*path" => "rails/mailers#preview", internal: true
- end
-
- if options.preview_path
- ActiveSupport::Dependencies.autoload_paths << options.preview_path
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/rescuable.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/rescuable.rb
deleted file mode 100644
index f2eabfa057..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/rescuable.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-module ActionMailer #:nodoc:
- # Provides `rescue_from` for mailers. Wraps mailer action processing,
- # mail job processing, and mail delivery.
- module Rescuable
- extend ActiveSupport::Concern
- include ActiveSupport::Rescuable
-
- class_methods do
- def handle_exception(exception) #:nodoc:
- rescue_with_handler(exception) || raise(exception)
- end
- end
-
- def handle_exceptions #:nodoc:
- yield
- rescue => exception
- rescue_with_handler(exception) || raise
- end
-
- private
- def process(*)
- handle_exceptions do
- super
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_case.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_case.rb
deleted file mode 100644
index 9ead03a40c..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_case.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require "active_support/test_case"
-require "rails-dom-testing"
-
-module ActionMailer
- class NonInferrableMailerError < ::StandardError
- def initialize(name)
- super "Unable to determine the mailer to test from #{name}. " \
- "You'll need to specify it using tests YourMailer in your " \
- "test case definition"
- end
- end
-
- class TestCase < ActiveSupport::TestCase
- module ClearTestDeliveries
- extend ActiveSupport::Concern
-
- included do
- setup :clear_test_deliveries
- teardown :clear_test_deliveries
- end
-
- private
-
- def clear_test_deliveries
- if ActionMailer::Base.delivery_method == :test
- ActionMailer::Base.deliveries.clear
- end
- end
- end
-
- module Behavior
- extend ActiveSupport::Concern
-
- include ActiveSupport::Testing::ConstantLookup
- include TestHelper
- include Rails::Dom::Testing::Assertions::SelectorAssertions
- include Rails::Dom::Testing::Assertions::DomAssertions
-
- included do
- class_attribute :_mailer_class
- setup :initialize_test_deliveries
- setup :set_expected_mail
- teardown :restore_test_deliveries
- ActiveSupport.run_load_hooks(:action_mailer_test_case, self)
- end
-
- module ClassMethods
- def tests(mailer)
- case mailer
- when String, Symbol
- self._mailer_class = mailer.to_s.camelize.constantize
- when Module
- self._mailer_class = mailer
- else
- raise NonInferrableMailerError.new(mailer)
- end
- end
-
- def mailer_class
- if mailer = _mailer_class
- mailer
- else
- tests determine_default_mailer(name)
- end
- end
-
- def determine_default_mailer(name)
- mailer = determine_constant_from_test_name(name) do |constant|
- Class === constant && constant < ActionMailer::Base
- end
- raise NonInferrableMailerError.new(name) if mailer.nil?
- mailer
- end
- end
-
- private
-
- def initialize_test_deliveries
- set_delivery_method :test
- @old_perform_deliveries = ActionMailer::Base.perform_deliveries
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries.clear
- end
-
- def restore_test_deliveries
- restore_delivery_method
- ActionMailer::Base.perform_deliveries = @old_perform_deliveries
- end
-
- def set_delivery_method(method)
- @old_delivery_method = ActionMailer::Base.delivery_method
- ActionMailer::Base.delivery_method = method
- end
-
- def restore_delivery_method
- ActionMailer::Base.deliveries.clear
- ActionMailer::Base.delivery_method = @old_delivery_method
- end
-
- def set_expected_mail
- @expected = Mail.new
- @expected.content_type ["text", "plain", { "charset" => charset }]
- @expected.mime_version = "1.0"
- end
-
- def charset
- "UTF-8"
- end
-
- def encode(subject)
- Mail::Encodings.q_value_encode(subject, charset)
- end
-
- def read_fixture(action)
- IO.readlines(File.join(Rails.root, "test", "fixtures", self.class.mailer_class.name.underscore, action))
- end
- end
-
- include Behavior
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_helper.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_helper.rb
deleted file mode 100644
index c30fb1fc18..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/test_helper.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-require "active_job"
-
-module ActionMailer
- # Provides helper methods for testing Action Mailer, including #assert_emails
- # and #assert_no_emails.
- module TestHelper
- include ActiveJob::TestHelper
-
- # Asserts that the number of emails sent matches the given number.
- #
- # def test_emails
- # assert_emails 0
- # ContactMailer.welcome.deliver_now
- # assert_emails 1
- # ContactMailer.welcome.deliver_now
- # assert_emails 2
- # end
- #
- # If a block is passed, that block should cause the specified number of
- # emails to be sent.
- #
- # def test_emails_again
- # assert_emails 1 do
- # ContactMailer.welcome.deliver_now
- # end
- #
- # assert_emails 2 do
- # ContactMailer.welcome.deliver_now
- # ContactMailer.welcome.deliver_now
- # end
- # end
- def assert_emails(number)
- if block_given?
- original_count = ActionMailer::Base.deliveries.size
- yield
- new_count = ActionMailer::Base.deliveries.size
- assert_equal number, new_count - original_count, "#{number} emails expected, but #{new_count - original_count} were sent"
- else
- assert_equal number, ActionMailer::Base.deliveries.size
- end
- end
-
- # Asserts that no emails have been sent.
- #
- # def test_emails
- # assert_no_emails
- # ContactMailer.welcome.deliver_now
- # assert_emails 1
- # end
- #
- # If a block is passed, that block should not cause any emails to be sent.
- #
- # def test_emails_again
- # assert_no_emails do
- # # No emails should be sent from this block
- # end
- # end
- #
- # Note: This assertion is simply a shortcut for:
- #
- # assert_emails 0
- def assert_no_emails(&block)
- assert_emails 0, &block
- end
-
- # Asserts that the number of emails enqueued for later delivery matches
- # the given number.
- #
- # def test_emails
- # assert_enqueued_emails 0
- # ContactMailer.welcome.deliver_later
- # assert_enqueued_emails 1
- # ContactMailer.welcome.deliver_later
- # assert_enqueued_emails 2
- # end
- #
- # If a block is passed, that block should cause the specified number of
- # emails to be enqueued.
- #
- # def test_emails_again
- # assert_enqueued_emails 1 do
- # ContactMailer.welcome.deliver_later
- # end
- #
- # assert_enqueued_emails 2 do
- # ContactMailer.welcome.deliver_later
- # ContactMailer.welcome.deliver_later
- # end
- # end
- def assert_enqueued_emails(number, &block)
- assert_enqueued_jobs number, only: [ ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob ], &block
- end
-
- # Asserts that no emails are enqueued for later delivery.
- #
- # def test_no_emails
- # assert_no_enqueued_emails
- # ContactMailer.welcome.deliver_later
- # assert_enqueued_emails 1
- # end
- #
- # If a block is provided, it should not cause any emails to be enqueued.
- #
- # def test_no_emails
- # assert_no_enqueued_emails do
- # # No emails should be enqueued from this block
- # end
- # end
- def assert_no_enqueued_emails(&block)
- assert_no_enqueued_jobs only: [ ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob ], &block
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/version.rb b/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/version.rb
deleted file mode 100644
index 8452d6370e..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/action_mailer/version.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require_relative "gem_version"
-
-module ActionMailer
- # Returns the version of the currently loaded Action Mailer as a
- # Gem::Version.
- def self.version
- gem_version
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/USAGE b/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/USAGE
deleted file mode 100644
index 2b0a078109..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/USAGE
+++ /dev/null
@@ -1,17 +0,0 @@
-Description:
-============
- Stubs out a new mailer and its views. Passes the mailer name, either
- CamelCased or under_scored, and an optional list of emails as arguments.
-
- This generates a mailer class in app/mailers and invokes your template
- engine and test framework generators.
-
-Example:
-========
- rails generate mailer Notifications signup forgot_password invoice
-
- creates a Notifications mailer class, views, and test:
- Mailer: app/mailers/notifications_mailer.rb
- Views: app/views/notifications_mailer/signup.text.erb [...]
- Test: test/mailers/notifications_mailer_test.rb
-
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/mailer_generator.rb b/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/mailer_generator.rb
deleted file mode 100644
index 99fe4544f1..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/mailer_generator.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module Rails
- module Generators
- class MailerGenerator < NamedBase
- source_root File.expand_path("../templates", __FILE__)
-
- argument :actions, type: :array, default: [], banner: "method method"
-
- check_class_collision suffix: "Mailer"
-
- def create_mailer_file
- template "mailer.rb", File.join("app/mailers", class_path, "#{file_name}_mailer.rb")
-
- in_root do
- if behavior == :invoke && !File.exist?(application_mailer_file_name)
- template "application_mailer.rb", application_mailer_file_name
- end
- end
- end
-
- hook_for :template_engine, :test_framework
-
- private
- def file_name # :doc:
- @_file_name ||= super.gsub(/_mailer/i, "")
- end
-
- def application_mailer_file_name
- @_application_mailer_file_name ||= if mountable_engine?
- "app/mailers/#{namespaced_path}/application_mailer.rb"
- else
- "app/mailers/application_mailer.rb"
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/application_mailer.rb b/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/application_mailer.rb
deleted file mode 100644
index 00fb9bd48f..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/application_mailer.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-<% module_namespacing do -%>
-class ApplicationMailer < ActionMailer::Base
- default from: 'from@example.com'
- layout 'mailer'
-end
-<% end %>
diff --git a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/mailer.rb b/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/mailer.rb
deleted file mode 100644
index 348d314758..0000000000
--- a/debian/gems-compat/actionmailer-5.1.7/lib/rails/generators/mailer/templates/mailer.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-<% module_namespacing do -%>
-class <%= class_name %>Mailer < ApplicationMailer
-<% actions.each do |action| -%>
-
- # Subject can be set in your I18n file at config/locales/en.yml
- # with the following lookup:
- #
- # en.<%= file_path.tr("/",".") %>_mailer.<%= action %>.subject
- #
- def <%= action %>
- @greeting = "Hi"
-
- mail to: "to@example.org"
- end
-<% end -%>
-end
-<% end -%>
diff --git a/debian/gems-compat/actionpack-5.1.7/CHANGELOG.md b/debian/gems-compat/actionpack-5.1.7/CHANGELOG.md
deleted file mode 100644
index 3cd48e3241..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/CHANGELOG.md
+++ /dev/null
@@ -1,559 +0,0 @@
-## Rails 5.1.7 (March 27, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.2 (March 11, 2019) ##
-
-* No changes.
-
-
-## Rails 5.1.6.1 (November 27, 2018) ##
-
-* No changes.
-
-
-## Rails 5.1.6 (March 29, 2018) ##
-
-* Check exclude before flagging cookies as secure.
-
- *Catherine Khuu*
-
-
-## Rails 5.1.5 (February 14, 2018) ##
-
-* Fix optimized url helpers when using relative url root
-
- Fixes #31220.
-
- *Andrew White*
-
-* Ensure dev and prod puma configs do not clobber `ActionDispatch::SystemTesting` defaults. Adds workers: 0 and daemon: false
-
- *Max Schwenk*
-
-## Rails 5.1.4 (September 07, 2017) ##
-
-* Make `take_failed_screenshot` work within engine.
-
- Fixes #30405.
-
- *Yuji Yaginuma*
-
-## Rails 5.1.4.rc1 (August 24, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3 (August 03, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc3 (July 31, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc2 (July 25, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.3.rc1 (July 19, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.2 (June 26, 2017) ##
-
-* Fallback `ActionController::Parameters#to_s` to `Hash#to_s`.
-
- *Kir Shatrov*
-
-* `driven_by` now registers poltergeist and capybara-webkit
-
- If driver poltergeist or capybara-webkit is set for System Tests,
- `driven_by` will register the driver and set additional options passed via
- `:options` param.
-
- Refer to drivers documentation to learn what options can be passed.
-
- *Mario Chavez*
-
-## Rails 5.1.1 (May 12, 2017) ##
-
-* No changes.
-
-
-## Rails 5.1.0 (April 27, 2017) ##
-
-* Raise exception when calling `to_h` and `to_hash` in an unpermitted Parameters.
-
- Before we returned either an empty hash or only the always permitted parameters
- (`:controller` and `:action` by default).
-
- The previous behavior was dangerous because in order to get the attributes users
- usually fallback to use `to_unsafe_h that` could potentially introduce security issues.
-
- *Rafael Mendonça França*
-
-* Deprecate `config.action_controller.raise_on_unfiltered_parameters`.
-
- This option has no effect in Rails 5.1.
-
- *Rafael Mendonça França*
-
-* Use more specific check for :format in route path
-
- The current check for whether to add an optional format to the path is very lax
- and will match things like `:format_id` where there are nested resources, e.g:
-
- ``` ruby
- resources :formats do
- resources :items
- end
- ```
-
- Fix this by using a more restrictive regex pattern that looks for the patterns
- `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
- allow for multiple closing parenthesis since the route may be of this form:
-
- ``` ruby
- get "/books(/:action(.:format))", controller: "books"
- ```
-
- This probably isn't what's intended since it means that the default index action
- route doesn't support a format but we have a test for it so we need to allow it.
-
- Fixes #28517.
-
- *Andrew White*
-
-* Add `action_controller_api` and `action_controller_base` load hooks to be called in `ActiveSupport.on_load`
-
- `ActionController::Base` and `ActionController::API` have differing implementations. This means that
- the one umbrella hook `action_controller` is not able to address certain situations where a method
- may not exist in a certain implementation.
-
- This is fixed by adding two new hooks so you can target `ActionController::Base` vs `ActionController::API`
-
- Fixes #27013.
-
- *Julian Nadeau*
-
-* Don't include default headers in `ActionController::Metal` responses
-
- The commit e16afe6 introduced an unintentional change of behavior where the default
- headers were included in responses from `ActionController::Metal` based controllers.
- This is now reverted to the previous behavior of having no default headers.
-
- Fixes #25820.
-
- *Jon Moss*
-
-* Fix `NameError` raised in `ActionController::Renderer#with_defaults`
-
- *Hiroyuki Ishii*
-
-* Added `#reverse_merge` and `#reverse_merge!` methods to `ActionController::Parameters`
-
- *Edouard Chin*, *Mitsutaka Mimura*
-
-* Fix malformed URLS when using `ApplicationController.renderer`
-
- The Rack environment variable `rack.url_scheme` was not being set so `scheme` was
- returning `nil`. This caused URLs to be malformed with the default settings.
- Fix this by setting `rack.url_scheme` when the environment is normalized.
-
- Fixes #28151.
-
- *George Vrettos*
-
-* Commit flash changes when using a redirect route.
-
- Fixes #27992.
-
- *Andrew White*
-
-* Prefer `remove_method` over `undef_method` when reloading routes
-
- When `undef_method` is used it prevents access to other implementations of that
- url helper in the ancestor chain so use `remove_method` instead to restore access.
-
- *Andrew White*
-
-* Add the `resolve` method to the routing DSL
-
- This new method allows customization of the polymorphic mapping of models:
-
- ``` ruby
- resource :basket
- resolve("Basket") { [:basket] }
- ```
-
- ``` erb
- <%= form_for @basket do |form| %>
-
- <% end %>
- ```
-
- This generates the correct singular URL for the form instead of the default
- resources member url, e.g. `/basket` vs. `/basket/:id`.
-
- Fixes #1769.
-
- *Andrew White*
-
-* Add the `direct` method to the routing DSL
-
- This new method allows creation of custom url helpers, e.g:
-
- ``` ruby
- direct(:apple) { "http://www.apple.com" }
-
- >> apple_url
- => "http://www.apple.com"
- ```
-
- This has the advantage of being available everywhere url helpers are available
- unlike custom url helpers defined in helper modules, etc.
-
- *Andrew White*
-
-* Add `ActionDispatch::SystemTestCase` to Action Pack
-
- Adds Capybara integration directly into Rails through Action Pack!
-
- See PR [#26703](https://github.com/rails/rails/pull/26703)
-
- *Eileen M. Uchitelle*
-
-* Remove deprecated `.to_prepare`, `.to_cleanup`, `.prepare!` and `.cleanup!` from `ActionDispatch::Reloader`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionDispatch::Callbacks.to_prepare` and `ActionDispatch::Callbacks.to_cleanup`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionController::Metal.call`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionController::Metal#env`.
-
- *Rafael Mendonça França*
-
-* Make `with_routing` test helper work when testing controllers inheriting from `ActionController::API`
-
- *Julia López*
-
-* Use accept header in integration tests with `as: :json`
-
- Instead of appending the `format` to the request path, Rails will figure
- out the format from the header instead.
-
- This allows devs to use `:as` on routes that don't have a format.
-
- Fixes #27144.
-
- *Kasper Timm Hansen*
-
-* Reset a new session directly after its creation in `ActionDispatch::IntegrationTest#open_session`.
-
- Fixes #22742.
-
- *Tawan Sierek*
-
-* Fixes incorrect output from `rails routes` when using singular resources.
-
- Fixes #26606.
-
- *Erick Reyna*
-
-* Fixes multiple calls to `logger.fatal` instead of a single call,
- for every line in an exception backtrace, when printing trace
- from `DebugExceptions` middleware.
-
- Fixes #26134.
-
- *Vipul A M*
-
-* Add support for arbitrary hashes in strong parameters:
-
- ```ruby
- params.permit(preferences: {})
- ```
-
- *Xavier Noria*
-
-* Add `ActionController::Parameters#merge!`, which behaves the same as `Hash#merge!`.
-
- *Yuji Yaginuma*
-
-* Allow keys not found in `RACK_KEY_TRANSLATION` for setting the environment when rendering
- arbitrary templates.
-
- *Sammy Larbi*
-
-* Remove deprecated support to non-keyword arguments in `ActionDispatch::IntegrationTest#process`,
- `#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionDispatch::IntegrationTest#*_via_redirect`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionDispatch::IntegrationTest#xml_http_request`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support for passing `:path` and route path as strings in `ActionDispatch::Routing::Mapper#match`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support for passing path as `nil` in `ActionDispatch::Routing::Mapper#match`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `cache_control` argument from `ActionDispatch::Static#initialize`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to passing strings or symbols to the middleware stack.
-
- *Rafael Mendonça França*
-
-* Change HSTS subdomain to true.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `host` and `port` ssl options.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `const_error` argument in
- `ActionDispatch::Session::SessionRestoreError#initialize`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `#original_exception` in `ActionDispatch::Session::SessionRestoreError`.
-
- *Rafael Mendonça França*
-
-* Deprecate `ActionDispatch::ParamsParser::ParseError` in favor of
- `ActionDispatch::Http::Parameters::ParseError`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `ActionDispatch::ParamsParser`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `original_exception` and `message` arguments in
- `ActionDispatch::ParamsParser::ParseError#initialize`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `#original_exception` in `ActionDispatch::ParamsParser::ParseError`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated access to mime types through constants.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to non-keyword arguments in `ActionController::TestCase#process`,
- `#get`, `#post`, `#patch`, `#put`, `#delete`, and `#head`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated `xml_http_request` and `xhr` methods in `ActionController::TestCase`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated methods in `ActionController::Parameters`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to comparing a `ActionController::Parameters`
- with a `Hash`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to `:text` in `render`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to `:nothing` in `render`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to `:back` in `redirect_to`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to passing status as option `head`.
-
- *Rafael Mendonça França*
-
-* Remove deprecated support to passing original exception to `ActionController::BadRequest`
- and the `ActionController::BadRequest#original_exception` method.
-
- *Rafael Mendonça França*
-
-* Remove deprecated methods `skip_action_callback`, `skip_filter`, `before_filter`,
- `prepend_before_filter`, `skip_before_filter`, `append_before_filter`, `around_filter`
- `prepend_around_filter`, `skip_around_filter`, `append_around_filter`, `after_filter`,
- `prepend_after_filter`, `skip_after_filter` and `append_after_filter`.
-
- *Rafael Mendonça França*
-
-* Show an "unmatched constraints" error when params fail to match constraints
- on a matched route, rather than a "missing keys" error.
-
- Fixes #26470.
-
- *Chris Carter*
-
-* Fix adding implicitly rendered template digests to ETags.
-
- Fixes a case when modifying an implicitly rendered template for a
- controller action using `fresh_when` or `stale?` would not result in a new
- `ETag` value.
-
- *Javan Makhmali*
-
-* Make `fixture_file_upload` work in integration tests.
-
- *Yuji Yaginuma*
-
-* Add `to_param` to `ActionController::Parameters` deprecations.
-
- In the future `ActionController::Parameters` are discouraged from being used
- in URLs without explicit whitelisting. Go through `to_h` to use `to_param`.
-
- *Kir Shatrov*
-
-* Fix nested multiple roots
-
- The PR #20940 enabled the use of multiple roots with different constraints
- at the top level but unfortunately didn't work when those roots were inside
- a namespace and also broke the use of root inside a namespace after a top
- level root was defined because the check for the existence of the named route
- used the global :root name and not the namespaced name.
-
- This is fixed by using the name_for_action method to expand the :root name to
- the full namespaced name. We can pass nil for the second argument as we're not
- dealing with resource definitions so don't need to handle the cases for edit
- and new routes.
-
- Fixes #26148.
-
- *Ryo Hashimoto*, *Andrew White*
-
-* Include the content of the flash in the auto-generated etag. This solves the following problem:
-
- 1. POST /messages
- 2. redirect_to messages_url, notice: 'Message was created'
- 3. GET /messages/1
- 4. GET /messages
-
- Step 4 would before still include the flash message, even though it's no longer relevant,
- because the etag cache was recorded with the flash in place and didn't change when it was gone.
-
- *DHH*
-
-* SSL: Changes redirect behavior for all non-GET and non-HEAD requests
- (like POST/PUT/PATCH etc) to `http://` resources to redirect to `https://`
- with a [307 status code](http://tools.ietf.org/html/rfc7231#section-6.4.7) instead of [301 status code](http://tools.ietf.org/html/rfc7231#section-6.4.2).
-
- 307 status code instructs the HTTP clients to preserve the original
- request method while redirecting. It has been part of HTTP RFC since
- 1999 and is implemented/recognized by most (if not all) user agents.
-
- # Before
- POST http://example.com/articles (i.e. ArticlesContoller#create)
- redirects to
- GET https://example.com/articles (i.e. ArticlesContoller#index)
-
- # After
- POST http://example.com/articles (i.e. ArticlesContoller#create)
- redirects to
- POST https://example.com/articles (i.e. ArticlesContoller#create)
-
- *Chirag Singhal*
-
-* Add `:as` option to `ActionController:TestCase#process` and related methods.
-
- Specifying `as: mime_type` allows the `CONTENT_TYPE` header to be specified
- in controller tests without manually doing this through `@request.headers['CONTENT_TYPE']`.
-
- *Everest Stefan Munro-Zeisberger*
-
-* Show cache hits and misses when rendering partials.
-
- Partials using the `cache` helper will show whether a render hit or missed
- the cache:
-
- ```
- Rendered messages/_message.html.erb in 1.2 ms [cache hit]
- Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
- ```
-
- This removes the need for the old fragment cache logging:
-
- ```
- Read fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/d0bdf2974e1ef6d31685c3b392ad0b74 (0.6ms)
- Rendered messages/_message.html.erb in 1.2 ms [cache hit]
- Write fragment views/v1/2914079/v1/2914079/recordings/70182313-20160225015037000000/3b4e249ac9d168c617e32e84b99218b5 (1.1ms)
- Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss]
- ```
-
- Though that full output can be reenabled with
- `config.action_controller.enable_fragment_cache_logging = true`.
-
- *Stan Lo*
-
-* Don't override the `Accept` header in integration tests when called with `xhr: true`.
-
- Fixes #25859.
-
- *David Chen*
-
-* Fix `defaults` option for root route.
-
- A regression from some refactoring for the 5.0 release, this change
- fixes the use of `defaults` (default parameters) in the `root` routing method.
-
- *Chris Arcand*
-
-* Check `request.path_parameters` encoding at the point they're set.
-
- Check for any non-UTF8 characters in path parameters at the point they're
- set in `env`. Previously they were checked for when used to get a controller
- class, but this meant routes that went directly to a Rack app, or skipped
- controller instantiation for some other reason, had to defend against
- non-UTF8 characters themselves.
-
- *Grey Baker*
-
-* Don't raise `ActionController::UnknownHttpMethod` from `ActionDispatch::Static`.
-
- Pass `Rack::Request` objects to `ActionDispatch::FileHandler` to avoid it
- raising `ActionController::UnknownHttpMethod`. If an unknown method is
- passed, it should pass exception higher in the stack instead, once we've had a
- chance to define exception handling behaviour.
-
- *Grey Baker*
-
-* Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`.
-
- Updated `ActionDispatch::ExceptionWrapper` to handle the Rack 2.0 namespace
- for `ParameterTypeError` and `InvalidParameterError` errors.
-
- *Grey Baker*
-
-Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/actionpack/CHANGELOG.md) for previous changes.
diff --git a/debian/gems-compat/actionpack-5.1.7/MIT-LICENSE b/debian/gems-compat/actionpack-5.1.7/MIT-LICENSE
deleted file mode 100644
index ac810e86d0..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/MIT-LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (c) 2004-2017 David Heinemeier Hansson
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/debian/gems-compat/actionpack-5.1.7/README.rdoc b/debian/gems-compat/actionpack-5.1.7/README.rdoc
deleted file mode 100644
index 0720c66cb9..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/README.rdoc
+++ /dev/null
@@ -1,57 +0,0 @@
-= Action Pack -- From request to response
-
-Action Pack is a framework for handling and responding to web requests. It
-provides mechanisms for *routing* (mapping request URLs to actions), defining
-*controllers* that implement actions, and generating responses by rendering
-*views*, which are templates of various formats. In short, Action Pack
-provides the view and controller layers in the MVC paradigm.
-
-It consists of several modules:
-
-* Action Dispatch, which parses information about the web request, handles
- routing as defined by the user, and does advanced processing related to HTTP
- such as MIME-type negotiation, decoding parameters in POST, PATCH, or PUT bodies,
- handling HTTP caching logic, cookies and sessions.
-
-* Action Controller, which provides a base controller class that can be
- subclassed to implement filters and actions to handle requests. The result
- of an action is typically content generated from views.
-
-With the Ruby on Rails framework, users only directly interface with the
-Action Controller module. Necessary Action Dispatch functionality is activated
-by default and Action View rendering is implicitly triggered by Action
-Controller. However, these modules are designed to function on their own and
-can be used outside of Rails.
-
-
-== Download and installation
-
-The latest version of Action Pack can be installed with RubyGems:
-
- $ gem install actionpack
-
-Source code can be downloaded as part of the Rails project on GitHub
-
-* https://github.com/rails/rails/tree/master/actionpack
-
-
-== License
-
-Action Pack is released under the MIT license:
-
-* http://www.opensource.org/licenses/MIT
-
-
-== Support
-
-API documentation is at
-
-* http://api.rubyonrails.org
-
-Bug reports can be filed for the Ruby on Rails project here:
-
-* https://github.com/rails/rails/issues
-
-Feature requests should be discussed on the rails-core mailing list here:
-
-* https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core
diff --git a/debian/gems-compat/actionpack-5.1.7/actionpack.gemspec b/debian/gems-compat/actionpack-5.1.7/actionpack.gemspec
deleted file mode 100644
index 67219bca6f..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/actionpack.gemspec
+++ /dev/null
@@ -1,55 +0,0 @@
-#########################################################
-# This file has been automatically generated by gem2tgz #
-#########################################################
-# -*- encoding: utf-8 -*-
-# stub: actionpack 5.1.7 ruby lib
-
-Gem::Specification.new do |s|
- s.name = "actionpack".freeze
- s.version = "5.1.7"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
- s.metadata = { "changelog_uri" => "https://github.com/rails/rails/blob/v5.1.7/actionpack/CHANGELOG.md", "source_code_uri" => "https://github.com/rails/rails/tree/v5.1.7/actionpack" } if s.respond_to? :metadata=
- s.require_paths = ["lib".freeze]
- s.authors = ["David Heinemeier Hansson".freeze]
- s.date = "2019-03-28"
- s.description = "Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.".freeze
- s.email = "david@loudthinking.com".freeze
- s.files = ["CHANGELOG.md".freeze, "MIT-LICENSE".freeze, "README.rdoc".freeze, "lib/abstract_controller.rb".freeze, "lib/abstract_controller/asset_paths.rb".freeze, "lib/abstract_controller/base.rb".freeze, "lib/abstract_controller/caching.rb".freeze, "lib/abstract_controller/caching/fragments.rb".freeze, "lib/abstract_controller/callbacks.rb".freeze, "lib/abstract_controller/collector.rb".freeze, "lib/abstract_controller/error.rb".freeze, "lib/abstract_controller/helpers.rb".freeze, "lib/abstract_controller/logger.rb".freeze, "lib/abstract_controller/railties/routes_helpers.rb".freeze, "lib/abstract_controller/rendering.rb".freeze, "lib/abstract_controller/translation.rb".freeze, "lib/abstract_controller/url_for.rb".freeze, "lib/action_controller.rb".freeze, "lib/action_controller/api.rb".freeze, "lib/action_controller/api/api_rendering.rb".freeze, "lib/action_controller/base.rb".freeze, "lib/action_controller/caching.rb".freeze, "lib/action_controller/form_builder.rb".freeze, "lib/action_controller/log_subscriber.rb".freeze, "lib/action_controller/metal.rb".freeze, "lib/action_controller/metal/basic_implicit_render.rb".freeze, "lib/action_controller/metal/conditional_get.rb".freeze, "lib/action_controller/metal/cookies.rb".freeze, "lib/action_controller/metal/data_streaming.rb".freeze, "lib/action_controller/metal/etag_with_flash.rb".freeze, "lib/action_controller/metal/etag_with_template_digest.rb".freeze, "lib/action_controller/metal/exceptions.rb".freeze, "lib/action_controller/metal/flash.rb".freeze, "lib/action_controller/metal/force_ssl.rb".freeze, "lib/action_controller/metal/head.rb".freeze, "lib/action_controller/metal/helpers.rb".freeze, "lib/action_controller/metal/http_authentication.rb".freeze, "lib/action_controller/metal/implicit_render.rb".freeze, "lib/action_controller/metal/instrumentation.rb".freeze, "lib/action_controller/metal/live.rb".freeze, "lib/action_controller/metal/mime_responds.rb".freeze, "lib/action_controller/metal/parameter_encoding.rb".freeze, "lib/action_controller/metal/params_wrapper.rb".freeze, "lib/action_controller/metal/redirecting.rb".freeze, "lib/action_controller/metal/renderers.rb".freeze, "lib/action_controller/metal/rendering.rb".freeze, "lib/action_controller/metal/request_forgery_protection.rb".freeze, "lib/action_controller/metal/rescue.rb".freeze, "lib/action_controller/metal/streaming.rb".freeze, "lib/action_controller/metal/strong_parameters.rb".freeze, "lib/action_controller/metal/testing.rb".freeze, "lib/action_controller/metal/url_for.rb".freeze, "lib/action_controller/railtie.rb".freeze, "lib/action_controller/railties/helpers.rb".freeze, "lib/action_controller/renderer.rb".freeze, "lib/action_controller/template_assertions.rb".freeze, "lib/action_controller/test_case.rb".freeze, "lib/action_dispatch.rb".freeze, "lib/action_dispatch/http/cache.rb".freeze, "lib/action_dispatch/http/filter_parameters.rb".freeze, "lib/action_dispatch/http/filter_redirect.rb".freeze, "lib/action_dispatch/http/headers.rb".freeze, "lib/action_dispatch/http/mime_negotiation.rb".freeze, "lib/action_dispatch/http/mime_type.rb".freeze, "lib/action_dispatch/http/mime_types.rb".freeze, "lib/action_dispatch/http/parameter_filter.rb".freeze, "lib/action_dispatch/http/parameters.rb".freeze, "lib/action_dispatch/http/rack_cache.rb".freeze, "lib/action_dispatch/http/request.rb".freeze, "lib/action_dispatch/http/response.rb".freeze, "lib/action_dispatch/http/upload.rb".freeze, "lib/action_dispatch/http/url.rb".freeze, "lib/action_dispatch/journey.rb".freeze, "lib/action_dispatch/journey/formatter.rb".freeze, "lib/action_dispatch/journey/gtg/builder.rb".freeze, "lib/action_dispatch/journey/gtg/simulator.rb".freeze, "lib/action_dispatch/journey/gtg/transition_table.rb".freeze, "lib/action_dispatch/journey/nfa/builder.rb".freeze, "lib/action_dispatch/journey/nfa/dot.rb".freeze, "lib/action_dispatch/journey/nfa/simulator.rb".freeze, "lib/action_dispatch/journey/nfa/transition_table.rb".freeze, "lib/action_dispatch/journey/nodes/node.rb".freeze, "lib/action_dispatch/journey/parser.rb".freeze, "lib/action_dispatch/journey/parser.y".freeze, "lib/action_dispatch/journey/parser_extras.rb".freeze, "lib/action_dispatch/journey/path/pattern.rb".freeze, "lib/action_dispatch/journey/route.rb".freeze, "lib/action_dispatch/journey/router.rb".freeze, "lib/action_dispatch/journey/router/utils.rb".freeze, "lib/action_dispatch/journey/routes.rb".freeze, "lib/action_dispatch/journey/scanner.rb".freeze, "lib/action_dispatch/journey/visitors.rb".freeze, "lib/action_dispatch/journey/visualizer/fsm.css".freeze, "lib/action_dispatch/journey/visualizer/fsm.js".freeze, "lib/action_dispatch/journey/visualizer/index.html.erb".freeze, "lib/action_dispatch/middleware/callbacks.rb".freeze, "lib/action_dispatch/middleware/cookies.rb".freeze, "lib/action_dispatch/middleware/debug_exceptions.rb".freeze, "lib/action_dispatch/middleware/debug_locks.rb".freeze, "lib/action_dispatch/middleware/exception_wrapper.rb".freeze, "lib/action_dispatch/middleware/executor.rb".freeze, "lib/action_dispatch/middleware/flash.rb".freeze, "lib/action_dispatch/middleware/public_exceptions.rb".freeze, "lib/action_dispatch/middleware/reloader.rb".freeze, "lib/action_dispatch/middleware/remote_ip.rb".freeze, "lib/action_dispatch/middleware/request_id.rb".freeze, "lib/action_dispatch/middleware/session/abstract_store.rb".freeze, "lib/action_dispatch/middleware/session/cache_store.rb".freeze, "lib/action_dispatch/middleware/session/cookie_store.rb".freeze, "lib/action_dispatch/middleware/session/mem_cache_store.rb".freeze, "lib/action_dispatch/middleware/show_exceptions.rb".freeze, "lib/action_dispatch/middleware/ssl.rb".freeze, "lib/action_dispatch/middleware/stack.rb".freeze, "lib/action_dispatch/middleware/static.rb".freeze, "lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/_source.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/_source.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/_trace.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/_trace.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/layout.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/template_error.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/template_error.text.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb".freeze, "lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb".freeze, "lib/action_dispatch/middleware/templates/routes/_route.html.erb".freeze, "lib/action_dispatch/middleware/templates/routes/_table.html.erb".freeze, "lib/action_dispatch/railtie.rb".freeze, "lib/action_dispatch/request/session.rb".freeze, "lib/action_dispatch/request/utils.rb".freeze, "lib/action_dispatch/routing.rb".freeze, "lib/action_dispatch/routing/endpoint.rb".freeze, "lib/action_dispatch/routing/inspector.rb".freeze, "lib/action_dispatch/routing/mapper.rb".freeze, "lib/action_dispatch/routing/polymorphic_routes.rb".freeze, "lib/action_dispatch/routing/redirection.rb".freeze, "lib/action_dispatch/routing/route_set.rb".freeze, "lib/action_dispatch/routing/routes_proxy.rb".freeze, "lib/action_dispatch/routing/url_for.rb".freeze, "lib/action_dispatch/system_test_case.rb".freeze, "lib/action_dispatch/system_testing/driver.rb".freeze, "lib/action_dispatch/system_testing/server.rb".freeze, "lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb".freeze, "lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb".freeze, "lib/action_dispatch/testing/assertion_response.rb".freeze, "lib/action_dispatch/testing/assertions.rb".freeze, "lib/action_dispatch/testing/assertions/response.rb".freeze, "lib/action_dispatch/testing/assertions/routing.rb".freeze, "lib/action_dispatch/testing/integration.rb".freeze, "lib/action_dispatch/testing/request_encoder.rb".freeze, "lib/action_dispatch/testing/test_process.rb".freeze, "lib/action_dispatch/testing/test_request.rb".freeze, "lib/action_dispatch/testing/test_response.rb".freeze, "lib/action_pack.rb".freeze, "lib/action_pack/gem_version.rb".freeze, "lib/action_pack/version.rb".freeze]
- s.homepage = "http://rubyonrails.org".freeze
- s.licenses = ["MIT".freeze]
- s.required_ruby_version = Gem::Requirement.new(">= 2.2.2".freeze)
- s.requirements = ["none".freeze]
- s.rubygems_version = "2.7.6.2".freeze
- s.summary = "Web-flow and rendering framework putting the VC in MVC (part of Rails).".freeze
-
- if s.respond_to? :specification_version then
- s.specification_version = 4
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_development_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, ["= 5.1.7"])
- s.add_runtime_dependency(%q.freeze, ["~> 2.0"])
- s.add_runtime_dependency(%q.freeze, [">= 0.6.3"])
- s.add_runtime_dependency(%q.freeze, ["~> 2.0"])
- s.add_runtime_dependency(%q.freeze, [">= 1.0.2", "~> 1.0"])
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, [">= 0.6.3"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, [">= 1.0.2", "~> 1.0"])
- end
- else
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["= 5.1.7"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, [">= 0.6.3"])
- s.add_dependency(%q.freeze, ["~> 2.0"])
- s.add_dependency(%q.freeze, [">= 1.0.2", "~> 1.0"])
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller.rb
deleted file mode 100644
index 8bd965b198..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require "action_pack"
-require "active_support/rails"
-require "active_support/i18n"
-
-module AbstractController
- extend ActiveSupport::Autoload
-
- autoload :Base
- autoload :Caching
- autoload :Callbacks
- autoload :Collector
- autoload :DoubleRenderError, "abstract_controller/rendering"
- autoload :Helpers
- autoload :Logger
- autoload :Rendering
- autoload :Translation
- autoload :AssetPaths
- autoload :UrlFor
-
- def self.eager_load!
- super
- AbstractController::Caching.eager_load!
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/asset_paths.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/asset_paths.rb
deleted file mode 100644
index e6170228d9..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/asset_paths.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-module AbstractController
- module AssetPaths #:nodoc:
- extend ActiveSupport::Concern
-
- included do
- config_accessor :asset_host, :assets_dir, :javascripts_dir,
- :stylesheets_dir, :default_asset_host_protocol, :relative_url_root
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/base.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/base.rb
deleted file mode 100644
index e7cb6347a2..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/base.rb
+++ /dev/null
@@ -1,257 +0,0 @@
-require "abstract_controller/error"
-require "active_support/configurable"
-require "active_support/descendants_tracker"
-require "active_support/core_ext/module/anonymous"
-require "active_support/core_ext/module/attr_internal"
-
-module AbstractController
- # Raised when a non-existing controller action is triggered.
- class ActionNotFound < StandardError
- end
-
- # AbstractController::Base is a low-level API. Nobody should be
- # using it directly, and subclasses (like ActionController::Base) are
- # expected to provide their own +render+ method, since rendering means
- # different things depending on the context.
- class Base
- attr_internal :response_body
- attr_internal :action_name
- attr_internal :formats
-
- include ActiveSupport::Configurable
- extend ActiveSupport::DescendantsTracker
-
- class << self
- attr_reader :abstract
- alias_method :abstract?, :abstract
-
- # Define a controller as abstract. See internal_methods for more
- # details.
- def abstract!
- @abstract = true
- end
-
- def inherited(klass) # :nodoc:
- # Define the abstract ivar on subclasses so that we don't get
- # uninitialized ivar warnings
- unless klass.instance_variable_defined?(:@abstract)
- klass.instance_variable_set(:@abstract, false)
- end
- super
- end
-
- # A list of all internal methods for a controller. This finds the first
- # abstract superclass of a controller, and gets a list of all public
- # instance methods on that abstract class. Public instance methods of
- # a controller would normally be considered action methods, so methods
- # declared on abstract classes are being removed.
- # (ActionController::Metal and ActionController::Base are defined as abstract)
- def internal_methods
- controller = self
-
- controller = controller.superclass until controller.abstract?
- controller.public_instance_methods(true)
- end
-
- # A list of method names that should be considered actions. This
- # includes all public instance methods on a controller, less
- # any internal methods (see internal_methods), adding back in
- # any methods that are internal, but still exist on the class
- # itself.
- #
- # ==== Returns
- # * Set - A set of all methods that should be considered actions.
- def action_methods
- @action_methods ||= begin
- # All public instance methods of this class, including ancestors
- methods = (public_instance_methods(true) -
- # Except for public instance methods of Base and its ancestors
- internal_methods +
- # Be sure to include shadowed public instance methods of this class
- public_instance_methods(false)).uniq.map(&:to_s)
-
- methods.to_set
- end
- end
-
- # action_methods are cached and there is sometimes a need to refresh
- # them. ::clear_action_methods! allows you to do that, so next time
- # you run action_methods, they will be recalculated.
- def clear_action_methods!
- @action_methods = nil
- end
-
- # Returns the full controller name, underscored, without the ending Controller.
- #
- # class MyApp::MyPostsController < AbstractController::Base
- #
- # end
- #
- # MyApp::MyPostsController.controller_path # => "my_app/my_posts"
- #
- # ==== Returns
- # * String
- def controller_path
- @controller_path ||= name.sub(/Controller$/, "".freeze).underscore unless anonymous?
- end
-
- # Refresh the cached action_methods when a new action_method is added.
- def method_added(name)
- super
- clear_action_methods!
- end
- end
-
- abstract!
-
- # Calls the action going through the entire action dispatch stack.
- #
- # The actual method that is called is determined by calling
- # #method_for_action. If no method can handle the action, then an
- # AbstractController::ActionNotFound error is raised.
- #
- # ==== Returns
- # * self
- def process(action, *args)
- @_action_name = action.to_s
-
- unless action_name = _find_action_name(@_action_name)
- raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
- end
-
- @_response_body = nil
-
- process_action(action_name, *args)
- end
-
- # Delegates to the class' ::controller_path
- def controller_path
- self.class.controller_path
- end
-
- # Delegates to the class' ::action_methods
- def action_methods
- self.class.action_methods
- end
-
- # Returns true if a method for the action is available and
- # can be dispatched, false otherwise.
- #
- # Notice that action_methods.include?("foo") may return
- # false and available_action?("foo") returns true because
- # this method considers actions that are also available
- # through other means, for example, implicit render ones.
- #
- # ==== Parameters
- # * action_name - The name of an action to be tested
- def available_action?(action_name)
- _find_action_name(action_name)
- end
-
- # Tests if a response body is set. Used to determine if the
- # +process_action+ callback needs to be terminated in
- # +AbstractController::Callbacks+.
- def performed?
- response_body
- end
-
- # Returns true if the given controller is capable of rendering
- # a path. A subclass of +AbstractController::Base+
- # may return false. An Email controller for example does not
- # support paths, only full URLs.
- def self.supports_path?
- true
- end
-
- private
-
- # Returns true if the name can be considered an action because
- # it has a method defined in the controller.
- #
- # ==== Parameters
- # * name - The name of an action to be tested
- #
- # :api: private
- def action_method?(name)
- self.class.action_methods.include?(name)
- end
-
- # Call the action. Override this in a subclass to modify the
- # behavior around processing an action. This, and not #process,
- # is the intended way to override action dispatching.
- #
- # Notice that the first argument is the method to be dispatched
- # which is *not* necessarily the same as the action name.
- def process_action(method_name, *args)
- send_action(method_name, *args)
- end
-
- # Actually call the method associated with the action. Override
- # this method if you wish to change how action methods are called,
- # not to add additional behavior around it. For example, you would
- # override #send_action if you want to inject arguments into the
- # method.
- alias send_action send
-
- # If the action name was not found, but a method called "action_missing"
- # was found, #method_for_action will return "_handle_action_missing".
- # This method calls #action_missing with the current action name.
- def _handle_action_missing(*args)
- action_missing(@_action_name, *args)
- end
-
- # Takes an action name and returns the name of the method that will
- # handle the action.
- #
- # It checks if the action name is valid and returns false otherwise.
- #
- # See method_for_action for more information.
- #
- # ==== Parameters
- # * action_name - An action name to find a method name for
- #
- # ==== Returns
- # * string - The name of the method that handles the action
- # * false - No valid method name could be found.
- # Raise +AbstractController::ActionNotFound+.
- def _find_action_name(action_name)
- _valid_action_name?(action_name) && method_for_action(action_name)
- end
-
- # Takes an action name and returns the name of the method that will
- # handle the action. In normal cases, this method returns the same
- # name as it receives. By default, if #method_for_action receives
- # a name that is not an action, it will look for an #action_missing
- # method and return "_handle_action_missing" if one is found.
- #
- # Subclasses may override this method to add additional conditions
- # that should be considered an action. For instance, an HTTP controller
- # with a template matching the action name is considered to exist.
- #
- # If you override this method to handle additional cases, you may
- # also provide a method (like +_handle_method_missing+) to handle
- # the case.
- #
- # If none of these conditions are true, and +method_for_action+
- # returns +nil+, an +AbstractController::ActionNotFound+ exception will be raised.
- #
- # ==== Parameters
- # * action_name - An action name to find a method name for
- #
- # ==== Returns
- # * string - The name of the method that handles the action
- # * nil - No method name could be found.
- def method_for_action(action_name)
- if action_method?(action_name)
- action_name
- elsif respond_to?(:action_missing, true)
- "_handle_action_missing"
- end
- end
-
- # Checks if the action name is valid and returns false otherwise.
- def _valid_action_name?(action_name)
- !action_name.to_s.include? File::SEPARATOR
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching.rb
deleted file mode 100644
index 26e3f08bc1..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-module AbstractController
- module Caching
- extend ActiveSupport::Concern
- extend ActiveSupport::Autoload
-
- eager_autoload do
- autoload :Fragments
- end
-
- module ConfigMethods
- def cache_store
- config.cache_store
- end
-
- def cache_store=(store)
- config.cache_store = ActiveSupport::Cache.lookup_store(store)
- end
-
- private
- def cache_configured?
- perform_caching && cache_store
- end
- end
-
- include ConfigMethods
- include AbstractController::Caching::Fragments
-
- included do
- extend ConfigMethods
-
- config_accessor :default_static_extension
- self.default_static_extension ||= ".html"
-
- config_accessor :perform_caching
- self.perform_caching = true if perform_caching.nil?
-
- config_accessor :enable_fragment_cache_logging
- self.enable_fragment_cache_logging = false
-
- class_attribute :_view_cache_dependencies
- self._view_cache_dependencies = []
- helper_method :view_cache_dependencies if respond_to?(:helper_method)
- end
-
- module ClassMethods
- def view_cache_dependency(&dependency)
- self._view_cache_dependencies += [dependency]
- end
- end
-
- def view_cache_dependencies
- self.class._view_cache_dependencies.map { |dep| instance_exec(&dep) }.compact
- end
-
- private
- # Convenience accessor.
- def cache(key, options = {}, &block) # :doc:
- if cache_configured?
- cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
- else
- yield
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching/fragments.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching/fragments.rb
deleted file mode 100644
index c85b4adba1..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/caching/fragments.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-module AbstractController
- module Caching
- # Fragment caching is used for caching various blocks within
- # views without caching the entire action as a whole. This is
- # useful when certain elements of an action change frequently or
- # depend on complicated state while other parts rarely change or
- # can be shared amongst multiple parties. The caching is done using
- # the +cache+ helper available in the Action View. See
- # ActionView::Helpers::CacheHelper for more information.
- #
- # While it's strongly recommended that you use key-based cache
- # expiration (see links in CacheHelper for more information),
- # it is also possible to manually expire caches. For example:
- #
- # expire_fragment('name_of_cache')
- module Fragments
- extend ActiveSupport::Concern
-
- included do
- if respond_to?(:class_attribute)
- class_attribute :fragment_cache_keys
- else
- mattr_writer :fragment_cache_keys
- end
-
- self.fragment_cache_keys = []
-
- helper_method :fragment_cache_key if respond_to?(:helper_method)
- end
-
- module ClassMethods
- # Allows you to specify controller-wide key prefixes for
- # cache fragments. Pass either a constant +value+, or a block
- # which computes a value each time a cache key is generated.
- #
- # For example, you may want to prefix all fragment cache keys
- # with a global version identifier, so you can easily
- # invalidate all caches.
- #
- # class ApplicationController
- # fragment_cache_key "v1"
- # end
- #
- # When it's time to invalidate all fragments, simply change
- # the string constant. Or, progressively roll out the cache
- # invalidation using a computed value:
- #
- # class ApplicationController
- # fragment_cache_key do
- # @account.id.odd? ? "v1" : "v2"
- # end
- # end
- def fragment_cache_key(value = nil, &key)
- self.fragment_cache_keys += [key || -> { value }]
- end
- end
-
- # Given a key (as described in +expire_fragment+), returns
- # a key suitable for use in reading, writing, or expiring a
- # cached fragment. All keys begin with views/,
- # followed by any controller-wide key prefix values, ending
- # with the specified +key+ value. The key is expanded using
- # ActiveSupport::Cache.expand_cache_key.
- def fragment_cache_key(key)
- head = self.class.fragment_cache_keys.map { |k| instance_exec(&k) }
- tail = key.is_a?(Hash) ? url_for(key).split("://").last : key
- ActiveSupport::Cache.expand_cache_key([*head, *tail], :views)
- end
-
- # Writes +content+ to the location signified by
- # +key+ (see +expire_fragment+ for acceptable formats).
- def write_fragment(key, content, options = nil)
- return content unless cache_configured?
-
- key = fragment_cache_key(key)
- instrument_fragment_cache :write_fragment, key do
- content = content.to_str
- cache_store.write(key, content, options)
- end
- content
- end
-
- # Reads a cached fragment from the location signified by +key+
- # (see +expire_fragment+ for acceptable formats).
- def read_fragment(key, options = nil)
- return unless cache_configured?
-
- key = fragment_cache_key(key)
- instrument_fragment_cache :read_fragment, key do
- result = cache_store.read(key, options)
- result.respond_to?(:html_safe) ? result.html_safe : result
- end
- end
-
- # Check if a cached fragment from the location signified by
- # +key+ exists (see +expire_fragment+ for acceptable formats).
- def fragment_exist?(key, options = nil)
- return unless cache_configured?
- key = fragment_cache_key(key)
-
- instrument_fragment_cache :exist_fragment?, key do
- cache_store.exist?(key, options)
- end
- end
-
- # Removes fragments from the cache.
- #
- # +key+ can take one of three forms:
- #
- # * String - This would normally take the form of a path, like
- # pages/45/notes.
- # * Hash - Treated as an implicit call to +url_for+, like
- # { controller: 'pages', action: 'notes', id: 45}
- # * Regexp - Will remove any fragment that matches, so
- # %r{pages/\d*/notes} might remove all notes. Make sure you
- # don't use anchors in the regex (^ or $) because
- # the actual filename matched looks like
- # ./cache/filename/path.cache. Note: Regexp expiration is
- # only supported on caches that can iterate over all keys (unlike
- # memcached).
- #
- # +options+ is passed through to the cache store's +delete+
- # method (or delete_matched, for Regexp keys).
- def expire_fragment(key, options = nil)
- return unless cache_configured?
- key = fragment_cache_key(key) unless key.is_a?(Regexp)
-
- instrument_fragment_cache :expire_fragment, key do
- if key.is_a?(Regexp)
- cache_store.delete_matched(key, options)
- else
- cache_store.delete(key, options)
- end
- end
- end
-
- def instrument_fragment_cache(name, key) # :nodoc:
- payload = instrument_payload(key)
- ActiveSupport::Notifications.instrument("#{name}.#{instrument_name}", payload) { yield }
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/callbacks.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/callbacks.rb
deleted file mode 100644
index ce4ecf17cc..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/callbacks.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-module AbstractController
- module Callbacks
- extend ActiveSupport::Concern
-
- # Uses ActiveSupport::Callbacks as the base functionality. For
- # more details on the whole callback system, read the documentation
- # for ActiveSupport::Callbacks.
- include ActiveSupport::Callbacks
-
- included do
- define_callbacks :process_action,
- terminator: ->(controller, result_lambda) { result_lambda.call if result_lambda.is_a?(Proc); controller.performed? },
- skip_after_callbacks_if_terminated: true
- end
-
- # Override AbstractController::Base's process_action to run the
- # process_action callbacks around the normal behavior.
- def process_action(*args)
- run_callbacks(:process_action) do
- super
- end
- end
-
- module ClassMethods
- # If +:only+ or +:except+ are used, convert the options into the
- # +:if+ and +:unless+ options of ActiveSupport::Callbacks.
- #
- # The basic idea is that :only => :index gets converted to
- # :if => proc {|c| c.action_name == "index" }.
- #
- # Note that :only has priority over :if in case they
- # are used together.
- #
- # only: :index, if: -> { true } # the :if option will be ignored.
- #
- # Note that :if has priority over :except in case they
- # are used together.
- #
- # except: :index, if: -> { true } # the :except option will be ignored.
- #
- # ==== Options
- # * only - The callback should be run only for this action.
- # * except - The callback should be run for all actions except this action.
- def _normalize_callback_options(options)
- _normalize_callback_option(options, :only, :if)
- _normalize_callback_option(options, :except, :unless)
- end
-
- def _normalize_callback_option(options, from, to) # :nodoc:
- if from = options[from]
- _from = Array(from).map(&:to_s).to_set
- from = proc { |c| _from.include? c.action_name }
- options[to] = Array(options[to]).unshift(from)
- end
- end
-
- # Take callback names and an optional callback proc, normalize them,
- # then call the block with each callback. This allows us to abstract
- # the normalization across several methods that use it.
- #
- # ==== Parameters
- # * callbacks - An array of callbacks, with an optional
- # options hash as the last parameter.
- # * block - A proc that should be added to the callbacks.
- #
- # ==== Block Parameters
- # * name - The callback to be added.
- # * options - A hash of options to be used when adding the callback.
- def _insert_callbacks(callbacks, block = nil)
- options = callbacks.extract_options!
- _normalize_callback_options(options)
- callbacks.push(block) if block
- callbacks.each do |callback|
- yield callback, options
- end
- end
-
- ##
- # :method: before_action
- #
- # :call-seq: before_action(names, block)
- #
- # Append a callback before actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: prepend_before_action
- #
- # :call-seq: prepend_before_action(names, block)
- #
- # Prepend a callback before actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: skip_before_action
- #
- # :call-seq: skip_before_action(names)
- #
- # Skip a callback before actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: append_before_action
- #
- # :call-seq: append_before_action(names, block)
- #
- # Append a callback before actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: after_action
- #
- # :call-seq: after_action(names, block)
- #
- # Append a callback after actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: prepend_after_action
- #
- # :call-seq: prepend_after_action(names, block)
- #
- # Prepend a callback after actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: skip_after_action
- #
- # :call-seq: skip_after_action(names)
- #
- # Skip a callback after actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: append_after_action
- #
- # :call-seq: append_after_action(names, block)
- #
- # Append a callback after actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: around_action
- #
- # :call-seq: around_action(names, block)
- #
- # Append a callback around actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: prepend_around_action
- #
- # :call-seq: prepend_around_action(names, block)
- #
- # Prepend a callback around actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: skip_around_action
- #
- # :call-seq: skip_around_action(names)
- #
- # Skip a callback around actions. See _insert_callbacks for parameter details.
-
- ##
- # :method: append_around_action
- #
- # :call-seq: append_around_action(names, block)
- #
- # Append a callback around actions. See _insert_callbacks for parameter details.
-
- # set up before_action, prepend_before_action, skip_before_action, etc.
- # for each of before, after, and around.
- [:before, :after, :around].each do |callback|
- define_method "#{callback}_action" do |*names, &blk|
- _insert_callbacks(names, blk) do |name, options|
- set_callback(:process_action, callback, name, options)
- end
- end
-
- define_method "prepend_#{callback}_action" do |*names, &blk|
- _insert_callbacks(names, blk) do |name, options|
- set_callback(:process_action, callback, name, options.merge(prepend: true))
- end
- end
-
- # Skip a before, after or around callback. See _insert_callbacks
- # for details on the allowed parameters.
- define_method "skip_#{callback}_action" do |*names|
- _insert_callbacks(names) do |name, options|
- skip_callback(:process_action, callback, name, options)
- end
- end
-
- # *_action is the same as append_*_action
- alias_method :"append_#{callback}_action", :"#{callback}_action"
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/collector.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/collector.rb
deleted file mode 100644
index 40ae5aa1ca..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/collector.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require "action_dispatch/http/mime_type"
-
-module AbstractController
- module Collector
- def self.generate_method_for_mime(mime)
- sym = mime.is_a?(Symbol) ? mime : mime.to_sym
- class_eval <<-RUBY, __FILE__, __LINE__ + 1
- def #{sym}(*args, &block)
- custom(Mime[:#{sym}], *args, &block)
- end
- RUBY
- end
-
- Mime::SET.each do |mime|
- generate_method_for_mime(mime)
- end
-
- Mime::Type.register_callback do |mime|
- generate_method_for_mime(mime) unless instance_methods.include?(mime.to_sym)
- end
-
- private
-
- def method_missing(symbol, &block)
- unless mime_constant = Mime[symbol]
- raise NoMethodError, "To respond to a custom format, register it as a MIME type first: " \
- "http://guides.rubyonrails.org/action_controller_overview.html#restful-downloads. " \
- "If you meant to respond to a variant like :tablet or :phone, not a custom format, " \
- "be sure to nest your variant response within a format response: " \
- "format.html { |html| html.tablet { ... } }"
- end
-
- if Mime::SET.include?(mime_constant)
- AbstractController::Collector.generate_method_for_mime(mime_constant)
- send(symbol, &block)
- else
- super
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/error.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/error.rb
deleted file mode 100644
index 7fafce4dd4..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/error.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module AbstractController
- class Error < StandardError #:nodoc:
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/helpers.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/helpers.rb
deleted file mode 100644
index ef3be7af83..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/helpers.rb
+++ /dev/null
@@ -1,195 +0,0 @@
-require "active_support/dependencies"
-
-module AbstractController
- module Helpers
- extend ActiveSupport::Concern
-
- included do
- class_attribute :_helpers
- self._helpers = Module.new
-
- class_attribute :_helper_methods
- self._helper_methods = Array.new
- end
-
- class MissingHelperError < LoadError
- def initialize(error, path)
- @error = error
- @path = "helpers/#{path}.rb"
- set_backtrace error.backtrace
-
- if error.path =~ /^#{path}(\.rb)?$/
- super("Missing helper file helpers/%s.rb" % path)
- else
- raise error
- end
- end
- end
-
- module ClassMethods
- # When a class is inherited, wrap its helper module in a new module.
- # This ensures that the parent class's module can be changed
- # independently of the child class's.
- def inherited(klass)
- helpers = _helpers
- klass._helpers = Module.new { include helpers }
- klass.class_eval { default_helper_module! } unless klass.anonymous?
- super
- end
-
- # Declare a controller method as a helper. For example, the following
- # makes the +current_user+ and +logged_in?+ controller methods available
- # to the view:
- # class ApplicationController < ActionController::Base
- # helper_method :current_user, :logged_in?
- #
- # def current_user
- # @current_user ||= User.find_by(id: session[:user])
- # end
- #
- # def logged_in?
- # current_user != nil
- # end
- # end
- #
- # In a view:
- # <% if logged_in? -%>Welcome, <%= current_user.name %><% end -%>
- #
- # ==== Parameters
- # * method[, method] - A name or names of a method on the controller
- # to be made available on the view.
- def helper_method(*meths)
- meths.flatten!
- self._helper_methods += meths
-
- meths.each do |meth|
- _helpers.class_eval <<-ruby_eval, __FILE__, __LINE__ + 1
- def #{meth}(*args, &blk) # def current_user(*args, &blk)
- controller.send(%(#{meth}), *args, &blk) # controller.send(:current_user, *args, &blk)
- end # end
- ruby_eval
- end
- end
-
- # The +helper+ class method can take a series of helper module names, a block, or both.
- #
- # ==== Options
- # * *args - Module, Symbol, String
- # * block - A block defining helper methods
- #
- # When the argument is a module it will be included directly in the template class.
- # helper FooHelper # => includes FooHelper
- #
- # When the argument is a string or symbol, the method will provide the "_helper" suffix, require the file
- # and include the module in the template class. The second form illustrates how to include custom helpers
- # when working with namespaced controllers, or other cases where the file containing the helper definition is not
- # in one of Rails' standard load paths:
- # helper :foo # => requires 'foo_helper' and includes FooHelper
- # helper 'resources/foo' # => requires 'resources/foo_helper' and includes Resources::FooHelper
- #
- # Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available
- # to the template.
- #
- # # One line
- # helper { def hello() "Hello, world!" end }
- #
- # # Multi-line
- # helper do
- # def foo(bar)
- # "#{bar} is the very best"
- # end
- # end
- #
- # Finally, all the above styles can be mixed together, and the +helper+ method can be invoked with a mix of
- # +symbols+, +strings+, +modules+ and blocks.
- #
- # helper(:three, BlindHelper) { def mice() 'mice' end }
- #
- def helper(*args, &block)
- modules_for_helpers(args).each do |mod|
- add_template_helper(mod)
- end
-
- _helpers.module_eval(&block) if block_given?
- end
-
- # Clears up all existing helpers in this class, only keeping the helper
- # with the same name as this class.
- def clear_helpers
- inherited_helper_methods = _helper_methods
- self._helpers = Module.new
- self._helper_methods = Array.new
-
- inherited_helper_methods.each { |meth| helper_method meth }
- default_helper_module! unless anonymous?
- end
-
- # Returns a list of modules, normalized from the acceptable kinds of
- # helpers with the following behavior:
- #
- # String or Symbol:: :FooBar or "FooBar" becomes "foo_bar_helper",
- # and "foo_bar_helper.rb" is loaded using require_dependency.
- #
- # Module:: No further processing
- #
- # After loading the appropriate files, the corresponding modules
- # are returned.
- #
- # ==== Parameters
- # * args - An array of helpers
- #
- # ==== Returns
- # * Array - A normalized list of modules for the list of
- # helpers provided.
- def modules_for_helpers(args)
- args.flatten.map! do |arg|
- case arg
- when String, Symbol
- file_name = "#{arg.to_s.underscore}_helper"
- begin
- require_dependency(file_name)
- rescue LoadError => e
- raise AbstractController::Helpers::MissingHelperError.new(e, file_name)
- end
-
- mod_name = file_name.camelize
- begin
- mod_name.constantize
- rescue LoadError
- # dependencies.rb gives a similar error message but its wording is
- # not as clear because it mentions autoloading. To the user all it
- # matters is that a helper module couldn't be loaded, autoloading
- # is an internal mechanism that should not leak.
- raise NameError, "Couldn't find #{mod_name}, expected it to be defined in helpers/#{file_name}.rb"
- end
- when Module
- arg
- else
- raise ArgumentError, "helper must be a String, Symbol, or Module"
- end
- end
- end
-
- private
- # Makes all the (instance) methods in the helper module available to templates
- # rendered through this controller.
- #
- # ==== Parameters
- # * module - The module to include into the current helper module
- # for the class
- def add_template_helper(mod)
- _helpers.module_eval { include mod }
- end
-
- def default_helper_module!
- module_name = name.sub(/Controller$/, "".freeze)
- module_path = module_name.underscore
- helper module_path
- rescue LoadError => e
- raise e unless e.is_missing? "helpers/#{module_path}_helper"
- rescue NameError => e
- raise e unless e.missing_name? "#{module_name}Helper"
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/logger.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/logger.rb
deleted file mode 100644
index c31ea6c5b5..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/logger.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "active_support/benchmarkable"
-
-module AbstractController
- module Logger #:nodoc:
- extend ActiveSupport::Concern
-
- included do
- config_accessor :logger
- include ActiveSupport::Benchmarkable
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/railties/routes_helpers.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/railties/routes_helpers.rb
deleted file mode 100644
index 14b574e322..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/railties/routes_helpers.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-module AbstractController
- module Railties
- module RoutesHelpers
- def self.with(routes, include_path_helpers = true)
- Module.new do
- define_method(:inherited) do |klass|
- super(klass)
- if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_routes_url_helpers) }
- klass.include(namespace.railtie_routes_url_helpers(include_path_helpers))
- else
- klass.include(routes.url_helpers(include_path_helpers))
- end
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/rendering.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/rendering.rb
deleted file mode 100644
index 54af938a93..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/rendering.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-require "abstract_controller/error"
-require "action_view"
-require "action_view/view_paths"
-require "set"
-
-module AbstractController
- class DoubleRenderError < Error
- DEFAULT_MESSAGE = "Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \"redirect_to(...) and return\"."
-
- def initialize(message = nil)
- super(message || DEFAULT_MESSAGE)
- end
- end
-
- module Rendering
- extend ActiveSupport::Concern
- include ActionView::ViewPaths
-
- # Normalizes arguments, options and then delegates render_to_body and
- # sticks the result in self.response_body.
- # :api: public
- def render(*args, &block)
- options = _normalize_render(*args, &block)
- rendered_body = render_to_body(options)
- if options[:html]
- _set_html_content_type
- else
- _set_rendered_content_type rendered_format
- end
- self.response_body = rendered_body
- end
-
- # Raw rendering of a template to a string.
- #
- # It is similar to render, except that it does not
- # set the +response_body+ and it should be guaranteed
- # to always return a string.
- #
- # If a component extends the semantics of +response_body+
- # (as ActionController extends it to be anything that
- # responds to the method each), this method needs to be
- # overridden in order to still return a string.
- # :api: plugin
- def render_to_string(*args, &block)
- options = _normalize_render(*args, &block)
- render_to_body(options)
- end
-
- # Performs the actual template rendering.
- # :api: public
- def render_to_body(options = {})
- end
-
- # Returns Content-Type of rendered content
- # :api: public
- def rendered_format
- Mime[:text]
- end
-
- DEFAULT_PROTECTED_INSTANCE_VARIABLES = Set.new %i(
- @_action_name @_response_body @_formats @_prefixes
- )
-
- # This method should return a hash with assigns.
- # You can overwrite this configuration per controller.
- # :api: public
- def view_assigns
- protected_vars = _protected_ivars
- variables = instance_variables
-
- variables.reject! { |s| protected_vars.include? s }
- variables.each_with_object({}) { |name, hash|
- hash[name.slice(1, name.length)] = instance_variable_get(name)
- }
- end
-
- # Normalize args by converting render "foo" to
- # render :action => "foo" and render "foo/bar" to
- # render :file => "foo/bar".
- # :api: plugin
- def _normalize_args(action = nil, options = {})
- if action.respond_to?(:permitted?)
- if action.permitted?
- action
- else
- raise ArgumentError, "render parameters are not permitted"
- end
- elsif action.is_a?(Hash)
- action
- else
- options
- end
- end
-
- # Normalize options.
- # :api: plugin
- def _normalize_options(options)
- options
- end
-
- # Process extra options.
- # :api: plugin
- def _process_options(options)
- options
- end
-
- # Process the rendered format.
- # :api: private
- def _process_format(format)
- end
-
- def _process_variant(options)
- end
-
- def _set_html_content_type # :nodoc:
- end
-
- def _set_rendered_content_type(format) # :nodoc:
- end
-
- # Normalize args and options.
- # :api: private
- def _normalize_render(*args, &block)
- options = _normalize_args(*args, &block)
- _process_variant(options)
- _normalize_options(options)
- options
- end
-
- def _protected_ivars # :nodoc:
- DEFAULT_PROTECTED_INSTANCE_VARIABLES
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/translation.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/translation.rb
deleted file mode 100644
index e4ac95df50..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/translation.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module AbstractController
- module Translation
- # Delegates to I18n.translate. Also aliased as t.
- #
- # When the given key starts with a period, it will be scoped by the current
- # controller and action. So if you call translate(".foo") from
- # PeopleController#index, it will convert the call to
- # I18n.translate("people.index.foo"). This makes it less repetitive
- # to translate many keys within the same controller / action and gives you a
- # simple framework for scoping them consistently.
- def translate(key, options = {})
- if key.to_s.first == "."
- path = controller_path.tr("/", ".")
- defaults = [:"#{path}#{key}"]
- defaults << options[:default] if options[:default]
- options[:default] = defaults.flatten
- key = "#{path}.#{action_name}#{key}"
- end
- I18n.translate(key, options)
- end
- alias :t :translate
-
- # Delegates to I18n.localize. Also aliased as l.
- def localize(*args)
- I18n.localize(*args)
- end
- alias :l :localize
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/url_for.rb b/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/url_for.rb
deleted file mode 100644
index 72d07b0927..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/abstract_controller/url_for.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module AbstractController
- # Includes +url_for+ into the host class (e.g. an abstract controller or mailer). The class
- # has to provide a +RouteSet+ by implementing the _routes methods. Otherwise, an
- # exception will be raised.
- #
- # Note that this module is completely decoupled from HTTP - the only requirement is a valid
- # _routes implementation.
- module UrlFor
- extend ActiveSupport::Concern
- include ActionDispatch::Routing::UrlFor
-
- def _routes
- raise "In order to use #url_for, you must include routing helpers explicitly. " \
- "For instance, `include Rails.application.routes.url_helpers`."
- end
-
- module ClassMethods
- def _routes
- nil
- end
-
- def action_methods
- @action_methods ||= begin
- if _routes
- super - _routes.named_routes.helper_names
- else
- super
- end
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller.rb
deleted file mode 100644
index 50f20aa789..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require "active_support/rails"
-require "abstract_controller"
-require "action_dispatch"
-require "action_controller/metal/live"
-require "action_controller/metal/strong_parameters"
-
-module ActionController
- extend ActiveSupport::Autoload
-
- autoload :API
- autoload :Base
- autoload :Metal
- autoload :Middleware
- autoload :Renderer
- autoload :FormBuilder
-
- eager_autoload do
- autoload :Caching
- end
-
- autoload_under "metal" do
- autoload :ConditionalGet
- autoload :Cookies
- autoload :DataStreaming
- autoload :EtagWithTemplateDigest
- autoload :EtagWithFlash
- autoload :Flash
- autoload :ForceSSL
- autoload :Head
- autoload :Helpers
- autoload :HttpAuthentication
- autoload :BasicImplicitRender
- autoload :ImplicitRender
- autoload :Instrumentation
- autoload :MimeResponds
- autoload :ParamsWrapper
- autoload :Redirecting
- autoload :Renderers
- autoload :Rendering
- autoload :RequestForgeryProtection
- autoload :Rescue
- autoload :Streaming
- autoload :StrongParameters
- autoload :ParameterEncoding
- autoload :Testing
- autoload :UrlFor
- end
-
- autoload_under "api" do
- autoload :ApiRendering
- end
-
- autoload :TestCase, "action_controller/test_case"
- autoload :TemplateAssertions, "action_controller/test_case"
-end
-
-# Common Active Support usage in Action Controller
-require "active_support/core_ext/module/attribute_accessors"
-require "active_support/core_ext/load_error"
-require "active_support/core_ext/module/attr_internal"
-require "active_support/core_ext/name_error"
-require "active_support/core_ext/uri"
-require "active_support/inflector"
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api.rb
deleted file mode 100644
index 94698df730..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api.rb
+++ /dev/null
@@ -1,147 +0,0 @@
-require "action_view"
-require "action_controller"
-require "action_controller/log_subscriber"
-
-module ActionController
- # API Controller is a lightweight version of ActionController::Base,
- # created for applications that don't require all functionalities that a complete
- # \Rails controller provides, allowing you to create controllers with just the
- # features that you need for API only applications.
- #
- # An API Controller is different from a normal controller in the sense that
- # by default it doesn't include a number of features that are usually required
- # by browser access only: layouts and templates rendering, cookies, sessions,
- # flash, assets, and so on. This makes the entire controller stack thinner,
- # suitable for API applications. It doesn't mean you won't have such
- # features if you need them: they're all available for you to include in
- # your application, they're just not part of the default API controller stack.
- #
- # Normally, +ApplicationController+ is the only controller that inherits from
- # ActionController::API. All other controllers in turn inherit from
- # +ApplicationController+.
- #
- # A sample controller could look like this:
- #
- # class PostsController < ApplicationController
- # def index
- # posts = Post.all
- # render json: posts
- # end
- # end
- #
- # Request, response, and parameters objects all work the exact same way as
- # ActionController::Base.
- #
- # == Renders
- #
- # The default API Controller stack includes all renderers, which means you
- # can use render :json and brothers freely in your controllers. Keep
- # in mind that templates are not going to be rendered, so you need to ensure
- # your controller is calling either render or redirect_to in
- # all actions, otherwise it will return 204 No Content.
- #
- # def show
- # post = Post.find(params[:id])
- # render json: post
- # end
- #
- # == Redirects
- #
- # Redirects are used to move from one action to another. You can use the
- # redirect_to method in your controllers in the same way as in
- # ActionController::Base. For example:
- #
- # def create
- # redirect_to root_url and return if not_authorized?
- # # do stuff here
- # end
- #
- # == Adding New Behavior
- #
- # In some scenarios you may want to add back some functionality provided by
- # ActionController::Base that is not present by default in
- # ActionController::API, for instance MimeResponds. This
- # module gives you the respond_to method. Adding it is quite simple,
- # you just need to include the module in a specific controller or in
- # +ApplicationController+ in case you want it available in your entire
- # application:
- #
- # class ApplicationController < ActionController::API
- # include ActionController::MimeResponds
- # end
- #
- # class PostsController < ApplicationController
- # def index
- # posts = Post.all
- #
- # respond_to do |format|
- # format.json { render json: posts }
- # format.xml { render xml: posts }
- # end
- # end
- # end
- #
- # Make sure to check the modules included in ActionController::Base
- # if you want to use any other functionality that is not provided
- # by ActionController::API out of the box.
- class API < Metal
- abstract!
-
- # Shortcut helper that returns all the ActionController::API modules except
- # the ones passed as arguments:
- #
- # class MyAPIBaseController < ActionController::Metal
- # ActionController::API.without_modules(:ForceSSL, :UrlFor).each do |left|
- # include left
- # end
- # end
- #
- # This gives better control over what you want to exclude and makes it easier
- # to create an API controller class, instead of listing the modules required
- # manually.
- def self.without_modules(*modules)
- modules = modules.map do |m|
- m.is_a?(Symbol) ? ActionController.const_get(m) : m
- end
-
- MODULES - modules
- end
-
- MODULES = [
- AbstractController::Rendering,
-
- UrlFor,
- Redirecting,
- ApiRendering,
- Renderers::All,
- ConditionalGet,
- BasicImplicitRender,
- StrongParameters,
-
- ForceSSL,
- DataStreaming,
-
- # Before callbacks should also be executed as early as possible, so
- # also include them at the bottom.
- AbstractController::Callbacks,
-
- # Append rescue at the bottom to wrap as much as possible.
- Rescue,
-
- # Add instrumentations hooks at the bottom, to ensure they instrument
- # all the methods properly.
- Instrumentation,
-
- # Params wrapper should come before instrumentation so they are
- # properly showed in logs
- ParamsWrapper
- ]
-
- MODULES.each do |mod|
- include mod
- end
-
- ActiveSupport.run_load_hooks(:action_controller_api, self)
- ActiveSupport.run_load_hooks(:action_controller, self)
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api/api_rendering.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api/api_rendering.rb
deleted file mode 100644
index 3a08d28c39..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/api/api_rendering.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module ActionController
- module ApiRendering
- extend ActiveSupport::Concern
-
- included do
- include Rendering
- end
-
- def render_to_body(options = {})
- _process_options(options)
- super
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/base.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/base.rb
deleted file mode 100644
index 8c2b111f89..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/base.rb
+++ /dev/null
@@ -1,273 +0,0 @@
-require "action_view"
-require "action_controller/log_subscriber"
-require "action_controller/metal/params_wrapper"
-
-module ActionController
- # Action Controllers are the core of a web request in \Rails. They are made up of one or more actions that are executed
- # on request and then either it renders a template or redirects to another action. An action is defined as a public method
- # on the controller, which will automatically be made accessible to the web-server through \Rails Routes.
- #
- # By default, only the ApplicationController in a \Rails application inherits from ActionController::Base. All other
- # controllers inherit from ApplicationController. This gives you one class to configure things such as
- # request forgery protection and filtering of sensitive request parameters.
- #
- # A sample controller could look like this:
- #
- # class PostsController < ApplicationController
- # def index
- # @posts = Post.all
- # end
- #
- # def create
- # @post = Post.create params[:post]
- # redirect_to posts_path
- # end
- # end
- #
- # Actions, by default, render a template in the app/views directory corresponding to the name of the controller and action
- # after executing code in the action. For example, the +index+ action of the PostsController would render the
- # template app/views/posts/index.html.erb by default after populating the @posts instance variable.
- #
- # Unlike index, the create action will not render a template. After performing its main purpose (creating a
- # new post), it initiates a redirect instead. This redirect works by returning an external
- # 302 Moved HTTP response that takes the user to the index action.
- #
- # These two methods represent the two basic action archetypes used in Action Controllers: Get-and-show and do-and-redirect.
- # Most actions are variations on these themes.
- #
- # == Requests
- #
- # For every request, the router determines the value of the +controller+ and +action+ keys. These determine which controller
- # and action are called. The remaining request parameters, the session (if one is available), and the full request with
- # all the HTTP headers are made available to the action through accessor methods. Then the action is performed.
- #
- # The full request object is available via the request accessor and is primarily used to query for HTTP headers:
- #
- # def server_ip
- # location = request.env["REMOTE_ADDR"]
- # render plain: "This server hosted at #{location}"
- # end
- #
- # == Parameters
- #
- # All request parameters, whether they come from a query string in the URL or form data submitted through a POST request are
- # available through the params method which returns a hash. For example, an action that was performed through
- # /posts?category=All&limit=5 will include { "category" => "All", "limit" => "5" } in params.
- #
- # It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as:
- #
- #
- #
- #
- # A request coming from a form holding these inputs will include { "post" => { "name" => "david", "address" => "hyacintvej" } }.
- # If the address input had been named post[address][street], the params would have included
- # { "post" => { "address" => { "street" => "hyacintvej" } } }. There's no limit to the depth of the nesting.
- #
- # == Sessions
- #
- # Sessions allow you to store objects in between requests. This is useful for objects that are not yet ready to be persisted,
- # such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such
- # as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely
- # they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at.
- #
- # You can place objects in the session by using the session method, which accesses a hash:
- #
- # session[:person] = Person.authenticate(user_name, password)
- #
- # You can retrieve it again through the same hash:
- #
- # Hello #{session[:person]}
- #
- # For removing objects from the session, you can either assign a single key to +nil+:
- #
- # # removes :person from session
- # session[:person] = nil
- #
- # or you can remove the entire session with +reset_session+.
- #
- # Sessions are stored by default in a browser cookie that's cryptographically signed, but unencrypted.
- # This prevents the user from tampering with the session but also allows them to see its contents.
- #
- # Do not put secret information in cookie-based sessions!
- #
- # == Responses
- #
- # Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response
- # object is generated automatically through the use of renders and redirects and requires no user intervention.
- #
- # == Renders
- #
- # Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering
- # of a template. Included in the Action Pack is the Action View, which enables rendering of ERB templates. It's automatically configured.
- # The controller passes objects to the view by assigning instance variables:
- #
- # def show
- # @post = Post.find(params[:id])
- # end
- #
- # Which are then automatically available to the view:
- #
- # Title: <%= @post.title %>
- #
- # You don't have to rely on the automated rendering. For example, actions that could result in the rendering of different templates
- # will use the manual rendering methods:
- #
- # def search
- # @results = Search.find(params[:query])
- # case @results.count
- # when 0 then render action: "no_results"
- # when 1 then render action: "show"
- # when 2..10 then render action: "show_many"
- # end
- # end
- #
- # Read more about writing ERB and Builder templates in ActionView::Base.
- #
- # == Redirects
- #
- # Redirects are used to move from one action to another. For example, after a create action, which stores a blog entry to the
- # database, we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself), we're
- # going to reuse (and redirect to) a show action that we'll assume has already been created. The code might look like this:
- #
- # def create
- # @entry = Entry.new(params[:entry])
- # if @entry.save
- # # The entry was saved correctly, redirect to show
- # redirect_to action: 'show', id: @entry.id
- # else
- # # things didn't go so well, do something else
- # end
- # end
- #
- # In this case, after saving our new entry to the database, the user is redirected to the show method, which is then executed.
- # Note that this is an external HTTP-level redirection which will cause the browser to make a second request (a GET to the show action),
- # and not some internal re-routing which calls both "create" and then "show" within one request.
- #
- # Learn more about redirect_to and what options you have in ActionController::Redirecting.
- #
- # == Calling multiple redirects or renders
- #
- # An action may contain only a single render or a single redirect. Attempting to try to do either again will result in a DoubleRenderError:
- #
- # def do_something
- # redirect_to action: "elsewhere"
- # render action: "overthere" # raises DoubleRenderError
- # end
- #
- # If you need to redirect on the condition of something, then be sure to add "and return" to halt execution.
- #
- # def do_something
- # redirect_to(action: "elsewhere") and return if monkeys.nil?
- # render action: "overthere" # won't be called if monkeys is nil
- # end
- #
- class Base < Metal
- abstract!
-
- # We document the request and response methods here because albeit they are
- # implemented in ActionController::Metal, the type of the returned objects
- # is unknown at that level.
-
- ##
- # :method: request
- #
- # Returns an ActionDispatch::Request instance that represents the
- # current request.
-
- ##
- # :method: response
- #
- # Returns an ActionDispatch::Response that represents the current
- # response.
-
- # Shortcut helper that returns all the modules included in
- # ActionController::Base except the ones passed as arguments:
- #
- # class MyBaseController < ActionController::Metal
- # ActionController::Base.without_modules(:ParamsWrapper, :Streaming).each do |left|
- # include left
- # end
- # end
- #
- # This gives better control over what you want to exclude and makes it
- # easier to create a bare controller class, instead of listing the modules
- # required manually.
- def self.without_modules(*modules)
- modules = modules.map do |m|
- m.is_a?(Symbol) ? ActionController.const_get(m) : m
- end
-
- MODULES - modules
- end
-
- MODULES = [
- AbstractController::Rendering,
- AbstractController::Translation,
- AbstractController::AssetPaths,
-
- Helpers,
- UrlFor,
- Redirecting,
- ActionView::Layouts,
- Rendering,
- Renderers::All,
- ConditionalGet,
- EtagWithTemplateDigest,
- EtagWithFlash,
- Caching,
- MimeResponds,
- ImplicitRender,
- StrongParameters,
- ParameterEncoding,
- Cookies,
- Flash,
- FormBuilder,
- RequestForgeryProtection,
- ForceSSL,
- Streaming,
- DataStreaming,
- HttpAuthentication::Basic::ControllerMethods,
- HttpAuthentication::Digest::ControllerMethods,
- HttpAuthentication::Token::ControllerMethods,
-
- # Before callbacks should also be executed as early as possible, so
- # also include them at the bottom.
- AbstractController::Callbacks,
-
- # Append rescue at the bottom to wrap as much as possible.
- Rescue,
-
- # Add instrumentations hooks at the bottom, to ensure they instrument
- # all the methods properly.
- Instrumentation,
-
- # Params wrapper should come before instrumentation so they are
- # properly showed in logs
- ParamsWrapper
- ]
-
- MODULES.each do |mod|
- include mod
- end
- setup_renderer!
-
- # Define some internal variables that should not be propagated to the view.
- PROTECTED_IVARS = AbstractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLES + %i(
- @_params @_response @_request @_config @_url_options @_action_has_layout @_view_context_class
- @_view_renderer @_lookup_context @_routes @_view_runtime @_db_runtime @_helper_proxy
- )
-
- def _protected_ivars # :nodoc:
- PROTECTED_IVARS
- end
-
- def self.make_response!(request)
- ActionDispatch::Response.create.tap do |res|
- res.request = request
- end
- end
-
- ActiveSupport.run_load_hooks(:action_controller_base, self)
- ActiveSupport.run_load_hooks(:action_controller, self)
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/caching.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/caching.rb
deleted file mode 100644
index 954265ad97..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/caching.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-module ActionController
- # \Caching is a cheap way of speeding up slow applications by keeping the result of
- # calculations, renderings, and database calls around for subsequent requests.
- #
- # You can read more about each approach by clicking the modules below.
- #
- # Note: To turn off all caching provided by Action Controller, set
- # config.action_controller.perform_caching = false
- #
- # == \Caching stores
- #
- # All the caching stores from ActiveSupport::Cache are available to be used as backends
- # for Action Controller caching.
- #
- # Configuration examples (FileStore is the default):
- #
- # config.action_controller.cache_store = :memory_store
- # config.action_controller.cache_store = :file_store, '/path/to/cache/directory'
- # config.action_controller.cache_store = :mem_cache_store, 'localhost'
- # config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new('localhost:11211')
- # config.action_controller.cache_store = MyOwnStore.new('parameter')
- module Caching
- extend ActiveSupport::Autoload
- extend ActiveSupport::Concern
-
- included do
- include AbstractController::Caching
- end
-
- private
-
- def instrument_payload(key)
- {
- controller: controller_name,
- action: action_name,
- key: key
- }
- end
-
- def instrument_name
- "action_controller".freeze
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/form_builder.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/form_builder.rb
deleted file mode 100644
index f2656ca894..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/form_builder.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-module ActionController
- # Override the default form builder for all views rendered by this
- # controller and any of its descendants. Accepts a subclass of
- # +ActionView::Helpers::FormBuilder+.
- #
- # For example, given a form builder:
- #
- # class AdminFormBuilder < ActionView::Helpers::FormBuilder
- # def special_field(name)
- # end
- # end
- #
- # The controller specifies a form builder as its default:
- #
- # class AdminAreaController < ApplicationController
- # default_form_builder AdminFormBuilder
- # end
- #
- # Then in the view any form using +form_for+ will be an instance of the
- # specified form builder:
- #
- # <%= form_for(@instance) do |builder| %>
- # <%= builder.special_field(:name) %>
- # <% end %>
- module FormBuilder
- extend ActiveSupport::Concern
-
- included do
- class_attribute :_default_form_builder, instance_accessor: false
- end
-
- module ClassMethods
- # Set the form builder to be used as the default for all forms
- # in the views rendered by this controller and its subclasses.
- #
- # ==== Parameters
- # * builder - Default form builder, an instance of +ActionView::Helpers::FormBuilder+
- def default_form_builder(builder)
- self._default_form_builder = builder
- end
- end
-
- # Default form builder for the controller
- def default_form_builder
- self.class._default_form_builder
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/log_subscriber.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/log_subscriber.rb
deleted file mode 100644
index d29a5fe68f..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/log_subscriber.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-module ActionController
- class LogSubscriber < ActiveSupport::LogSubscriber
- INTERNAL_PARAMS = %w(controller action format _method only_path)
-
- def start_processing(event)
- return unless logger.info?
-
- payload = event.payload
- params = payload[:params].except(*INTERNAL_PARAMS)
- format = payload[:format]
- format = format.to_s.upcase if format.is_a?(Symbol)
-
- info "Processing by #{payload[:controller]}##{payload[:action]} as #{format}"
- info " Parameters: #{params.inspect}" unless params.empty?
- end
-
- def process_action(event)
- info do
- payload = event.payload
- additions = ActionController::Base.log_process_action(payload)
-
- status = payload[:status]
- if status.nil? && payload[:exception].present?
- exception_class_name = payload[:exception].first
- status = ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_class_name)
- end
- message = "Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in #{event.duration.round}ms"
- message << " (#{additions.join(" | ".freeze)})" unless additions.empty?
- message << "\n\n" if defined?(Rails.env) && Rails.env.development?
-
- message
- end
- end
-
- def halted_callback(event)
- info { "Filter chain halted as #{event.payload[:filter].inspect} rendered or redirected" }
- end
-
- def send_file(event)
- info { "Sent file #{event.payload[:path]} (#{event.duration.round(1)}ms)" }
- end
-
- def redirect_to(event)
- info { "Redirected to #{event.payload[:location]}" }
- end
-
- def send_data(event)
- info { "Sent data #{event.payload[:filename]} (#{event.duration.round(1)}ms)" }
- end
-
- def unpermitted_parameters(event)
- debug do
- unpermitted_keys = event.payload[:keys]
- "Unpermitted parameter#{'s' if unpermitted_keys.size > 1}: #{unpermitted_keys.map { |e| ":#{e}" }.join(", ")}"
- end
- end
-
- %w(write_fragment read_fragment exist_fragment?
- expire_fragment expire_page write_page).each do |method|
- class_eval <<-METHOD, __FILE__, __LINE__ + 1
- def #{method}(event)
- return unless logger.info? && ActionController::Base.enable_fragment_cache_logging
- key_or_path = event.payload[:key] || event.payload[:path]
- human_name = #{method.to_s.humanize.inspect}
- info("\#{human_name} \#{key_or_path} (\#{event.duration.round(1)}ms)")
- end
- METHOD
- end
-
- def logger
- ActionController::Base.logger
- end
- end
-end
-
-ActionController::LogSubscriber.attach_to :action_controller
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal.rb
deleted file mode 100644
index 246644dcbd..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal.rb
+++ /dev/null
@@ -1,257 +0,0 @@
-require "active_support/core_ext/array/extract_options"
-require "action_dispatch/middleware/stack"
-require "action_dispatch/http/request"
-require "action_dispatch/http/response"
-
-module ActionController
- # Extend ActionDispatch middleware stack to make it aware of options
- # allowing the following syntax in controllers:
- #
- # class PostsController < ApplicationController
- # use AuthenticationMiddleware, except: [:index, :show]
- # end
- #
- class MiddlewareStack < ActionDispatch::MiddlewareStack #:nodoc:
- class Middleware < ActionDispatch::MiddlewareStack::Middleware #:nodoc:
- def initialize(klass, args, actions, strategy, block)
- @actions = actions
- @strategy = strategy
- super(klass, args, block)
- end
-
- def valid?(action)
- @strategy.call @actions, action
- end
- end
-
- def build(action, app = Proc.new)
- action = action.to_s
-
- middlewares.reverse.inject(app) do |a, middleware|
- middleware.valid?(action) ? middleware.build(a) : a
- end
- end
-
- private
-
- INCLUDE = ->(list, action) { list.include? action }
- EXCLUDE = ->(list, action) { !list.include? action }
- NULL = ->(list, action) { true }
-
- def build_middleware(klass, args, block)
- options = args.extract_options!
- only = Array(options.delete(:only)).map(&:to_s)
- except = Array(options.delete(:except)).map(&:to_s)
- args << options unless options.empty?
-
- strategy = NULL
- list = nil
-
- if only.any?
- strategy = INCLUDE
- list = only
- elsif except.any?
- strategy = EXCLUDE
- list = except
- end
-
- Middleware.new(klass, args, list, strategy, block)
- end
- end
-
- # ActionController::Metal is the simplest possible controller, providing a
- # valid Rack interface without the additional niceties provided by
- # ActionController::Base.
- #
- # A sample metal controller might look like this:
- #
- # class HelloController < ActionController::Metal
- # def index
- # self.response_body = "Hello World!"
- # end
- # end
- #
- # And then to route requests to your metal controller, you would add
- # something like this to config/routes.rb:
- #
- # get 'hello', to: HelloController.action(:index)
- #
- # The +action+ method returns a valid Rack application for the \Rails
- # router to dispatch to.
- #
- # == Rendering Helpers
- #
- # ActionController::Metal by default provides no utilities for rendering
- # views, partials, or other responses aside from explicitly calling of
- # response_body=, content_type=, and status=. To
- # add the render helpers you're used to having in a normal controller, you
- # can do the following:
- #
- # class HelloController < ActionController::Metal
- # include AbstractController::Rendering
- # include ActionView::Layouts
- # append_view_path "#{Rails.root}/app/views"
- #
- # def index
- # render "hello/index"
- # end
- # end
- #
- # == Redirection Helpers
- #
- # To add redirection helpers to your metal controller, do the following:
- #
- # class HelloController < ActionController::Metal
- # include ActionController::Redirecting
- # include Rails.application.routes.url_helpers
- #
- # def index
- # redirect_to root_url
- # end
- # end
- #
- # == Other Helpers
- #
- # You can refer to the modules included in ActionController::Base to see
- # other features you can bring into your metal controller.
- #
- class Metal < AbstractController::Base
- abstract!
-
- # Returns the last part of the controller's name, underscored, without the ending
- # Controller. For instance, PostsController returns posts.
- # Namespaces are left out, so Admin::PostsController returns posts as well.
- #
- # ==== Returns
- # * string
- def self.controller_name
- @controller_name ||= name.demodulize.sub(/Controller$/, "").underscore
- end
-
- def self.make_response!(request)
- ActionDispatch::Response.new.tap do |res|
- res.request = request
- end
- end
-
- def self.binary_params_for?(action) # :nodoc:
- false
- end
-
- # Delegates to the class' controller_name.
- def controller_name
- self.class.controller_name
- end
-
- attr_internal :response, :request
- delegate :session, to: "@_request"
- delegate :headers, :status=, :location=, :content_type=,
- :status, :location, :content_type, to: "@_response"
-
- def initialize
- @_request = nil
- @_response = nil
- @_routes = nil
- super
- end
-
- def params
- @_params ||= request.parameters
- end
-
- def params=(val)
- @_params = val
- end
-
- alias :response_code :status # :nodoc:
-
- # Basic url_for that can be overridden for more robust functionality.
- def url_for(string)
- string
- end
-
- def response_body=(body)
- body = [body] unless body.nil? || body.respond_to?(:each)
- response.reset_body!
- return unless body
- response.body = body
- super
- end
-
- # Tests if render or redirect has already happened.
- def performed?
- response_body || response.committed?
- end
-
- def dispatch(name, request, response) #:nodoc:
- set_request!(request)
- set_response!(response)
- process(name)
- request.commit_flash
- to_a
- end
-
- def set_response!(response) # :nodoc:
- @_response = response
- end
-
- def set_request!(request) #:nodoc:
- @_request = request
- @_request.controller_instance = self
- end
-
- def to_a #:nodoc:
- response.to_a
- end
-
- def reset_session
- @_request.reset_session
- end
-
- class_attribute :middleware_stack
- self.middleware_stack = ActionController::MiddlewareStack.new
-
- def self.inherited(base) # :nodoc:
- base.middleware_stack = middleware_stack.dup
- super
- end
-
- # Pushes the given Rack middleware and its arguments to the bottom of the
- # middleware stack.
- def self.use(*args, &block)
- middleware_stack.use(*args, &block)
- end
-
- # Alias for +middleware_stack+.
- def self.middleware
- middleware_stack
- end
-
- # Returns a Rack endpoint for the given action name.
- def self.action(name)
- if middleware_stack.any?
- middleware_stack.build(name) do |env|
- req = ActionDispatch::Request.new(env)
- res = make_response! req
- new.dispatch(name, req, res)
- end
- else
- lambda { |env|
- req = ActionDispatch::Request.new(env)
- res = make_response! req
- new.dispatch(name, req, res)
- }
- end
- end
-
- # Direct dispatch to the controller. Instantiates the controller, then
- # executes the action named +name+.
- def self.dispatch(name, req, res)
- if middleware_stack.any?
- middleware_stack.build(name) { |env| new.dispatch(name, req, res) }.call req.env
- else
- new.dispatch(name, req, res)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb
deleted file mode 100644
index cef65a362c..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/basic_implicit_render.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module ActionController
- module BasicImplicitRender # :nodoc:
- def send_action(method, *args)
- super.tap { default_render unless performed? }
- end
-
- def default_render(*args)
- head :no_content
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/conditional_get.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/conditional_get.rb
deleted file mode 100644
index eb636fa3f6..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/conditional_get.rb
+++ /dev/null
@@ -1,273 +0,0 @@
-require "active_support/core_ext/hash/keys"
-
-module ActionController
- module ConditionalGet
- extend ActiveSupport::Concern
-
- include Head
-
- included do
- class_attribute :etaggers
- self.etaggers = []
- end
-
- module ClassMethods
- # Allows you to consider additional controller-wide information when generating an ETag.
- # For example, if you serve pages tailored depending on who's logged in at the moment, you
- # may want to add the current user id to be part of the ETag to prevent unauthorized displaying
- # of cached pages.
- #
- # class InvoicesController < ApplicationController
- # etag { current_user.try :id }
- #
- # def show
- # # Etag will differ even for the same invoice when it's viewed by a different current_user
- # @invoice = Invoice.find(params[:id])
- # fresh_when(@invoice)
- # end
- # end
- def etag(&etagger)
- self.etaggers += [etagger]
- end
- end
-
- # Sets the +etag+, +last_modified+, or both on the response and renders a
- # 304 Not Modified response if the request is already fresh.
- #
- # === Parameters:
- #
- # * :etag Sets a "weak" ETag validator on the response. See the
- # +:weak_etag+ option.
- # * :weak_etag Sets a "weak" ETag validator on the response.
- # Requests that set If-None-Match header may return a 304 Not Modified
- # response if it matches the ETag exactly. A weak ETag indicates semantic
- # equivalence, not byte-for-byte equality, so they're good for caching
- # HTML pages in browser caches. They can't be used for responses that
- # must be byte-identical, like serving Range requests within a PDF file.
- # * :strong_etag Sets a "strong" ETag validator on the response.
- # Requests that set If-None-Match header may return a 304 Not Modified
- # response if it matches the ETag exactly. A strong ETag implies exact
- # equality: the response must match byte for byte. This is necessary for
- # doing Range requests within a large video or PDF file, for example, or
- # for compatibility with some CDNs that don't support weak ETags.
- # * :last_modified Sets a "weak" last-update validator on the
- # response. Subsequent requests that set If-Modified-Since may return a
- # 304 Not Modified response if last_modified <= If-Modified-Since.
- # * :public By default the Cache-Control header is private, set this to
- # +true+ if you want your application to be cacheable by other devices (proxy caches).
- # * :template By default, the template digest for the current
- # controller/action is included in ETags. If the action renders a
- # different template, you can include its digest instead. If the action
- # doesn't render a template at all, you can pass template: false
- # to skip any attempt to check for a template digest.
- #
- # === Example:
- #
- # def show
- # @article = Article.find(params[:id])
- # fresh_when(etag: @article, last_modified: @article.updated_at, public: true)
- # end
- #
- # This will render the show template if the request isn't sending a matching ETag or
- # If-Modified-Since header and just a 304 Not Modified response if there's a match.
- #
- # You can also just pass a record. In this case +last_modified+ will be set
- # by calling +updated_at+ and +etag+ by passing the object itself.
- #
- # def show
- # @article = Article.find(params[:id])
- # fresh_when(@article)
- # end
- #
- # You can also pass an object that responds to +maximum+, such as a
- # collection of active records. In this case +last_modified+ will be set by
- # calling maximum(:updated_at) on the collection (the timestamp of the
- # most recently updated record) and the +etag+ by passing the object itself.
- #
- # def index
- # @articles = Article.all
- # fresh_when(@articles)
- # end
- #
- # When passing a record or a collection, you can still set the public header:
- #
- # def show
- # @article = Article.find(params[:id])
- # fresh_when(@article, public: true)
- # end
- #
- # When rendering a different template than the default controller/action
- # style, you can indicate which digest to include in the ETag:
- #
- # before_action { fresh_when @article, template: 'widgets/show' }
- #
- def fresh_when(object = nil, etag: nil, weak_etag: nil, strong_etag: nil, last_modified: nil, public: false, template: nil)
- weak_etag ||= etag || object unless strong_etag
- last_modified ||= object.try(:updated_at) || object.try(:maximum, :updated_at)
-
- if strong_etag
- response.strong_etag = combine_etags strong_etag,
- last_modified: last_modified, public: public, template: template
- elsif weak_etag || template
- response.weak_etag = combine_etags weak_etag,
- last_modified: last_modified, public: public, template: template
- end
-
- response.last_modified = last_modified if last_modified
- response.cache_control[:public] = true if public
-
- head :not_modified if request.fresh?(response)
- end
-
- # Sets the +etag+ and/or +last_modified+ on the response and checks it against
- # the client request. If the request doesn't match the options provided, the
- # request is considered stale and should be generated from scratch. Otherwise,
- # it's fresh and we don't need to generate anything and a reply of 304 Not Modified is sent.
- #
- # === Parameters:
- #
- # * :etag Sets a "weak" ETag validator on the response. See the
- # +:weak_etag+ option.
- # * :weak_etag Sets a "weak" ETag validator on the response.
- # Requests that set If-None-Match header may return a 304 Not Modified
- # response if it matches the ETag exactly. A weak ETag indicates semantic
- # equivalence, not byte-for-byte equality, so they're good for caching
- # HTML pages in browser caches. They can't be used for responses that
- # must be byte-identical, like serving Range requests within a PDF file.
- # * :strong_etag Sets a "strong" ETag validator on the response.
- # Requests that set If-None-Match header may return a 304 Not Modified
- # response if it matches the ETag exactly. A strong ETag implies exact
- # equality: the response must match byte for byte. This is necessary for
- # doing Range requests within a large video or PDF file, for example, or
- # for compatibility with some CDNs that don't support weak ETags.
- # * :last_modified Sets a "weak" last-update validator on the
- # response. Subsequent requests that set If-Modified-Since may return a
- # 304 Not Modified response if last_modified <= If-Modified-Since.
- # * :public By default the Cache-Control header is private, set this to
- # +true+ if you want your application to be cacheable by other devices (proxy caches).
- # * :template By default, the template digest for the current
- # controller/action is included in ETags. If the action renders a
- # different template, you can include its digest instead. If the action
- # doesn't render a template at all, you can pass template: false
- # to skip any attempt to check for a template digest.
- #
- # === Example:
- #
- # def show
- # @article = Article.find(params[:id])
- #
- # if stale?(etag: @article, last_modified: @article.updated_at)
- # @statistics = @article.really_expensive_call
- # respond_to do |format|
- # # all the supported formats
- # end
- # end
- # end
- #
- # You can also just pass a record. In this case +last_modified+ will be set
- # by calling +updated_at+ and +etag+ by passing the object itself.
- #
- # def show
- # @article = Article.find(params[:id])
- #
- # if stale?(@article)
- # @statistics = @article.really_expensive_call
- # respond_to do |format|
- # # all the supported formats
- # end
- # end
- # end
- #
- # You can also pass an object that responds to +maximum+, such as a
- # collection of active records. In this case +last_modified+ will be set by
- # calling +maximum(:updated_at)+ on the collection (the timestamp of the
- # most recently updated record) and the +etag+ by passing the object itself.
- #
- # def index
- # @articles = Article.all
- #
- # if stale?(@articles)
- # @statistics = @articles.really_expensive_call
- # respond_to do |format|
- # # all the supported formats
- # end
- # end
- # end
- #
- # When passing a record or a collection, you can still set the public header:
- #
- # def show
- # @article = Article.find(params[:id])
- #
- # if stale?(@article, public: true)
- # @statistics = @article.really_expensive_call
- # respond_to do |format|
- # # all the supported formats
- # end
- # end
- # end
- #
- # When rendering a different template than the default controller/action
- # style, you can indicate which digest to include in the ETag:
- #
- # def show
- # super if stale? @article, template: 'widgets/show'
- # end
- #
- def stale?(object = nil, **freshness_kwargs)
- fresh_when(object, **freshness_kwargs)
- !request.fresh?(response)
- end
-
- # Sets an HTTP 1.1 Cache-Control header. Defaults to issuing a +private+
- # instruction, so that intermediate caches must not cache the response.
- #
- # expires_in 20.minutes
- # expires_in 3.hours, public: true
- # expires_in 3.hours, public: true, must_revalidate: true
- #
- # This method will overwrite an existing Cache-Control header.
- # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
- #
- # The method will also ensure an HTTP Date header for client compatibility.
- def expires_in(seconds, options = {})
- response.cache_control.merge!(
- max_age: seconds,
- public: options.delete(:public),
- must_revalidate: options.delete(:must_revalidate)
- )
- options.delete(:private)
-
- response.cache_control[:extras] = options.map { |k, v| "#{k}=#{v}" }
- response.date = Time.now unless response.date?
- end
-
- # Sets an HTTP 1.1 Cache-Control header of no-cache. This means the
- # resource will be marked as stale, so clients must always revalidate.
- # Intermediate/browser caches may still store the asset.
- def expires_now
- response.cache_control.replace(no_cache: true)
- end
-
- # Cache or yield the block. The cache is supposed to never expire.
- #
- # You can use this method when you have an HTTP response that never changes,
- # and the browser and proxies should cache it indefinitely.
- #
- # * +public+: By default, HTTP responses are private, cached only on the
- # user's web browser. To allow proxies to cache the response, set +true+ to
- # indicate that they can serve the cached response to all users.
- def http_cache_forever(public: false)
- expires_in 100.years, public: public
-
- yield if stale?(etag: request.fullpath,
- last_modified: Time.new(2011, 1, 1).utc,
- public: public)
- end
-
- private
- def combine_etags(validator, options)
- [validator, *etaggers.map { |etagger| instance_exec(options, &etagger) }].compact
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/cookies.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/cookies.rb
deleted file mode 100644
index 44925641a1..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/cookies.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module ActionController #:nodoc:
- module Cookies
- extend ActiveSupport::Concern
-
- included do
- helper_method :cookies if defined?(helper_method)
- end
-
- private
- def cookies
- request.cookie_jar
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/data_streaming.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/data_streaming.rb
deleted file mode 100644
index 731e03e2fc..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/data_streaming.rb
+++ /dev/null
@@ -1,150 +0,0 @@
-require "action_controller/metal/exceptions"
-
-module ActionController #:nodoc:
- # Methods for sending arbitrary data and for streaming files to the browser,
- # instead of rendering.
- module DataStreaming
- extend ActiveSupport::Concern
-
- include ActionController::Rendering
-
- DEFAULT_SEND_FILE_TYPE = "application/octet-stream".freeze #:nodoc:
- DEFAULT_SEND_FILE_DISPOSITION = "attachment".freeze #:nodoc:
-
- private
- # Sends the file. This uses a server-appropriate method (such as X-Sendfile)
- # via the Rack::Sendfile middleware. The header to use is set via
- # +config.action_dispatch.x_sendfile_header+.
- # Your server can also configure this for you by setting the X-Sendfile-Type header.
- #
- # Be careful to sanitize the path parameter if it is coming from a web
- # page. send_file(params[:path]) allows a malicious user to
- # download any file on your server.
- #
- # Options:
- # * :filename - suggests a filename for the browser to use.
- # Defaults to File.basename(path).
- # * :type - specifies an HTTP content type.
- # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json.
- # If omitted, the type will be inferred from the file extension specified in :filename.
- # If no content type is registered for the extension, the default type 'application/octet-stream' will be used.
- # * :disposition - specifies whether the file will be shown inline or downloaded.
- # Valid values are 'inline' and 'attachment' (default).
- # * :status - specifies the status code to send with the response. Defaults to 200.
- # * :url_based_filename - set to +true+ if you want the browser to guess the filename from
- # the URL, which is necessary for i18n filenames on certain browsers
- # (setting :filename overrides this option).
- #
- # The default Content-Type and Content-Disposition headers are
- # set to download arbitrary binary files in as many browsers as
- # possible. IE versions 4, 5, 5.5, and 6 are all known to have
- # a variety of quirks (especially when downloading over SSL).
- #
- # Simple download:
- #
- # send_file '/path/to.zip'
- #
- # Show a JPEG in the browser:
- #
- # send_file '/path/to.jpeg', type: 'image/jpeg', disposition: 'inline'
- #
- # Show a 404 page in the browser:
- #
- # send_file '/path/to/404.html', type: 'text/html; charset=utf-8', status: 404
- #
- # Read about the other Content-* HTTP headers if you'd like to
- # provide the user with more information (such as Content-Description) in
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11.
- #
- # Also be aware that the document may be cached by proxies and browsers.
- # The Pragma and Cache-Control headers declare how the file may be cached
- # by intermediaries. They default to require clients to validate with
- # the server before releasing cached responses. See
- # http://www.mnot.net/cache_docs/ for an overview of web caching and
- # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
- # for the Cache-Control header spec.
- def send_file(path, options = {}) #:doc:
- raise MissingFile, "Cannot read file #{path}" unless File.file?(path) && File.readable?(path)
-
- options[:filename] ||= File.basename(path) unless options[:url_based_filename]
- send_file_headers! options
-
- self.status = options[:status] || 200
- self.content_type = options[:content_type] if options.key?(:content_type)
- response.send_file path
- end
-
- # Sends the given binary data to the browser. This method is similar to
- # render plain: data, but also allows you to specify whether
- # the browser should display the response as a file attachment (i.e. in a
- # download dialog) or as inline data. You may also set the content type,
- # the file name, and other things.
- #
- # Options:
- # * :filename - suggests a filename for the browser to use.
- # * :type - specifies an HTTP content type. Defaults to 'application/octet-stream'.
- # You can specify either a string or a symbol for a registered type with Mime::Type.register, for example :json.
- # If omitted, type will be inferred from the file extension specified in :filename.
- # If no content type is registered for the extension, the default type 'application/octet-stream' will be used.
- # * :disposition - specifies whether the file will be shown inline or downloaded.
- # Valid values are 'inline' and 'attachment' (default).
- # * :status - specifies the status code to send with the response. Defaults to 200.
- #
- # Generic data download:
- #
- # send_data buffer
- #
- # Download a dynamically-generated tarball:
- #
- # send_data generate_tgz('dir'), filename: 'dir.tgz'
- #
- # Display an image Active Record in the browser:
- #
- # send_data image.data, type: image.content_type, disposition: 'inline'
- #
- # See +send_file+ for more information on HTTP Content-* headers and caching.
- def send_data(data, options = {}) #:doc:
- send_file_headers! options
- render options.slice(:status, :content_type).merge(body: data)
- end
-
- def send_file_headers!(options)
- type_provided = options.has_key?(:type)
-
- self.content_type = DEFAULT_SEND_FILE_TYPE
- response.sending_file = true
-
- content_type = options.fetch(:type, DEFAULT_SEND_FILE_TYPE)
- raise ArgumentError, ":type option required" if content_type.nil?
-
- if content_type.is_a?(Symbol)
- extension = Mime[content_type]
- raise ArgumentError, "Unknown MIME type #{options[:type]}" unless extension
- self.content_type = extension
- else
- if !type_provided && options[:filename]
- # If type wasn't provided, try guessing from file extension.
- content_type = Mime::Type.lookup_by_extension(File.extname(options[:filename]).downcase.delete(".")) || content_type
- end
- self.content_type = content_type
- end
-
- disposition = options.fetch(:disposition, DEFAULT_SEND_FILE_DISPOSITION)
- unless disposition.nil?
- disposition = disposition.to_s
- disposition += %(; filename="#{options[:filename]}") if options[:filename]
- headers["Content-Disposition"] = disposition
- end
-
- headers["Content-Transfer-Encoding"] = "binary"
-
- # Fix a problem with IE 6.0 on opening downloaded files:
- # If Cache-Control: no-cache is set (which Rails does by default),
- # IE removes the file it just downloaded from its cache immediately
- # after it displays the "open/save" dialog, which means that if you
- # hit "open" the file isn't there anymore when the application that
- # is called for handling the download is run, so let's workaround that
- response.cache_control[:public] ||= false
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_flash.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_flash.rb
deleted file mode 100644
index 7bd338bd7c..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_flash.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-module ActionController
- # When you're using the flash, it's generally used as a conditional on the view.
- # This means the content of the view depends on the flash. Which in turn means
- # that the ETag for a response should be computed with the content of the flash
- # in mind. This does that by including the content of the flash as a component
- # in the ETag that's generated for a response.
- module EtagWithFlash
- extend ActiveSupport::Concern
-
- include ActionController::ConditionalGet
-
- included do
- etag { flash unless flash.empty? }
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_template_digest.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_template_digest.rb
deleted file mode 100644
index 798564db96..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/etag_with_template_digest.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-module ActionController
- # When our views change, they should bubble up into HTTP cache freshness
- # and bust browser caches. So the template digest for the current action
- # is automatically included in the ETag.
- #
- # Enabled by default for apps that use Action View. Disable by setting
- #
- # config.action_controller.etag_with_template_digest = false
- #
- # Override the template to digest by passing +:template+ to +fresh_when+
- # and +stale?+ calls. For example:
- #
- # # We're going to render widgets/show, not posts/show
- # fresh_when @post, template: 'widgets/show'
- #
- # # We're not going to render a template, so omit it from the ETag.
- # fresh_when @post, template: false
- #
- module EtagWithTemplateDigest
- extend ActiveSupport::Concern
-
- include ActionController::ConditionalGet
-
- included do
- class_attribute :etag_with_template_digest
- self.etag_with_template_digest = true
-
- ActiveSupport.on_load :action_view, yield: true do
- etag do |options|
- determine_template_etag(options) if etag_with_template_digest
- end
- end
- end
-
- private
- def determine_template_etag(options)
- if template = pick_template_for_etag(options)
- lookup_and_digest_template(template)
- end
- end
-
- # Pick the template digest to include in the ETag. If the +:template+ option
- # is present, use the named template. If +:template+ is +nil+ or absent, use
- # the default controller/action template. If +:template+ is false, omit the
- # template digest from the ETag.
- def pick_template_for_etag(options)
- unless options[:template] == false
- options[:template] || "#{controller_path}/#{action_name}"
- end
- end
-
- def lookup_and_digest_template(template)
- ActionView::Digestor.digest name: template, finder: lookup_context
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/exceptions.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/exceptions.rb
deleted file mode 100644
index 175dd9eb9e..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/exceptions.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-module ActionController
- class ActionControllerError < StandardError #:nodoc:
- end
-
- class BadRequest < ActionControllerError #:nodoc:
- def initialize(msg = nil)
- super(msg)
- set_backtrace $!.backtrace if $!
- end
- end
-
- class RenderError < ActionControllerError #:nodoc:
- end
-
- class RoutingError < ActionControllerError #:nodoc:
- attr_reader :failures
- def initialize(message, failures = [])
- super(message)
- @failures = failures
- end
- end
-
- class ActionController::UrlGenerationError < ActionControllerError #:nodoc:
- end
-
- class MethodNotAllowed < ActionControllerError #:nodoc:
- def initialize(*allowed_methods)
- super("Only #{allowed_methods.to_sentence(locale: :en)} requests are allowed.")
- end
- end
-
- class NotImplemented < MethodNotAllowed #:nodoc:
- end
-
- class UnknownController < ActionControllerError #:nodoc:
- end
-
- class MissingFile < ActionControllerError #:nodoc:
- end
-
- class SessionOverflowError < ActionControllerError #:nodoc:
- DEFAULT_MESSAGE = "Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data."
-
- def initialize(message = nil)
- super(message || DEFAULT_MESSAGE)
- end
- end
-
- class UnknownHttpMethod < ActionControllerError #:nodoc:
- end
-
- class UnknownFormat < ActionControllerError #:nodoc:
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/flash.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/flash.rb
deleted file mode 100644
index 347fbf0e74..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/flash.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-module ActionController #:nodoc:
- module Flash
- extend ActiveSupport::Concern
-
- included do
- class_attribute :_flash_types, instance_accessor: false
- self._flash_types = []
-
- delegate :flash, to: :request
- add_flash_types(:alert, :notice)
- end
-
- module ClassMethods
- # Creates new flash types. You can pass as many types as you want to create
- # flash types other than the default alert and notice in
- # your controllers and views. For instance:
- #
- # # in application_controller.rb
- # class ApplicationController < ActionController::Base
- # add_flash_types :warning
- # end
- #
- # # in your controller
- # redirect_to user_path(@user), warning: "Incomplete profile"
- #
- # # in your view
- # <%= warning %>
- #
- # This method will automatically define a new method for each of the given
- # names, and it will be available in your views.
- def add_flash_types(*types)
- types.each do |type|
- next if _flash_types.include?(type)
-
- define_method(type) do
- request.flash[type]
- end
- helper_method type
-
- self._flash_types += [type]
- end
- end
- end
-
- private
- def redirect_to(options = {}, response_status_and_flash = {}) #:doc:
- self.class._flash_types.each do |flash_type|
- if type = response_status_and_flash.delete(flash_type)
- flash[flash_type] = type
- end
- end
-
- if other_flashes = response_status_and_flash.delete(:flash)
- flash.update(other_flashes)
- end
-
- super(options, response_status_and_flash)
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/force_ssl.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/force_ssl.rb
deleted file mode 100644
index 73e67573ca..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/force_ssl.rb
+++ /dev/null
@@ -1,97 +0,0 @@
-require "active_support/core_ext/hash/except"
-require "active_support/core_ext/hash/slice"
-
-module ActionController
- # This module provides a method which will redirect the browser to use the secured HTTPS
- # protocol. This will ensure that users' sensitive information will be
- # transferred safely over the internet. You _should_ always force the browser
- # to use HTTPS when you're transferring sensitive information such as
- # user authentication, account information, or credit card information.
- #
- # Note that if you are really concerned about your application security,
- # you might consider using +config.force_ssl+ in your config file instead.
- # That will ensure all the data is transferred via HTTPS, and will
- # prevent the user from getting their session hijacked when accessing the
- # site over unsecured HTTP protocol.
- module ForceSSL
- extend ActiveSupport::Concern
- include AbstractController::Callbacks
-
- ACTION_OPTIONS = [:only, :except, :if, :unless]
- URL_OPTIONS = [:protocol, :host, :domain, :subdomain, :port, :path]
- REDIRECT_OPTIONS = [:status, :flash, :alert, :notice]
-
- module ClassMethods
- # Force the request to this particular controller or specified actions to be
- # through the HTTPS protocol.
- #
- # If you need to disable this for any reason (e.g. development) then you can use
- # an +:if+ or +:unless+ condition.
- #
- # class AccountsController < ApplicationController
- # force_ssl if: :ssl_configured?
- #
- # def ssl_configured?
- # !Rails.env.development?
- # end
- # end
- #
- # ==== URL Options
- # You can pass any of the following options to affect the redirect url
- # * host - Redirect to a different host name
- # * subdomain - Redirect to a different subdomain
- # * domain - Redirect to a different domain
- # * port - Redirect to a non-standard port
- # * path - Redirect to a different path
- #
- # ==== Redirect Options
- # You can pass any of the following options to affect the redirect status and response
- # * status - Redirect with a custom status (default is 301 Moved Permanently)
- # * flash - Set a flash message when redirecting
- # * alert - Set an alert message when redirecting
- # * notice - Set a notice message when redirecting
- #
- # ==== Action Options
- # You can pass any of the following options to affect the before_action callback
- # * only - The callback should be run only for this action
- # * except - The callback should be run for all actions except this action
- # * if - A symbol naming an instance method or a proc; the
- # callback will be called only when it returns a true value.
- # * unless - A symbol naming an instance method or a proc; the
- # callback will be called only when it returns a false value.
- def force_ssl(options = {})
- action_options = options.slice(*ACTION_OPTIONS)
- redirect_options = options.except(*ACTION_OPTIONS)
- before_action(action_options) do
- force_ssl_redirect(redirect_options)
- end
- end
- end
-
- # Redirect the existing request to use the HTTPS protocol.
- #
- # ==== Parameters
- # * host_or_options - Either a host name or any of the url and
- # redirect options available to the force_ssl method.
- def force_ssl_redirect(host_or_options = nil)
- unless request.ssl?
- options = {
- protocol: "https://",
- host: request.host,
- path: request.fullpath,
- status: :moved_permanently
- }
-
- if host_or_options.is_a?(Hash)
- options.merge!(host_or_options)
- elsif host_or_options
- options[:host] = host_or_options
- end
-
- secure_url = ActionDispatch::Http::URL.url_for(options.slice(*URL_OPTIONS))
- flash.keep if respond_to?(:flash) && request.respond_to?(:flash)
- redirect_to secure_url, options.slice(*REDIRECT_OPTIONS)
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/head.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/head.rb
deleted file mode 100644
index 0c50894bce..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/head.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-module ActionController
- module Head
- # Returns a response that has no content (merely headers). The options
- # argument is interpreted to be a hash of header names and values.
- # This allows you to easily return a response that consists only of
- # significant headers:
- #
- # head :created, location: person_path(@person)
- #
- # head :created, location: @person
- #
- # It can also be used to return exceptional conditions:
- #
- # return head(:method_not_allowed) unless request.post?
- # return head(:bad_request) unless valid_request?
- # render
- #
- # See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list of valid +status+ symbols.
- def head(status, options = {})
- if status.is_a?(Hash)
- raise ArgumentError, "#{status.inspect} is not a valid value for `status`."
- end
-
- status ||= :ok
-
- location = options.delete(:location)
- content_type = options.delete(:content_type)
-
- options.each do |key, value|
- headers[key.to_s.dasherize.split("-").each { |v| v[0] = v[0].chr.upcase }.join("-")] = value.to_s
- end
-
- self.status = status
- self.location = url_for(location) if location
-
- self.response_body = ""
-
- if include_content?(response_code)
- self.content_type = content_type || (Mime[formats.first] if formats)
- response.charset = false
- end
-
- true
- end
-
- private
- def include_content?(status)
- case status
- when 100..199
- false
- when 204, 205, 304
- false
- else
- true
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/helpers.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/helpers.rb
deleted file mode 100644
index 476d081239..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/helpers.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-module ActionController
- # The \Rails framework provides a large number of helpers for working with assets, dates, forms,
- # numbers and model objects, to name a few. These helpers are available to all templates
- # by default.
- #
- # In addition to using the standard template helpers provided, creating custom helpers to
- # extract complicated logic or reusable functionality is strongly encouraged. By default, each controller
- # will include all helpers. These helpers are only accessible on the controller through #helpers
- #
- # In previous versions of \Rails the controller will include a helper which
- # matches the name of the controller, e.g., MyController will automatically
- # include MyHelper. To return old behavior set +config.action_controller.include_all_helpers+ to +false+.
- #
- # Additional helpers can be specified using the +helper+ class method in ActionController::Base or any
- # controller which inherits from it.
- #
- # The +to_s+ method from the \Time class can be wrapped in a helper method to display a custom message if
- # a \Time object is blank:
- #
- # module FormattedTimeHelper
- # def format_time(time, format=:long, blank_message=" ")
- # time.blank? ? blank_message : time.to_s(format)
- # end
- # end
- #
- # FormattedTimeHelper can now be included in a controller, using the +helper+ class method:
- #
- # class EventsController < ActionController::Base
- # helper FormattedTimeHelper
- # def index
- # @events = Event.all
- # end
- # end
- #
- # Then, in any view rendered by EventController, the format_time method can be called:
- #
- # <% @events.each do |event| -%>
- #
- # <% end -%>
- #
- # Finally, assuming we have two event instances, one which has a time and one which does not,
- # the output might look like this:
- #
- # 23 Aug 11:30 | Carolina Railhawks Soccer Match
- # N/A | Carolina Railhawks Training Workshop
- #
- module Helpers
- extend ActiveSupport::Concern
-
- class << self; attr_accessor :helpers_path; end
- include AbstractController::Helpers
-
- included do
- class_attribute :helpers_path, :include_all_helpers
- self.helpers_path ||= []
- self.include_all_helpers = true
- end
-
- module ClassMethods
- # Declares helper accessors for controller attributes. For example, the
- # following adds new +name+ and name= instance methods to a
- # controller and makes them available to the view:
- # attr_accessor :name
- # helper_attr :name
- #
- # ==== Parameters
- # * attrs - Names of attributes to be converted into helpers.
- def helper_attr(*attrs)
- attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
- end
-
- # Provides a proxy to access helper methods from outside the view.
- def helpers
- @helper_proxy ||= begin
- proxy = ActionView::Base.new
- proxy.config = config.inheritable_copy
- proxy.extend(_helpers)
- end
- end
-
- # Overwrite modules_for_helpers to accept :all as argument, which loads
- # all helpers in helpers_path.
- #
- # ==== Parameters
- # * args - A list of helpers
- #
- # ==== Returns
- # * array - A normalized list of modules for the list of helpers provided.
- def modules_for_helpers(args)
- args += all_application_helpers if args.delete(:all)
- super(args)
- end
-
- # Returns a list of helper names in a given path.
- #
- # ActionController::Base.all_helpers_from_path 'app/helpers'
- # # => ["application", "chart", "rubygems"]
- def all_helpers_from_path(path)
- helpers = Array(path).flat_map do |_path|
- extract = /^#{Regexp.quote(_path.to_s)}\/?(.*)_helper.rb$/
- names = Dir["#{_path}/**/*_helper.rb"].map { |file| file.sub(extract, '\1'.freeze) }
- names.sort!
- end
- helpers.uniq!
- helpers
- end
-
- private
- # Extract helper names from files in app/helpers/**/*_helper.rb
- def all_application_helpers
- all_helpers_from_path(helpers_path)
- end
- end
-
- # Provides a proxy to access helper methods from outside the view.
- def helpers
- @_helper_proxy ||= view_context
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/http_authentication.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/http_authentication.rb
deleted file mode 100644
index d8bc895265..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/http_authentication.rb
+++ /dev/null
@@ -1,520 +0,0 @@
-require "base64"
-require "active_support/security_utils"
-
-module ActionController
- # Makes it dead easy to do HTTP Basic, Digest and Token authentication.
- module HttpAuthentication
- # Makes it dead easy to do HTTP \Basic authentication.
- #
- # === Simple \Basic example
- #
- # class PostsController < ApplicationController
- # http_basic_authenticate_with name: "dhh", password: "secret", except: :index
- #
- # def index
- # render plain: "Everyone can see me!"
- # end
- #
- # def edit
- # render plain: "I'm only accessible if you know the password"
- # end
- # end
- #
- # === Advanced \Basic example
- #
- # Here is a more advanced \Basic example where only Atom feeds and the XML API is protected by HTTP authentication,
- # the regular HTML interface is protected by a session approach:
- #
- # class ApplicationController < ActionController::Base
- # before_action :set_account, :authenticate
- #
- # private
- # def set_account
- # @account = Account.find_by(url_name: request.subdomains.first)
- # end
- #
- # def authenticate
- # case request.format
- # when Mime[:xml], Mime[:atom]
- # if user = authenticate_with_http_basic { |u, p| @account.users.authenticate(u, p) }
- # @current_user = user
- # else
- # request_http_basic_authentication
- # end
- # else
- # if session_authenticated?
- # @current_user = @account.users.find(session[:authenticated][:user_id])
- # else
- # redirect_to(login_url) and return false
- # end
- # end
- # end
- # end
- #
- # In your integration tests, you can do something like this:
- #
- # def test_access_granted_from_xml
- # @request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password)
- # get "/notes/1.xml"
- #
- # assert_equal 200, status
- # end
- module Basic
- extend self
-
- module ControllerMethods
- extend ActiveSupport::Concern
-
- module ClassMethods
- def http_basic_authenticate_with(options = {})
- before_action(options.except(:name, :password, :realm)) do
- authenticate_or_request_with_http_basic(options[:realm] || "Application") do |name, password|
- # This comparison uses & so that it doesn't short circuit and
- # uses `variable_size_secure_compare` so that length information
- # isn't leaked.
- ActiveSupport::SecurityUtils.variable_size_secure_compare(name, options[:name]) &
- ActiveSupport::SecurityUtils.variable_size_secure_compare(password, options[:password])
- end
- end
- end
- end
-
- def authenticate_or_request_with_http_basic(realm = "Application", message = nil, &login_procedure)
- authenticate_with_http_basic(&login_procedure) || request_http_basic_authentication(realm, message)
- end
-
- def authenticate_with_http_basic(&login_procedure)
- HttpAuthentication::Basic.authenticate(request, &login_procedure)
- end
-
- def request_http_basic_authentication(realm = "Application", message = nil)
- HttpAuthentication::Basic.authentication_request(self, realm, message)
- end
- end
-
- def authenticate(request, &login_procedure)
- if has_basic_credentials?(request)
- login_procedure.call(*user_name_and_password(request))
- end
- end
-
- def has_basic_credentials?(request)
- request.authorization.present? && (auth_scheme(request).downcase == "basic")
- end
-
- def user_name_and_password(request)
- decode_credentials(request).split(":", 2)
- end
-
- def decode_credentials(request)
- ::Base64.decode64(auth_param(request) || "")
- end
-
- def auth_scheme(request)
- request.authorization.to_s.split(" ", 2).first
- end
-
- def auth_param(request)
- request.authorization.to_s.split(" ", 2).second
- end
-
- def encode_credentials(user_name, password)
- "Basic #{::Base64.strict_encode64("#{user_name}:#{password}")}"
- end
-
- def authentication_request(controller, realm, message)
- message ||= "HTTP Basic: Access denied.\n"
- controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.tr('"'.freeze, "".freeze)}")
- controller.status = 401
- controller.response_body = message
- end
- end
-
- # Makes it dead easy to do HTTP \Digest authentication.
- #
- # === Simple \Digest example
- #
- # require 'digest/md5'
- # class PostsController < ApplicationController
- # REALM = "SuperSecret"
- # USERS = {"dhh" => "secret", #plain text password
- # "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password
- #
- # before_action :authenticate, except: [:index]
- #
- # def index
- # render plain: "Everyone can see me!"
- # end
- #
- # def edit
- # render plain: "I'm only accessible if you know the password"
- # end
- #
- # private
- # def authenticate
- # authenticate_or_request_with_http_digest(REALM) do |username|
- # USERS[username]
- # end
- # end
- # end
- #
- # === Notes
- #
- # The +authenticate_or_request_with_http_digest+ block must return the user's password
- # or the ha1 digest hash so the framework can appropriately hash to check the user's
- # credentials. Returning +nil+ will cause authentication to fail.
- #
- # Storing the ha1 hash: MD5(username:realm:password), is better than storing a plain password. If
- # the password file or database is compromised, the attacker would be able to use the ha1 hash to
- # authenticate as the user at this +realm+, but would not have the user's password to try using at
- # other sites.
- #
- # In rare instances, web servers or front proxies strip authorization headers before
- # they reach your application. You can debug this situation by logging all environment
- # variables, and check for HTTP_AUTHORIZATION, amongst others.
- module Digest
- extend self
-
- module ControllerMethods
- def authenticate_or_request_with_http_digest(realm = "Application", message = nil, &password_procedure)
- authenticate_with_http_digest(realm, &password_procedure) || request_http_digest_authentication(realm, message)
- end
-
- # Authenticate with HTTP Digest, returns true or false
- def authenticate_with_http_digest(realm = "Application", &password_procedure)
- HttpAuthentication::Digest.authenticate(request, realm, &password_procedure)
- end
-
- # Render output including the HTTP Digest authentication header
- def request_http_digest_authentication(realm = "Application", message = nil)
- HttpAuthentication::Digest.authentication_request(self, realm, message)
- end
- end
-
- # Returns false on a valid response, true otherwise
- def authenticate(request, realm, &password_procedure)
- request.authorization && validate_digest_response(request, realm, &password_procedure)
- end
-
- # Returns false unless the request credentials response value matches the expected value.
- # First try the password as a ha1 digest password. If this fails, then try it as a plain
- # text password.
- def validate_digest_response(request, realm, &password_procedure)
- secret_key = secret_token(request)
- credentials = decode_credentials_header(request)
- valid_nonce = validate_nonce(secret_key, request, credentials[:nonce])
-
- if valid_nonce && realm == credentials[:realm] && opaque(secret_key) == credentials[:opaque]
- password = password_procedure.call(credentials[:username])
- return false unless password
-
- method = request.get_header("rack.methodoverride.original_method") || request.get_header("REQUEST_METHOD")
- uri = credentials[:uri]
-
- [true, false].any? do |trailing_question_mark|
- [true, false].any? do |password_is_ha1|
- _uri = trailing_question_mark ? uri + "?" : uri
- expected = expected_response(method, _uri, credentials, password, password_is_ha1)
- expected == credentials[:response]
- end
- end
- end
- end
-
- # Returns the expected response for a request of +http_method+ to +uri+ with the decoded +credentials+ and the expected +password+
- # Optional parameter +password_is_ha1+ is set to +true+ by default, since best practice is to store ha1 digest instead
- # of a plain-text password.
- def expected_response(http_method, uri, credentials, password, password_is_ha1 = true)
- ha1 = password_is_ha1 ? password : ha1(credentials, password)
- ha2 = ::Digest::MD5.hexdigest([http_method.to_s.upcase, uri].join(":"))
- ::Digest::MD5.hexdigest([ha1, credentials[:nonce], credentials[:nc], credentials[:cnonce], credentials[:qop], ha2].join(":"))
- end
-
- def ha1(credentials, password)
- ::Digest::MD5.hexdigest([credentials[:username], credentials[:realm], password].join(":"))
- end
-
- def encode_credentials(http_method, credentials, password, password_is_ha1)
- credentials[:response] = expected_response(http_method, credentials[:uri], credentials, password, password_is_ha1)
- "Digest " + credentials.sort_by { |x| x[0].to_s }.map { |v| "#{v[0]}='#{v[1]}'" }.join(", ")
- end
-
- def decode_credentials_header(request)
- decode_credentials(request.authorization)
- end
-
- def decode_credentials(header)
- ActiveSupport::HashWithIndifferentAccess[header.to_s.gsub(/^Digest\s+/, "").split(",").map do |pair|
- key, value = pair.split("=", 2)
- [key.strip, value.to_s.gsub(/^"|"$/, "").delete('\'')]
- end]
- end
-
- def authentication_header(controller, realm)
- secret_key = secret_token(controller.request)
- nonce = self.nonce(secret_key)
- opaque = opaque(secret_key)
- controller.headers["WWW-Authenticate"] = %(Digest realm="#{realm}", qop="auth", algorithm=MD5, nonce="#{nonce}", opaque="#{opaque}")
- end
-
- def authentication_request(controller, realm, message = nil)
- message ||= "HTTP Digest: Access denied.\n"
- authentication_header(controller, realm)
- controller.status = 401
- controller.response_body = message
- end
-
- def secret_token(request)
- key_generator = request.key_generator
- http_auth_salt = request.http_auth_salt
- key_generator.generate_key(http_auth_salt)
- end
-
- # Uses an MD5 digest based on time to generate a value to be used only once.
- #
- # A server-specified data string which should be uniquely generated each time a 401 response is made.
- # It is recommended that this string be base64 or hexadecimal data.
- # Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed.
- #
- # The contents of the nonce are implementation dependent.
- # The quality of the implementation depends on a good choice.
- # A nonce might, for example, be constructed as the base 64 encoding of
- #
- # time-stamp H(time-stamp ":" ETag ":" private-key)
- #
- # where time-stamp is a server-generated time or other non-repeating value,
- # ETag is the value of the HTTP ETag header associated with the requested entity,
- # and private-key is data known only to the server.
- # With a nonce of this form a server would recalculate the hash portion after receiving the client authentication header and
- # reject the request if it did not match the nonce from that header or
- # if the time-stamp value is not recent enough. In this way the server can limit the time of the nonce's validity.
- # The inclusion of the ETag prevents a replay request for an updated version of the resource.
- # (Note: including the IP address of the client in the nonce would appear to offer the server the ability
- # to limit the reuse of the nonce to the same client that originally got it.
- # However, that would break proxy farms, where requests from a single user often go through different proxies in the farm.
- # Also, IP address spoofing is not that hard.)
- #
- # An implementation might choose not to accept a previously used nonce or a previously used digest, in order to
- # protect against a replay attack. Or, an implementation might choose to use one-time nonces or digests for
- # POST, PUT, or PATCH requests and a time-stamp for GET requests. For more details on the issues involved see Section 4
- # of this document.
- #
- # The nonce is opaque to the client. Composed of Time, and hash of Time with secret
- # key from the Rails session secret generated upon creation of project. Ensures
- # the time cannot be modified by client.
- def nonce(secret_key, time = Time.now)
- t = time.to_i
- hashed = [t, secret_key]
- digest = ::Digest::MD5.hexdigest(hashed.join(":"))
- ::Base64.strict_encode64("#{t}:#{digest}")
- end
-
- # Might want a shorter timeout depending on whether the request
- # is a PATCH, PUT, or POST, and if the client is a browser or web service.
- # Can be much shorter if the Stale directive is implemented. This would
- # allow a user to use new nonce without prompting the user again for their
- # username and password.
- def validate_nonce(secret_key, request, value, seconds_to_timeout = 5 * 60)
- return false if value.nil?
- t = ::Base64.decode64(value).split(":").first.to_i
- nonce(secret_key, t) == value && (t - Time.now.to_i).abs <= seconds_to_timeout
- end
-
- # Opaque based on digest of secret key
- def opaque(secret_key)
- ::Digest::MD5.hexdigest(secret_key)
- end
- end
-
- # Makes it dead easy to do HTTP Token authentication.
- #
- # Simple Token example:
- #
- # class PostsController < ApplicationController
- # TOKEN = "secret"
- #
- # before_action :authenticate, except: [ :index ]
- #
- # def index
- # render plain: "Everyone can see me!"
- # end
- #
- # def edit
- # render plain: "I'm only accessible if you know the password"
- # end
- #
- # private
- # def authenticate
- # authenticate_or_request_with_http_token do |token, options|
- # # Compare the tokens in a time-constant manner, to mitigate
- # # timing attacks.
- # ActiveSupport::SecurityUtils.secure_compare(
- # ::Digest::SHA256.hexdigest(token),
- # ::Digest::SHA256.hexdigest(TOKEN)
- # )
- # end
- # end
- # end
- #
- #
- # Here is a more advanced Token example where only Atom feeds and the XML API is protected by HTTP token authentication,
- # the regular HTML interface is protected by a session approach:
- #
- # class ApplicationController < ActionController::Base
- # before_action :set_account, :authenticate
- #
- # private
- # def set_account
- # @account = Account.find_by(url_name: request.subdomains.first)
- # end
- #
- # def authenticate
- # case request.format
- # when Mime[:xml], Mime[:atom]
- # if user = authenticate_with_http_token { |t, o| @account.users.authenticate(t, o) }
- # @current_user = user
- # else
- # request_http_token_authentication
- # end
- # else
- # if session_authenticated?
- # @current_user = @account.users.find(session[:authenticated][:user_id])
- # else
- # redirect_to(login_url) and return false
- # end
- # end
- # end
- # end
- #
- #
- # In your integration tests, you can do something like this:
- #
- # def test_access_granted_from_xml
- # get(
- # "/notes/1.xml", nil,
- # 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token)
- # )
- #
- # assert_equal 200, status
- # end
- #
- #
- # On shared hosts, Apache sometimes doesn't pass authentication headers to
- # FCGI instances. If your environment matches this description and you cannot
- # authenticate, try this rule in your Apache setup:
- #
- # RewriteRule ^(.*)$ dispatch.fcgi [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]
- module Token
- TOKEN_KEY = "token="
- TOKEN_REGEX = /^(Token|Bearer)\s+/
- AUTHN_PAIR_DELIMITERS = /(?:,|;|\t+)/
- extend self
-
- module ControllerMethods
- def authenticate_or_request_with_http_token(realm = "Application", message = nil, &login_procedure)
- authenticate_with_http_token(&login_procedure) || request_http_token_authentication(realm, message)
- end
-
- def authenticate_with_http_token(&login_procedure)
- Token.authenticate(self, &login_procedure)
- end
-
- def request_http_token_authentication(realm = "Application", message = nil)
- Token.authentication_request(self, realm, message)
- end
- end
-
- # If token Authorization header is present, call the login
- # procedure with the present token and options.
- #
- # [controller]
- # ActionController::Base instance for the current request.
- #
- # [login_procedure]
- # Proc to call if a token is present. The Proc should take two arguments:
- #
- # authenticate(controller) { |token, options| ... }
- #
- # Returns the return value of login_procedure if a
- # token is found. Returns nil if no token is found.
-
- def authenticate(controller, &login_procedure)
- token, options = token_and_options(controller.request)
- unless token.blank?
- login_procedure.call(token, options)
- end
- end
-
- # Parses the token and options out of the token Authorization header.
- # The value for the Authorization header is expected to have the prefix
- # "Token" or "Bearer". If the header looks like this:
- # Authorization: Token token="abc", nonce="def"
- # Then the returned token is "abc", and the options are
- # {nonce: "def"}
- #
- # request - ActionDispatch::Request instance with the current headers.
- #
- # Returns an +Array+ of [String, Hash] if a token is present.
- # Returns +nil+ if no token is found.
- def token_and_options(request)
- authorization_request = request.authorization.to_s
- if authorization_request[TOKEN_REGEX]
- params = token_params_from authorization_request
- [params.shift[1], Hash[params].with_indifferent_access]
- end
- end
-
- def token_params_from(auth)
- rewrite_param_values params_array_from raw_params auth
- end
-
- # Takes raw_params and turns it into an array of parameters
- def params_array_from(raw_params)
- raw_params.map { |param| param.split %r/=(.+)?/ }
- end
-
- # This removes the " characters wrapping the value.
- def rewrite_param_values(array_params)
- array_params.each { |param| (param[1] || "").gsub! %r/^"|"$/, "" }
- end
-
- # This method takes an authorization body and splits up the key-value
- # pairs by the standardized :, ;, or \t
- # delimiters defined in +AUTHN_PAIR_DELIMITERS+.
- def raw_params(auth)
- _raw_params = auth.sub(TOKEN_REGEX, "").split(/\s*#{AUTHN_PAIR_DELIMITERS}\s*/)
-
- if !(_raw_params.first =~ %r{\A#{TOKEN_KEY}})
- _raw_params[0] = "#{TOKEN_KEY}#{_raw_params.first}"
- end
-
- _raw_params
- end
-
- # Encodes the given token and options into an Authorization header value.
- #
- # token - String token.
- # options - optional Hash of the options.
- #
- # Returns String.
- def encode_credentials(token, options = {})
- values = ["#{TOKEN_KEY}#{token.to_s.inspect}"] + options.map do |key, value|
- "#{key}=#{value.to_s.inspect}"
- end
- "Token #{values * ", "}"
- end
-
- # Sets a WWW-Authenticate header to let the client know a token is desired.
- #
- # controller - ActionController::Base instance for the outgoing response.
- # realm - String realm to use in the header.
- #
- # Returns nothing.
- def authentication_request(controller, realm, message = nil)
- message ||= "HTTP Token: Access denied.\n"
- controller.headers["WWW-Authenticate"] = %(Token realm="#{realm.tr('"'.freeze, "".freeze)}")
- controller.__send__ :render, plain: message, status: :unauthorized
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/implicit_render.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/implicit_render.rb
deleted file mode 100644
index eeb27f99f4..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/implicit_render.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-module ActionController
- # Handles implicit rendering for a controller action that does not
- # explicitly respond with +render+, +respond_to+, +redirect+, or +head+.
- #
- # For API controllers, the implicit response is always 204 No Content.
- #
- # For all other controllers, we use these heuristics to decide whether to
- # render a template, raise an error for a missing template, or respond with
- # 204 No Content:
- #
- # First, if we DO find a template, it's rendered. Template lookup accounts
- # for the action name, locales, format, variant, template handlers, and more
- # (see +render+ for details).
- #
- # Second, if we DON'T find a template but the controller action does have
- # templates for other formats, variants, etc., then we trust that you meant
- # to provide a template for this response, too, and we raise
- # ActionController::UnknownFormat with an explanation.
- #
- # Third, if we DON'T find a template AND the request is a page load in a web
- # browser (technically, a non-XHR GET request for an HTML response) where
- # you reasonably expect to have rendered a template, then we raise
- # ActionView::UnknownFormat with an explanation.
- #
- # Finally, if we DON'T find a template AND the request isn't a browser page
- # load, then we implicitly respond with 204 No Content.
- module ImplicitRender
- # :stopdoc:
- include BasicImplicitRender
-
- def default_render(*args)
- if template_exists?(action_name.to_s, _prefixes, variants: request.variant)
- render(*args)
- elsif any_templates?(action_name.to_s, _prefixes)
- message = "#{self.class.name}\##{action_name} is missing a template " \
- "for this request format and variant.\n" \
- "\nrequest.formats: #{request.formats.map(&:to_s).inspect}" \
- "\nrequest.variant: #{request.variant.inspect}"
-
- raise ActionController::UnknownFormat, message
- elsif interactive_browser_request?
- message = "#{self.class.name}\##{action_name} is missing a template " \
- "for this request format and variant.\n\n" \
- "request.formats: #{request.formats.map(&:to_s).inspect}\n" \
- "request.variant: #{request.variant.inspect}\n\n" \
- "NOTE! For XHR/Ajax or API requests, this action would normally " \
- "respond with 204 No Content: an empty white screen. Since you're " \
- "loading it in a web browser, we assume that you expected to " \
- "actually render a template, not nothing, so we're showing an " \
- "error to be extra-clear. If you expect 204 No Content, carry on. " \
- "That's what you'll get from an XHR or API request. Give it a shot."
-
- raise ActionController::UnknownFormat, message
- else
- logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger
- super
- end
- end
-
- def method_for_action(action_name)
- super || if template_exists?(action_name.to_s, _prefixes)
- "default_render"
- end
- end
-
- private
- def interactive_browser_request?
- request.get? && request.format == Mime[:html] && !request.xhr?
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb
deleted file mode 100644
index 2485d27cec..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/instrumentation.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require "benchmark"
-require "abstract_controller/logger"
-
-module ActionController
- # Adds instrumentation to several ends in ActionController::Base. It also provides
- # some hooks related with process_action. This allows an ORM like Active Record
- # and/or DataMapper to plug in ActionController and show related information.
- #
- # Check ActiveRecord::Railties::ControllerRuntime for an example.
- module Instrumentation
- extend ActiveSupport::Concern
-
- include AbstractController::Logger
-
- attr_internal :view_runtime
-
- def process_action(*args)
- raw_payload = {
- controller: self.class.name,
- action: action_name,
- params: request.filtered_parameters,
- headers: request.headers,
- format: request.format.ref,
- method: request.request_method,
- path: request.fullpath
- }
-
- ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)
-
- ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
- begin
- result = super
- payload[:status] = response.status
- result
- ensure
- append_info_to_payload(payload)
- end
- end
- end
-
- def render(*args)
- render_output = nil
- self.view_runtime = cleanup_view_runtime do
- Benchmark.ms { render_output = super }
- end
- render_output
- end
-
- def send_file(path, options = {})
- ActiveSupport::Notifications.instrument("send_file.action_controller",
- options.merge(path: path)) do
- super
- end
- end
-
- def send_data(data, options = {})
- ActiveSupport::Notifications.instrument("send_data.action_controller", options) do
- super
- end
- end
-
- def redirect_to(*args)
- ActiveSupport::Notifications.instrument("redirect_to.action_controller") do |payload|
- result = super
- payload[:status] = response.status
- payload[:location] = response.filtered_location
- result
- end
- end
-
- private
-
- # A hook invoked every time a before callback is halted.
- def halted_callback_hook(filter)
- ActiveSupport::Notifications.instrument("halted_callback.action_controller", filter: filter)
- end
-
- # A hook which allows you to clean up any time, wrongly taken into account in
- # views, like database querying time.
- #
- # def cleanup_view_runtime
- # super - time_taken_in_something_expensive
- # end
- #
- # :api: plugin
- def cleanup_view_runtime
- yield
- end
-
- # Every time after an action is processed, this method is invoked
- # with the payload, so you can add more information.
- # :api: plugin
- def append_info_to_payload(payload)
- payload[:view_runtime] = view_runtime
- end
-
- module ClassMethods
- # A hook which allows other frameworks to log what happened during
- # controller process action. This method should return an array
- # with the messages to be added.
- # :api: plugin
- def log_process_action(payload) #:nodoc:
- messages, view_runtime = [], payload[:view_runtime]
- messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime
- messages
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/live.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/live.rb
deleted file mode 100644
index a607ee2309..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/live.rb
+++ /dev/null
@@ -1,310 +0,0 @@
-require "action_dispatch/http/response"
-require "delegate"
-require "active_support/json"
-
-module ActionController
- # Mix this module into your controller, and all actions in that controller
- # will be able to stream data to the client as it's written.
- #
- # class MyController < ActionController::Base
- # include ActionController::Live
- #
- # def stream
- # response.headers['Content-Type'] = 'text/event-stream'
- # 100.times {
- # response.stream.write "hello world\n"
- # sleep 1
- # }
- # ensure
- # response.stream.close
- # end
- # end
- #
- # There are a few caveats with this module. You *cannot* write headers after the
- # response has been committed (Response#committed? will return truthy).
- # Calling +write+ or +close+ on the response stream will cause the response
- # object to be committed. Make sure all headers are set before calling write
- # or close on your stream.
- #
- # You *must* call close on your stream when you're finished, otherwise the
- # socket may be left open forever.
- #
- # The final caveat is that your actions are executed in a separate thread than
- # the main thread. Make sure your actions are thread safe, and this shouldn't
- # be a problem (don't share state across threads, etc).
- module Live
- extend ActiveSupport::Concern
-
- module ClassMethods
- def make_response!(request)
- if request.get_header("HTTP_VERSION") == "HTTP/1.0"
- super
- else
- Live::Response.new.tap do |res|
- res.request = request
- end
- end
- end
- end
-
- # This class provides the ability to write an SSE (Server Sent Event)
- # to an IO stream. The class is initialized with a stream and can be used
- # to either write a JSON string or an object which can be converted to JSON.
- #
- # Writing an object will convert it into standard SSE format with whatever
- # options you have configured. You may choose to set the following options:
- #
- # 1) Event. If specified, an event with this name will be dispatched on
- # the browser.
- # 2) Retry. The reconnection time in milliseconds used when attempting
- # to send the event.
- # 3) Id. If the connection dies while sending an SSE to the browser, then
- # the server will receive a +Last-Event-ID+ header with value equal to +id+.
- #
- # After setting an option in the constructor of the SSE object, all future
- # SSEs sent across the stream will use those options unless overridden.
- #
- # Example Usage:
- #
- # class MyController < ActionController::Base
- # include ActionController::Live
- #
- # def index
- # response.headers['Content-Type'] = 'text/event-stream'
- # sse = SSE.new(response.stream, retry: 300, event: "event-name")
- # sse.write({ name: 'John'})
- # sse.write({ name: 'John'}, id: 10)
- # sse.write({ name: 'John'}, id: 10, event: "other-event")
- # sse.write({ name: 'John'}, id: 10, event: "other-event", retry: 500)
- # ensure
- # sse.close
- # end
- # end
- #
- # Note: SSEs are not currently supported by IE. However, they are supported
- # by Chrome, Firefox, Opera, and Safari.
- class SSE
- WHITELISTED_OPTIONS = %w( retry event id )
-
- def initialize(stream, options = {})
- @stream = stream
- @options = options
- end
-
- def close
- @stream.close
- end
-
- def write(object, options = {})
- case object
- when String
- perform_write(object, options)
- else
- perform_write(ActiveSupport::JSON.encode(object), options)
- end
- end
-
- private
-
- def perform_write(json, options)
- current_options = @options.merge(options).stringify_keys
-
- WHITELISTED_OPTIONS.each do |option_name|
- if (option_value = current_options[option_name])
- @stream.write "#{option_name}: #{option_value}\n"
- end
- end
-
- message = json.gsub("\n".freeze, "\ndata: ".freeze)
- @stream.write "data: #{message}\n\n"
- end
- end
-
- class ClientDisconnected < RuntimeError
- end
-
- class Buffer < ActionDispatch::Response::Buffer #:nodoc:
- include MonitorMixin
-
- # Ignore that the client has disconnected.
- #
- # If this value is `true`, calling `write` after the client
- # disconnects will result in the written content being silently
- # discarded. If this value is `false` (the default), a
- # ClientDisconnected exception will be raised.
- attr_accessor :ignore_disconnect
-
- def initialize(response)
- @error_callback = lambda { true }
- @cv = new_cond
- @aborted = false
- @ignore_disconnect = false
- super(response, SizedQueue.new(10))
- end
-
- def write(string)
- unless @response.committed?
- @response.set_header "Cache-Control", "no-cache"
- @response.delete_header "Content-Length"
- end
-
- super
-
- unless connected?
- @buf.clear
-
- unless @ignore_disconnect
- # Raise ClientDisconnected, which is a RuntimeError (not an
- # IOError), because that's more appropriate for something beyond
- # the developer's control.
- raise ClientDisconnected, "client disconnected"
- end
- end
- end
-
- # Write a 'close' event to the buffer; the producer/writing thread
- # uses this to notify us that it's finished supplying content.
- #
- # See also #abort.
- def close
- synchronize do
- super
- @buf.push nil
- @cv.broadcast
- end
- end
-
- # Inform the producer/writing thread that the client has
- # disconnected; the reading thread is no longer interested in
- # anything that's being written.
- #
- # See also #close.
- def abort
- synchronize do
- @aborted = true
- @buf.clear
- end
- end
-
- # Is the client still connected and waiting for content?
- #
- # The result of calling `write` when this is `false` is determined
- # by `ignore_disconnect`.
- def connected?
- !@aborted
- end
-
- def on_error(&block)
- @error_callback = block
- end
-
- def call_on_error
- @error_callback.call
- end
-
- private
-
- def each_chunk(&block)
- loop do
- str = nil
- ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
- str = @buf.pop
- end
- break unless str
- yield str
- end
- end
- end
-
- class Response < ActionDispatch::Response #:nodoc: all
- private
-
- def before_committed
- super
- jar = request.cookie_jar
- # The response can be committed multiple times
- jar.write self unless committed?
- end
-
- def build_buffer(response, body)
- buf = Live::Buffer.new response
- body.each { |part| buf.write part }
- buf
- end
- end
-
- def process(name)
- t1 = Thread.current
- locals = t1.keys.map { |key| [key, t1[key]] }
-
- error = nil
- # This processes the action in a child thread. It lets us return the
- # response code and headers back up the Rack stack, and still process
- # the body in parallel with sending data to the client.
- new_controller_thread {
- ActiveSupport::Dependencies.interlock.running do
- t2 = Thread.current
-
- # Since we're processing the view in a different thread, copy the
- # thread locals from the main thread to the child thread. :'(
- locals.each { |k, v| t2[k] = v }
-
- begin
- super(name)
- rescue => e
- if @_response.committed?
- begin
- @_response.stream.write(ActionView::Base.streaming_completion_on_exception) if request.format == :html
- @_response.stream.call_on_error
- rescue => exception
- log_error(exception)
- ensure
- log_error(e)
- @_response.stream.close
- end
- else
- error = e
- end
- ensure
- @_response.commit!
- end
- end
- }
-
- ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
- @_response.await_commit
- end
-
- raise error if error
- end
-
- # Spawn a new thread to serve up the controller in. This is to get
- # around the fact that Rack isn't based around IOs and we need to use
- # a thread to stream data from the response bodies. Nobody should call
- # this method except in Rails internals. Seriously!
- def new_controller_thread # :nodoc:
- Thread.new {
- t2 = Thread.current
- t2.abort_on_exception = true
- yield
- }
- end
-
- def log_error(exception)
- logger = ActionController::Base.logger
- return unless logger
-
- logger.fatal do
- message = "\n#{exception.class} (#{exception.message}):\n"
- message << exception.annoted_source_code.to_s if exception.respond_to?(:annoted_source_code)
- message << " " << exception.backtrace.join("\n ")
- "#{message}\n\n"
- end
- end
-
- def response_body=(body)
- super
- response.close if response
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/mime_responds.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/mime_responds.rb
deleted file mode 100644
index 7b4c7b923e..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/mime_responds.rb
+++ /dev/null
@@ -1,311 +0,0 @@
-require "abstract_controller/collector"
-
-module ActionController #:nodoc:
- module MimeResponds
- # Without web-service support, an action which collects the data for displaying a list of people
- # might look something like this:
- #
- # def index
- # @people = Person.all
- # end
- #
- # That action implicitly responds to all formats, but formats can also be whitelisted:
- #
- # def index
- # @people = Person.all
- # respond_to :html, :js
- # end
- #
- # Here's the same action, with web-service support baked in:
- #
- # def index
- # @people = Person.all
- #
- # respond_to do |format|
- # format.html
- # format.js
- # format.xml { render xml: @people }
- # end
- # end
- #
- # What that says is, "if the client wants HTML or JS in response to this action, just respond as we
- # would have before, but if the client wants XML, return them the list of people in XML format."
- # (Rails determines the desired response format from the HTTP Accept header submitted by the client.)
- #
- # Supposing you have an action that adds a new person, optionally creating their company
- # (by name) if it does not already exist, without web-services, it might look like this:
- #
- # def create
- # @company = Company.find_or_create_by(name: params[:company][:name])
- # @person = @company.people.create(params[:person])
- #
- # redirect_to(person_list_url)
- # end
- #
- # Here's the same action, with web-service support baked in:
- #
- # def create
- # company = params[:person].delete(:company)
- # @company = Company.find_or_create_by(name: company[:name])
- # @person = @company.people.create(params[:person])
- #
- # respond_to do |format|
- # format.html { redirect_to(person_list_url) }
- # format.js
- # format.xml { render xml: @person.to_xml(include: @company) }
- # end
- # end
- #
- # If the client wants HTML, we just redirect them back to the person list. If they want JavaScript,
- # then it is an Ajax request and we render the JavaScript template associated with this action.
- # Lastly, if the client wants XML, we render the created person as XML, but with a twist: we also
- # include the person's company in the rendered XML, so you get something like this:
- #
- #
- # ...
- # ...
- #
- # ...
- # ...
- # ...
- #
- #
- #
- # Note, however, the extra bit at the top of that action:
- #
- # company = params[:person].delete(:company)
- # @company = Company.find_or_create_by(name: company[:name])
- #
- # This is because the incoming XML document (if a web-service request is in process) can only contain a
- # single root-node. So, we have to rearrange things so that the request looks like this (url-encoded):
- #
- # person[name]=...&person[company][name]=...&...
- #
- # And, like this (xml-encoded):
- #
- #
- # ...
- #
- # ...
- #
- #
- #
- # In other words, we make the request so that it operates on a single entity's person. Then, in the action,
- # we extract the company data from the request, find or create the company, and then create the new person
- # with the remaining data.
- #
- # Note that you can define your own XML parameter parser which would allow you to describe multiple entities
- # in a single request (i.e., by wrapping them all in a single root node), but if you just go with the flow
- # and accept Rails' defaults, life will be much easier.
- #
- # If you need to use a MIME type which isn't supported by default, you can register your own handlers in
- # +config/initializers/mime_types.rb+ as follows.
- #
- # Mime::Type.register "image/jpg", :jpg
- #
- # Respond to also allows you to specify a common block for different formats by using +any+:
- #
- # def index
- # @people = Person.all
- #
- # respond_to do |format|
- # format.html
- # format.any(:xml, :json) { render request.format.to_sym => @people }
- # end
- # end
- #
- # In the example above, if the format is xml, it will render:
- #
- # render xml: @people
- #
- # Or if the format is json:
- #
- # render json: @people
- #
- # Formats can have different variants.
- #
- # The request variant is a specialization of the request format, like :tablet,
- # :phone, or :desktop.
- #
- # We often want to render different html/json/xml templates for phones,
- # tablets, and desktop browsers. Variants make it easy.
- #
- # You can set the variant in a +before_action+:
- #
- # request.variant = :tablet if request.user_agent =~ /iPad/
- #
- # Respond to variants in the action just like you respond to formats:
- #
- # respond_to do |format|
- # format.html do |variant|
- # variant.tablet # renders app/views/projects/show.html+tablet.erb
- # variant.phone { extra_setup; render ... }
- # variant.none { special_setup } # executed only if there is no variant set
- # end
- # end
- #
- # Provide separate templates for each format and variant:
- #
- # app/views/projects/show.html.erb
- # app/views/projects/show.html+tablet.erb
- # app/views/projects/show.html+phone.erb
- #
- # When you're not sharing any code within the format, you can simplify defining variants
- # using the inline syntax:
- #
- # respond_to do |format|
- # format.js { render "trash" }
- # format.html.phone { redirect_to progress_path }
- # format.html.none { render "trash" }
- # end
- #
- # Variants also support common +any+/+all+ block that formats have.
- #
- # It works for both inline:
- #
- # respond_to do |format|
- # format.html.any { render html: "any" }
- # format.html.phone { render html: "phone" }
- # end
- #
- # and block syntax:
- #
- # respond_to do |format|
- # format.html do |variant|
- # variant.any(:tablet, :phablet){ render html: "any" }
- # variant.phone { render html: "phone" }
- # end
- # end
- #
- # You can also set an array of variants:
- #
- # request.variant = [:tablet, :phone]
- #
- # This will work similarly to formats and MIME types negotiation. If there
- # is no +:tablet+ variant declared, +:phone+ variant will be picked:
- #
- # respond_to do |format|
- # format.html.none
- # format.html.phone # this gets rendered
- # end
- def respond_to(*mimes)
- raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given?
-
- collector = Collector.new(mimes, request.variant)
- yield collector if block_given?
-
- if format = collector.negotiate_format(request)
- _process_format(format)
- _set_rendered_content_type format
- response = collector.response
- response.call if response
- else
- raise ActionController::UnknownFormat
- end
- end
-
- # A container for responses available from the current controller for
- # requests for different mime-types sent to a particular action.
- #
- # The public controller methods +respond_to+ may be called with a block
- # that is used to define responses to different mime-types, e.g.
- # for +respond_to+ :
- #
- # respond_to do |format|
- # format.html
- # format.xml { render xml: @people }
- # end
- #
- # In this usage, the argument passed to the block (+format+ above) is an
- # instance of the ActionController::MimeResponds::Collector class. This
- # object serves as a container in which available responses can be stored by
- # calling any of the dynamically generated, mime-type-specific methods such
- # as +html+, +xml+ etc on the Collector. Each response is represented by a
- # corresponding block if present.
- #
- # A subsequent call to #negotiate_format(request) will enable the Collector
- # to determine which specific mime-type it should respond with for the current
- # request, with this response then being accessible by calling #response.
- class Collector
- include AbstractController::Collector
- attr_accessor :format
-
- def initialize(mimes, variant = nil)
- @responses = {}
- @variant = variant
-
- mimes.each { |mime| @responses[Mime[mime]] = nil }
- end
-
- def any(*args, &block)
- if args.any?
- args.each { |type| send(type, &block) }
- else
- custom(Mime::ALL, &block)
- end
- end
- alias :all :any
-
- def custom(mime_type, &block)
- mime_type = Mime::Type.lookup(mime_type.to_s) unless mime_type.is_a?(Mime::Type)
- @responses[mime_type] ||= if block_given?
- block
- else
- VariantCollector.new(@variant)
- end
- end
-
- def response
- response = @responses.fetch(format, @responses[Mime::ALL])
- if response.is_a?(VariantCollector) # `format.html.phone` - variant inline syntax
- response.variant
- elsif response.nil? || response.arity == 0 # `format.html` - just a format, call its block
- response
- else # `format.html{ |variant| variant.phone }` - variant block syntax
- variant_collector = VariantCollector.new(@variant)
- response.call(variant_collector) # call format block with variants collector
- variant_collector.variant
- end
- end
-
- def negotiate_format(request)
- @format = request.negotiate_mime(@responses.keys)
- end
-
- class VariantCollector #:nodoc:
- def initialize(variant = nil)
- @variant = variant
- @variants = {}
- end
-
- def any(*args, &block)
- if block_given?
- if args.any? && args.none? { |a| a == @variant }
- args.each { |v| @variants[v] = block }
- else
- @variants[:any] = block
- end
- end
- end
- alias :all :any
-
- def method_missing(name, *args, &block)
- @variants[name] = block if block_given?
- end
-
- def variant
- if @variant.empty?
- @variants[:none] || @variants[:any]
- else
- @variants[variant_key]
- end
- end
-
- private
- def variant_key
- @variant.find { |variant| @variants.key?(variant) } || :any
- end
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/parameter_encoding.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/parameter_encoding.rb
deleted file mode 100644
index ecc691619e..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/parameter_encoding.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-module ActionController
- # Specify binary encoding for parameters for a given action.
- module ParameterEncoding
- extend ActiveSupport::Concern
-
- module ClassMethods
- def inherited(klass) # :nodoc:
- super
- klass.setup_param_encode
- end
-
- def setup_param_encode # :nodoc:
- @_parameter_encodings = {}
- end
-
- def binary_params_for?(action) # :nodoc:
- @_parameter_encodings[action.to_s]
- end
-
- # Specify that a given action's parameters should all be encoded as
- # ASCII-8BIT (it "skips" the encoding default of UTF-8).
- #
- # For example, a controller would use it like this:
- #
- # class RepositoryController < ActionController::Base
- # skip_parameter_encoding :show
- #
- # def show
- # @repo = Repository.find_by_filesystem_path params[:file_path]
- #
- # # `repo_name` is guaranteed to be UTF-8, but was ASCII-8BIT, so
- # # tag it as such
- # @repo_name = params[:repo_name].force_encoding 'UTF-8'
- # end
- #
- # def index
- # @repositories = Repository.all
- # end
- # end
- #
- # The show action in the above controller would have all parameter values
- # encoded as ASCII-8BIT. This is useful in the case where an application
- # must handle data but encoding of the data is unknown, like file system data.
- def skip_parameter_encoding(action)
- @_parameter_encodings[action.to_s] = true
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/params_wrapper.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/params_wrapper.rb
deleted file mode 100644
index e8c69c98a9..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/params_wrapper.rb
+++ /dev/null
@@ -1,289 +0,0 @@
-require "active_support/core_ext/hash/slice"
-require "active_support/core_ext/hash/except"
-require "active_support/core_ext/module/anonymous"
-require "action_dispatch/http/mime_type"
-
-module ActionController
- # Wraps the parameters hash into a nested hash. This will allow clients to
- # submit requests without having to specify any root elements.
- #
- # This functionality is enabled in +config/initializers/wrap_parameters.rb+
- # and can be customized.
- #
- # You could also turn it on per controller by setting the format array to
- # a non-empty array:
- #
- # class UsersController < ApplicationController
- # wrap_parameters format: [:json, :xml, :url_encoded_form, :multipart_form]
- # end
- #
- # If you enable +ParamsWrapper+ for +:json+ format, instead of having to
- # send JSON parameters like this:
- #
- # {"user": {"name": "Konata"}}
- #
- # You can send parameters like this:
- #
- # {"name": "Konata"}
- #
- # And it will be wrapped into a nested hash with the key name matching the
- # controller's name. For example, if you're posting to +UsersController+,
- # your new +params+ hash will look like this:
- #
- # {"name" => "Konata", "user" => {"name" => "Konata"}}
- #
- # You can also specify the key in which the parameters should be wrapped to,
- # and also the list of attributes it should wrap by using either +:include+ or
- # +:exclude+ options like this:
- #
- # class UsersController < ApplicationController
- # wrap_parameters :person, include: [:username, :password]
- # end
- #
- # On Active Record models with no +:include+ or +:exclude+ option set,
- # it will only wrap the parameters returned by the class method
- # attribute_names.
- #
- # If you're going to pass the parameters to an +ActiveModel+ object (such as
- # User.new(params[:user])), you might consider passing the model class to
- # the method instead. The +ParamsWrapper+ will actually try to determine the
- # list of attribute names from the model and only wrap those attributes:
- #
- # class UsersController < ApplicationController
- # wrap_parameters Person
- # end
- #
- # You still could pass +:include+ and +:exclude+ to set the list of attributes
- # you want to wrap.
- #
- # By default, if you don't specify the key in which the parameters would be
- # wrapped to, +ParamsWrapper+ will actually try to determine if there's
- # a model related to it or not. This controller, for example:
- #
- # class Admin::UsersController < ApplicationController
- # end
- #
- # will try to check if Admin::User or +User+ model exists, and use it to
- # determine the wrapper key respectively. If both models don't exist,
- # it will then fallback to use +user+ as the key.
- module ParamsWrapper
- extend ActiveSupport::Concern
-
- EXCLUDE_PARAMETERS = %w(authenticity_token _method utf8)
-
- require "mutex_m"
-
- class Options < Struct.new(:name, :format, :include, :exclude, :klass, :model) # :nodoc:
- include Mutex_m
-
- def self.from_hash(hash)
- name = hash[:name]
- format = Array(hash[:format])
- include = hash[:include] && Array(hash[:include]).collect(&:to_s)
- exclude = hash[:exclude] && Array(hash[:exclude]).collect(&:to_s)
- new name, format, include, exclude, nil, nil
- end
-
- def initialize(name, format, include, exclude, klass, model) # :nodoc:
- super
- @include_set = include
- @name_set = name
- end
-
- def model
- super || synchronize { super || self.model = _default_wrap_model }
- end
-
- def include
- return super if @include_set
-
- m = model
- synchronize do
- return super if @include_set
-
- @include_set = true
-
- unless super || exclude
- if m.respond_to?(:attribute_names) && m.attribute_names.any?
- if m.respond_to?(:stored_attributes) && !m.stored_attributes.empty?
- self.include = m.attribute_names + m.stored_attributes.values.flatten.map(&:to_s)
- else
- self.include = m.attribute_names
- end
- end
- end
- end
- end
-
- def name
- return super if @name_set
-
- m = model
- synchronize do
- return super if @name_set
-
- @name_set = true
-
- unless super || klass.anonymous?
- self.name = m ? m.to_s.demodulize.underscore :
- klass.controller_name.singularize
- end
- end
- end
-
- private
- # Determine the wrapper model from the controller's name. By convention,
- # this could be done by trying to find the defined model that has the
- # same singular name as the controller. For example, +UsersController+
- # will try to find if the +User+ model exists.
- #
- # This method also does namespace lookup. Foo::Bar::UsersController will
- # try to find Foo::Bar::User, Foo::User and finally User.
- def _default_wrap_model
- return nil if klass.anonymous?
- model_name = klass.name.sub(/Controller$/, "").classify
-
- begin
- if model_klass = model_name.safe_constantize
- model_klass
- else
- namespaces = model_name.split("::")
- namespaces.delete_at(-2)
- break if namespaces.last == model_name
- model_name = namespaces.join("::")
- end
- end until model_klass
-
- model_klass
- end
- end
-
- included do
- class_attribute :_wrapper_options
- self._wrapper_options = Options.from_hash(format: [])
- end
-
- module ClassMethods
- def _set_wrapper_options(options)
- self._wrapper_options = Options.from_hash(options)
- end
-
- # Sets the name of the wrapper key, or the model which +ParamsWrapper+
- # would use to determine the attribute names from.
- #
- # ==== Examples
- # wrap_parameters format: :xml
- # # enables the parameter wrapper for XML format
- #
- # wrap_parameters :person
- # # wraps parameters into +params[:person]+ hash
- #
- # wrap_parameters Person
- # # wraps parameters by determining the wrapper key from Person class
- # (+person+, in this case) and the list of attribute names
- #
- # wrap_parameters include: [:username, :title]
- # # wraps only +:username+ and +:title+ attributes from parameters.
- #
- # wrap_parameters false
- # # disables parameters wrapping for this controller altogether.
- #
- # ==== Options
- # * :format - The list of formats in which the parameters wrapper
- # will be enabled.
- # * :include - The list of attribute names which parameters wrapper
- # will wrap into a nested hash.
- # * :exclude - The list of attribute names which parameters wrapper
- # will exclude from a nested hash.
- def wrap_parameters(name_or_model_or_options, options = {})
- model = nil
-
- case name_or_model_or_options
- when Hash
- options = name_or_model_or_options
- when false
- options = options.merge(format: [])
- when Symbol, String
- options = options.merge(name: name_or_model_or_options)
- else
- model = name_or_model_or_options
- end
-
- opts = Options.from_hash _wrapper_options.to_h.slice(:format).merge(options)
- opts.model = model
- opts.klass = self
-
- self._wrapper_options = opts
- end
-
- # Sets the default wrapper key or model which will be used to determine
- # wrapper key and attribute names. Called automatically when the
- # module is inherited.
- def inherited(klass)
- if klass._wrapper_options.format.any?
- params = klass._wrapper_options.dup
- params.klass = klass
- klass._wrapper_options = params
- end
- super
- end
- end
-
- # Performs parameters wrapping upon the request. Called automatically
- # by the metal call stack.
- def process_action(*args)
- if _wrapper_enabled?
- if request.parameters[_wrapper_key].present?
- wrapped_hash = _extract_parameters(request.parameters)
- else
- wrapped_hash = _wrap_parameters request.request_parameters
- end
-
- wrapped_keys = request.request_parameters.keys
- wrapped_filtered_hash = _wrap_parameters request.filtered_parameters.slice(*wrapped_keys)
-
- # This will make the wrapped hash accessible from controller and view.
- request.parameters.merge! wrapped_hash
- request.request_parameters.merge! wrapped_hash
-
- # This will display the wrapped hash in the log file.
- request.filtered_parameters.merge! wrapped_filtered_hash
- end
- super
- end
-
- private
-
- # Returns the wrapper key which will be used to store wrapped parameters.
- def _wrapper_key
- _wrapper_options.name
- end
-
- # Returns the list of enabled formats.
- def _wrapper_formats
- _wrapper_options.format
- end
-
- # Returns the list of parameters which will be selected for wrapped.
- def _wrap_parameters(parameters)
- { _wrapper_key => _extract_parameters(parameters) }
- end
-
- def _extract_parameters(parameters)
- if include_only = _wrapper_options.include
- parameters.slice(*include_only)
- else
- exclude = _wrapper_options.exclude || []
- parameters.except(*(exclude + EXCLUDE_PARAMETERS))
- end
- end
-
- # Checks if we should perform parameters wrapping.
- def _wrapper_enabled?
- return false unless request.has_content_type?
-
- ref = request.content_mime_type.ref
- _wrapper_formats.include?(ref) && _wrapper_key && !request.request_parameters.key?(_wrapper_key)
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/redirecting.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/redirecting.rb
deleted file mode 100644
index fdfe82f96b..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/redirecting.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-module ActionController
- module Redirecting
- extend ActiveSupport::Concern
-
- include AbstractController::Logger
- include ActionController::UrlFor
-
- # Redirects the browser to the target specified in +options+. This parameter can be any one of:
- #
- # * Hash - The URL will be generated by calling url_for with the +options+.
- # * Record - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record.
- # * String starting with protocol:// (like http://) or a protocol relative reference (like //) - Is passed straight through as the target for redirection.
- # * String not containing a protocol - The current protocol and host is prepended to the string.
- # * Proc - A block that will be executed in the controller's context. Should return any option accepted by +redirect_to+.
- #
- # === Examples:
- #
- # redirect_to action: "show", id: 5
- # redirect_to @post
- # redirect_to "http://www.rubyonrails.org"
- # redirect_to "/images/screenshot.jpg"
- # redirect_to posts_url
- # redirect_to proc { edit_post_url(@post) }
- #
- # The redirection happens as a 302 Found header unless otherwise specified using the :status option:
- #
- # redirect_to post_url(@post), status: :found
- # redirect_to action: 'atom', status: :moved_permanently
- # redirect_to post_url(@post), status: 301
- # redirect_to action: 'atom', status: 302
- #
- # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an
- # integer, or a symbol representing the downcased, underscored and symbolized description.
- # Note that the status code must be a 3xx HTTP code, or redirection will not occur.
- #
- # If you are using XHR requests other than GET or POST and redirecting after the
- # request then some browsers will follow the redirect using the original request
- # method. This may lead to undesirable behavior such as a double DELETE. To work
- # around this you can return a 303 See Other status code which will be
- # followed using a GET request.
- #
- # redirect_to posts_url, status: :see_other
- # redirect_to action: 'index', status: 303
- #
- # It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names
- # +alert+ and +notice+ as well as a general purpose +flash+ bucket.
- #
- # redirect_to post_url(@post), alert: "Watch it, mister!"
- # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road"
- # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id }
- # redirect_to({ action: 'atom' }, alert: "Something serious happened")
- #
- # Statements after +redirect_to+ in our controller get executed, so +redirect_to+ doesn't stop the execution of the function.
- # To terminate the execution of the function immediately after the +redirect_to+, use return.
- # redirect_to post_url(@post) and return
- def redirect_to(options = {}, response_status = {})
- raise ActionControllerError.new("Cannot redirect to nil!") unless options
- raise AbstractController::DoubleRenderError if response_body
-
- self.status = _extract_redirect_to_status(options, response_status)
- self.location = _compute_redirect_to_location(request, options)
- self.response_body = "You are being redirected."
- end
-
- # Redirects the browser to the page that issued the request (the referrer)
- # if possible, otherwise redirects to the provided default fallback
- # location.
- #
- # The referrer information is pulled from the HTTP `Referer` (sic) header on
- # the request. This is an optional header and its presence on the request is
- # subject to browser security settings and user preferences. If the request
- # is missing this header, the fallback_location will be used.
- #
- # redirect_back fallback_location: { action: "show", id: 5 }
- # redirect_back fallback_location: @post
- # redirect_back fallback_location: "http://www.rubyonrails.org"
- # redirect_back fallback_location: "/images/screenshot.jpg"
- # redirect_back fallback_location: posts_url
- # redirect_back fallback_location: proc { edit_post_url(@post) }
- #
- # All options that can be passed to redirect_to are accepted as
- # options and the behavior is identical.
- def redirect_back(fallback_location:, **args)
- if referer = request.headers["Referer"]
- redirect_to referer, **args
- else
- redirect_to fallback_location, **args
- end
- end
-
- def _compute_redirect_to_location(request, options) #:nodoc:
- case options
- # The scheme name consist of a letter followed by any combination of
- # letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
- # characters; and is terminated by a colon (":").
- # See http://tools.ietf.org/html/rfc3986#section-3.1
- # The protocol relative scheme starts with a double slash "//".
- when /\A([a-z][a-z\d\-+\.]*:|\/\/).*/i
- options
- when String
- request.protocol + request.host_with_port + options
- when Proc
- _compute_redirect_to_location request, options.call
- else
- url_for(options)
- end.delete("\0\r\n")
- end
- module_function :_compute_redirect_to_location
- public :_compute_redirect_to_location
-
- private
- def _extract_redirect_to_status(options, response_status)
- if options.is_a?(Hash) && options.key?(:status)
- Rack::Utils.status_code(options.delete(:status))
- elsif response_status.key?(:status)
- Rack::Utils.status_code(response_status[:status])
- else
- 302
- end
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/renderers.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/renderers.rb
deleted file mode 100644
index 733aca195d..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/renderers.rb
+++ /dev/null
@@ -1,180 +0,0 @@
-require "set"
-
-module ActionController
- # See Renderers.add
- def self.add_renderer(key, &block)
- Renderers.add(key, &block)
- end
-
- # See Renderers.remove
- def self.remove_renderer(key)
- Renderers.remove(key)
- end
-
- # See Responder#api_behavior
- class MissingRenderer < LoadError
- def initialize(format)
- super "No renderer defined for format: #{format}"
- end
- end
-
- module Renderers
- extend ActiveSupport::Concern
-
- # A Set containing renderer names that correspond to available renderer procs.
- # Default values are :json, :js, :xml.
- RENDERERS = Set.new
-
- included do
- class_attribute :_renderers
- self._renderers = Set.new.freeze
- end
-
- # Used in ActionController::Base
- # and ActionController::API to include all
- # renderers by default.
- module All
- extend ActiveSupport::Concern
- include Renderers
-
- included do
- self._renderers = RENDERERS
- end
- end
-
- # Adds a new renderer to call within controller actions.
- # A renderer is invoked by passing its name as an option to
- # AbstractController::Rendering#render. To create a renderer
- # pass it a name and a block. The block takes two arguments, the first
- # is the value paired with its key and the second is the remaining
- # hash of options passed to +render+.
- #
- # Create a csv renderer:
- #
- # ActionController::Renderers.add :csv do |obj, options|
- # filename = options[:filename] || 'data'
- # str = obj.respond_to?(:to_csv) ? obj.to_csv : obj.to_s
- # send_data str, type: Mime[:csv],
- # disposition: "attachment; filename=#{filename}.csv"
- # end
- #
- # Note that we used Mime[:csv] for the csv mime type as it comes with Rails.
- # For a custom renderer, you'll need to register a mime type with
- # Mime::Type.register.
- #
- # To use the csv renderer in a controller action:
- #
- # def show
- # @csvable = Csvable.find(params[:id])
- # respond_to do |format|
- # format.html
- # format.csv { render csv: @csvable, filename: @csvable.name }
- # end
- # end
- def self.add(key, &block)
- define_method(_render_with_renderer_method_name(key), &block)
- RENDERERS << key.to_sym
- end
-
- # This method is the opposite of add method.
- #
- # To remove a csv renderer:
- #
- # ActionController::Renderers.remove(:csv)
- def self.remove(key)
- RENDERERS.delete(key.to_sym)
- method_name = _render_with_renderer_method_name(key)
- remove_method(method_name) if method_defined?(method_name)
- end
-
- def self._render_with_renderer_method_name(key)
- "_render_with_renderer_#{key}"
- end
-
- module ClassMethods
- # Adds, by name, a renderer or renderers to the +_renderers+ available
- # to call within controller actions.
- #
- # It is useful when rendering from an ActionController::Metal controller or
- # otherwise to add an available renderer proc to a specific controller.
- #
- # Both ActionController::Base and ActionController::API
- # include ActionController::Renderers::All, making all renderers
- # available in the controller. See Renderers::RENDERERS and Renderers.add.
- #
- # Since ActionController::Metal controllers cannot render, the controller
- # must include AbstractController::Rendering, ActionController::Rendering,
- # and ActionController::Renderers, and have at least one renderer.
- #
- # Rather than including ActionController::Renderers::All and including all renderers,
- # you may specify which renderers to include by passing the renderer name or names to
- # +use_renderers+. For example, a controller that includes only the :json renderer
- # (+_render_with_renderer_json+) might look like:
- #
- # class MetalRenderingController < ActionController::Metal
- # include AbstractController::Rendering
- # include ActionController::Rendering
- # include ActionController::Renderers
- #
- # use_renderers :json
- #
- # def show
- # render json: record
- # end
- # end
- #
- # You must specify a +use_renderer+, else the +controller.renderer+ and
- # +controller._renderers+ will be nil, and the action will fail.
- def use_renderers(*args)
- renderers = _renderers + args
- self._renderers = renderers.freeze
- end
- alias use_renderer use_renderers
- end
-
- # Called by +render+ in AbstractController::Rendering
- # which sets the return value as the +response_body+.
- #
- # If no renderer is found, +super+ returns control to
- # ActionView::Rendering.render_to_body, if present.
- def render_to_body(options)
- _render_to_body_with_renderer(options) || super
- end
-
- def _render_to_body_with_renderer(options)
- _renderers.each do |name|
- if options.key?(name)
- _process_options(options)
- method_name = Renderers._render_with_renderer_method_name(name)
- return send(method_name, options.delete(name), options)
- end
- end
- nil
- end
-
- add :json do |json, options|
- json = json.to_json(options) unless json.kind_of?(String)
-
- if options[:callback].present?
- if content_type.nil? || content_type == Mime[:json]
- self.content_type = Mime[:js]
- end
-
- "/**/#{options[:callback]}(#{json})"
- else
- self.content_type ||= Mime[:json]
- json
- end
- end
-
- add :js do |js, options|
- self.content_type ||= Mime[:js]
- js.respond_to?(:to_js) ? js.to_js(options) : js
- end
-
- add :xml do |xml, options|
- self.content_type ||= Mime[:xml]
- xml.respond_to?(:to_xml) ? xml.to_xml(options) : xml
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/rendering.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/rendering.rb
deleted file mode 100644
index 67f207afc2..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/rendering.rb
+++ /dev/null
@@ -1,122 +0,0 @@
-require "active_support/core_ext/string/filters"
-
-module ActionController
- module Rendering
- extend ActiveSupport::Concern
-
- RENDER_FORMATS_IN_PRIORITY = [:body, :plain, :html]
-
- module ClassMethods
- # Documentation at ActionController::Renderer#render
- delegate :render, to: :renderer
-
- # Returns a renderer instance (inherited from ActionController::Renderer)
- # for the controller.
- attr_reader :renderer
-
- def setup_renderer! # :nodoc:
- @renderer = Renderer.for(self)
- end
-
- def inherited(klass)
- klass.setup_renderer!
- super
- end
- end
-
- # Before processing, set the request formats in current controller formats.
- def process_action(*) #:nodoc:
- self.formats = request.formats.map(&:ref).compact
- super
- end
-
- # Check for double render errors and set the content_type after rendering.
- def render(*args) #:nodoc:
- raise ::AbstractController::DoubleRenderError if response_body
- super
- end
-
- # Overwrite render_to_string because body can now be set to a Rack body.
- def render_to_string(*)
- result = super
- if result.respond_to?(:each)
- string = ""
- result.each { |r| string << r }
- string
- else
- result
- end
- end
-
- def render_to_body(options = {})
- super || _render_in_priorities(options) || " "
- end
-
- private
-
- def _process_variant(options)
- if defined?(request) && !request.nil? && request.variant.present?
- options[:variant] = request.variant
- end
- end
-
- def _render_in_priorities(options)
- RENDER_FORMATS_IN_PRIORITY.each do |format|
- return options[format] if options.key?(format)
- end
-
- nil
- end
-
- def _set_html_content_type
- self.content_type = Mime[:html].to_s
- end
-
- def _set_rendered_content_type(format)
- if format && !response.content_type
- self.content_type = format.to_s
- end
- end
-
- # Normalize arguments by catching blocks and setting them on :update.
- def _normalize_args(action = nil, options = {}, &blk)
- options = super
- options[:update] = blk if block_given?
- options
- end
-
- # Normalize both text and status options.
- def _normalize_options(options)
- _normalize_text(options)
-
- if options[:html]
- options[:html] = ERB::Util.html_escape(options[:html])
- end
-
- if options[:status]
- options[:status] = Rack::Utils.status_code(options[:status])
- end
-
- super
- end
-
- def _normalize_text(options)
- RENDER_FORMATS_IN_PRIORITY.each do |format|
- if options.key?(format) && options[format].respond_to?(:to_text)
- options[format] = options[format].to_text
- end
- end
- end
-
- # Process controller specific options, as status, content-type and location.
- def _process_options(options)
- status, content_type, location = options.values_at(:status, :content_type, :location)
-
- self.status = status if status
- self.content_type = content_type if content_type
- headers["Location"] = url_for(location) if location
-
- super
- end
- end
-end
diff --git a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/request_forgery_protection.rb b/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/request_forgery_protection.rb
deleted file mode 100644
index 5051c02a62..0000000000
--- a/debian/gems-compat/actionpack-5.1.7/lib/action_controller/metal/request_forgery_protection.rb
+++ /dev/null
@@ -1,418 +0,0 @@
-require "rack/session/abstract/id"
-require "action_controller/metal/exceptions"
-require "active_support/security_utils"
-
-module ActionController #:nodoc:
- class InvalidAuthenticityToken < ActionControllerError #:nodoc:
- end
-
- class InvalidCrossOriginRequest < ActionControllerError #:nodoc:
- end
-
- # Controller actions are protected from Cross-Site Request Forgery (CSRF) attacks
- # by including a token in the rendered HTML for your application. This token is
- # stored as a random string in the session, to which an attacker does not have
- # access. When a request reaches your application, \Rails verifies the received
- # token with the token in the session. All requests are checked except GET requests
- # as these should be idempotent. Keep in mind that all session-oriented requests
- # should be CSRF protected, including JavaScript and HTML requests.
- #
- # Since HTML and JavaScript requests are typically made from the browser, we
- # need to ensure to verify request authenticity for the web browser. We can
- # use session-oriented authentication for these types of requests, by using
- # the `protect_from_forgery` method in our controllers.
- #
- # GET requests are not protected since they don't have side effects like writing
- # to the database and don't leak sensitive information. JavaScript requests are
- # an exception: a third-party site can use a