diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..bab620de0c88a4ab058aea125ff8d987b61f9608 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore Byebug command history file. +.byebug_history diff --git a/.gitmodules b/.gitmodules index 22f74c6281d0b79d92f4445faa91ae75ee1adcd0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "de"] - path = de - url = https://git.tchncs.de/Illuna-Minetest/illuna-minetest.tk.git diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000000000000000000000000000000000..59b117a124b775a2434136feeec4fb965d7b3faf --- /dev/null +++ b/Gemfile @@ -0,0 +1,21 @@ +source 'https://rubygems.org' + +gem 'geocoder' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.0.0' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.0' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' + +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000000000000000000000000000000000..4a136967d8641362580ec2bea3ec233ade669724 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,141 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.0.0) + actionpack (= 5.0.0) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.0) + actionview (= 5.0.0) + activesupport (= 5.0.0) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.0) + activesupport (= 5.0.0) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (5.0.0) + activesupport (= 5.0.0) + globalid (>= 0.3.6) + activemodel (5.0.0) + activesupport (= 5.0.0) + activerecord (5.0.0) + activemodel (= 5.0.0) + activesupport (= 5.0.0) + arel (~> 7.0) + activesupport (5.0.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (7.0.0) + builder (3.2.2) + concurrent-ruby (1.0.2) + erubis (2.7.0) + execjs (2.7.0) + geocoder (1.3.7) + globalid (0.3.6) + activesupport (>= 4.1.0) + i18n (0.7.0) + jquery-rails (4.1.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.4) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.0) + nio4r (1.2.1) + nokogiri (1.6.8) + mini_portile2 (~> 2.1.0) + pkg-config (~> 1.1.7) + pkg-config (1.1.7) + puma (3.4.0) + rack (2.0.1) + rack-test (0.6.3) + rack (>= 1.0) + rails (5.0.0) + actioncable (= 5.0.0) + actionmailer (= 5.0.0) + actionpack (= 5.0.0) + actionview (= 5.0.0) + activejob (= 5.0.0) + activemodel (= 5.0.0) + activerecord (= 5.0.0) + activesupport (= 5.0.0) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.0) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) + nokogiri (~> 1.6.0) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.0.0) + actionpack (= 5.0.0) + activesupport (= 5.0.0) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (11.2.2) + sass (3.4.22) + sass-rails (5.0.5) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sprockets (3.6.3) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.1.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.5) + turbolinks (5.0.0) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.0) + execjs (>= 0.3.0, < 3) + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + +PLATFORMS + ruby + +DEPENDENCIES + geocoder + jquery-rails + puma (~> 3.0) + rails (~> 5.0.0) + sass-rails (~> 5.0) + sqlite3 + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + +BUNDLED WITH + 1.12.5 diff --git a/LICENSE b/LICENSE index 9ef4c6e35c9cd240ce5f919be99ae73f9bd883e5..f561c3e03692e1d1980e81f65cfb03dd75b7bab5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ + + The MIT License (MIT) Copyright (c) 2016 the World of Illuna @@ -19,3 +21,4 @@ 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/Rakefile b/Rakefile new file mode 100644 index 0000000000000000000000000000000000000000..e85f913914bd9d1342eae4cdd97b5520733a592a --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/admin/disk.html b/admin/disk.html deleted file mode 100644 index 1000eff69232ce93b6179881d79aec9e95b43315..0000000000000000000000000000000000000000 --- a/admin/disk.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
- -
- - -
-
-
-
- - - - - - - - diff --git a/admin/downloads.html b/admin/downloads.html deleted file mode 100644 index f6f938574cc4d8f2905a564f9c705bc864f5762a..0000000000000000000000000000000000000000 --- a/admin/downloads.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
-
- - -
-
-
-
- - - - - - - - diff --git a/admin/home.html b/admin/home.html deleted file mode 100644 index 4728d471c1200166d5354d1774210619bcd0b455..0000000000000000000000000000000000000000 --- a/admin/home.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
- -
- - - -
-
-
-
- - - - - - - - diff --git a/admin/ping.html b/admin/ping.html deleted file mode 100644 index 925c73595e96b068dc991004fc21b9dc008ede92..0000000000000000000000000000000000000000 --- a/admin/ping.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
- -
- tchncs2 -> illuna-minetest
- - -
- tchncs2 -> google
- - -
-
-
-
- - - - - - - - diff --git a/admin/player.html b/admin/player.html deleted file mode 100644 index 8fd09731e66faed66c762e43a164f030d857253e..0000000000000000000000000000000000000000 --- a/admin/player.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
- -
- - -
-
-
-
- - - - - - - - diff --git a/admin/uptime.html b/admin/uptime.html deleted file mode 100644 index 758315768d60bbc78df7b82d9fda83fb1e8c4729..0000000000000000000000000000000000000000 --- a/admin/uptime.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - ..:: Illuna Minetest - Admin ::.. - - - - - - - -
-
-
- -
- Minetest
- - -
- Server
- - - -
-
-
-
- - - - - - - - - - - - diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000000000000000000000000000000000000..b16e53d6d56d262ebcd7692c54616a9df2a30f8b --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/app/assets/images/.keep b/app/assets/images/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000000000000000000000000000000000000..b12018d099eef7ddf93907f0a87cf38c522d2ebd --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js new file mode 100644 index 0000000000000000000000000000000000000000..71ee1e66de2ca69297c0e3434f452b3a09e26e9c --- /dev/null +++ b/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// 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/app/assets/javascripts/channels/.keep b/app/assets/javascripts/channels/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000000000000000000000000000000000000..0ebd7fe8299ebee6f56fa726f834e4264d27d39d --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 0000000000000000000000000000000000000000..f0ddc6846ae428e58ea9741cadd1e1c3a11bb967 --- /dev/null +++ b/app/assets/stylesheets/home.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the home controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/screenshots.scss b/app/assets/stylesheets/screenshots.scss new file mode 100644 index 0000000000000000000000000000000000000000..8eb2c4530f82cb66223a558047fc8e9a59d497ca --- /dev/null +++ b/app/assets/stylesheets/screenshots.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the screenshots controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000000000000000000000000000000000000..d67269728300b9dac6a4a0db443ece02d7b6c513 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000000000000000000000000000000000000..0ff5442f476f98d578f77221b57164cffcf08de0 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..0fbf9507cf791bb754c25094c9cd49a8be4463d2 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,29 @@ +class ApplicationController < ActionController::Base + before_action :set_locale + # thanks to https://www.sitepoint.com/go-global-rails-i18n/ + def set_locale + if cookies[:educator_locale] && I18n.available_locales.include?(cookies[:educator_locale].to_sym) + l = cookies[:educator_locale].to_sym + else + begin + country_code = request.location.country_code + if country_code + country_code = country_code.downcase.to_sym + [:de, :en].include?(country_code) ? l = :de : l = :en + else + l = I18n.default_locale # use default locale if cannot retrieve this info + end + rescue + l = I18n.default_locale + ensure + cookies.permanent[:educator_locale] = l + end + end + I18n.locale = l + end + protect_from_forgery with: :exception + #def default_url_options(options={}) + #logger.debug "default_url_options is passed options: #{options.inspect}\n" + # { :locale => I18n.locale } + #end +end diff --git a/app/controllers/concerns/.keep b/app/controllers/concerns/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..8e5eecfa3a59618070de52521983db640b294e17 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,6 @@ +class HomeController < ApplicationController + partial_dir = Rails.root.join("app", "views", "home") + def index + render :index + end +end diff --git a/app/controllers/screenshots_controller.rb b/app/controllers/screenshots_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..7cb76f39af2b5325a0d2181be9a35a05eb8d6482 --- /dev/null +++ b/app/controllers/screenshots_controller.rb @@ -0,0 +1,2 @@ +class ScreenshotsController < ApplicationController + end diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..9926e3a6132bcf76ae6e14d0169f9cc5139db0f5 --- /dev/null +++ b/app/controllers/settings_controller.rb @@ -0,0 +1,8 @@ +class SettingsController < ApplicationController + def change_locale + l = params[:locale].to_s.strip.to_sym + l = I18n.default_locale unless I18n.available_locales.include?(l) + cookies.permanent[:educator_locale] = l + redirect_to request.referer || root_url + end +end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..d571bd7444020f82851816cafe1a251ce8d3135b --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,5 @@ +module ApplicationHelper + def is_active(action) + params[:action] == action ? "active" : nil + end +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..23de56ac60aace0b1cc98dba68407ddcecc7614a --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/helpers/screenshots_helper.rb b/app/helpers/screenshots_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..9d6a138413e132e746c7ef60c4f81920e88954c8 --- /dev/null +++ b/app/helpers/screenshots_helper.rb @@ -0,0 +1,2 @@ +module ScreenshotsHelper +end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000000000000000000000000000000000000..a009ace51ccf46bab4ac06100a225a1fa1801e65 --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000000000000000000000000000000000000..286b2239d139960190594225e0134fe1a5c05370 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000000000000000000000000000000000000..10a4cba84df37181f4cf310fd85d8f0aaa5d90ba --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/concerns/.keep b/app/models/concerns/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/views/home/contact.html.erb b/app/views/home/contact.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..47e11ad4b435b0880696aa27c827fbee7ae8c294 --- /dev/null +++ b/app/views/home/contact.html.erb @@ -0,0 +1,230 @@ +<% content_for :title, t('home.contact.title') %> +
+
+

<%= t('home.contact.headline') %>

+ + + + + + + + + + + + + + + + + + + + +
+

<%= t('home.contact.headline2') %>

+

<%= t('home.contact.head_connected') %>

+
+

+ XMPP + + IRC + + Minetest +

+
+

<%= t('home.contact.head_real_talk') %>

+ + mumble + +
+
+

<%= t('home.contact.head_groups') %>

+
+
+

<%= t('home.contact.head_threads') %>

+ + mt_en + + mt_de +
+
+

<%= t('home.contact.head_social') %>

