Class: System::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
Class Method Details
.cache_dir ⇒ Object
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_dir ⇒ Object
23
24
25
|
# File 'lib/system/command/caching.rb', line 23
def cache_dir
@@cache_dir
end
|
#cache_file ⇒ Object
27
28
29
|
# File 'lib/system/command/caching.rb', line 27
def cache_file
CacheFile.new cache_dir, @args
end
|
#execute ⇒ Object
31
32
33
34
|
# File 'lib/system/command/caching.rb', line 31
def execute
cachefile = cache_file
@output = cachefile.readlines
end
|