lib/texico/template/file.rb
# Copy Template
#
# Returns a status object unless the operation was successful, in which
# case nil is returned.
Copy Template
Returns a status object unless the operation was successful, in which
case nil is returned.
Copy Template Returns a status object unless the operation was successful in which case nil is returned .
def copy_template(src, dest, params, noop: nil, verbose: nil)
        file_body =
          ::File.open src, 'rb' do |file|
            ERB.new(file.read, 0).result_with_hash params
          end
        return if noop
        ::File.open(dest, 'wb') { |file| file.write file_body }
        nil
      rescue NameError => e
        FileStatus.new self, e
      end
def copy_template ( src , dest , params , noop : nil , verbose : nil ) file_body = :: File . open src , 'rb' do | file | ERB . new ( file . read , 0 ) . result_with_hash params end return if noop :: File . open ( dest , 'wb' ) { | file | file . write file_body } nil rescue NameError => e FileStatus . new self , e end
Copy Template
Returns a status object unless the operation was successful, in which
case nil is returned.
Copy Template Returns a status object unless the operation was successful in which case nil is returned .
src
<not_specific>
dest
<not_specific>
params
<not_specific>
noop
<not_specific>
verbose
<not_specific>