railman 0.6.13 → 0.6.14

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: 7033d6686d77861959227d4e9b27ef5611fb93e1
4
- data.tar.gz: 4d946a16c6168c828465fd6c6c28bb94f439245a
3
+ metadata.gz: ff3a64f05648faa195706f4ae12a591089c00df6
4
+ data.tar.gz: ae60b309f39a1eca295a15814bcc9fecc002149c
5
5
  SHA512:
6
- metadata.gz: bde38841e330a4d2d07e514744ea6738ad8f387bc2b71f15ed823e87c22ce1b5c5f4110b84cff79763681c9c4e395feaa842d1df29968e890af54451d1a7e3ca
7
- data.tar.gz: 4ecdd838b4391f182366b5c9370ad259ab7df3c33c83c57ddfce472c2f112f2e8509e918b48dfeaa46afcbd59f8a7da2a3540adfe830cbf91446e88ef9f25952
6
+ metadata.gz: 3eff0133a2d9fb481bde443b16490f876dc123284a80b4546506ff30ee90d86971dc7a4ac46e0266fbc026a65c70d3c0c2cf45f88dc55a6eb6fe6be3cd7ab7f1
7
+ data.tar.gz: 509ac45277e79b7e041f979b4f7bc76daf10bd921d8e3558aebece6f167a75c87bd58c2000d86bbff6e4e3b6d74a3a21818e2fed852373147f430997446e621f
@@ -1,3 +1,3 @@
1
1
  module Railman
2
- VERSION = '0.6.13'
2
+ VERSION = '0.6.14'
3
3
  end
@@ -28,6 +28,8 @@ EXCEPTION_NOTIFICATION_SENDER = 'server@<%= @config.domain %>'
28
28
  UNICORN_BEHIND_NGINX = <%= @unicorn_behind_nginx %>
29
29
  # UNICORN_PORT = 3000
30
30
 
31
+ # Redis settings
32
+ REDIS_SERVER = 'localhost:6379/X'
31
33
 
32
34
  # Rails environment
33
35
  RAILS_ENV = 'development'
@@ -36,6 +36,8 @@ EXCEPTION_NOTIFICATION_SENDER = 'server@<%= @config.domain %>'
36
36
  UNICORN_BEHIND_NGINX = true
37
37
  UNICORN_WORKERS = 4
38
38
 
39
+ # Redis settings
40
+ REDIS_SERVER = 'localhost:6379/X'
39
41
 
40
42
  # Rails environment
41
43
  RAILS_ENV = 'production'
@@ -28,6 +28,8 @@ EXCEPTION_NOTIFICATION_SENDER = 'server@<%= @config.domain %>'
28
28
  UNICORN_BEHIND_NGINX = true
29
29
  # UNICORN_PORT = 3000
30
30
 
31
+ # Redis settings
32
+ REDIS_SERVER = 'localhost:6379/X'
31
33
 
32
34
  # Rails environment
33
35
  RAILS_ENV = 'test'
@@ -7,9 +7,10 @@ gem 'pg', '0.18.2'
7
7
 
8
8
  gem 'semantic-rails-ui' # semantic-ui + simple_form + rails helpers
9
9
 
10
- gem 'dalli', '2.7.6' # memcached client
11
- gem 'kgio', '2.10.0' # gives dalli 20-30% performance boost
12
- gem 'redis-session-store' # store sessions in redis
10
+ gem 'hiredis', '0.6.1'
11
+ gem 'redis', '3.3.1', require: %w(redis redis/connection/hiredis)
12
+ gem 'redis-namespace', '1.5.2'
13
+ gem 'redis-rails', '5.0.1'
13
14
 
14
15
  gem 'sidekiq', '4.1.1' # backgroud jobs
15
16
  gem 'sidekiq-scheduler', '2.0.6' # scheduled background jobs
@@ -56,7 +56,7 @@ Rails.application.configure do
56
56
 
57
57
  # Use a different cache store in production.
58
58
  # config.cache_store = :mem_cache_store
59
- config.cache_store = :dalli_store, { namespace: '<%= @config.app_name %>:' }
59
+ config.cache_store = :redis_store, "redis://#{ENV.fetch('REDIS_SERVER')}/<%= @config.app_name %>:#{Rails.env}:cache"
60
60
 
61
61
  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
62
62
  # config.action_controller.asset_host = 'http://assets.example.com'
