Class: System::CachingCommandLine

Inherits:
CommandLine show all
Defined in:
lib/system/command/caching.rb

Direct Known Subclasses

SVNx::CachingCommandLine

Constant Summary collapse

@@cache_dir =

caches its input and values.

'/tmp' + Pathname.new($0).expand_path

Instance Attribute Summary

Attributes inherited from CommandLine

#output

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandLine

#<<, #initialize, #to_command

Constructor Details

This class inherits a constructor from System::CommandLine

Class Method Details

.cache_dirObject



13
14
15
# File 'lib/system/command/caching.rb', line 13

def cache_dir
  @@cache_dir
end

.cache_dir=(dir) ⇒ Object



17
18
19
# File 'lib/system/command/caching.rb', line 17

def cache_dir= dir
  @@cache_dir = dir
end

Instance Method Details

#cache_dirObject



22
23
24
# File 'lib/system/command/caching.rb', line 22

def cache_dir
  @@cache_dir
end

#cache_fileObject



26
27
28
29
# File 'lib/system/command/caching.rb', line 26

def cache_file
  pwd = Pathname.pwd.split_path.join('')
  CacheFile.new cache_dir, @args
end

#executeObject



31
32
33
34
# File 'lib/system/command/caching.rb', line 31

def execute
  cachefile = cache_file
  @output = cachefile.readlines
end