Class: CmdLine::CachingCommandLine

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

Direct Known Subclasses

Svnx::Base::CachingCommandLine

Instance Attribute Summary

Attributes inherited from CommandLine

#args, #error, #output, #status

Instance Method Summary collapse

Methods inherited from CommandLine

#<<, #initialize, #to_command

Constructor Details

This class inherits a constructor from CmdLine::CommandLine

Instance Method Details

#cache_dirObject

caches its input and values.



11
12
13
14
# File 'lib/cmdline/caching.rb', line 11

def cache_dir
  @cache_dir ||= '/tmp' + Pathname.new($0).expand_path.to_s
  @cache_dir
end

#cache_fileObject



16
17
18
# File 'lib/cmdline/caching.rb', line 16

def cache_file
  CacheFile.new cache_dir, @args
end

#executeObject



20
21
22
23
# File 'lib/cmdline/caching.rb', line 20

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