Class: FsTemplate::FromCommand
- Inherits:
-
Object
- Object
- FsTemplate::FromCommand
- Includes:
- FromHash
- Defined in:
- lib/fs_template/from_command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/fs_template/from_command.rb', line 4 def command @command end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/fs_template/from_command.rb', line 4 def path @path end |
Instance Method Details
#with_tmp_dir ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/fs_template/from_command.rb', line 6 def with_tmp_dir dir = "/tmp/#{rand(1000000000000000000)}" `mkdir #{dir}` Dir.chdir(dir) do yield dir end ensure ec "rm -rf #{dir}", :silent => true end |