Class: ClientPkgCache
- Inherits:
-
Object
- Object
- ClientPkgCache
- Defined in:
- plugins/client_pkg/lib/client_pkg_cache.rb
Overview
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
Instance Attribute Summary collapse
-
#client_rev ⇒ Object
readonly
Returns the value of attribute client_rev.
-
#gz_cache ⇒ Object
readonly
Returns the value of attribute gz_cache.
-
#js_cache ⇒ Object
readonly
Returns the value of attribute js_cache.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#scan_time ⇒ Object
readonly
Returns the value of attribute scan_time.
-
#theme_cache ⇒ Object
readonly
Returns the value of attribute theme_cache.
Instance Method Summary collapse
-
#httime(time) ⇒ Object
Helper method to return the time formatted according to the HTTP RFC.
-
#initialize ⇒ ClientPkgCache
constructor
Initially, scan.
- #set_cache(js, gz, themes) ⇒ Object
-
#suffix(file_path) ⇒ Object
Helper method to return the suffix of a file.
Constructor Details
#initialize ⇒ ClientPkgCache
Initially, scan.
24 25 26 27 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 24 def initialize @client_rev = 0 # scan_dirs end |
Instance Attribute Details
#client_rev ⇒ Object (readonly)
Returns the value of attribute client_rev.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def client_rev @client_rev end |
#gz_cache ⇒ Object (readonly)
Returns the value of attribute gz_cache.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def gz_cache @gz_cache end |
#js_cache ⇒ Object (readonly)
Returns the value of attribute js_cache.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def js_cache @js_cache end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def last_modified @last_modified end |
#scan_time ⇒ Object (readonly)
Returns the value of attribute scan_time.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def scan_time @scan_time end |
#theme_cache ⇒ Object (readonly)
Returns the value of attribute theme_cache.
17 18 19 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 17 def theme_cache @theme_cache end |
Instance Method Details
#httime(time) ⇒ Object
Helper method to return the time formatted according to the HTTP RFC
35 36 37 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 35 def httime(time) return time.gmtime.strftime('%a, %d %b %Y %H:%M:%S %Z') end |
#set_cache(js, gz, themes) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 39 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 |
#suffix(file_path) ⇒ Object
Helper method to return the suffix of a file
30 31 32 |
# File 'plugins/client_pkg/lib/client_pkg_cache.rb', line 30 def suffix(file_path) return '.'+file_path.split('.')[-1] end |