<TomyWork>
# require 'date'; DateTime.parse('2019-03-15 13:01:11 UTC').strftime('%F %T') # How can I make this display times in the local time zone?
Guest30977 has joined #ruby
<TomyWork>
local time zone = the system's configured time zone, basically whatever the "date" bash command shows
<darix>
uplime: you youngster probably forgot all the fun of 1.8 to 2.0
<TomyWork>
that was a fun time to start writing ruby
conta has quit [Ping timeout: 250 seconds]
jcalla has joined #ruby
apparition has quit [Quit: Bye]
bjpenn has joined #ruby
tau has joined #ruby
marcoecc has quit [Ping timeout: 272 seconds]
jokester has quit [Quit: shutdown]
devil_tux has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
jokester has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
stryek has joined #ruby
Rapture has joined #ruby
alem0lars_ has joined #ruby
alem0lars_ has quit [Read error: Connection reset by peer]
<kke>
is there some neat way to "cyclically" (rolling?) get an item from an array? like let's say i have KEY = [1, 2, 3, 4, 5]. something clever to make something like KEY.cyclical(5) point to KEY[0], KEY.cyclical(6) to KEY[1], KEY.cyclical(11) to KEY[0]
<kke>
well that method shouldn't be that difficult. i'm just thinking there's probably some trick i can't think of how this could be done with science.
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
tpanarch1st has quit [Ping timeout: 246 seconds]
suukim has quit [Quit: Konversation terminated!]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 245 seconds]
cow[moo] has joined #ruby
D9 has joined #ruby
zachk has joined #ruby
ellcs has joined #ruby
themsay has quit [Ping timeout: 240 seconds]
themsay has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
hightower3 has joined #ruby
hightower3 has quit [Changing host]
hightower3 has joined #ruby
<zenspider>
havenwood: hah!
<zenspider>
mmmmmaybe!
DWSR has joined #ruby
za1b1tsu has joined #ruby
<DWSR>
Hey all, I'm trying to build a Docker container for my company's Rails 5.0.7.1 app. I'm trying to precompile assets in the container build (rather than before), but I'm running into some issues with initializers that are reaching out to things like MySQL or Redis which is not ideal. I noticed that 'initialize_on_precompile' was removed in Rails 4.1. What's the recommended way to deal with this situation?
<za1b1tsu>
so regarding irb, there is this option:--single-irb Share self with sub-irb. Does anyone know what this is about, an example? Can't find anything on google
zachk has quit [Changing host]
zachk has joined #ruby
aqd has quit [Quit: Leaving]
t0xik has joined #ruby
<leftylink>
za1b1tsu: in irb, I do `a = 5`, then I do `irb`, that is a sub-irb. In the sub-irb, what happens if I ask for `a` ? Without flag, it is not defined, NameError. With flag, it is defined (it is 5)
<leftylink>
I hope it was clear. if not, maybe a quick log of my session will help, https://dpaste.de/PHbz/raw
zleap has joined #ruby
zleap has joined #ruby
zleap has quit [Changing host]
<zenspider>
DWSR: please ask rails questions in the rails channel
<DWSR>
zenspider: I've also asked it in there.
<zleap>
DWSR: #rubyonrails
<za1b1tsu>
leftylink, wow ok, I never knew I could start irb within irb, what's the usecase? how could it be useful to start irb in irb?
<zenspider>
corollary: please don't ask rails questions in here
<zenspider>
za1b1tsu: it's like starting a subshell... not terribly useful imo, but sometimes it is nice to have a stack to push/pop
bjpenn has quit [Ping timeout: 250 seconds]
devil_tux has joined #ruby
<zenspider>
and I guess... the single-irb flag means that it is NOT like a subshell, and more like a dynamically scoped (Or non-scoped?) language.
<zenspider>
I don't think I like that option
<za1b1tsu>
hmm, ok, thank you
dar123 has joined #ruby
<dar123>
hey guyz, i have install ruby 1.9.3 on ubuntu bionic with rvm or rbenv
<dar123>
i was able to do it using 'apt-get install ruby1.9.3 on trusty
<zenspider>
dar123: you know that's a bad idea, right?
<dar123>
yes i know, but no choice. The app i am installing is very old
<dar123>
will try to fork and update it when i have time
<dar123>
atleast i am trying to update the OS from trusty to bionic
za1b1tsu_ has joined #ruby
aqd has joined #ruby
devil_tux has quit [Ping timeout: 255 seconds]
za1b1tsu has quit [Ping timeout: 245 seconds]
segy has quit [Ping timeout: 255 seconds]
<zenspider>
dar123: doesn't matter if you update the OS if your app has gaping holes in it
<zenspider>
not saying it does... but it probably does
DWSR has quit [Quit: Page closed]
debajit has joined #ruby
<debajit>
I'm looking for a data structure / entity that will let me share some state across multiple threads. It looks like I could use Concurrent::Map or an Concurrent::Atom for this. Both reads and writes will be frequent. What is the best Concurrent Ruby solution I could use for this problem?
segy has joined #ruby
<zenspider>
"best" is a myth. it entirely depends on what you're trying to do
falco_ has joined #ruby
<debajit>
zenspider: "good enough" is good for me :)
<zenspider>
if you need to pipeline workers, for example, then queue is perfectly sufficient. If you need some sort of shared mutable state object (which always feels like a bad idea to me), then you'll need something else. Even just a proxy wrapper with a mutex could work, but ... this way madness yadda yadda
bjpenn has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
voidwatch has quit [Ping timeout: 245 seconds]
grilix has quit [Ping timeout: 255 seconds]
falco_ has left #ruby [#ruby]
ur5us has joined #ruby
za1b1tsu_ has quit [Remote host closed the connection]
gix has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.4]
ravenousmoose has joined #ruby
sameerynho has quit [Ping timeout: 245 seconds]
devil_tux has joined #ruby
Azure has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
<robotcars>
i am trying to iterate over a folder of yml files that contain intelligent guess of csv data, and update the columns in the yml (c0,c1,c3) with the headers of a csv template
<robotcars>
i'm having an issue updating the yml value
<ruby[bot]>
robotcars: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<robotcars>
opy
devil_tux has quit [Read error: Connection reset by peer]
<zenspider>
robotcars: you're not writing anything in your gist
zleap has quit [Quit: WeeChat 2.4]
<robotcars>
i commented out L20, because it truncates the file
<zenspider>
line 20 doesn't write out anything to a file
mochiyoda has joined #ruby
<zenspider>
...and I'm not patient enough to wait 5 minutes between responses
<robotcars>
can you refresh the gist please
<zenspider>
ok... read line 20, preferably out loud to yourself
devil_tux has quit [Read error: Connection reset by peer]
<debajit>
zenspider: thanks!
<leftylink>
note that as we can see from https://ruby-doc.org/core-2.5.0/File.html#method-c-open , the file is passed to the block. no other assumptions are made about the block. if the block needs to do something to the file, then it is obligated to do so by using the appropriate operations on the file
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
debajit: totally. good luck!
<zenspider>
leftylink: I was hoping they'd work that out on their own by code reading..
<leftylink>
ah, got it
<zenspider>
meh... I'm simply not patient enough to help out in this case. not while I still have a new gem release to do
<zenspider>
so... have at it :P
Fernando-Basso has joined #ruby
<robotcars>
good luck ;D
tau is now known as supertramp
jcalla has quit [Ping timeout: 255 seconds]
devil_tux has joined #ruby
Ai9zO5AP has quit [Ping timeout: 268 seconds]
ams__ has quit [Quit: Connection closed for inactivity]
jcarl43 has joined #ruby
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has quit [Quit: leaving]
<zenspider>
ruby_parser-legacy 1.0.0 released... finally. I'm so glad to get that off my plate
schleppel has quit [Quit: Konversation terminated!]
nowhere_man has joined #ruby
debajit has quit [Ping timeout: 256 seconds]
dar123 has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
tdy1 has quit [Ping timeout: 252 seconds]
hightower3 has quit [Ping timeout: 245 seconds]
physikoi has joined #ruby
<physikoi>
hello #ruby , I'm suddenly getting a bunch of "make" errors. Even after wiping my gems, I get errors like this: "... make: *** No rule to make target ...". Thoughts? ty
Tempesta has quit [Ping timeout: 272 seconds]
grvgr has quit [Quit: Connection closed for inactivity]
jaddison has quit [Quit: jaddison]
Tempesta has joined #ruby
raulp has joined #ruby
raulp has left #ruby [#ruby]
ur5us has quit [Remote host closed the connection]
houhoulis has joined #ruby
rindolf has quit [Ping timeout: 246 seconds]
bjpenn has quit [Ping timeout: 245 seconds]
Puffball has joined #ruby
<miah>
is there a Makefile in your directory? make isn't really related to ruby in any way.
SuperL4g has joined #ruby
bjpenn has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
<physikoi>
hey miah : full error: "make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `ruby_http_parser.o'. Stop."
<miah>
are you trying to build ruby?
<physikoi>
no, just trying to install gems
<physikoi>
:/
devil_tux has quit [Ping timeout: 252 seconds]
<miah>
do you have xcode installed and activated?
SuperLag has quit [Ping timeout: 272 seconds]
<miah>
(as it looks like you're using the system ruby and its going to rely on the xcode dev kit stuff)
bjpenn has quit [Ping timeout: 246 seconds]
DaRock has joined #ruby
<physikoi>
yeah, i do. did that stuff a while ago because I use macports for most stuff. any other possibilities spring to mind?