lacquer 0.6.6 → 0.6.7.pre.alpha

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: e706da67a272b82cee6c8da31abe6c8d9e78358c
4
- data.tar.gz: 60c69ff19d95e669f1f5201b0ae78a6e69480501
3
+ metadata.gz: 8225278545c3f3578292b862f0326c40393a07ab
4
+ data.tar.gz: 7565daf9bb067c70fff1274f7974e00df71d0617
5
5
  SHA512:
6
- metadata.gz: 1ca0ce46286b668c6617e8d1a619c56abc583ad649d4f321927e2247cf16b79c50e8be20fac4526afd5ca56d670ef0361b3832edc2d43d82e5c2b42eee08d4ca
7
- data.tar.gz: f40f3deffabd878d515c46538c6012179c386c143b5b034767c873c652abc12e1751b0c15707818af0deec3d6ed1734a6f025af2eacce6d980a993f94de7a208
6
+ metadata.gz: 859335ca9872c1951b198a27177a66dd85a0a15ef2fdfcfb2a0e57092a8567ea58b3eea567c2355120e8c6382a3ae4834fb08296da0580eb42fffa20c5b57bde
7
+ data.tar.gz: f8fc23ae649701a0d0f5b702f7e984cc01dea0517d323b548a308df9d974501f0d3c0107a35bbe315bee898cd94bbe83849499925cfe01d428921074852d5fcd
data/lib/lacquer/tasks.rb CHANGED
@@ -22,11 +22,13 @@ namespace :lacquer do
22
22
  desc "Restart varnishd daemon using Lacquer's settings"
23
23
  task :restart => :environment do
24
24
  varnishd = Lacquer::Varnishd.new
25
- if varnishd.running?
26
- varnishd.stop
27
- sleep(1)
25
+ if varnishd.config_changed?
26
+ if varnishd.running?
27
+ varnishd.stop
28
+ sleep(1)
29
+ end
30
+ varnishd.start
28
31
  end
29
- varnishd.start
30
32
  end
31
33
 
32
34
  desc "Reload VCL configuration through varnishadm with Lacquer's settings"
@@ -1,3 +1,5 @@
1
+ require 'digest/md5'
2
+
1
3
  module Lacquer
2
4
  class Varnishd
3
5
  attr_accessor :listen, :telnet, :sbin_path, :bin_path, :storage, :working_dir, :user, :backend, :params, :use_sudo, :pid_path
@@ -35,9 +37,13 @@ module Lacquer
35
37
 
36
38
  def generate_vcl
37
39
  if erb_vcl_script_filename.exist?
38
- log "#{erb_vcl_script_filename} found rendering to #{vcl_script_filename}"
39
- File.open(vcl_script_filename, "w") do |vcl|
40
- vcl.write(render_vcl)
40
+ if config_changed?
41
+ log "#{erb_vcl_script_filename} found rendering to #{vcl_script_filename}"
42
+ File.open(vcl_script_filename, "w") do |vcl|
43
+ vcl.write(render_vcl)
44
+ end
45
+ else
46
+ log "#{erb_vcl_script_filename} has not changed"
41
47
  end
42
48
  end
43
49
  end
@@ -78,6 +84,12 @@ module Lacquer
78
84
  !!pid && !!execute("ps p #{pid}").include?(pid.to_s) # works with sudo
79
85
  end
80
86
 
87
+ def config_changed?
88
+ existing_hash = Digest::MD5.hexdigest(File.read(vcl_script_filename))
89
+ new_hash = Digest::MD5.hexdigest(render_vcl)
90
+ new_hash != existing_hash
91
+ end
92
+
81
93
  def args
82
94
  options.map { |k, v| "#{k} #{v}" }.join(" ")
83
95
  end
@@ -1,3 +1,3 @@
1
1
  module Lacquer
2
- VERSION = '0.6.6'
2
+ VERSION = '0.6.7-alpha'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lacquer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7.pre.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russ Smith (russ@bashme.org)
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-06-07 00:00:00.000000000 Z
14
+ date: 2017-06-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -161,9 +161,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - ">"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 1.3.1
167
167
  requirements: []
168
168
  rubyforge_project: lacquer
169
169
  rubygems_version: 2.5.2