Class: Helpers::NewFile
- Inherits:
-
Object
- Object
- Helpers::NewFile
- Defined in:
- lib/spior/helpers.rb
Overview
Class Newfile Create a file and move at the dest
Example
string = “nameserver 127.0.0.1” name = “resolv.conf” dest = “/etc” new_file = Helpers::Newfile.new(string, name, dest) new_file.add
Direct Known Subclasses
Instance Method Summary collapse
-
#add ⇒ Object
Method #add Add the file at @dest.
-
#initialize(string, name, dest = '/tmp') ⇒ NewFile
constructor
Method #new === Parameters * string = string for the whole file * name = name of the file (e.g: resolv.conf) * dest = path (e.g: /etc).
- #perm(user, perm) ⇒ Object
Constructor Details
#initialize(string, name, dest = '/tmp') ⇒ NewFile
Method #new
Parameters
-
string = string for the whole file
-
name = name of the file (e.g: resolv.conf)
-
dest = path (e.g: /etc)
69 70 71 72 73 |
# File 'lib/spior/helpers.rb', line 69 def initialize(string, name, dest = '/tmp') @string = string @name = name @dest = "#{dest}/#{@name}" end |