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

Delete most of the logic, and clean-up what's left #83

Merged
merged 5 commits into from
Oct 25, 2017
Merged

Conversation

skalee
Copy link
Contributor

@skalee skalee commented Oct 25, 2017

The previous regular-expression-based implementation was insufficient, and very difficult to improve. Therefore, most of it must be removed prior being rewritten from scratch.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was n...
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter EnforcedStyle (for Style/Encoding) found in .rubocop.yml
Style/Encoding no longer supports styles. The "never" behavior is always assumed.
obsolete parameter SupportedStyles (for Style/Encoding) found in .rubocop.yml

@codecov
Copy link

codecov bot commented Oct 25, 2017

Codecov Report

Merging #83 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #83      +/-   ##
=========================================
- Coverage   99.44%   99.4%   -0.04%     
=========================================
  Files          10      10              
  Lines         358     168     -190     
=========================================
- Hits          356     167     -189     
+ Misses          2       1       -1
Impacted Files Coverage Δ
...b/uri_format_validator/validators/uri_validator.rb 100% <100%> (+1.23%) ⬆️
spec/uri_validator_spec.rb 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee54f84...2df94b0. Read the comment docs.

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was n...
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter EnforcedStyle (for Style/Encoding) found in .rubocop.yml
Style/Encoding no longer supports styles. The "never" behavior is always assumed.
obsolete parameter SupportedStyles (for Style/Encoding) found in .rubocop.yml

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was n...
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter EnforcedStyle (for Style/Encoding) found in .rubocop.yml
Style/Encoding no longer supports styles. The "never" behavior is always assumed.
obsolete parameter SupportedStyles (for Style/Encoding) found in .rubocop.yml

Copy link

@houndci-bot houndci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some files could not be reviewed due to errors:

Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was n...
Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered.
(obsolete configuration found in .rubocop.yml, please update it)
obsolete parameter EnforcedStyle (for Style/Encoding) found in .rubocop.yml
Style/Encoding no longer supports styles. The "never" behavior is always assumed.
obsolete parameter SupportedStyles (for Style/Encoding) found in .rubocop.yml

def validate_retrievable(option, uri)
fail_unless Reacher.new(uri).retrievable? if option
invalid unless Reacher.new(uri).retrievable? if option

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using nested modifiers.
Avoid modifier if after another conditional.

Single `invalid` method is enough.
The allow_nil/blank options are standard Active Model features.  There
aren't implemented in this gem, thus they don't need testing.
Validating URLs requires additional constraints.  Not all valid URIs
with http(s) scheme set are valid URLs.  We used to have a RegExp
for that, but it has been proven to be way too limited.

Disabling these specs for now.
@skalee skalee merged commit 1286ca7 into master Oct 25, 2017
@skalee skalee deleted the rewrite branch October 25, 2017 19:07
skalee added a commit that referenced this pull request Oct 25, 2017
The :scheme option has been temporarily removed in 6839f41
(pull request #83).  Providing it in these tests was the odd necessity
of previous implementation.  Now it may be (and should be) removed from
these examples as irrelevant.
skalee added a commit that referenced this pull request Oct 25, 2017
The :scheme option has been temporarily removed in 6839f41
(pull request #83).  Providing it in these tests was the odd requirement
of the previous implementation.  Now it may be (and should be) removed
from these examples as irrelevant.
skalee added a commit that referenced this pull request Oct 26, 2017
The :scheme option has been temporarily removed in 6839f41
(pull request #83) and greatly reworked since then.  In the previous
implementation, providing it in these examples was an odd necessity.
Now it's only a confusing and troublesome leftover, which is being
removed now.
skalee added a commit that referenced this pull request Oct 26, 2017
The :scheme option has been temporarily removed in 6839f41
(pull request #83) and greatly reworked since then.  In the previous
implementation, providing it in these examples was an odd necessity.
Now it's only a confusing and troublesome leftover, which is being
removed now.
skalee added a commit that referenced this pull request Oct 26, 2017
The :scheme option has been temporarily removed in 6839f41
(pull request #83) and greatly reworked since then.  In the previous
implementation, providing it in these examples was an odd necessity.
Now it's only a confusing and troublesome leftover, which is being
removed now.
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

Successfully merging this pull request may close these issues.

2 participants