big_session 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +32 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +60 -0
- data/Rakefile +8 -0
- data/big_session.gemspec +44 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/examples/landing_page_app_and_core_app/README.md +3 -0
- data/examples/landing_page_app_and_core_app/app_core/.ruby-version +1 -0
- data/examples/landing_page_app_and_core_app/app_core/Dockerfile +22 -0
- data/examples/landing_page_app_and_core_app/app_core/Gemfile +66 -0
- data/examples/landing_page_app_and_core_app/app_core/Gemfile.lock +236 -0
- data/examples/landing_page_app_and_core_app/app_core/README.md +24 -0
- data/examples/landing_page_app_and_core_app/app_core/Rakefile +6 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/config/manifest.js +3 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/images/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/application.js +16 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/cable.js +13 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/javascripts/channels/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/assets/stylesheets/application.css +15 -0
- data/examples/landing_page_app_and_core_app/app_core/app/channels/application_cable/channel.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/channels/application_cable/connection.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/application_controller.rb +12 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/controllers/conversions_controller.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_core/app/helpers/application_helper.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_core/app/jobs/application_job.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_core/app/mailers/application_mailer.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/app/models/application_record.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_core/app/models/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/application.html.erb +15 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/mailer.html.erb +13 -0
- data/examples/landing_page_app_and_core_app/app_core/app/views/layouts/mailer.text.erb +1 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/bundle +3 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/rails +9 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/rake +9 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/setup +36 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/spring +17 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/update +31 -0
- data/examples/landing_page_app_and_core_app/app_core/bin/yarn +11 -0
- data/examples/landing_page_app_and_core_app/app_core/config.ru +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/application.rb +19 -0
- data/examples/landing_page_app_and_core_app/app_core/config/boot.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/cable.yml +10 -0
- data/examples/landing_page_app_and_core_app/app_core/config/credentials.yml.enc +1 -0
- data/examples/landing_page_app_and_core_app/app_core/config/database.yml +88 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environment.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/development.rb +78 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/production.rb +94 -0
- data/examples/landing_page_app_and_core_app/app_core/config/environments/test.rb +46 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/assets.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/big_session.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/content_security_policy.rb +25 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/cookies_serializer.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/inflections.rb +16 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/mime_types.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/initializers/wrap_parameters.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_core/config/locales/en.yml +33 -0
- data/examples/landing_page_app_and_core_app/app_core/config/puma.rb +34 -0
- data/examples/landing_page_app_and_core_app/app_core/config/routes.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_core/config/spring.rb +6 -0
- data/examples/landing_page_app_and_core_app/app_core/config/storage.yml +34 -0
- data/examples/landing_page_app_and_core_app/app_core/db/seeds.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_core/entrypoint.sh +8 -0
- data/examples/landing_page_app_and_core_app/app_core/lib/assets/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/lib/tasks/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/log/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/package.json +5 -0
- data/examples/landing_page_app_and_core_app/app_core/public/404.html +67 -0
- data/examples/landing_page_app_and_core_app/app_core/public/422.html +67 -0
- data/examples/landing_page_app_and_core_app/app_core/public/500.html +66 -0
- data/examples/landing_page_app_and_core_app/app_core/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/apple-touch-icon.png +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/favicon.ico +0 -0
- data/examples/landing_page_app_and_core_app/app_core/public/robots.txt +1 -0
- data/examples/landing_page_app_and_core_app/app_core/storage/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/application_system_test_case.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_core/test/controllers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/fixtures/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/fixtures/files/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/helpers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/integration/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/mailers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/models/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/system/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/test/test_helper.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_core/tmp/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_core/vendor/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/.ruby-version +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/Dockerfile +22 -0
- data/examples/landing_page_app_and_core_app/app_lp/Gemfile +66 -0
- data/examples/landing_page_app_and_core_app/app_lp/Gemfile.lock +256 -0
- data/examples/landing_page_app_and_core_app/app_lp/README.md +24 -0
- data/examples/landing_page_app_and_core_app/app_lp/Rakefile +6 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/config/manifest.js +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/images/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/application.js +16 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/cable.js +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/javascripts/channels/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/assets/stylesheets/application.css +15 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/channels/application_cable/channel.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/channels/application_cable/connection.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/application_controller.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/conversions_controller.rb +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/controllers/lps_controller.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/helpers/application_helper.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/jobs/application_job.rb +2 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/mailers/application_mailer.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/models/application_record.rb +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/models/concerns/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/application.html.erb +15 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/mailer.html.erb +13 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/layouts/mailer.text.erb +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/app/views/lps/show.html.haml +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/bundle +3 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/rails +9 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/rake +9 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/setup +36 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/spring +17 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/update +31 -0
- data/examples/landing_page_app_and_core_app/app_lp/bin/yarn +11 -0
- data/examples/landing_page_app_and_core_app/app_lp/config.ru +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/application.rb +19 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/boot.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/cable.yml +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/credentials.yml.enc +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/database.yml +88 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environment.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/development.rb +77 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/production.rb +94 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/environments/test.rb +46 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/application_controller_renderer.rb +8 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/assets.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/big_session.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/content_security_policy.rb +25 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/cookies_serializer.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/filter_parameter_logging.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/inflections.rb +16 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/mime_types.rb +4 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/initializers/wrap_parameters.rb +14 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/locales/en.yml +33 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/puma.rb +34 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/routes.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/spring.rb +6 -0
- data/examples/landing_page_app_and_core_app/app_lp/config/storage.yml +34 -0
- data/examples/landing_page_app_and_core_app/app_lp/db/seeds.rb +7 -0
- data/examples/landing_page_app_and_core_app/app_lp/entrypoint.sh +8 -0
- data/examples/landing_page_app_and_core_app/app_lp/lib/assets/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/lib/tasks/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/log/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/package.json +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/404.html +67 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/422.html +67 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/500.html +66 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/apple-touch-icon.png +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/favicon.ico +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/public/robots.txt +1 -0
- data/examples/landing_page_app_and_core_app/app_lp/storage/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/application_system_test_case.rb +5 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/controllers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/fixtures/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/fixtures/files/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/helpers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/integration/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/mailers/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/models/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/system/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/test/test_helper.rb +10 -0
- data/examples/landing_page_app_and_core_app/app_lp/tmp/.keep +0 -0
- data/examples/landing_page_app_and_core_app/app_lp/vendor/.keep +0 -0
- data/examples/landing_page_app_and_core_app/docker-compose.yml +26 -0
- data/lib/big_session.rb +15 -0
- data/lib/big_session/faraday.rb +35 -0
- data/lib/big_session/rack_middleware.rb +57 -0
- data/lib/big_session/session_id.rb +25 -0
- data/lib/big_session/version.rb +5 -0
- metadata +330 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
# README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
|
5
|
+
// vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require activestorage
|
15
|
+
//= require turbolinks
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
|
6
|
+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
def append_info_to_payload(payload)
|
3
|
+
super
|
4
|
+
|
5
|
+
payload[:referer] = request.referer
|
6
|
+
payload[:user_agent] = request.user_agent
|
7
|
+
payload[:remote_ip] = request.remote_ip
|
8
|
+
payload[:big_session_id] = Thread.current.fetch('big_session_id', nil)
|
9
|
+
end
|
10
|
+
end
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class ConversionsController < ApplicationController
|
2
|
+
def create
|
3
|
+
faraday = Faraday.new(url: 'http://app_core:3000/conversions') do |conn|
|
4
|
+
conn.use :big_session
|
5
|
+
conn.adapter Faraday.default_adapter
|
6
|
+
conn.request :url_encoded
|
7
|
+
end
|
8
|
+
res = faraday.post
|
9
|
+
if res.status == 200
|
10
|
+
#
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>App</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
9
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
begin
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
4
|
+
rescue LoadError => e
|
5
|
+
raise unless e.message.include?('spring')
|
6
|
+
end
|
7
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
8
|
+
require_relative '../config/boot'
|
9
|
+
require 'rails/commands'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a starting point to setup your application.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:setup'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads Spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
12
|
+
if spring
|
13
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
|
+
gem 'spring', spring.version
|
15
|
+
require 'spring/binstub'
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a way to update your development environment automatically.
|
14
|
+
# Add necessary update steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
puts "\n== Updating database =="
|
24
|
+
system! 'bin/rails db:migrate'
|
25
|
+
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
27
|
+
system! 'bin/rails log:clear tmp:clear'
|
28
|
+
|
29
|
+
puts "\n== Restarting application server =="
|
30
|
+
system! 'bin/rails restart'
|
31
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
3
|
+
Dir.chdir(APP_ROOT) do
|
4
|
+
begin
|
5
|
+
exec "yarnpkg", *ARGV
|
6
|
+
rescue Errno::ENOENT
|
7
|
+
$stderr.puts "Yarn executable was not detected in the system."
|
8
|
+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
|
9
|
+
exit 1
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'boot'
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
|
9
|
+
module App
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Initialize configuration defaults for originally generated Rails version.
|
12
|
+
config.load_defaults 5.2
|
13
|
+
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration can go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded after loading
|
17
|
+
# the framework and any gems in your application.
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
sah+vz0gJmUyEAXOjO0CdlM8TY9qtOzghKp1x4cfZon2SlTC0M5LD6ilbjlrm/zydkTDV1G1Nph7oBgyl/F6eQ4pXs+qTBwzAHtHL8Q+ktcQ814k89Fm5VyfZsNryhsag0W/MlDPpDSgSlM0P/JCmHPgulRpFzYAmzc2ktWCSUTbc83dku/S3wFDraeay/3hHIopMVmqVqOVxxyWMPRbxDBA6jqQ+0gmCzIYHVaB8GdxdI06qtOsq1ww4G6cMDEkQOo2SSl1M8ZKFgO9oBTswKa8W5HIlifd/uZqOgp9Q5HPKUHNH7Xe4bgQxNl0k4cc9qinrKuj8E5RwtOKs3spiR1Z1/OIQtTJsOVjM8Of/zGNyAQEbb2r+OwJhCe/IQg2MbpQXQY26pzzWnIF/UooD0vwc5cb67YO3UIW--QrY/c6Nc+7kOkWZq--6fmd5Lk49SUfys7jz1fOLw==
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# PostgreSQL. Versions 9.1 and up are supported.
|
2
|
+
#
|
3
|
+
# Install the pg driver:
|
4
|
+
# gem install pg
|
5
|
+
# On OS X with Homebrew:
|
6
|
+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
7
|
+
# On OS X with MacPorts:
|
8
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
9
|
+
# On Windows:
|
10
|
+
# gem install pg
|
11
|
+
# Choose the win32 build.
|
12
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
13
|
+
#
|
14
|
+
# Configure Using Gemfile
|
15
|
+
# gem 'pg'
|
16
|
+
#
|
17
|
+
default: &default
|
18
|
+
adapter: postgresql
|
19
|
+
encoding: unicode
|
20
|
+
# For details on connection pooling, see Rails configuration guide
|
21
|
+
# http://guides.rubyonrails.org/configuring.html#database-pooling
|
22
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
23
|
+
host: db
|
24
|
+
username: postgres
|
25
|
+
password:
|
26
|
+
|
27
|
+
development:
|
28
|
+
<<: *default
|
29
|
+
database: app2_development
|
30
|
+
|
31
|
+
# The specified database role being used to connect to postgres.
|
32
|
+
# To create additional roles in postgres see `$ createuser --help`.
|
33
|
+
# When left blank, postgres will use the default role. This is
|
34
|
+
# the same name as the operating system user that initialized the database.
|
35
|
+
#username: app
|
36
|
+
|
37
|
+
# The password associated with the postgres role (username).
|
38
|
+
#password:
|
39
|
+
|
40
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
41
|
+
# domain socket that doesn't need configuration. Windows does not have
|
42
|
+
# domain sockets, so uncomment these lines.
|
43
|
+
#host: localhost
|
44
|
+
|
45
|
+
# The TCP port the server listens on. Defaults to 5432.
|
46
|
+
# If your server runs on a different port number, change accordingly.
|
47
|
+
#port: 5432
|
48
|
+
|
49
|
+
# Schema search path. The server defaults to $user,public
|
50
|
+
#schema_search_path: myapp,sharedapp,public
|
51
|
+
|
52
|
+
# Minimum log levels, in increasing order:
|
53
|
+
# debug5, debug4, debug3, debug2, debug1,
|
54
|
+
# log, notice, warning, error, fatal, and panic
|
55
|
+
# Defaults to warning.
|
56
|
+
#min_messages: notice
|
57
|
+
|
58
|
+
# Warning: The database defined as "test" will be erased and
|
59
|
+
# re-generated from your development database when you run "rake".
|
60
|
+
# Do not set this db to the same as development or production.
|
61
|
+
test:
|
62
|
+
<<: *default
|
63
|
+
database: app2_test
|
64
|
+
|
65
|
+
# As with config/secrets.yml, you never want to store sensitive information,
|
66
|
+
# like your database password, in your source code. If your source code is
|
67
|
+
# ever seen by anyone, they now have access to your database.
|
68
|
+
#
|
69
|
+
# Instead, provide the password as a unix environment variable when you boot
|
70
|
+
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
71
|
+
# for a full rundown on how to provide these environment variables in a
|
72
|
+
# production deployment.
|
73
|
+
#
|
74
|
+
# On Heroku and other platform providers, you may have a full connection URL
|
75
|
+
# available as an environment variable. For example:
|
76
|
+
#
|
77
|
+
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
78
|
+
#
|
79
|
+
# You can use this database configuration with:
|
80
|
+
#
|
81
|
+
# production:
|
82
|
+
# url: <%= ENV['DATABASE_URL'] %>
|
83
|
+
#
|
84
|
+
production:
|
85
|
+
<<: *default
|
86
|
+
database: app2_production
|
87
|
+
username: app2
|
88
|
+
password: <%= ENV['APP_DATABASE_PASSWORD'] %>
|