Class: S3Website::GzipHelper
- Inherits:
-
Object
- Object
- S3Website::GzipHelper
- Defined in:
- lib/s3_website/gzip_helper.rb
Instance Method Summary collapse
- #gzip_files ⇒ Object
-
#initialize(config, site_dir) ⇒ GzipHelper
constructor
A new instance of GzipHelper.
Constructor Details
#initialize(config, site_dir) ⇒ GzipHelper
Returns a new instance of GzipHelper.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/s3_website/gzip_helper.rb', line 6 def initialize(config, site_dir) @config = config @site_dir = site_dir @extensions = if config['gzip'] config['gzip'].is_a?(Array) ? config['gzip'] : S3Website::DEFAULT_GZIP_EXTENSIONS else [] end end |
Instance Method Details
#gzip_files ⇒ Object
17 18 19 20 21 |
# File 'lib/s3_website/gzip_helper.rb', line 17 def gzip_files Dir.glob(@site_dir + '/**/{*,.*}', File::FNM_DOTMATCH).each { |file| gzip_file!(file) if File.file?(file) && gzip?(file) } end |