Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6644

adding directory location to my file output script

Newsgroups comp.lang.ruby
Date 2012-10-10 13:04 -0700
Message-ID <f5075c06-b7f2-4cd3-a40c-906547bdc120@googlegroups.com> (permalink)
Subject adding directory location to my file output script
From crossanpdx@gmail.com

Show all headers | View raw


Below is my script which create me a html file called pickle.html and then when ran again, it checks if exists and if so appends to the file and creates new one. 

I need to tell the script where I want to the html file to go to.

I run this from the working directory and in the same directory is a folder called 'logs' so I would like all the pickle.html files to go to logs. 

Suggestions? and Thank you much in advance!


require 'date'

file, new_file = 'pickle.html', DateTime.now.strftime('%s')

if File.exists?('file')
  File.rename('file', "pickle_#{new_file}.html")
end

command = %Q(cucumber --format 'Timestamped::HtmlFormatter' --out #{file})

exec command

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

adding directory location to my file output script crossanpdx@gmail.com - 2012-10-10 13:04 -0700
  Re: adding directory location to my file output script Charles Calvert <cbciv@yahoo.com> - 2012-10-10 21:41 -0400
    Re: adding directory location to my file output script Ryan Crossan <crossanpdx@gmail.com> - 2012-10-11 06:32 -0700

csiph-web