@@ -0,0 +1,2 @@
1
+ $redis = Redis::Namespace.new("<%= @config.app_name %>:#{Rails.env}:app", redis: Redis.new(url: "redis://#{ENV.fetch('REDIS_SERVER')}"))
2
+ $redis_root = Redis::Namespace.new("<%= @config.app_name %>:#{Rails.env}", redis: Redis.new(url: "redis://#{ENV.fetch('REDIS_SERVER')}"))
@@ -1,6 +1,7 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.session_store :redis_session_store, {
3
+ Rails.application.config.session_store :redis_store,
4
+ redis_server: "redis://#{ENV.fetch('REDIS_SERVER')}/<%= @config.app_name %>:#{Rails.env}:sessions",
4
5
  key: "_<%= @config.app_name %>_session",
5
- redis: { key_prefix: "<%= @config.app_name %>:", expire_after: 30.minutes }
6
- }
6
+ expire_after: 30.minutes
7
+
@@ -1,7 +1,7 @@
1
1
  require 'sidekiq/scheduler'
2
2
 
3
3
  # Configure Sidekiq Redis connection to use the '<%= @config.app_name %>' namespace
4
- redis_config = { url: 'redis://localhost:6379', namespace: '<%= @config.app_name %>:' }
4
+ redis_config = { url: "redis://#{ENV.fetch('REDIS_SERVER')}", namespace: "<%= @config.app_name %>:#{Rails.env}:sidekiq" }
5
5
 
6
6
  Sidekiq.configure_server do |config|
7
7
  config.redis = redis_config
@@ -19,6 +19,8 @@ server {
19
19
  proxy_set_header Host $http_host;
20
20
  proxy_redirect off;
21
21
  proxy_pass http://<%= @config.app_name %>;
22
+
23
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
22
24
  }
23
25
 
24
26
  client_max_body_size 100m;
@@ -33,6 +35,7 @@ server {
33
35
  if ($request_filename ~* ^.*?\.(eot)|(ttf)|(woff)|(svg)|(otf)$){
34
36
  add_header Access-Control-Allow-Origin *;
35
37
  }
38
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
36
39
  break;
37
40
  }
38
41
 
@@ -41,6 +44,7 @@ server {
41
44
  gzip_static on; # to serve pre-gzipped version
42
45
  expires max;
43
46
  add_header Cache-Control public;
47
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
44
48
  }
45
49
 
46
50
  # Let's Encrypt certificates
@@ -1,4 +1,4 @@
1
- require 'test_helper'
1
+ require 'webtest_helper'
2
2
 
3
3
  class HomepageTest < WebTest
4
4
  test 'homepage' do
@@ -17,50 +17,3 @@ class UnitTest < ActiveSupport::TestCase
17
17
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
18
18
  fixtures :all
19
19
  end
