producer-rails 0.2.1 → 0.4.0

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: c3d5fcbe9b3be613c7f2920d17f2615181b84f69
4
- data.tar.gz: 5ffa8ba35a20987ae7e525d5548c53e779191096
3
+ metadata.gz: b247e0396c29dea40ab091053af4fde785781b98
4
+ data.tar.gz: 1e9c4ddef9e202d3001acfc9c41e2a25d218f73d
5
5
  SHA512:
6
- metadata.gz: 32c9700fec0967891df08474f3cbfd248109128745ef6e052215c6fec86a7963a8aa6ab5a22eb91dd5edb94a8077ae83494266e1c145accdfaf89dc7848cac74
7
- data.tar.gz: cbddfc4e9fff13b02830de1fe5d1a036c7ffc9e24dc167f446f204347e4564cdc3db9335ffaff2d582781f0d9c5c9f1c4e17c863737f2af5cfaaab6e3e931428
6
+ metadata.gz: 3408bf4ebdf1d36e2ed35c4115f5603b3c891d95c22f0e575cad4029aa17dc9de9861933931cb4e7bb3d4e43f2ac199d7edf421a74db2616f5c0f997d36b9999
7
+ data.tar.gz: c18b44c2b461bf8cf5352935194a149d0ae3f03d5f509874fa79467bec579a798b0b101f1e66b7db5e5de23000fd9def765432f5d5b7923cced03f8c971aff8a
data/README.md CHANGED
@@ -2,7 +2,6 @@ producer-rails
2
2
  ==============
3
3
 
4
4
  [![Version ][badge-version-img]][badge-version-uri]
5
- [![Build status ][badge-build-img]][badge-build-uri]
6
5
 
7
6
 
8
7
  Ruby on Rails specific macros and tests for [producer][].
@@ -43,5 +42,3 @@ $ producer config/deploy.rb -t host.example -- restart
43
42
  [producer]: https://github.com/tjouan/producer-core
44
43
  [badge-version-img]: https://img.shields.io/gem/v/producer-rails.svg?style=flat-square
45
44
  [badge-version-uri]: https://rubygems.org/gems/producer-rails
46
- [badge-build-img]: https://img.shields.io/travis/tjouan/producer-rails/master.svg?style=flat-square
47
- [badge-build-uri]: https://travis-ci.org/tjouan/producer-rails
@@ -25,14 +25,10 @@ module Producer
25
25
  end
26
26
 
27
27
  define_macro :deploy do |path = get(:app_path)|
28
+ next unless recipe_argv && recipe_argv.any?
28
29
  _deploy_registry_setup
29
-
30
- case recipe_argv[0]
31
- when 'init' then deploy_init
32
- when 'update' then deploy_update
33
- when 'start' then deploy_start
34
- when 'stop' then deploy_stop
35
- when 'restart' then deploy_restart
30
+ recipe_argv.each do |arg|
31
+ send :"deploy_#{arg}"
36
32
  end
37
33
  end
38
34
 
@@ -159,9 +155,21 @@ production:
159
155
  file_write_once www_config_path, <<-eoh
160
156
  worker_processes #{get :www_workers, WWW_WORKERS}
161
157
  timeout #{get :www_timeout, WWW_TIMEOUT}
162
- preload_app false
158
+ preload_app true
163
159
  pid '#{get :www_pid_path, WWW_PID_PATH}'
164
160
  listen "\#{ENV['HOME']}/#{path}/#{get(:www_sock_path, WWW_SOCK_PATH)}"
161
+
162
+ before_fork do |server, worker|
163
+ if defined? ActiveRecord::Base
164
+ ActiveRecord::Base.connection.disconnect!
165
+ end
166
+ end
167
+
168
+ after_fork do |server, worker|
169
+ if defined? ActiveRecord::Base
170
+ ActiveRecord::Base.establish_connection
171
+ end
172
+ end
165
173
  eoh
166
174
  end
167
175
 
@@ -170,6 +178,7 @@ listen "\#{ENV['HOME']}/#{path}/#{get(:www_sock_path, WWW_SOCK_PATH)}
170
178
  sh "cd #{path} && chmod 711 public public/assets"
171
179
  sh "cd #{path} && find public/assets -type d -exec chmod 711 {} \\;"
172
180
  sh "cd #{path} && find public/assets -type f -exec chmod 644 {} \\;"
181
+ sh "cd #{path} && chmod 644 public/*.*"
173
182
  end
174
183
 
175
184
  define_macro :app_start do |path, processes|
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Rails
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.4.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: producer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2017-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: producer-core
@@ -44,14 +44,20 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.6'
47
+ version: '0.8'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '0.9'
48
51
  type: :development
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
- version: '0.6'
57
+ version: '0.8'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '0.9'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: cucumber
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +86,20 @@ dependencies:
80
86
  - - "~>"
81
87
  - !ruby/object:Gem::Version
82
88
  version: '1.1'
89
+ - !ruby/object:Gem::Dependency
90
+ name: pg
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.18'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.18'
83
103
  - !ruby/object:Gem::Dependency
84
104
  name: rake
85
105
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
158
  version: '0'
139
159
  requirements: []
140
160
  rubyforge_project:
141
- rubygems_version: 2.4.5
161
+ rubygems_version: 2.6.14
142
162
  signing_key:
143
163
  specification_version: 4
144
164
  summary: producer rails addon