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.to_s

Instance Attribute Summary

Attributes inherited from CommandLine

#args, #error, #output, #status

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



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

def cache_dir
  @@cache_dir
end

.cache_dir=(dir) ⇒ Object



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

def cache_dir= dir
  @@cache_dir = dir
end

Instance Method Details

#cache_dirObject



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

def cache_dir
  @@cache_dir
end

#cache_fileObject



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

def cache_file
  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