[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Using rake package task- suppressing initial segment of path

Dan Tenenbaum

9/1/2006 7:23:00 PM

I have the following trivial bit of code, just to help me figure out
how to create a more usable tarball:

require 'rake/packagetask'
Rake::PackageTask.new('WCV', :noversion) do |p|
p.need_tar_gz = true
p.package_files.include("README")
end
when I run "rake package", it creates a pkg directory
and a tarball in that directory called "wcv.tar.gz".
when I do "tar ztf pkg/wcv.tar.gz" I see this:

wcv/
wcv/README

I need for the initial "wcv" **not** to be included.
In other words, when I run "tar ztf pkg/wcv.tar.gz" I want to see:
README

Can this be done?

Thx

--
Posted via http://www.ruby-....

9 Answers

Jim Weirich

9/1/2006 9:04:00 PM

0

Dan Tenenbaum wrote:
[...]
> I need for the initial "wcv" **not** to be included.
> In other words, when I run "tar ztf pkg/wcv.tar.gz" I want to see:
> README

Yikes! I hate when packages dump their contained files intermingled
with files in the current directory. That's why PackageTask does it
that way it does.

However, read on if you feel you have a legitimate need.

> Can this be done?

The package task does not do that, nor is there a straightforward way to
configure it to do so.

However ...

The guts of the package task are not that complex. It is just running
tar over the list of files it has collected. If you don't want to redo
everything, you can let the package task build the directory and then
just add your own task to build the tar file.

Assume your project is myproj, version 1.2.3

Add this task:


file "myproj-1.2.3.tgz" => "pkg/myproj-1.2.3" do
chdir("pkg/pkg/myproj-1.2.3") do
sh %{tar zcvf ../../myproj-1.2.3.tgz *}
end
end

This will create a tgz file in the root of your project (rather than in
the pkg directory like the package task does). Typing:

rake myproj-1.2.3.tgz

will do the trick.

Does this help?

-- Jim Weirich

--
Posted via http://www.ruby-....

Dan Tenenbaum

9/1/2006 10:20:00 PM

0

Jim Weirich wrote:
> Dan Tenenbaum wrote:
> [...]
>> I need for the initial "wcv" **not** to be included.
>> In other words, when I run "tar ztf pkg/wcv.tar.gz" I want to see:
>> README
>
> Yikes! I hate when packages dump their contained files intermingled
> with files in the current directory. That's why PackageTask does it
> that way it does.

Yeah...but I'm not creating a package. I have a specialized need.

> Assume your project is myproj, version 1.2.3
>
> Add this task:
>
>
> file "myproj-1.2.3.tgz" => "pkg/myproj-1.2.3" do
> chdir("pkg/pkg/myproj-1.2.3") do
> sh %{tar zcvf ../../myproj-1.2.3.tgz *}
> end
> end
>
> This will create a tgz file in the root of your project (rather than in
> the pkg directory like the package task does). Typing:
>
> rake myproj-1.2.3.tgz
>
> will do the trick.
>
> Does this help?

Yes, that works, thanks. I ended up just doing it without the Package
task, and just using Find.find to generate the list of files, looping
through it to weed out my complicated exclusions.

--
Posted via http://www.ruby-....

Carrie

11/9/2009 2:19:00 AM

0

MikeRyder wrote:
> On Sun, 8 Nov 2009 18:00:51 -0500, "Carrie"
> <starchild1124@charter.net> wrote:
>
>> Mike wrote:
>>> So, this place finally died.
>>
>> I just clicked on it to see what was going on. I figured so many
>> had said I had driven people away, and I should leave, it would be
>> jumping, without me posting here.
>> Every now and then I have looked at it, but didn't seem like much of
>> anything going on for discussion.
>> Where is all the active and interesting course discussion some were
>> blamed for preventing?
>>
>
> There's never been an intention on the part of some of the faithful to
> have interesting course discussions. There has on the other hand been
> no scarcity of intention to bitch that some (the unholy, undesirable
> ones) were preventing such discussions.

I know. And it seems kind of silly now, after being away from it for
awhile.
Maybe the value of the newsgroup hasn't been "serious course
discussions" (that people are prevented from having) but practicing, and
remembering what really matters, and I can change my own mind and peaceful
choose what, if anything I respond to, and how?
We usually can't change the world and people in it, if we don't like
it/them. At least in a direct way.


Carrie

11/9/2009 3:57:00 AM

0

ellie wrote:
> On Nov 8, 3:00 pm, "Carrie" <starchild1...@charter.net> wrote:
>> Mike wrote:
>>> So, this place finally died.
>>
>> I just clicked on it to see what was going on. I figured so many had
>> said I had driven people away, and I should leave, it would be
>> jumping, without me posting here.
>> Every now and then I have looked at it, but didn't seem like much of
>> anything going on for discussion.
>> Where is all the active and interesting course discussion some were
>> blamed for preventing?
>
> Good to see all my friends have been p-osting today after a long
> absence. :)

