havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.3, 2.4.5, 2.3.8, 2.6.0-preview3: 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!
Freshnuts has quit [Quit: Leaving]
jaddison has joined #ruby
Puffball has quit [Remote host closed the connection]
gix has quit [Ping timeout: 268 seconds]
jaddison has quit [Quit: jaddison]
hutch has quit [Ping timeout: 244 seconds]
arescorpio has joined #ruby
arescorpio has quit [Max SendQ exceeded]
dbz has joined #ruby
dbz has quit [Ping timeout: 246 seconds]
white_lilies has joined #ruby
riotjones has joined #ruby
jaddison has joined #ruby
bak1an has quit [Quit: Textual IRC Client: www.textualapp.com]
Puffball has joined #ruby
arescorpio has joined #ruby
hutch has joined #ruby
jaddison has quit [Quit: jaddison]
white_lilies has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
themsay has quit [Ping timeout: 246 seconds]
themsay has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
Arkantos has joined #ruby
blackmesa has quit [Quit: WeeChat 2.3]
bambanx has joined #ruby
darkhanb has joined #ruby
darkhanb has quit [Quit: Textual IRC Client: www.textualapp.com]
ua has quit [Ping timeout: 252 seconds]
Tom-_ has joined #ruby
ua has joined #ruby
patr0clus has joined #ruby
jottr has joined #ruby
phaul has quit [Quit: bye]
\void has joined #ruby
phaul has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
paulscoder has quit [Quit: paulscoder]
matti has joined #ruby
patr0clus has quit [Quit: WeeChat 2.2]
arescorpio has quit [Read error: No route to host]
ua has quit [Ping timeout: 268 seconds]
AJA4350 has quit [Quit: AJA4350]
ua has joined #ruby
white_lilies has joined #ruby
vikaton has quit [Quit: Connection closed for inactivity]
woodruffw has quit [Quit: And then he took off.]
woodruffw has joined #ruby
hutch has quit [Ping timeout: 250 seconds]
thi has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
esrse has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
hutch has joined #ruby
tdy has joined #ruby
bambanxx has joined #ruby
akaiiro has joined #ruby
white_lilies has quit [Ping timeout: 250 seconds]
cnsvc has joined #ruby
bambanx has quit [Ping timeout: 272 seconds]
dionysus69 has quit [Read error: Connection reset by peer]
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
hutch has quit [Ping timeout: 250 seconds]
StarLord__ has joined #ruby
bambanxx has quit [Ping timeout: 272 seconds]
StarLord__ has quit [Ping timeout: 244 seconds]
hutch has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
Arkantos has quit [Quit: Textual IRC Client: www.textualapp.com]
riotjones has quit [Remote host closed the connection]
phaul has quit [Ping timeout: 240 seconds]
riotjones has joined #ruby
riotjones has quit [Ping timeout: 244 seconds]
akaiiro has quit [Ping timeout: 250 seconds]
cnsvc has quit [Ping timeout: 256 seconds]
awkwords has joined #ruby
riotjones has joined #ruby
riotjones has quit [Ping timeout: 245 seconds]
braincrash has quit [Quit: bye bye]
cnsvc has joined #ruby
hutch has quit [Ping timeout: 268 seconds]
braincrash has joined #ruby
white_lilies has joined #ruby
peirama has quit [Remote host closed the connection]
peirama has joined #ruby
hutch has joined #ruby
peirama has quit [Ping timeout: 268 seconds]
peirama has joined #ruby
awkwords has quit [Ping timeout: 245 seconds]
peirama has quit [Ping timeout: 250 seconds]
awkwords has joined #ruby
Ring0` has joined #ruby
akaiiro has joined #ruby
<Ring0`> How do I write a map(or something else) so that I preserve result from previous iteration over a new one? Eg [+1, +2, +3] => [1, 3, 6]
peirama has joined #ruby
<Ring0`> so like [1,2,3].map { |n| previous_num_but_initially_0 + n }
peirama has quit [Ping timeout: 246 seconds]
peirama has joined #ruby
za1b1tsu has joined #ruby
peirama has quit [Ping timeout: 250 seconds]
mangold has quit [Ping timeout: 252 seconds]
riotjones has joined #ruby
peirama has joined #ruby
ur5us has quit [Remote host closed the connection]
riotjoe has joined #ruby
riotjones has quit [Ping timeout: 245 seconds]
peirama has quit [Ping timeout: 245 seconds]
riotjoe has quit [Ping timeout: 250 seconds]
tectonic has joined #ruby
peirama has joined #ruby
cd has quit [Quit: cd]
<Iambchop> Ring0`: > n=0; [1,2,3].map{|a| n+=a} => [1, 3, 6]
<Iambchop> Ring0`: > [1,2,3].each_with_object([0]).map{|a,n| n[0]+=a} #=> [1, 3, 6]
peirama has quit [Ping timeout: 240 seconds]
Tom-_ has left #ruby ["Leaving"]
Tom-_ has joined #ruby
peirama has joined #ruby
peirama has quit [Remote host closed the connection]
peirama has joined #ruby
jottr has joined #ruby
peirama has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 240 seconds]
<Iambchop> one more before bed> [1,2,3].inject([0]){|a,b| a<<b+a[-1]}[1..-1] # => [1, 3, 6]
<Iambchop> > [1,2,3].inject([]){|a,b| a<<b+a[-1].to_i} #=> [1, 3, 6]
tectonic has quit []
<baweaver> Ring0`: Advent of code?
awkwords has quit [Ping timeout: 250 seconds]
hutch has quit [Ping timeout: 250 seconds]
<baweaver> Probably reduce
* desnudopenguino winks at baweaver
awkwords has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* baweaver trips over tachyons
<baweaver> Ah, the next story is posting later this week!
conta has joined #ruby
<baweaver> desnudopenguino: the lemurs are going to save Christmas!
<desnudopenguino> !!!
<KrzaQ> if I want a jit here and now, what are my options, if any? Googling ruby with jit now only gives me 2.6 results
ByronJohnson has quit [Ping timeout: 252 seconds]
malen has joined #ruby
ByronJohnson has joined #ruby
<desnudopenguino> baweaver: oh snap, you're using the plum keyset as well?
<baweaver> On my 60%, yes.
<baweaver> Stock MD Ctrl on the other one, like the feel of them.
<baweaver> Box Dark Yellows
brandonkal has quit [Quit: Textual IRC Client: www.textualapp.com]
tdy has quit [Ping timeout: 250 seconds]
<desnudopenguino> nice!
malen has quit [Ping timeout: 245 seconds]
malen has joined #ruby
APK is now known as AKPWD
jetchisel has quit [Ping timeout: 268 seconds]
awkwords has quit [Quit: sleepy time]
white_lilies has quit [Ping timeout: 252 seconds]
aupadhye has joined #ruby
jcarl43 has joined #ruby
reber has joined #ruby
reber has quit [Remote host closed the connection]
white_lilies has joined #ruby
conta1 has joined #ruby
conta1 has quit [Client Quit]
conta1 has joined #ruby
conta1 has quit [Client Quit]
kapil____ has quit [Quit: Connection closed for inactivity]
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
ogres has joined #ruby
conta has quit [Ping timeout: 250 seconds]
white_lilies has quit [Ping timeout: 244 seconds]
akaiiro has quit [Remote host closed the connection]
peirama has joined #ruby
dbz has joined #ruby
dionysus69 has joined #ruby
<Ring0`> baweaver: haha how did you know :^)
nolanv has quit [Ping timeout: 272 seconds]
<Ring0`> damn I've been cuckd
<baweaver> Sounded familiar.
<Ring0`> now I can't ask questions on how to make my code even more unreadible
jottr has joined #ruby
nolanv has joined #ruby
dedRabbit has joined #ruby
<dedRabbit> Hello
jottr has quit [Ping timeout: 250 seconds]
dbz has quit [Ping timeout: 250 seconds]
<dedRabbit> l
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 240 seconds]
riotjones has joined #ruby
Inline has quit [Quit: Leaving]
<dedRabbit> cat: /a/: No such file or directory
dedRabbit has quit [Quit: WeeChat 1.9.1]
dedRabbit has joined #ruby
riotjones has quit [Ping timeout: 252 seconds]
conta has joined #ruby
dbz has joined #ruby
dedRabbit has quit [Quit: WeeChat 1.9.1]
dedRabbit has joined #ruby
bmurt has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
dedRabbit has quit [Client Quit]
bmurt has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
Skarlso has quit [Remote host closed the connection]
sleetdrop has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
kapil____ has joined #ruby
CrazyEddy has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
clemens3 has joined #ruby
DTZUZO has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
dbz has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
keden has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
lucasb_ has joined #ruby
vondruch has joined #ruby
lucasb_ is now known as lucasb
dbz has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 250 seconds]
cabotto has joined #ruby
aufi has joined #ruby
aupadhye has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
riotjones has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
jottr has joined #ruby
riotjones has quit [Ping timeout: 272 seconds]
Guest21835 has joined #ruby
awkwords has joined #ruby
bhaak has quit [Ping timeout: 268 seconds]
jnoon has quit [Quit: Leaving.]
aupadhye has quit [Ping timeout: 268 seconds]
riotjones has joined #ruby
cnsvc has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
LinuxKnight has quit [Remote host closed the connection]
LinuxKnight has joined #ruby
aupadhye has joined #ruby
cabotto has quit []
phaul has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Remote host closed the connection]
alem0lars has joined #ruby
themsay has quit [Ping timeout: 240 seconds]
themsay has joined #ruby
endemic has quit [Ping timeout: 252 seconds]
cnsvc has quit [Ping timeout: 256 seconds]
endemic has joined #ruby
cnsvc has joined #ruby
Guest21835 is now known as sameerynho
sameerynho is now known as Guest57479
Guest57479 has quit [Quit: WeeChat 2.3]
lxsameer has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
alem0lars has quit [Ping timeout: 250 seconds]
piks3l has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ruby
alxd has joined #ruby
<alxd> Hey! I'm quite an experienced Pythonista / JS dev and I'd like to learn Ruby and Ruby on Rails to contribute to Mastodon. Can you recommend any sources? Learn Ruby The Hard Way? Codecademy? How much should I focus on pure Ruby, how much on Rails?
alem0lars has joined #ruby
jetchisel has joined #ruby
fluxAeon has joined #ruby
roshanavand has joined #ruby
sarink has joined #ruby
x0f_ has quit [Quit: quit]
x0f has joined #ruby
jetchisel has quit [Ping timeout: 250 seconds]
sarink has quit [Ping timeout: 246 seconds]
jetchisel has joined #ruby
riotjones has quit [Quit: Leaving...]
cnsvc has joined #ruby
c0mrad3 has joined #ruby
blackmesa has joined #ruby
paulscoder has joined #ruby
blackmesa1 has joined #ruby
mangold has joined #ruby
esrse has quit [Ping timeout: 268 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
endemic has quit [Ping timeout: 268 seconds]
y0u has quit [Ping timeout: 268 seconds]
mangold has quit [Read error: Connection reset by peer]
endemic has joined #ruby
y0u has joined #ruby
blackmesa1 has quit [Ping timeout: 268 seconds]
KeyJoo has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
rkoller has joined #ruby
rkoller has quit [Client Quit]
unreal has quit [Ping timeout: 246 seconds]
agent_white has quit [Remote host closed the connection]
cnsvc has joined #ruby
alem0lars has quit [Ping timeout: 250 seconds]
conta has quit [Ping timeout: 272 seconds]
conta has joined #ruby
conta has quit [Ping timeout: 250 seconds]
aupadhye has quit [Quit: Leaving]
yadunut has joined #ruby
cgajardo has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
paulscoder has quit [Quit: paulscoder]
DTZUZO has joined #ruby
yadunut has quit [Quit: Textual IRC Client: www.textualapp.com]
jcalla has quit [Ping timeout: 244 seconds]
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 250 seconds]
vondruch_ is now known as vondruch
AJA4350 has joined #ruby
mangold has joined #ruby
conta1 has joined #ruby
cnsvc has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
alem0lars has joined #ruby
akem has joined #ruby
mostlybadfly has joined #ruby
loveablelobster has joined #ruby
loveablelobster has quit [Client Quit]
loveablelobster has joined #ruby
awkwords has quit [Quit: sleepy time]
alem0lars has quit [Ping timeout: 246 seconds]
eclm has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
peirama has quit [Remote host closed the connection]
peirama has joined #ruby
loveablelobster has left #ruby ["Textual IRC Client: www.textualapp.com"]
bobdobbs has quit [Read error: Connection reset by peer]
jcalla has joined #ruby
vonfry has joined #ruby
vonfry has quit [Client Quit]
cabotto has joined #ruby
phaul has quit [Quit: bye]
orbyt_ has joined #ruby
polishdub has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
mangold has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
hutch has joined #ruby
orbyt_ has quit [Ping timeout: 246 seconds]
white_lilies has joined #ruby
SeepingN has joined #ruby
Rapture has joined #ruby
mangold has joined #ruby
cgajardo has quit [Quit: WeeChat 1.9.1]
lxsameer has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
crankharder has joined #ruby
white_lilies has quit [Ping timeout: 268 seconds]
jeffreylevesque has joined #ruby
phaul has joined #ruby
cabotto has quit []
mangold has quit [Ping timeout: 252 seconds]
cschneid has quit [Read error: Connection reset by peer]
<piks3l> Hey alxd ! If you already know Django, RoR shouldn't be too hard. The structure is a bit different but it's still an MVC. If you're really new to Ruby syntax, I'd say Codecademy is nice to start. As you already know some languages, I'd say it's to familiarize yourself with the syntax
cnsvc has joined #ruby
<piks3l> Also Mastodon is using React which, to me, is still confusing
<piks3l> if you have questions about RoR, ping me :)
<piks3l> I'm not senior, but I can help
<alxd> piks3l, I'm fluent in React and Redux (some Haskell), so I've already scored some easy hits there
<piks3l> Oh cool !
<alxd> I'm learning how to sanitize HTML in HAML now :D
<piks3l> that sounds awesome !
c0mrad3 has quit [Quit: Connection closed for inactivity]
kapil____ has quit [Quit: Connection closed for inactivity]
gnufied has joined #ruby
<piks3l> alxd if you find good documentation on how to connect React/Redux to RoR, I'm interested :p
hutch has quit [Ping timeout: 250 seconds]
<alxd> piks3l, I'm kind of an expert on React, so I may help ;)
hutch has joined #ruby
<alxd> What do you mean by connect?
<piks3l> Well, i'd like to have a backend in RoR and front in React
<piks3l> but I'm failing at finding good documentation on that
<alxd> That's pretty general. Do you want a Single Page App?
<alxd> Do you want something isomorphic?
<alxd> The easiest thing would be to write RoR with REST / graphQL API and have a React app get data from there, unaware if it's RoR, Django or some Java app
<piks3l> No, not a single page app, something more complex. The default front for RoR (ERB) doesn't translate well on mobile and I'm looking at solution on that
<piks3l> Yeah exactly that
<alxd> piks3l, mobile has nothing to do with RoR, it's CSS only ;)
<alxd> unless you want React Native to have mobile /apps/
<piks3l> yes, React Native :)
<piks3l> Sorry if I'm not clear ahah
<alxd> Ah. So just use React Native with REST / GraphQL, nothing more
<alxd> Do you know how to make your API in RoR?
<piks3l> Yes
<piks3l> Ok then
<phaul> I don't think you can easily connect the RoR REST to graphql.
<alxd> So if you want to make Android / iOS apps, you just use React Native and query the endpoints from your Rails
<piks3l> coooool !
<piks3l> thanks !
<phaul> I just did an small example app with Sinatra/graphql/react. My impression is that graphql-rub sits at the middleware level
<alxd> I used one in a production app and I have to say: if you write both frontend and backend, stay with REST
<alxd> graphQL is great if you cannot make backend changes too often, but for me it was cumbersome
<phaul> but it sort of makes Rails pointless for it.
<phaul> if you are interested https://github.com/phaul/books. Simplest example app..
<phaul> but no Rails.
<piks3l> mmh
<alxd> well, something needs to manage credentials
<alxd> I don't know if Rails is the right tool, but with Django being comparable I would use Django just to manage APIs, with nothing to render client-side
<piks3l> Everytime I use Sinatra, I tend to plan for no scaling because it becomes really painful from there
<piks3l> I see
Inline has joined #ruby
polishdub has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 2.3]
AJA4350 has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
jeffreylevesque has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
vondruch has joined #ruby
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
spiette has quit [Quit: ZNC 1.7.1 - https://znc.in]
kapil____ has joined #ruby
bmurt has joined #ruby
bmurt has quit [Client Quit]
spiette has joined #ruby
bmurt has joined #ruby
<phaul> alxd: is Django primarily REST? if so in Django don't you end up implementing 2 APIs one REST one graphql? Or are there ways to share code between them? And if so can you for instance share per resource authorization?
<alxd> phaul, Django uses rest with Django-Rest-Framework
rippa has joined #ruby
<alxd> you can just install Graphene /instead/ of DRF
<alxd> if nothing changed in the latest versions, I don't recall Django _needing_ to have REST
<alxd> As I said, I use Django mainly for the ease of authentication and administration in my project. It doesn't scale perfectly, but it's modular when it comes to APIs
roshanavand has joined #ruby
vondruch has quit [Remote host closed the connection]
kaleido has quit [Ping timeout: 250 seconds]
piks3l has quit [Quit: piks3l]
_phaul has joined #ruby
kaleido has joined #ruby
phaul has quit [Read error: Connection reset by peer]
_phaul is now known as phaul
vondruch has joined #ruby
Fridtjof has quit [Ping timeout: 250 seconds]
pistachio has quit [Ping timeout: 250 seconds]
lightstalker has quit [Remote host closed the connection]
Fridtjof has joined #ruby
pistachio has joined #ruby
lightstalker has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> so for instance in Rails I handled authorization with CanCanCan (disclaimer: I haven't used rails for a while now) https://github.com/CanCanCommunity/cancancan If you look at the Readme you will see how the whole thing is entangled in REST controller ideas.. But I guess you can define an endpoint to graphql, and when graphql-ruby calls out to the DB layer you can insert a manual if can? :update, resource ... or
<phaul> similar and raise Exceptions when needed
conta1 has quit [Ping timeout: 268 seconds]
<phaul> but to me it feels you just mostly need active_record (the ORM layer from Rails).
bak1an has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
akaiiro has joined #ruby
roshanavand has quit [Quit: Gone planting!]
roshanavand has joined #ruby
Renich_ has joined #ruby
Renich has quit [Ping timeout: 240 seconds]
Renich_ is now known as Renich
sarink has joined #ruby
RougeR has joined #ruby
<RougeR> heya, does anyone know how you might add self from a class method while doing something with the class
<RougeR> i know thats horribly explained
<RougeR> but im dealing with a code base where i THINK something like that might be happening. but i cant find where
sarink has quit [Ping timeout: 252 seconds]
<phaul> RougeR: maybe a small example snippet that demonstrates what you mean
<RougeR> phaul, honestly im not sure how this works. ill try explain it though
<RougeR> so im using resque and redis as a taskengine
<RougeR> except we have our own custom tasks which can be put into json workflows and chained together
<RougeR> standard resque tasks rely on the self.perform to be processed first
<RougeR> our resque tasks just have perform instead of self.perform
<RougeR> resque-retry does not seem to want to play game with our custom task classes, but works fine with regular resque classes
<RougeR> my guess is there is something missing between the two
<RougeR> and upon retry its not recognized as a valid resque class maybe?
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
uplime has joined #ruby
lunarkitty7 has quit [Ping timeout: 268 seconds]
<phaul> Stab in the dark as I dont know these libs: but ... the environment expects an object that respond_to(:perform). If it's a class and :perform is a method of the class so be it. If it's your custom object, that could be fine too, but you need to instantiate it? Like instead of using Myclass (standard case), you have to give the environment Myclass.new (special case)?
<RougeR> heya phaul yes you are right, but i dont have control of this lib
<RougeR> ive also found out where its calling .perform
<RougeR> but i dont know how to fix my issue
<RougeR> im loathe to share application code from qork
<RougeR> work*
<RougeR> but simply
<RougeR> klass = Object::const_get(@task.class_name).new(@task.input)
<RougeR> @task.output = klass.perform
<RougeR> is whats being done
<RougeR> ive no clue of the solution yet
<phaul> sure, don't get into trouble :) can you paste the error message though?
sarink has joined #ruby
<RougeR> phaul, no error
<RougeR> :l
<RougeR> it just doesnt get retried
cnsvc has joined #ruby
<phaul> ah. thats a bummer :)
<RougeR> i need to somehow turn the perform method into a class method while its being retried?
<RougeR> i think
<RougeR> i dont think anyone left at my company fully understands how the scheduling/task engine part works
<RougeR> or else they would have told me this would be an issue last week
uplime is now known as nchambers
<phaul> where can you add behaviour, what code can you modify in this flow? I can help with turning an instance method into class method if that helps ?
<RougeR> so a task gets loaded by a worker
<RougeR> and during that process. quite a few complex ruby bits are done
<RougeR> and yeah that might help
<RougeR> it might be a case of i want to use it as a class method if it has failed once
<RougeR> so that would be helpful to know
<phaul> so assuming that the instance method does not need any state from the instance and does not refer to self :) it's just a bit of metaprogramming. I write up an example. Otherwise if those things are not true, it's not even possible
<RougeR> im honestyly, not quite sure
<RougeR> i dont think it does
<RougeR> it is metaprogramming just about
lunarkitty7 has joined #ruby
<RougeR> tbh im just glad i spotted where the issue was today, i could have gone round for hours more trying to find it
<RougeR> its this line here
<RougeR> @task.output = klass.perform
AJA4350 has joined #ruby
<RougeR> klass = Object::const_get(@task.class_name).new(@task.input)
<RougeR> Object.send(:remove_const, @task.class_name.to_sym) if klass
roshanavand has quit [Read error: Connection reset by peer]
<RougeR> between that is 6 line of setup/logging etc
<RougeR> and config
<RougeR> why would you want to remove the constant from the class
<phaul> RougeR: I don't know... but https://gist.github.com/83b4d24290271069a0364f8ef10a4875 demonstrates how one can hack a method into a class that's based on an instance method
ua has quit [Ping timeout: 246 seconds]
<phaul> (argument passing not included, but could be done)
nchambers has quit [Remote host closed the connection]
<RougeR> thanks phaul
<RougeR> phaul, how would you do that if the classes were called dynamically
<RougeR> wait i think i see how
cd has joined #ruby
tdy has joined #ruby
peirama has quit [Ping timeout: 244 seconds]
ua has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
peirama has joined #ruby
cthulchu_ has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
gix has joined #ruby
aufi has quit [Ping timeout: 252 seconds]
jaddison has joined #ruby
<phaul> apart from that this "works" it will give redefinition of method foo erros on multiple calls of boo, and even worse it will leak memory as the instances that received :boo can't be freed _ever_ while the process running.
peirama has quit [Ping timeout: 250 seconds]
<phaul> it's a hack..
<RougeR> phaul, it feels like trying to unravel spaghetti
peirama has joined #ruby
<phaul> yeah. I agree. maybe the best is to wait for the authors, if that's an option
<RougeR> they are long gone, however got 2 senior devs back wednesday
<RougeR> they know ther stuff way better than me, but their ruby knowledge is only about on par with me
<RougeR> phaul, i duno its progress. I now think i know where the issue is.
peirama has quit [Remote host closed the connection]
<RougeR> before it was just a mystery with no errors
peirama has joined #ruby
gix has quit [Ping timeout: 250 seconds]
keden has quit [Quit: WeeChat 2.3]
<RougeR> phaul,
<RougeR> im not being daft here am i
<RougeR> klass = Object::const_get(@task.class_name).new(@task.input)
<RougeR> @task.output = klass.perform
<RougeR> is that just calling the peform method and assigning the result to output?
<RougeR> but its actually MyClass.perform
lxsameer has quit [Ping timeout: 250 seconds]
<phaul> that's what it does, but it get stuff out of @task. @task.class_name, @task.input, etc
<RougeR> instead of MyClass.new.perform
<phaul> like @task might be an openstruct, and if you fill class_name with MyClass then yes.
<RougeR> so it takes an instance of that task (i.e @task = MyClass.new)
<RougeR> @task is a class
<RougeR> yeah thats gotta be how it works
<RougeR> it just sorta clicked, no idea how to fix it
<phaul> &>> Integer.class_name
<rubydoc> # => undefined method `class_name' for Integer:Class (NoMethodError) (https://carc.in/#/r/5om2)
<phaul> &>> 1.class_name
<rubydoc> # => undefined method `class_name' for 1:Integer (NoMethodError) (https://carc.in/#/r/5om3)
<RougeR> hmm
<RougeR> so complicated...
sarink has quit [Remote host closed the connection]
<phaul> can you print @task.inspect ? @task.class ?
<RougeR> i know what they are
<RougeR> hang on ill show ya
<RougeR> ive got an internal mock task
nowhere_man has quit [Ping timeout: 252 seconds]
sarink has joined #ruby
<RougeR> phaul,
conta1 has joined #ruby
<RougeR> this is one of our custom tasks
<RougeR> and this is a standard task
sarink has quit [Ping timeout: 246 seconds]
<phaul> so what's @task? @task == MockTask ? and .class_name is inherited from CustomTask? or where is it coming from?
<RougeR> @task is an active record relation
<RougeR> with a load of information about the task
<RougeR> then klass becomes an instance of @task
<RougeR> explaining that to you made it clearer to me actually
<RougeR> CustomTask is a load of logic for chaining tasks and varies other things
<RougeR> why the feck is this line here
<phaul> well, rubber-duck debug ... sorry for otherwise not being much help, obiously you have code you can't disclose, and Im just speculating a lot ..
<RougeR> phaul, yeah im really sorry. i know its annoying trying to discuss it without the code
<RougeR> Object.send(:remove_const, @task.class_name.to_sym) if klass
<RougeR> still dont get the point in that line
<RougeR> phaul, its quite a complex custom job scheduling engine
<RougeR> and no one put any comments anywhere
<RougeR> because "ruby code should be self documenting"...and other myths
<baweaver> Mind that's not Ruby
<baweaver> That's just lazy programmers
<RougeR> yeah, i dont know
<RougeR> im a jr dev, i dont get much say
<RougeR> i much prefer to have a small amount of comments in key complex areas
<baweaver> We have YARDoc and other things for a reason
<RougeR> baweaver, is that a documentation/comment maintinence thing?
<RougeR> .g YARDoc
<RougeR> ahhh ive seen it before
<RougeR> nice
<baweaver> We're about to implement policy here that a PR without requisite YARDoc breaks CI
<RougeR> mm i like that
<RougeR> noice
<baweaver> (fair warning havenwood ^)
<baweaver> :P
<RougeR> baweaver, yeah i have had a 'fun' first job for a new dev
<RougeR> custom sinatra clusterfuck of a project
<baweaver> Here's a secret
<baweaver> Everything's hacky
* RougeR cries
<baweaver> You just get good at managing the chaos
<RougeR> yeah, its got easier
bmurt has joined #ruby
<RougeR> im past my probation, so cant be doing too bad haha
<baweaver> You probably just have a jobs framework that tries to be smart about dispatching actions
<RougeR> we do
<RougeR> we use resque
<baweaver> Want some fun Ruby magic shenanigans?
<RougeR> but weve added workflow functionality and our own system on top
<baweaver> well, I say magic, but reduce is pretty useful
<RougeR> reduce is pretty good
<RougeR> not used it in a while
<baweaver> Did an entire talk on it: https://www.youtube.com/watch?v=x3b9KlzjJNM&t=1s
<baweaver> and illustrated it with cartoon lemurs
<RougeR> is it the same as inject?
<RougeR> i forget
<baweaver> alias, so yeah
<RougeR> yeah, i know it more as inject. just what i learnt
awkwords has joined #ruby
<RougeR> even (1..10).inject(:+) is quite nice
<baweaver> did you know that every other Enumerable function can be implemented in terms of reduce?
<RougeR> i did not
<baweaver> Now we have (1..10).sum in 2.4+
<RougeR> but i will add the talk you linked
<baweaver> you'll enjoy that talk then
<RougeR> thanks :)
<RougeR> ill check it our tommorow, just finishing up for the day. will ping you my thoughts :)
<baweaver> Also most of the medium articles over on medium.com/@baweaver go over Ruby topics in a decent amount of depth
<baweaver> Lemme know if you'd like to see a topic covered.
<RougeR> im still a bit shit with yielf
<RougeR> yield
<RougeR> i know how it works, but i can never see when to use it
<RougeR> and i never see it used in other PRs
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<al2o3-cr> i see alot of ["1\n", "2\n", "3\n"].map(&:to_i).sum when you can do ["1\n", "2\n", "3\n"].sum &:to_i
<RougeR> you just removed the brackets right?
reber has joined #ruby
reber__ has joined #ruby
<RougeR> im personally not a fan of removing brackets in ruby unless its a DSL
<al2o3-cr> RougeR: i didn't use map.
<RougeR> no?
<al2o3-cr> sum takes a block.
maryo has joined #ruby
<RougeR> oh sorry i see the difference now
<al2o3-cr> no worries.
<RougeR> yeah the second way is nice, well spotted
<RougeR> if you add brackets!
<RougeR> curious what people here think about over usage of ternary and when it should be used.
<al2o3-cr> choose what suits you, i do =)
<RougeR> al2o3-cr, yeah i do, or i follow the coding style for the project
jottr has quit [Ping timeout: 272 seconds]
<RougeR> i just dislike omitting brackets/braces/terminations n general
<RougeR> looking at you python...
reber has quit [Client Quit]
<al2o3-cr> RougeR: yeah, stick to a style you like/follow.
patr0clus has joined #ruby
eckhardt_ has joined #ruby
<baweaver> al2o3-cr: lines.sum(&:to_i) :D
<baweaver> Sum takes a block function, which is super cheating
nicesignal has quit [Remote host closed the connection]
<baweaver> Ah
<baweaver> right
<baweaver> You said that. Ignore me
nicesignal has joined #ruby
<RougeR> :P
* baweaver needs coffee
cow[moo] has joined #ruby
<baweaver> Keep an eye on this for more RubyConf talks to watch - https://twitter.com/keystonelemur/status/1069650750979039232
<baweaver> brb
<RougeR> ty
<RougeR> catchya later
orbyt_ has joined #ruby
\void has joined #ruby
cow[moo] has quit [Ping timeout: 250 seconds]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
cow[moo] has joined #ruby
dbz has joined #ruby
GodFather has joined #ruby
za1b1tsu has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
za1b1tsu has quit [Client Quit]
za1b1tsu has joined #ruby
sanscoeur has joined #ruby
clemens3 has joined #ruby
chouhoulis has joined #ruby
hiroaki has joined #ruby
jottr has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
dellavg_ has joined #ruby
lxsameer has joined #ruby
RougeR has quit [Ping timeout: 244 seconds]
patr0clus has quit [Quit: WeeChat 2.2]
jottr has quit [Ping timeout: 250 seconds]
sarink has joined #ruby
Aqo has joined #ruby
maryo has quit [Ping timeout: 268 seconds]
sarink has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 246 seconds]
ivanskie has joined #ruby
akaiiro has quit [Remote host closed the connection]
Eiam has joined #ruby
akaiiro has joined #ruby
conta1 has quit [Remote host closed the connection]
kent\n has quit [Ping timeout: 268 seconds]
conta1 has joined #ruby
kent\n has joined #ruby
piks3l has joined #ruby
jaddison has quit [Quit: jaddison]
clemens3 has quit [Remote host closed the connection]
za1b1tsu has quit [Quit: Leaving]
reber has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
reber__ has quit [Ping timeout: 246 seconds]
SeepingN has quit [Ping timeout: 246 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
Nicmavr has joined #ruby
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
patr0clus has joined #ruby
za1b1tsu has joined #ruby
C-o has quit [Quit: ZNC - http://znc.in]
jarlopez has joined #ruby
jarlopez has left #ruby [#ruby]
Renich_ has joined #ruby
Renich has quit [Ping timeout: 252 seconds]
Renich_ is now known as Renich
hutch has quit [Ping timeout: 250 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has joined #ruby
patr0clus has quit [Ping timeout: 268 seconds]
blackswan has joined #ruby
<blackswan> use Inline 'Ruby' => 'require "rails"'; yields #<ArgumentError: unknown encoding name: binary> while trying to load a ruby file with coding: binary
<blackswan> (in perl)
Dbugger has joined #ruby
bmurt has joined #ruby
jottr has joined #ruby
SeepingN has joined #ruby
jsral has joined #ruby
cschneid_ has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
SeepingN has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Ping timeout: 272 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
alxd has quit [Excess Flood]
alxd has joined #ruby
ivanskie has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r3m has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r3m is now known as C-o
hutch has quit [Ping timeout: 246 seconds]
spiette has quit [Quit: ZNC 1.7.1 - https://znc.in]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
hiroaki has quit [Ping timeout: 246 seconds]
spiette has joined #ruby
conta1 has quit [Quit: conta1]
orbyt_ has joined #ruby
jaddison has joined #ruby
RougeR has quit [Read error: Connection reset by peer]
jaddison has quit [Client Quit]
RougeR has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
orbyt_ has joined #ruby
Dreamer3_ has joined #ruby
Dbugger has quit [Ping timeout: 268 seconds]
<blackswan> anybody around familiar with ruby internals?
dellavg_ has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
cow[moo] has joined #ruby
nchambers has joined #ruby
jaddison has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
KeyJoo has quit [Ping timeout: 272 seconds]
reber has quit [Remote host closed the connection]
kurra has joined #ruby
jaddison has quit [Quit: jaddison]
sanscoeu_ has joined #ruby
<peirama> is tk still a thing?
Lewis has joined #ruby
sanscoeu_ has quit [Remote host closed the connection]
<Lewis> hi
sanscoeur has quit [Ping timeout: 268 seconds]
<nchambers> peirama: the tld?
<Lewis> whats the diff between non deterministic vs deterministic date?
<nchambers> do you mean data?
<Lewis> date
<Lewis> calendar date
graphene has quit [Remote host closed the connection]
<peirama> nchambers: https://github.com/ruby/tk
<nchambers> ah, wrong on 2 counts
<nchambers> tcl was my next guess though :}
<peirama> for UI interfaces in ruby... not sure if there is something better.
graphene has joined #ruby
Yxhuvud has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ausmat has joined #ruby
masterasia has joined #ruby
<masterasia> Hi
<masterasia> I'm trying to decrypt something but it is telling me that the key must be 32 byte
<masterasia> thoughts?
orbyt_ has joined #ruby
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
<SeepingN_> supply the correct 32 byte key
tectonic has joined #ruby
<knight33> I'm checking for pending tasks in a small ruby app of mine. The amount gets put into a string like so -> "Count: " + tasks.count.to_s, however I run into a small bug when there are none, since I guess it's nil.to_s. Should I check if it > 0? or not nil? or false?
Rapture has joined #ruby
<nchambers> do you control the data that is in tasks.count?
brandonkal has joined #ruby
<nchambers> if so, you can set it to 0 instead of nil
<nchambers> or alternatively, override to_s for the tasks class, and do the logic in there
bak1an has joined #ruby
<ausmat> Anyone here using `dry-validation` in prod? I’d like to hear some gotchas with any, and best practices
Puffball has quit [Remote host closed the connection]
<knight33> Control the data? I mean, I don't put tasks in there, just checking for them.
peirama has left #ruby ["ERC (IRC client for Emacs 26.1)"]
Puffball has joined #ruby
<knight33> I see NilClass.to_s gives me an empty string, but I guess it's the count that throws it off
phaul has quit [Ping timeout: 252 seconds]
Puffball has quit [Read error: Connection reset by peer]
hutch has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaddison has joined #ruby
jaddison has quit [Client Quit]
jsral has quit [Quit: leaving]
jaddison has joined #ruby
cow[moo] has joined #ruby
cow[moo] has quit [Client Quit]
<blackswan> now i'm getting #<TypeError: no implicit conversion of NoMethodError into String> when i do use Inline 'Ruby' => 'require "rails"';
<blackswan> i don't even know what's printing this, perl or ruby
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 245 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
GodFather has quit [Ping timeout: 250 seconds]
cschneid has quit [Ping timeout: 246 seconds]
Aqo has quit [Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805]]
jaddison has quit [Quit: jaddison]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
jaddison has joined #ruby
kurra has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
eclm has quit [Ping timeout: 250 seconds]
ua has quit [Ping timeout: 245 seconds]
zenspider has quit [Ping timeout: 272 seconds]
phaul has joined #ruby
ua has joined #ruby
mostlybadfly has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
zenspider has joined #ruby
roshanavand has quit [Read error: Connection reset by peer]
masterasia has quit [Ping timeout: 256 seconds]
agent_white has joined #ruby
sarink has joined #ruby
sarink has quit [Remote host closed the connection]
sarink has joined #ruby
jaddison has quit [Quit: jaddison]
crankharder has quit [Ping timeout: 246 seconds]
jaddison has joined #ruby
piks3l has quit [Quit: piks3l]
jottr has quit [Ping timeout: 250 seconds]
cow[moo] has joined #ruby
cow[moo] has quit [Ping timeout: 268 seconds]
nowhere_man has joined #ruby
jaddison has quit [Quit: jaddison]