From 94df11a761980746f49e8bdf2461c6f62fbef267 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 28 Sep 2011 13:15:01 -0400 Subject: [PATCH] initial very early release --- guard-lacquer.gemspec | 6 ++--- images/varnish.png | Bin 0 -> 14131 bytes lib/guard-lacquer.rb | 2 -- lib/guard/lacquer.rb | 41 +++++++++++++++++++++++++--------- lib/guard/lacquer/varnishd.rb | 25 +++++++++++++++++++++ spec/spec_helper.rb | 2 +- 6 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 images/varnish.png delete mode 100644 lib/guard-lacquer.rb create mode 100644 lib/guard/lacquer/varnishd.rb diff --git a/guard-lacquer.gemspec b/guard-lacquer.gemspec index 9633001..30d75e8 100644 --- a/guard-lacquer.gemspec +++ b/guard-lacquer.gemspec @@ -7,8 +7,8 @@ Gem::Specification.new do |s| s.authors = ["John Bintz"] s.email = ["john@coswellproductions.com"] s.homepage = "" - s.summary = %q{TODO: Write a gem summary} - s.description = %q{TODO: Write a gem description} + s.summary = %q{Guard to run Varnish using Lacquer} + s.description = %q{Guard to run Varnish using Lacquer} s.rubyforge_project = "guard-lacquer" @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] - s.add_runtime_dependency 'lacquer' + s.add_runtime_dependency 'lacquer', '>= 0.5.0.beta' s.add_runtime_dependency 'guard' s.add_development_dependency 'rspec', '~> 2.6.0' diff --git a/images/varnish.png b/images/varnish.png new file mode 100644 index 0000000000000000000000000000000000000000..22d58b94936b236c9b773f3131bdee6d8eb23894 GIT binary patch literal 14131 zcmV-3H_XV1P)EX>4Tx0C?J+Q+HUC_ZB|i_hk=OLfG)Jmu!ImA|tE_$Pihg5Rw34gb)%y#f69p zRumNxoJdu~g4GI0orvO~D7a@qiilc^Ra`jkAKa(4eR}Wh?fcjJyyu+f{LXpL4}cL8 zCXwc%Y5+M>g*-agACFH+#L2yY0u@N$1RxOR%fe>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Gv1v#rWKne~=!HG8aY+YqjBAe*-$II#*;_8i+%(i->};jK%~q*L1g&DW8HJ`fc^baub0 zO{+yupSgJFP(^KS_uSe9*qBMB(ttPCFI2~BW)mjgD_ z{dRcks+_U?L#s2lwxVOq8#sI=6~HwwjN9MYKjnTVs>53WN#lidXK?U8U5Dcz*%+ct z2Hw{E(la*j^l^&o203~xt_4Vcn#>s#^92kJpzQL*z}T|Hdf;EIOlGbo6;E?&`=^{c zUOM62$2c-^B8J3#UweN|JRbSP<#4;w%JVBiR&}c_V-REvU}F!%s*d2Y8~*2AQv|Qg zw&p{K0|#0FiFp08%VD$l-!>^K*DX)ob!h?z*I5Mz08Cfe`j;o1Z;cha4@QXz(!$N? zu2J%M%br1wS~61BXr8e)$FQj<2oQ$>KOZN}qWuxqi&8RmplC%oby!mgjapl8ZMX6C zHOo_9h;xabGjRCrz?5^x&Qs3UN-kg8DnKH^BkU-;?cH0N0;c5p>#=~fIgU;PD0#qZ zvjlmky{U(BVxkqxg#(y%cw{uU(<0+n52e1kd5QJleD~vmmEUt2&%S!f`O2P2=Sw_h z)%gbGP%bSyS!foy($FN$QWcW6m~G{`Q-Xu^Rd-k&6#LttDO^Yi0wqlyL!CnT|ZG`TThj}_sF70 zb)!`Q97!J_V-T36{SHjj$-KR5@FsvOeQEmAK$h-U)nz=pBGmvWXC1bt "127.0.0.1:#{options[:port]}", - :storage => "file,tmp/cache/varnish.store,32M", - :backend => options[:backend], - :sbin_path => File.split(`which varnishd`).first, + @options = { + :port => 3001, + :backend => '127.0.0.1:3000', + :storage => 'file,tmp/cache/varnish.store,32M', + :sbin_path => File.split(`which varnishd`.strip).first, :pid_file => 'tmp/pids/varnish.pid' - ) + }.merge(options) + + @backend = Varnishd.new(@options) + + if !File.file?(varnish_erb = 'config/varnish.vcl.erb') + UI.info "No config/varnish.vcl.erb found, copying default from Lacquer..." + + FileUtils.mkdir_p File.split(varnish_erb).first + FileUtils.cp Gem.find_files('generators/lacquer/templates/varnish.vcl.erb').first, varnish_erb + end end def start + @backend.stop if @backend.running? @backend.start + + notify "Varnish started on port #{@options[:port]}, with backend #{@options[:backend]}." end def stop - @backend.start stop + @backend.stop + + notify("Until next time...", :title => 'guard-varnish') end def reload @@ -45,6 +59,11 @@ module Guard def run_on_deletion(paths) restart end + + private + def notify(message) + Notifier.notify(message, :title => 'guard-lacquer', :image => File.expand_path("../../../images/varnish.png", __FILE__)) + end end end diff --git a/lib/guard/lacquer/varnishd.rb b/lib/guard/lacquer/varnishd.rb new file mode 100644 index 0000000..c79776c --- /dev/null +++ b/lib/guard/lacquer/varnishd.rb @@ -0,0 +1,25 @@ +require 'lacquer' +require 'lacquer/varnishd' + +class Guard::Lacquer::Varnishd < ::Lacquer::Varnishd + attr_accessor :pid_file + + def self.root_path + Pathname.new(Dir.pwd) + end + + def self.env + ENV['RAILS_ENV'] || 'development' + end + + def initialize(options) + if options[:backend].split(':').first.empty? + options[:backend] = "127.0.0.1#{options[:backend]}" + end + self.pid_file = self.class.root_path.join(options[:pid_file]) + options[:listen] = "127.0.0.1:#{options[:port]}" + + super(Hash[options.collect { |k, v| [ k.to_s, v ] }]) + end +end + diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index df6bb5e..66ccdc4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -require 'guard-lacquer' +require 'guard/lacquer' RSpec.configure do |c| c.mock_with :mocha