Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release after every list update #265

Closed
matias-sclavi opened this issue Oct 5, 2023 · 3 comments
Closed

New release after every list update #265

matias-sclavi opened this issue Oct 5, 2023 · 3 comments

Comments

@matias-sclavi
Copy link

matias-sclavi commented Oct 5, 2023

Hi!

We are having an error that is fixed by one of the latest public suffixes list updates. Shouldn't a release be done every time the list is updated?

Thanks!

@weppos
Copy link
Owner

weppos commented Oct 6, 2023

Thanks for your suggestion @matias-sclavi . I've thought about it in the past, but with the frequency the list is updated (close to daily), we will end up with a very large number of released which in many cases is an excessive overhead.

There is also no guarantee that main is perfectly in sync with the list.

If you need to use the latest version, the library supports the ability to load an arbitrary list in the PSL format. You can have your own script to download the list as frequently as you need, and initiate the lib with a list from a local path instead of using the default list.

@weppos weppos closed this as completed Oct 6, 2023
@geeksam
Copy link

geeksam commented Oct 6, 2023

@weppos Good to know. At first glance, I don't see any documentation about that feature. Poking through the code, it looks like something like this would work:

list_text = File.read('path/to/updated/list')
list = PublicSuffix::List.parse(list_text)
PublicSuffix::List.default = list

Is that correct? If so I'll send a PR to add that to the README.

Also, how would you feel about adding a top-level convenience method to turn the above snippet into a one-liner? Maybe something like PublicSuffix.load_custom_list? If you're open to that, I can send a separate "straw man" PR.

@weppos
Copy link
Owner

weppos commented Oct 10, 2023

Yes, that code is correct. There is a similar example in the README for building a custom list without private names, but you are right an example with a custom list is a good idea.
https://github.com/weppos/publicsuffix-ruby/blob/main/README.md#private-domains

There is also a second approach, which is building a list instance and then query against it, rather than replacing the default list. This is somewhat a preferrable approach if you deal with an environment where overriding a global variable is an undesirable effect.

For now, I'd rather not add a convenient method for it. It will require extra maintenance effort for little gain, if it is properly documented.

@weppos weppos closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants