~ghost08/ratt

6 2

[Question] Modifying the project to work as a libray?

Details
Message ID
<20210708132216.cmdk4wqbbobjx7oi@morc.localdomain>
DKIM signature
pass
Download raw message
Hello,

I would like to be able to use ratt as a library in another project and
the way the code is structured at the moment doesn't allow this.

Basically I want to pass a URL and a Selectors object to RATT and get
back a string containing the RSS xml.

Would you be interested in a patch that achieves this? I forked the
project[1] and the changeset isn't that large (~200 lines).

[1] https://git.sr.ht/~mariusor/ratt

Cheers,
/Marius
Details
Message ID
<CCOFYSNB8JXL.N0WC95DLWRK7@micro-pc>
In-Reply-To
<20210708132216.cmdk4wqbbobjx7oi@morc.localdomain> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Hi Marius,

that's a great idea. So I think this would be then installed with:
`go install git.sr.ht/~ghost08/ratt/cmd@latest` ?
Then I must change also the AUR packages. When time allows I'll check it
and add your patch. Will inform you.

Re: [Question] Modifying the project to work as a library?

Details
Message ID
<20210709083221.gx2nuompnkgcsldx@morc.localdomain>
In-Reply-To
<CCOFYSNB8JXL.N0WC95DLWRK7@micro-pc> (view parent)
DKIM signature
pass
Download raw message
On 21-07-09 09:47:09, Vladimír Magyar wrote:
> Hi Marius,
> 
> that's a great idea. So I think this would be then installed with:
> `go install git.sr.ht/~ghost08/ratt/cmd@latest` ?
> Then I must change also the AUR packages. When time allows I'll check it
> and add your patch. Will inform you.

OK, I'm glad to hear. I'll prep the patch and send it sometime this
week. So far I haven't tested it fully outside of what I needed it for.

I'll try to also write a patch for the AUR package.

Cheers,
/Marius
Details
Message ID
<20210709120221.ryjriiz6pgoaxwlg@morc.localdomain>
In-Reply-To
<CCOFYSNB8JXL.N0WC95DLWRK7@micro-pc> (view parent)
DKIM signature
pass
Download raw message
On 21-07-09 09:47:09, Vladimír Magyar wrote:

> `go install git.sr.ht/~ghost08/ratt/cmd@latest` ?

In testing my patch I stumbled upon this small issue.

If we use the go install command, the binary will be installed under the
name of its folder, ie: cmd, which is not what we want.

We have two options here:

  1. Update install instructions to use git and `go build -o`

  2. Rename the cmd folder to something like ratt, but then the install
command will look ugly being:

    go install git.sr.ht/~ghost08/ratt/ratt@latest

Any preference, or any idea about how to do it better?

Regards,
/Marius
Details
Message ID
<CCOLTJDTUPS1.3SN3JNDY6IRDT@micro-pc>
In-Reply-To
<20210709120221.ryjriiz6pgoaxwlg@morc.localdomain> (view parent)
DKIM signature
pass
Download raw message
I think it is done with another folder in the cmd
git.sr.ht/~ghost08/ratt/cmd/ratt

Then, I think, it can be installed with just
`go install git.sr.ht/~ghost08/ratt@latest`
Details
Message ID
<20210709144847.qr2wprm6tftwtbhs@morc.localdomain>
In-Reply-To
<CCOLTJDTUPS1.3SN3JNDY6IRDT@micro-pc> (view parent)
DKIM signature
pass
Download raw message
On 21-07-09 14:22:24, Vladimír Magyar wrote:

> Then, I think, it can be installed with just
> `go install git.sr.ht/~ghost08/ratt@latest`

Hello Vladimir, thank you for the suggestion but unfortunatelly no,
install requires a main package as the final element in the path (using
my fork for this as an example):

    go install git.sr.ht/~mariusor/ratt@5936598
    go install: package git.sr.ht/~mariusor/ratt is not a main package

I think that using /cmd/ratt will still require full path in the install
command.

I'll do some more investigation on my side also.

Cheers,
/Marius
Details
Message ID
<CCOP85UM1FI1.26BU9PZ06G6DZ@micro-pc>
In-Reply-To
<20210709144847.qr2wprm6tftwtbhs@morc.localdomain> (view parent)
DKIM signature
pass
Download raw message
Ok so it will be:
`go install git.sr.ht/~ghost08/ratt/cmd/ratt@latest`

I think it's not that big of a deal

So I'll wait for your patch.
Reply to thread Export thread (mbox)