Sha256: f20b0e61d8151d7745d8fa01310388252425796f8e450a17666f58e9faca51fd

Contents?: true

Size: 1.21 KB

Versions: 7

Compression:

Stored size: 1.21 KB

Contents

##   Riassence Framework
 #   Copyright 2007 Riassence Inc.
 #   http://riassence.com/
 #
 #   You should have received a copy of the GNU General Public License along
 #   with this software package. If not, contact licensing@riassence.com
 ##


=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
    @last_modified = httime( time_now )
  end
  
end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rsence-2.0.0.5.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.4.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.3.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.2.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.1.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.0.pre plugins/client_pkg/lib/client_pkg_cache.rb
rsence-2.0.0.pre plugins/client_pkg/lib/client_pkg_cache.rb