+ + diaspora + + + twitter + +
+
+
+ + + + + + + + diff --git a/app/views/home/donate.html.erb b/app/views/home/donate.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..37409adff903e8f3c2093325c893c1d0b7a7e581 --- /dev/null +++ b/app/views/home/donate.html.erb @@ -0,0 +1,67 @@ +<% content_for :title, t('home.donate.title') %> +<%= content_for(:license) do %> +
  • Impressum
  • +
  • |
  • +<% end %> +
    +
    +
    + +

    <%= t('home.donate.description') %>

    +
    + + +
    +
    +
    + +
    +

    <%= t('home.donate.amazing') %>

    +
    +
    +
    59.01%

    +
    +
    +

    + +
    +

    <%= t('home.donate.cool_idea_html') %>

    +
    + +
    + diff --git a/app/views/home/faq.html.erb b/app/views/home/faq.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..cf0bfc9a4ede4f4d8e597e12d98f15f9c59ed884 --- /dev/null +++ b/app/views/home/faq.html.erb @@ -0,0 +1,40 @@ +<% content_for :title, t('home.faq.title') %> +
    +

    <%=t('home.faq.headline')%>

    +

    <%=t('home.faq.password_html')%>

    +
    +

    <%=t('home.faq.interact_html')%>

    +
    +

    <%=t('home.faq.texturepacks_html')%>

    + + +
    +
    +

    <%=t('home.faq.disconnect_html')%>

    +
    +

    <%=t('home.faq.buckets_html')%>

    +
    +

    <%=t('home.faq.sources_html')%>

    + <%=t('home.faq.sources_mods')%> + <%=t('home.faq.sources_tp')%> + <%=t('home.faq.sources_git')%> +
    +

    <%=t('home.faq.mapgen_html')%>

    +
    +
    diff --git a/app/views/home/home.html.erb b/app/views/home/home.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..cb80fea8d35c82d4a1fbf053351f0b315a5e9da1 --- /dev/null +++ b/app/views/home/home.html.erb @@ -0,0 +1,2 @@ +

    Home#home

    +

    Find me in app/views/home/home.html.erb

    diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..66164e5bad85eb5acc82f350836711fc33d85efa --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,62 @@ +<% content_for :title, t('home.index.title') %> +
    +
    +

    <%= t('home.index.headline') %>

    +

    <%= t('home.index.description_html') %>

    + Screenshots + +

    <%= t('home.index.release') %>

    +
    + +

     

    +
    +

    <%= t('home.index.ssdb_html') %>

    +
    +
    +

    <%= t('home.index.kvm_html') %>

    +
    +
    +

    <%= t('home.index.theme_html') %>

    +
    +
    + +
    diff --git a/app/views/home/mapshots.html.erb b/app/views/home/mapshots.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..a66e803281c003de4362a927434d4d377ed2a9cc --- /dev/null +++ b/app/views/home/mapshots.html.erb @@ -0,0 +1,22 @@ +<% content_for :title, t('home.mapshots.title') %> +
    +

    <%= t('home.mapshots.headline') %>

    +
    + +
    +
    +
    + + + +
    +
    diff --git a/mods.html b/app/views/home/mods.html.erb similarity index 85% rename from mods.html rename to app/views/home/mods.html.erb index 44064b129a9f90656595e984ee6eba143aa84515..cab9693a58e1e8d337eaf7a0486f97d502aacc6f 100644 --- a/mods.html +++ b/app/views/home/mods.html.erb @@ -1,55 +1,11 @@ - - - - - - - - ..:: Illuna Minetest - Mods ::.. - - - - - -
    -
    + <% content_for :title, t('home.mods.title') %> +
    -

    our modlist:

    +

    <%= t('home.mods.headline') %>


    -
    Brings armor and shields to the game.
    This and items in your hands will be visible to other players. +
    <%= t('home.mods.3d_armor_html') %>
    1. 3d_armor
    2. @@ -85,7 +41,7 @@
    -
    Backgroundmusic and sounds. +
    <%= t('home.mods.ambience') %>
    @@ -100,7 +56,7 @@ -
    Useful for signposts. +
    <%= t('home.mods.arrow_signs') %>
    @@ -115,7 +71,7 @@ -
    Increase your inventar by crafting some bags! +
    <%= t('home.mods.arrow_bags') %>
    @@ -130,7 +86,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.beds') %>
    @@ -145,7 +101,7 @@ -
    Grants other mods to change the servers biomes. +
    <%= t('home.mods.biomelib') %>
    @@ -159,7 +115,7 @@ -
    A moneysystem similar to bitcoin. +
    <%= t('home.mods.bitchange') %>
    @@ -174,7 +130,7 @@ -
    A faster and more eyecandy boat. +
    <%= t('home.mods.boats') %>
    @@ -189,7 +145,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.bones') %>
    @@ -204,7 +160,7 @@ -
    Based of PilzAdams Carts. Its a bit smoother. +
    <%= t('home.mods.boost_cart_html') %>
    @@ -216,7 +172,7 @@ -
    Small, beautiful bridges. +
    <%= t('home.mods.bridges') %>
    @@ -231,7 +187,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.buckets') %>
    @@ -249,7 +205,7 @@ -
    Invent different types of cannons to protect you. +
    <%= t('home.mods.cannons') %>
    @@ -267,7 +223,7 @@ -
    Generates a-w-e-s-o-m-e caves! You wont believe your eyes. +
    <%= t('home.mods.caverealms') %>
    @@ -282,7 +238,7 @@ -
    Based of the Minetest fork "Voxelands". Design your character with many many options.
    You may want to hit F7 two times to change your camera. +
    <%= t('home.mods.character_creator_html') %>
    @@ -297,28 +253,10 @@ -
    Decoration for x-mas. +
    <%= t('home.mods.christmas_craft') %>
    - -

    @@ -352,7 +290,7 @@ -
    A bunch of medieval items. +
    <%= t('home.mods.cottages') %>

    @@ -384,7 +322,7 @@ -
    New minerals and items from the pre-industrial age. +
    <%= t('home.mods.darkage') %>
    @@ -396,7 +334,7 @@ -
    Individual and random public die-messages. Also a note to the player where he/she can fint the grave. +
    <%= t('home.mods.death_messages') %>
    @@ -411,7 +349,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.default') %> @@ -427,7 +365,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.doors') %>
    @@ -442,7 +380,7 @@ -
    Found a big dungeon? Lets search for a chest with surprise items! +
    <%= t('home.mods.dungeon_loot') %>
    @@ -457,7 +395,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.dye') %>
    @@ -472,7 +410,7 @@ -
    A very big extended version of farming. +
    <%= t('home.mods.farming') %>
    @@ -487,7 +425,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.flowers') %>
    @@ -502,7 +440,7 @@ -
    Part of the original Minetest game. +
    <%= t('home.mods.give_initial_stuff') %>
    @@ -517,7 +455,7 @@ -
    The welcome paper for newcomers. +
    <%= t('home.mods.helloscreen') %>
    @@ -532,7 +470,7 @@ -
    A _bunch_ of items to decorate your awesome residence. +
    <%= t('home.mods.homedecor_modpack') %>
    @@ -547,7 +485,7 @@ -
    Needed to show hunger, armorbar and more. +
    <%= t('home.mods.hudbars') %>
    @@ -559,7 +497,7 @@ -
    Recipes and exclusive blocks/items from/for this minetestserver. +
    <%= t('home.mods.illuna') %>
    @@ -571,7 +509,7 @@ -
    Adds shortcuts to your inventory. For example for bags ow character_creator. +
    <%= t('home.mods.inventory_plus') %>
    @@ -587,7 +525,7 @@ -
    Connects us to our IRC channel. +
    <%= t('home.mods.irc') %>
    @@ -602,7 +540,7 @@ -
    Got a big shadow in a new are? Water or lava wont float anymore? /mapfix Will made your day. +
    <%= t('home.mods.mapfix') %>
    @@ -617,7 +555,7 @@ -
    To protect admins or allow them to place undiggable nodes and more. +
    <%= t('home.mods.maptools') %>
    @@ -630,7 +568,7 @@ -
    More medieval stuff. +
    <%= t('home.mods.medieval_craft') %>
    @@ -644,7 +582,7 @@ -
    Similar to Minecraft. Adds stuff based on electronic pulses. +
    <%= t('home.mods.mesecons') %>
    @@ -658,7 +596,7 @@ -
    Creates a cube of daylike light. +
    <%= t('home.mods.mini_sun') %>
    @@ -675,7 +613,7 @@ -
    Bringt uns die folgenden Wesen: +
    <%= t('home.mods.mobs') %>
    1. bee
    2. @@ -704,7 +642,6 @@ -
      A cute goat mod using mobs_redo API.
    3. @@ -714,7 +651,6 @@ -
      Also using the mobs_redo API:
      1. birds
      2. @@ -728,7 +664,6 @@ -
        Also using the mobs_redo API.
      3. @@ -741,7 +676,6 @@ -
        Also using the mobs_redo API:
        1. pumpking
        2. sandworm
        3. @@ -762,7 +696,6 @@ -
          Nutzt ebenfalls die mobs_redo API:
          1. bear
          2. better_rat
          3. @@ -782,7 +715,7 @@ -
            A young, interesting mod. Let spawn traders if you got the privilege or just ask for it. +
            <%= t('home.mods.mobf_trader') %>
          @@ -798,7 +731,7 @@ -
          Again some more stuff. +
          <%= t('home.mods.moreblocks') %> @@ -811,7 +744,7 @@ -
          Different new glasstypes. +
          <%= t('home.mods.moreglass') %>
          @@ -829,7 +762,7 @@ -
          Adds copper, tin, silver, gold and three new toolsets and swords to the game. +
          <%= t('home.mods.moreores') %>
          @@ -844,7 +777,7 @@ -
          A bunch of amazing new trees. +
          <%= t('home.mods.moretrees') %>
          @@ -856,7 +789,7 @@ -
          Needed for our statistics. +
          <%= t('home.mods.munin') %>
          @@ -871,7 +804,7 @@ -
          Transport your items with pipes. Also adds some new mechanisms. +
          <%= t('home.mods.pipeworks') %>
          @@ -886,7 +819,7 @@ -
          Molehill, bushes and much more! +
          <%= t('home.mods.plantlife_modpack') %>
          @@ -901,7 +834,7 @@ -
          To create white blocks and stairs...mainly. +
          <%= t('home.mods.quartz') %>
          @@ -913,7 +846,7 @@ -
          Replace nodes just with one click. But be careful! +
          <%= t('home.mods.replacer') %>
          @@ -928,7 +861,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.screwdriver') %>
          @@ -940,7 +873,7 @@ -
          Colorful new blocks...shells...seaplants... . +
          <%= t('home.mods.sea') %>
          @@ -955,7 +888,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.sethome') %>
          @@ -967,7 +900,7 @@ -
          Shows the text on the signs. +
          <%= t('home.mods.signs_lib') %>
          @@ -982,7 +915,7 @@ -
          Hold E to run fast. +
          <%= t('home.mods.sprint_html') %>
          @@ -997,7 +930,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.stairs') %>
          @@ -1012,7 +945,7 @@ -
          More stairs. +
          <%= t('home.mods.stairsplus') %>
          @@ -1027,7 +960,7 @@ -
          New steel items. +
          <%= t('home.mods.steel') %>
          @@ -1043,7 +976,7 @@ -
          Potions and pads to teleport. +
          <%= t('home.mods.teleport_potion') %>
          @@ -1055,7 +988,7 @@ -
          Only allowed players can join on maintenance. +
          <%= t('home.mods.the_list') %>
          @@ -1070,7 +1003,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.tnt') %>
          @@ -1085,7 +1018,7 @@ -
          Makes our torches 3D. +
          <%= t('home.mods.torches') %>
          @@ -1100,7 +1033,7 @@ -
          Adds elevators and teleport boxes. +
          <%= t('home.mods.travelnet') %>
          @@ -1115,7 +1048,7 @@ -
          More colors. +
          <%= t('home.mods.unifieddyes') %>
          @@ -1130,7 +1063,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.vessels') %>
          @@ -1145,7 +1078,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.walls') %>
          @@ -1157,7 +1090,7 @@ -
          Make you some wine, beer and more. +
          <%= t('home.mods.wine') %>
          @@ -1172,7 +1105,7 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.wool') %>
          @@ -1184,7 +1117,7 @@ -
          Create wals with different stuff. +
          <%= t('home.mods.xconnected') %>
          @@ -1199,7 +1132,7 @@ -
          Workbench, Enchantingtable and much more interesting stuff. +
          <%= t('home.mods.xdecor') %>
          @@ -1214,59 +1147,14 @@ -
          Part of the original Minetest game. +
          <%= t('home.mods.xpanes') %>
          Back to Top - - - - - - - - - - - - - - diff --git a/app/views/home/rules.html.erb b/app/views/home/rules.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..98edb7378bc0b5a8ae2f28b3352ef262fbdb82b2 --- /dev/null +++ b/app/views/home/rules.html.erb @@ -0,0 +1,64 @@ +<% content_for :title, t('home.rules.title') %> +
          +

          <%= t('home.rules.headline') %>

          +
            +

            <%= t('home.rules.head_general') %>

            +
          • +

            <%= t('home.rules.fire') %>

            +
          • +
          • +

            <%= t('home.rules.steal') %>

            +
          • +
              +
            1. +

              <%= t('home.rules.steal_except_html') %>

              +
            2. +
            +
          • +

            <%= t('home.rules.distance_html') %>

            +
          • +
              +
            1. +

              <%= t('home.rules.distance_except_html') %>

              +
            2. +
            +
          • +

            <%= t('home.rules.insults') %>

            +
          • +
          • +

            <%= t('home.rules.flattening') %>

            +
          • +
          • +

            <%= t('home.rules.harvested_trees') %>

            +
          • +
          • +

            <%= t('home.rules.pvp') %>

            +
          • +
              +
            1. <%= t('home.rules.pvp_except_html') %>

              +
            2. +
            +
          • +

            <%= t('home.rules.bones_html') %>

            +
          • +

            <%= t('home.rules.head_tnt') %>

            +
          • +

            <%= t('home.rules.tnt_general_html') %>

            +
              +
            1. +

              <%= t('home.rules.tnt_grief') %>

              +
            2. +
            3. +

              <%= t('home.rules.tnt_fire') %>

              +
            4. +
            5. +

              <%= t('home.rules.tnt_asking') %>

              +
            6. +
            +
          • +

            <%= t('home.rules.head_mese') %>

            +
          • +

            <%= t('home.rules.mesecons_html') %>

            +
          • +
          +
          diff --git a/app/views/home/show.haml b/app/views/home/show.haml new file mode 100644 index 0000000000000000000000000000000000000000..b1ca392cc0abf09a689dc2c9381b35e993fd35e4 --- /dev/null +++ b/app/views/home/show.haml @@ -0,0 +1,2 @@ +- content_for :page_title do + = illuna_brand diff --git a/app/views/home/stats.html.erb b/app/views/home/stats.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..361c501630f634a22029df105271c005bd4e6f45 --- /dev/null +++ b/app/views/home/stats.html.erb @@ -0,0 +1,22 @@ +<% content_for :title, t('home.stats.title') %> +
          +

          <%= t('home.stats.headline') %>

          +
          + +
          +
          + +
          +
          + +
          +
          + +
          +
          + +
          +
          + +
          +
          diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..b09174ff8b366d334663f15fc6ad5120d020bcce --- /dev/null +++ b/app/views/layouts/application.html.erb @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + <%= yield(:title) %> + + + + +
          + + <%= yield %> + + +
          +
          +
          +
          + by tchncs.de +
          +
          + + +
          +
          + + +<%= yield(:after) %> + diff --git a/app/views/screenshots/bennys_residence.html.erb b/app/views/screenshots/bennys_residence.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..65f1611863bcbd6ea605573faa3a15b522ad5e23 --- /dev/null +++ b/app/views/screenshots/bennys_residence.html.erb @@ -0,0 +1,57 @@ +<% content_for :title, t('screenshots.bennys_residence.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        4. all screenshots are licensed under:
        5. +
        6. |
        7. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/app/views/screenshots/country_house.html.erb b/app/views/screenshots/country_house.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..e7af41d9f6eb8e50851a067ef7feb6bdffa0f697 --- /dev/null +++ b/app/views/screenshots/country_house.html.erb @@ -0,0 +1,50 @@ +<% content_for :title, t('screenshots.country_house.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        8. all screenshots are licensed under:
        9. +
        10. |
        11. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/app/views/screenshots/home_on_water.html.erb b/app/views/screenshots/home_on_water.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..6fef81528fb83879b78c1a64231c79eef1ffe51a --- /dev/null +++ b/app/views/screenshots/home_on_water.html.erb @@ -0,0 +1,50 @@ +<% content_for :title, t('screenshots.home_on_water.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        12. all screenshots are licensed under:
        13. +
        14. |
        15. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/screenshots/page-1.html b/app/views/screenshots/index.html.erb similarity index 53% rename from screenshots/page-1.html rename to app/views/screenshots/index.html.erb index de4a3100289d8baecc87ff5510938d96b8a677e5..74ee828c234b5cc25dfde298f9f98b41207b2d71 100644 --- a/screenshots/page-1.html +++ b/app/views/screenshots/index.html.erb @@ -1,54 +1,9 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots ::.. - - - - - - -
          -
          - +<% content_for :title, t('screenshots.index.title') %> +
          +
          - +

          @@ -78,7 +33,7 @@

          - +
          @@ -88,7 +43,7 @@
          - +
          @@ -98,7 +53,7 @@
          - +
          @@ -138,7 +93,7 @@
          - +
          @@ -148,7 +103,7 @@
          - +
          @@ -158,7 +113,7 @@
          - +
          @@ -174,49 +129,16 @@
          -
          - - - - - - - - - - - - \ No newline at end of file +
          + +<% content_for(:license) do %> +
        16. all screenshots are licensed under:
        17. +
        18. |
        19. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> diff --git a/app/views/screenshots/londors_residence.html.erb b/app/views/screenshots/londors_residence.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..1cb81da47971c32239f69896e77a6f0343589a31 --- /dev/null +++ b/app/views/screenshots/londors_residence.html.erb @@ -0,0 +1,43 @@ +<% content_for :title, t('screenshots.londors_residence.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        20. all screenshots are licensed under:
        21. +
        22. |
        23. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/app/views/screenshots/skyscraper.html.erb b/app/views/screenshots/skyscraper.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..4a5b6d26495ce7c87fc4706b07701322df41dc6f --- /dev/null +++ b/app/views/screenshots/skyscraper.html.erb @@ -0,0 +1,43 @@ +<% content_for :title, t('screenshots.skyscraper.title') %> +
          +
          +<% content_for(:license) do %> +
        24. all screenshots are licensed under:
        25. +
        26. |
        27. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/app/views/screenshots/tower_of_madness.html.erb b/app/views/screenshots/tower_of_madness.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..b598d1ccba2c7ef84b00ac742fca9cc5b4a3efbe --- /dev/null +++ b/app/views/screenshots/tower_of_madness.html.erb @@ -0,0 +1,50 @@ +<% content_for :title, t('screenshots.tower_of_madness.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        28. all screenshots are licensed under:
        29. +
        30. |
        31. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/app/views/screenshots/townhall.html.erb b/app/views/screenshots/townhall.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..734d2f0a8b5605e2dcaf6f4575f5fe54822b0339 --- /dev/null +++ b/app/views/screenshots/townhall.html.erb @@ -0,0 +1,50 @@ +<% content_for :title, t('screenshots.townhall.title') %> +
          + +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + + + +
          +
          +
          +
          + +
          +
          +<% content_for(:license) do %> +
        32. all screenshots are licensed under:
        33. +
        34. |
        35. +<% end %> +<% content_for(:after) do %> + + + + + +<% end %> + diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000000000000000000000000000000000000..66e9889e8b4aeea1af13e2396fb70594232a2ae3 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000000000000000000000000000000000000..073966023774750c90fe9c89910c769a92da604b --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000000000000000000000000000000000000..17240489f64832c9ce080088e27780d3dc3ee29a --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000000000000000000000000000000000000..e620b4dadb27feebc2043e55bc0d23c104ccac37 --- /dev/null +++ b/bin/setup @@ -0,0 +1,34 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/bin/update b/bin/update new file mode 100755 index 0000000000000000000000000000000000000000..a8e4462f20340b73db6df04da3a3fa0dd842713f --- /dev/null +++ b/bin/update @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/config.ru b/config.ru new file mode 100644 index 0000000000000000000000000000000000000000..f7ba0b527b16a6f539991825ecd72c2e9b6e3af0 --- /dev/null +++ b/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/config/application.rb b/config/application.rb new file mode 100644 index 0000000000000000000000000000000000000000..7e874cf8d566e5e93df9f2440732e5b6916a22ed --- /dev/null +++ b/config/application.rb @@ -0,0 +1,15 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module IllunaMinetestTk + class Application < Rails::Application + # Settings in config/environments/* take precedence over those specified here. + # Application configuration should go into files in config/initializers + # -- all .rb files in that directory are automatically loaded. + end +end diff --git a/config/boot.rb b/config/boot.rb new file mode 100644 index 0000000000000000000000000000000000000000..30f5120df6986349c532c8ece3c170726118a703 --- /dev/null +++ b/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000000000000000000000000000000000000..0bbde6f74fe1216e2e76c2cac2e8a5901b2107b0 --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,9 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: redis://localhost:6379/1 diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000000000000000000000000000000000000..1c1a37ca8df8dafd501066d54086ca5693f4b204 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: 5 + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/config/environment.rb b/config/environment.rb new file mode 100644 index 0000000000000000000000000000000000000000..426333bb46978d897be4cc6fac77b9fcaacf59d0 --- /dev/null +++ b/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb new file mode 100644 index 0000000000000000000000000000000000000000..6f7197045a46e6d83a4cded160ca436599637b80 --- /dev/null +++ b/config/environments/development.rb @@ -0,0 +1,54 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + if Rails.root.join('tmp/caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=172800' + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/config/environments/production.rb b/config/environments/production.rb new file mode 100644 index 0000000000000000000000000000000000000000..c4b81a0394140fb3498de484d42b937aa0545214 --- /dev/null +++ b/config/environments/production.rb @@ -0,0 +1,86 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "illuna-minetest_tk_#{Rails.env}" + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/config/environments/test.rb b/config/environments/test.rb new file mode 100644 index 0000000000000000000000000000000000000000..30587ef6d5ec30b210adfbc7a496880209fe76b7 --- /dev/null +++ b/config/environments/test.rb @@ -0,0 +1,42 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=3600' + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000000000000000000000000000000000000..51639b67a00ddba973a92d59ec277f5d97b63ef6 --- /dev/null +++ b/config/initializers/application_controller_renderer.rb @@ -0,0 +1,6 @@ +# Be sure to restart your server when you modify this file. + +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000000000000000000000000000000000000..01ef3e6630af133b41bd954e220f31231aa281d9 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,11 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path +# Rails.application.config.assets.paths << Emoji.images_path + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000000000000000000000000000000000000..59385cdf379bd06a8d2326dcd4de6d5cd5d3f5b0 --- /dev/null +++ b/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000000000000000000000000000000000000..5a6a32d371fe575acf9f87e2ab7e8ae4d0f11e69 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000000000000000000000000000000000000..4a994e1e7bb7ce28dcec98bad48b9a891d7dec51 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb new file mode 100644 index 0000000000000000000000000000000000000000..ac033bf9dc846101320c96a5ce8aceb8c96ec098 --- /dev/null +++ b/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb new file mode 100644 index 0000000000000000000000000000000000000000..dc1899682b01c3a6d9673faf746e235fb64fc4d2 --- /dev/null +++ b/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb new file mode 100644 index 0000000000000000000000000000000000000000..0706cafd4e599ba8dc791c5109469ec6d5867001 --- /dev/null +++ b/config/initializers/new_framework_defaults.rb @@ -0,0 +1,24 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 5.0 upgrade. +# +# Read the Rails 5.0 release notes for more info on each option. + +# Enable per-form CSRF tokens. Previous versions had false. +Rails.application.config.action_controller.per_form_csrf_tokens = true + +# Enable origin-checking CSRF mitigation. Previous versions had false. +Rails.application.config.action_controller.forgery_protection_origin_check = true + +# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`. +# Previous versions had false. +ActiveSupport.to_time_preserves_timezone = true + +# Require `belongs_to` associations by default. Previous versions had false. +Rails.application.config.active_record.belongs_to_required_by_default = true + +# Do not halt callback chains when a callback returns false. Previous versions had true. +ActiveSupport.halt_callback_chains_on_return_false = false + +# Configure SSL options to enable HSTS with subdomains. Previous versions had false. +Rails.application.config.ssl_options = { hsts: { subdomains: true } } diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb new file mode 100644 index 0000000000000000000000000000000000000000..d0b3bdfa2c4df734a0c79329d8e7a4015156f62a --- /dev/null +++ b/config/initializers/session_store.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.session_store :cookie_store, key: '_illuna-minetest_tk_session' diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000000000000000000000000000000000000..bbfc3961bffef15dabb35fe0de4c409d6efb58c5 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/locales/de.yml b/config/locales/de.yml new file mode 100644 index 0000000000000000000000000000000000000000..4c3461424aa804c19a08c18496288b2f7044992f --- /dev/null +++ b/config/locales/de.yml @@ -0,0 +1,189 @@ +de: + nav: + home: "Home" + rules: "Regeln" + stats: "Statistiken" + donate: "Unterstützen" + home: + index: + title: "The World of Illuna | Home" + headline: "..:: willkommen in der wundervollen Welt von Illuna ::.." + description_html: " …einem deutschen Minetestserver, mit einer einzigartigen Modsammlung, eigenem Texturepack und einem hohen Qualitätsanspruch.
          Du kannst uns in der öffentlichen Serverliste, in deinem Clienten finden." + join: "Trete dem Spiel bei!" + modal_title: "Getting Started" + modal_step1_html: "

          Schritt 1:

          Überprüfe deine Clientversion!

          Wenn deine Versionsnummer unter '0.4.13' ist,
          führe bitte eine Aktualisierung durch, um auch sicher mit diesem Server kompatibel zu sein.
          " + modal_step2_html: "

          Schritt 2:

          Lese die Regeln und stelle dich in unserem Forum vor.
          Ja, das ist notwendig.
          Es werden keine Ausnahmen gemacht.

          " + modal_step3_html: "

          Schritt 3:

          Log dich ein:

          • Du findest uns in der öffentlichen Serverliste (du kannst diese mit dem Häkchen unten, links aktivieren).
            Du kannst auch einfach eine der folgenden Adressen verwenden:

            1. Domain: illuna-minetest.tk

            2. Domain: mt.tchncs.de

            3. IPv4: 5.1.76.102

            4. IPv6: 2a00:f820:417::a73c:4097

            Hinweis: das gefragte Passwort ist frei nach deiner Wahl, denn der erste Login entspricht der Registrierung auf dem Server.

          " + release: "aktuellste Minetest Release:" + ssdb_html: "SSDB powered!
          Benötigte Teile der Datenbank werden im RAM gelagert.
          Das bringt dem Server eine unglaubliche Performance!" + kvm_html: "Echte Ressourcen durch einsetzen einer KVM!
          Es ist eine KVM Maschine, nicht irgendeine OpenVZ auf einem überladenen Host!
          Dieser Server hat fest definierte Ressourcen und kann stets darauf zugreifen." + theme_html: "Eigenes Theme!
          Wir kreieren und stellen ein komplett eigenes Servertheme zusammen.
          Wenn du kein Texturpack installiert hast, bekommst du automatisch das Serverseitige." + rules: + title: "The World of Illuna | Regelwerk" + headline: "Regelwerk" + head_general: "allgemeine Regeln" + head_tnt: "TNT" + head_mese: "Pipeworks/Mesecons" + fire: "Es ist nicht gestattet, eine Brandrodung zu vollziehen. Das Feuer ist leider zu schwer unter Kontrolle zu bringen." + steal: "Es darf auch aus ungesperrten Truhen nichts entnommen werden. Auch nicht von Admins." + steal_except_html: "Ausnahmen:
          -Ausdrückliche Erlaubnis des Besitzers
          -Sharepoints

          " + distance_html: "Im Umkreis von 50 Blöcken um ein Baugebiet eines individuellen Spielers darf nichts verändert werden.
          Es darf auch kein Baum gefällt werden o.ä." + distance_except_html: "Ausnahmen:
          -ausdrückliche Erlaubnis des Bautreibenden
          -ein Admin erlaubt es Dir" + insults: "Persönliche Beleidigungen, jede Form von Mobbing, rassistische Äusserungen etc. sind nicht gestattet." + flattening: "Planieren und zerstören ganzer Landschaften ist nicht erwünscht." + harvested_trees: "Abgeschlagene Bäume sind mittels der gedroppten Setzlinge nachzuforsten (mindestens 1 neuer Setzling auf einen abgeschlagenen Baum)" + pvp: "Töten von Mitspielern ist nicht gewünscht" + pvp_except_html: "Ausnahmen:
          -Der Spieler ist damit einverstanden
          -PvP Events

          " + bones_html: "Wenn Du alte Knochen findest, darfst Du entscheiden ob Du sie mitnimmst.
          Bitte beachte, das Du damit einen anderen Spieler traurig machen könntest." + tnt_general_html: "Mit dem Erhalt des trusted_player Privileges, darf TNT auf Illuna genutzt werden.
          Für das Privileg muss der Spieler mindestens drei Wochen aktiv mitgespielt haben und darf nicht negativ aufgefallen sein.
          Ausnahmen können von Teammitgliedern individuell bestimmt werden." + tnt_grief: "mutwilliges Beschädigen anderer Leute Bauten wird nicht toleriert." + tnt_fire: "TNT darf zum roden von Bäumen nur eingesetzt werden, wenn Feuer serverseitig deaktiviert ist." + tnt_asking: "das Team darf nach dem Privileg gefragt werden, ein immer wiederkehrendes Fragen ist jedoch nicht gestattet." + mesecons_html: "Wir bitten alle Spieler darauf zu achten ihre Systeme so zu bauen, das Objekte einen möglichst kurzen Weg zurücklegen müssen.
          Minetest ist für solche Systeme nicht ausgelegt und hat so schon genug Probleme das effizient und schnell zu bewältigen.
          Mit anderen Worten: mit zu ineffizienten Systemen kann es zu Lags kommen. Es werden mitunter Teleport Tubes empfohlen." + faq: + title: "The World of Illuna | FAQ" + headline: "Noch Fragen?" + password_html: "Wie lautet das Serverpasswort?

          Du hast die Wahl. Der erste Login entspricht einer Registrierung auf dem Server,
          du kannst dein Passwort also frei wählen.
          Wenn Du dich nichtmehr einloggen kannst, nachdem du dich mit verschieden alten Clients,
          versucht hast einzuloggen, kontaktiere uns bitte.
          Die Verschlüsselung der Passwörter hat sich in der 0.4.13 Release geändert.
          " + interact_html: "Ich bin neu auf dem Server und kann nichts abbauen

          Um unsere Spieler vor Trolls und anderen gemeinen Kindern zu schützen,
          kommen alle neuen Spieler ersteinmal als Gäste auf den Server.
          Bitte lese dir als Erstes unsere Regeln durch und folge den dortigen Instruktionen." + texturepacks_html: "Muss ich das Texturpack vom Server nutzen?

          Natürlich nicht, es gibt jede Menge Alternativen!
          Vorschläge:

          " + texturepacks_illuna: "das Servertexturepack in 32px:" + texturepacks_john_smith: "ein schönes, alternatives Texturepack in 32px:" + texturepacks_mt_32px_html: "Ein Texturpack welches die Default
          16px Texturen auf 32px pimpt: " + disconnect_html: "Hilfe, die Map lädt nicht nach?!

          Bitte logg dich neu ein um zu schauen ob der Server noch online ist.
          Wenn nicht, kontaktiere uns bitte umgehend.
          Wenn doch, gab es möglicherweise ein lokales Verbindungsproblem bei Dir,
          oder etwas hat den Server zu einem unsauberen Neustart veranlasst." + buckets_html: "Mein Eimer will einfach nicht funktionieren, was ist da los?

          Das ist ein kleines Kommunikationsproblem zwischen Client und Server.
          Schlag einfach irgendwas, bis ein 'Crack' zu sehen ist.
          Dein Eimer sollte wieder funktionieren." + sources_html: "Kann ich irgendwo die Serverscripts einsehen? Wo finde ich das Texturpack?

          " + sources_mods: "Servermods" + sources_tp: "Texturepack" + sources_git: "Git" + mapgen_html: "Welches Mapgen wird eingesetzt?

          Wir verwenden Mapgen v6 und v7." + mapshots: + title: "The World of Illuna | Mapshots" + headline: "betrachte unsere wundervolle welt aus der sicht eines satelliten!" + new_tab: "in neuem Tab öffnen" + static_image: "komplettes Bild downloaden" + history: "alle Mapshots ansehen" + stats: + title: "The World of Illuna | Statistiken" + headline: "Statistiken. Alle 5 Minuten aktualisiert." + donate: + title: "The World of Illuna | Unterstützen" + description: "Du kannst uns Geld spenden. Das wird uns helfen unsere Dienste zu bezahlen und dem Projekt entsprechend helfen, lange zu leben:" + amazing: "Hier kannst du in Prozent sehen, wie uns fantastische Menschen bereits unterstützt haben, unsere Kosten zu begleichen" + payd: "bezahlt: " + donated: "gespendet: " + graceful_helpers: "♥ erhabene Helfer ♥" + money_donations: "Gelspenden" + contributions: "weitere Unterstützungen" + cool_idea_html: "wenn du eine coole Idee hast, den Server zu verbessern, schreibe uns einfach

          " + textures: "Texturen" + contact: + title: "The World of Illuna | Contact & Social" + headline: "Das Team kontaktieren" + headline2: "Treffe Deine Community!" + head_connected: "Unsere Chats sind verbunden. Schreib mit deinen Mitspielern von wo Du willst:" + head_real_talk: "Lieber in Echt unterhalten?" + head_groups: "Gruppen" + head_social: "Social" + head_threads: "Threads" + join_jabber: "Trete unserem Jabberchannel bei" + join_now: "jetzt beitreten" + join_irc: "Trete unserem IRC Channel bei" + write_in_minetest: "Schreibe mit uns in Minetest" + just_write_in_minetest_html: "Schreib einfach
          im öffentlichen Minetestchat, ingame" + mods: + title: "The World of Illuna | Modliste" + headline: "Modliste" + 3d_armor_html: "Part of the original Minetest game./Teil des originalen Minetest game." + ambience: "Hintergrundmusik und Geräusche" + arrow_signs: "Praktisch als Wegweiser, hat jedoch keine nach aussen sichtbare Schrift wie die herkömmlichen Schilder durch den Homedecor Mod." + beds: "Teil des originalen Minetest game." + biome_lib: "Grants other mods to change the servers biomes." + bitchange: "A moneysystem similar to bitcoin." + boats: "A faster and more eyecandy boat." + bones: "Teil des originalen Minetest game." + boost_cart_html: "
          Based of PilzAdams Carts. Its a bit smoother." + bridges: "Small, beautiful bridges." + buckets: "Teil des originalen Minetest game." + cannons: "Invent different types of cannons to protect yourself." + caverealms: "Generates a-w-e-s-o-m-e caves! You wont believe your eyes." + character_creator_html: "Based of the Minetest fork 'Voxelands'. Design your character with many many options.
          You may want to hit F7 two times to change your camera." + christmas_craft: "Decoration for x-mas." + columnia: "Beautiful pillars and more." + cottages: "A bunch of medieval items." + craft_guide: "Wondering about recipes? Just take a look in the guide!" + darkage: "New minerals and items from the pre-industrial age." + death_messages: "Individual and random public die-messages. Also a note to the player where he/she can fint the grave." + default: "Teil des originalen Minetest game." + doors: "Teil des originalen Minetest game." + dungeon_loot: "Found a big dungeon? Go search for a chest with surprising items!" + dye: "Teil des originalen Minetest game." + farming: "A very extendet version of the original farming Mod from Minetest" + flowers: "Teil des originalen Minetest game." + give_initial_stuff: "Teil des originalen Minetest game." + helloscreen: "The welcome paper for newcomers" + homedecor_modpack: "A _bunch_ of new items for decoratin your awesome residence" + hudbars: "Add hungerscreen to hud and also hunger functionality" + illuna: "Illuna related modifications" + inventory_plus: "Adds shortcuts to your inventory, for example bags or character_creator. It provides an API for mods." + irc: "Connects Minetest to an IRC channel" + mapfix: "Used for fixing stucking water/lava or light-/shadowbugs." + maptools: "admintoys, adds undiggable/unpointable nodes and one-hit tools" + medieval_craft: "even more medieval stuff" + mesecons: "Similar to Minecraf's redstone. Adds stuff based on electronic impulses" + mini_sun: "creates a cube of daylike light" + mobs: "adds the following creatures:" + mobf_trader: "A young, interesting mod. Let spawn traders!" + moreblocks: "Nodes made of nodes - for example with the circular saw." + moreglass: "Glasses without frames and they're colored!" + moreores: "Adds copper, tin, silver, gold and three new toolsets and swords to the game." + moretrees: "A bunch of amazing new kinds of trees." + munin: "used for our statistics" + pipeworks: "Transport your items with pipes. Also adds some new mechanisms," + plantlife_modpack: "Molehill, bushes and much more." + quartz: "A new ore to create white blocks...and stairs...mainly." + replacer: "Replace nodes just with one click. But be careful!" + screwdriver: "Teil des originalen Minetest game." + sea: "Colorful new blocks...shells...seaplants... ." + sethome: "Teil des originalen Minetest game." + signs_lib: "Used for showing the text on the signs" + sprint_html: "Hold E to run fast." + stairs: "Teil des originalen Minetest game." + stairsplus: "Even more stairs" + steel: "Adds new steel items and nodes" + teleport_potion: "Adds teleport pads and potions to the game" + the_list: "Useful for maintenances: Only allowed players can join the game." + tnt: "Teil des originalen Minetest game." + torches: "Makes the torches 3D" + travelnet: "Adds elevators and teleport boxes" + unifieddyes: "Even more colors" + vessels: "Teil des originalen Minetest game." + walls: "Teil des originalen Minetest game." + wine: "Make you some wine, beer and more." + wool: "Teil des originalen Minetest game." + xdecor: "Workbench, Enchantingtable and much more interesting stuff." + xpanes: "Teil des originalen Minetest game." + screenshots: + index: + title: "The World of Illuna | Offizielle Screenshots" + headline: "..:: (erste) offizielle Screenshots unserer wundervollen Welt ::.." + bennys_residence: + title: "The World of Illuna | Benny's Wohnhaus" + headline: "..:: benny's wohnhaus ::.." + country_house: + title: "The World of Illuna | Kelso's Landhaus" + headline: "..:: kelso's landhaus ::.." + home_on_water: + title: "The World of Illuna | bluepheonix's Haus am Wasser" + headline: "..:: bluepheonix's haus am wasser ::.." + londors_residence: + title: "The World of Illuna | Londor's Wohnhaus" + headline: "..:: londor's wohnhaus ::.." + skyscraper: + title: "The World of Illuna | sunstorm314's Wolkenkratzer" + headline_html: "..:: sunstorm314's Wolkenkratzer ::..
          aktuelle Höhe: 530m (13 März 2016)" + tower_of_madness: + title: "The World of Illuna | coeseta's Tower of Madness" + headline: "..:: coeseta's tower of madness ::.." + townhall: + title: "The World of Illuna | coeseta's Stadthalle" + headline: "..:: coeseta's stadthalle ::.." diff --git a/config/locales/en.yml b/config/locales/en.yml new file mode 100644 index 0000000000000000000000000000000000000000..9679b2a5f695bf5a65422929e416347ff780ab1b --- /dev/null +++ b/config/locales/en.yml @@ -0,0 +1,190 @@ +en: + nav: + home: "Home" + rules: "Rules" + stats: "Statistics" + donate: "Donate" + home: + index: + title: "The World of Illuna | Home" + headline: "..:: welcome to the wonderful World of Illuna ::.." + description_html: "…a german Minetest PvP Server the an unique modcollection, an own texturepack and a high quality demanding.
          You will find us on the public Serverlist on your Client." + join: "Let's join the game!" + modal_title: "Getting Started" + modal_step1_html: "

          Step 1:

          Doublecheck your Client Version.

          If its below Minetest 0.4.13,
          please do an update, to make sure to be compatible with this Server.
          If you need help with updating, follow this Link.

          " + modal_step2_html: "

          Step 2:

          Read the Rules and follow the instructions.
          Yes, thats necessary.
          Everyone had and have to do this. We don't make exceptions!

          " + modal_step3_html: "

          Step 3:

          Log you in:

          • You'll find us in the public serverlist (enable it with the checkbox down-left).
            You can also use the following adresses:

            1. Domain: illuna-minetest.tk

            2. Domain: mt.tchncs.de

            3. IPv4: 5.1.76.102

            4. IPv6: 2a00:f820:417::a73c:4097

            Note: the password is your choice, because first-login = register.

          " + release: "latest Minetest Release:" + ssdb_html: "SSDB powered!
          Needed parts of the Database are stored in the Servers RAM.
          This will bring you awesome performance." + kvm_html: "Real Ressources using KVM!
          It's a KVM machine, which means, its not some vserver on an overloaded Host
          Our machine has hard ressources and can always access them." + theme_html: "Custom Theme!
          We are collecting and developing our own Servertheme.
          If your client using default textures, our theme will be loaded automaticly" + rules: + title: "The World of Illuna | Rules" + headline: "Rules Book" + head_general: "general Rules" + head_tnt: "TNT" + head_mese: "Pipeworks/Mesecons" + fire: "It's not allowed to set anything on fire, because fires can get easily out of control and cause significant damage to players and environment" + steal: "It's not allowed to grap anything from other players or admins , not even if the chest is unlocked." + steal_except_html: "Exceptions:
          -The owner has allowed you to take something
          -Sharepoints" + distance_html: "Please keep 50 blocks free space to other builds / players homes
          -In that area you are not allowed to change anything (digging holes or removing trees for example)" + distance_except_html: "Exception:
          -The owner or an admin allowed you to build there" + insults: "Personal insults in any form, mobbing, ethnical offense is strictly forbidden" + flattening: "Flattening or leveling of bigger landscapes is not allowed" + harvested_trees: "Harvested trees have to be replanted using the dropped saplings. (minimum 1 tree has to be planted for each cut tree)" + pvp: "It's not allowed to kill other players" + pvp_except_html: "Exceptions:
          -The player allowed it
          -PvP events" + bones_html: "If you find old bones, you be free to grab them.
          Please consider that you can make a player sad by doing that." + tnt_general_html: "If you earned the trusted_player privilege, you are able to use TNT.
          You must be at least active on the Server for three weeks without standing out negatively to get it.
          Teammember are able to make exceptions." + tnt_grief: "Wanton destroying of other people buildings is not tolerated" + tnt_fire: "Its forbidden to clearing trees if the server has fire enabled." + tnt_asking: "You are able to ask the team for this privilegen but we dont want to be asked recurrently." + mesecons_html: "We ask you to build your automatism Systems with less way for objects as possible.
          Please use teleportation tubes for example.
          Minetest is not written to handle many objects in long-way pipes and have naturally trouble to handle this properly.
          If you build too large systems with long pipes, you may get the hole server lagging." + faq: + title: "The World of Illuna | FAQ" + headline: "Some Questions?" + password_html: "why is the server asking for a password?

          You have the choice, just use your prefered one.
          We think its important, that everyone secures his account with a password.
          It's hashed serverside for your privacy.
          If you have trouble logging in after switching Minetest clients with different build numbers,
          please contact us. Thats because the hash mechanism had changed in 0.4.13." + interact_html: "Im new at the Server and cant dig anything

          To be sure that no one came only to troll and griefing, we disabled the interact privilege by default.
          Feel free to check out if you want to play on our world.
          If you want to play here, doublecheck the rules and follow the instructions.
          " + texturepacks_html: "Is there an alternative to the serverside texturepack?

          Yes, just find you one and choose it in your client.
          Examples:

          " + texturepacks_illuna: "the servers texturepack in 32px:" + texturepacks_john_smith: "a nice different texturepack in 32px:" + texturepacks_mt_32px_html: "a texturepack pimping the
          default 16px textures to 32px:" + disconnect_html: "Help, the Map doesn’t load anymore?!

          Please make a relogg to see if the server is already running.
          If not, please contact us!" + buckets_html: "My bucket doesn’t work – what should I do?

          This is a little problem with the communication between your client and the server.
          Please beat something with your pickaxe for example.
          Your bucket should be fixed." + sources_html: "Where are the sources? Are there open viewable scripts? What about the servertextures?

          We love opensource. Opensource is the reason why you can play Minetest.
          Much very important softwareprojects would be missing without Opensource.
          So we won't hide anything for you. Just ask us if you didn't found something.
          " + sources_mods: "our modlist" + sources_tp: "our texturepack" + sources_git: "our Git" + mapgen_html: "What Mapgen is used?

          We are using Mapgen V6 and V7" + mapshots: + title: "The World of Illuna | Mapshots" + headline: "See our world like a satellite!" + new_tab: "open map in new tab" + static_image: "download full static image" + history: "browse the history" + stats: + title: "The World of Illuna | Statistics" + headline: "Statistics. Updated every 5 minutes." + donate: + title: "The World of Illuna | Donate" + description: "You can donate us some money or help us to solve problems. This will help this project to stay alive." + amazing: "here you can see how much the amazing people helped us to pay the services:" + payd: "payd: " + donated: "donated: " + graceful_helpers: "♥ graceful helpers ♥" + money_donations: "money donations" + contributions: "further contributions" + cool_idea_html: "if you have a cool idea how we can improve this minetestserver, please write us! " + textures: "textures" + contact: + title: "The World of Illuna | Contact & Social" + headline: "Contact the Team" + headline2: "Meet Your Community!" + head_connected: "Our chats are connected. Meet us where ever you want:" + head_real_talk: "want a real talk?" + head_groups: "Groups" + head_social: "Social" + head_threads: "Threads" + join_jabber: "Join our Jabberchannel" + join_now: "join now" + join_irc: "Join our IRC Channel" + write_in_minetest: "Write with us in Minetest" + just_write_in_minetest_html: "Just write with us,
          in the public Minetest chat" + mods: + title: "The World of Illuna | Modlist" + headline: "Modlist" + 3d_armor_html: "Brings armor and shields to the game.
          This and items in your hands will be visible to other players." + ambience: "Backgroundmusic and sounds." + arrow_signs: "Useful for signposts" + beds: "Part of the original Minetest game" + biome_lib: "Grants other mods to change the servers biomes." + bitchange: "A moneysystem similar to bitcoin." + boats: "A faster and more eyecandy boat." + bones: "Part of the original Minetest game." + boost_cart_html: "
          Based of PilzAdams Carts. Its a bit smoother." + bridges: "Small, beautiful bridges." + buckets: "Part of the original Minetest game" + cannons: "Invent different types of cannons to protect yourself." + caverealms: "Generates a-w-e-s-o-m-e caves! You wont believe your eyes." + character_creator_html: "Based of the Minetest fork 'Voxelands'. Design your character with many many options.
          You may want to hit F7 two times to change your camera." + christmas_craft: "Decoration for x-mas." + columnia: "Beautiful pillars and more." + cottages: "A bunch of medieval items." + craft_guide: "Wondering about recipes? Just take a look in the guide!" + darkage: "New minerals and items from the pre-industrial age." + death_messages: "Individual and random public die-messages. Also a note to the player where he/she can fint the grave." + default: "Part of the original Minetest game" + doors: "Part of the original Minetest game" + dungeon_loot: "Found a big dungeon? Go search for a chest with surprising items!" + dye: "Part of the original Minetest game" + farming: "A very extendet version of the original farming Mod from Minetest" + flowers: "Part of the original Minetest game" + give_initial_stuff: "Part of the original Minetest game" + helloscreen: "The welcome paper for newcomers" + homedecor_modpack: "A _bunch_ of new items for decoratin your awesome residence" + hudbars: "Add hungerscreen to hud and also hunger functionality" + illuna: "Illuna related modifications" + inventory_plus: "Adds shortcuts to your inventory, for example bags or character_creator. It provides an API for mods." + irc: "Connects Minetest to an IRC channel" + mapfix: "Used for fixing stucking water/lava or light-/shadowbugs." + maptools: "admintoys, adds undiggable/unpointable nodes and one-hit tools" + medieval_craft: "even more medieval stuff" + mesecons: "Similar to Minecraf's redstone. Adds stuff based on electronic impulses" + mini_sun: "creates a cube of daylike light" + mobs: "adds the following creatures:" + mobf_trader: "A young, interesting mod. Let spawn traders!" + moreblocks: "Nodes made of nodes - for example with the circular saw." + moreglass: "Glasses without frames and they're colored!" + moreores: "Adds copper, tin, silver, gold and three new toolsets and swords to the game." + moretrees: "A bunch of amazing new kinds of trees." + munin: "used for our statistics" + pipeworks: "Transport your items with pipes. Also adds some new mechanisms," + plantlife_modpack: "Molehill, bushes and much more." + quartz: "A new ore to create white blocks...and stairs...mainly." + replacer: "Replace nodes just with one click. But be careful!" + screwdriver: "Part of the original Minetest game" + sea: "Colorful new blocks...shells...seaplants... ." + sethome: "Part of the original Minetest game" + signs_lib: "Used for showing the text on the signs" + sprint_html: "Hold E to run fast." + stairs: "Part of the original Minetest game" + stairsplus: "Even more stairs" + steel: "Adds new steel items and nodes" + teleport_potion: "Adds teleport pads and potions to the game" + the_list: "Useful for maintenances: Only allowed players can join the game." + tnt: "Part of the original Minetest game" + torches: "Makes the torches 3D" + travelnet: "Adds elevators and teleport boxes" + unifieddyes: "Even more colors" + vessels: "Part of the original Minetest game" + walls: "Part of the original Minetest game." + wine: "Make you some wine, beer and more." + wool: "Part of the original Minetest game" + xdecor: "Workbench, Enchantingtable and much more interesting stuff." + xpanes: "Part of the original Minetest game." + + screenshots: + index: + title: "The World of Illuna | Official Screenshots" + headline: "..:: (first) screenshots of our wonderful world ::.." + bennys_residence: + title: "The World of Illuna | Benny's Residence" + headline: "..:: benny's residence ::.." + country_house: + title: "The World of Illuna | Kelso's Country House" + headline: "..:: kelso's country house ::.." + home_on_water: + title: "The World of Illuna | bluepheonix's House on Water" + headline: "..:: bluepheonix's house on water ::.." + londors_residence: + title: "The World of Illuna | Londor's Residence" + headline: "..:: londor's residence ::.." + skyscraper: + title: "The World of Illuna | sunstorm314's Skyscraper" + headline_html: "..:: sunstorm314's skyscraper ::..
          current height: 530m (13 March 2016)" + tower_of_madness: + title: "The World of Illuna | coeseta's Tower of Madness" + headline: "..:: coeseta's tower of madness ::.." + townhall: + title: "The World of Illuna | coeseta's Townhall" + headline: "..:: coeseta's townhall ::.." diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000000000000000000000000000000000000..c7f311f8116a762772f8900ac8c1a7b1de0b6c0d --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,47 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum, this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests, default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. If you use this option +# you need to make sure to reconnect any threads in the `on_worker_boot` +# block. +# +# preload_app! + +# The code in the `on_worker_boot` will be called if you are using +# clustered mode by specifying a number of `workers`. After each worker +# process is booted this block will be run, if you are using `preload_app!` +# option you will want to use this block to reconnect to any threads +# or connections that may have been created at application boot, Ruby +# cannot share connections between processes. +# +# on_worker_boot do +# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) +# end + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb new file mode 100644 index 0000000000000000000000000000000000000000..436a664f573f04785a30d23af5c2a867e634c473 --- /dev/null +++ b/config/routes.rb @@ -0,0 +1,23 @@ +Rails.application.routes.draw do + get '/change_locale/:locale', to: 'settings#change_locale', as: :change_locale + get 'home' => 'home#index', :as => 'home' + get 'rules' => 'home#rules', :as => 'rules' + get 'faq' => 'home#faq', :as => 'faq' + get 'mapshots' => 'home#mapshots', :as => 'mapshots' + get 'stats' => 'home#stats', :as => 'stats' + get 'donate' => 'home#donate', :as => 'donate' + get 'contact' => 'home#contact', :as => 'contact' + get 'mods' => 'home#mods', :as => 'mods' + root :to => 'home#index' + get '/:screenshots', to: 'screenshots#index' + get '/:screenshots/tower_of_madness', to: 'screenshots#tower_of_madness' + get '/:screenshots/townhall', to: 'screenshots#townhall' + get '/:screenshots/home_on_water', to: 'screenshots#home_on_water' + get '/:screenshots/londors_residence', to: 'screenshots#londors_residence' + get '/:screenshots/country_house', to: 'screenshots#country_house' + get '/:screenshots/skyscraper', to: 'screenshots#skyscraper' + get '/:screenshots/bennys_residence', to: 'screenshots#bennys_residence' +end + + + diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000000000000000000000000000000000000..1e3b2446840c2870b425d3665ee0084978f06e3c --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rails secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 73bd35d6af330e2bdfb73891e9202acc0a1a2b5a37ba98f02914662a06cbf7e7ec7588b01a5f2f62c2209e8ec3fcc9030c6c95d1e07e696b3495941d7f5fa2ec + +test: + secret_key_base: 9de9ed6f85cb70a4658953b42c58615d74ab8f10c6500ecee3bb5931e8d13c8735148534f33b7faa58867e6dbedc0a72c4c68a3597e5e8d9a3bd3bf7f7d00d75 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb new file mode 100644 index 0000000000000000000000000000000000000000..c9119b40c08eff8aef2d607f5bf42424483cbd15 --- /dev/null +++ b/config/spring.rb @@ -0,0 +1,6 @@ +%w( + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +).each { |path| Spring.watch(path) } diff --git a/contact.html b/contact.html deleted file mode 100644 index 027b0a80c08d24b771faa9bd13f89bdbde2228d3..0000000000000000000000000000000000000000 --- a/contact.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Contact ::.. - - - - - - -
          -
          -
          -

          Contact the Team

          - - - - - - - - - - - - - - - - - - - - -
          -

          Meet Your Community!

          -

          Our chats are connected. Meet us where ever you want:

          -
          -

          - XMPP - - IRC - - Minetest -

          -
          -

          want a real talk?

          - - mumble - -
          -
          -

          Groups

          -
          -
          -

          Threads

          - - mt_en - - mt_de -
          -
          -

          Social

          - - diaspora - - - twitter - -
          -
          -
          - - - - - - - - - - - - - - - -
          - - - - - - - - - - diff --git a/db/seeds.rb b/db/seeds.rb new file mode 100644 index 0000000000000000000000000000000000000000..1beea2accd7ed91d080b323eef17dba95e95e27f --- /dev/null +++ b/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/de b/de deleted file mode 160000 index 0343a890e3fc36536ca7316a7ab7a428839820a8..0000000000000000000000000000000000000000 --- a/de +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0343a890e3fc36536ca7316a7ab7a428839820a8 diff --git a/donate.html b/donate.html deleted file mode 100644 index f4517da54ca05bdf16612e7092d42e5cd6d2875d..0000000000000000000000000000000000000000 --- a/donate.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Donate ::.. - - - - - - -
          -
          -
          -
          - -

          You can donate us some money or help us to solve problems. This will help this project to stay alive.

          -
          - - -
          -

          -
          -
            -
              - -
                - -
              • payd:

                281,98€

              • -
              • donated:

                174,41€

              • -
                -
              -
              -
            -
          -
          -

          here you can see how much the amazing people helped us to pay the services:

          -
          -
          -
          59.01%

          -
          -
          -

          -
            -
              -

              ♥ graceful helpers ♥

              -
              money donations
              - -
                -
              • Donzooles + 8€
              • -
              • Coeseta + 60€
              • -
              • Coeseta + 50€
              • -
              • Coeseta + 20€
              • -
              • Kelso + 20€
              • -
              • Anonymous + 10€
              • -
              • Alexander F. + 6,41€
              • -
              -
              -
              further contributions
              - -
                -
              • Coeseta textures
              • -
              • Kelso textures
              • -
              • Dafoxia textures
              • -
              -
              -
            -
          -
          -

          …if you have a cool idea how we can improve this minetestserver, please write us!

          -

           

          -
          -
          - - - - - - - - - diff --git a/errorpages/404.html b/errorpages/404.html deleted file mode 100644 index d08bd8d4d4e650a4efbfde4ba02552b1ef74e346..0000000000000000000000000000000000000000 --- a/errorpages/404.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - ..:: Illuna Minetest - Homepage ::.. - - -
          -
          -
          404
          -

          Ooops the requested content was not found.
          Go back?

          -
          - - - - - - - - diff --git a/home.html b/home.html deleted file mode 100644 index b3cf6b3d29371d1bd73c253f27f01600ffe7a122..0000000000000000000000000000000000000000 --- a/home.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - ..:: Illuna Minetest - Home ::.. - - - - - - -
          -
          -
          -

          ..:: welcome to the wonderful World of Illuna ::..

          -

          - …a german Minetest PvP Server the an unique modcollection, an own texturepack and a high quality demanding.
          - You will find us on the public Serverlist on your Client.

          - Screenshots - -

          latest Minetest Release:

          -
          - -

           

          -
          - SSDB powered!
          - Needed parts of the Database are stored in the Servers RAM.
          - This will bring you awesome performance. -
          -
          -
          Real Ressources using KVM!
          - It's a KVM machine, which means, its not some vserver on an overloaded Host
          - Our machine has hard ressources and can always access them. -
          -
          - Custom Theme!
          - We are collecting and developing our own Servertheme.
          - If your client using default textures, our theme will be loaded automaticly. -
          -
          - -
          -
          -
          - - - - - - - diff --git a/lib/assets/.keep b/lib/assets/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/lib/tasks/.keep b/lib/tasks/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/log/.keep b/log/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mapshots.html b/mapshots.html deleted file mode 100644 index 4317562c86414cb3d0062aa5cd50b0138714634f..0000000000000000000000000000000000000000 --- a/mapshots.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Mapshots ::.. - - - - - - -
          -
          - -

          see our wonderful world like a satellite!

          - -
          - - -
          -

           

          - - -
          - - - - - - - \ No newline at end of file diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000000000000000000000000000000000000..b612547fc21d079889046e65d1fb135ec6921eaa --- /dev/null +++ b/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
          +
          +

          The page you were looking for doesn't exist.

          +

          You may have mistyped the address or the page may have moved.

          +
          +

          If you are the application owner check the logs for more information.

          +
          + + diff --git a/public/422.html b/public/422.html new file mode 100644 index 0000000000000000000000000000000000000000..a21f82b3bdb817ecbc43f74c6fe360300739418a --- /dev/null +++ b/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
          +
          +

          The change you wanted was rejected.

          +

          Maybe you tried to change something you didn't have access to.

          +
          +

          If you are the application owner check the logs for more information.

          +
          + + diff --git a/public/500.html b/public/500.html new file mode 100644 index 0000000000000000000000000000000000000000..061abc587dcac4cdb1d62a890e4fd4bb20b8cb61 --- /dev/null +++ b/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
          +
          +

          We're sorry, but something went wrong.

          +
          +

          If you are the application owner check the logs for more information.

          +
          + + diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c9c7c01f30b90e009de2d15952ae83230f8e37a --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-agent: * +# Disallow: / diff --git a/q+a.html b/q+a.html deleted file mode 100644 index b2e7321b25f63039bbfd71921ceb3af52ea50e24..0000000000000000000000000000000000000000 --- a/q+a.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Q & A ::.. - - - - - - -
          -
          -

          some questions?

          -
          -why is the server asking for a password?

          - -You have the choice, just use your prefered one.
          -We think its important, that everyone secures his account with a password.
          -It's hashed serverside for your privacy.
          -If you have trouble logging in after switching Minetest clients with different build numbers,
          -please contact us. Thats because the hash mechanism had changed in 0.4.13. - -
          - -Im new at the Server and cant dig anything :-(

          - -To be sure that no one came only to troll and griefing, we disabled the interact privilege by default.
          -
          Feel free to check out if you want to play on our world.
          -If you want to play here, doublecheck the rules and follow the instructions.
          - -
          - -Is anywhere a list of the crafting recipes?

          - -Yes:
          - - -
          - -Is there an alternative to the serverside texturepack?

          - -Yes, just find you one and choose it in your client.
          -Examples:

          - - -
            -
          • the servers texturepack in 32px: Link
          • -
          • a nice different texturepack in 32px: Link -
          • -
          • a texturepack pimping the
            default 16px textures to 32px: Link -
          • -
          -
          - -
          - -Help, the Map doesn’t load anymore?!

          - -Please make a relogg to see if the server is already running. -If not, please contact us! - -
          - -My bucket doesn’t work – what should I do?

          - -This is a little problem with the communication between your client and the server.
          -Please beat something with your pickaxe for example.
          -
          Your bucket should be fixed. - -
          - -Where are the sources? Are there open viewable scripts? What about the servertextures?

          - -We love opensource. Opensource is the reason why you can play Minetest.
          -Much very important softwareprojects would be missing without Opensource.
          -So we won't hide anything for you. Just ask us if you didn't found something.
          -our modlist -our texturepack -our Git - -
          - -What Mapgen is used?

          - -We are using Mapgen V6 and V7 -
          -
          -
          - - - - - - - - - \ No newline at end of file diff --git a/rules.html b/rules.html deleted file mode 100644 index f72bfd39db8371eee08be51bfc4c24bc6e51ae15..0000000000000000000000000000000000000000 --- a/rules.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Rules ::.. - - - - - - -
          -
          - -
            -
            general Rules
            -
          • -

            It's not allowed to set anything on fire, because fires can get easily out of control and cause significant damage to players and environment

            -
          • -
          • -

            It's not allowed to grap anything from other players or admins , not even if the chest is unlocked.

            -
          • -
              -
            1. -

              Exceptions:
              - -The owner has allowed you to take something
              - -Sharepoints

              -
            2. -
            -
          • -

            Please keep 50 blocks free space to other builds / players homes
            - -In that area you are not allowed to change anything (digging holes or removing trees for example)

            -
          • -
              -
            1. -

              Exception:
              - -The owner or an admin allowed you to build there

              -
            2. -
            -
          • -

            Personal insults in any form, mobbing, ethnical offense is strictly forbidden

            -
          • -
          • -

            Flattening or leveling of bigger landscapes is not allowed

            -
          • -
          • -

            Harvested trees have to be replanted using the dropped saplings. (minimum 1 tree has to be planted for each cut tree)

            -
          • -
          • -

            It's not allowed to kill other players

            -
          • -
              -
            1. Exceptions:
              - -The player allowed it
              - -PvP events

              -
            2. -
            -
          • -

            If you find old bones, you be free to grab them.
            Please consider that you can make a player sad by doing that.

            -
          • -
            -
            TNT
            -
          • -

            If you earned the trusted_player privilege, you are able to use TNT.
            - You must be at least active on the Server for three weeks without standing out negatively to get it.
            - Teammember are able to make exceptions.

            -
              -
            1. -

              Wanton destroying of other people buildings is not tolerated

              -
            2. -
            3. -

              Its forbidden to clearing trees if the server has fire enabled.

              -
            4. -
            5. -

              You are able to ask the team for this privilegen but we dont want to be asked recurrently.

              -
            6. -
            -
          • -
            -
            Pipeworks/Mesecons
            -
          • -

            We ask you to build your automatism Systems with less way for objects as possible.
            - Please use teleportation tubes for example.
            - Minetest is not written to handle many objects in long-way pipes and have naturally trouble to handle this properly.
            - If you build too large systems with long pipes, you may get the hole server lagging.

            -
          • -
          -
          - -
          -
          - - - - - - - \ No newline at end of file diff --git a/screenshots/benny/residence.html b/screenshots/benny/residence.html deleted file mode 100644 index 69727fddca5db1d471280cdf22a50e6c69dd5eee..0000000000000000000000000000000000000000 --- a/screenshots/benny/residence.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Benny's Residence ::.. - - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - diff --git a/screenshots/bluepheonix/house_on_water.html b/screenshots/bluepheonix/house_on_water.html deleted file mode 100644 index f391e3773fa240d9abc910f30ec8eed8a1e2959d..0000000000000000000000000000000000000000 --- a/screenshots/bluepheonix/house_on_water.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Bluepheonix's House on Water ::.. - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - diff --git a/screenshots/coeseta/tower_of_madness.html b/screenshots/coeseta/tower_of_madness.html deleted file mode 100644 index a75795386162c939a98cdebd4c3fba19c77ff09f..0000000000000000000000000000000000000000 --- a/screenshots/coeseta/tower_of_madness.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Coeseta's Tower of Madness ::.. - - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - diff --git a/screenshots/coeseta/townhall.html b/screenshots/coeseta/townhall.html deleted file mode 100644 index ffdccc1a695076bd382fc8ad0f50e8bab2dfa605..0000000000000000000000000000000000000000 --- a/screenshots/coeseta/townhall.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Coeseta's Townhall ::.. - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - \ No newline at end of file diff --git a/screenshots/kelso/kelsos_landhaus.html b/screenshots/kelso/kelsos_landhaus.html deleted file mode 100644 index 31a62123aa2ac528ce40db43dbd4a57718043060..0000000000000000000000000000000000000000 --- a/screenshots/kelso/kelsos_landhaus.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Kelso's Country House ::.. - - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - \ No newline at end of file diff --git a/screenshots/londor/wohnhaus.html b/screenshots/londor/wohnhaus.html deleted file mode 100644 index a00efa85fcc26e35c82bed99e7ba83fdd1ab0cf6..0000000000000000000000000000000000000000 --- a/screenshots/londor/wohnhaus.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Londor's Residence ::.. - - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - \ No newline at end of file diff --git a/screenshots/sunstorm314/wolkenkratzer.html b/screenshots/sunstorm314/wolkenkratzer.html deleted file mode 100644 index d947b7f7abfa56ad8135a3fd04f3d61d0e520017..0000000000000000000000000000000000000000 --- a/screenshots/sunstorm314/wolkenkratzer.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Screenshots | Sunstorm314's Skyscraper ::.. - - - - - - -
          -
          - -
          -
          - - - -
          -
          -
          -
          - - - -
          -
          -
          -
          - -
          -
          - - - - - - - - - - - - \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 46fe0ee9a781decc910063956520ccef2d126d43..0000000000000000000000000000000000000000 --- a/stats.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Stats ::.. - - - - - -
          -
          -

          update interval = 5 minutes

          -
          - -
          -
          - -
          -
          - -
          -
          - -
          -
          - -
          -
          - -
          -
          - - - - - - - - \ No newline at end of file diff --git a/test/controllers/.keep b/test/controllers/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/fixtures/.keep b/test/fixtures/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/helpers/.keep b/test/helpers/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/integration/.keep b/test/integration/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/mailers/.keep b/test/mailers/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/models/.keep b/test/models/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..92e39b2d78ca9daa446290d9b364f3e7b5baeef9 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/tmp/.keep b/tmp/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/updating.html b/updating.html deleted file mode 100644 index d5c6b7aaac2cad1b020b07eeff6499ba3a0e3952..0000000000000000000000000000000000000000 --- a/updating.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - ..:: Illuna Minetest - Rules ::.. - - - - - - -
          -
          - -
            -
          • Choose your System
          • -
              -
            1. Linux
            2. -
                -
              1. Ubuntu / Linux Mint
              2. -
              3. Arch Linux and Derivates
              4. -
              5. compile it by hand
              6. -
              -
            3. OS X
            4. -
            5. Windows
            6. -
            -
          -
          - -
          -
          -
          -

          Linux:

          -

          Ubuntu / Linux Mint

          -Open your Terminal (Sometimes called "Konsole") and type the following:

          - -sudo add-apt-repository ppa:minetestdevs/stable
          -sudo apt-get update && sudo apt-get dist-upgrade -
          -

          Arch Linux and Derivates

          -The Arch Repos are currently up to date.
          -If you have an older version, doublecheck your Mirrorlist.

          -

          AUR

          -If you have access to the AUR, just install minetest-git.

          -

          compiling by hand

          - -git clone https://github.com/minetest/minetest
          -cd minetest/games
          -git clone https://github.com/minetest/minetest_game && cd ..
          -cmake . //check if there are no errors
          -make -j$(grep -c processor /proc/cpuinfo)
          -sudo make install //if you want -
          -
          -
          - -
          -
          -
          -

          OS X

          -

          10.5

          -

          10.6

          -

          10.7

          -

          10.8

          -

          10.9

          -

          Yosemite (10.10)

          - -
          -
          -
          -
          -
          -
          - -
          -
          -
          -

          Windows

          -
          -If you dont know if you have 32bit or 64bit, you can look at Start -> Systemcontrol -> System -
          -
          -
          - - - -
          -
          -
          -
          -
          -
          -
          -
          -
          - - - - - - - - - - - - - - - diff --git a/vendor/assets/javascripts/.keep b/vendor/assets/javascripts/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/bin/erubis b/vendor/bundle/ruby/2.3.0/bin/erubis new file mode 100755 index 0000000000000000000000000000000000000000..217ce9b9cb4ba9f78596e6e0419ef885ea283502 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/erubis @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'erubis' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'erubis', version +load Gem.bin_path('erubis', 'erubis', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/geocode b/vendor/bundle/ruby/2.3.0/bin/geocode new file mode 100755 index 0000000000000000000000000000000000000000..da97338cbde3a213a4b9a9c9228e579d1b5f830b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/geocode @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'geocoder' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'geocoder', version +load Gem.bin_path('geocoder', 'geocode', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/nokogiri b/vendor/bundle/ruby/2.3.0/bin/nokogiri new file mode 100755 index 0000000000000000000000000000000000000000..48148d3ae40a780787526f991a01c1b6191b3fbd --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/nokogiri @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'nokogiri', version +load Gem.bin_path('nokogiri', 'nokogiri', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/puma b/vendor/bundle/ruby/2.3.0/bin/puma new file mode 100755 index 0000000000000000000000000000000000000000..003f58f1c88a457fcfe62c21e020fb7e5dfb3d75 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/puma @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'puma' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'puma', version +load Gem.bin_path('puma', 'puma', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/pumactl b/vendor/bundle/ruby/2.3.0/bin/pumactl new file mode 100755 index 0000000000000000000000000000000000000000..261d7fa307a24b378954fc851ea276b4b7755d7d --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/pumactl @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'puma' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'puma', version +load Gem.bin_path('puma', 'pumactl', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/rackup b/vendor/bundle/ruby/2.3.0/bin/rackup new file mode 100755 index 0000000000000000000000000000000000000000..62f6a6a2cccb2ae1922c522057346fe5db582fd9 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/rackup @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'rack' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'rack', version +load Gem.bin_path('rack', 'rackup', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/rails b/vendor/bundle/ruby/2.3.0/bin/rails new file mode 100755 index 0000000000000000000000000000000000000000..a40c1724aa90c7c8030d977a22831abaf8ba4527 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/rails @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'railties' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'railties', version +load Gem.bin_path('railties', 'rails', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/rake b/vendor/bundle/ruby/2.3.0/bin/rake new file mode 100755 index 0000000000000000000000000000000000000000..d5fbaafc57d3f2d039b6379f14cfa47b25f66dc1 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/rake @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'rake', version +load Gem.bin_path('rake', 'rake', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/sass b/vendor/bundle/ruby/2.3.0/bin/sass new file mode 100755 index 0000000000000000000000000000000000000000..cbb4c19bebbb11e5c2be21c3b6d9571cf3fafcc7 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/sass @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'sass', version +load Gem.bin_path('sass', 'sass', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/sass-convert b/vendor/bundle/ruby/2.3.0/bin/sass-convert new file mode 100755 index 0000000000000000000000000000000000000000..34caefe3f47120ab3bd0ecc8a3554b5c6609d78b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/sass-convert @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'sass', version +load Gem.bin_path('sass', 'sass-convert', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/scss b/vendor/bundle/ruby/2.3.0/bin/scss new file mode 100755 index 0000000000000000000000000000000000000000..e25ae7fa55f5180c5cf5c8949ba7c103344e6cc1 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/scss @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'sass', version +load Gem.bin_path('sass', 'scss', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/sprockets b/vendor/bundle/ruby/2.3.0/bin/sprockets new file mode 100755 index 0000000000000000000000000000000000000000..89c30ce88b0a536c005ace4ada21272c71296f9c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/sprockets @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'sprockets' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'sprockets', version +load Gem.bin_path('sprockets', 'sprockets', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/thor b/vendor/bundle/ruby/2.3.0/bin/thor new file mode 100755 index 0000000000000000000000000000000000000000..ec4bdb0bd5332b3a91267dd806d8a724534a8369 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/thor @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'thor', version +load Gem.bin_path('thor', 'thor', version) diff --git a/vendor/bundle/ruby/2.3.0/bin/tilt b/vendor/bundle/ruby/2.3.0/bin/tilt new file mode 100755 index 0000000000000000000000000000000000000000..7dbad494233250038e6ededefa9812b7690408b0 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/bin/tilt @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +# +# This file was generated by RubyGems. +# +# The application 'tilt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'rubygems' + +version = ">= 0.a" + +if ARGV.first + str = ARGV.first + str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding + if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then + version = $1 + ARGV.shift + end +end + +gem 'tilt', version +load Gem.bin_path('tilt', 'tilt', version) diff --git a/vendor/bundle/ruby/2.3.0/cache/actioncable-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/actioncable-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..563c210e80c573db19197421e93d6ed16f6f91b9 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/actioncable-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/actionmailer-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/actionmailer-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..2867e10c35e976d8adb492eafc588a63c030e9cb Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/actionmailer-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/actionpack-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/actionpack-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..b6d8b644a0b0f70fa54b6aecb328f01be21ea1ab Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/actionpack-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/actionview-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/actionview-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..8d48cb1c0a63c0ef8f759ec6ae16b6398d6cabe3 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/actionview-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/activejob-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/activejob-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..15c3b5ea42a164c1446acedc145912da98b7848f Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/activejob-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/activemodel-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/activemodel-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..1883e769cba774c33e0c710204a2041b9c8b0f71 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/activemodel-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/activerecord-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/activerecord-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..8afcd9d5026bda8cb0d52863225defb1a5b6ae3e Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/activerecord-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/activesupport-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/activesupport-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..51fa15dded5949a73a1b53f9ed2da80706681a96 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/activesupport-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/arel-7.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/arel-7.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..8553974bfaceb83752b3d53838ada70b5eb25b96 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/arel-7.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/builder-3.2.2.gem b/vendor/bundle/ruby/2.3.0/cache/builder-3.2.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..b59ef922ebd687bf5b6b254f410f4d511c1ccf6e Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/builder-3.2.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/concurrent-ruby-1.0.2.gem b/vendor/bundle/ruby/2.3.0/cache/concurrent-ruby-1.0.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..12607b19ee0886b415c4ce5b36a4ba03674db671 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/concurrent-ruby-1.0.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/erubis-2.7.0.gem b/vendor/bundle/ruby/2.3.0/cache/erubis-2.7.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..4acd2e769f45842d046774fd8c20afc5ffff2753 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/erubis-2.7.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/execjs-2.7.0.gem b/vendor/bundle/ruby/2.3.0/cache/execjs-2.7.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..1247cce4575fbacc36b995a01ac20e8a9833b198 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/execjs-2.7.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/geocoder-1.3.7.gem b/vendor/bundle/ruby/2.3.0/cache/geocoder-1.3.7.gem new file mode 100644 index 0000000000000000000000000000000000000000..bfe94036efaf04c7aed311362220a64abd7174a3 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/geocoder-1.3.7.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/globalid-0.3.6.gem b/vendor/bundle/ruby/2.3.0/cache/globalid-0.3.6.gem new file mode 100644 index 0000000000000000000000000000000000000000..eaf5d6a36b81af612e9dc276ff52d666339e23f4 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/globalid-0.3.6.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/i18n-0.7.0.gem b/vendor/bundle/ruby/2.3.0/cache/i18n-0.7.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..6f8cf7357f5a7442166df9e37c7139d8e634e020 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/i18n-0.7.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/jquery-rails-4.1.1.gem b/vendor/bundle/ruby/2.3.0/cache/jquery-rails-4.1.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..5fc8120ab4f95edf9bb5fc5e36353fae1cd7d68f Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/jquery-rails-4.1.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/loofah-2.0.3.gem b/vendor/bundle/ruby/2.3.0/cache/loofah-2.0.3.gem new file mode 100644 index 0000000000000000000000000000000000000000..1aa5e846f20a82b13b00ae226f2a89ef6ad54520 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/loofah-2.0.3.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/mail-2.6.4.gem b/vendor/bundle/ruby/2.3.0/cache/mail-2.6.4.gem new file mode 100644 index 0000000000000000000000000000000000000000..4fa553a1f40c3cccb1614b4a9b980cb907d3b860 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/mail-2.6.4.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/method_source-0.8.2.gem b/vendor/bundle/ruby/2.3.0/cache/method_source-0.8.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..842453a334b7708bfe6e619c4e284aa254ea7294 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/method_source-0.8.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/mime-types-3.1.gem b/vendor/bundle/ruby/2.3.0/cache/mime-types-3.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..142b7d66e51c2b3b6274341d6bf19a7efc26a1b3 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/mime-types-3.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/mime-types-data-3.2016.0521.gem b/vendor/bundle/ruby/2.3.0/cache/mime-types-data-3.2016.0521.gem new file mode 100644 index 0000000000000000000000000000000000000000..7b9007748affd2b2f818f999384a7b79aa96f8d5 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/mime-types-data-3.2016.0521.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/mini_portile2-2.1.0.gem b/vendor/bundle/ruby/2.3.0/cache/mini_portile2-2.1.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..bb3fbc781463ddd6839f0cc346cda0ce23ea2d80 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/mini_portile2-2.1.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/minitest-5.9.0.gem b/vendor/bundle/ruby/2.3.0/cache/minitest-5.9.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..24693f1fb66141af1728e36d431f609555ac25d8 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/minitest-5.9.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/nio4r-1.2.1.gem b/vendor/bundle/ruby/2.3.0/cache/nio4r-1.2.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..31cffdf369d4febfac55b1f4bde94ad77bfa4e91 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/nio4r-1.2.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/nokogiri-1.6.8.gem b/vendor/bundle/ruby/2.3.0/cache/nokogiri-1.6.8.gem new file mode 100644 index 0000000000000000000000000000000000000000..d8782d9e4498cad158d95727257a887ff2ab9ecd Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/nokogiri-1.6.8.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/pkg-config-1.1.7.gem b/vendor/bundle/ruby/2.3.0/cache/pkg-config-1.1.7.gem new file mode 100644 index 0000000000000000000000000000000000000000..e1a3df358bb685beda0a836c6fa930a0919b34a3 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/pkg-config-1.1.7.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/puma-3.4.0.gem b/vendor/bundle/ruby/2.3.0/cache/puma-3.4.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..c1bb36e6a35035008ae5ef9712b001e68a987a24 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/puma-3.4.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rack-2.0.1.gem b/vendor/bundle/ruby/2.3.0/cache/rack-2.0.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..96edfca49c42082d91d7d24c0cf8df89a47db3a9 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rack-2.0.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rack-test-0.6.3.gem b/vendor/bundle/ruby/2.3.0/cache/rack-test-0.6.3.gem new file mode 100644 index 0000000000000000000000000000000000000000..914afe94c0949f75dce7721bda90d1720a901cea Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rack-test-0.6.3.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rails-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/rails-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..f13f2f078c165d194c134e9a96e2f8caca3f372b Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rails-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rails-dom-testing-2.0.1.gem b/vendor/bundle/ruby/2.3.0/cache/rails-dom-testing-2.0.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..32e47887fbaf752683cc3160a30293b348bbc650 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rails-dom-testing-2.0.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rails-html-sanitizer-1.0.3.gem b/vendor/bundle/ruby/2.3.0/cache/rails-html-sanitizer-1.0.3.gem new file mode 100644 index 0000000000000000000000000000000000000000..a41936135c5036269b2e0e2a2dccf7c616117986 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rails-html-sanitizer-1.0.3.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/railties-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/railties-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..47e495ca0bcfdf44253dfcee832b0819b304bbf5 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/railties-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/rake-11.2.2.gem b/vendor/bundle/ruby/2.3.0/cache/rake-11.2.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..5da7d29fb8b1c7d2bc9938b6b8b333fd31764b19 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/rake-11.2.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/sass-3.4.22.gem b/vendor/bundle/ruby/2.3.0/cache/sass-3.4.22.gem new file mode 100644 index 0000000000000000000000000000000000000000..ce4282bdc9cd66b143b4c7288eef7c39a7c3d5c2 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/sass-3.4.22.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/sass-rails-5.0.5.gem b/vendor/bundle/ruby/2.3.0/cache/sass-rails-5.0.5.gem new file mode 100644 index 0000000000000000000000000000000000000000..101cf9c9c28e12004e9df124bbc7aae7b0cb9c87 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/sass-rails-5.0.5.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/sprockets-3.6.3.gem b/vendor/bundle/ruby/2.3.0/cache/sprockets-3.6.3.gem new file mode 100644 index 0000000000000000000000000000000000000000..568e65cac47bac8d3a1069ec8bb116299b4b8694 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/sprockets-3.6.3.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/sprockets-rails-3.1.1.gem b/vendor/bundle/ruby/2.3.0/cache/sprockets-rails-3.1.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..50c04543681d8ab6ee63691ba4cc55448ff21ae5 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/sprockets-rails-3.1.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/sqlite3-1.3.11.gem b/vendor/bundle/ruby/2.3.0/cache/sqlite3-1.3.11.gem new file mode 100644 index 0000000000000000000000000000000000000000..69760cd06876a5281dd2d2e42a0b9ab3bfb6272f Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/sqlite3-1.3.11.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/thor-0.19.1.gem b/vendor/bundle/ruby/2.3.0/cache/thor-0.19.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..1ca502f3a513ea990d71c14abf341e220995ce06 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/thor-0.19.1.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/thread_safe-0.3.5.gem b/vendor/bundle/ruby/2.3.0/cache/thread_safe-0.3.5.gem new file mode 100644 index 0000000000000000000000000000000000000000..ab806b6e88cdfb98619cf4f9051e583e9fafae91 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/thread_safe-0.3.5.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/tilt-2.0.5.gem b/vendor/bundle/ruby/2.3.0/cache/tilt-2.0.5.gem new file mode 100644 index 0000000000000000000000000000000000000000..d7c6c8da6a2532cf81e589d8b2a4d1b0b0129a5e Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/tilt-2.0.5.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/turbolinks-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/turbolinks-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..69e37195319f091dc66fb16e353b2673d52e9dd2 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/turbolinks-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/turbolinks-source-5.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/turbolinks-source-5.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..b4c3b7053c6cc24e597940b36887f158c0a31a6c Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/turbolinks-source-5.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/tzinfo-1.2.2.gem b/vendor/bundle/ruby/2.3.0/cache/tzinfo-1.2.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..57dd32600b87dba72714712a096cad29cc7df024 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/tzinfo-1.2.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/uglifier-3.0.0.gem b/vendor/bundle/ruby/2.3.0/cache/uglifier-3.0.0.gem new file mode 100644 index 0000000000000000000000000000000000000000..ab05793015246d2a29040802142c2d401ccb6454 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/uglifier-3.0.0.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/websocket-driver-0.6.4.gem b/vendor/bundle/ruby/2.3.0/cache/websocket-driver-0.6.4.gem new file mode 100644 index 0000000000000000000000000000000000000000..9e1374ce743b05e4a732d0df826cb388a50c7f63 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/websocket-driver-0.6.4.gem differ diff --git a/vendor/bundle/ruby/2.3.0/cache/websocket-extensions-0.1.2.gem b/vendor/bundle/ruby/2.3.0/cache/websocket-extensions-0.1.2.gem new file mode 100644 index 0000000000000000000000000000000000000000..59ad4be9223fb234407aaacc5fd7de94f70b8d85 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/cache/websocket-extensions-0.1.2.gem differ diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem.build_complete b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem.build_complete new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out new file mode 100644 index 0000000000000000000000000000000000000000..a7722f46495ac2eee6f4f7a97e8bef837ea84a4f --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out @@ -0,0 +1,58 @@ +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nio4r-1.2.1/ext/nio4r +/usr/bin/ruby -r ./siteconf20160705-6016-jt5duc.rb extconf.rb +checking for unistd.h... yes +checking for rb_thread_blocking_region()... no +checking for rb_thread_call_without_gvl()... yes +checking for sys/select.h... yes +checking for poll.h... yes +checking for sys/epoll.h... yes +checking for sys/event.h... no +checking for port.h... no +checking for sys/resource.h... yes +creating Makefile + +To see why this extension failed to compile, please check the mkmf.log which can be found here: + + /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/mkmf.log + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nio4r-1.2.1/ext/nio4r +make "DESTDIR=" clean + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nio4r-1.2.1/ext/nio4r +make "DESTDIR=" +compiling monitor.c +compiling nio4r_ext.c +In file included from nio4r_ext.c:7:0: +../libev/ev.c:1829:31: Warnung: »ev_default_loop_ptr« initialisiert und als »extern« deklariert + EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ + ^~~~~~~~~~~~~~~~~~~ +In file included from nio4r_ext.c:7:0: +../libev/ev.c: In Funktion »ev_run«: +../libev/ev.c:3737:9: Warnung: Implizite Deklaration der Funktion »rb_thread_call_without_gvl« [-Wimplicit-function-declaration] + rb_thread_call_without_gvl(ev_backend_poll, (void *)&poll_args, RUBY_UBF_IO, 0); + ^~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from nio4r_ext.c:7:0: +../libev/ev.c: In Funktion »evpipe_write«: +../libev/ev.c:2458:11: Warnung: Der Rückgabewert von »write«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result] + write (evpipe [1], &counter, sizeof (uint64_t)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +../libev/ev.c:2470:11: Warnung: Der Rückgabewert von »write«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result] + write (evpipe [1], &(evpipe [1]), 1); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +../libev/ev.c: In Funktion »pipecb«: +../libev/ev.c:2491:11: Warnung: Der Rückgabewert von »read«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result] + read (evpipe [1], &counter, sizeof (uint64_t)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +../libev/ev.c:2505:11: Warnung: Der Rückgabewert von »read«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result] + read (evpipe [0], &dummy, sizeof (dummy)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +compiling selector.c +selector.c: In Funktion »NIO_Selector_wakeup«: +selector.c:398:5: Warnung: Der Rückgabewert von »write«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result] + write(selector->wakeup_writer, "\0", 1); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +linking shared-object nio4r_ext.so + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nio4r-1.2.1/ext/nio4r +make "DESTDIR=" install +/usr/bin/install -c -m 0755 nio4r_ext.so ./.gem.20160705-6016-723pbz diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/mkmf.log b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/mkmf.log new file mode 100644 index 0000000000000000000000000000000000000000..f549f45288a052120ab32133e4ff7aaa7c25158f --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/mkmf.log @@ -0,0 +1,198 @@ +have_header: checking for unistd.h... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_func: checking for rb_thread_blocking_region()... -------------------- no + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »rb_thread_blocking_region« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +/tmp/ccgGk06U.o: In function `t': +conftest.c:(.text+0x7): undefined reference to `rb_thread_blocking_region' +collect2: Fehler: ld gab 1 als Ende-Status zurück +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void rb_thread_blocking_region(); +14: int t(void) { rb_thread_blocking_region(); return 0; } +/* end */ + +-------------------- + +have_func: checking for rb_thread_call_without_gvl()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »rb_thread_call_without_gvl« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_call_without_gvl; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_thread_call_without_gvl; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void rb_thread_call_without_gvl(); +14: int t(void) { rb_thread_call_without_gvl(); return 0; } +/* end */ + +-------------------- + +have_header: checking for sys/select.h... -------------------- yes + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_header: checking for poll.h... -------------------- yes + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_header: checking for sys/epoll.h... -------------------- yes + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_header: checking for sys/event.h... -------------------- no + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +conftest.c:3:23: schwerwiegender Fehler: sys/event.h: Datei oder Verzeichnis nicht gefunden + #include + ^ +Kompilierung beendet. +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_header: checking for port.h... -------------------- no + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +conftest.c:3:18: schwerwiegender Fehler: port.h: Datei oder Verzeichnis nicht gefunden + #include + ^ +Kompilierung beendet. +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +have_header: checking for sys/resource.h... -------------------- yes + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/nio4r_ext.so b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/nio4r_ext.so new file mode 100755 index 0000000000000000000000000000000000000000..afd76cde24bc100ef81ff70b320772d7ab858baf Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/nio4r_ext.so differ diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem.build_complete b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem.build_complete new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out new file mode 100644 index 0000000000000000000000000000000000000000..c68b8ee298bea32b429def9692b7eadf87957cc5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/gem_make.out @@ -0,0 +1,252 @@ +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri +/usr/bin/ruby -r ./siteconf20160705-6016-160yvs7.rb extconf.rb +Using pkg-config version 1.1.7 +checking if the C compiler accepts ... yes +Building nokogiri using packaged libraries. +Using mini_portile version 2.1.0 +checking for gzdopen() in -lz... yes +checking for iconv... yes +************************************************************************ +IMPORTANT NOTICE: + +Building Nokogiri with a packaged version of libxml2-2.9.4. + +Team Nokogiri will keep on doing their best to provide security +updates in a timely manner, but if this is a concern for you and want +to use the system library instead; abort this installation process and +reinstall nokogiri as follows: + + gem install nokogiri -- --use-system-libraries + [--with-xml2-config=/path/to/xml2-config] + [--with-xslt-config=/path/to/xslt-config] + +If you are using Bundler, tell it to use the option: + + bundle config build.nokogiri --use-system-libraries + bundle install + +Note, however, that nokogiri is not fully compatible with arbitrary +versions of libxml2 provided by OS/package vendors. +************************************************************************ +Extracting libxml2-2.9.4.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4... OK +Running 'configure' for libxml2 2.9.4... OK +Running 'compile' for libxml2 2.9.4... OK +Running 'install' for libxml2 2.9.4... OK +Activating libxml2 2.9.4 (from /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4)... +************************************************************************ +IMPORTANT NOTICE: + +Building Nokogiri with a packaged version of libxslt-1.1.29. + +Team Nokogiri will keep on doing their best to provide security +updates in a timely manner, but if this is a concern for you and want +to use the system library instead; abort this installation process and +reinstall nokogiri as follows: + + gem install nokogiri -- --use-system-libraries + [--with-xml2-config=/path/to/xml2-config] + [--with-xslt-config=/path/to/xslt-config] + +If you are using Bundler, tell it to use the option: + + bundle config build.nokogiri --use-system-libraries + bundle install +************************************************************************ +Extracting libxslt-1.1.29.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.29... OK +Running 'configure' for libxslt 1.1.29... OK +Running 'compile' for libxslt 1.1.29... OK +Running 'install' for libxslt 1.1.29... OK +Activating libxslt 1.1.29 (from /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29)... +checking for main() in -llzma... yes +checking for xmlParseDoc() in libxml/parser.h... yes +checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes +checking for exsltFuncRegister() in libexslt/exslt.h... yes +checking for xmlHasFeature()... yes +checking for xmlFirstElementChild()... yes +checking for xmlRelaxNGSetParserStructuredErrors()... yes +checking for xmlRelaxNGSetParserStructuredErrors()... yes +checking for xmlRelaxNGSetValidStructuredErrors()... yes +checking for xmlSchemaSetValidStructuredErrors()... yes +checking for xmlSchemaSetParserStructuredErrors()... yes +creating Makefile + +To see why this extension failed to compile, please check the mkmf.log which can be found here: + + /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri +make "DESTDIR=" clean + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri +make "DESTDIR=" +compiling html_document.c +compiling html_element_description.c +In file included from /usr/include/ruby-2.3.0/ruby.h:33:0, + from ./nokogiri.h:33, + from ./html_element_description.h:4, + from html_element_description.c:1: +html_element_description.c: In Funktion »get_description«: +html_element_description.c:252:40: Warnung: cast discards »const« qualifier from pointer target type [-Wcast-qual] + return Data_Wrap_Struct(klass, 0, 0, (void *)description); + ^ +/usr/include/ruby-2.3.0/ruby/ruby.h:1167:34: Anmerkung: in Definition des Makros »Data_Wrap_Struct« + rb_data_object_wrap((klass),(sval),(RUBY_DATA_FUNC)(mark),(RUBY_DATA_FUNC)(free)) + ^~~~ +compiling html_entity_lookup.c +compiling html_sax_parser_context.c +compiling html_sax_push_parser.c +compiling nokogiri.c +compiling xml_attr.c +compiling xml_attribute_decl.c +compiling xml_cdata.c +compiling xml_comment.c +compiling xml_document.c +xml_document.c: In Funktion »set_encoding«: +xml_document.c:182:12: Warnung: cast discards »const« qualifier from pointer target type [-Wcast-qual] + free((char *) doc->encoding); /* this may produce a gcc cast warning */ + ^ +xml_document.c: In Funktion »canonicalize«: +xml_document.c:535:15: Warnung: cast discards »const« qualifier from pointer target type [-Wcast-qual] + ns[i] = (xmlChar*) ptr; + ^ +compiling xml_document_fragment.c +compiling xml_dtd.c +compiling xml_element_content.c +compiling xml_element_decl.c +compiling xml_encoding_handler.c +compiling xml_entity_decl.c +compiling xml_entity_reference.c +compiling xml_io.c +compiling xml_libxml2_hacks.c +compiling xml_namespace.c +xml_namespace.c: In Funktion »dealloc_namespace«: +xml_namespace.c:17:13: Warnung: cast discards »const« qualifier from pointer target type [-Wcast-qual] + xmlFree((xmlChar *)ns->href); + ^ +xml_namespace.c:20:13: Warnung: cast discards »const« qualifier from pointer target type [-Wcast-qual] + xmlFree((xmlChar *)ns->prefix); + ^ +xml_namespace.c: In Funktion »part_of_an_xpath_node_set_eh«: +xml_namespace.c:67:49: Warnung: Übergabe des Arguments 1 von »Nokogiri_namespace_eh« von inkompatiblem Zeigertyp [-Wincompatible-pointer-types] + return (node->next && ! Nokogiri_namespace_eh(node->next)); + ^~~~ +xml_namespace.c:27:5: Anmerkung: »xmlNodePtr {aka struct _xmlNode *}« erwartet, aber Argument hat Typ »struct _xmlNs *« + int Nokogiri_namespace_eh(xmlNodePtr node) + ^~~~~~~~~~~~~~~~~~~~~ +compiling xml_node.c +xml_node.c: In Funktion »reparent_node_with«: +xml_node.c:170:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_NODE« wird nicht von switch behandelt [-Wswitch] + switch (reparentee->type) { + ^~~~~~ +xml_node.c:170:7: Warnung: Aufzählungswert »XML_ENTITY_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_DOCUMENT_FRAG_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_NOTATION_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_HTML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_DTD_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_ELEMENT_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_ENTITY_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_NAMESPACE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_XINCLUDE_START« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_XINCLUDE_END« wird nicht von switch behandelt [-Wswitch] +xml_node.c:170:7: Warnung: Aufzählungswert »XML_DOCB_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_NODE« wird nicht von switch behandelt [-Wswitch] + switch (reparentee->type) { + ^~~~~~ +xml_node.c:188:7: Warnung: Aufzählungswert »XML_ENTITY_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_DOCUMENT_TYPE_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_DOCUMENT_FRAG_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_NOTATION_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_HTML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_DTD_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_ELEMENT_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_ENTITY_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_NAMESPACE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_XINCLUDE_START« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_XINCLUDE_END« wird nicht von switch behandelt [-Wswitch] +xml_node.c:188:7: Warnung: Aufzählungswert »XML_DOCB_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ELEMENT_NODE« wird nicht von switch behandelt [-Wswitch] + switch (reparentee->type) { + ^~~~~~ +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_CDATA_SECTION_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ENTITY_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_PI_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_COMMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_DOCUMENT_TYPE_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_DOCUMENT_FRAG_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_NOTATION_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_HTML_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_DTD_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ELEMENT_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ATTRIBUTE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_ENTITY_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_NAMESPACE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_XINCLUDE_START« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_XINCLUDE_END« wird nicht von switch behandelt [-Wswitch] +xml_node.c:199:7: Warnung: Aufzählungswert »XML_DOCB_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_CDATA_SECTION_NODE« wird nicht von switch behandelt [-Wswitch] + switch (parent->type) { + ^~~~~~ +xml_node.c:167:5: Warnung: Aufzählungswert »XML_ENTITY_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_PI_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_COMMENT_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_DOCUMENT_TYPE_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_NOTATION_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_DTD_NODE« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_ELEMENT_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_ATTRIBUTE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_ENTITY_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_NAMESPACE_DECL« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_XINCLUDE_START« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_XINCLUDE_END« wird nicht von switch behandelt [-Wswitch] +xml_node.c:167:5: Warnung: Aufzählungswert »XML_DOCB_DOCUMENT_NODE« wird nicht von switch behandelt [-Wswitch] +compiling xml_node_set.c +compiling xml_processing_instruction.c +compiling xml_reader.c +compiling xml_relax_ng.c +compiling xml_sax_parser.c +compiling xml_sax_parser_context.c +compiling xml_sax_push_parser.c +compiling xml_schema.c +compiling xml_syntax_error.c +compiling xml_text.c +compiling xml_xpath_context.c +compiling xslt_stylesheet.c +In file included from /usr/include/ruby-2.3.0/ruby.h:33:0, + from ./nokogiri.h:33, + from ./xslt_stylesheet.h:4, + from xslt_stylesheet.c:1: +xslt_stylesheet.c: In Funktion »initFunc«: +xslt_stylesheet.c:217:21: Warnung: Übergabe des Arguments 1 von »rb_data_object_get« erzeugt Ganzzahl von Zeiger ohne Typkonvertierung [-Wint-conversion] + Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple, + ^ +/usr/include/ruby-2.3.0/ruby/ruby.h:1205:41: Anmerkung: in Definition des Makros »Data_Get_Struct« + ((sval) = (type*)rb_data_object_get(obj)) + ^~~ +/usr/include/ruby-2.3.0/ruby/ruby.h:1397:1: Anmerkung: »VALUE {aka long unsigned int}« erwartet, aber Argument hat Typ »void *« + rb_data_object_get(VALUE obj) + ^~~~~~~~~~~~~~~~~~ +xslt_stylesheet.c: In Funktion »shutdownFunc«: +xslt_stylesheet.c:230:21: Warnung: Übergabe des Arguments 1 von »rb_data_object_get« erzeugt Ganzzahl von Zeiger ohne Typkonvertierung [-Wint-conversion] + Data_Get_Struct(ctxt->style->_private, nokogiriXsltStylesheetTuple, + ^ +/usr/include/ruby-2.3.0/ruby/ruby.h:1205:41: Anmerkung: in Definition des Makros »Data_Get_Struct« + ((sval) = (type*)rb_data_object_get(obj)) + ^~~ +/usr/include/ruby-2.3.0/ruby/ruby.h:1397:1: Anmerkung: »VALUE {aka long unsigned int}« erwartet, aber Argument hat Typ »void *« + rb_data_object_get(VALUE obj) + ^~~~~~~~~~~~~~~~~~ +linking shared-object nokogiri/nokogiri.so +Using pkg-config version 1.1.7 +Cleaning files only used during build. +rm -rf /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports +rm -rf /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ext/nokogiri +make "DESTDIR=" install +/usr/bin/install -c -m 0755 nokogiri.so ./.gem.20160705-6016-1fhhpzy/nokogiri diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log new file mode 100644 index 0000000000000000000000000000000000000000..889d81506e2063b7bc4acd5a48ef0c85495633f6 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/mkmf.log @@ -0,0 +1,505 @@ +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -Werror -c conftest.c" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main() {return 0;} +/* end */ + +have_library: checking for gzdopen() in -lz... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lz -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: printf("%p", &t); +11: } +12: +13: return 0; +14: } +15: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; } +/* end */ + +-------------------- + +have_iconv?: checking for iconv... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: #include + 5: + 6: int main(void) + 7: { + 8: iconv_t cd = iconv_open("", ""); + 9: iconv(cd, NULL, NULL, NULL, NULL); +10: return EXIT_SUCCESS; +11: } +/* end */ + +-------------------- + +have_library: checking for main() in -llzma... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return !p; } +/* end */ + +-------------------- + +have_func: checking for xmlParseDoc() in libxml/parser.h... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: printf("%p", &t); +11: } +12: +13: return 0; +14: } +15: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlParseDoc; return !p; } +/* end */ + +-------------------- + +have_func: checking for xsltParseStylesheetDoc() in libxslt/xslt.h... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:15:57: Fehler: »xsltParseStylesheetDoc« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xsltParseStylesheetDoc; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~ +conftest.c:15:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: printf("%p", &t); +11: } +12: +13: return 0; +14: } +15: int t(void) { void ((*volatile p)()); p = (void ((*)()))xsltParseStylesheetDoc; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: printf("%p", &t); +11: } +12: +13: return 0; +14: } +15: extern void xsltParseStylesheetDoc(); +16: int t(void) { xsltParseStylesheetDoc(); return 0; } +/* end */ + +-------------------- + +have_func: checking for exsltFuncRegister() in libexslt/exslt.h... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: #include + 4: + 5: /*top*/ + 6: extern int t(void); + 7: int main(int argc, char **argv) + 8: { + 9: if (argc > 1000000) { +10: printf("%p", &t); +11: } +12: +13: return 0; +14: } +15: int t(void) { void ((*volatile p)()); p = (void ((*)()))exsltFuncRegister; return !p; } +/* end */ + +-------------------- + +have_func: checking for xmlHasFeature()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlHasFeature« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlHasFeature; return !p; } + ^~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlHasFeature; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlHasFeature(); +14: int t(void) { xmlHasFeature(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlFirstElementChild()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlFirstElementChild« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlFirstElementChild; return !p; } + ^~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlFirstElementChild; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlFirstElementChild(); +14: int t(void) { xmlFirstElementChild(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlRelaxNGSetParserStructuredErrors()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlRelaxNGSetParserStructuredErrors« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetParserStructuredErrors; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetParserStructuredErrors; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlRelaxNGSetParserStructuredErrors(); +14: int t(void) { xmlRelaxNGSetParserStructuredErrors(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlRelaxNGSetParserStructuredErrors()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlRelaxNGSetParserStructuredErrors« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetParserStructuredErrors; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetParserStructuredErrors; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlRelaxNGSetParserStructuredErrors(); +14: int t(void) { xmlRelaxNGSetParserStructuredErrors(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlRelaxNGSetValidStructuredErrors()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlRelaxNGSetValidStructuredErrors« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetValidStructuredErrors; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlRelaxNGSetValidStructuredErrors; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlRelaxNGSetValidStructuredErrors(); +14: int t(void) { xmlRelaxNGSetValidStructuredErrors(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlSchemaSetValidStructuredErrors()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlSchemaSetValidStructuredErrors« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlSchemaSetValidStructuredErrors; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlSchemaSetValidStructuredErrors; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlSchemaSetValidStructuredErrors(); +14: int t(void) { xmlSchemaSetValidStructuredErrors(); return 0; } +/* end */ + +-------------------- + +have_func: checking for xmlSchemaSetParserStructuredErrors()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »xmlSchemaSetParserStructuredErrors« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlSchemaSetParserStructuredErrors; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))xmlSchemaSetParserStructuredErrors; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/include -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -I/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/include/libxml2 -D_FORTIFY_SOURCE=2 "-DNOKOGIRI_LIBXML2_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c -L. -L/usr/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib -L/home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lruby /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libexslt.a -lm -ldl -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxslt/1.1.29/lib/libxslt.a -ldl -lm -llzma -lz /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/ports/x86_64-pc-linux-gnu/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -lgmp -ldl -lcrypt -lm -lc " +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void xmlSchemaSetParserStructuredErrors(); +14: int t(void) { xmlSchemaSetParserStructuredErrors(); return 0; } +/* end */ + +-------------------- + diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/nokogiri/nokogiri.so b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/nokogiri/nokogiri.so new file mode 100755 index 0000000000000000000000000000000000000000..6eb9aae4a9940dbabb500fc4e3d610336c6666aa Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.6.8/nokogiri/nokogiri.so differ diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/gem.build_complete b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/gem.build_complete new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/gem_make.out b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/gem_make.out new file mode 100644 index 0000000000000000000000000000000000000000..27ee76e281c86b1b71557d97cbf59b8235419afa --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/gem_make.out @@ -0,0 +1,25 @@ +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/puma-3.4.0/ext/puma_http11 +/usr/bin/ruby -r ./siteconf20160705-6016-3q3026.rb extconf.rb +checking for BIO_read() in -lcrypto... yes +checking for SSL_CTX_new() in -lssl... yes +checking for openssl/bio.h... yes +creating Makefile + +To see why this extension failed to compile, please check the mkmf.log which can be found here: + + /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/mkmf.log + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/puma-3.4.0/ext/puma_http11 +make "DESTDIR=" clean + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/puma-3.4.0/ext/puma_http11 +make "DESTDIR=" +compiling http11_parser.c +compiling io_buffer.c +compiling mini_ssl.c +compiling puma_http11.c +linking shared-object puma/puma_http11.so + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/puma-3.4.0/ext/puma_http11 +make "DESTDIR=" install +/usr/bin/install -c -m 0755 puma_http11.so ./.gem.20160705-6016-1gavpnl/puma diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/mkmf.log b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/mkmf.log new file mode 100644 index 0000000000000000000000000000000000000000..5e01b0c58f14ef178fe622f4bee7509a62726281 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/mkmf.log @@ -0,0 +1,115 @@ +have_library: checking for BIO_read() in -lcrypto... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lcrypto -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »BIO_read« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))BIO_read; return !p; } + ^~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))BIO_read; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lcrypto -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void BIO_read(); +14: int t(void) { BIO_read(); return 0; } +/* end */ + +-------------------- + +have_library: checking for SSL_CTX_new() in -lssl... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lcrypto -lruby -lssl -lcrypto -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »SSL_CTX_new« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return !p; } + ^~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))SSL_CTX_new; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lcrypto -lruby -lssl -lcrypto -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void SSL_CTX_new(); +14: int t(void) { SSL_CTX_new(); return 0; } +/* end */ + +-------------------- + +have_header: checking for openssl/bio.h... -------------------- yes + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/puma/puma_http11.so b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/puma/puma_http11.so new file mode 100755 index 0000000000000000000000000000000000000000..76bbdca22205375f52bf617813570b9f285f53f1 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/puma-3.4.0/puma/puma_http11.so differ diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem.build_complete b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem.build_complete new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out new file mode 100644 index 0000000000000000000000000000000000000000..0a0d675688f975075fd18bbd590203789ac5fe37 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/gem_make.out @@ -0,0 +1,36 @@ +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3 +/usr/bin/ruby -r ./siteconf20160705-6016-1v4a70g.rb extconf.rb +checking for sqlite3.h... yes +checking for sqlite3_libversion_number() in -lsqlite3... yes +checking for rb_proc_arity()... yes +checking for rb_integer_pack()... yes +checking for sqlite3_initialize()... yes +checking for sqlite3_backup_init()... yes +checking for sqlite3_column_database_name()... yes +checking for sqlite3_enable_load_extension()... yes +checking for sqlite3_load_extension()... yes +checking for sqlite3_open_v2()... yes +checking for sqlite3_prepare_v2()... yes +checking for sqlite3_int64 in sqlite3.h... yes +checking for sqlite3_uint64 in sqlite3.h... yes +creating Makefile + +To see why this extension failed to compile, please check the mkmf.log which can be found here: + + /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/mkmf.log + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3 +make "DESTDIR=" clean + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3 +make "DESTDIR=" +compiling backup.c +compiling database.c +compiling exception.c +compiling sqlite3.c +compiling statement.c +linking shared-object sqlite3/sqlite3_native.so + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11/ext/sqlite3 +make "DESTDIR=" install +/usr/bin/install -c -m 0755 sqlite3_native.so ./.gem.20160705-6016-1hdoe41/sqlite3 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/mkmf.log b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/mkmf.log new file mode 100644 index 0000000000000000000000000000000000000000..9867bfd13f1019b10873d29c1f131646bd685a62 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/mkmf.log @@ -0,0 +1,467 @@ +find_header: checking for sqlite3.h... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: int main(int argc, char **argv) +4: { +5: return 0; +6: } +/* end */ + +"gcc -E -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -o conftest.i" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +/* end */ + +-------------------- + +find_library: checking for sqlite3_libversion_number() in -lsqlite3... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_libversion_number« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_libversion_number; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_libversion_number; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_libversion_number(); +14: int t(void) { sqlite3_libversion_number(); return 0; } +/* end */ + +-------------------- + +have_func: checking for rb_proc_arity()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_proc_arity; return !p; } +/* end */ + +-------------------- + +have_func: checking for rb_integer_pack()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_integer_pack; return !p; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_initialize()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_initialize« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_initialize; return !p; } + ^~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_initialize; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_initialize(); +14: int t(void) { sqlite3_initialize(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_backup_init()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_backup_init« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_backup_init; return !p; } + ^~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_backup_init; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_backup_init(); +14: int t(void) { sqlite3_backup_init(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_column_database_name()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_column_database_name« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_column_database_name; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_column_database_name; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_column_database_name(); +14: int t(void) { sqlite3_column_database_name(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_enable_load_extension()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_enable_load_extension« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_enable_load_extension; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_enable_load_extension; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_enable_load_extension(); +14: int t(void) { sqlite3_enable_load_extension(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_load_extension()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_load_extension« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_load_extension; return !p; } + ^~~~~~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_load_extension; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_load_extension(); +14: int t(void) { sqlite3_load_extension(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_open_v2()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_open_v2« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_open_v2; return !p; } + ^~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_open_v2; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_open_v2(); +14: int t(void) { sqlite3_open_v2(); return 0; } +/* end */ + +-------------------- + +have_func: checking for sqlite3_prepare_v2()... -------------------- yes + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +conftest.c: In Funktion »t«: +conftest.c:13:57: Fehler: »sqlite3_prepare_v2« nicht deklariert (erste Benutzung in dieser Funktion) + int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_prepare_v2; return !p; } + ^~~~~~~~~~~~~~~~~~ +conftest.c:13:57: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: int t(void) { void ((*volatile p)()); p = (void ((*)()))sqlite3_prepare_v2; return !p; } +/* end */ + +"gcc -o conftest -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -lsqlite3 -lruby -lsqlite3 -lpthread -lgmp -ldl -lcrypt -lm -lc" +checked program was: +/* begin */ + 1: #include "ruby.h" + 2: + 3: /*top*/ + 4: extern int t(void); + 5: int main(int argc, char **argv) + 6: { + 7: if (argc > 1000000) { + 8: printf("%p", &t); + 9: } +10: +11: return 0; +12: } +13: extern void sqlite3_prepare_v2(); +14: int t(void) { sqlite3_prepare_v2(); return 0; } +/* end */ + +-------------------- + +have_type: checking for sqlite3_int64 in sqlite3.h... -------------------- yes + +"gcc -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -c conftest.c" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +4: +5: /*top*/ +6: typedef sqlite3_int64 conftest_type; +7: int conftestval[sizeof(conftest_type)?1:-1]; +/* end */ + +-------------------- + +have_type: checking for sqlite3_uint64 in sqlite3.h... -------------------- yes + +"gcc -I/usr/include/ruby-2.3.0/x86_64-linux -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -c conftest.c" +checked program was: +/* begin */ +1: #include "ruby.h" +2: +3: #include +4: +5: /*top*/ +6: typedef sqlite3_uint64 conftest_type; +7: int conftestval[sizeof(conftest_type)?1:-1]; +/* end */ + +-------------------- + diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/sqlite3/sqlite3_native.so b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/sqlite3/sqlite3_native.so new file mode 100755 index 0000000000000000000000000000000000000000..573559c3853a57e9440249b8c2946c2c8ceb3ada Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.11/sqlite3/sqlite3_native.so differ diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/gem.build_complete b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/gem.build_complete new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/gem_make.out b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/gem_make.out new file mode 100644 index 0000000000000000000000000000000000000000..6b25fb61bec0d6c656124315a979ab51f5c9f502 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/gem_make.out @@ -0,0 +1,15 @@ +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/websocket-driver-0.6.4/ext/websocket-driver +/usr/bin/ruby -r ./siteconf20160705-6016-1ovfdc3.rb extconf.rb +creating Makefile + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/websocket-driver-0.6.4/ext/websocket-driver +make "DESTDIR=" clean + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/websocket-driver-0.6.4/ext/websocket-driver +make "DESTDIR=" +compiling websocket_mask.c +linking shared-object websocket_mask.so + +current directory: /home/technics/Dokumente/HTML/illuna-minetest.tk/vendor/bundle/ruby/2.3.0/gems/websocket-driver-0.6.4/ext/websocket-driver +make "DESTDIR=" install +/usr/bin/install -c -m 0755 websocket_mask.so ./.gem.20160705-6016-wanfq5 diff --git a/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/websocket_mask.so b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/websocket_mask.so new file mode 100755 index 0000000000000000000000000000000000000000..6f14cc11c022e8218cef3176b7512d67349c9976 Binary files /dev/null and b/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/websocket-driver-0.6.4/websocket_mask.so differ diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/CHANGELOG.md b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..9c39bbdc4e4a7e297f7b9a35e95270a806786125 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/CHANGELOG.md @@ -0,0 +1,83 @@ +## Rails 5.0.0 (June 30, 2016) ## + +* Fix development reloading support: new cable connections are now correctly + dispatched to the reloaded channel class, instead of using a cached reference + to the originally-loaded version. + + *Matthew Draper* + +* WebSocket protocol negotiation. + + Introduces an Action Cable protocol version that moves independently + of and, hopefully, more slowly than Action Cable itself. Client sockets + negotiate a protocol with the Cable server using WebSockets' native + subprotocol support: + * https://tools.ietf.org/html/rfc6455#section-1.9 + * https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols + + If they can't negotiate a compatible protocol (usually due to upgrading + the Cable server with a browser still running old JavaScript) then the + client knows to disconnect, cease retrying, and tell the app that it hit + a protocol mismatch. + + This allows us to evolve the Action Cable message format, handshaking, + pings, acknowledgements, and more without breaking older clients' + expectations of server behavior. + + *Daniel Rhodes* + +* Pubsub: automatic stream decoding. + + stream_for @room, coder: ActiveSupport::JSON do |message| + # `message` is a Ruby hash here instead of a JSON string + + The `coder` must respond to `#decode`. Defaults to `coder: nil` + which skips decoding entirely. + + *Jeremy Daer* + +* Add ActiveSupport::Notifications to ActionCable::Channel. + + *Matthew Wear* + +* Safely support autoloading and class unloading, by preventing concurrent + loads, and disconnecting all cables during reload. + + *Matthew Draper* + +* Ensure ActionCable behaves correctly for non-string queue names. + + *Jay Hayes* + +* Added `em_redis_connector` and `redis_connector` to + `ActionCable::SubscriptionAdapter::EventedRedis` and added `redis_connector` + to `ActionCable::SubscriptionAdapter::Redis`, so you can overwrite with your + own initializers. This is used when you want to use different-than-standard + Redis adapters, like for Makara distributed Redis. + + *DHH* + +* Support PostgreSQL pubsub adapter. + + *Jon Moss* + +* Remove EventMachine dependency. + + *Matthew Draper* + +* Remove Celluloid dependency. + + *Mike Perham* + +* Create notion of an `ActionCable::SubscriptionAdapter`. + Separate out Redis functionality into + `ActionCable::SubscriptionAdapter::Redis`, and add a + PostgreSQL adapter as well. Configuration file for + ActionCable was changed from`config/redis/cable.yml` to + `config/cable.yml`. + + *Jon Moss* + +* Added to Rails! + + *DHH* diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/MIT-LICENSE b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/MIT-LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..27a17cf41b4cc6e07855d35810385e799893b67c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2015-2016 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/README.md b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f378a6464ec07e15fb2c4f585be56bf7091bca8c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/README.md @@ -0,0 +1,545 @@ +# 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 + + protected + def find_verified_user + if current_user = User.find_by(id: cookies.signed[:user_id]) + current_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: + +```coffeescript +# app/assets/javascripts/cable.coffee +#= require action_cable + +@App = {} +App.cable = ActionCable.createConsumer("ws://cable.example.com") +``` + +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 "page:change.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](http://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 specified origins, which are passed to the server config as an array. The origins can be instances of strings or regular expressions, against which a check for match will be performed. + +```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 and allow requests from any origin: + +```ruby +Rails.application.config.action_cable.disable_request_forgery_protection = true +``` + +### 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 close to what we're using in Basecamp: + +```ruby +Rails.application.config.action_cable.log_tags = [ + -> request { request.env['bc.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: +``` +#!/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... +``` + +## 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable.rb new file mode 100644 index 0000000000000000000000000000000000000000..b6d28428675dd11a33013ce486c95a4dc313a724 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable.rb @@ -0,0 +1,52 @@ +#-- +# Copyright (c) 2015-2016 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel.rb new file mode 100644 index 0000000000000000000000000000000000000000..7ae262ce5f47a6d33eb34ce2967d523f1b9d130a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel.rb @@ -0,0 +1,14 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/base.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..845b747fc5e091cd0585d7368a918378555fe8a9 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/base.rb @@ -0,0 +1,297 @@ +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 + + protected + # 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! + @action_methods = nil + end + + # Refresh the cached action_methods when a new action_method is added. + def method_added(name) + 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. + @defer_subscription_confirmation = false + + @reject_subscription = nil + @subscription_confirmation_sent = nil + + delegate_connection_identifiers + subscribe_to_channel + 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 + + # 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 + + + protected + # 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 + # 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 + # 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) + logger.info "#{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 defer_subscription_confirmation! + @defer_subscription_confirmation = true + end + + def defer_subscription_confirmation? + @defer_subscription_confirmation + end + + def subscription_confirmation_sent? + @subscription_confirmation_sent + end + + def reject + @reject_subscription = true + end + + def subscription_rejected? + @reject_subscription + end + + private + def delegate_connection_identifiers + connection.identifiers.each do |identifier| + define_singleton_method(identifier) do + connection.send(identifier) + end + end + end + + def subscribe_to_channel + run_callbacks :subscribe do + subscribed + end + + if subscription_rejected? + reject_subscription + else + transmit_subscription_confirmation unless defer_subscription_confirmation? + 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) + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/broadcasting.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/broadcasting.rb new file mode 100644 index 0000000000000000000000000000000000000000..afc23d7d1a229df0e115b22338ddb9379b007c83 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/broadcasting.rb @@ -0,0 +1,29 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/callbacks.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/callbacks.rb new file mode 100644 index 0000000000000000000000000000000000000000..295d750e861c231b4b1087e262903f5e1ea1f483 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/callbacks.rb @@ -0,0 +1,35 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/naming.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/naming.rb new file mode 100644 index 0000000000000000000000000000000000000000..4c9d53b15acbadad857274b01d5b8c5cbf17fb08 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/naming.rb @@ -0,0 +1,22 @@ +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' + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/periodic_timers.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/periodic_timers.rb new file mode 100644 index 0000000000000000000000000000000000000000..41511312fce83b9abb47c906f4aff254bbfef180 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/periodic_timers.rb @@ -0,0 +1,77 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/streams.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/streams.rb new file mode 100644 index 0000000000000000000000000000000000000000..200c9d053c9d4cfc8180414b6976f2b65d23948d --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/channel/streams.rb @@ -0,0 +1,174 @@ +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 + transmit_subscription_confirmation + 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 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection.rb new file mode 100644 index 0000000000000000000000000000000000000000..5f813cf8e0463a3e30217fbf39d28a369676a004 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection.rb @@ -0,0 +1,21 @@ +module ActionCable + module Connection + extend ActiveSupport::Autoload + + eager_autoload do + autoload :Authorization + autoload :Base + autoload :ClientSocket + autoload :Identification + autoload :InternalChannel + autoload :FayeClientSocket + autoload :FayeEventLoop + autoload :MessageBuffer + autoload :Stream + autoload :StreamEventLoop + autoload :Subscriptions + autoload :TaggedLoggerProxy + autoload :WebSocket + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/authorization.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/authorization.rb new file mode 100644 index 0000000000000000000000000000000000000000..070a70e4e2a858c2fabdf1d089a1fb5c539ccc6e --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/authorization.rb @@ -0,0 +1,13 @@ +module ActionCable + module Connection + module Authorization + class UnauthorizedError < StandardError; end + + private + def reject_unauthorized_connection + logger.error "An unauthorized connection attempt was rejected" + raise UnauthorizedError + end + end + end +end \ No newline at end of file diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/base.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..cc4e0f8c8b530912daf44be1fd82cf40c1274149 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/base.rb @@ -0,0 +1,255 @@ +require 'action_dispatch' + +module ActionCable + module Connection + # For every WebSocket 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 + # + # protected + # def find_verified_user + # if current_user = User.find_by_identity cookies.signed[:identity_id] + # current_user + # else + # reject_unauthorized_connection + # end + # 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, server.config.client_socket_class) + @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`, and `subscriptions`. + # 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: + # ignore + end + + def on_close(reason, code) # :nodoc: + send_async :handle_close + end + + protected + # The request that initiated the WebSocket connection is available here. This gives access to the environment, cookies, etc. + def request + @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 + request.cookie_jar + end + + attr_reader :websocket + attr_reader :message_buffer + + private + 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 + + if 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/client_socket.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/client_socket.rb new file mode 100644 index 0000000000000000000000000000000000000000..6f29f32ea9f11ed63cc28c3f503129877880c5dc --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/client_socket.rb @@ -0,0 +1,155 @@ +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 or (code >= 3000 and 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_client_socket.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_client_socket.rb new file mode 100644 index 0000000000000000000000000000000000000000..a4bfe7db17e53cb077327eb3709a7547c564a884 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_client_socket.rb @@ -0,0 +1,48 @@ +require 'faye/websocket' + +module ActionCable + module Connection + class FayeClientSocket + def initialize(env, event_target, stream_event_loop, protocols) + @env = env + @event_target = event_target + @protocols = protocols + + @faye = nil + end + + def alive? + @faye && @faye.ready_state == Faye::WebSocket::API::OPEN + end + + def transmit(data) + connect + @faye.send data + end + + def close + @faye && @faye.close + end + + def protocol + @faye && @faye.protocol + end + + def rack_response + connect + @faye.rack_response + end + + private + def connect + return if @faye + @faye = Faye::WebSocket.new(@env, @protocols) + + @faye.on(:open) { |event| @event_target.on_open } + @faye.on(:message) { |event| @event_target.on_message(event.data) } + @faye.on(:close) { |event| @event_target.on_close(event.reason, event.code) } + @faye.on(:error) { |event| @event_target.on_error(event.message) } + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_event_loop.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_event_loop.rb new file mode 100644 index 0000000000000000000000000000000000000000..9c44b38bc38909e30fbeb683d5067dd4828806ca --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/faye_event_loop.rb @@ -0,0 +1,44 @@ +require 'thread' + +require 'eventmachine' +EventMachine.epoll if EventMachine.epoll? +EventMachine.kqueue if EventMachine.kqueue? + +module ActionCable + module Connection + class FayeEventLoop + @@mutex = Mutex.new + + def timer(interval, &block) + ensure_reactor_running + EMTimer.new(::EM::PeriodicTimer.new(interval, &block)) + end + + def post(task = nil, &block) + task ||= block + + ensure_reactor_running + ::EM.next_tick(&task) + end + + private + def ensure_reactor_running + return if EventMachine.reactor_running? + @@mutex.synchronize do + Thread.new { EventMachine.run } unless EventMachine.reactor_running? + Thread.pass until EventMachine.reactor_running? + end + end + + class EMTimer + def initialize(inner) + @inner = inner + end + + def shutdown + @inner.cancel + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/identification.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/identification.rb new file mode 100644 index 0000000000000000000000000000000000000000..4a54044affa86cf9b2f2f76b6b9dba3b90609aa5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/identification.rb @@ -0,0 +1,46 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/internal_channel.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/internal_channel.rb new file mode 100644 index 0000000000000000000000000000000000000000..f70d52f99bea27bfed170e27b201cea7d0c19939 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/internal_channel.rb @@ -0,0 +1,43 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/message_buffer.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/message_buffer.rb new file mode 100644 index 0000000000000000000000000000000000000000..6a80770cae89b1854ef8b3d605961811e62264c1 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/message_buffer.rb @@ -0,0 +1,53 @@ +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 + + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream.rb new file mode 100644 index 0000000000000000000000000000000000000000..0cf59091bc79e22eb400c26337a8658a7cf3992d --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream.rb @@ -0,0 +1,57 @@ +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 + 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) + return @rack_hijack_io.write(data) if @rack_hijack_io + return @stream_send.call(data) if @stream_send + rescue EOFError, Errno::ECONNRESET + @socket_object.client_gone + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream_event_loop.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream_event_loop.rb new file mode 100644 index 0000000000000000000000000000000000000000..2abad09c0320d39f746791844d4cb3a35068821b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/stream_event_loop.rb @@ -0,0 +1,103 @@ +require 'nio' +require 'thread' + +module ActionCable + module Connection + class StreamEventLoop + def initialize + @nio = @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 + + Concurrent.global_io_executor << task + end + + def attach(io, stream) + @todo << lambda do + @map[io] = stream + @nio.register(io, :r) + end + wakeup + end + + def detach(io, stream) + @todo << lambda do + @nio.deregister io + @map.delete io + 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 + @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 = @map[io] + + begin + stream.receive io.read_nonblock(4096) + rescue IO::WaitReadable + next + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb new file mode 100644 index 0000000000000000000000000000000000000000..6051818bfbff4be6e39007870c604e2b992f4be5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/subscriptions.rb @@ -0,0 +1,75 @@ +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 + + subscription_klass = id_options[:channel].safe_constantize + + if subscription_klass && ActionCable::Channel::Base >= subscription_klass + subscriptions[id_key] ||= subscription_klass.new(connection, id_key, id_options) + 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 + + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/tagged_logger_proxy.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/tagged_logger_proxy.rb new file mode 100644 index 0000000000000000000000000000000000000000..41afa9680a0038d7478fdb651fdaff1a1ad5f477 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/tagged_logger_proxy.rb @@ -0,0 +1,40 @@ +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 + + protected + def log(type, message) + tag(@logger) { @logger.send type, message } + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/web_socket.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/web_socket.rb new file mode 100644 index 0000000000000000000000000000000000000000..11f28c37e80293ac2b9fca796f7a2864a89be9e7 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/connection/web_socket.rb @@ -0,0 +1,39 @@ +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, client_socket_class, protocols: ActionCable::INTERNAL[:protocols]) + @websocket = ::WebSocket::Driver.websocket?(env) ? client_socket_class.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 + + protected + attr_reader :websocket + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/engine.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/engine.rb new file mode 100644 index 0000000000000000000000000000000000000000..96176e0014a7de7c88b818d7e27f56f8ab9064a4 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/engine.rb @@ -0,0 +1,77 @@ +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 ||= "http://localhost:3000" 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 = self.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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/gem_version.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/gem_version.rb new file mode 100644 index 0000000000000000000000000000000000000000..d04b16c1b51e15f47ba20d50170df605e28c4e81 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/gem_version.rb @@ -0,0 +1,15 @@ +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 = 0 + TINY = 0 + PRE = nil + + STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/helpers/action_cable_helper.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/helpers/action_cable_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..2081a37db6adaae7e6b04d020d56b5debd5c6f1c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/helpers/action_cable_helper.rb @@ -0,0 +1,40 @@ +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' => true %> + # + # + # 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/remote_connections.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/remote_connections.rb new file mode 100644 index 0000000000000000000000000000000000000000..a5280244278c8234b6ec8d8b1aa225a13d59c8fb --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/remote_connections.rb @@ -0,0 +1,66 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server.rb new file mode 100644 index 0000000000000000000000000000000000000000..bd6a3826a3e581338c9f2234936fbada93fc5b77 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server.rb @@ -0,0 +1,15 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/base.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..422c130913631d226f5e9e8806427c9b02132098 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/base.rb @@ -0,0 +1,83 @@ +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 + worker_pool.halt if @worker_pool + + @worker_pool = 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 ||= config.event_loop_class.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 db connection pool and block while they wait for other workers to release their connections. Use a smaller worker pool or a larger + # db 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/broadcasting.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/broadcasting.rb new file mode 100644 index 0000000000000000000000000000000000000000..8f93564113bd3f0e48390c82c3262d5533130739 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/broadcasting.rb @@ -0,0 +1,48 @@ +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.info "[ActionCable] Broadcasting to #{broadcasting}: #{message.inspect}" + encoded = coder ? coder.encode(message) : message + server.pubsub.broadcast broadcasting, encoded + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/configuration.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/configuration.rb new file mode 100644 index 0000000000000000000000000000000000000000..ada1ac22cc1faa7dd9b06f1c95450fdfcd1ed464 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/configuration.rb @@ -0,0 +1,56 @@ +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 :use_faye, :connection_class, :worker_pool_size + attr_accessor :disable_request_forgery_protection, :allowed_request_origins + attr_accessor :cable, :url, :mount_path + + def initialize + @log_tags = [] + + @connection_class = -> { ActionCable::Connection::Base } + @worker_pool_size = 4 + + @disable_request_forgery_protection = false + 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 + + def event_loop_class + if use_faye + ActionCable::Connection::FayeEventLoop + else + ActionCable::Connection::StreamEventLoop + end + end + + def client_socket_class + if use_faye + ActionCable::Connection::FayeClientSocket + else + ActionCable::Connection::ClientSocket + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/connections.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/connections.rb new file mode 100644 index 0000000000000000000000000000000000000000..5e61b4e335b14c45dd1f52d7287db1e0835ea96f --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/connections.rb @@ -0,0 +1,34 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker.rb new file mode 100644 index 0000000000000000000000000000000000000000..f3a4fc5a5b78bbf625858b655db078618a8881d3 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker.rb @@ -0,0 +1,75 @@ +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.kill + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker/active_record_connection_management.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker/active_record_connection_management.rb new file mode 100644 index 0000000000000000000000000000000000000000..c1e4aa8103565fd20136971b39986ef94541c88f --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/server/worker/active_record_connection_management.rb @@ -0,0 +1,19 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter.rb new file mode 100644 index 0000000000000000000000000000000000000000..72e62f3daf863c1830277e41a60e147abba73ac3 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter.rb @@ -0,0 +1,8 @@ +module ActionCable + module SubscriptionAdapter + extend ActiveSupport::Autoload + + autoload :Base + autoload :SubscriberMap + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/async.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/async.rb new file mode 100644 index 0000000000000000000000000000000000000000..10b3ac8cd8556cd04b62229cb43ba9b3eadcbfee --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/async.rb @@ -0,0 +1,27 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/base.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..796db5ffa354e7aad0bc8f8c5bf3b4b4a0257318 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/base.rb @@ -0,0 +1,28 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/evented_redis.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/evented_redis.rb new file mode 100644 index 0000000000000000000000000000000000000000..4735a4bfa8375ab39f21a39ac1dcdd3d66d819a4 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/evented_redis.rb @@ -0,0 +1,79 @@ +require 'thread' + +gem 'em-hiredis', '~> 0.3.0' +gem 'redis', '~> 3.0' +require 'em-hiredis' +require 'redis' + +EventMachine.epoll if EventMachine.epoll? +EventMachine.kqueue if EventMachine.kqueue? + +module ActionCable + module SubscriptionAdapter + class EventedRedis < Base # :nodoc: + @@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(*) + 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? + @@mutex.synchronize do + Thread.new { EventMachine.run } unless EventMachine.reactor_running? + Thread.pass until EventMachine.reactor_running? + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/inline.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/inline.rb new file mode 100644 index 0000000000000000000000000000000000000000..81357faead2c0f10dd0753b6e9d6fd38764b10c6 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/inline.rb @@ -0,0 +1,35 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/postgresql.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/postgresql.rb new file mode 100644 index 0000000000000000000000000000000000000000..66c7852f6e141b55869d67675e7039f14e542e5a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/postgresql.rb @@ -0,0 +1,107 @@ +gem 'pg', '~> 0.18' +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 'ActiveRecord database must be Postgres in order to use the Postgres ActionCable 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/redis.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/redis.rb new file mode 100644 index 0000000000000000000000000000000000000000..65434f71070a6b5e2660751fb38090cd4c4a4aaa --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/redis.rb @@ -0,0 +1,172 @@ +require 'thread' + +gem 'redis', '~> 3.0' +require 'redis' + +module ActionCable + module SubscriptionAdapter + class Redis < Base # :nodoc: + # 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.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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/subscriber_map.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/subscriber_map.rb new file mode 100644 index 0000000000000000000000000000000000000000..37eed097939d6b92ed69caab94fec9d16790fa93 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/subscription_adapter/subscriber_map.rb @@ -0,0 +1,53 @@ +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 { @subscribers[channel].dup } + 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/version.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/version.rb new file mode 100644 index 0000000000000000000000000000000000000000..e17877202bcb94cc16c6854d3ee6b7ea0a04294e --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/action_cable/version.rb @@ -0,0 +1,8 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/assets/compiled/action_cable.js b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/assets/compiled/action_cable.js new file mode 100644 index 0000000000000000000000000000000000000000..4c5f938630160ef2449f721cf2837e7b00c9b381 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/assets/compiled/action_cable.js @@ -0,0 +1,590 @@ +(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"] + }, + 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; + messages = 1 <= arguments.length ? slice.call(arguments, 0) : []; + if (this.debugging) { + messages.push(Date.now()); + return console.log.apply(console, ["[ActionCable]"].concat(slice.call(messages))); + } + } + }; + + if (typeof window !== "undefined" && window !== null) { + window.ActionCable = this.ActionCable; + } + + if (typeof module !== "undefined" && module !== null) { + module.exports = this.ActionCable; + } + +}).call(this); +(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())); + throw new Error("Existing connection must be closed before opening"); + } else { + ActionCable.log("Opening WebSocket, current state is " + (this.getState()) + ", subprotocols: " + protocols); + if (this.webSocket != null) { + this.uninstallEventHandlers(); + } + this.webSocket = new 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, error1; + 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); diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/USAGE b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/USAGE new file mode 100644 index 0000000000000000000000000000000000000000..6249553c2226ff8f96e51732a43bc2c264d731f5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/USAGE @@ -0,0 +1,14 @@ +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/javascript/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/javascript/channels/chat.coffee diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/channel_generator.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/channel_generator.rb new file mode 100644 index 0000000000000000000000000000000000000000..47232252e34161256596fb74e2a5a55d95eac013 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/channel_generator.rb @@ -0,0 +1,47 @@ +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 self.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 + + protected + 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 self.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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/channel.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/channel.rb new file mode 100644 index 0000000000000000000000000000000000000000..d56fa30f4d8a99c246e009091c4b4f34dcc9b2ab --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/channel.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading. +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/connection.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/connection.rb new file mode 100644 index 0000000000000000000000000000000000000000..b4f41389ad0ccbabc06d497f8626d61a5e919c04 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/application_cable/connection.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading. +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/cable.js b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/cable.js new file mode 100644 index 0000000000000000000000000000000000000000..71ee1e66de2ca69297c0e3434f452b3a09e26e9c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/cable.js @@ -0,0 +1,13 @@ +// 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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.coffee b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.coffee new file mode 100644 index 0000000000000000000000000000000000000000..5467811aba574a3838f5a0653f610e22af175b64 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.coffee @@ -0,0 +1,14 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.js b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.js new file mode 100644 index 0000000000000000000000000000000000000000..ab0e68b11aaf0ce67d77207085b3de1e18330dac --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/assets/channel.js @@ -0,0 +1,18 @@ +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/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/channel.rb b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/channel.rb new file mode 100644 index 0000000000000000000000000000000000000000..7bff3341c1947f278aeede1b1fdbf094edb7b2f0 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.0/lib/rails/generators/channel/templates/channel.rb @@ -0,0 +1,17 @@ +# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading. +<% 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/CHANGELOG.md b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..6070a4d366dba98655ded236fd032ee1f65f66ca --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/CHANGELOG.md @@ -0,0 +1,130 @@ +## Rails 5.0.0 (June 30, 2016) ## + +* Exception handling: use `rescue_from` to handle exceptions raised by + mailer actions, by message delivery, and by deferred delivery jobs. + + *Jeremy Daer* + +* Disallow calling `#deliver_later` after making local modifications to + the message which would be lost when the delivery job is enqueued. + + Prevents a common, hard-to-find bug like: + + message = Notifier.welcome(user, foo) + message.message_id = my_generated_message_id + message.deliver_later + + The message_id is silently lost! *Only the mailer arguments are passed + to the delivery job.* + + This raises an exception now. Make modifications to the message within + the mailer method instead, or use a custom Active Job to manage delivery + instead of using #deliver_later. + + *Jeremy Daer* + +* Removes `-t` from default Sendmail arguments to match the underlying + `Mail::Sendmail` setting. + + *Clayton Liggitt* + +* Add support for fragment caching in Action Mailer views. + + *Stan Lo* + +* Reset `ActionMailer::Base.deliveries` after every test in + `ActionDispatch::IntegrationTest`. + + *Yves Senn* + +* `config.action_mailer.default_url_options[:protocol]` is now set to `https` if `config.force_ssl` is set to `true`. + + *Andrew Kampjes* + +* Add `config.action_mailer.deliver_later_queue_name` configuration to set the + mailer queue name. + + *Chris McGrath* + +* `assert_emails` in block form, uses the given number as expected value. + This makes the error message much easier to understand. + + *Yuji Yaginuma* + +* Add support for inline images in mailer previews by using an interceptor + class to convert cid: urls in image src attributes to data urls. + + *Andrew White* + +* Mailer preview now uses `url_for` to fix links to emails for apps running on + a subdirectory. + + *Remo Mueller* + +* Mailer previews no longer crash when the `mail` method wasn't called + (`NullMail`). + + Fixes #19849. + + *Yves Senn* + +* Make sure labels and values line up in mailer previews. + + *Yves Senn* + +* Add `assert_enqueued_emails` and `assert_no_enqueued_emails`. + + Example: + + def test_emails + assert_enqueued_emails 2 do + ContactMailer.welcome.deliver_later + ContactMailer.welcome.deliver_later + end + end + + def test_no_emails + assert_no_enqueued_emails do + # No emails enqueued here + end + end + + *George Claghorn* + +* Add `_mailer` suffix to mailers created via generator, following the same + naming convention used in controllers and jobs. + + *Carlos Souza* + +* Remove deprecated `*_path` helpers in email views. + + *Rafael Mendonça França* + +* Remove deprecated `deliver` and `deliver!` methods. + + *claudiob* + +* Template lookup now respects default locale and I18n fallbacks. + + Given the following templates: + + mailer/demo.html.erb + mailer/demo.en.html.erb + mailer/demo.pt.html.erb + + Before this change, for a locale that doesn't have its associated file, the + `mailer/demo.html.erb` would be rendered even if `en` was the default locale. + + Now `mailer/demo.en.html.erb` has precedence over the file without locale. + + Also, it is possible to give a fallback. + + mailer/demo.pt.html.erb + mailer/demo.pt-BR.html.erb + + So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be rendered given + the right I18n fallback configuration. + + *Rafael Mendonça França* + +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes. diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/MIT-LICENSE b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/MIT-LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8573eb1225d81de1f3a4cecf0ecbf5349d81cfe2 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/MIT-LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2004-2016 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/README.rdoc b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/README.rdoc new file mode 100644 index 0000000000000000000000000000000000000000..397ebe42017d4e35d6264d1ddd5dc26bb0aca3bf --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/README.rdoc @@ -0,0 +1,175 @@ += 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer.rb new file mode 100644 index 0000000000000000000000000000000000000000..55c017e338e7bb7806f7a45bb0fc7689b621a91e --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer.rb @@ -0,0 +1,58 @@ +#-- +# Copyright (c) 2004-2016 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/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 :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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/base.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..1c2f6c9a17f8683acc4afdf4312c36959641c590 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/base.rb @@ -0,0 +1,967 @@ +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" } + # + # 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 + # + # = 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 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 } + # + # private + # + # def my_method + # 'some complex call' + # end + # end + # + # Note that the proc 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', 'peer', 'client_once', + # 'fail_if_no_peer_cert') or directly the constant (OpenSSL::SSL::VERIFY_NONE, + # OpenSSL::SSL::VERIFY_PEER, ...). + # + # * 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 -t 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. + class Base < AbstractController::Base + include DeliveryMethods + include Rescuable + 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 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 + + protected + + def set_payload_for_mail(payload, mail) #:nodoc: + 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) # :nodoc: + if action_methods.include?(method_name.to_s) + MessageDelivery.new(self, method_name, *args) + else + super + end + end + + private + + def respond_to_missing?(method, include_all = false) #:nodoc: + action_methods.include?(method.to_s) + 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 + } + + 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 + + protected + + # 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) + 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 = {}) + 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? + false + end + + private + + def apply_defaults(headers) + default_values = self.class.default.map do |key, value| + [ + key, + value.is_a?(Proc) ? instance_eval(&value) : value + ] + end.to_h + + headers_with_defaults = headers.reverse_merge(default_values) + headers_with_defaults[:subject] ||= default_i18n_subject + headers_with_defaults + 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] + [{ + body: headers.delete(:body), + content_type: self.class.default[:content_type] || "text/plain" + }] + else + collect_responses_from_templates(headers) + end + 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" + end + + ActiveSupport.run_load_hooks(:action_mailer, self) + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/collector.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/collector.rb new file mode 100644 index 0000000000000000000000000000000000000000..e8883a8235526d837ce270fbcc01115f55c895d2 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/collector.rb @@ -0,0 +1,30 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_job.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_job.rb new file mode 100644 index 0000000000000000000000000000000000000000..d371c1b61a4640d24702464fc97252b8aa64651b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_job.rb @@ -0,0 +1,34 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_methods.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_methods.rb new file mode 100644 index 0000000000000000000000000000000000000000..571c8e7d2a51b9648fe39367ecb4cd41b2102107 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/delivery_methods.rb @@ -0,0 +1,87 @@ +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 -t' + 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 ||= self.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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/gem_version.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/gem_version.rb new file mode 100644 index 0000000000000000000000000000000000000000..5fa42762f6078144e269852ce3e03bae0943bc75 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/gem_version.rb @@ -0,0 +1,15 @@ +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 = 0 + TINY = 0 + PRE = nil + + STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/inline_preview_interceptor.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/inline_preview_interceptor.rb new file mode 100644 index 0000000000000000000000000000000000000000..419d6c7b93ce69f153dbfc7c8e984604db1213aa --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/inline_preview_interceptor.rb @@ -0,0 +1,61 @@ +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_source.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 html_source + html_part.body.raw_source + 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/log_subscriber.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/log_subscriber.rb new file mode 100644 index 0000000000000000000000000000000000000000..2867bf90fb741b342a22178658341fe51525f7ab --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/log_subscriber.rb @@ -0,0 +1,39 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/mail_helper.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/mail_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..239974e7b1e10eeaf0b1ce52563cfcd8a37e328f --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/mail_helper.rb @@ -0,0 +1,70 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/message_delivery.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/message_delivery.rb new file mode 100644 index 0000000000000000000000000000000000000000..c5ba5f9f1dcb6986ed5f1619e3aa8e7ad17d22e2 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/message_delivery.rb @@ -0,0 +1,125 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/preview.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/preview.rb new file mode 100644 index 0000000000000000000000000000000000000000..aab92fe8dbf7192c43e1835a4fe2d9d266393885 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/preview.rb @@ -0,0 +1,118 @@ +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 = self.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 + + protected + def load_previews #:nodoc: + if preview_path + Dir["#{preview_path}/**/*_preview.rb"].each{ |file| require_dependency file } + end + end + + def preview_path #:nodoc: + Base.preview_path + end + + def show_previews #:nodoc: + Base.show_previews + end + + def inform_preview_interceptors(message) #:nodoc: + Base.preview_interceptors.each do |interceptor| + interceptor.previewing_email(message) + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/railtie.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/railtie.rb new file mode 100644 index 0000000000000000000000000000000000000000..a727ed38e9d89d34f8f5233a5cd293ffa162f6dc --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/railtie.rb @@ -0,0 +1,74 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/rescuable.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/rescuable.rb new file mode 100644 index 0000000000000000000000000000000000000000..f2eabfa0574f865f9d8e3d54b5023fc73f345fda --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/rescuable.rb @@ -0,0 +1,27 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_case.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_case.rb new file mode 100644 index 0000000000000000000000000000000000000000..b045e883ad5bc4fcbcad7d213bdf6553bd047221 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_case.rb @@ -0,0 +1,122 @@ +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 + 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 = self._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 + + protected + + def initialize_test_deliveries # :nodoc: + 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 # :nodoc: + restore_delivery_method + ActionMailer::Base.perform_deliveries = @old_perform_deliveries + end + + def set_delivery_method(method) # :nodoc: + @old_delivery_method = ActionMailer::Base.delivery_method + ActionMailer::Base.delivery_method = method + end + + def restore_delivery_method # :nodoc: + ActionMailer::Base.deliveries.clear + ActionMailer::Base.delivery_method = @old_delivery_method + end + + def set_expected_mail # :nodoc: + @expected = Mail.new + @expected.content_type ["text", "plain", { "charset" => charset }] + @expected.mime_version = '1.0' + end + + private + + 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_helper.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_helper.rb new file mode 100644 index 0000000000000000000000000000000000000000..e423aac389ff71772d51894543f471d126e6181b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/test_helper.rb @@ -0,0 +1,113 @@ +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, &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, &block + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/version.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/version.rb new file mode 100644 index 0000000000000000000000000000000000000000..06f80a8fdc02218e1c5584e46f4063ca43606594 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/action_mailer/version.rb @@ -0,0 +1,9 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/USAGE b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/USAGE new file mode 100644 index 0000000000000000000000000000000000000000..2b0a078109e951bd9ad8066d362084060bc3c1db --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/USAGE @@ -0,0 +1,17 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/mailer_generator.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/mailer_generator.rb new file mode 100644 index 0000000000000000000000000000000000000000..01bdfb0685b9e29f2995d47811191816d313c0a5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/mailer_generator.rb @@ -0,0 +1,37 @@ +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 self.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 + + protected + def file_name + @_file_name ||= super.gsub(/_mailer/i, '') + end + + private + 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/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/application_mailer.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/application_mailer.rb new file mode 100644 index 0000000000000000000000000000000000000000..00fb9bd48fa22db52a9837541264d102575d4006 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/application_mailer.rb @@ -0,0 +1,6 @@ +<% module_namespacing do -%> +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end +<% end %> diff --git a/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/mailer.rb b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/mailer.rb new file mode 100644 index 0000000000000000000000000000000000000000..348d3147586bee13c795dbfedce690d81c4bc54e --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionmailer-5.0.0/lib/rails/generators/mailer/templates/mailer.rb @@ -0,0 +1,17 @@ +<% 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/CHANGELOG.md b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..02be87e4ac501cd0ee0e300d9de6d9d2b0e9b575 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/CHANGELOG.md @@ -0,0 +1,822 @@ +## Rails 5.0.0 (June 30, 2016) ## + +* Add `ActionController#helpers` to get access to the view context at the controller + level. + + *Rafael Mendonça França* + +* Routing: Refactor `:action` default handling to ensure that path + parameters are not mutated during route generation. + + *Andrew White* + +* Add extension synonyms `yml` and `yaml` for MIME type `application/x-yaml`. + + *bogdanvlviv* + +* Adds support for including ActionController::Cookies in API controllers. + Previously, including the module would raise when trying to define + a `cookies` helper method. Skip calling #helper_method if it is not + defined -- if we don't have helpers, we needn't define one. + + Fixes #24304 + + *Ryan T. Hosford* + +* ETags: Introduce `Response#strong_etag=` and `#weak_etag=` and analogous + options for `fresh_when` and `stale?`. `Response#etag=` sets a weak ETag. + + Strong ETags are desirable when you're serving byte-for-byte identical + responses that support Range requests, like PDFs or videos (typically + done by reproxying the response from a backend storage service). + Also desirable when fronted by some CDNs that support strong ETags + only, like Akamai. + + *Jeremy Daer* + +* ETags: No longer strips quotes (") from ETag values before comparing them. + Quotes are significant, part of the ETag. A quoted ETag and an unquoted + one are not the same entity. + + *Jeremy Daer* + +* ETags: Support `If-None-Match: *`. Rarely useful for GET requests; meant + to provide some optimistic concurrency control for PUT requests. + + *Jeremy Daer* + +* `ActionDispatch::ParamsParser` is deprecated and was removed from the middleware + stack. To configure the parameter parsers use `ActionDispatch::Request.parameter_parsers=`. + + *tenderlove* + +* When a `respond_to` collector with a block doesn't have a response, then + a `:no_content` response should be rendered. This brings the default + rendering behavior introduced by https://github.com/rails/rails/issues/19036 + to controller methods employing `respond_to`. + + *Justin Coyne* + +* Add `ActionController::Parameters#dig` on Ruby 2.3 and greater, which + behaves the same as `Hash#dig`. + + *Sean Griffin* + +* Add request headers in the payload of the `start_processing.action_controller` + and `process_action.action_controller` notifications. + + *Gareth du Plooy* + +* Add `action_dispatch_integration_test` load hook. The hook can be used to + extend `ActionDispatch::IntegrationTest` once it has been loaded. + + *Yuichiro Kaneko* + +* Update default rendering policies when the controller action did + not explicitly indicate a response. + + For API controllers, the implicit render always renders "204 No Content" + and does not account for any templates. + + For other controllers, the following conditions are checked: + + First, if a template exists for the controller action, it is rendered. + This template lookup takes into account the action name, locales, format, + variant, template handlers, etc. (see `render` for details). + + Second, if other templates exist for the controller action but is not in + the right format (or variant, etc.), an `ActionController::UnknownFormat` + is raised. The list of available templates is assumed to be a complete + enumeration of all the possible formats (or variants, etc.); that is, + having only HTML and JSON templates indicate that the controller action is + not meant to handle XML requests. + + Third, if the current request is an "interactive" browser request (the user + navigated here by entering the URL in the address bar, submitting a form, + clicking on a link, etc. as opposed to an XHR or non-browser API request), + `ActionView::UnknownFormat` is raised to display a helpful error + message. + + Finally, it falls back to the same "204 No Content" behavior as API controllers. + + *Godfrey Chan*, *Jon Moss*, *Kasper Timm Hansen*, *Mike Clark*, *Matthew Draper* + +* Add "application/gzip" as a default mime type. + + *Mehmet Emin İNAÇ* + +* Add request encoding and response parsing to integration tests. + + What previously was: + + ```ruby + require 'test_helper' + + class ApiTest < ActionDispatch::IntegrationTest + test 'creates articles' do + assert_difference -> { Article.count } do + post articles_path(format: :json), + params: { article: { title: 'Ahoy!' } }.to_json, + headers: { 'Content-Type' => 'application/json' } + end + + assert_equal({ 'id' => Article.last.id, 'title' => 'Ahoy!' }, JSON.parse(response.body)) + end + end + ``` + + Can now be written as: + + ```ruby + require 'test_helper' + + class ApiTest < ActionDispatch::IntegrationTest + test 'creates articles' do + assert_difference -> { Article.count } do + post articles_path, params: { article: { title: 'Ahoy!' } }, as: :json + end + + assert_equal({ 'id' => Article.last.id, 'title' => 'Ahoy!' }, response.parsed_body) + end + end + ``` + + Passing `as: :json` to integration test request helpers will set the format, + content type and encode the parameters as JSON. + + Then on the response side, `parsed_body` will parse the body according to the + content type the response has. + + Currently JSON is the only supported MIME type. Add your own with + `ActionDispatch::IntegrationTest.register_encoder`. + + *Kasper Timm Hansen* + +* Add "image/svg+xml" as a default mime type. + + *DHH* + +* Add `-g` and `-c` options to `bin/rails routes`. These options return the url `name`, `verb` and + `path` field that match the pattern or match a specific controller. + + Deprecate `CONTROLLER` env variable in `bin/rails routes`. + + See #18902. + + *Anton Davydov*, *Vipul A M* + +* Response etags to always be weak: Prefixes 'W/' to value returned by + `ActionDispatch::Http::Cache::Response#etag=`, such that etags set in + `fresh_when` and `stale?` are weak. + + Fixes #17556. + + *Abhishek Yadav* + +* Provide the name of HTTP Status code in assertions. + + *Sean Collins* + +* More explicit error message when running `rake routes`. `CONTROLLER` argument + can now be supplied in different ways: + `Rails::WelcomeController`, `Rails::Welcome`, `rails/welcome`. + + Fixes #22918. + + *Edouard Chin* + +* Allow `ActionController::Parameters` instances as an argument to URL + helper methods. An `ArgumentError` will be raised if the passed parameters + are not secure. + + Fixes #22832. + + *Prathamesh Sonpatki* + +* Add option for per-form CSRF tokens. + + *Greg Ose*, *Ben Toews* + +* Fix `ActionController::Parameters#convert_parameters_to_hashes` to return filtered + or unfiltered values based on from where it is called, `to_h` or `to_unsafe_h` + respectively. + + Fixes #22841. + + *Prathamesh Sonpatki* + +* Add `ActionController::Parameters#include?` + + *Justin Coyne* + +* Deprecate `redirect_to :back` in favor of `redirect_back`, which accepts a + required `fallback_location` argument, thus eliminating the possibility of a + `RedirectBackError`. + + *Derek Prior* + +* Add `redirect_back` method to `ActionController::Redirecting` to provide a + way to safely redirect to the `HTTP_REFERER` if it is present, falling back + to a provided redirect otherwise. + + *Derek Prior* + +* `ActionController::TestCase` will be moved to its own gem in Rails 5.1. + + With the speed improvements made to `ActionDispatch::IntegrationTest` we no + longer need to keep two separate code bases for testing controllers. In + Rails 5.1 `ActionController::TestCase` will be deprecated and moved into a + gem outside of Rails source. + + This is a documentation deprecation so that going forward new tests will use + `ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`. + + *Eileen M. Uchitelle* + +* Add a `response_format` option to `ActionDispatch::DebugExceptions` + to configure the format of the response when errors occur in + development mode. + + If `response_format` is `:default` the debug info will be rendered + in an HTML page. In the other hand, if the provided value is `:api` + the debug info will be rendered in the original response format. + + *Jorge Bejar* + +* Change the `protect_from_forgery` prepend default to `false`. + + Per this comment + https://github.com/rails/rails/pull/18334#issuecomment-69234050 we want + `protect_from_forgery` to default to `prepend: false`. + + `protect_from_forgery` will now be inserted into the callback chain at the + point it is called in your application. This is useful for cases where you + want to `protect_from_forgery` after you perform required authentication + callbacks or other callbacks that are required to run after forgery protection. + + If you want `protect_from_forgery` callbacks to always run first, regardless of + position they are called in your application then you can add `prepend: true` + to your `protect_from_forgery` call. + + Example: + + ```ruby + protect_from_forgery prepend: true + ``` + + *Eileen M. Uchitelle* + +* In url_for, never append a question mark to the URL when the query string + is empty anyway. (It used to do that when called like `url_for(controller: + 'x', action: 'y', q: {})`.) + + *Paul Grayson* + +* Catch invalid UTF-8 querystring values and respond with BadRequest + + Check querystring params for invalid UTF-8 characters, and raise an + ActionController::BadRequest error if present. Previously these strings + would typically trigger errors further down the stack. + + *Grey Baker* + +* Parse RSS/ATOM responses as XML, not HTML. + + *Alexander Kaupanin* + +* Show helpful message in `BadRequest` exceptions due to invalid path + parameter encodings. + + Fixes #21923. + + *Agis Anastasopoulos* + +* Add the ability of returning arbitrary headers to `ActionDispatch::Static`. + + Now ActionDispatch::Static can accept HTTP headers so that developers + will have control of returning arbitrary headers like + 'Access-Control-Allow-Origin' when a response is delivered. They can be + configured with `#config`: + + Example: + + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=60", + "Access-Control-Allow-Origin" => "http://rubyonrails.org" + } + + *Yuki Nishijima* + +* Allow multiple `root` routes in same scope level. Example: + + Example: + + root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) } + root 'landing#show' + + *Rafael Sales* + +* Fix regression in mounted engine named routes generation for app deployed to + a subdirectory. `relative_url_root` was prepended to the path twice (e.g. + "/subdir/subdir/engine_path" instead of "/subdir/engine_path") + + Fixes #20920. Fixes #21459. + + *Matthew Erhard* + +* `ActionDispatch::Response#new` no longer applies default headers. If you want + default headers applied to the response object, then call + `ActionDispatch::Response.create`. This change only impacts people who are + directly constructing an `ActionDispatch::Response` object. + +* Accessing mime types via constants like `Mime::HTML` is deprecated. Please + change code like this: + + Mime::HTML + + To this: + + Mime[:html] + + This change is so that Rails will not manage a list of constants, and fixes + an issue where if a type isn't registered you could possibly get the wrong + object. + + `Mime[:html]` is available in older versions of Rails, too, so you can + safely change libraries and plugins and maintain compatibility with + multiple versions of Rails. + +* `url_for` does not modify its arguments when generating polymorphic URLs. + + *Bernerd Schaefer* + +* Make it easier to opt in to `config.force_ssl` and `config.ssl_options` by + making them less dangerous to try and easier to disable. + + SSL redirect: + * Move `:host` and `:port` options within `redirect: { … }`. Deprecate. + * Introduce `:status` and `:body` to customize the redirect response. + The 301 permanent default makes it difficult to test the redirect and + back out of it since browsers remember the 301. Test with a 302 or 307 + instead, then switch to 301 once you're confident that all is well. + + HTTP Strict Transport Security (HSTS): + * Shorter max-age. Shorten the default max-age from 1 year to 180 days, + the low end for https://www.ssllabs.com/ssltest/ grading and greater + than the 18-week minimum to qualify for browser preload lists. + * Disabling HSTS. Setting `hsts: false` now sets `hsts { expires: 0 }` + instead of omitting the header. Omitting does nothing to disable HSTS + since browsers hang on to your previous settings until they expire. + Sending `{ hsts: { expires: 0 }}` flushes out old browser settings and + actually disables HSTS: + http://tools.ietf.org/html/rfc6797#section-6.1.1 + * HSTS Preload. Introduce `preload: true` to set the `preload` flag, + indicating that your site may be included in browser preload lists, + including Chrome, Firefox, Safari, IE11, and Edge. Submit your site: + https://hstspreload.appspot.com + + *Jeremy Daer* + +* Update `ActionController::TestSession#fetch` to behave more like + `ActionDispatch::Request::Session#fetch` when using non-string keys. + + *Jeremy Friesen* + +* Using strings or symbols for middleware class names is deprecated. Convert + things like this: + + middleware.use "Foo::Bar" + + to this: + + middleware.use Foo::Bar + +* `ActionController::TestSession` now accepts a default value as well as + a block for generating a default value based off the key provided. + + This fixes calls to `session#fetch` in `ApplicationController` instances that + take more two arguments or a block from raising `ArgumentError: wrong + number of arguments (2 for 1)` when performing controller tests. + + *Matthew Gerrior* + +* Fix `ActionController::Parameters#fetch` overwriting `KeyError` returned by + default block. + + *Jonas Schuber Erlandsson*, *Roque Pinel* + +* `ActionController::Parameters` no longer inherits from + `HashWithIndifferentAccess` + + Inheriting from `HashWithIndifferentAccess` allowed users to call any + enumerable methods on `Parameters` object, resulting in a risk of losing the + `permitted?` status or even getting back a pure `Hash` object instead of + a `Parameters` object with proper sanitization. + + By not inheriting from `HashWithIndifferentAccess`, we are able to make + sure that all methods that are defined in `Parameters` object will return + a proper `Parameters` object with a correct `permitted?` flag. + + *Prem Sichanugrist* + +* Replaced `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` + from the concurrent-ruby gem. + + *Jerry D'Antonio* + +* Add ability to filter parameters based on parent keys. + + # matches {credit_card: {code: "xxxx"}} + # doesn't match {file: { code: "xxxx"}} + config.filter_parameters += [ "credit_card.code" ] + + See #13897. + + *Guillaume Malette* + +* Deprecate passing first parameter as `Hash` and default status code for `head` method. + + *Mehmet Emin İNAÇ* + +* Adds`Rack::Utils::ParameterTypeError` and `Rack::Utils::InvalidParameterError` + to the rescue_responses hash in `ExceptionWrapper` (Rack recommends + integrators serve 400s for both of these). + + *Grey Baker* + +* Add support for API only apps. + `ActionController::API` is added as a replacement of + `ActionController::Base` for this kind of applications. + + *Santiago Pastorino*, *Jorge Bejar* + +* Remove `assigns` and `assert_template`. Both methods have been extracted + into a gem at https://github.com/rails/rails-controller-testing. + + See #18950. + + *Alan Guo Xiang Tan* + +* `FileHandler` and `Static` middleware initializers accept `index` argument + to configure the directory index file name. Defaults to `index` (as in + `index.html`). + + See #20017. + + *Eliot Sykes* + +* Deprecate `:nothing` option for `render` method. + + *Mehmet Emin İNAÇ* + +* Fix `rake routes` not showing the right format when + nesting multiple routes. + + See #18373. + + *Ravil Bayramgalin* + +* Add ability to override default form builder for a controller. + + class AdminController < ApplicationController + default_form_builder AdminFormBuilder + end + + *Kevin McPhillips* + +* For actions with no corresponding templates, render `head :no_content` + instead of raising an error. This allows for slimmer API controller + methods that simply work, without needing further instructions. + + See #19036. + + *Stephen Bussey* + +* Provide friendlier access to request variants. + + request.variant = :phone + request.variant.phone? # true + request.variant.tablet? # false + + request.variant = [:phone, :tablet] + request.variant.phone? # true + request.variant.desktop? # false + request.variant.any?(:phone, :desktop) # true + request.variant.any?(:desktop, :watch) # false + + *George Claghorn* + +* Fix regression where a gzip file response would have a Content-type, + even when it was a 304 status code. + + See #19271. + + *Kohei Suzuki* + +* Fix handling of empty `X_FORWARDED_HOST` header in `raw_host_with_port`. + + Previously, an empty `X_FORWARDED_HOST` header would cause + `Actiondispatch::Http:URL.raw_host_with_port` to return `nil`, causing + `Actiondispatch::Http:URL.host` to raise a `NoMethodError`. + + *Adam Forsyth* + +* Allow `Bearer` as token-keyword in `Authorization-Header`. + + Additionally to `Token`, the keyword `Bearer` is acceptable as a keyword + for the auth-token. The `Bearer` keyword is described in the original + OAuth RFC and used in libraries like Angular-JWT. + + See #19094. + + *Peter Schröder* + +* Drop request class from `RouteSet` constructor. + + If you would like to use a custom request class, please subclass and implement + the `request_class` method. + + *tenderlove@ruby-lang.org* + +* Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`. + + Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not + prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack) + is set, it takes precedence. + + Fixes #5122. + + *Yasyf Mohamedali* + +* Partitioning of routes is now done when the routes are being drawn. This + helps to decrease the time spent filtering the routes during the first request. + + *Guo Xiang Tan* + +* Fix regression in functional tests. Responses should have default headers + assigned. + + See #18423. + + *Jeremy Kemper*, *Yves Senn* + +* Deprecate `AbstractController#skip_action_callback` in favor of individual skip_callback methods + (which can be made to raise an error if no callback was removed). + + *Iain Beeston* + +* Alias the `ActionDispatch::Request#uuid` method to `ActionDispatch::Request#request_id`. + Due to implementation, `config.log_tags = [:request_id]` also works in substitute + for `config.log_tags = [:uuid]`. + + *David Ilizarov* + +* Change filter on /rails/info/routes to use an actual path regexp from rails + and not approximate javascript version. Oniguruma supports much more + extensive list of features than javascript regexp engine. + + Fixes #18402. + + *Ravil Bayramgalin* + +* Non-string authenticity tokens do not raise NoMethodError when decoding + the masked token. + + *Ville Lautanala* + +* Add `http_cache_forever` to Action Controller, so we can cache a response + that never gets expired. + + *arthurnn* + +* `ActionController#translate` supports symbols as shortcuts. + When a shortcut is given it also performs the lookup without the action + name. + + *Max Melentiev* + +* Expand `ActionController::ConditionalGet#fresh_when` and `stale?` to also + accept a collection of records as the first argument, so that the + following code can be written in a shorter form. + + # Before + def index + @articles = Article.all + fresh_when(etag: @articles, last_modified: @articles.maximum(:updated_at)) + end + + # After + def index + @articles = Article.all + fresh_when(@articles) + end + + *claudiob* + +* Explicitly ignored wildcard verbs when searching for HEAD routes before fallback + + Fixes an issue where a mounted rack app at root would intercept the HEAD + request causing an incorrect behavior during the fall back to GET requests. + + Example: + + draw do + get '/home' => 'test#index' + mount rack_app, at: '/' + end + head '/home' + assert_response :success + + In this case, a HEAD request runs through the routes the first time and fails + to match anything. Then, it runs through the list with the fallback and matches + `get '/home'`. The original behavior would match the rack app in the first pass. + + *Terence Sun* + +* Discarded flash messages get removed before storing into session. + + *Samuel Cochran* + +* Migrating xhr methods to keyword arguments syntax + in `ActionController::TestCase` and `ActionDispatch::Integration` + + Old syntax: + + xhr :get, :create, params: { id: 1 } + + New syntax example: + + get :create, params: { id: 1 }, xhr: true + + *Kir Shatrov* + +* Migrating to keyword arguments syntax in `ActionController::TestCase` and + `ActionDispatch::Integration` HTTP request methods. + + Example: + + post :create, params: { y: x }, session: { a: 'b' } + get :view, params: { id: 1 } + get :view, params: { id: 1 }, format: :json + + *Kir Shatrov* + +* Preserve default url options when generating URLs. + + Fixes an issue that would cause `default_url_options` to be lost when + generating URLs with fewer positional arguments than parameters in the + route definition. + + *Tekin Suleyman* + +* Deprecate `*_via_redirect` integration test methods. + + Use `follow_redirect!` manually after the request call for the same behavior. + + *Aditya Kapoor* + +* Add `ActionController::Renderer` to render arbitrary templates + outside controller actions. + + Its functionality is accessible through class methods `render` and + `renderer` of `ActionController::Base`. + + *Ravil Bayramgalin* + +* Support `:assigns` option when rendering with controllers/mailers. + + *Ravil Bayramgalin* + +* Default headers, removed in controller actions, are no longer reapplied on + the test response. + + *Jonas Baumann* + +* Deprecate all `*_filter` callbacks in favor of `*_action` callbacks. + + *Rafael Mendonça França* + +* Allow you to pass `prepend: false` to `protect_from_forgery` to have the + verification callback appended instead of prepended to the chain. + This allows you to let the verification step depend on prior callbacks. + + Example: + + class ApplicationController < ActionController::Base + before_action :authenticate + protect_from_forgery prepend: false, unless: -> { @authenticated_by.oauth? } + + private + def authenticate + if oauth_request? + # authenticate with oauth + @authenticated_by = 'oauth'.inquiry + else + # authenticate with cookies + @authenticated_by = 'cookie'.inquiry + end + end + end + + *Josef Šimánek* + +* Remove `ActionController::HideActions`. + + *Ravil Bayramgalin* + +* Remove `respond_to`/`respond_with` placeholder methods, this functionality + has been extracted to the `responders` gem. + + *Carlos Antonio da Silva* + +* Remove deprecated assertion files. + + *Rafael Mendonça França* + +* Remove deprecated usage of string keys in URL helpers. + + *Rafael Mendonça França* + +* Remove deprecated `only_path` option on `*_path` helpers. + + *Rafael Mendonça França* + +* Remove deprecated `NamedRouteCollection#helpers`. + + *Rafael Mendonça França* + +* Remove deprecated support to define routes with `:to` option that doesn't contain `#`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Response#to_ary`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Request#deep_munge`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`. + + *Rafael Mendonça França* + +* Remove deprecated option `use_route` in controller tests. + + *Rafael Mendonça França* + +* Ensure `append_info_to_payload` is called even if an exception is raised. + + Fixes an issue where when an exception is raised in the request the additional + payload data is not available. + + See #14903. + + *Dieter Komendera*, *Margus Pärt* + +* Correctly rely on the response's status code to handle calls to `head`. + + *Robin Dupret* + +* Using `head` method returns empty response_body instead + of returning a single space " ". + + The old behavior was added as a workaround for a bug in an early + version of Safari, where the HTTP headers are not returned correctly + if the response body has a 0-length. This is been fixed since and + the workaround is no longer necessary. + + Fixes #18253. + + *Prathamesh Sonpatki* + +* Fix how polymorphic routes works with objects that implement `to_model`. + + *Travis Grathwell* + +* Stop converting empty arrays in `params` to `nil`. + + This behavior was introduced in response to CVE-2012-2660, CVE-2012-2694 + and CVE-2013-0155 + + ActiveRecord now issues a safe query when passing an empty array into + a where clause, so there is no longer a need to defend against this type + of input (any nils are still stripped from the array). + + *Chris Sinjakli* + +* Remove `ActionController::ModelNaming` module. + + *claudiob* + +* Fixed usage of optional scopes in url helpers. + + *Alex Robbin* + +* Fixed handling of positional url helper arguments when `format: false`. + + Fixes #17819. + + *Andrew White*, *Tatiana Soukiassian* + +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md) for previous changes. diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/MIT-LICENSE b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/MIT-LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..8573eb1225d81de1f3a4cecf0ecbf5349d81cfe2 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/MIT-LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2004-2016 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/README.rdoc b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/README.rdoc new file mode 100644 index 0000000000000000000000000000000000000000..0720c66cb9089175b6baaba7cb9f1a58f03c7cd1 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/README.rdoc @@ -0,0 +1,57 @@ += 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..1e57cbaac46862f4761a4a45a7840a52d58e4a73 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller.rb @@ -0,0 +1,24 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/asset_paths.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/asset_paths.rb new file mode 100644 index 0000000000000000000000000000000000000000..e6170228d9ce50e7e270767eac3502c658184b59 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/asset_paths.rb @@ -0,0 +1,10 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/base.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..aa06f70433c6790435b4577ff9f1c68f89c1d268 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/base.rb @@ -0,0 +1,259 @@ +require 'erubis' +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 + + undef_method :not_implemented + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching.rb new file mode 100644 index 0000000000000000000000000000000000000000..0dea50889a9ef0157c7ac1316eb2d4855826a85c --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching.rb @@ -0,0 +1,62 @@ +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? + + 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 + + protected + # Convenience accessor. + def cache(key, options = {}, &block) + if cache_configured? + cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block) + else + yield + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching/fragments.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching/fragments.rb new file mode 100644 index 0000000000000000000000000000000000000000..3257a731ed737f3f65c41903048118e3604299f0 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/caching/fragments.rb @@ -0,0 +1,143 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb new file mode 100644 index 0000000000000000000000000000000000000000..3ef8da86faacbff301c5cc9374b302fd0ef832de --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb @@ -0,0 +1,229 @@ +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 + + # Skip before, after, and around action callbacks matching any of the names. + # + # ==== Parameters + # * names - A list of valid names that could be used for + # callbacks. Note that skipping uses Ruby equality, so it's + # impossible to skip a callback defined using an anonymous proc + # using #skip_action_callback. + def skip_action_callback(*names) + ActiveSupport::Deprecation.warn('`skip_action_callback` is deprecated and will be removed in Rails 5.1. Please use skip_before_action, skip_after_action or skip_around_action instead.') + skip_before_action(*names, raise: false) + skip_after_action(*names, raise: false) + skip_around_action(*names, raise: false) + end + + def skip_filter(*names) + ActiveSupport::Deprecation.warn("`skip_filter` is deprecated and will be removed in Rails 5.1. Use skip_before_action, skip_after_action or skip_around_action instead.") + skip_action_callback(*names) + 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 "#{callback}_filter" do |*names, &blk| + ActiveSupport::Deprecation.warn("#{callback}_filter is deprecated and will be removed in Rails 5.1. Use #{callback}_action instead.") + send("#{callback}_action", *names, &blk) + 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 + + define_method "prepend_#{callback}_filter" do |*names, &blk| + ActiveSupport::Deprecation.warn("prepend_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use prepend_#{callback}_action instead.") + send("prepend_#{callback}_action", *names, &blk) + 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 + + define_method "skip_#{callback}_filter" do |*names, &blk| + ActiveSupport::Deprecation.warn("skip_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use skip_#{callback}_action instead.") + send("skip_#{callback}_action", *names, &blk) + end + + # *_action is the same as append_*_action + alias_method :"append_#{callback}_action", :"#{callback}_action" + + define_method "append_#{callback}_filter" do |*names, &blk| + ActiveSupport::Deprecation.warn("append_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use append_#{callback}_action instead.") + send("append_#{callback}_action", *names, &blk) + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/collector.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/collector.rb new file mode 100644 index 0000000000000000000000000000000000000000..55654be22420051621c66b5396175cda004222f8 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/collector.rb @@ -0,0 +1,41 @@ +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 self.instance_methods.include?(mime.to_sym) + end + + protected + + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/error.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/error.rb new file mode 100644 index 0000000000000000000000000000000000000000..7fafce4dd4fedba58d971dd946b18d5f11303d97 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/error.rb @@ -0,0 +1,4 @@ +module AbstractController + class Error < StandardError #:nodoc: + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/helpers.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/helpers.rb new file mode 100644 index 0000000000000000000000000000000000000000..ab4355296b3be1b3062d1ffd5133366dbff0ec40 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/helpers.rb @@ -0,0 +1,195 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/logger.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/logger.rb new file mode 100644 index 0000000000000000000000000000000000000000..c31ea6c5b52c7fd6a6e09e4dcead706a64c248fc --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/logger.rb @@ -0,0 +1,12 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/railties/routes_helpers.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/railties/routes_helpers.rb new file mode 100644 index 0000000000000000000000000000000000000000..14b574e32282549cb4e06858a4e93db37dff7d9a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/railties/routes_helpers.rb @@ -0,0 +1,18 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/rendering.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/rendering.rb new file mode 100644 index 0000000000000000000000000000000000000000..4ba2c269499392b2eb7a34c48080ae365c24c955 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/rendering.rb @@ -0,0 +1,136 @@ +require 'abstract_controller/error' +require 'active_support/concern' +require 'active_support/core_ext/class/attribute' +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 _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) + #TODO: remove defined? when we restore AP <=> AV dependency + if defined?(request) && !request.nil? && request.variant.present? + options[:variant] = request.variant + end + _normalize_options(options) + options + end + + def _protected_ivars # :nodoc: + DEFAULT_PROTECTED_INSTANCE_VARIABLES + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/translation.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/translation.rb new file mode 100644 index 0000000000000000000000000000000000000000..56b8ce895e3ffbf4237c18c942e1ead2f11b788a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/translation.rb @@ -0,0 +1,29 @@ +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 + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/url_for.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/url_for.rb new file mode 100644 index 0000000000000000000000000000000000000000..72d07b09270294e43ee12ddf087c7af8c12ce2c9 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/abstract_controller/url_for.rb @@ -0,0 +1,33 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller.rb new file mode 100644 index 0000000000000000000000000000000000000000..62f59052052d860ccd3162518271282d1fdf3520 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller.rb @@ -0,0 +1,61 @@ +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 :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 :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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api.rb new file mode 100644 index 0000000000000000000000000000000000000000..6bbebb7b4c5b78a0454f64be6bbc8f276dbc1ba8 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api.rb @@ -0,0 +1,147 @@ +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 + # + # Quite straightforward. 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, self) + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api/api_rendering.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api/api_rendering.rb new file mode 100644 index 0000000000000000000000000000000000000000..3a08d28c393c2c5d49fc1ce8cd55a46fd4b193e3 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/api/api_rendering.rb @@ -0,0 +1,14 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/base.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/base.rb new file mode 100644 index 0000000000000000000000000000000000000000..d546d7260c99326744cb7eb595caccda79f48cb1 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/base.rb @@ -0,0 +1,265 @@ +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 in turn 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 stemming 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) + # + # And retrieved 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, + Caching, + MimeResponds, + ImplicitRender, + StrongParameters, + + 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 + + ActiveSupport.run_load_hooks(:action_controller, self) + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/caching.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/caching.rb new file mode 100644 index 0000000000000000000000000000000000000000..a9a8508abc36fb4c7c3d2b3d103e864f472e1f76 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/caching.rb @@ -0,0 +1,44 @@ +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" + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/form_builder.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/form_builder.rb new file mode 100644 index 0000000000000000000000000000000000000000..f2656ca894a773afe52e59475c5ac94b38836e70 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/form_builder.rb @@ -0,0 +1,48 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/log_subscriber.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/log_subscriber.rb new file mode 100644 index 0000000000000000000000000000000000000000..a0917b4fdbb0d159bd1fd5d176eada38a0acd0d4 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/log_subscriber.rb @@ -0,0 +1,76 @@ +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.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? + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal.rb new file mode 100644 index 0000000000000000000000000000000000000000..f6e67b02d757ef745ce40496ff46d4e1134fbd1a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal.rb @@ -0,0 +1,266 @@ +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(get_class(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! + + def env + @_request.env + end + deprecate :env + + # 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.create.tap do |res| + res.request = request + end + 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 + + # Makes the controller a Rack endpoint that runs the action in the given + # +env+'s +action_dispatch.request.path_parameters+ key. + def self.call(env) + req = ActionDispatch::Request.new env + action(req.path_parameters[:action]).call(env) + end + class << self; deprecate :call; 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/basic_implicit_render.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/basic_implicit_render.rb new file mode 100644 index 0000000000000000000000000000000000000000..cef65a362c5b01e83ae028eb22c65e5d5b787026 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/basic_implicit_render.rb @@ -0,0 +1,11 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/conditional_get.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/conditional_get.rb new file mode 100644 index 0000000000000000000000000000000000000000..480e265e4405daca328d403fa638d958c29f7126 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/conditional_get.rb @@ -0,0 +1,272 @@ +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 so no caching should + # occur by the browser or intermediate caches (like caching proxy servers). + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/cookies.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/cookies.rb new file mode 100644 index 0000000000000000000000000000000000000000..44925641a1cfe4234ab117afc7946dff05555644 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/cookies.rb @@ -0,0 +1,14 @@ +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/data_streaming.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/data_streaming.rb new file mode 100644 index 0000000000000000000000000000000000000000..6cd6130032e4e467e1fa22490340e8ad0a39dd79 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/data_streaming.rb @@ -0,0 +1,150 @@ +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: + + protected + # 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) and 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 + + private + def send_file_headers!(options) + type_provided = options.has_key?(:type) + + 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' + + response.sending_file = true + + # 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/etag_with_template_digest.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/etag_with_template_digest.rb new file mode 100644 index 0000000000000000000000000000000000000000..669cf55bcaf9c39b4d55de99699e89e2ac50bde3 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/etag_with_template_digest.rb @@ -0,0 +1,50 @@ +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 + + def pick_template_for_etag(options) + options.fetch(:template) { "#{controller_name}/#{action_name}" } + end + + def lookup_and_digest_template(template) + ActionView::Digestor.digest name: template, finder: lookup_context + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/exceptions.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/exceptions.rb new file mode 100644 index 0000000000000000000000000000000000000000..5c0ada37be5d1fe9b4d896ff22332ca75aa6a8b6 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/exceptions.rb @@ -0,0 +1,64 @@ +module ActionController + class ActionControllerError < StandardError #:nodoc: + end + + class BadRequest < ActionControllerError #:nodoc: + def initialize(msg = nil, e = nil) + if e + ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \ + "Exceptions will automatically capture the original exception.", caller) + end + + super(msg) + set_backtrace $!.backtrace if $! + end + + def original_exception + ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller) + cause + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/flash.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/flash.rb new file mode 100644 index 0000000000000000000000000000000000000000..65351284b9f6c49b1530c3ae6875aa817390d78e --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/flash.rb @@ -0,0 +1,60 @@ +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 + + protected + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/force_ssl.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/force_ssl.rb new file mode 100644 index 0000000000000000000000000000000000000000..ea8e91ce2442d41b7d2a210b9325dc0c7ea2391b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/force_ssl.rb @@ -0,0 +1,97 @@ +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 HTTPS + # protocol. This will ensure that user's 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 transferred via HTTPS protocol and 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 + # under 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 & + # 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) + redirect_to secure_url, options.slice(*REDIRECT_OPTIONS) + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/head.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/head.rb new file mode 100644 index 0000000000000000000000000000000000000000..5e9832fd4edf66e975d298a1c8ddbcd0a3901b94 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/head.rb @@ -0,0 +1,64 @@ +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) + msg = status[:status] ? 'The :status option' : 'The implicit :ok status' + options, status = status, status.delete(:status) + + ActiveSupport::Deprecation.warn(<<-MSG.squish) + #{msg} on `head` has been deprecated and will be removed in Rails 5.1. + Please pass the status as a separate parameter before the options, instead. + MSG + 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?(self.response_code) + self.content_type = content_type || (Mime[formats.first] if formats) + self.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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/helpers.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/helpers.rb new file mode 100644 index 0000000000000000000000000000000000000000..22493dea50d5360a63671b05ff7dfead9eebeaab --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/helpers.rb @@ -0,0 +1,122 @@ +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| -%> + #

          + # <%= format_time(event.time, :short, "N/A") %> | <%= event.name %> + #

          + # <% 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 helpers 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 helpers methods from outside the view. + def helpers + @_helper_proxy ||= view_context + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/http_authentication.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/http_authentication.rb new file mode 100644 index 0000000000000000000000000000000000000000..4639348509f3f099f3c161506e2f8b3da2f5d404 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/http_authentication.rb @@ -0,0 +1,521 @@ +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 + # + # protected + # 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 + # + # protected + # 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/implicit_render.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/implicit_render.rb new file mode 100644 index 0000000000000000000000000000000000000000..6192fc0f9c58ba832d4678aee5a404bd28357356 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/implicit_render.rb @@ -0,0 +1,74 @@ +require 'active_support/core_ext/string/strip' + +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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/instrumentation.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/instrumentation.rb new file mode 100644 index 0000000000000000000000000000000000000000..624a6d5b764ede5b6c6e317d9db175ff9d8aba79 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/instrumentation.rb @@ -0,0 +1,109 @@ +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 => self.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 #:nodoc: + 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) #:nodoc: + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/live.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/live.rb new file mode 100644 index 0000000000000000000000000000000000000000..5d395cd8bd5c3fa9e1e3b1ee50b47c00c2ce7de0 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/live.rb @@ -0,0 +1,306 @@ +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) + while str = @buf.pop + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/mime_responds.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/mime_responds.rb new file mode 100644 index 0000000000000000000000000000000000000000..2e89af1a5e027271db0c81103965e433b985ae62 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/mime_responds.rb @@ -0,0 +1,311 @@ +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] + # + # which will work similarly to formats and MIME types negotiation. If there will be 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/params_wrapper.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/params_wrapper.rb new file mode 100644 index 0000000000000000000000000000000000000000..c38fc40b819c82b5ba115853134bdf368802b49b --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/params_wrapper.rb @@ -0,0 +1,285 @@ +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? + self.include = m.attribute_names + 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 #:nodoc: + 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. Will be 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. Will be 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[_wrapper_key] + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/redirecting.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/redirecting.rb new file mode 100644 index 0000000000000000000000000000000000000000..3c7cc156276bc459e590978413da4c21331b36b6 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/redirecting.rb @@ -0,0 +1,135 @@ +module ActionController + class RedirectBackError < AbstractController::Error #:nodoc: + DEFAULT_MESSAGE = 'No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify request.env["HTTP_REFERER"].' + + def initialize(message = nil) + super(message || DEFAULT_MESSAGE) + end + end + + 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 articles_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") + # + def redirect_to(options = {}, response_status = {}) #:doc: + 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: articles_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 :back + ActiveSupport::Deprecation.warn(<<-MESSAGE.squish) + `redirect_to :back` is deprecated and will be removed from Rails 5.1. + Please use `redirect_back(fallback_location: fallback_location)` where + `fallback_location` represents the location to use if the request has + no HTTP referer information. + MESSAGE + request.headers["Referer"] or raise RedirectBackError + 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/renderers.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/renderers.rb new file mode 100644 index 0000000000000000000000000000000000000000..1735609cd938dad0dc371e731d6f7b74723e50b5 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/renderers.rb @@ -0,0 +1,183 @@ +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 + # To use renderers and their mime types in more concise ways, see + # ActionController::MimeResponds::ClassMethods.respond_to + 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 lest 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/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/rendering.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/rendering.rb new file mode 100644 index 0000000000000000000000000000000000000000..cce6fe7787c55ba4f3a7d5f2ea9b03ad638147e7 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/rendering.rb @@ -0,0 +1,132 @@ +require 'active_support/core_ext/string/filters' + +module ActionController + module Rendering + extend ActiveSupport::Concern + + RENDER_FORMATS_IN_PRIORITY = [:body, :text, :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 self.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 _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) + unless 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) #:nodoc: + options = super + options[:update] = blk if block_given? + options + end + + # Normalize both text and status options. + def _normalize_options(options) #:nodoc: + _normalize_text(options) + + if options[:text] + ActiveSupport::Deprecation.warn <<-WARNING.squish + `render :text` is deprecated because it does not actually render a + `text/plain` response. Switch to `render plain: 'plain text'` to + render as `text/plain`, `render html: 'HTML'` to + render as `text/html`, or `render body: 'raw'` to match the deprecated + behavior and render with the default Content-Type, which is + `text/plain`. + WARNING + end + + if options[:html] + options[:html] = ERB::Util.html_escape(options[:html]) + end + + if options.delete(:nothing) + ActiveSupport::Deprecation.warn("`:nothing` option is deprecated and will be removed in Rails 5.1. Use `head` method to respond with empty response body.") + options[:body] = nil + 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) #:nodoc: + status, content_type, location = options.values_at(:status, :content_type, :location) + + self.status = status if status + self.content_type = content_type if content_type + self.headers["Location"] = url_for(location) if location + + super + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/request_forgery_protection.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/request_forgery_protection.rb new file mode 100644 index 0000000000000000000000000000000000000000..f7e8d06f10ddc4cdc543e43c92431ab0ec98fd00 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/request_forgery_protection.rb @@ -0,0 +1,412 @@ +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 + # + # The first two characters (">) are required in case the exception happens + # while rendering attributes for a given tag. You can check the real cause + # for the exception in your logger. + # + # == Web server support + # + # Not all web servers support streaming out-of-the-box. You need to check + # the instructions for each of them. + # + # ==== Unicorn + # + # Unicorn supports streaming but it needs to be configured. For this, you + # need to create a config file as follow: + # + # # unicorn.config.rb + # listen 3000, tcp_nopush: false + # + # And use it on initialization: + # + # unicorn_rails --config-file unicorn.config.rb + # + # You may also want to configure other parameters like :tcp_nodelay. + # Please check its documentation for more information: http://unicorn.bogomips.org/Unicorn/Configurator.html#method-i-listen + # + # If you are using Unicorn with NGINX, you may need to tweak NGINX. + # Streaming should work out of the box on Rainbows. + # + # ==== Passenger + # + # To be described. + # + module Streaming + extend ActiveSupport::Concern + + protected + + # Set proper cache control and transfer encoding when streaming + def _process_options(options) #:nodoc: + super + if options[:stream] + if request.version == "HTTP/1.0" + options.delete(:stream) + else + headers["Cache-Control"] ||= "no-cache" + headers["Transfer-Encoding"] = "chunked" + headers.delete("Content-Length") + end + end + end + + # Call render_body if we are streaming instead of usual +render+. + def _render_template(options) #:nodoc: + if options.delete(:stream) + Rack::Chunked::Body.new view_renderer.render_body(view_context, options) + else + super + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/strong_parameters.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/strong_parameters.rb new file mode 100644 index 0000000000000000000000000000000000000000..08049d7af803084ef7e17c48f172630d56ab297a --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/strong_parameters.rb @@ -0,0 +1,872 @@ +require 'active_support/core_ext/hash/indifferent_access' +require 'active_support/core_ext/hash/transform_values' +require 'active_support/core_ext/array/wrap' +require 'active_support/core_ext/string/filters' +require 'active_support/rescuable' +require 'action_dispatch/http/upload' +require 'rack/test' +require 'stringio' +require 'set' + +module ActionController + # Raised when a required parameter is missing. + # + # params = ActionController::Parameters.new(a: {}) + # params.fetch(:b) + # # => ActionController::ParameterMissing: param is missing or the value is empty: b + # params.require(:a) + # # => ActionController::ParameterMissing: param is missing or the value is empty: a + class ParameterMissing < KeyError + attr_reader :param # :nodoc: + + def initialize(param) # :nodoc: + @param = param + super("param is missing or the value is empty: #{param}") + end + end + + # Raised when a supplied parameter is not expected and + # ActionController::Parameters.action_on_unpermitted_parameters + # is set to :raise. + # + # params = ActionController::Parameters.new(a: "123", b: "456") + # params.permit(:c) + # # => ActionController::UnpermittedParameters: found unpermitted parameters: a, b + class UnpermittedParameters < IndexError + attr_reader :params # :nodoc: + + def initialize(params) # :nodoc: + @params = params + super("found unpermitted parameter#{'s' if params.size > 1 }: #{params.join(", ")}") + end + end + + # == Action Controller \Parameters + # + # Allows you to choose which attributes should be whitelisted for mass updating + # and thus prevent accidentally exposing that which shouldn't be exposed. + # Provides two methods for this purpose: #require and #permit. The former is + # used to mark parameters as required. The latter is used to set the parameter + # as permitted and limit which attributes should be allowed for mass updating. + # + # params = ActionController::Parameters.new({ + # person: { + # name: 'Francesco', + # age: 22, + # role: 'admin' + # } + # }) + # + # permitted = params.require(:person).permit(:name, :age) + # permitted # => {"name"=>"Francesco", "age"=>22} + # permitted.class # => ActionController::Parameters + # permitted.permitted? # => true + # + # Person.first.update!(permitted) + # # => # + # + # It provides two options that controls the top-level behavior of new instances: + # + # * +permit_all_parameters+ - If it's +true+, all the parameters will be + # permitted by default. The default is +false+. + # * +action_on_unpermitted_parameters+ - Allow to control the behavior when parameters + # that are not explicitly permitted are found. The values can be :log to + # write a message on the logger or :raise to raise + # ActionController::UnpermittedParameters exception. The default value is :log + # in test and development environments, +false+ otherwise. + # + # Examples: + # + # params = ActionController::Parameters.new + # params.permitted? # => false + # + # ActionController::Parameters.permit_all_parameters = true + # + # params = ActionController::Parameters.new + # params.permitted? # => true + # + # params = ActionController::Parameters.new(a: "123", b: "456") + # params.permit(:c) + # # => {} + # + # ActionController::Parameters.action_on_unpermitted_parameters = :raise + # + # params = ActionController::Parameters.new(a: "123", b: "456") + # params.permit(:c) + # # => ActionController::UnpermittedParameters: found unpermitted keys: a, b + # + # Please note that these options *are not thread-safe*. In a multi-threaded + # environment they should only be set once at boot-time and never mutated at + # runtime. + # + # You can fetch values of ActionController::Parameters using either + # :key or "key". + # + # params = ActionController::Parameters.new(key: 'value') + # params[:key] # => "value" + # params["key"] # => "value" + class Parameters + cattr_accessor :permit_all_parameters, instance_accessor: false + cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false + + delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?, :include?, + :as_json, to: :@parameters + + # By default, never raise an UnpermittedParameters exception if these + # params are present. The default includes both 'controller' and 'action' + # because they are added by Rails and should be of no concern. One way + # to change these is to specify `always_permitted_parameters` in your + # config. For instance: + # + # config.always_permitted_parameters = %w( controller action format ) + cattr_accessor :always_permitted_parameters + self.always_permitted_parameters = %w( controller action ) + + # Returns a new instance of ActionController::Parameters. + # Also, sets the +permitted+ attribute to the default value of + # ActionController::Parameters.permit_all_parameters. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: 'Francesco') + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # + # ActionController::Parameters.permit_all_parameters = true + # + # params = ActionController::Parameters.new(name: 'Francesco') + # params.permitted? # => true + # Person.new(params) # => # + def initialize(parameters = {}) + @parameters = parameters.with_indifferent_access + @permitted = self.class.permit_all_parameters + end + + # Returns true if another +Parameters+ object contains the same content and + # permitted flag. + def ==(other) + if other.respond_to?(:permitted?) + self.permitted? == other.permitted? && self.parameters == other.parameters + elsif other.is_a?(Hash) + ActiveSupport::Deprecation.warn <<-WARNING.squish + Comparing equality between `ActionController::Parameters` and a + `Hash` is deprecated and will be removed in Rails 5.1. Please only do + comparisons between instances of `ActionController::Parameters`. If + you need to compare to a hash, first convert it using + `ActionController::Parameters#new`. + WARNING + @parameters == other.with_indifferent_access + else + @parameters == other + end + end + + # Returns a safe ActiveSupport::HashWithIndifferentAccess + # representation of this parameter with all unpermitted keys removed. + # + # params = ActionController::Parameters.new({ + # name: 'Senjougahara Hitagi', + # oddity: 'Heavy stone crab' + # }) + # params.to_h # => {} + # + # safe_params = params.permit(:name) + # safe_params.to_h # => {"name"=>"Senjougahara Hitagi"} + def to_h + if permitted? + convert_parameters_to_hashes(@parameters, :to_h) + else + slice(*self.class.always_permitted_parameters).permit!.to_h + end + end + + # Returns an unsafe, unfiltered + # ActiveSupport::HashWithIndifferentAccess representation of this + # parameter. + # + # params = ActionController::Parameters.new({ + # name: 'Senjougahara Hitagi', + # oddity: 'Heavy stone crab' + # }) + # params.to_unsafe_h + # # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"} + def to_unsafe_h + convert_parameters_to_hashes(@parameters, :to_unsafe_h) + end + alias_method :to_unsafe_hash, :to_unsafe_h + + # Convert all hashes in values into parameters, then yield each pair in + # the same way as Hash#each_pair + def each_pair(&block) + @parameters.each_pair do |key, value| + yield key, convert_hashes_to_parameters(key, value) + end + end + alias_method :each, :each_pair + + # Attribute that keeps track of converted arrays, if any, to avoid double + # looping in the common use case permit + mass-assignment. Defined in a + # method to instantiate it only if needed. + # + # Testing membership still loops, but it's going to be faster than our own + # loop that converts values. Also, we are not going to build a new array + # object per fetch. + def converted_arrays + @converted_arrays ||= Set.new + end + + # Returns +true+ if the parameter is permitted, +false+ otherwise. + # + # params = ActionController::Parameters.new + # params.permitted? # => false + # params.permit! + # params.permitted? # => true + def permitted? + @permitted + end + + # Sets the +permitted+ attribute to +true+. This can be used to pass + # mass assignment. Returns +self+. + # + # class Person < ActiveRecord::Base + # end + # + # params = ActionController::Parameters.new(name: 'Francesco') + # params.permitted? # => false + # Person.new(params) # => ActiveModel::ForbiddenAttributesError + # params.permit! + # params.permitted? # => true + # Person.new(params) # => # + def permit! + each_pair do |key, value| + Array.wrap(value).each do |v| + v.permit! if v.respond_to? :permit! + end + end + + @permitted = true + self + end + + # This method accepts both a single key and an array of keys. + # + # When passed a single key, if it exists and its associated value is + # either present or the singleton +false+, returns said value: + # + # ActionController::Parameters.new(person: { name: 'Francesco' }).require(:person) + # # => {"name"=>"Francesco"} + # + # Otherwise raises ActionController::ParameterMissing: + # + # ActionController::Parameters.new.require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # ActionController::Parameters.new(person: nil).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # ActionController::Parameters.new(person: "\t").require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # ActionController::Parameters.new(person: {}).require(:person) + # # ActionController::ParameterMissing: param is missing or the value is empty: person + # + # When given an array of keys, the method tries to require each one of them + # in order. If it succeeds, an array with the respective return values is + # returned: + # + # params = ActionController::Parameters.new(user: { ... }, profile: { ... }) + # user_params, profile_params = params.require(:user, :profile) + # + # Otherwise, the method re-raises the first exception found: + # + # params = ActionController::Parameters.new(user: {}, profile: {}) + # user_params, profile_params = params.require(:user, :profile) + # # ActionController::ParameterMissing: param is missing or the value is empty: user + # + # Technically this method can be used to fetch terminal values: + # + # # CAREFUL + # params = ActionController::Parameters.new(person: { name: 'Finn' }) + # name = params.require(:person).require(:name) # CAREFUL + # + # but take into account that at some point those ones have to be permitted: + # + # def person_params + # params.require(:person).permit(:name).tap do |person_params| + # person_params.require(:name) # SAFER + # end + # end + # + # for example. + def require(key) + return key.map { |k| require(k) } if key.is_a?(Array) + value = self[key] + if value.present? || value == false + value + else + raise ParameterMissing.new(key) + end + end + + # Alias of #require. + alias :required :require + + # Returns a new ActionController::Parameters instance that + # includes only the given +filters+ and sets the +permitted+ attribute + # for the object to +true+. This is useful for limiting which attributes + # should be allowed for mass updating. + # + # params = ActionController::Parameters.new(user: { name: 'Francesco', age: 22, role: 'admin' }) + # permitted = params.require(:user).permit(:name, :age) + # permitted.permitted? # => true + # permitted.has_key?(:name) # => true + # permitted.has_key?(:age) # => true + # permitted.has_key?(:role) # => false + # + # Only permitted scalars pass the filter. For example, given + # + # params.permit(:name) + # + # +:name+ passes if it is a key of +params+ whose associated value is of type + # +String+, +Symbol+, +NilClass+, +Numeric+, +TrueClass+, +FalseClass+, + # +Date+, +Time+, +DateTime+, +StringIO+, +IO+, + # +ActionDispatch::Http::UploadedFile+ or +Rack::Test::UploadedFile+. + # Otherwise, the key +:name+ is filtered out. + # + # You may declare that the parameter should be an array of permitted scalars + # by mapping it to an empty array: + # + # params = ActionController::Parameters.new(tags: ['rails', 'parameters']) + # params.permit(tags: []) + # + # You can also use +permit+ on nested parameters, like: + # + # params = ActionController::Parameters.new({ + # person: { + # name: 'Francesco', + # age: 22, + # pets: [{ + # name: 'Purplish', + # category: 'dogs' + # }] + # } + # }) + # + # permitted = params.permit(person: [ :name, { pets: :name } ]) + # permitted.permitted? # => true + # permitted[:person][:name] # => "Francesco" + # permitted[:person][:age] # => nil + # permitted[:person][:pets][0][:name] # => "Purplish" + # permitted[:person][:pets][0][:category] # => nil + # + # Note that if you use +permit+ in a key that points to a hash, + # it won't allow all the hash. You also need to specify which + # attributes inside the hash should be whitelisted. + # + # params = ActionController::Parameters.new({ + # person: { + # contact: { + # email: 'none@test.com', + # phone: '555-1234' + # } + # } + # }) + # + # params.require(:person).permit(:contact) + # # => {} + # + # params.require(:person).permit(contact: :phone) + # # => {"contact"=>{"phone"=>"555-1234"}} + # + # params.require(:person).permit(contact: [ :email, :phone ]) + # # => {"contact"=>{"email"=>"none@test.com", "phone"=>"555-1234"}} + def permit(*filters) + params = self.class.new + + filters.flatten.each do |filter| + case filter + when Symbol, String + permitted_scalar_filter(params, filter) + when Hash then + hash_filter(params, filter) + end + end + + unpermitted_parameters!(params) if self.class.action_on_unpermitted_parameters + + params.permit! + end + + # Returns a parameter for the given +key+. If not found, + # returns +nil+. + # + # params = ActionController::Parameters.new(person: { name: 'Francesco' }) + # params[:person] # => {"name"=>"Francesco"} + # params[:none] # => nil + def [](key) + convert_hashes_to_parameters(key, @parameters[key]) + end + + # Assigns a value to a given +key+. The given key may still get filtered out + # when +permit+ is called. + def []=(key, value) + @parameters[key] = value + end + + # Returns a parameter for the given +key+. If the +key+ + # can't be found, there are several options: With no other arguments, + # it will raise an ActionController::ParameterMissing error; + # if more arguments are given, then that will be returned; if a block + # is given, then that will be run and its result returned. + # + # params = ActionController::Parameters.new(person: { name: 'Francesco' }) + # params.fetch(:person) # => {"name"=>"Francesco"} + # params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none + # params.fetch(:none, 'Francesco') # => "Francesco" + # params.fetch(:none) { 'Francesco' } # => "Francesco" + def fetch(key, *args) + convert_value_to_parameters( + @parameters.fetch(key) { + if block_given? + yield + else + args.fetch(0) { raise ActionController::ParameterMissing.new(key) } + end + } + ) + end + + if Hash.method_defined?(:dig) + # Extracts the nested parameter from the given +keys+ by calling +dig+ + # at each step. Returns +nil+ if any intermediate step is +nil+. + # + # params = ActionController::Parameters.new(foo: { bar: { baz: 1 } }) + # params.dig(:foo, :bar, :baz) # => 1 + # params.dig(:foo, :zot, :xyz) # => nil + # + # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) + # params2.dig(:foo, 1) # => 11 + def dig(*keys) + convert_value_to_parameters(@parameters.dig(*keys)) + end + end + + # Returns a new ActionController::Parameters instance that + # includes only the given +keys+. If the given +keys+ + # don't exist, returns an empty hash. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.slice(:a, :b) # => {"a"=>1, "b"=>2} + # params.slice(:d) # => {} + def slice(*keys) + new_instance_with_inherited_permitted_status(@parameters.slice(*keys)) + end + + # Returns current ActionController::Parameters instance which + # contains only the given +keys+. + def slice!(*keys) + @parameters.slice!(*keys) + self + end + + # Returns a new ActionController::Parameters instance that + # filters out the given +keys+. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.except(:a, :b) # => {"c"=>3} + # params.except(:d) # => {"a"=>1,"b"=>2,"c"=>3} + def except(*keys) + new_instance_with_inherited_permitted_status(@parameters.except(*keys)) + end + + # Removes and returns the key/value pairs matching the given keys. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.extract!(:a, :b) # => {"a"=>1, "b"=>2} + # params # => {"c"=>3} + def extract!(*keys) + new_instance_with_inherited_permitted_status(@parameters.extract!(*keys)) + end + + # Returns a new ActionController::Parameters with the results of + # running +block+ once for every value. The keys are unchanged. + # + # params = ActionController::Parameters.new(a: 1, b: 2, c: 3) + # params.transform_values { |x| x * 2 } + # # => {"a"=>2, "b"=>4, "c"=>6} + def transform_values(&block) + if block + new_instance_with_inherited_permitted_status( + @parameters.transform_values(&block) + ) + else + @parameters.transform_values + end + end + + # Performs values transformation and returns the altered + # ActionController::Parameters instance. + def transform_values!(&block) + @parameters.transform_values!(&block) + self + end + + # Returns a new ActionController::Parameters instance with the + # results of running +block+ once for every key. The values are unchanged. + def transform_keys(&block) + if block + new_instance_with_inherited_permitted_status( + @parameters.transform_keys(&block) + ) + else + @parameters.transform_keys + end + end + + # Performs keys transformation and returns the altered + # ActionController::Parameters instance. + def transform_keys!(&block) + @parameters.transform_keys!(&block) + self + end + + # Deletes and returns a key-value pair from +Parameters+ whose key is equal + # to key. If the key is not found, returns the default value. If the + # optional code block is given and the key is not found, pass in the key + # and return the result of block. + def delete(key) + convert_value_to_parameters(@parameters.delete(key)) + end + + # Returns a new instance of ActionController::Parameters with only + # items that the block evaluates to true. + def select(&block) + new_instance_with_inherited_permitted_status(@parameters.select(&block)) + end + + # Equivalent to Hash#keep_if, but returns nil if no changes were made. + def select!(&block) + @parameters.select!(&block) + self + end + alias_method :keep_if, :select! + + # Returns a new instance of ActionController::Parameters with items + # that the block evaluates to true removed. + def reject(&block) + new_instance_with_inherited_permitted_status(@parameters.reject(&block)) + end + + # Removes items that the block evaluates to true and returns self. + def reject!(&block) + @parameters.reject!(&block) + self + end + alias_method :delete_if, :reject! + + # Returns values that were assigned to the given +keys+. Note that all the + # +Hash+ objects will be converted to ActionController::Parameters. + def values_at(*keys) + convert_value_to_parameters(@parameters.values_at(*keys)) + end + + # Returns an exact copy of the ActionController::Parameters + # instance. +permitted+ state is kept on the duped object. + # + # params = ActionController::Parameters.new(a: 1) + # params.permit! + # params.permitted? # => true + # copy_params = params.dup # => {"a"=>1} + # copy_params.permitted? # => true + def dup + super.tap do |duplicate| + duplicate.permitted = @permitted + end + end + + # Returns a new ActionController::Parameters with all keys from + # +other_hash+ merges into current hash. + def merge(other_hash) + new_instance_with_inherited_permitted_status( + @parameters.merge(other_hash) + ) + end + + # This is required by ActiveModel attribute assignment, so that user can + # pass +Parameters+ to a mass assignment methods in a model. It should not + # matter as we are using +HashWithIndifferentAccess+ internally. + def stringify_keys # :nodoc: + dup + end + + def inspect + "<#{self.class} #{@parameters} permitted: #{@permitted}>" + end + + def method_missing(method_sym, *args, &block) + if @parameters.respond_to?(method_sym) + message = <<-DEPRECATE.squish + Method #{method_sym} is deprecated and will be removed in Rails 5.1, + as `ActionController::Parameters` no longer inherits from + hash. Using this deprecated behavior exposes potential security + problems. If you continue to use this method you may be creating + a security vulnerability in your app that can be exploited. Instead, + consider using one of these documented methods which are not + deprecated: http://api.rubyonrails.org/v#{ActionPack.version}/classes/ActionController/Parameters.html + DEPRECATE + ActiveSupport::Deprecation.warn(message) + @parameters.public_send(method_sym, *args, &block) + else + super + end + end + + protected + attr_reader :parameters + + def permitted=(new_permitted) + @permitted = new_permitted + end + + def fields_for_style? + @parameters.all? { |k, v| k =~ /\A-?\d+\z/ && (v.is_a?(Hash) || v.is_a?(Parameters)) } + end + + private + def new_instance_with_inherited_permitted_status(hash) + self.class.new(hash).tap do |new_instance| + new_instance.permitted = @permitted + end + end + + def convert_parameters_to_hashes(value, using) + case value + when Array + value.map { |v| convert_parameters_to_hashes(v, using) } + when Hash + value.transform_values do |v| + convert_parameters_to_hashes(v, using) + end.with_indifferent_access + when Parameters + value.send(using) + else + value + end + end + + def convert_hashes_to_parameters(key, value) + converted = convert_value_to_parameters(value) + @parameters[key] = converted unless converted.equal?(value) + converted + end + + def convert_value_to_parameters(value) + case value + when Array + return value if converted_arrays.member?(value) + converted = value.map { |_| convert_value_to_parameters(_) } + converted_arrays << converted + converted + when Hash + self.class.new(value) + else + value + end + end + + def each_element(object) + case object + when Array + object.grep(Parameters).map { |el| yield el }.compact + when Parameters + if object.fields_for_style? + hash = object.class.new + object.each { |k,v| hash[k] = yield v } + hash + else + yield object + end + end + end + + def unpermitted_parameters!(params) + unpermitted_keys = unpermitted_keys(params) + if unpermitted_keys.any? + case self.class.action_on_unpermitted_parameters + when :log + name = "unpermitted_parameters.action_controller" + ActiveSupport::Notifications.instrument(name, keys: unpermitted_keys) + when :raise + raise ActionController::UnpermittedParameters.new(unpermitted_keys) + end + end + end + + def unpermitted_keys(params) + self.keys - params.keys - self.always_permitted_parameters + end + + # + # --- Filtering ---------------------------------------------------------- + # + + # This is a white list of permitted scalar types that includes the ones + # supported in XML and JSON requests. + # + # This list is in particular used to filter ordinary requests, String goes + # as first element to quickly short-circuit the common case. + # + # If you modify this collection please update the API of +permit+ above. + PERMITTED_SCALAR_TYPES = [ + String, + Symbol, + NilClass, + Numeric, + TrueClass, + FalseClass, + Date, + Time, + # DateTimes are Dates, we document the type but avoid the redundant check. + StringIO, + IO, + ActionDispatch::Http::UploadedFile, + Rack::Test::UploadedFile, + ] + + def permitted_scalar?(value) + PERMITTED_SCALAR_TYPES.any? {|type| value.is_a?(type)} + end + + def permitted_scalar_filter(params, key) + if has_key?(key) && permitted_scalar?(self[key]) + params[key] = self[key] + end + + keys.grep(/\A#{Regexp.escape(key)}\(\d+[if]?\)\z/) do |k| + if permitted_scalar?(self[k]) + params[k] = self[k] + end + end + end + + def array_of_permitted_scalars?(value) + if value.is_a?(Array) && value.all? {|element| permitted_scalar?(element)} + yield value + end + end + + def non_scalar?(value) + value.is_a?(Array) || value.is_a?(Parameters) + end + + EMPTY_ARRAY = [] + def hash_filter(params, filter) + filter = filter.with_indifferent_access + + # Slicing filters out non-declared keys. + slice(*filter.keys).each do |key, value| + next unless value + next unless has_key? key + + if filter[key] == EMPTY_ARRAY + # Declaration { comment_ids: [] }. + array_of_permitted_scalars?(self[key]) do |val| + params[key] = val + end + elsif non_scalar?(value) + # Declaration { user: :name } or { user: [:name, :age, { address: ... }] }. + params[key] = each_element(value) do |element| + element.permit(*Array.wrap(filter[key])) + end + end + end + end + end + + # == Strong \Parameters + # + # It provides an interface for protecting attributes from end-user + # assignment. This makes Action Controller parameters forbidden + # to be used in Active Model mass assignment until they have been + # whitelisted. + # + # In addition, parameters can be marked as required and flow through a + # predefined raise/rescue flow to end up as a 400 Bad Request with no + # effort. + # + # class PeopleController < ActionController::Base + # # Using "Person.create(params[:person])" would raise an + # # ActiveModel::ForbiddenAttributes exception because it'd + # # be using mass assignment without an explicit permit step. + # # This is the recommended form: + # def create + # Person.create(person_params) + # end + # + # # This will pass with flying colors as long as there's a person key in the + # # parameters, otherwise it'll raise an ActionController::MissingParameter + # # exception, which will get caught by ActionController::Base and turned + # # into a 400 Bad Request reply. + # def update + # redirect_to current_account.people.find(params[:id]).tap { |person| + # person.update!(person_params) + # } + # end + # + # private + # # Using a private method to encapsulate the permissible parameters is + # # just a good pattern since you'll be able to reuse the same permit + # # list between create and update. Also, you can specialize this method + # # with per-user checking of permissible attributes. + # def person_params + # params.require(:person).permit(:name, :age) + # end + # end + # + # In order to use accepts_nested_attributes_for with Strong \Parameters, you + # will need to specify which nested attributes should be whitelisted. You might want + # to allow +:id+ and +:_destroy+, see ActiveRecord::NestedAttributes for more information. + # + # class Person + # has_many :pets + # accepts_nested_attributes_for :pets + # end + # + # class PeopleController < ActionController::Base + # def create + # Person.create(person_params) + # end + # + # ... + # + # private + # + # def person_params + # # It's mandatory to specify the nested attributes that should be whitelisted. + # # If you use `permit` with just the key that points to the nested attributes hash, + # # it will return an empty hash. + # params.require(:person).permit(:name, :age, pets_attributes: [ :id, :name, :category ]) + # end + # end + # + # See ActionController::Parameters.require and ActionController::Parameters.permit + # for more information. + module StrongParameters + extend ActiveSupport::Concern + include ActiveSupport::Rescuable + + # Returns a new ActionController::Parameters object that + # has been instantiated with the request.parameters. + def params + @_params ||= Parameters.new(request.parameters) + end + + # Assigns the given +value+ to the +params+ hash. If +value+ + # is a Hash, this will create an ActionController::Parameters + # object that has been instantiated with the given +value+ hash. + def params=(value) + @_params = value.is_a?(Hash) ? Parameters.new(value) : value + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/testing.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/testing.rb new file mode 100644 index 0000000000000000000000000000000000000000..ac37b00010f6ed15b95361ca8d4fa0bbdebca366 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/testing.rb @@ -0,0 +1,20 @@ +module ActionController + module Testing + extend ActiveSupport::Concern + + # Behavior specific to functional tests + module Functional # :nodoc: + def recycle! + @_url_options = nil + self.formats = nil + self.params = nil + end + end + + module ClassMethods + def before_filters + _process_action_callbacks.find_all{|x| x.kind == :before}.map(&:name) + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/url_for.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/url_for.rb new file mode 100644 index 0000000000000000000000000000000000000000..dbf7241a14690566f7ce257d2410abbe0e3441e2 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/metal/url_for.rb @@ -0,0 +1,56 @@ +module ActionController + # Includes +url_for+ into the host class. The class has to provide a +RouteSet+ by implementing + # the _routes method. Otherwise, an exception will be raised. + # + # In addition to AbstractController::UrlFor, this module accesses the HTTP layer to define + # url options like the +host+. In order to do so, this module requires the host class + # to implement +env+ which needs to be Rack-compatible and +request+ + # which is either an instance of +ActionDispatch::Request+ or an object + # that responds to the +host+, +optional_port+, +protocol+ and + # +symbolized_path_parameter+ methods. + # + # class RootUrl + # include ActionController::UrlFor + # include Rails.application.routes.url_helpers + # + # delegate :env, :request, to: :controller + # + # def initialize(controller) + # @controller = controller + # @url = root_path # named route from the application. + # end + # end + module UrlFor + extend ActiveSupport::Concern + + include AbstractController::UrlFor + + def url_options + @_url_options ||= { + :host => request.host, + :port => request.optional_port, + :protocol => request.protocol, + :_recall => request.path_parameters + }.merge!(super).freeze + + if (same_origin = _routes.equal?(request.routes)) || + (script_name = request.engine_script_name(_routes)) || + (original_script_name = request.original_script_name) + + options = @_url_options.dup + if original_script_name + options[:original_script_name] = original_script_name + else + if same_origin + options[:script_name] = request.script_name.empty? ? "".freeze : request.script_name.dup + else + options[:script_name] = script_name + end + end + options.freeze + else + @_url_options + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railtie.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railtie.rb new file mode 100644 index 0000000000000000000000000000000000000000..28b20052b520eceec082c8c43df2b656c2b5f0d8 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railtie.rb @@ -0,0 +1,71 @@ +require "rails" +require "action_controller" +require "action_dispatch/railtie" +require "abstract_controller/railties/routes_helpers" +require "action_controller/railties/helpers" +require "action_view/railtie" + +module ActionController + class Railtie < Rails::Railtie #:nodoc: + config.action_controller = ActiveSupport::OrderedOptions.new + + config.eager_load_namespaces << ActionController + + initializer "action_controller.assets_config", :group => :all do |app| + app.config.action_controller.assets_dir ||= app.config.paths["public"].first + end + + initializer "action_controller.set_helpers_path" do |app| + ActionController::Helpers.helpers_path = app.helpers_paths + end + + initializer "action_controller.parameters_config" do |app| + options = app.config.action_controller + + ActionController::Parameters.permit_all_parameters = options.delete(:permit_all_parameters) { false } + if app.config.action_controller[:always_permitted_parameters] + ActionController::Parameters.always_permitted_parameters = + app.config.action_controller.delete(:always_permitted_parameters) + end + ActionController::Parameters.action_on_unpermitted_parameters = options.delete(:action_on_unpermitted_parameters) do + (Rails.env.test? || Rails.env.development?) ? :log : false + end + end + + initializer "action_controller.set_configs" do |app| + paths = app.config.paths + options = app.config.action_controller + + options.logger ||= Rails.logger + options.cache_store ||= Rails.cache + + options.javascripts_dir ||= paths["public/javascripts"].first + options.stylesheets_dir ||= paths["public/stylesheets"].first + + # Ensure readers methods get compiled + options.asset_host ||= app.config.asset_host + options.relative_url_root ||= app.config.relative_url_root + + ActiveSupport.on_load(:action_controller) do + include app.routes.mounted_helpers + extend ::AbstractController::Railties::RoutesHelpers.with(app.routes) + extend ::ActionController::Railties::Helpers + + options.each do |k,v| + k = "#{k}=" + if respond_to?(k) + send(k, v) + elsif !Base.respond_to?(k) + raise "Invalid option key: #{k}" + end + end + end + end + + initializer "action_controller.compile_config_methods" do + ActiveSupport.on_load(:action_controller) do + config.compile_methods! if config.respond_to?(:compile_methods!) + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railties/helpers.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railties/helpers.rb new file mode 100644 index 0000000000000000000000000000000000000000..3985c6b273422d262d7f674cccd2a22712898287 --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/railties/helpers.rb @@ -0,0 +1,22 @@ +module ActionController + module Railties + module Helpers + def inherited(klass) + super + return unless klass.respond_to?(:helpers_path=) + + if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_helpers_paths) } + paths = namespace.railtie_helpers_paths + else + paths = ActionController::Helpers.helpers_path + end + + klass.helpers_path = paths + + if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers + klass.helper :all + end + end + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/renderer.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/renderer.rb new file mode 100644 index 0000000000000000000000000000000000000000..5ff4a658adaeef10ee616357f472d160022cb91d --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/renderer.rb @@ -0,0 +1,111 @@ +require 'active_support/core_ext/hash/keys' + +module ActionController + # ActionController::Renderer allows to render arbitrary templates + # without requirement of being in controller actions. + # + # You get a concrete renderer class by invoking ActionController::Base#renderer. + # For example, + # + # ApplicationController.renderer + # + # It allows you to call method #render directly. + # + # ApplicationController.renderer.render template: '...' + # + # You can use this shortcut in a controller, instead of the previous example: + # + # ApplicationController.render template: '...' + # + # #render allows you to use the same options that you can use when rendering in a controller. + # For example, + # + # FooController.render :action, locals: { ... }, assigns: { ... } + # + # The template will be rendered in a Rack environment which is accessible through + # ActionController::Renderer#env. You can set it up in two ways: + # + # * by changing renderer defaults, like + # + # ApplicationController.renderer.defaults # => hash with default Rack environment + # + # * by initializing an instance of renderer by passing it a custom environment. + # + # ApplicationController.renderer.new(method: 'post', https: true) + # + class Renderer + attr_reader :defaults, :controller + + DEFAULTS = { + http_host: 'example.org', + https: false, + method: 'get', + script_name: '', + input: '' + }.freeze + + # Create a new renderer instance for a specific controller class. + def self.for(controller, env = {}, defaults = DEFAULTS.dup) + new(controller, env, defaults) + end + + # Create a new renderer for the same controller but with a new env. + def new(env = {}) + self.class.new controller, env, defaults + end + + # Create a new renderer for the same controller but with new defaults. + def with_defaults(defaults) + self.class.new controller, env, self.defaults.merge(defaults) + end + + # Accepts a custom Rack environment to render templates in. + # It will be merged with ActionController::Renderer.defaults + def initialize(controller, env, defaults) + @controller = controller + @defaults = defaults + @env = normalize_keys defaults.merge(env) + end + + # Render templates with any options from ActionController::Base#render_to_string. + def render(*args) + raise 'missing controller' unless controller + + request = ActionDispatch::Request.new @env + request.routes = controller._routes + + instance = controller.new + instance.set_request! request + instance.set_response! controller.make_response!(request) + instance.render_to_string(*args) + end + + private + def normalize_keys(env) + new_env = {} + env.each_pair { |k,v| new_env[rack_key_for(k)] = rack_value_for(k, v) } + new_env + end + + RACK_KEY_TRANSLATION = { + http_host: 'HTTP_HOST', + https: 'HTTPS', + method: 'REQUEST_METHOD', + script_name: 'SCRIPT_NAME', + input: 'rack.input' + } + + IDENTITY = ->(_) { _ } + + RACK_VALUE_TRANSLATION = { + https: ->(v) { v ? 'on' : 'off' }, + method: ->(v) { v.upcase }, + } + + def rack_key_for(key); RACK_KEY_TRANSLATION[key]; end + + def rack_value_for(key, value) + RACK_VALUE_TRANSLATION.fetch(key, IDENTITY).call value + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/template_assertions.rb b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/template_assertions.rb new file mode 100644 index 0000000000000000000000000000000000000000..0179f4afcd63b101c33a14fea53b316056f5bacf --- /dev/null +++ b/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/template_assertions.rb @@ -0,0 +1,9 @@ +module ActionController + module TemplateAssertions + def assert_template(options = {}, message = nil) + raise NoMethodError, + "assert_template has been extracted to a gem. To continue using it, + add `gem 'rails-controller-testing'` to your Gemfile." + end + end +end diff --git a/vendor/bundle/ruby/2.3.0/gems/actionpack-5.0.0/lib/action_controller/test_case.rb b/vendor/bundle/ruby/2.3.0/gems/