railsqs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +120 -0
- data/LICENSE +21 -0
- data/README.md +3 -0
- data/Rakefile +3 -0
- data/bin/railsqs +14 -0
- data/bin/rake +16 -0
- data/bin/setup +13 -0
- data/lib/railsqs/actions.rb +25 -0
- data/lib/railsqs/app_builder.rb +270 -0
- data/lib/railsqs/generators/app_generator.rb +177 -0
- data/lib/railsqs/version.rb +5 -0
- data/lib/railsqs.rb +4 -0
- data/railsqs.gemspec +34 -0
- data/templates/#bin_setup.erb# +34 -0
- data/templates/Gemfile.erb +64 -0
- data/templates/Procfile +2 -0
- data/templates/README.md.erb +35 -0
- data/templates/_flashes.html.erb +9 -0
- data/templates/_footer.html.erb +0 -0
- data/templates/_javascript.html.erb +10 -0
- data/templates/_navigation.html.erb +20 -0
- data/templates/application.css.scss +10 -0
- data/templates/bin_setup.erb +37 -0
- data/templates/bootstrap.scss +50 -0
- data/templates/config_i18n_tasks.yml +13 -0
- data/templates/config_locales_en.yml +19 -0
- data/templates/development_seeds.rb +7 -0
- data/templates/disable_xml_params.rb +3 -0
- data/templates/errors.rb +34 -0
- data/templates/newrelic.yml.erb +34 -0
- data/templates/postgresql_database.yml.erb +12 -0
- data/templates/puma.rb +158 -0
- data/templates/rack_timeout.rb +1 -0
- data/templates/railsqs_gitignore +13 -0
- data/templates/railsqs_layout.html.erb.erb +24 -0
- data/templates/sample.env +3 -0
- data/templates/secrets.yml +14 -0
- data/templates/smtp.rb +9 -0
- data/templates/staging.rb +5 -0
- data/templates/unicorn.rb +30 -0
- metadata +137 -0
data/lib/railsqs.rb
ADDED
data/railsqs.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'railsqs/version'
|
4
|
+
require 'date'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.required_ruby_version = ">= #{Railsqs::RUBY_VERSION}"
|
8
|
+
s.authors = ['opendrops']
|
9
|
+
s.date = Date.today.strftime('%Y-%m-%d')
|
10
|
+
|
11
|
+
s.description = <<-HERE
|
12
|
+
Railsqs is a base Rails project that you can upgrade. It is used by
|
13
|
+
opendrops to get a jump start on a working app. Use Railsqs if you're in a
|
14
|
+
rush to build something amazing; don't use it if you like missing deadlines.
|
15
|
+
HERE
|
16
|
+
|
17
|
+
s.email = 'support@opendrops.com'
|
18
|
+
s.executables = ['railsqs']
|
19
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
20
|
+
s.files = `git ls-files`.split("\n")
|
21
|
+
s.homepage = 'http://github.com/opendrops/railsqs'
|
22
|
+
s.license = 'MIT'
|
23
|
+
s.name = 'railsqs'
|
24
|
+
s.rdoc_options = ['--charset=UTF-8']
|
25
|
+
s.require_paths = ['lib']
|
26
|
+
s.summary = "Generate a Rails app using opendrops's best practices. (Based on Thoughtbot's suspenders)"
|
27
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
28
|
+
s.version = Railsqs::VERSION
|
29
|
+
|
30
|
+
s.add_dependency 'bitters', '~> 0.10.0'
|
31
|
+
s.add_dependency 'bundler', '~> 1.3'
|
32
|
+
s.add_dependency 'rails', Railsqs::RAILS_VERSION
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
# Set up Rails app. Run this script immediately after cloning the codebase.
|
4
|
+
# https://github.com/thoughtbot/guides/tree/master/protocol
|
5
|
+
|
6
|
+
# Exit if any subcommand fails
|
7
|
+
set -e
|
8
|
+
|
9
|
+
# Set up Ruby dependencies via Bundler
|
10
|
+
if ! command -v bundle > /dev/null; then
|
11
|
+
gem install bundler --no-document
|
12
|
+
fi
|
13
|
+
|
14
|
+
bundle install
|
15
|
+
|
16
|
+
# Set up configurable environment variables
|
17
|
+
if [ ! -f .env ]; then
|
18
|
+
cp .sample.env .env
|
19
|
+
fi
|
20
|
+
|
21
|
+
# Set up database and add any development seed data
|
22
|
+
bundle exec rake dev:prime
|
23
|
+
|
24
|
+
# Pick a port for Foreman
|
25
|
+
if ! grep -qs 'port' .foreman; then
|
26
|
+
printf 'port: <%= config[:port_number] %>\n' >> .foreman
|
27
|
+
fi
|
28
|
+
|
29
|
+
# Error out if Foreman is not installed
|
30
|
+
if ! command -v foreman > /dev/null; then
|
31
|
+
printf 'Foreman is not installed.\n'
|
32
|
+
printf 'See https://github.com/ddollar/foreman for install instructions.\n'
|
33
|
+
exit 1
|
34
|
+
fi
|
@@ -0,0 +1,64 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
ruby '<%= Railsqs::RUBY_VERSION %>'
|
3
|
+
|
4
|
+
def darwin_only(require_as)
|
5
|
+
RUBY_PLATFORM.include?('darwin') && require_as
|
6
|
+
end
|
7
|
+
|
8
|
+
def linux_only(require_as)
|
9
|
+
RUBY_PLATFORM.include?('linux') && require_as
|
10
|
+
end
|
11
|
+
|
12
|
+
gem 'bootstrap-sass', '~> 3.2.0'
|
13
|
+
gem 'bourbon', '~> 3.2.1'
|
14
|
+
gem 'coffee-rails', '~> 4.0.0'
|
15
|
+
gem 'email_validator'
|
16
|
+
gem 'font-awesome-rails'
|
17
|
+
gem 'jquery-rails', '~> 4.0.0.beta2'
|
18
|
+
gem 'jbuilder', '~> 2.0'
|
19
|
+
gem 'kaminari'
|
20
|
+
gem 'neat', '~> 1.5.1'
|
21
|
+
gem 'normalize-rails', '~> 3.0.0'
|
22
|
+
gem 'pg'
|
23
|
+
gem 'puma'
|
24
|
+
gem 'rack-timeout'
|
25
|
+
gem 'rails', '<%= Railsqs::RAILS_VERSION %>'
|
26
|
+
gem 'ransack', github: 'activerecord-hackery/ransack', branch: 'rails-4.2'
|
27
|
+
gem 'recipient_interceptor'
|
28
|
+
gem 'sass-rails', '~> 5.0.0.beta1'
|
29
|
+
gem 'simple_form'
|
30
|
+
gem 'turbolinks'
|
31
|
+
gem 'uglifier', '>= 1.3.0'
|
32
|
+
|
33
|
+
group :development, :test do
|
34
|
+
gem 'awesome_print'
|
35
|
+
gem 'byebug'
|
36
|
+
gem 'capybara'
|
37
|
+
gem 'ffaker'
|
38
|
+
gem 'growl', require: darwin_only('growl')
|
39
|
+
gem 'guard'
|
40
|
+
gem 'guard-spinach'
|
41
|
+
gem 'launchy'
|
42
|
+
gem 'pry'
|
43
|
+
gem 'pry-rails'
|
44
|
+
gem 'rb-fsevent', require: darwin_only('rb-fsevent')
|
45
|
+
gem 'rb-inotify', require: linux_only('rb-inotify')
|
46
|
+
gem 'spinach'
|
47
|
+
gem 'spring-commands-spinach'
|
48
|
+
gem 'spring'
|
49
|
+
gem 'web-console', '~> 2.0.0.beta4'
|
50
|
+
end
|
51
|
+
|
52
|
+
group :test do
|
53
|
+
gem 'database_cleaner'
|
54
|
+
gem 'poltergeist'
|
55
|
+
gem 'timecop'
|
56
|
+
gem 'webmock'
|
57
|
+
end
|
58
|
+
|
59
|
+
group :staging, :production do
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
|
data/templates/Procfile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
<%= app_name.humanize %>
|
2
|
+
<%= '=' * app_name.humanize.length %>
|
3
|
+
|
4
|
+
Getting Started
|
5
|
+
---------------
|
6
|
+
|
7
|
+
After you have cloned this repo, run this setup script to set up your machine
|
8
|
+
with the necessary dependencies to run and test this app:
|
9
|
+
|
10
|
+
% ./bin/setup
|
11
|
+
|
12
|
+
It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up
|
13
|
+
your machine with [this script].
|
14
|
+
|
15
|
+
[this script]: https://github.com/thoughtbot/laptop
|
16
|
+
|
17
|
+
After setting up, you can run the application using [foreman]:
|
18
|
+
|
19
|
+
% foreman start
|
20
|
+
|
21
|
+
If you don't have `foreman`, see [Foreman's install instructions][foreman]. It
|
22
|
+
is [purposefully excluded from the project's `Gemfile`][exclude].
|
23
|
+
|
24
|
+
[foreman]: https://github.com/ddollar/foreman
|
25
|
+
[exclude]: https://github.com/ddollar/foreman/pull/437#issuecomment-41110407
|
26
|
+
|
27
|
+
Guidelines
|
28
|
+
----------
|
29
|
+
|
30
|
+
Use the following guides for getting things done, programming well, and
|
31
|
+
programming in style.
|
32
|
+
|
33
|
+
* [Protocol](http://github.com/thoughtbot/guides/blob/master/protocol)
|
34
|
+
* [Best Practices](http://github.com/thoughtbot/guides/blob/master/best-practices)
|
35
|
+
* [Style](http://github.com/thoughtbot/guides/blob/master/style)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%# Rails flash messages styled for Bootstrap 3.0 %>
|
2
|
+
<% flash.each do |name, msg| %>
|
3
|
+
<% if msg.is_a?(String) %>
|
4
|
+
<div class="alert alert-<%= name.to_s == 'notice' ? 'success' : 'danger' %>">
|
5
|
+
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
6
|
+
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
File without changes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%# navigation styled for Bootstrap 3.0 %>
|
2
|
+
<nav class="navbar navbar-default">
|
3
|
+
<div class="container">
|
4
|
+
<div class="navbar-header">
|
5
|
+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
6
|
+
<span class="sr-only">Toggle navigation</span>
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
<span class="icon-bar"></span>
|
10
|
+
</button>
|
11
|
+
<%= link_to 'Home', root_path, class: 'navbar-brand' %>
|
12
|
+
</div>
|
13
|
+
<div class="collapse navbar-collapse">
|
14
|
+
<ul class="nav navbar-nav">
|
15
|
+
<li><a href="#">Dummy</a></li>
|
16
|
+
<%# render 'layouts/navigation_links' %>
|
17
|
+
</ul>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</nav>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
# Set up Rails app. Run this script immediately after cloning the codebase.
|
4
|
+
# https://github.com/thoughtbot/guides/tree/master/protocol
|
5
|
+
|
6
|
+
# Exit if any subcommand fails
|
7
|
+
set -e
|
8
|
+
|
9
|
+
# Set up Ruby dependencies via Bundler
|
10
|
+
if ! command -v bundle > /dev/null; then
|
11
|
+
gem install bundler --no-document
|
12
|
+
fi
|
13
|
+
|
14
|
+
bundle install
|
15
|
+
|
16
|
+
# Set up configurable environment variables
|
17
|
+
if [ ! -f .env ]; then
|
18
|
+
cp .sample.env .env
|
19
|
+
fi
|
20
|
+
|
21
|
+
# Set up database and add any development seed data
|
22
|
+
bundle exec rake dev:prime
|
23
|
+
|
24
|
+
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
|
25
|
+
mkdir -p .git/safe
|
26
|
+
|
27
|
+
# Pick a port for Foreman
|
28
|
+
if ! grep -qs 'port' .foreman; then
|
29
|
+
printf 'port: <%= config[:port_number] %>\n' >> .foreman
|
30
|
+
fi
|
31
|
+
|
32
|
+
# Error out if Foreman is not installed
|
33
|
+
if ! command -v foreman > /dev/null; then
|
34
|
+
printf 'Foreman is not installed.\n'
|
35
|
+
printf 'See https://github.com/ddollar/foreman for install instructions.\n'
|
36
|
+
exit 1
|
37
|
+
fi
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// Core variables and mixins
|
2
|
+
@import "bootstrap/variables";
|
3
|
+
@import "bootstrap/mixins";
|
4
|
+
|
5
|
+
// Reset and dependencies
|
6
|
+
@import "bootstrap/normalize";
|
7
|
+
@import "bootstrap/print";
|
8
|
+
@import "bootstrap/glyphicons";
|
9
|
+
|
10
|
+
// Core CSS
|
11
|
+
@import "bootstrap/scaffolding";
|
12
|
+
@import "bootstrap/type";
|
13
|
+
@import "bootstrap/code";
|
14
|
+
@import "bootstrap/grid";
|
15
|
+
@import "bootstrap/tables";
|
16
|
+
@import "bootstrap/forms";
|
17
|
+
@import "bootstrap/buttons";
|
18
|
+
|
19
|
+
// Components
|
20
|
+
@import "bootstrap/component-animations";
|
21
|
+
@import "bootstrap/dropdowns";
|
22
|
+
@import "bootstrap/button-groups";
|
23
|
+
@import "bootstrap/input-groups";
|
24
|
+
@import "bootstrap/navs";
|
25
|
+
@import "bootstrap/navbar";
|
26
|
+
@import "bootstrap/breadcrumbs";
|
27
|
+
@import "bootstrap/pagination";
|
28
|
+
@import "bootstrap/pager";
|
29
|
+
@import "bootstrap/labels";
|
30
|
+
@import "bootstrap/badges";
|
31
|
+
@import "bootstrap/jumbotron";
|
32
|
+
@import "bootstrap/thumbnails";
|
33
|
+
@import "bootstrap/alerts";
|
34
|
+
@import "bootstrap/progress-bars";
|
35
|
+
@import "bootstrap/media";
|
36
|
+
@import "bootstrap/list-group";
|
37
|
+
@import "bootstrap/panels";
|
38
|
+
@import "bootstrap/responsive-embed";
|
39
|
+
@import "bootstrap/wells";
|
40
|
+
@import "bootstrap/close";
|
41
|
+
|
42
|
+
// Components w/ JavaScript
|
43
|
+
@import "bootstrap/modals";
|
44
|
+
@import "bootstrap/tooltip";
|
45
|
+
@import "bootstrap/popovers";
|
46
|
+
@import "bootstrap/carousel";
|
47
|
+
|
48
|
+
// Utility classes
|
49
|
+
@import "bootstrap/utilities";
|
50
|
+
@import "bootstrap/responsive-utilities";
|
data/templates/errors.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "net/http"
|
2
|
+
require "net/smtp"
|
3
|
+
|
4
|
+
# Example:
|
5
|
+
# begin
|
6
|
+
# some http call
|
7
|
+
# rescue *HTTP_ERRORS => error
|
8
|
+
# notify_hoptoad error
|
9
|
+
# end
|
10
|
+
|
11
|
+
HTTP_ERRORS = [
|
12
|
+
EOFError,
|
13
|
+
Errno::ECONNRESET,
|
14
|
+
Errno::EINVAL,
|
15
|
+
Net::HTTPBadResponse,
|
16
|
+
Net::HTTPHeaderSyntaxError,
|
17
|
+
Net::ProtocolError,
|
18
|
+
Timeout::Error
|
19
|
+
]
|
20
|
+
|
21
|
+
SMTP_SERVER_ERRORS = [
|
22
|
+
IOError,
|
23
|
+
Net::SMTPAuthenticationError,
|
24
|
+
Net::SMTPServerBusy,
|
25
|
+
Net::SMTPUnknownError,
|
26
|
+
TimeoutError
|
27
|
+
]
|
28
|
+
|
29
|
+
SMTP_CLIENT_ERRORS = [
|
30
|
+
Net::SMTPFatalError,
|
31
|
+
Net::SMTPSyntaxError
|
32
|
+
]
|
33
|
+
|
34
|
+
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
|
@@ -0,0 +1,34 @@
|
|
1
|
+
common: &default_settings
|
2
|
+
app_name: "<%= app_name %>"
|
3
|
+
audit_log:
|
4
|
+
enabled: false
|
5
|
+
browser_monitoring:
|
6
|
+
auto_instrument: true
|
7
|
+
capture_params: false
|
8
|
+
developer_mode: false
|
9
|
+
error_collector:
|
10
|
+
capture_source: true
|
11
|
+
enabled: true
|
12
|
+
ignore_errors: "ActionController::RoutingError,Sinatra::NotFound"
|
13
|
+
license_key: "<%%= ENV["NEW_RELIC_LICENSE_KEY"] %>"
|
14
|
+
log_level: info
|
15
|
+
monitor_mode: true
|
16
|
+
transaction_tracer:
|
17
|
+
enabled: true
|
18
|
+
record_sql: obfuscated
|
19
|
+
stack_trace_threshold: 0.500
|
20
|
+
transaction_threshold: apdex_f
|
21
|
+
development:
|
22
|
+
<<: *default_settings
|
23
|
+
monitor_mode: false
|
24
|
+
developer_mode: true
|
25
|
+
test:
|
26
|
+
<<: *default_settings
|
27
|
+
monitor_mode: false
|
28
|
+
production:
|
29
|
+
<<: *default_settings
|
30
|
+
monitor_mode: true
|
31
|
+
staging:
|
32
|
+
<<: *default_settings
|
33
|
+
app_name: "<%= app_name %> (Staging)"
|
34
|
+
monitor_mode: true
|
data/templates/puma.rb
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
#!/usr/bin/env puma
|
2
|
+
|
3
|
+
# The directory to operate out of.
|
4
|
+
#
|
5
|
+
# The default is the current directory.
|
6
|
+
#
|
7
|
+
# directory '/u/apps/lolcat'
|
8
|
+
|
9
|
+
# Use an object or block as the rack application. This allows the
|
10
|
+
# config file to be the application itself.
|
11
|
+
#
|
12
|
+
# app do |env|
|
13
|
+
# puts env
|
14
|
+
#
|
15
|
+
# body = 'Hello, World!'
|
16
|
+
#
|
17
|
+
# [200, { 'Content-Type' => 'text/plain', 'Content-Length' => body.length.to_s }, [body]]
|
18
|
+
# end
|
19
|
+
|
20
|
+
# Load “path” as a rackup file.
|
21
|
+
#
|
22
|
+
# The default is “config.ru”.
|
23
|
+
#
|
24
|
+
# rackup '/u/apps/lolcat/config.ru'
|
25
|
+
|
26
|
+
# Set the environment in which the rack's app will run. The value must be a string.
|
27
|
+
#
|
28
|
+
# The default is “development”.
|
29
|
+
#
|
30
|
+
# environment 'production'
|
31
|
+
|
32
|
+
# Daemonize the server into the background. Highly suggest that
|
33
|
+
# this be combined with “pidfile” and “stdout_redirect”.
|
34
|
+
#
|
35
|
+
# The default is “false”.
|
36
|
+
#
|
37
|
+
# daemonize
|
38
|
+
# daemonize false
|
39
|
+
|
40
|
+
# Store the pid of the server in the file at “path”.
|
41
|
+
#
|
42
|
+
# pidfile '/u/apps/lolcat/tmp/pids/puma.pid'
|
43
|
+
|
44
|
+
# Use “path” as the file to store the server info state. This is
|
45
|
+
# used by “pumactl” to query and control the server.
|
46
|
+
#
|
47
|
+
# state_path '/u/apps/lolcat/tmp/pids/puma.state'
|
48
|
+
|
49
|
+
# Redirect STDOUT and STDERR to files specified. The 3rd parameter
|
50
|
+
# (“append”) specifies whether the output is appended, the default is
|
51
|
+
# “false”.
|
52
|
+
#
|
53
|
+
# stdout_redirect '/u/apps/lolcat/log/stdout', '/u/apps/lolcat/log/stderr'
|
54
|
+
# stdout_redirect '/u/apps/lolcat/log/stdout', '/u/apps/lolcat/log/stderr', true
|
55
|
+
|
56
|
+
# Disable request logging.
|
57
|
+
#
|
58
|
+
# The default is “false”.
|
59
|
+
#
|
60
|
+
# quiet
|
61
|
+
|
62
|
+
# Configure “min” to be the minimum number of threads to use to answer
|
63
|
+
# requests and “max” the maximum.
|
64
|
+
#
|
65
|
+
# The default is “0, 16”.
|
66
|
+
#
|
67
|
+
# threads 0, 16
|
68
|
+
|
69
|
+
# Bind the server to “url”. “tcp://”, “unix://” and “ssl://” are the only
|
70
|
+
# accepted protocols.
|
71
|
+
#
|
72
|
+
# The default is “tcp://0.0.0.0:9292”.
|
73
|
+
#
|
74
|
+
# bind 'tcp://0.0.0.0:9292'
|
75
|
+
# bind 'unix:///var/run/puma.sock'
|
76
|
+
# bind 'unix:///var/run/puma.sock?umask=0777'
|
77
|
+
# bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
|
78
|
+
|
79
|
+
# Instead of “bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'” you
|
80
|
+
# can also use the “ssl_bind” option.
|
81
|
+
#
|
82
|
+
# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }
|
83
|
+
|
84
|
+
# Code to run before doing a restart. This code should
|
85
|
+
# close log files, database connections, etc.
|
86
|
+
#
|
87
|
+
# This can be called multiple times to add code each time.
|
88
|
+
#
|
89
|
+
# on_restart do
|
90
|
+
# puts 'On restart...'
|
91
|
+
# end
|
92
|
+
|
93
|
+
# Command to use to restart puma. This should be just how to
|
94
|
+
# load puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments
|
95
|
+
# to puma, as those are the same as the original process.
|
96
|
+
#
|
97
|
+
# restart_command '/u/app/lolcat/bin/restart_puma'
|
98
|
+
|
99
|
+
# === Cluster mode ===
|
100
|
+
|
101
|
+
# How many worker processes to run.
|
102
|
+
#
|
103
|
+
# The default is “0”.
|
104
|
+
#
|
105
|
+
# workers 2
|
106
|
+
|
107
|
+
# Code to run when a worker boots to setup the process before booting
|
108
|
+
# the app.
|
109
|
+
#
|
110
|
+
# This can be called multiple times to add hooks.
|
111
|
+
#
|
112
|
+
# on_worker_boot do
|
113
|
+
# puts 'On worker boot...'
|
114
|
+
# end
|
115
|
+
|
116
|
+
# Code to run when a worker boots to setup the process after booting
|
117
|
+
# the app.
|
118
|
+
#
|
119
|
+
# This can be called multiple times to add hooks.
|
120
|
+
#
|
121
|
+
# after_worker_boot do
|
122
|
+
# puts 'On worker boot...'
|
123
|
+
# end
|
124
|
+
|
125
|
+
# Allow workers to reload bundler context when master process is issued
|
126
|
+
# a USR1 signal. This allows proper reloading of gems while the master
|
127
|
+
# is preserved across a phased-restart. (incompatible with preload_app)
|
128
|
+
# (off by default)
|
129
|
+
|
130
|
+
# prune_bundler
|
131
|
+
|
132
|
+
# Preload the application before starting the workers; this conflicts with
|
133
|
+
# phased restart feature. (off by default)
|
134
|
+
|
135
|
+
# preload_app!
|
136
|
+
|
137
|
+
# Additional text to display in process listing
|
138
|
+
#
|
139
|
+
# tag 'app name'
|
140
|
+
|
141
|
+
# Change the default timeout of workers
|
142
|
+
#
|
143
|
+
# worker_timeout 60
|
144
|
+
|
145
|
+
# === Puma control rack application ===
|
146
|
+
|
147
|
+
# Start the puma control rack application on “url”. This application can
|
148
|
+
# be communicated with to control the main server. Additionally, you can
|
149
|
+
# provide an authentication token, so all requests to the control server
|
150
|
+
# will need to include that token as a query parameter. This allows for
|
151
|
+
# simple authentication.
|
152
|
+
#
|
153
|
+
# Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb
|
154
|
+
# to see what the app has available.
|
155
|
+
#
|
156
|
+
# activate_control_app 'unix:///var/run/pumactl.sock'
|
157
|
+
# activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' }
|
158
|
+
# activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true }
|
@@ -0,0 +1 @@
|
|
1
|
+
Rack::Timeout.timeout = (ENV["TIMEOUT_IN_SECONDS"] || 5).to_i
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title><%%= content_for?(:title) ? yield(:title) : "My Application" %></title>
|
7
|
+
<meta name="description" content="<%%= content_for?(:description) ? yield(:description) : "" %>">
|
8
|
+
<%%= stylesheet_link_tag :application, media: "all" %>
|
9
|
+
<%%= csrf_meta_tags %>
|
10
|
+
</head>
|
11
|
+
<body class="">
|
12
|
+
<header>
|
13
|
+
<%%= render 'navigation' %>
|
14
|
+
</header>
|
15
|
+
<main role="main">
|
16
|
+
<%%= render 'flashes' -%>
|
17
|
+
<%%= yield %>
|
18
|
+
</main>
|
19
|
+
<footer>
|
20
|
+
<%%= render 'footer' %>
|
21
|
+
</footer>
|
22
|
+
<%%= render 'javascript' %>
|
23
|
+
</body>
|
24
|
+
</html>
|