Skip to content

Refactor GistTag #65

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

Merged
merged 10 commits into from
Jul 16, 2019
Merged

Refactor GistTag #65

merged 10 commits into from
Jul 16, 2019

Conversation

ashmaroli
Copy link
Member

  • GistTag#context_contains_key? uses both :has_key? and key?. So its effectively a stalemate.
  • GistTag.client is a public_class_method. It should be placed above the private access modifier
    gist = GistTag.client.gist gist_id

@ashmaroli ashmaroli requested a review from a team October 26, 2018 15:50
@@ -47,6 +47,7 @@ def determine_arguments(input)
end

# rubocop:disable Style/PreferredHashMethods
# Remove the check for `:has_key?` when the plugin drops support for `< Liquid 4.0`
Copy link
Member

Choose a reason for hiding this comment

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

As https://pages.github.com/versions/ supports it, I'm fine with requiring Liquid 4.0.
That's up to someone from GitHub to decide.
/cc @parkr

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, requiring Liquid 4 is fine by me, but give a major bump to this gem if you do that. For now, backwards compatibility is good.

@ashmaroli ashmaroli changed the title Fix some simple RuboCop offenses Refactor GistTag Oct 26, 2018
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

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

LGTM.

@DirtyF DirtyF requested a review from a team October 26, 2018 17:31
@ashmaroli ashmaroli added this to the 2.0 milestone Oct 26, 2018
@ashmaroli
Copy link
Member Author

@mattr-, @parkr I'd like to move the following regex to a private_constant. What would be a suitable name for the constant?

matched = input.match(%r!\A([\S]+|.*(?=\/).+)\s?(\S*)\Z!)

@mattr-
Copy link
Member

mattr- commented Mar 24, 2019

I wouldn't bother moving it to a constant at all. Very little gain for that change when it's already in a method that describes what's going on. Moving the regexp to a constant makes it more important in the class than it is. That's not the class' main concern, so best to leave it hidden inside that method, IMO.

@mattr-
Copy link
Member

mattr- commented Mar 25, 2019

For a PR that was only supposed to be about rubocop offenses, this is starting to get off track. Let's cap it off here and then do further work in other PRs if necessary.

@ashmaroli
Copy link
Member Author

@mattr- It had stopped being about RuboCop offenses much before I renamed the PR title. But I agree, its time to defer any more changes.

@DirtyF
Copy link
Member

DirtyF commented Jul 16, 2019

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit bc23c25 into jekyll:master Jul 16, 2019
@jekyllbot jekyllbot added the fix label Jul 16, 2019
jekyllbot added a commit that referenced this pull request Jul 16, 2019
@jekyll jekyll locked and limited conversation to collaborators Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants