o2webappizer 0.1.11 → 0.1.12

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: 02c23ef3fc19af92e7f285d73711543a87d22517
4
- data.tar.gz: d174985c6804c1abb195abf2bc3e04e70dc19492
3
+ metadata.gz: 8458a9177ac1fde2b14481d8cdb15fb586186696
4
+ data.tar.gz: 76cafc2f6c00c10ed83a7093b6fcf2e1d139aa6b
5
5
  SHA512:
6
- metadata.gz: b0a4875badbb9648858038147c76488341180f35a89758effe39cac4fee6f6bec1d2a0344b0cc4f925ccb06125ab850dc689feaeb5d820c17c3e9285a2877c80
7
- data.tar.gz: c45d79daaa1dc620883d1733ca463f5cc49f886ee8173db23a681c108f9eed8f4460d5c0e466b175002bbb269947da75373466e1d9e9d49f4b9999c9420a5540
6
+ metadata.gz: 958c9232628423cf9f00805b5dfe4c093a92ded22fb1512725d2c2847bca025d09f92eac05f6a433c1d7597e04570552b66b509998137f864c63a420185ca129
7
+ data.tar.gz: 6c1c59f94d3b2d387df5d67d358b9beb9d05226cae937e3d4d86bafb0fb8c5c49f62fd8c439c3998fa448ea529745855fe00062fcf793d688c672ac0ac637e25
@@ -155,12 +155,17 @@ module O2webappizer
155
155
  def db_directory
156
156
  template 'db/seeds.rb'
157
157
  rake 'railties:install:migrations'
158
- Dir['db/migrate/*.rb'].sort.last =~ /(\d{14})_/
159
- next_timestamp = $1.to_i + 1
160
158
  copy_file 'db/migrate/001_add_mail_interceptors_to_settings.rb',
161
159
  "db/migrate/#{next_timestamp}_add_mail_interceptors_to_settings.rb"
162
160
  end
163
161
 
162
+ def next_timestamp
163
+ return @next_timestamp + 1 if @next_timestamp
164
+
165
+ Dir['db/migrate/*.rb'].sort.last =~ /(\d{14})_/
166
+ @next_timestamp = $1.to_i + 1
167
+ end
168
+
164
169
  def duplicate_locale(locale, name = nil)
165
170
  src_name = name ? "#{name}.en.yml" : "en.yml"
166
171
  dst_name = name ? "#{name}.#{locale}.yml" : "#{locale}.yml"
@@ -1,5 +1,5 @@
1
1
  module O2webappizer
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
4
  RAILS_VERSION = "4.2"
5
5
  end
data/templates/Capfile CHANGED
@@ -12,7 +12,6 @@ require 'capistrano/rails/migrations'
12
12
  require 'capistrano/o2web_recipes'
13
13
  require 'capistrano/nginx'
14
14
  require 'capistrano/passenger'
15
- require 'capistrano/faster_assets'
16
15
  require 'whenever/capistrano'
17
16
 
18
17
  # Load custom tasks from `lib/capistrano/tasks` if you have any defined
data/templates/Gemfile.tt CHANGED
@@ -7,8 +7,8 @@ gem 'rake', '~> 10.4'
7
7
  # Use postgresql as the database for Active Record
8
8
  gem 'pg', '~> 0.15'
9
9
  # Use SCSS for stylesheets
10
- gem 'sassc-rails', github: 'Shopify/sassc-rails', branch: 'sprockets-rails-3'
11
- gem 'sprockets-derailleur', github: 'bonobos/sprockets-derailleur'
10
+ gem 'sassc-rails', github: 'sass/sassc-rails'
11
+ gem 'sprockets-derailleur', github: 'o2web/sprockets-derailleur'
12
12
  # Use Uglifier as compressor for JavaScript assets
13
13
  gem 'uglifier', '>= 1.3.0'
14
14
  # Use CoffeeScript for .coffee assets and views
@@ -35,7 +35,6 @@ group :development, :test do
35
35
  gem 'capistrano3-nginx', '~> 2.0'
36
36
  gem 'capistrano-passenger'
37
37
  gem 'capistrano-o2web-recipes', github: 'o2web/capistrano-o2web-recipes', branch: 'master'
38
- gem 'capistrano-faster-assets', '~> 1.0'
39
38
  # TODO: gem 'capistrano-maintenance', '~> 1.0'
40
39
 
41
40
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
@@ -69,6 +69,6 @@ Vagrant.configure(2) do |config|
69
69
  # sudo apt-get update
70
70
  # sudo apt-get install -y apache2
71
71
  # SHELL
72
- config.vm.hostname = "<%= app_name.dasherize %>.dev"
72
+ config.vm.hostname = "<%= app_name.gsub('_', '-') %>.dev"
73
73
  # config.vm.synced_folders
74
74
  end
@@ -17,31 +17,20 @@ set :rbenv_map_bins, %w{rake gem bundle ruby rails}
17
17
  set :passenger_restart_with_sudo, false
18
18
  set :passenger_restart_command, 'rbenv sudo passenger-config restart-app'
19
19
 
20
- # default to %W[system]
21
20
  <% if options.solidus? -%>
22
21
  set :files_public_dirs, fetch(:files_public_dirs, []).push(*%W[
23
22
  spree
24
23
  ])
25
24
  <% else -%>
26
25
  # set :files_public_dirs, fetch(:files_public_dirs, []).push(*%W[
27
- # spree
28
26
  # ])
29
27
  <% end -%>
30
- # default to []
31
28
  # set :files_private_dirs, fetch(:files_private_dirs, []).push(*%W[
32
29
  # ])
33
30
 
34
31
  # set :nginx_workers, 1
35
- # default to %W[assets system]
36
- <% if options.solidus? -%>
37
- set :nginx_assets_dirs, fetch(:nginx_assets_dirs, []).push(*%W[
38
- spree
39
- ])
40
- <% else -%>
41
32
  # set :nginx_assets_dirs, fetch(:nginx_assets_dirs, []).push(*%W[
42
- # spree
43
33
  # ])
44
- <% end -%>
45
34
  # set :nginx_max_body_size, '10m'
46
35
 
47
36
  set :pty, true
@@ -81,12 +70,4 @@ namespace :deploy do
81
70
  # end
82
71
  end
83
72
  end
84
-
85
- after :deploy, :touch_cron_log do
86
- on roles :app do
87
- within shared_path do
88
- execute :touch, 'log/cron.log'
89
- end
90
- end
91
- end
92
73
  end
@@ -11,7 +11,7 @@ set :admin_name, 'vagrant'
11
11
  # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
12
12
  # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
13
13
  # server 'db.example.com', user: 'deploy', roles: %w{db}
14
- set :server, "#{fetch(:application).dasherize}.dev"
14
+ set :server, "#{fetch(:application).gsub('_', '-')}.dev"
15
15
  server fetch(:server), user: fetch(:deployer_name), roles: %w[app web db]
16
16
 
17
17
  # role-based syntax
@@ -17,49 +17,46 @@ server {
17
17
  listen 80 default_server;
18
18
  listen [::]:80 default_server ipv6only=on;
19
19
 
20
+ server_name <%= fetch(:server) %>;
21
+ passenger_enabled on;
22
+ rails_env <%= fetch(:stage) %>;
23
+ root <%= fetch(:deploy_to) %>/current/public;
24
+
25
+ <% if fetch(:stage) == :production %>
20
26
  # SSL configuration
21
27
  #
22
28
  # listen 443 ssl default_server;
23
29
  # listen [::]:443 ssl default_server;
24
30
  #
31
+ # ssl_certificate /etc/ssl/certs/$server_name.chained.crt;
32
+ # ssl_certificate_key /etc/ssl/private/$server_name.key;
33
+ #
25
34
  # Self signed certs generated by the ssl-cert package
26
35
  # Don't use them in a production server!
27
36
  #
28
37
  # include snippets/snakeoil.conf;
29
-
30
- server_name <%= fetch(:server) %>;
31
- passenger_enabled on;
32
- rails_env <%= fetch(:stage) %>;
33
- root <%= fetch(:deploy_to) %>/current/public;
34
-
35
- <% if fetch(:stage) == :production %>
36
- # listen 443 ssl;
37
- # ssl_certificate /etc/ssl/certs/<%= fetch(:server) %>.chained.crt;
38
- # ssl_certificate_key /etc/ssl/private/<%= fetch(:server) %>.key;
39
38
  <% end %>
40
39
 
41
40
  client_max_body_size <%= fetch(:nginx_max_body_size) %>;
42
41
 
43
- error_page 500 502 503 504 /50x.html;
44
- location = /50x.html {
45
- root html;
46
- }
42
+ error_page 404 /404.html;
43
+ error_page 422 /422.html;
44
+ error_page 500 502 503 504 /500.html;
47
45
 
48
- # TODO: it doesn't work
49
- # location ~ ^/(<%= fetch(:nginx_assets_dirs).join('|') %>)/ {
50
- # root <%= fetch(:deploy_to) %>/current/public;
51
- # gzip_static on;
52
- # expires max;
53
- # add_header Cache-Control public;
54
- # break;
55
- # }
56
- }
57
-
58
- server {
59
- listen 80;
46
+ if ($host = www.$server_name) {
47
+ return 301 $scheme://$server_name$request_uri;
48
+ }
60
49
 
61
- server_name www.<%= fetch(:server) %>;
62
- return 301 $scheme://<%= fetch(:server) %>$request_uri;
50
+ <% fetch(:nginx_assets_dirs).each do |dir| %>
51
+ location /<%= dir %>/ {
52
+ gzip_static on;
53
+ expires 1M;
54
+ add_header Cache-Control public;
55
+ add_header Last-Modified "";
56
+ add_header ETag "";
57
+ break;
58
+ }
59
+ <% end %>
63
60
  }
64
61
 
65
62
  # Virtual Host configuration for example.com
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: o2webappizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrice Lebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-19 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -207,3 +207,4 @@ signing_key:
207
207
  specification_version: 4
208
208
  summary: Project Boilerplate Builder used by O2Web
209
209
  test_files: []
210
+ has_rdoc: