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

Get some nice Regexp which is agnostic about the seconds. #1582

Merged
merged 4 commits into from Oct 24, 2013

Conversation

Projects
None yet
4 participants
@parkr
Member

parkr commented Sep 27, 2013

Fixes the issue of intermittent failures due to issues with being one second after generation time.

Alternative to #1573

/cc @mattr-

@@ -40,5 +40,15 @@ def location(folder, direction)
[before || '.', after || '.']
end
def seconds_agnostic_time(datetime = Time.now)
pieces = datetime.to_s.split(" ")
time = "#{pieces[1].split(':').first}:#{pieces[1].split(':')[1]}:\\d{2}"

This comment has been minimized.

@kelvinst

kelvinst Sep 27, 2013

I know it's 💅, but what about:

  time_split = pieces[1].split(':')
  time = "#{time_split.first}:#{time_split[1]}:\\d{2}"

If you want to kill me for being so annoying, I understand you. 😘

PS.: The kiss was a joke, don't understand it wrong. 😆

This comment has been minimized.

@parkr

parkr Sep 28, 2013

Member

Yes, and more!

@kelvinst

This comment has been minimized.

kelvinst commented Sep 28, 2013

Awesome. Just beautiful ❤️ 💙

@@ -40,5 +40,15 @@ def location(folder, direction)
[before || '.', after || '.']
end
def seconds_agnostic_time(datetime = Time.now)
date, time, zone = datetime.strftime("%Y-%m-%d %H:%M:%S %z").split(" ")

This comment has been minimized.

@kelvinst

kelvinst Sep 28, 2013

So
I like it, but why get the seconds here to ignore them below?

This comment has been minimized.

@parkr

parkr Sep 28, 2013

Member

I have no idea!

mattr- added a commit that referenced this pull request Oct 24, 2013

Merge pull request #1582 from mojombo/seconds_agnostic_time
Get some nice Regexp which is agnostic about the seconds.

mattr- added a commit that referenced this pull request Oct 24, 2013

@mattr- mattr- merged commit 4258854 into master Oct 24, 2013

1 check passed

default The Travis CI build passed
Details

@parkr parkr deleted the seconds_agnostic_time branch Oct 24, 2013

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.