20
-
21
- # configure webtests with capybara and poltergeist (headless)
22
- require 'capybara/rails'
23
- require 'capybara_minitest_spec'
24
- require 'capybara/poltergeist'
25
-
26
- CAPYBARA_WINDOW_SIZE = [1024, 768]
27
-
28
- if ENV['HEADLESS'] == 'true'
29
- # headless driver configuration
30
- Capybara.register_driver :poltergeist do |app|
31
- poltergeist_options = { debug: false, timeout: 30, js_errors: true, window_size: CAPYBARA_WINDOW_SIZE }
32
- Capybara::Poltergeist::Driver.new(app, poltergeist_options)
33
- end
34
- Capybara.default_driver = :poltergeist
35
- else
36
- # chrome browser driver configuration
37
- Capybara.register_driver :selenium do |app|
38
- Capybara::Selenium::Driver.new(app, :browser => :chrome)
39
- end
40
- Capybara.default_driver = :selenium
41
- Capybara.current_session.driver.browser.manage.window.resize_to CAPYBARA_WINDOW_SIZE[0], CAPYBARA_WINDOW_SIZE[1]
42
- end
43
- Capybara.default_max_wait_time = 5 # how long should capybara wait for elements to appear on the page (ajax)
44
-
45
- # use database_cleaner to clean the database after every test with truncation, instead of using transactional fixtures
46
- require 'database_cleaner'
47
- DatabaseCleaner.strategy = :truncation
48
-
49
- # default test class for webtests
50
- class WebTest < ActionDispatch::IntegrationTest
51
- include Capybara::DSL
52
- extend Minitest::Spec::DSL
53
- include Minitest::Reporters::Screenshot
54
-
55
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
56
- fixtures :all
57
-
58
- # disable transactional fixtures, as we use DatabaseCleaner
59
- self.use_transactional_fixtures = false
60
-
61
- # clean database after each test with database_cleaner
62
- def after_teardown
63
- super
64
- DatabaseCleaner.clean
65
- end
66
- end
@@ -0,0 +1,60 @@
1
+ require 'simplecov' if ENV['COVERAGE'] == 'true'
2
+
3
+ # default rails test configuration
4
+ ENV['RAILS_ENV'] ||= 'test'
5
+ require File.expand_path('../../config/environment', __FILE__)
6
+ require 'rails/test_help'
7
+
8
+ # use minitest-reporters to create xmls for jenkins and nicer terminal reporting
9
+ require 'minitest/reporters'
10
+ require 'minitest/reporters/screenshot_reporter'
11
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new,
12
+ Minitest::Reporters::JUnitReporter.new,
13
+ Minitest::Reporters::ScreenshotReporter.new]
14
+
15
+ # configure webtests with capybara and poltergeist (headless)
16
+ require 'capybara/rails'
17
+ require 'capybara_minitest_spec'
18
+ require 'capybara/poltergeist'
19
+
20
+ CAPYBARA_WINDOW_SIZE = [1024, 768]
21
+
22
+ if ENV['HEADLESS'] == 'true'
23
+ # headless driver configuration
24
+ Capybara.register_driver :poltergeist do |app|
25
+ poltergeist_options = { debug: false, timeout: 30, js_errors: true, window_size: CAPYBARA_WINDOW_SIZE }
26
+ Capybara::Poltergeist::Driver.new(app, poltergeist_options)
27
+ end
28
+ Capybara.default_driver = :poltergeist
29
+ else
30
+ # chrome browser driver configuration
31
+ Capybara.register_driver :selenium do |app|
32
+ Capybara::Selenium::Driver.new(app, :browser => :chrome)
33
+ end
34
+ Capybara.default_driver = :selenium
35
+ Capybara.current_session.driver.browser.manage.window.resize_to CAPYBARA_WINDOW_SIZE[0], CAPYBARA_WINDOW_SIZE[1]
36
+ end
37
+ Capybara.default_max_wait_time = 5 # how long should capybara wait for elements to appear on the page (ajax)
38
+
39
+ # use database_cleaner to clean the database after every test with truncation, instead of using transactional fixtures
40
+ require 'database_cleaner'
41
+ DatabaseCleaner.strategy = :truncation
42
+
43
+ # default test class for webtests
44
+ class WebTest < ActionDispatch::IntegrationTest
45
+ include Capybara::DSL
46
+ extend Minitest::Spec::DSL
47
+ include Minitest::Reporters::Screenshot
48
+
49
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
50
+ fixtures :all
51
+
52
+ # disable transactional fixtures, as we use DatabaseCleaner
53
+ self.use_transactional_fixtures = false
54
+
55
+ # clean database after each test with database_cleaner
56
+ def after_teardown
57
+ super
58
+ DatabaseCleaner.clean
59
+ end
60
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.13
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Jancev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-09 00:00:00.000000000 Z
11
+ date: 2016-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -219,6 +219,7 @@ files:
219
219
  - templates/rails_app/config/initializers/inflections.rb
220
220
  - templates/rails_app/config/initializers/log_formatting.rb
221
221
  - templates/rails_app/config/initializers/mime_types.rb
222
+ - templates/rails_app/config/initializers/redis.rb.tt
222
223
  - templates/rails_app/config/initializers/session_store.rb.tt
223
224
  - templates/rails_app/config/initializers/sidekiq.rb.tt
224
225
  - templates/rails_app/config/initializers/wrap_parameters.rb
@@ -252,6 +253,7 @@ files:
252
253
  - templates/rails_app/test/mailers/.keep
253
254
  - templates/rails_app/test/models/.keep
254
255
  - templates/rails_app/test/test_helper.rb
256
+ - templates/rails_app/test/webtest_helper.rb
255
257
  - templates/rails_app/vendor/assets/javascripts/.keep
256
258
  - templates/rails_app/vendor/assets/stylesheets/.keep
257
259
  homepage: https://github.com/igorj/railman