orats 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/orats/cli.rb +1 -1
- data/lib/orats/cli_help/new +1 -1
- data/lib/orats/commands/new/rails.rb +9 -8
- data/lib/orats/templates/base.rb +3 -2
- data/lib/orats/templates/includes/new/rails/.env +6 -5
- data/lib/orats/templates/includes/new/rails/Gemfile +2 -2
- data/lib/orats/templates/includes/new/rails/Procfile +2 -2
- data/lib/orats/templates/includes/new/rails/config/initializers/sidekiq.rb +2 -2
- data/lib/orats/templates/includes/new/rails/config/puma.rb +2 -3
- data/lib/orats/templates/includes/new/rails/config/sidekiq.yml +3 -1
- data/lib/orats/templates/includes/new/rails/config/unicorn.rb +3 -3
- data/lib/orats/version.rb +1 -1
- data/test/integration/cli_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2c27bb2c2a590489d6a99623e2d7f558d379d9
|
4
|
+
data.tar.gz: 4094e0ed724bda3bb83c461afd5027009ea41807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 380dd962f0246cb071c3bef38867bb1f0ed289ba796d9f95ff329e7a213766b61fec6573ded56bf9740c5d766584e280a2abe60c38b37c1f76b64fee0ef03769
|
7
|
+
data.tar.gz: 148b5771f26520873df6bb54f098a96d02f011fbd7d4d2b262fbe196b6550e4a1b7b72064fd955f09c671149f1fdafa57ee6f14cc58fe2e4a0cbb8f3fd515306
|
data/README.md
CHANGED
@@ -104,7 +104,7 @@ All of the changes have git commits to go with them. After generating a project
|
|
104
104
|
- **Core changes**:
|
105
105
|
- Use `postgres` as the primary SQL database
|
106
106
|
- Use `redis` as the cache backend
|
107
|
-
- Use `
|
107
|
+
- Use `unicorn` or `puma` as the web backend
|
108
108
|
- Use `sidekiq` as a background worker
|
109
109
|
- **Features**:
|
110
110
|
- Configure scheduled jobs and tasks using `whenever`
|
data/lib/orats/cli.rb
CHANGED
@@ -50,7 +50,7 @@ module Orats
|
|
50
50
|
option :template, default: '', aliases: '-t'
|
51
51
|
option :custom, default: '', aliases: '-c'
|
52
52
|
option :skip_server_start, type: :boolean, default: false, aliases: '-S'
|
53
|
-
option :backend, default: '
|
53
|
+
option :backend, default: 'unicorn', aliases: '-b'
|
54
54
|
option :rc, default: ''
|
55
55
|
desc 'new PATH [options]', 'Create a new orats application'
|
56
56
|
long_desc File.read(File.join(File.dirname(__FILE__), 'cli_help/new'))
|
data/lib/orats/cli_help/new
CHANGED
@@ -41,7 +41,7 @@ module Orats
|
|
41
41
|
gsub_postgres_info
|
42
42
|
gsub_redis_info
|
43
43
|
gsub_readme
|
44
|
-
|
44
|
+
gsub_puma if @options[:backend] == 'puma'
|
45
45
|
|
46
46
|
bundle_install
|
47
47
|
bundle_binstubs
|
@@ -100,15 +100,16 @@ module Orats
|
|
100
100
|
commit 'Update the readme'
|
101
101
|
end
|
102
102
|
|
103
|
-
def
|
104
|
-
task 'Update files for switching to
|
103
|
+
def gsub_puma
|
104
|
+
task 'Update files for switching to puma'
|
105
105
|
|
106
|
-
gsub_file "#{@target_path}/Procfile", '
|
107
|
-
'
|
108
|
-
gsub_file "#{@target_path}/Gemfile",
|
109
|
-
|
106
|
+
gsub_file "#{@target_path}/Procfile", 'unicorn -c config/unicorn.rb',
|
107
|
+
'puma -C config/puma.rb'
|
108
|
+
gsub_file "#{@target_path}/Gemfile",
|
109
|
+
"gem 'unicorn'", "#gem 'unicorn'"
|
110
|
+
gsub_file "#{@target_path}/Gemfile", "#gem 'puma'", "gem 'puma'"
|
110
111
|
|
111
|
-
commit 'Switch from
|
112
|
+
commit 'Switch from unicorn to puma'
|
112
113
|
end
|
113
114
|
|
114
115
|
def bundle_install
|
data/lib/orats/templates/base.rb
CHANGED
@@ -164,6 +164,8 @@ def update_app_config
|
|
164
164
|
|
165
165
|
# http://www.loc.gov/standards/iso639-2/php/English_list.php
|
166
166
|
config.i18n.default_locale = ENV['DEFAULT_LOCALE'] unless ENV['DEFAULT_LOCALE'] == 'en'
|
167
|
+
|
168
|
+
config.paths['log'] = ENV['LOG_FILE']
|
167
169
|
S
|
168
170
|
end
|
169
171
|
|
@@ -180,8 +182,7 @@ ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
|
|
180
182
|
end
|
181
183
|
S
|
182
184
|
end
|
183
|
-
commit 'Configure
|
184
|
-
' the validation output'
|
185
|
+
commit 'Configure various application wide settings'
|
185
186
|
end
|
186
187
|
|
187
188
|
def update_database_config
|
@@ -28,6 +28,7 @@ ACTION_MAILER_DEFAULT_TO: 'me@app_name.com'
|
|
28
28
|
# test: app_name_test
|
29
29
|
DATABASE_URL: 'postgresql://db_user@db_location:db_port/app_name?encoding=utf8&pool=5&timeout=5000'
|
30
30
|
CACHE_URL: 'redis://cache_location:cache_port/0'
|
31
|
+
BACKGROUND_URL: 'redis://cache_location:cache_port/0'
|
31
32
|
|
32
33
|
# listen on a tcp port or unix socket
|
33
34
|
LISTEN_ON: '0.0.0.0:3000'
|
@@ -43,15 +44,15 @@ THREADS_MAX: 1
|
|
43
44
|
WORKERS: 1
|
44
45
|
|
45
46
|
# this should equal the database pool size
|
46
|
-
|
47
|
+
BACKGROUND_THREADS: 5
|
47
48
|
|
48
49
|
# the name of the service
|
49
|
-
# this gets combined with
|
50
|
+
# this gets combined with RUN_STATE_PATH to form a full path
|
50
51
|
SERVICE: 'app_name'
|
51
52
|
|
52
|
-
# the
|
53
|
-
# in production you might consider /var/log/
|
54
|
-
|
53
|
+
# the log file that both the app and sidekiq write to
|
54
|
+
# in production you might consider /var/log/user.log to leverage syslog
|
55
|
+
LOG_FILE: 'log/app_name.log'
|
55
56
|
|
56
57
|
# the path that will contain pids and sockets
|
57
58
|
# in production you will likely want to set this to '/var/run/app_name'
|
@@ -12,8 +12,8 @@ gem 'font-awesome-rails', '~> 4.1.0'
|
|
12
12
|
gem 'pg', '~> 0.17.1'
|
13
13
|
gem 'redis-rails', '~> 4.0.0'
|
14
14
|
|
15
|
-
gem '
|
16
|
-
#gem '
|
15
|
+
gem 'unicorn', '~> 4.8.3'
|
16
|
+
#gem 'puma', '~> 2.9.0'
|
17
17
|
gem 'sidekiq', '~> 3.2.1'
|
18
18
|
gem 'sinatra', '>= 1.4.5', require: false
|
19
19
|
|
@@ -1,3 +1,3 @@
|
|
1
|
-
web:
|
1
|
+
web: unicorn -c config/unicorn.rb | grep -v --line-buffered ' 304 -'
|
2
2
|
worker: sidekiq -C config/sidekiq.yml
|
3
|
-
log: tail -f
|
3
|
+
log: tail -f $LOG_FILE | grep -xv --line-buffered '^[[:space:]]*' | grep -v --line-buffered '/assets/' | grep -v --line-buffered 'HTTP/1.1'
|
@@ -19,9 +19,8 @@ pidfile "#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}.pid"
|
|
19
19
|
# uploads you may want to increase this.
|
20
20
|
worker_timeout 30
|
21
21
|
|
22
|
-
# The
|
23
|
-
stdout_redirect
|
24
|
-
"#{ENV['LOG_PATH']}/#{ENV['SERVICE']}.error.log"
|
22
|
+
# The file that gets logged to.
|
23
|
+
stdout_redirect ENV['LOG_FILE'], ENV['LOG_FILE']
|
25
24
|
|
26
25
|
# Preload the application before starting the workers.
|
27
26
|
preload_app!
|
@@ -20,9 +20,9 @@ pid "#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}.pid"
|
|
20
20
|
# uploads you may want to increase this.
|
21
21
|
timeout 30
|
22
22
|
|
23
|
-
# The
|
24
|
-
stdout_path
|
25
|
-
stderr_path
|
23
|
+
# The file that gets logged to.
|
24
|
+
stdout_path ENV['LOG_FILE']
|
25
|
+
stderr_path ENV['LOG_FILE']
|
26
26
|
|
27
27
|
# Combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings:
|
28
28
|
# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
|
data/lib/orats/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Janetakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|