Sha256: 7e815f4437d67efe5985819425ba8a4fd7554e07eb1d0e5ff6d37eb5186d27a6

Contents?: true

Size: 639 Bytes

Versions: 11

Compression:

Stored size: 639 Bytes

Contents

# -*- coding: utf-8 -*-

# assetsのキャッシュを削除する
#
# ただし、このメソッドを呼び出した後で page.driver.restart を実行しなけ
# ればブラウザ側のキャッシュが有効になったままとなる。
def expire_assets_cache
  env = Rails.application.assets
  if Rails.application.config.cache_classes
    env.instance_variable_set('@assets', {})
    env.instance_variable_set('@digests', {})
    env = env.instance_variable_get('@environment')
  end
  env.send(:expire_index!)
  Dir.glob(Rails.root.join('tmp/cache/assets/test/sprockets/*')) { |f|
    FileUtils.remove_entry_secure(f)
  }
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
smalruby-editor-0.0.12-x86-mingw32 spec/support/assets.rb
smalruby-editor-0.0.12 spec/support/assets.rb
smalruby-editor-0.0.11-x86-mingw32 spec/support/assets.rb
smalruby-editor-0.0.11 spec/support/assets.rb
smalruby-editor-0.0.10-x86-mingw32 spec/support/assets.rb
smalruby-editor-0.0.10 spec/support/assets.rb
smalruby-editor-0.0.9-x86-mingw32 spec/support/assets.rb
smalruby-editor-0.0.9 spec/support/assets.rb
smalruby-editor-0.0.8 spec/support/assets.rb
smalruby-editor-0.0.8-x86-mingw32 spec/support/assets.rb
smalruby-editor-0.0.7 spec/support/assets.rb