havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
fuDwitc has joined #ruby
r3m is now known as Pascal
Pascal is now known as r3m
bga57 has joined #ruby
fuDwitc has quit [Ping timeout: 265 seconds]
<gitter1234> Trying to import some JSON into my app. The key (string) seems valid, but the value (integer) turns out nil. Anybody know how why? https://gist.github.com/anon987654321/8b758c731bfbff09bbbba0d431dc0c03
<gitter1234> * know why
<leftylink> wait
<leftylink> yeah.
<leftylink> a row doesn't contain an array, it only contains two elements.
<leftylink> a row doesn't contain an array of key value pairs
<leftylink> a row is a key value pair
bga57 has quit [Ping timeout: 264 seconds]
fuDwitc has joined #ruby
bga57 has joined #ruby
<adam12> gitter1234: Did you define `find_by_numeric_code!` or is it a Rails helper?
<adam12> I can't even remember if ActiveRecord still support find_by_some_method_missing
<gitter1234> adam12: `numeric_code` should be a db field. That part seems to work fine judging by the rails console though?
fuDwitc has quit [Ping timeout: 256 seconds]
<siery> gitter1234: I guess you do to many assumptions, that was just a question c:
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
fuDwitc has joined #ruby
<gitter1234> leftylink: aaah yeah! now i get it.. i think
<gitter1234> siery: you're absolutely right :)
fuDwitc has quit [Ping timeout: 260 seconds]
chromis has joined #ruby
<adam12> gitter1234: Does it actually output the first keypair? I see you have puts `key` puts `value`.
<adam12> gitter1234: If it does, just out of curiosity, switch to Municipality.find_by!(numeric_code: key) instead of the find_by_numeric_code!
fuDwitc has joined #ruby
<gitter1234> adam12: It only outputtet the key, but leftylink was right, I had a redundant loop it seems
<adam12> Oh i see it.
<adam12> I got sidetracked watching a video.
<gitter1234> :D trying it now..
ur5us has quit [Ping timeout: 260 seconds]
<adam12> I'd destructure inside the `each_with_index`. do |(key, value), idx|
<adam12> I'd use `pp` or `p` when debugging values, since `p value` would of given you `nil` and not empty string.
<gitter1234> I'll look into those!
<gitter1234> ActiveRecord::RecordNotFound: Couldn't find Municipality: https://gist.github.com/anon987654321/8b758c731bfbff09bbbba0d431dc0c03 right now though, with find_by!(numeric_code: key) as well
fuDwitc has quit [Ping timeout: 272 seconds]
<gitter1234> This time the key and value is outputted correctly.
<al2o3-cr> data was an HTTParty::Response
<gitter1234> al2o3-cr: thank you! but unfortunately the same ActiveRecord::RecordNotFound: Couldn't find Municipality there as well
<gitter1234> but this appears to be a different problem. you guys have been more than helpful!
<al2o3-cr> gitter1234: try key.to_i(8)
<al2o3-cr> or key.oct
<gitter1234> thats neat, (8) as in utf8?
<gitter1234> darn, no dice :/
<al2o3-cr> octal
<al2o3-cr> hmm.. i though that work work.
<gitter1234> al2o3-cr: no dice on oct either..
<gitter1234> i thought so too
<al2o3-cr> gitter1234: what's the error?
<gitter1234> after all i didnt look up a string in the console
<gitter1234> al2o3-cr: the same, couldn't find municipality
<adam12> Maybe it never existed the first time. You're passing a string to an Integer column.
<gitter1234> wait! looks like it worked for the first municipality! with oct
<gitter1234> well hello there.. (although it fails for the second one)
<gitter1234> adam12: Yep..
<adam12> You probably want to migrate that column into a string column (varchar or text or whatever your database is using).
<adam12> My guess is when you created municipalities, you didn't use the ! method, and it was silently skipped on failure.
ur5us has joined #ruby
<gitter1234> good point! i gotta start using more !'s
<adam12> gitter1234: Interestingly, it's why Sequel (another Ruby ORM) defaults to raising on failure. Hidden bugs.
<gitter1234> yeah maybe string would be more proper too.. the numeric_code is an https://en.wikipedia.org/wiki/ISO_3166-2 number or something like that
<gitter1234> sane default indeed
<gitter1234> thanks guys
bruce_lee has quit [Ping timeout: 260 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
fratis has joined #ruby
<al2o3-cr> gitter1234: can you quickly test this: Municipality.find_by_numeric_code!(key[/^0/] ? key.oct : key.to_i)
<al2o3-cr> i can't of a good way of doing it at the moment.
drincruz has joined #ruby
fratis has quit []
<al2o3-cr> or does it work if you switch to varchar.
<gitter1234> looks intense :) i switched the database field to string since its a string in the json and also it feels more right/semantic, as the numeric code is a gov't assigned number. trying it out now..
tau has quit [Ping timeout: 246 seconds]
drincruz has quit [Ping timeout: 246 seconds]
<gitter1234> al2o3-cr: yes!!!!
<al2o3-cr> gitter1234: awesome! :)
<gitter1234> al2o3-cr :)
<gitter1234> i think i see what you did there.. nice
fratis has joined #ruby
fratis has quit [Read error: Connection reset by peer]
fratis has joined #ruby
fratis has quit [Client Quit]
al2o3-cr has quit [Quit: WeeChat 2.8]
al2o3-cr has joined #ruby
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
lesha has quit [Ping timeout: 256 seconds]
ChmEarl has quit [Quit: Leaving]
DTZUZU_ has joined #ruby
DTZUZU has quit [Ping timeout: 264 seconds]
DTZUZU_ has quit [Quit: WeeChat 2.8]
DTZUZU has joined #ruby
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
DTZUZU has quit [Client Quit]
DTZUZU has joined #ruby
sagax has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 246 seconds]
sagax has joined #ruby
NODE has quit [Remote host closed the connection]
NODE has joined #ruby
jenrzzz has quit [Quit: Lost terminal]
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
gix- has joined #ruby
gix has quit [Disconnected by services]
jenrzzz has joined #ruby
bsdbandit-01 has quit [Ping timeout: 256 seconds]
poro_ has quit [Quit: Leaving]
DTZUZU has quit [Ping timeout: 246 seconds]
DTZUZU has joined #ruby
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
_whitelogger has joined #ruby
alexherbo2 has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
gitter1234 has quit [Quit: Connection closed for inactivity]
mheld has quit [Quit: Connection closed for inactivity]
fuDwitc has joined #ruby
_whitelogger has joined #ruby
fuDwitc has quit [Ping timeout: 258 seconds]
fuDwitc has joined #ruby
fuDwitc has quit [Ping timeout: 246 seconds]
cliluw has quit [Quit: Leaving]
sauvin has joined #ruby
fuDwitc has joined #ruby
fuDwitc has quit [Ping timeout: 256 seconds]
renich has quit [Quit: renich]
gix- has quit [Ping timeout: 265 seconds]
akem_ has joined #ruby
deimos_ has quit [Quit: leaving]
akem has quit [Ping timeout: 256 seconds]
cnsvc_ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
deimos_ has joined #ruby
conta has joined #ruby
imode has quit [Ping timeout: 256 seconds]
cnsvc_ has joined #ruby
Archenoth has joined #ruby
Mawile has quit [Ping timeout: 246 seconds]
kinduff has quit [Read error: Connection reset by peer]
conta has quit [Quit: conta]
kinduff has joined #ruby
conta has joined #ruby
schne1der has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
clemens3 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fuDwitc has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
fuDwitc has quit [Remote host closed the connection]
fuDwitc has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
xylophone has quit [Quit: leaving]
manjaroi3 has joined #ruby
manjaroi3 is now known as xylophone
kinduff8 has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff8 is now known as kinduff
ldepandis has joined #ruby
bga57 has quit [Ping timeout: 256 seconds]
alexherbo2 has quit [Ping timeout: 260 seconds]
bga57 has joined #ruby
ur5us has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
conta has quit [Quit: conta]
reyfi9e has quit [Ping timeout: 260 seconds]
Querens has joined #ruby
reyfi9e has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
evert has quit [Remote host closed the connection]
evert has joined #ruby
evert has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 258 seconds]
evert has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
apotheon has quit [Ping timeout: 246 seconds]
apotheon has joined #ruby
alexherbo2 has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
DTZUZU_ has joined #ruby
DTZUZU has quit [Ping timeout: 240 seconds]
lesha has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
BH23 has quit [Ping timeout: 265 seconds]
TCZ has joined #ruby
TCZ is now known as DoomSlayer2020
BH23 has joined #ruby
akem_ has quit [Quit: Leaving]
akem has joined #ruby
akem_ has joined #ruby
akem_ has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
xylophone has quit [Ping timeout: 240 seconds]
DoomSlayer2020 has quit [Quit: Leaving]
akem_ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
sh7d has quit [Read error: Connection reset by peer]
sh7d has joined #ruby
conta has joined #ruby
Emmanuel_ChanelW has joined #ruby
cnsvc_ has joined #ruby
evdubs has quit [Ping timeout: 260 seconds]
evdubs has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
Emmanuel_ChanelW has quit [Quit: Leaving]
sarna has joined #ruby
dionysus69 has joined #ruby
alexherbo2 has joined #ruby
<sarna> is IRC the most popular chat platform used by rubyists? I'd expect a lot more people here
drincruz has joined #ruby
Emmanuel_ChanelW has joined #ruby
burningserenity has joined #ruby
vqrs has quit [Ping timeout: 246 seconds]
vqrs has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
vondruch_ has joined #ruby
<AndreYuhai> in my rspec test file RubyMine warns me as "can not find it" but it runs fine. How can I fix that? The same applies to "to" and "describe" as well. https://dpaste.org/LE9i
burningserenity has quit [Ping timeout: 260 seconds]
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
gavlee has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
drincruz has joined #ruby
burningserenity has joined #ruby
burningserenity has quit [Client Quit]
burningserenity has joined #ruby
TCZ has quit [Quit: Leaving]
gnufied has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
troulouliou_div2 has joined #ruby
<jhass> AndreYuhai: require "rspec" ?
<jhass> or rather make sure require your spec_helper.rb
<jhass> sarna: I don't know, IRC/Freenode is just in a general decline as people move to Slack, Discord, Matrix, Twitter etc unfortunately
<jhass> this is still one of the stronger channels I'm in
troulouliou_div2 has quit [Ping timeout: 272 seconds]
<sarna> jhass: #python still has 1800 online members :(
<AndreYuhai> jhass, Oh yes thank you. when I did rspec before it was underlining that as well so I had deleted it. Turns out I have to wait a bit to load I guess.
gavlee has joined #ruby
<jhass> I bet 1000 of them would prefer to be in #python2 :D
chalkmonster has joined #ruby
<sarna> I don't like slack, it's even more ephemeral than irc, and heavy as heck :/
<sarna> I joined a discord server but it's unfortunately pretty dead (mostly newbies asking questions, nobody responding)
<jhass> I don't see it as an alternative to IRC, for me the usecases are entirely distinct
<jhass> if you look for a place to get answers to questions, I'd say this one still works :)
<sarna> well yeah, if I want irc to be alive, why don't I use irc, lol
<jhass> maybe ruby usage is also declining a bit if we're honest as people move to things like go, rust maybe even elixir. I have the feeling Ruby people are more likely polyglots than python people
<sarna> yeah, ruby is not so shiny anymore
<sarna> but I'd say it's still really popular
<jennis> If i have two Foo objects that both have an an integer attribute bar, how do I get the Foo object which has the minimum Foo.bar?
ChmEarl has joined #ruby
<sarna> otoh at work people want to move from ruby to python.. I can't wait to move to go in three years again, eh :/
<jennis> ah, Foo.min_by(&:bar) does the trick
mydog2 has joined #ruby
rippa has joined #ruby
<mydog2> hey
<sarna> hello
<AndreYuhai> I am using mechanize as a class variable and I will create two threads using the same class variable to send requests. This might get messed up, right? :D
dretnx has joined #ruby
dretnx has quit [Client Quit]
burningserenity has quit [Ping timeout: 258 seconds]
<mydog2> not a ruby dev.. looking to work with a ruby dev but he's new to ruby! i have a few questions
conta has quit [Quit: conta]
<mydog2> he's got a ruby app that works on heroku
<mydog2> i'm looking to transfer the app to run on a linux/apache platform
<mydog2> is this a difficult process?
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
cd has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jhass> AndreYuhai: yeah, I see no statements to thread safety in its docs, so it's safer to assume it's thread unsafe. Shouldn't hurt to just give each thread its own instance
<AndreYuhai> jhass, Alright thank you so much. I am just doing things but sometimes I don't know whether it's the correct way haha.
<havenwood> mydog2: It's not particularly difficult, but can take a while if you've never done things like configure a firewall and setup Apache as a reverse proxy.
<jhass> mydog2: not the most difficult one, no. Heroku certainly is 50x easier, that's what you pay for. Mostly by making many decisions for you, that you have to make on your own. If there's no prior experience it's quite a steep learning curve, but once you know how to host a ruby app, you know it.
Xiti has quit [Ping timeout: 246 seconds]
lucasb has joined #ruby
Xiti has joined #ruby
sarna has quit [Quit: Connection closed]
gpanders has quit [Ping timeout: 265 seconds]
Xiti has quit [Remote host closed the connection]
gpanders has joined #ruby
lesha has quit [Ping timeout: 246 seconds]
cnsvc_ has joined #ruby
Xiti has joined #ruby
<mydog2> hey jhass - since you've helped me a few times on github issues.. the project i'm considering will have multiple apps, can i have a "project" github account, where i''ll place the repos for the project apps?
<jhass> just create an organization
<mydog2> is that free?? i know.. google it!
<mydog2> looking now
poro has joined #ruby
Xiti has quit [Ping timeout: 260 seconds]
<mydog2> i''ll create another account.. and go from there..
bukkitgerman8608 has quit [Ping timeout: 260 seconds]
bukkitgerman8608 has joined #ruby
Emmanuel_ChanelW has quit [Quit: Leaving]
gpanders has quit [Quit: ZNC - https://znc.in]
gpanders has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
Xiti has joined #ruby
DaRock has quit [Ping timeout: 260 seconds]
ldepandis has joined #ruby
prestorium has quit [Read error: Connection reset by peer]
prestorium has joined #ruby
gpanders has quit [Ping timeout: 260 seconds]
<poro> Any what the +0200 is when I do Time.now
<poro> 2020-05-29 17:17:52 +0200
cnsvc_ has quit [Ping timeout: 240 seconds]
<poro> Anybody knows*
<nopc0de> its your timezone?
<nopc0de> UTC+2
<poro> oh that makes sense
<nopc0de> There's also Time.utc.now I believe
<jidar> https://gist.github.com/974bd8feb9c0247097de3d2f429180f0 having trouble tracking this down, anybody offer suggestions?
gpanders has joined #ruby
gnufied has quit [Quit: Leaving]
Esa__ has joined #ruby
leitz has joined #ruby
deathwishdave has joined #ruby
fuDwitc has quit [Remote host closed the connection]
fuDwitc has joined #ruby
imode has joined #ruby
fuDwitc has quit [Ping timeout: 256 seconds]
fuDwitc has joined #ruby
SeepingN has joined #ruby
fuDwitc has quit [Remote host closed the connection]
<leitz> Happy Friday everyone.
fuDwitc has joined #ruby
gitter1234 has joined #ruby
<havenwood> jidar: Show `gem which irb` and `which irb`?
<havenwood> jidar: Also, what's: head -n1 "$(which irb)"
lesha has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> jidar: It seems either irb is getting loaded three times. I dunno why this script is doing that, but it's possible to do with #load or manually.
<havenwood> jidar: Does just running Ruby produce a warning?: ruby -rirb -e "0"
gix has joined #ruby
<jidar> yes to the last one: ruby -rirb -e "0" does produce the warning
Besnik_b has quit [Ping timeout: 246 seconds]
nopc0de has quit [Quit: Leaving]
deathwishdave has joined #ruby
<jidar> havenwood: I do note that this is just a symlink /usr/share/ruby/irb.rb -> /usr/share/gems/gems/irb-1.2.3/lib/irb.rb
poro has quit [Ping timeout: 246 seconds]
banisterfiend has joined #ruby
conta has joined #ruby
schne1der has quit [Ping timeout: 256 seconds]
<ule> Can someone please explain to me if it is safe to run GC.start at the end of a script execution? (In my case it is actually a Sidekiq queue process
<ule> If I understood well from my google search here.. it doesn't run GC immediately, but instead, just tells Ruby that the code is ready to clean things up
<havenwood> ule: It does actually start an immediate sweep by default, but that's optional. The GC will run without your intervention and when a process exits memory will be entirely reclaimed.
plutes has joined #ruby
conta has quit [Quit: conta]
fuDwitc has quit [Remote host closed the connection]
<ule> I guess this is an issue with Sidekiq then. Because the memory here keeps growing, start using swap until collapses
<havenwood> ule: If for some reason the GC is disabled, you can trigger a single deferred sweep for the future with: GC.start(immediate_sweep: false)
<ule> And the process/job in the queue is gone
plutes has quit [Max SendQ exceeded]
<havenwood> ule: Is the GC disabled?
plutes has joined #ruby
fuDwitc has joined #ruby
<ule> havenwood: As far as I know it is not. Let me share a newrelic chart:
<ule> As you can see, objects allocations are going down, but memory keeps increasing and never goes down
<havenwood> ule: From a Sidekiq worker, what does `GC.enable` return? It'll return `false` if it's already enabled.
<ule> Let me confirm that
<havenwood> It's probably enabled, but wanted to double check.
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fuDwitc has quit [Ping timeout: 260 seconds]
<havenwood> ule: Just checking out your screenshot, and I do see the GC runnning.
<ule> Agree
<ule> otherwise the objects allocation would still be up
<havenwood> ule: It looks like the memory usage only creeps up after the initial spike (which I presume is the app loading?).
<ule> But then what would be the reason for memory staying up?
<ule> It goes up everey time the job runs
<ule> I noticed that only long running jobs are generating the issue
<ule> for simple ones thar runs < 3 seconds it does nothing on memory
<ule> for those big ones thar runs 5 minutes < 10 minutes.. then the problem happens
<havenwood> ule: Can you share the code of the long-running job that causes the issue?
<havenwood> ule: Looking at the gradual climb, it seems fairly typical for malloc. Can you switch to jemalloc?
<ule> I can't share, but basically it pulls ~20k "user" objects, creates another data structure organizing it, and fires off another worker.
<havenwood> ule: Happy to take a look.
<havenwood> ule: Could you switch allocators to jemalloc?
<havenwood> ule: (Usually you just install jemalloc and add a flag when you recompile Ruby.
<havenwood> )
<havenwood> *install jemalloc with your package manager
<ule> All I know about malloc is from my time with C. When you say to use jemalloc, you're saying to use JRuby for instance?
xco has joined #ruby
<ule> I see, We're using a "regular" ruby here.. 2.6
<havenwood> ule: Nope, nothing JRuby.
<havenwood> ule: When you compile Ruby, it typically dynamically links to a memory allocator. The default for portability reasons is malloc, but jemalloc is widely considered superior for several reasons. While Ruby hasn't swapped the default, it does make it very easy to switch your allocator to the popular jemalloc.
<ule> I see
<havenwood> ule: Jemalloc is the default memory allocator in FreeBSD.
<ule> I'll run some tests for that
<ule> and I know FreeBSD is well known for speed/performance
<ule> might be a good thing indeed
<havenwood> ule: The Fullstaq Ruby default server versions use jemalloc. Here's their explanation of why: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/blob/master/README.md#what-is-jemalloc-and-how-does-it-benefit-me
<havenwood> Fullstaq Ruby might even be a nice option, if you're looking for a package manager style Ruby with jemalloc and a nice default configuration.
<havenwood> It's very well set up.
kashike has quit [Quit: hiss]
<havenwood> ule: I've been really happy with it and use it in dev and production. You get speed benefits in addition to substantially less memory creep.
<havenwood> We use it at work ubiquitously. I see it used widely.
poro has joined #ruby
<havenwood> It pairs very nicely with Ruby.
<ule> Do you know if there is any compiled version for Ruby with jemalloc for env managers like RVM or RBENV?
* havenwood sulks that chruby wasn't mentioned
<ule> lol
<ule> Unfortunately thats my reality here :D
<havenwood> ule: Ruby supports a --with-jemalloc flag, so it's easy to pass that on to RVM, ruby-install, ruby-build, or you can use it directly if you compile yourself.
<havenwood> ule: For example: rvm install ruby-2.7.1 -C --with-jemalloc
<ule> I'll try it out, but to place that in Production here I'm gonna need to test and get some approvals first
<havenwood> ule: (First install jemalloc with your package manager.)
<ule> got it
<ule> havenwood: that might work
<havenwood> ule: ruby-install --latest ruby-2.7 -- --with-jemalloc
<havenwood> ule: :P
<havenwood> chruby \o/
<ule> havenwood: thanks for sharing all this
<havenwood> ule: No prob.
<havenwood> ule: Ubuntu?
<ule> CentOS
<havenwood> ule: The CentOS Fullstaq Ruby really might be a nice option: https://github.com/fullstaq-labs/fullstaq-ruby-server-edition/blob/master/README.md#rhelcentos
<havenwood> ule: Then you can: sudo apt install fullstaq-ruby-2.6-jemalloc
<havenwood> ule: Err
<havenwood> You know what I mean, haha.
<ule> yum
<ule> yeah haha
<havenwood> /s/apt/yum/
<havenwood> ule: The Passenger folk know their stuff around Ruby deployment and packaged this nicely.
ropeney has quit [Quit: ZNC 1.7.4 - https://znc.in]
fuDwitc has joined #ruby
alexherbo2 has joined #ruby
<gitter1234> Hey any recommendations for cool tech to use in a Rails video conferencing app?
fuDwitc has quit [Ping timeout: 246 seconds]
<gitter1234> ule: FreeBSD is fast because it bypasses a lot of important security stuff :/
<gitter1234> i see it's become quite popular now after digitalocean endorsed it. i really wish they'd endorsed openbsd instead
troulouliou_div2 has joined #ruby
ttoocs has quit [Read error: No route to host]
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
drincruz has quit [Read error: Connection reset by peer]
sauvin has quit [Ping timeout: 260 seconds]
drincruz has joined #ruby
<AndreYuhai> Do I not have to precede my instance variables with '@' when calling them inside the class? Didn't know that.
TCZ has joined #ruby
<AndreYuhai> Or when returning them inside a hash to be specific.
TCZ is now known as DoomSlasher2020
DoomSlasher2020 is now known as MoodSlayer2020
MoodSlayer2020 has quit [Quit: Leaving]
<adam12> AndreYuhai: That's a method call.
<AndreYuhai> adam12, ooooooooooh
<adam12> AndreYuhai: It's obviously using @consumer_key but that's hidden away from you if you use the accessors provided by Ruby (attr_??)
<adam12> AndreYuhai: And methods inside a class are all available to each other for calling. No mystery there.
<AndreYuhai> yeah now it makes sense. So it's actually calling the getter.
<AndreYuhai> adam12, thank you.
<adam12> AndreYuhai: Yep, you got it.
cliluw has joined #ruby
plutes has quit [Quit: If you judge me now, you have judge me prematurely.]
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 256 seconds]
<havenwood> AndreYuhai: It's faster to access the instance variable directly, for a simple getter.
<AndreYuhai> havenwood, what would not be a simple getter for example?
<havenwood> AndreYuhai: In that ^ example, all three return the same value, but `@foo` is faster.
<jhass> havenwood: YAGNI very much?
<jhass> let's not confuse newbies like this
<havenwood> jhass: They're reading code, and getting confused by deviation from what they learned.
<jhass> what's performance to do with that?
<havenwood> jhass: I don't think it's harmful to see the common three ways folk get readers.
<jhass> especially YAGNI performance considerations
<havenwood> jhass: Just suggesting one is better than the others, to head of the inevitable "why are there three ways and which should I use."
<jhass> performance is not the only criteria
<havenwood> jhass: I was about to say it's also easier on the reader.
<jhass> that's opinion
<havenwood> everything is
davispuh has joined #ruby
<jhass> there's different styles. a comphrensive discussion on all the pros and cons from all angles might be a bit much
<AndreYuhai> havenwood, Yeap got it, thank you. That's what I've been using so far but when I saw that code I just couldn't think it was actually calling the getter. :D
<jhass> and picking a single fact is equally confusing
<havenwood> I'd suggest using instance variables directly when it works. The simplest thing that works aligning with readability and performance is great.
<havenwood> jhass: It's the single fact that isn't debatable.
<jhass> but it's importance is
<havenwood> It matters when it matters. I thought it was an interesting tidbit to gently guide towards best practices.
<havenwood> YMMV
<jhass> micro performance considerations like this is nothing we should occupy newbie heads with IMO. Heck, its a consideration I would generally avoid outside a performance optimization context, that is improving an identified bottleneck
<jhass> outside that context, it's just YAGNI and taking up valuable headpace
<jhass> *space
<jhass> you can still state your opinion and it'll be respected most likely, but let's not put importance on unimportant things
<havenwood> jhass: I've had it matter plenty of times. A default choice of the fastest, simplest way isn't just YAGNI. I didn't feel like AndreYuhai needed kid gloves, but maybe I was wrong.
<havenwood> AndreYuhai: In any case, great to be reading code!!
ellcs1 has joined #ruby
<havenwood> jhass: When given multiple ways to do it, I always wonder "do they differ in any substantial way?" Not trying to harp on performance, and I could have waited to see if the question was going to be asked.
<havenwood> In this case, the three aren't aliases.
<havenwood> But all three are fairly common.
<AndreYuhai> Though I haven't been fiddling with Ruby long enough to learn stuff about performances, it is a nice tip and I appreciate it. I mean any kind of help gets my appreciation since you answer me and you devote your time.
<AndreYuhai> havenwood, I am actually reading it to write another API wrapper for another website haha. Thought it's best way. :D
prestorium has quit [Ping timeout: 260 seconds]
<havenwood> If you don't try to make it a RuboCop default, are you really grinding your style axe? :P
<havenwood> AndreYuhai: APIs are fun. Seems much more straightforward to me when no DOM/Browser is involved.
ropeney has joined #ruby
<AndreYuhai> havenwood, indeed, I will actually use it to scrape some stuff to use later. So I thought wrapper might serve other people as well.
<AndreYuhai> havenwood, RuboCop on RubyMine is really annoying sometimes underlining most of the code. Probably it's because I didn't do the customization but anyway. :D
DTZUZU_ has quit [Ping timeout: 258 seconds]
<leftylink> the purpose of this question is only because I'm curious. if I want to teach Ruby to others who know a different language, I will have an easier time with aspects of Ruby that are like many other languages. what are the aspects of Ruby that I'd have the most difficult time relating to other languages?
DTZUZU_ has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
prestorium has joined #ruby
leitz has quit [Quit: Leaving]
fuDwitc has joined #ruby
prestorium has quit [Ping timeout: 265 seconds]
mheld has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
fuDwitc_ has joined #ruby
fuDwitc has quit [Ping timeout: 256 seconds]
fuDwitc has joined #ruby
kristian_on_linu has joined #ruby
fuDwitc_ has quit [Ping timeout: 258 seconds]
Xiti` has quit [Quit: Leaving]
schne1der has joined #ruby
tau has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
<poro> /list
jenrzzz has joined #ruby
<poro> sry
Xiti has joined #ruby
duderonomy has quit [Ping timeout: 265 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
cnsvc_ has joined #ruby
SeepingN has quit [Client Quit]
<havenwood> leftylink: It totally depends. If you know the languages Ruby borrows from, not much would be far from grasp.
<havenwood> leftylink: Blocks might be something that folk tend to have not seen before.
cnsvc_ has quit [Ping timeout: 240 seconds]
deathwishdave has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
<jhass> yeah blocks and loops just being method calls
<jhass> symbols aren't exactly common either I'd say
duderonomy has joined #ruby
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
s3nd1v0g1us has joined #ruby
cnsvc_ has joined #ruby
poro has quit [Quit: Leaving]
prestorium has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
giorgian` has quit [Quit: restart]
cnsvc_ has quit [Ping timeout: 240 seconds]
<xco> havenwood didn't you write a tool for temporal storage? i need it
SeepingN has joined #ruby
<havenwood> xco: temporal? say more?
<xco> havenwood local storage on disk
<havenwood> xco: Ah, yeah. I have a gem called "persist" or PStore from the stdlib is fairly useable. :)
<xco> yup. that one
<havenwood> Or YAML::Store in the stdlib.
<xco> thanks <3
bsdband29 has joined #ruby
<AndreYuhai> I can see the method defined Twitter::Rest::Users but I couldn't find how it ends up in Client class.
<xco> thank you
<havenwood> any time
<AndreYuhai> Like include etc.
poro has joined #ruby
bsdbandit-01 has quit [Ping timeout: 256 seconds]
ellcs1 has joined #ruby
<AndreYuhai> havenwood, thanks once again!
<havenwood> AndreYuhai: you're welcome
poro has left #ruby ["Leaving"]
poro has joined #ruby
fuDwitc has quit [Remote host closed the connection]
fuDwitc has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
s3nd1v0g1us has quit [Ping timeout: 272 seconds]
gitter1234 has quit [Quit: Connection closed for inactivity]
<pwnd_nsfw> havenwood, do you get paid to be here? :P
<havenwood> pwnd_nsfw: nope, and the channel didn't give me parental leave either. ¯\_(ツ)_/¯
<havenwood> we need to work on benefits.
<pwnd_nsfw> XD
<pwnd_nsfw> The QoL working for the #ruby irc channel is lacking?
<pwnd_nsfw> is #rubyonrails any better? lol
DaRock has joined #ruby
banisterfiend has joined #ruby
fuDwitc has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
duderonomy has quit [Ping timeout: 264 seconds]
lesha has quit [Read error: Connection reset by peer]
lesha has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lesha has quit [Read error: Connection reset by peer]
lesha has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
drincruz has quit [Ping timeout: 256 seconds]
bsdbandit-01 has joined #ruby
troulouliou_dev has joined #ruby
duderonomy has joined #ruby
bsdband29 has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
dvarrui has joined #ruby
dvarrui has quit [Remote host closed the connection]
kristian_on_linu has quit [Remote host closed the connection]
duderonomy has quit [Ping timeout: 272 seconds]
schne1der has quit [Ping timeout: 246 seconds]
drincruz has joined #ruby
prestorium has quit [Quit: prestorium]
cnsvc_ has joined #ruby
duderonomy has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection timed out]
ur5us has joined #ruby
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
xco has joined #ruby
<xco> havenwood there was a technique you use once to factorise something like this https://gist.github.com/xcobar/82526a7dacda0161ee5d5a773ea0ddd5 i forgot
<xco> it involved doing away with the << shoving
<xco> remember?
smccarthy has joined #ruby
<smccarthy> I found bundler/inline yesterday. I tried using it in AWS Lambda, but even after changing ENV['BUNDLE_PATH'], ENV['BUNDLE_USER_HOME'], and ENV['GEM_HOME'] to a directory in /tmp, I still get "You don't have write permissions for the /var/runtime directory." I even tried Dir.chdir "/tmp/" , and it still tries to write to /var/runtime (which isn't writable in AWS Lambda). Any ideas ?
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
nofxx has joined #ruby