Method: Rabal::FileTree#action

Defined in:
lib/rabal/file_tree.rb

#actionObject

Open up the file and write the contents. It is assumed that the present working directory is the location for the file to be created.



83
84
85
86
87
88
89
90
91
92
# File 'lib/rabal/file_tree.rb', line 83

def action
    if not File.file?(file_name) then
        info("creating #{file_name}")
        File.open(file_name,"w+") do |f|
            f.write(file_contents)
        end
    else
        debug("skipping #{file_name} - already exists")
    end
end