Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
adding directory location to my file output script
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
crossan...@gmail.com  
View profile  
 More options Oct 10 2012, 4:04 pm
Newsgroups: comp.lang.ruby
From: crossan...@gmail.com
Date: Wed, 10 Oct 2012 13:04:35 -0700 (PDT)
Local: Wed, Oct 10 2012 4:04 pm
Subject: adding directory location to my file output script
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Calvert  
View profile  
 More options Oct 10 2012, 9:41 pm
Newsgroups: comp.lang.ruby
From: Charles Calvert <cb...@yahoo.com>
Date: Wed, 10 Oct 2012 21:41:32 -0400
Local: Wed, Oct 10 2012 9:41 pm
Subject: Re: adding directory location to my file output script
On Wed, 10 Oct 2012 13:04:35 -0700 (PDT), crossan...@gmail.com wrote
in <f5075c06-b7f2-4cd3-a40c-906547bdc120@googlegroups.com>:

> 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.

[snip]

>require 'date'

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

How about:

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

>if File.exists?('file')

Why are you enclosing file in quotation marks?  That's a string
literal, not a variable name.

>  File.rename('file', "pickle_#{new_file}.html")

File.rename(file, "logs/pickle_#{new_file}.html")

[snip rest]
--
Charles Calvert             |  Websites
Celtic Wolf, Inc.           |  Web Applications
http://www.celticwolf.com/  |  Software
(703) 580-0210              |  Databases


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Crossan  
View profile  
 More options Oct 11 2012, 9:32 am
Newsgroups: comp.lang.ruby
From: Ryan Crossan <crossan...@gmail.com>
Date: Thu, 11 Oct 2012 06:32:13 -0700 (PDT)
Local: Thurs, Oct 11 2012 9:32 am
Subject: Re: adding directory location to my file output script
Charles,

Thank you much for the tips and suggestions. It is working just like I need it to now.

I appreciate it.

 - Ryan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »