capistrano3-unicorn-nginx 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d55dee8485c471078acbb4146442732922fe01f7
4
- data.tar.gz: 71e2d5d0f0342286caa5ac9e87d44f7772260aaa
3
+ metadata.gz: 822fb6189bd5e45ea0109dcc69f9291b89ddfb46
4
+ data.tar.gz: 41ddcf88bf99358359c904eb7983c873f20ba9b4
5
5
  SHA512:
6
- metadata.gz: 544c89dbb5260b6b7c20850e36b785e337764e41344de731d73c082d47b02be4812e94d53024aef68f8b7594e019fd0907272f3c5dd1bd8898bf2bbf0df1fa17
7
- data.tar.gz: 4b6de54167fdba5dd50fbe1ab2c023ce62fe634c9ffed4645cb0a37e97dce54f9be625b24447dce4a0a925a43b12b167d0bcfadb589f4f7ca37584189b7881c9
6
+ metadata.gz: ecbf2a903a8a372f14edad78e3b61a145831955749544573d808449c05f435715582b7ef3db9add16063ada57ff7189f902c265a5c7ab3cd5ae544cff0e18206
7
+ data.tar.gz: 6be3e727b1565c3ce8d8d06b9d6f192dd23177c2ee5c5b253fa392c36d6aeddde80e0c1b9fa08caaba29eb9250a6f953cc6b34bc21adb9e670706018b87407a0
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'capistrano3-unicorn-nginx'
7
- s.version = '0.0.1'
7
+ s.version = '0.0.2'
8
8
  s.date = '2019-02-01'
9
9
  s.summary = "Capistrano tasks for automatic and sensible unicorn configuration"
10
10
  s.description = <<-EOF.gsub(/^\s+/, '')
@@ -118,7 +118,7 @@ namespace :unicorn do
118
118
  end
119
119
 
120
120
  desc "Unicorn generate config file"
121
- task :init_config do
121
+ task :setup do
122
122
  on roles(fetch(:unicorn_roles)) do
123
123
  execute(:mkdir, '-pv', File.dirname(fetch(:unicorn_config_path))) unless file_exists?(fetch(:unicorn_config_file))
124
124
  upload! template('unicorn.rb.erb'), fetch(:unicorn_config_path)
@@ -3,6 +3,15 @@ require "erb"
3
3
  module Capistrano3
4
4
  module UnicornNginx
5
5
  module Helpers
6
+ def template template_name
7
+ StringIO.new(template_to_s(template_name))
8
+ end
9
+
10
+ def template_to_s template_name
11
+ config_file = File.join(File.dirname(__FILE__), "../../generators/capistrano/simple_unicorn/templates/#{template_name}")
12
+ ERB.new(File.read(config_file), nil, '-').result(binding)
13
+ end
14
+
6
15
  def sudo_upload!(from, to)
7
16
  filename = File.basename(to)
8
17
  to_dir = File.dirname(to)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano3-unicorn-nginx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - truongkma