Class: CmdLine::CachingCommandLine
- Inherits:
-
CommandLine
- Object
- CommandLine
- CmdLine::CachingCommandLine
- Defined in:
- lib/cmdline/caching.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from CommandLine
#args, #error, #output, #status
Instance Method Summary collapse
-
#cache_dir ⇒ Object
caches its input and values.
- #cache_file ⇒ Object
- #execute ⇒ Object
Methods inherited from CommandLine
Constructor Details
This class inherits a constructor from CmdLine::CommandLine
Instance Method Details
#cache_dir ⇒ Object
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)..to_s @cache_dir end |
#cache_file ⇒ Object
16 17 18 |
# File 'lib/cmdline/caching.rb', line 16 def cache_file CacheFile.new cache_dir, @args end |
#execute ⇒ Object
20 21 22 23 |
# File 'lib/cmdline/caching.rb', line 20 def execute cachefile = cache_file @output = cachefile.readlines end |