Maybe a vacation is good at some point. New perspective, new start, and
all.
I have been busy, I don't know where summer went, or even if we had one.
I think it was mainly cold and rainy, which is okay with me, I don't like
hot and humid.
Had someone living here again (I keep saying "never again", it's people
with problems who are usually the ones in need of a home. This one wasn't
too bad, though and stayed out of my way most of the time (LOL)
High point newswise was my Golden Retriever Izzy swallowed a sewing
needle... I had taken in a puppy, someone who couldn't keep her (ended up
finding her a good home, and now have another dog someone moving into an
apartment couldn't take). I blame it on the puppy of course. I was mending
something and left my sewing basket on the table beside the bed. The puppy
had a chewed up spool of thread, there was chewed up spool in the bed and
the needle that had been stuck in the side of the spool was missing. I kept
thinking it must be here I'm just not seeing it.
But, Izzy was coughing and gagging and I could feel it in the back of her
throat (sideways) but it was too slippery to pull out (think wiggly dog,
and slimey tongue) Got her to the vet, X rays showed there was a needle, by
then it was down near her stomach. If it was too far, she'd have to go to
Burlington for surgery. But, the local vet anestitized her and managed to
get it out (with something, I wasn't there. Long tool to get things out of
animal's stomachs?). Kept her overnight to make sure her throat was okay.
And next day she was fine. $174, which wasn't bad compared to what I'd
thought, taking her to Burlington (100 or so miles away) for surgery. They
even charged 75 cents for disposal of the needle.
Just when you think your kids are grown up and on their own, there's
pets.
Actually, when looking it up online (waiting to find out if my vet could
get it) I found out the thread would have been worse. Had she eating THAT it
does something like tangles up in their intestines. That's why they kept
saying "are you sure she didn't eat any of the thread?"
I usually keep the sewing box up, mainly because I don't want them
ruining the thread (the cats would love to play with it) but didn't realize
how dangerous (and expensive) it could be.
I just had on the Animal Planet channel, they were showing weird things
that animals swallow. One dog swallowed a knife, another one a 2' plastic
mop handle. A python that was loose in FL swallowed a cat (the cat didn't
survive)
Another one ate 4 golf balls, thinknig they were eggs. (these were
surgically removed)
Yikes....


Lotus_Bloom

11/9/2009 4:26:00 AM

0


"Carrie" <starchild1124@charter.net> wrote in message
news:NpMJm.2059$cd7.1587@newsfe04.iad...
> ellie wrote:
>> On Nov 8, 3:00 pm, "Carrie" <starchild1...@charter.net> wrote:
>>> Mike wrote:
>>>> So, this place finally died.
>>>
>>> I just clicked on it to see what was going on. I figured so many had
>>> said I had driven people away, and I should leave, it would be
>>> jumping, without me posting here.
>>> Every now and then I have looked at it, but didn't seem like much of
>>> anything going on for discussion.
>>> Where is all the active and interesting course discussion some were
>>> blamed for preventing?
>>
>> Good to see all my friends have been p-osting today after a long
>> absence. :)
>
> Maybe a vacation is good at some point. New perspective, new start, and
> all.
> I have been busy, I don't know where summer went, or even if we had one.
> I think it was mainly cold and rainy, which is okay with me, I don't like
> hot and humid.
> Had someone living here again (I keep saying "never again", it's people
> with problems who are usually the ones in need of a home. This one wasn't
> too bad, though and stayed out of my way most of the time (LOL)
> High point newswise was my Golden Retriever Izzy swallowed a sewing
> needle... I had taken in a puppy, someone who couldn't keep her (ended up
> finding her a good home, and now have another dog someone moving into an
> apartment couldn't take). I blame it on the puppy of course. I was mending
> something and left my sewing basket on the table beside the bed. The puppy
> had a chewed up spool of thread, there was chewed up spool in the bed and
> the needle that had been stuck in the side of the spool was missing. I
> kept
> thinking it must be here I'm just not seeing it.
> But, Izzy was coughing and gagging and I could feel it in the back of her
> throat (sideways) but it was too slippery to pull out (think wiggly dog,
> and slimey tongue) Got her to the vet, X rays showed there was a needle,
> by
> then it was down near her stomach. If it was too far, she'd have to go to
> Burlington for surgery. But, the local vet anestitized her and managed to
> get it out (with something, I wasn't there. Long tool to get things out of
> animal's stomachs?). Kept her overnight to make sure her throat was okay.
> And next day she was fine. $174, which wasn't bad compared to what I'd
> thought, taking her to Burlington (100 or so miles away) for surgery. They
> even charged 75 cents for disposal of the needle.
> Just when you think your kids are grown up and on their own, there's
> pets.
> Actually, when looking it up online (waiting to find out if my vet
> could
> get it) I found out the thread would have been worse. Had she eating THAT
> it
> does something like tangles up in their intestines. That's why they kept
> saying "are you sure she didn't eat any of the thread?"
> I usually keep the sewing box up, mainly because I don't want them
> ruining the thread (the cats would love to play with it) but didn't
> realize
> how dangerous (and expensive) it could be.
> I just had on the Animal Planet channel, they were showing weird things
> that animals swallow. One dog swallowed a knife, another one a 2' plastic
> mop handle. A python that was loose in FL swallowed a cat (the cat didn't
> survive)
> Another one ate 4 golf balls, thinknig they were eggs. (these were
> surgically removed)
> Yikes....
>

Wow, poor thing, that's quite an ordeal and actually recovering it. :))


Pieter

11/9/2009 10:13:00 AM

0


"ellie" <miraclelurker@yahoo.com> schreef in bericht
news:b966e121-db4d-46c6-83e4-d4d8da505644@q40g2000prh.googlegroups.com...

> Good to see all my friends have been p-osting today after a long
> absence. :)

- That's how I see it as well!


Carrie

11/9/2009 2:37:00 PM

0

deb wrote:
> "Carrie" <starchild1124@charter.net> wrote in message
> news:NpMJm.2059$cd7.1587@newsfe04.iad...
>> ellie wrote:
>>> On Nov 8, 3:00 pm, "Carrie" <starchild1...@charter.net> wrote:
>>>> Mike wrote:
>>>>> So, this place finally died.
>>>>
>>>> I just clicked on it to see what was going on. I figured so many
>>>> had said I had driven people away, and I should leave, it would be
>>>> jumping, without me posting here.
>>>> Every now and then I have looked at it, but didn't seem like much
>>>> of anything going on for discussion.
>>>> Where is all the active and interesting course discussion some were
>>>> blamed for preventing?
>>>
>>> Good to see all my friends have been p-osting today after a long
>>> absence. :)
>>
>> Maybe a vacation is good at some point. New perspective, new
>> start, and all.
>> I have been busy, I don't know where summer went, or even if we
>> had one. I think it was mainly cold and rainy, which is okay with
>> me, I don't like hot and humid.
>> Had someone living here again (I keep saying "never again", it's
>> people with problems who are usually the ones in need of a home.
>> This one wasn't too bad, though and stayed out of my way most of the
>> time (LOL) High point newswise was my Golden Retriever Izzy
>> swallowed a sewing needle... I had taken in a puppy, someone who
>> couldn't keep her (ended up finding her a good home, and now have
>> another dog someone moving into an apartment couldn't take). I blame
>> it on the puppy of course. I was mending something and left my
>> sewing basket on the table beside the bed. The puppy had a chewed up
>> spool of thread, there was chewed up spool in the bed and the needle
>> that had been stuck in the side of the spool was missing. I kept
>> thinking it must be here I'm just not seeing it.
>> But, Izzy was coughing and gagging and I could feel it in the back
>> of her throat (sideways) but it was too slippery to pull out (think
>> wiggly dog, and slimey tongue) Got her to the vet, X rays showed
>> there was a needle, by
>> then it was down near her stomach. If it was too far, she'd have to
>> go to Burlington for surgery. But, the local vet anestitized her and
>> managed to get it out (with something, I wasn't there. Long tool to
>> get things out of animal's stomachs?). Kept her overnight to make
>> sure her throat was okay. And next day she was fine. $174, which
>> wasn't bad compared to what I'd thought, taking her to Burlington
>> (100 or so miles away) for surgery. They even charged 75 cents for
>> disposal of the needle. Just when you think your kids are grown
>> up and on their own, there's pets.
>> Actually, when looking it up online (waiting to find out if my vet
>> could
>> get it) I found out the thread would have been worse. Had she eating
>> THAT it
>> does something like tangles up in their intestines. That's why they
>> kept saying "are you sure she didn't eat any of the thread?"
>> I usually keep the sewing box up, mainly because I don't want them
>> ruining the thread (the cats would love to play with it) but didn't
>> realize
>> how dangerous (and expensive) it could be.
>> I just had on the Animal Planet channel, they were showing weird
>> things that animals swallow. One dog swallowed a knife, another one
>> a 2' plastic mop handle. A python that was loose in FL swallowed a
>> cat (the cat didn't survive)
>> Another one ate 4 golf balls, thinknig they were eggs. (these were
>> surgically removed)
>> Yikes....
>>
>
> Wow, poor thing, that's quite an ordeal and actually recovering it.
> :))

I think it was worse for me!
She came back the next day, fine, and probably had forgotten all about
it.
Animals seem to have a way of letting things go and moving on.


Carrie

11/9/2009 2:42:00 PM

0

ellie wrote:
> On Nov 8, 7:56 pm, "Carrie" <starchild1...@charter.net> wrote:
>> ellie wrote:
>>> On Nov 8, 3:00 pm, "Carrie" <starchild1...@charter.net> wrote:
>>>> Mike wrote:
>>>>> So, this place finally died.
>>
>>>> I just clicked on it to see what was going on. I figured so many
>>>> had said I had driven people away, and I should leave, it would be
>>>> jumping, without me posting here.
>>>> Every now and then I have looked at it, but didn't seem like much
>>>> of anything going on for discussion.
>>>> Where is all the active and interesting course discussion some were
>>>> blamed for preventing?
>>
>>> Good to see all my friends have been p-osting today after a long
>>> absence. :)
>>
>> Maybe a vacation is good at some point. New perspective, new start,
>> and all.
>> I have been busy, I don't know where summer went, or even if we had
>> one.
>> I think it was mainly cold and rainy, which is okay with me, I don't
>> like hot and humid.
>> Had someone living here again (I keep saying "never again", it's
>> people with problems who are usually the ones in need of a home.
>> This one wasn't too bad, though and stayed out of my way most of the
>> time (LOL)
>> High point newswise was my Golden Retriever Izzy swallowed a sewing
>> needle... I had taken in a puppy, someone who couldn't keep her
>> (ended up finding her a good home, and now have another dog someone
>> moving into an apartment couldn't take). I blame it on the puppy of
>> course. I was mending something and left my sewing basket on the
>> table beside the bed. The puppy had a chewed up spool of thread,
>> there was chewed up spool in the bed and the needle that had been
>> stuck in the side of the spool was missing. I kept thinking it must
>> be here I'm just not seeing it.
>> But, Izzy was coughing and gagging and I could feel it in the back
>> of her throat (sideways) but it was too slippery to pull out (think
>> wiggly dog, and slimey tongue) Got her to the vet, X rays showed
>> there was a needle, by then it was down near her stomach. If it was
>> too far, she'd have to go to Burlington for surgery. But, the local
>> vet anestitized her and managed to get it out (with something, I
>> wasn't there. Long tool to get things out of animal's stomachs?).
>> Kept her overnight to make sure her throat was okay. And next day
>> she was fine. $174, which wasn't bad compared to what I'd thought,
>> taking her to Burlington (100 or so miles away) for surgery. They
>> even charged 75 cents for disposal of the needle.
>> Just when you think your kids are grown up and on their own, there's
>> pets.
>> Actually, when looking it up online (waiting to find out if my vet
>> could get it) I found out the thread would have been worse. Had she
>> eating THAT it does something like tangles up in their intestines.
>> That's why they kept saying "are you sure she didn't eat any of the
>> thread?"
>> I usually keep the sewing box up, mainly because I don't want them
>> ruining the thread (the cats would love to play with it) but didn't
>> realize how dangerous (and expensive) it could be.
>> I just had on the Animal Planet channel, they were showing weird
>> things that animals swallow. One dog swallowed a knife, another one
>> a 2' plastic mop handle. A python that was loose in FL swallowed a
>> cat (the cat didn't survive)
>> Another one ate 4 golf balls, thinknig they were eggs. (these were
>> surgically removed)
>> Yikes....
>
> $174 to remove a neddle from the stomach? If only humans hadn't lost
> their tails they could save thousands of dollars by just going to the
> vet!

I know, but animals don't have inisurance, Medicaid, etc. to help.
If the needle had gone too far down, she'd have had to go to Burlington
(big city) for surgery. Well, the laposcope or whatever they use. None of
the local vets here have them or do that. But, on the other hand, they are
probably good at working without one. Since it had only gotten to the bottom
of her throat, and not into her stomach, he was able to get it out. My first
thought when I heard he was going to try was a picture of a bent open coat
hanger, like you use to reach things with (LOL) Of course, it was more than
that, h probably has long thin forcepts of some kind. They sedated her
first, too.
I probably would have freaked out at $174 if I hadn't been imaginin what
it would cost to take her to Burlington for surgery, before that.
My daughter's dog had kidney stones and the treatement and later removal
of them added up to $1300. And vets insist on being paid, at the time.
Now I think of all this when I do something, before leaving a sewing
basket with thread, and a needle stuck in the side (I was going to come back
to what I was doing) within reach of dogs.
Of course I think it was all the puppy's fault (the puppy I had at the
time (LOL)


Carrie

11/9/2009 3:46:00 PM

0

Pieter wrote:
> "ellie" <miraclelurker@yahoo.com> schreef in bericht
> news:b966e121-db4d-46c6-83e4-d4d8da505644@q40g2000prh.googlegroups.com...
>
>> Good to see all my friends have been p-osting today after a long
>> absence. :)
>
> - That's how I see it as well!

Maybe we get into taking things too seriously, and every now and then need
some space to put it in better perspective. Let a little time go by, and
see it in a new way.