#ruby - 19 November 2018
« Back 1 day Forward 1 day »
[07:20:29] marz_d`ghostman: I'm trying to test the format of logger, is there like a test specific stream I can use instead of a file?
[17:13:19] Aces1up: hey all i have been searching around but can not find an answer to this. when i save a datetime to column in rails I know it saves it as utc.. How can I later do a query on that datetime to see if it has passed a certain time in another timezone?
[17:13:19] Aces1up: <aces1up> it is as simple as querying the database using a datetime object set with a different timezone and AR knows what to do from there?
[17:18:03] RougeR: aces1up, https://stackoverflow.com/questions/28872761/time-zone-storage-in-data-type-timestamp-with-time-zone/28876266#28876266
[17:18:37] RougeR: could be that you have to write a sql method otherwise you are going to be doing the checks in rails
[17:23:20] Aces1up: right now i have an app where i was storing all things as unix timestamp, now i need to adapt it to retreieve stuff based on biz location / timezone
[17:26:10] Aces1up: or should i just switch over everything to date time object so AR can do queries against timezone of business?
[17:27:02] Aces1up: its polling businesses for new leads that come in.. so i have a cron job running every 30 secs.
[17:29:12] Aces1up: sure let me know your thoughts if i can adapt just Timestamps to work with timezones.
[17:29:37] Aces1up: i guess i need to convert the timestamp to time object then convert to timezone but then how would I do a query with all those conversions.
[19:00:19] rubydoc: OpenSSL::SSL::Session#timeout, Object#timeout, Timeout.timeout, WEBrick::Utils.timeout
[19:01:03] rubydoc: https://ruby-doc.org/stdlib-2.5.3/libdoc/timeout/rdoc/Object.html#method-i-timeout
[23:05:33] dachi`: public_send(res.reason_phrase == "Created" ? *[:a, "PR Created"] : *[:a, "PR not created"])
[23:09:57] zenspider: dachi: that looks like an if statement to me. Don't be clever when you don't need to be
[23:12:08] dachi`: Radar: thanks I broke it down, I was just thinking that one line would be better, but still this looks nicer now
[23:12:27] Radar: Out of those three options I would pick B. Ternaries are good for short bits of code and I think the string there makes it too long.
[23:14:19] dachi`: yep thanks guys. i'll leave, i had this bnc but seems something went wrang. I'm in a hurry, tty later maybe, I remember Radar and some other names for 4-5 years already
[23:32:52] zenspider: first foray into jruby in a looong time. Having some problems. Installed 18.104.22.168 via rbenv, but I'm getting heavy handed warnings on every invocation about reflection & security? Is there something I should be doing?
[23:33:01] zenspider: Second problem: rbenv seems to hate jgem and probably everything else? stubs just bitch and give up. I have to full path everything. Clue?
[23:52:49] dubuc: I am using Puppet provided by my platform team. And for some reason, an Array.to_yaml.lines returns Enumerable instead of Array.
[23:54:49] zenspider: you probably don't want `to_yaml.lines` at all, right? what would you be doing with the yaml?
[23:55:18] dubuc: https://github.com/pcfens/puppet-filebeat/commit/ca68224b93ab2d6d72d4416211d4e0f09a61c55d#diff-3f3faf2c3bb11906e4bf525391805942R195
[23:58:52] zenspider: ah. ok. I see. they're doing this in a yml.erb file... so no, the --- isn't valid at that location... the problem is using to_yaml at all. sec.