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