Sha256: 3741b08e9150f8f736d53870a6f02b1e6cd9e4f6871f3ab12dee637e2585018f

Contents?: true

Size: 1003 Bytes

Versions: 27

Compression:

Stored size: 1003 Bytes

Contents

=begin
 FileCache scans and stores the ui path for javascript files and 
 (css/html/image) theme files compiled as the result of the client
 SDK's build_client.rb
=end
class ClientPkgCache
  
  attr_reader :scan_time, :js_cache, :theme_cache, :gz_cache, :client_rev, :last_modified
  
  # A lock flag for preventing different threads from
  # scanning simultaneously in debug mode
  @busy_scanning = false
  
  # Initially, scan.
  def initialize
    @client_rev = 0
    # scan_dirs
  end
  
  # Helper method to return the suffix of a file
  def suffix(file_path)
    return '.'+file_path.split('.')[-1]
  end
  
  # Helper method to return the time formatted according to the HTTP RFC
  def httime(time)
    return time.gmtime.strftime('%a, %d %b %Y %H:%M:%S %Z')
  end
  
  def set_cache( js, gz, themes )
    @js_cache    = js
    @gz_cache    = gz
    @theme_cache = themes
    time_now = Time.now
    @client_rev  = time_now.to_i.to_s( 36 )
    @last_modified = httime( time_now )
  end
  
end


Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
rsence-pre-3.0.0.16 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.15 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.14 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.12 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.11 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.10 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.9 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.8 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.7 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.6 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.5 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.4 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.3 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.2 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.1 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-3.0.0.0 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-2.3.0.26 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-2.3.0.25 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-2.3.0.24 plugins/client_pkg/lib/client_pkg_cache.rb
rsence-pre-2.3.0.23 plugins/client_pkg/lib/client_pkg_cache.rb