Newbie: How to delete a Rails app (Windows)

P

peter.cutting

Hi
Rails looks very neat but I need to delete some of my experiments

I know how to create an app:-

cd c:\rails
rails cookbook

but how do I delete? (If I just delete then I get a permissions
problem)

what about models controllers etc

Thanks alot

Peter
 
J

Jacek

Hi
Rails looks very neat but I need to delete some of my experiments

I know how to create an app:-

cd c:\rails
rails cookbook

but how do I delete? (If I just delete then I get a permissions
problem)

what about models controllers etc

Thanks alot

Peter
What gems has to do with application. If you want to delete app
just do it and create another one. Am'I missing something ?
Jacek Balcerski
 
D

Douglas Livingstone

but how do I delete? (If I just delete then I get a permissions

If you are on XP and you can't delete a folder, it is probably XP
being buggy. It tends to not like you deleting folders you've just
looked inside... sometimes the esiest answer is to log off, then log
back in, then delete the folder. That's my experience anyway.

To delete just a controller, or just a model, you'll have to go into
your project directory and delete the files you don't want anymore
manually. I don't believe generate modifies any files in the
directory, it just creates new ones. Delete 'em :)

Douglas
 
D

Douglas Livingstone

Today. there doesnt seem to be a problem.sorry.

That'll be because you turned your somputer off overnight - same
effect as logging on then off.

Douglas
 
C

Caio Tiago Oliveira

Douglas Livingstone, 2/2/2005 06:04:
If you are on XP and you can't delete a folder, it is probably XP
being buggy. It tends to not like you deleting folders you've just
looked inside... sometimes the esiest answer is to log off, then log
back in, then delete the folder. That's my experience anyway.

The process may be running. XP don't let you delete something which is
loaded in the memory. So he have to close the process before
(Cntrl+Alt+Del, in the Process tab).
 
P

peter.cutting

yes the switching off may have helped (will try logging off next time
it happens). moving on

what process would that be. I would have thought that the only active
process would be the MySQL service. And of course any editors and or
command prompts I have open in the application directory. As far as I
can Ruby and Rails are not continually running processes.
 
T

Tanner Burson

yes the switching off may have helped (will try logging off next time
it happens). moving on

what process would that be. I would have thought that the only active
process would be the MySQL service. And of course any editors and or
command prompts I have open in the application directory. As far as I
can Ruby and Rails are not continually running processes.

Your webserver should also be running (which could also have the files
open, hence the permissions error).
 
B

Barry Sperling

Hello,
I'm trying to understand how to use the test/unit methods and I haven't
been able to learn them from:

http://www.rubygarden.org/ruby?UsingTestUnit
http://www.rubyconf.com/2001/talks/testinginreverse/
http://www.rubygarden.org/ruby?RubyTesting

The first 2 are basically the same and don't work exactly the same on
my Win 2K machine. My output is different than the examples at every
stage, which is no big deal except at the end when the writer declares
victory with no bugs and my output still complains of errors. Can
someone point me to a (gentler/more complete) link that would take me
through the learning curve and, ideally, even work on Windows?
Thanks,
Barry
 
D

Douglas Livingstone

what process would that be.
Your webserver should also be running (which could also have the files
open, hence the permissions error).

It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

Douglas
 
D

Douglas Livingstone

PS: tested on WinXP Pro SP2


It happens when the flder apperas empty too.

Thry this:
1. Create a new folder on the desktop
2. Right click, then "new-> bitmap image"
3. Right click on the image, select edit
4. Put something into the image, save it. Close you image editing program
5. Turn on thumbnail view
6. Try and delete the folder by draging it to the recycle bin, keeping
the view of the folder open (won't work)

Think that it is the image still in use?

7. Delete the image from the folder (will work)
9. Close the view of the folder
8. Folder is now "empty" but you still can't delete it.

Douglas
 
H

Hugh Sasse Staff Elec Eng

Hello,
I'm trying to understand how to use the test/unit methods and I
haven't been able to learn them from: [...]
Can someone point me to a
(gentler/more complete) link that would take me through the learning curve
and, ideally, even work on Windows?

Depends which bits you are trying to get your mind around. If it is
the acual examples, then it might be worth posting the code you had,
what you got, and what you expected. If it is this whole "unit
testing thing", then much of what I wrote and linked to at

http://www.eng.cse.dmu.ac.uk/~hgs/ruby/ruby-unit.html

is probably still useful, and it contains some links to Test Unit
intormation, although it is principally about Ruby Unit, which
predates Test Unit. I've no plans/time/energy to update this in the
*immediate* future, though I see a need for doing so at some point.
 
B

Barry Sperling

Hugh said:
Depends which bits you are trying to get your mind around. If it is
the acual examples, then it might be worth posting the code you had,
what you got, and what you expected.

Thanks, I'll take a look at your link!

As an example of the differences, this is what the writer of the Ruby
Garden tutorial had at the end:

C:\projects-ruby\Sandbox>ruby tc_string_wrapper.rb
Loaded suite tc_string_wrapper
Started...
..
Finished in 0.01 seconds.
1 runs, 1 assertions, 0 failures, 0 errors

And this is what I got running it in Scite:

Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors
Exit code: 1

Any thoughts, or other links, would be appreciated.
Barry
 
H

Hugh Sasse Staff Elec Eng

And this is what I got running it in Scite:

I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?
Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors
Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.
We could probably do with knowing what versions of Ruby and Test Unit
you are using.

All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.
Any thoughts, or other links, would be appreciated.
Barry

Hugh
 
B

Barry Sperling

Hi Hugh,
I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?
Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.
Loaded suite Test_Unit.rbw
Started
F
Finished in 0.05 seconds.

1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors
Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.

require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
def test_wrap
wrapper = StringWrapper.new
assert_equal("This is a\nwrapped\nline.",
wrapper.wrap("This is a wrapped line.", 9),
"The line should have been wrapped to 9 columns")
end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
def wrap( string, columns )
string.scan(/(.{1,9}) (?: |$)/).join("\n")
end
end
We could probably do with knowing what versions of Ruby and Test Unit
you are using.

Ruby 1.8.2 and whatever Test Unit comes with it.
All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.
Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with:

require 'test/unit'
class TC_MYTest < Test::Unit::TestCase
def test_fail
assert(false, 'Assertion was false.')
end
end

works as stated. But I need some more hand holding to get it to judge
my own work.
Thanks,
Barry
 
H

Hugh Sasse Staff Elec Eng

Hi Hugh,
I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?
Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.
[...]
1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1

We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.

require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
def test_wrap
wrapper = StringWrapper.new
assert_equal("This is a\nwrapped\nline.",
wrapper.wrap("This is a wrapped line.", 9),
"The line should have been wrapped to 9 columns")
end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
def wrap( string, columns )
string.scan(/(.{1,9}) (?: |$)/).join("\n")

Should be
string.scan(/(.{1,9})(?: |$)/).join("\n")
i.e no space between ) and ( because the regular expression will look
for that space.

And I think you get an empty string because
/.{1,9) / and /.{1,9} $/ never match the input. There is no double
space, and there is no [space][end of line], / $/.
We could probably do with knowing what versions of Ruby and Test Unit
you are using.

Ruby 1.8.2 and whatever Test Unit comes with it.
Thanks
All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.
Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with: [...]
assert(false, 'Assertion was false.') [...]

works as stated. But I need some more hand holding to get it to judge my own
work.
Thanks,
Barry
HTH
Hugh
 
B

Barry Sperling

Thank you!
The "space" was an error and it now runs correctly. FWIW, an earlier
error (yesterday) was leaving out the "require" for the file that held
the StringWrapper class. Now if I could only figure out what is going
Hi Hugh,
I don't use Scite, so can't be sure how this interacts.
Presumably you get the same results outside of Scite?
Yes, when I used it on the command line as:
e:\ruby\scite\ruby test_unit.rbw

I got the same error.
[...]
1) Failure:
test_wrap(TC_StringWrapper) [Test_Unit.rbw:11]:
The line should have been wrapped to 9 columns.
<"This is a\nwrapped\nline."> expected but was
<"">.

1 tests, 1 assertions, 1 failures, 0 errors

Exit code: 1




We'd really need to see your code to be able to reproduce this, and
to be sure that it doesn't differ significantly from the example.


require 'test/unit'
require 'string_wrapper' #NOTE: I ALSO TRIED _.RB AND _.RBW HERE

class TC_StringWrapper < Test::Unit::TestCase
def test_wrap
wrapper = StringWrapper.new
assert_equal("This is a\nwrapped\nline.",
wrapper.wrap("This is a wrapped line.", 9),
"The line should have been wrapped to 9 columns")
end
end

and string_wrapper.rbw ( also made a string_wrapper.rb just to be sure ):

class StringWrapper
def wrap( string, columns )
string.scan(/(.{1,9}) (?: |$)/).join("\n")


Should be
string.scan(/(.{1,9})(?: |$)/).join("\n")
i.e no space between ) and ( because the regular expression will look
for that space.


And I think you get an empty string because
/.{1,9) / and /.{1,9} $/ never match the input. There is no double
space, and there is no [space][end of line], / $/.
We could probably do with knowing what versions of Ruby and Test Unit
you are using.


Ruby 1.8.2 and whatever Test Unit comes with it.

Thanks
All we can say now is that it is clear the assert statement is
getting an empty string, but from what I can's see.

Any thoughts, or other links, would be appreciated.

Thanks for your link, and I'm currently looking at:

http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html

The example there with:
[...]

assert(false, 'Assertion was false.')
[...]


works as stated. But I need some more hand holding to get it to judge
my own work.
Thanks,
Barry
HTH
Hugh
 
H

Hugh Sasse Staff Elec Eng

Thank you!
The "space" was an error and it now runs correctly. FWIW, an earlier
error (yesterday) was leaving out the "require" for the file that held the

The fact that the test failed showed me where the error was. Which
shows how well they work....
StringWrapper class. Now if I could only figure out what is going on here...

Which bit is confusing you? The test unit bit, the string.scan, the
regexp, .... ? With the windows distro you have the 1.6 docs to
consult about String#scan and about regexps, which doesn't mean they
make sense to you, of course. :)

Hugh
 
B

Barry Sperling

Hugh said:
Which bit is confusing you? The test unit bit,
Yes.
1) I am not clear on whether only the classes are being tested ( no
instances, no run with real inputs ) or a full program can be tested.
2) Is the intent to test all boundary conditions? Pre-conditions?
Post-conditions?
3) Is a single test meant for a single class and its subclasses, or
does it work just as well with all of the classes that might be in the
program at once?
Thanks,
Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,166
Messages
2,570,907
Members
47,448
Latest member
DeanaQ4445

Latest Threads

Top