Sha256: 824741c1ecfe5b8dc236d096bad9eab8dffde373bee5d799a0041f39ba116342

Contents?: true

Size: 836 Bytes

Versions: 3

Compression:

Stored size: 836 Bytes

Contents

class AppcacheManifestGenerator < Rails::Generators::NamedBase
  def create_appcache_manifest
    create_file "app/views/rails_appcache/manifests/#{file_name}.appcache.erb", <<-FILE 
CACHE MANIFEST

# auto-expire appcache in dev
# <%= appcache_version_string %>

CACHE:
# by default, only the root path is cached
/

# Cache additional paths by using path helpers:
# <%= posts_path %>

# Cache our JS/CSS bundles
<%= stylesheet_cache_path '#{file_name}' %>
<%= javascript_cache_path '#{file_name}' %>

# Cache additional assets by using the asset_cache_path, or any of the Rails built-in asset pipeline helpers
# <%= asset_cache_path 'logo.png' %>
# or
# <%= asset_path 'logo.png' %>

# Make everything else accessible
# WITHOUT THIS LINE, your browser will 404 for anything not explicitly listed under CACHE:
NETWORK:
*
FILE
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_appcache-0.0.5 lib/generators/appcache_manifest_generator.rb
rails_appcache-0.0.4 lib/generators/appcache_manifest_generator.rb
rails_appcache-0.0.2 lib/generators/appcache_manifest_generator.rb