nswebgen 0.5.7 → 0.6.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.
@@ -28,6 +28,7 @@ class AppBuilder < Rails::AppBuilder
28
28
  template 'application.rb'
29
29
  template 'environment.rb'
30
30
  template 'memcache.yml'
31
+ template 'logrotate.conf'
31
32
  template 'deploy.rb'
32
33
  template 'unicorn.rb'
33
34
  template 'unicorn_init_customer_qa.sh'
@@ -225,6 +226,7 @@ module Nsweb
225
226
  rails_options[:skip_javascript] = true
226
227
 
227
228
  Rails::Generators::AppGenerator.new([app_path], rails_options).invoke_all
229
+ gsub_file 'public/500.html', /CUNAME/, options.cuname
228
230
  end
229
231
 
230
232
  def init_nsweb
@@ -0,0 +1,11 @@
1
+ /var/www/<%= app_name %>/shared/log/*.log {
2
+ weekly
3
+ missingok
4
+ rotate 24
5
+ compress
6
+ sharedscripts
7
+ postrotate
8
+ kill -s HUP `cat /var/www/<%= app_name %>/shared/pids/unicorn.pid`
9
+ kill -USR1 `cat /var/run/nginx.pid`
10
+ endscript
11
+ }
@@ -21,3 +21,47 @@ pid APP_PATH + "/shared/pids/unicorn.pid"
21
21
 
22
22
  stderr_path APP_PATH + "/shared/log/unicorn.stderr.log"
23
23
  stdout_path APP_PATH + "/shared/log/unicorn.stdout.log"
24
+
25
+ preload_app true
26
+
27
+ #
28
+ # This fixes the "Gemfile not found" error on seamless restarts
29
+ #
30
+ before_exec do |server|
31
+ ENV['BUNDLE_GEMFILE'] = working_directory + "/Gemfile"
32
+ end
33
+
34
+ before_fork do |server, worker|
35
+
36
+ #
37
+ # The master process has no need for a connection to the database
38
+ #
39
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!
40
+
41
+ #
42
+ # At this point, the new master is up and running, about to
43
+ # fork a new worker. Its safe to send the old master a
44
+ # QUIT signal so that it can die gracefully.
45
+ #
46
+ old_pid = "#{server.config[:pid]}.oldbin"
47
+ if File.exists?(old_pid) && server.pid != old_pid
48
+ begin
49
+ Process.kill("QUIT", File.read(old_pid).to_i)
50
+ rescue Errno::ENOENT, Errno::ESRCH
51
+ # someone else did our job for us
52
+ end
53
+ end
54
+ end
55
+
56
+ after_fork do |server, worker|
57
+
58
+ #
59
+ # Workers DO need database connections
60
+ #
61
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
62
+
63
+ #
64
+ # This gets around a Redis problem with threading
65
+ #
66
+ Nsweb.redis_store.client.reconnect
67
+ end
@@ -1,56 +1,46 @@
1
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>General Error (500)</title>
5
- <style type="text/css">
6
- body {
7
- margin: 0;
8
- padding: 2em;
9
- font-size: 80%;
10
- background-color: #e0e0e0;
11
- color: #333;
12
- font-family: verdana, helvetica, arial, sans-serif;
13
- }
14
-
15
- body {
16
- line-height: 1.2em;
17
- width: 900px;
18
- }
19
-
20
- div.dialog {
21
- border: 1px solid #a62f00;
22
- background-color: #fa7080;
23
- color: #b72e3e;
24
- margin: 1em auto 1em 0;
25
- text-align: center;
26
- width: 35em;
27
- }
2
+ <!--[if lt IE 7]> <html class="ie6"> <![endif]-->
3
+ <!--[if IE 7]> <html class="ie7"> <![endif]-->
4
+ <!--[if IE 8]> <html class="ie8"> <![endif]-->
5
+ <!--[if gt IE 8]><!--> <html> <!--<![endif]-->
6
+ <head>
7
+ <title>CUNAME</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <meta http-equiv="pragma" content="no-cache" />
10
+ <meta http-equiv="cache-control" content="no-cache" />
28
11
 
29
- div#header {
30
- border-right: 1px solid #c0c0c0;
31
- border-left: 1px solid #c0c0c0;
32
- background-color: #ffffff;
33
- background-image: url('/images/header.jpg');
34
- padding: 0;
35
- height: 120px;}
12
+ <script src="/assets/nsweb/application.js" type="text/javascript"></script>
13
+ <script src="/assets/application.js" type="text/javascript"></script>
14
+
15
+ <link href="/assets/nsweb/application.css" media="screen" rel="stylesheet" type="text/css" />
16
+ <link href="/assets/application.css" media="screen" rel="stylesheet" type="text/css" />
17
+ <link href="/assets/nsweb/print.css" media="print" rel="stylesheet" type="text/css" />
18
+ <link href="/assets/print.css" media="print" rel="stylesheet" type="text/css" />
19
+ <!--[if (IE 7) | (IE 8)]>
20
+ <link href="/assets/nsweb/ie.css" media="screen" rel="stylesheet" type="text/css" />
21
+ <link href="/assets/ie.css" media="screen" rel="stylesheet" type="text/css" />
22
+ <![endif]-->
23
+
24
+
25
+ <meta content="authenticity_token" name="csrf-param" />
36
26
 
37
- h1 {
38
- font-size: 1.6em;
39
- font-weight: bold;
40
- line-height: 1.8em;
41
- }
42
- </style>
27
+ <meta content="eEsoSD3pFB9rmjq2PEE2GwwCZJsximkpritXYwfa5vw=" name="csrf-token" />
43
28
  </head>
29
+ <body data-timeout="600">
30
+ <div id="constraint">
31
+ <div id="header">
32
+ </div>
33
+ <div id="content">
34
+ <h2>Oops!</h2>
35
+ <p>
36
+ Something went wrong while trying to process your request. We've been
37
+ notified about the problem and will get it fixed as soon as possible.
38
+
39
+ If the problem persists, please notify the Credit Union.
40
+ </p>
44
41
 
45
- <body>
46
- <div id="header">
47
- </div>
48
- <div class="dialog">
49
- <h1>An unexpected error has occurred.</h1>
50
- <p>We've been notified about this issue and we'll take a look at it shortly.</p>
51
- </div>
52
- <div>
53
- <a href="/">Return to v-Branch</a>
54
- <div>
42
+ <a href="/">Back</a>
43
+ </div>
44
+ </div>
55
45
  </body>
56
46
  </html>
@@ -3,5 +3,5 @@
3
3
  #
4
4
 
5
5
  module Nswebgen
6
- VERSION = '0.5.7' # Current Nswebgen version
6
+ VERSION = '0.6.0' # Current Nswebgen version
7
7
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nswebgen
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.7
5
+ version: 0.6.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - John C. Burr
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2012-05-22 00:00:00 Z
14
+ date: 2012-07-11 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties
@@ -68,6 +68,7 @@ files:
68
68
  - lib/nsweb/generators/nsweb/app/templates/config/database.yml
69
69
  - lib/nsweb/generators/nsweb/app/templates/config/deploy.rb
70
70
  - lib/nsweb/generators/nsweb/app/templates/config/initializers/session_store.rb.tt
71
+ - lib/nsweb/generators/nsweb/app/templates/config/logrotate.conf
71
72
  - lib/nsweb/generators/nsweb/app/templates/config/memcache.yml
72
73
  - lib/nsweb/generators/nsweb/app/templates/config/routes.rb
73
74
  - lib/nsweb/generators/nsweb/app/templates/config/unicorn.rb
@@ -95,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
96
  requirements:
96
97
  - - ">="
97
98
  - !ruby/object:Gem::Version
98
- hash: 260496689
99
+ hash: -455024287
99
100
  segments:
100
101
  - 0
101
102
  version: "0"