Sha256: 10cff192689b80cc6deeb390ff204dec9aa3ad5ba22bc25e717f70872375eafe

Contents?: true

Size: 366 Bytes

Versions: 4

Compression:

Stored size: 366 Bytes

Contents

# frozen_string_literal: true
class Twelvefactor::Environment::Cache::File
  def self.apply app, cache_url
    config = app.config
    config.cache_store = :file_store, cache_url.path, options(cache_url.query)
  end

  def self.options query
    return {} unless query

    CGI
      .parse(query)
      .map { |k, val| [k.to_sym, val.first] }
      .to_h
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
twelvefactor-cache-1.0.3 lib/twelvefactor/environment/cache/file.rb
twelvefactor-cache-1.0.2 lib/twelvefactor/environment/cache/file.rb
twelvefactor-cache-1.0.1 lib/twelvefactor/environment/cache/file.rb
twelvefactor-cache-1.0.0 lib/twelvefactor/environment/cache/file.rb