-
Notifications
You must be signed in to change notification settings - Fork 0
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
Minor changes to allow for subclassing #2
base: master
Are you sure you want to change the base?
Conversation
Several examples of Regexify subclasses are included
Minor tweaks to allow subclasses
Added accessor methods with validated input for 'options' in RegexifyWithOptions
Added accessor methods for 'options' in examples/example.rb
Removed some redundant code
Removed redundant code
Fixed some indentation
Hey Steve, is there a reason why you closed this PR? It looks really promising 😄 |
Probably because this is the first one I've ever done. I'll re-open it.
Sorry for the newbie mistake.
…-- sw
On Sun, Oct 14, 2018 at 7:20 PM Justin Léger ***@***.***> wrote:
Hey Steve, is there a reason why you closed this PR?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACPr9fdP1FgSvXJmrLYzkrJ9GAQw64T9ks5uk_DngaJpZM4Xba9l>
.
|
@stevewi All good. I like what I see. Perhaps we could introduce your variations as options in the main gem. What do you think? |
There are very few changes in your code itself: Logic changes
Visibility changes
The real action is in the example (
I have an application that scans in-/out-bound mail for certain sets of regexps and sets a tag header in the message depending on what it finds. I'm certainly no expert at writing regexps and most of the ones I have are fairly simple from a guru's point of view (they do, however, use the I'm looking for a way to build/edit regexps more easily (and in symbols that my pea-brain understands) -- perhaps using Anyway, that's my motivation... -- sw P.S. I would also like any file format to include a minimal amount of reuse of expressions using Boolean logic (similar to SpamAssassin rules: https://wiki.apache.org/spamassassin/WritingRules) and some rudimentary amount of forward chaining on substrings using |
It's your gem... I only want to use it without having to support it 😉
I don't know what you mean by 'options in the main gem'... Can you please
explain? I'm afraid I'm not very familiar with gem packaging either. Be
aware that the 'RegexifyANSI' class may generate nonsensical Regexps -- and
that the class is an example of what is possible...not what is possible and
correct (I think it needs a little more thought).
I posted a note about the changes and my motivation for them on the PR. I
don't know if you've read it but, if not, I'd encourage you to. It sort of
lays out a vision of what I want to accomplish with Regexify.
Regards,
Steve
…On Mon, Oct 15, 2018 at 9:12 AM Justin Léger ***@***.***> wrote:
@stevewi <https://github.com/stevewi> All good. I like what I see.
Perhaps we could introduced your variations as options in the main gem.
What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACPr9aIrjI_FdQZJ6Ezsr0dBRWnuqv4Vks5ulLP_gaJpZM4Xba9l>
.
|
On Mon, Oct 15, 2018 at 11:04 AM Steve Witten <caponecicero@gmail.com> wrote:
<snip />
I don't know what you mean by 'options in the main gem'... Can you please
explain? I'm afraid I'm not very familiar with gem packaging either.
P.S. What I've submitted is totally backwards-compatible from a
functionality perspective with your gem. I'm always leary of introducing
scads of incomprehensible (and possibly incompatible) options.
-- sw
… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed a case...when
construct & replaced with 3 equivalent <statement> if <condition>
constructs...less code and possibly faster...and possible solves one of the codebeat issues.
This there are a few minor changes to lib/regexify.rb to allow for easier use of the
Regexify
class as a base class. There is a new file called examples/example.rb to demonstrate. examples/example.rb contains three different subclasses ofRegexify
of varying complexity. The monkey-patch ofRegexify
is just for the convenience of the test cases at the bottom.I hope you will consider merging this into the master branch of your repository.
Thanks for letting me contribute.
-- Steve Witten