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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83d8c43283eef490327ff90675b0e529a7357bab
4
- data.tar.gz: 9a1776f981cc18005e89c35e44aa83801038e777
3
+ metadata.gz: 4f2c27bb2c2a590489d6a99623e2d7f558d379d9
4
+ data.tar.gz: 4094e0ed724bda3bb83c461afd5027009ea41807
5
5
  SHA512:
6
- metadata.gz: a2682482822e5a30a57568a0696a44b00afc750d2bc2907e01e2399d29208b8525fe287db1ef59b3dc307f422a6be2daee586ba65c6cf2f2c8cbd0da8ba27bad
7
- data.tar.gz: 355f88e955b843ab9d1f7bcb4b890e42c93551d3587dc00474101045dc1b546b131f4efa5d5c6843d42ddfcba43c319164a98fcb5fc99dd79c5d974c452bd6d3
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 `puma` or `unicorn` as the web backend
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`
@@ -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: 'puma', aliases: '-b'
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'))
@@ -24,6 +24,6 @@ Template features:
24
24
 
25
25
  Project features:
26
26
 
27
- `--backend` to switch to a different server backend, ie. unicorn
27
+ `--backend` to switch to a different server backend, ie. puma
28
28
 
29
29
  `--skip-server-start` to skip automatically running puma and sidekiq [false]
@@ -41,7 +41,7 @@ module Orats
41
41
  gsub_postgres_info
42
42
  gsub_redis_info
43
43
  gsub_readme
44
- gsub_unicorn if @options[:backend] == 'unicorn'
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 gsub_unicorn
104
- task 'Update files for switching to unicorn'
103
+ def gsub_puma
104
+ task 'Update files for switching to puma'
105
105
 
106
- gsub_file "#{@target_path}/Procfile", 'puma -C config/puma.rb',
107
- 'unicorn -c config/unicorn.rb'
108
- gsub_file "#{@target_path}/Gemfile", "gem 'puma'", "#gem 'puma'"
109
- gsub_file "#{@target_path}/Gemfile", "#gem 'unic", "gem 'unic"
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 puma to unicorn'
112
+ commit 'Switch from unicorn to puma'
112
113
  end
113
114
 
114
115
  def bundle_install
@@ -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 the mailer/redis, update the timezone and adjust ' + \
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
- SIDEKIQ_CONCURRENCY: 5
47
+ BACKGROUND_THREADS: 5
47
48
 
48
49
  # the name of the service
49
- # this gets combined with LOG_PATH and RUN_STATE_PATH to form a full path
50
+ # this gets combined with RUN_STATE_PATH to form a full path
50
51
  SERVICE: 'app_name'
51
52
 
52
- # the path where logs get written to
53
- # in production you might consider /var/log/app_name
54
- LOG_PATH: 'log'
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 'puma', '~> 2.9.0'
16
- #gem 'unicorn', '~> 4.8.3'
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: puma -C config/puma.rb | grep -v --line-buffered ' 304 -'
1
+ web: unicorn -c config/unicorn.rb | grep -v --line-buffered ' 304 -'
2
2
  worker: sidekiq -C config/sidekiq.yml
3
- log: tail -f log/development.log | grep -xv --line-buffered '^[[:space:]]*' | grep -v --line-buffered '/assets/'
3
+ log: tail -f $LOG_FILE | grep -xv --line-buffered '^[[:space:]]*' | grep -v --line-buffered '/assets/' | grep -v --line-buffered 'HTTP/1.1'
@@ -1,6 +1,6 @@
1
1
  sidekiq_config = {
2
- url: ENV['CACHE_URL'],
3
- namespace: "ns_app::sidekiq_#{Rails.env}"
2
+ url: ENV['BACKGROUND_URL'],
3
+ namespace: "ns_app::sidekiq_#{Rails.env}"
4
4
  }
5
5
 
6
6
  Sidekiq.configure_server do |config|
@@ -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 paths to where logs will be written to.
23
- stdout_redirect "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}.access.log",
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!
@@ -1,5 +1,7 @@
1
1
  ---
2
+
2
3
  :pidfile: "<%= ENV['RUN_STATE_PATH'] %>/sidekiq.pid"
3
- :concurrency: <%= ENV['SIDEKIQ_CONCURRENCY'].to_i %>
4
+ :logfile: "<%= ENV['LOG_FILE'] %>"
5
+ :concurrency: <%= ENV['BACKGROUND_THREADS'].to_i %>
4
6
  :queues:
5
7
  - default
@@ -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 paths to where logs will be written to.
24
- stdout_path "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}.access.log"
25
- stderr_path "#{ENV['LOG_PATH']}/#{ENV['SERVICE']}.error.log"
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
@@ -1,4 +1,4 @@
1
1
  # set the version of this gem
2
2
  module Orats
3
- VERSION = '0.9.3'
3
+ VERSION = '0.9.4'
4
4
  end
@@ -23,8 +23,8 @@ class TestCLI < Minitest::Test
23
23
  assert_new '--template auth'
24
24
  end
25
25
 
26
- def test_new_with_unicorn
27
- assert_new '--backend unicorn'
26
+ def test_new_with_puma
27
+ assert_new '--backend puma'
28
28
  end
29
29
 
30
30
  def test_new_with_invalid_template
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.3
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-07 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor