Permalink
Browse files

Rails 2 generators (purgeable_install)

  • Loading branch information...
1 parent 47f918a commit eae3f49d001241e66ad3ca9d081baef3933987f7 @kawamanza kawamanza committed Mar 16, 2012
Showing with 50 additions and 0 deletions.
  1. +27 −0 generators/purgeable/purgeable_install_generator.rb
  2. +23 −0 templates/install/purgeable.yml
@@ -0,0 +1,27 @@
+require 'rbconfig'
+
+class PurgeableInstallGenerator < Rails::Generator::Base
+ def manifest
+ record do |m|
+ m.file "purgeable.yml", "config/purgeable.yml"
+ end
+ end
+
+ def self.gem_root
+ File.expand_path('../../../', __FILE__)
+ end
+
+ def self.source_root
+ File.join(gem_root, 'templates', 'install')
+ end
+
+ def source_root
+ self.class.source_root
+ end
+
+ private
+
+ def banner
+ "Usage: #{$0} purgeable_install"
+ end
+end
@@ -0,0 +1,23 @@
+sample: &sample
+ http_cache:
+ - resource_hosts:
+ - "www1.example.com"
+ - "www2.example.com"
+ cache_locations:
+ - "varnish1.example.com"
+ - "varnish2.example.com"
+ - resource_hosts:
+ - "www3.example.com"
+ - "www4.example.com"
+ cache_locations:
+ - "varnish3.example.com"
+ - "varnish4.example.com"
+
+development:
+ <<: *sample
+
+test:
+ http_cache: []
+
+production:
+ http_cache: []

0 comments on commit eae3f49

Please sign in to comment.