<dionysus69>
line 60, json['params'], = *args so I assume this works like the following: we are dealing with mass assignment but only with one variable, first element of the array args gets assigned to json["params"], I just dont get why I cant just assign splatted array to the params as hash
<dionysus69>
I also have one more question to everyone about monkey patching. So I am monkey patching a gem which pretty much has a single file and I am just changing this line 60, so I am basically only monkey patching method_missing method on line 37 in the link I posted. but when I insert this code RPC > JSON > Client > def method_missing other methods do not get inherited from the gem, so I am forced to copy all methods
<dionysus69>
in the file just to monkey patch single method
<dionysus69>
AFAIK, it is supposed to inherit everything else from the gem, and just shadow/override the monkey patched method
crankharder has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
dsmythe has quit [Remote host closed the connection]
dsmythe has joined #ruby
jottr has joined #ruby
conta has joined #ruby
jenrzzz has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
jottr has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
conta has quit [Read error: Connection reset by peer]
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 250 seconds]
conta has joined #ruby
Swyper has quit [Remote host closed the connection]
<ryouba>
when using something like regosaurs=[/(?<blah>\d+)/, /(?<boobledeedoop>[[:punct:]]/]; regosaurs.all? {|r| r.match? "99 bottles of beer."} ... is there any way i can access the matching groups' contents (blah: 99, boobledeedoop: '.') later?
jottr has joined #ruby
<ryouba>
hmm, foo=[];regosaurs=[/(?<blah>\d+)/, /(?<boobledeedoop>[[:punct:]])/]; regosaurs.all? {|r| foo << "99 bottles of beer.".match(r); foo.any?} works. not much elegant though.
dsmythe has quit [Ping timeout: 276 seconds]
ellcs has joined #ruby
za1b1tsu has joined #ruby
buckworst has quit [Quit: Connection closed for inactivity]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
<ryouba>
phaul: quite well, i just figured out "regosaurs=[/(?<blah>\d+)/, /(?<boobledeedoop>[[:punct:]])/]; matches=regosaurs.map {|r| "99 bottles of beer.".match(r)&.named_captures}.compact.inject :merge" before you came, which makes me happy :)
<ryouba>
how are you?
<phaul>
that's cool, not too bad myself, thank you.
agent_white has quit [Quit: bbl]
daniel__ has quit [Remote host closed the connection]
ralt has joined #ruby
<ralt>
hi
postmodern has quit [Quit: Leaving]
<ralt>
is it normal that the git tags on the upstream git repository have disappeared?
<ryouba>
phaul: what time zone are you in btw?
<phaul>
ryouba: CET
<ryouba>
oh, just a little bit west of me then :)
prestorium has quit [Quit: prestorium]
<ralt>
we were using the git tags to build a custom version of upstream versions but no longer can. I assume it's related to the change from svn to git, but it feels weird, and not necessarily on purpose, to delete the tags. How do you know which commit to build your release tarballs on?
daniel____ has joined #ruby
daniel__ has joined #ruby
daniel____ has quit [Remote host closed the connection]
daniel__ has quit [Client Quit]
daniel____ has joined #ruby
reber has quit [Remote host closed the connection]
olblak has joined #ruby
mangold has joined #ruby
ferr has joined #ruby
maleghast has joined #ruby
maleghast has quit [Client Quit]
conta has joined #ruby
maleghast has joined #ruby
dsmythe has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Remote host closed the connection]
dsmythe has joined #ruby
conta has quit [Ping timeout: 250 seconds]
crankharder has quit [Ping timeout: 250 seconds]
AJA4350 has joined #ruby
tdy1 has quit [Ping timeout: 255 seconds]
conta has joined #ruby
ralt has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
wald0 has joined #ruby
_joes_ has joined #ruby
Swyper has quit [Remote host closed the connection]
maleghast has quit [Ping timeout: 250 seconds]
tdy1 has joined #ruby
AJA4351 has joined #ruby
dostoyevsky has quit [Ping timeout: 268 seconds]
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
dostoyevsky has joined #ruby
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #ruby
Swyper has joined #ruby
dostoyevsky has quit [Ping timeout: 258 seconds]
conta has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
Swyper has quit [Ping timeout: 258 seconds]
conta has joined #ruby
Swyper has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
dostoyevsky has joined #ruby
Swyper has quit [Remote host closed the connection]
ramfjord has joined #ruby
jenrzzz has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
Swyper has quit [Remote host closed the connection]
conta has quit [Remote host closed the connection]
conta has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
old_relik has joined #ruby
mikeiniowa has quit [Remote host closed the connection]
<havenwood>
old_relik: I'd suggest extracting `details` to a frozen constant.
<havenwood>
old_relik_: Usually, DateTime.current is best in Rails (has TZ).
<old_relik_>
that makes sense
<old_relik_>
can't extract details
<old_relik_>
it's populated via params
<old_relik_>
oh, you mean an unpopulated constant
<havenwood>
old_relik_: ah, didn't notice that
<havenwood>
no, i'm just blind
<wildermind>
Hi, I installed `rvm` and then typed `sudo rvm install puppet -v 3.8.7` and all went find but when I type `puppet --version` I get the following error: https://pastebin.ubuntu.com/p/jD76NFzjqk/
<old_relik_>
right
<old_relik_>
I mean, no
<wildermind>
help? :) Im only using rvm to install puppter
<old_relik_>
that's not what I meant
<wildermind>
pupptet
<wildermind>
puppet*
<dionysus69>
what's the benefit of freezing? just for protection against accidental mutation?
old_relik has quit [Ping timeout: 256 seconds]
<havenwood>
dionysus69: yup
<havenwood>
wildermind: weird, seems like a Puppet error in monkey_patches.rb, line 178
<wildermind>
havenwood: ok thanks, will try to install puppet without rvm lol, someone told me its the easiest
yokel has quit [Ping timeout: 245 seconds]
<havenwood>
wildermind: doesn't look like an RVM problem
<wildermind>
havenwood: you think its something with the package itself or my system
<wildermind>
?
<havenwood>
wildermind: i'm curious what's on that line?
old_relik_ has quit [Quit: Page closed]
<wildermind>
I'll look now, where are the global ruby gems installed?
<havenwood>
wildermind: check: gem env gemdir
<havenwood>
wildermind: usually you don't want to do a global install of RVM - just a local one suffices and is less likely to result in permission issues
<havenwood>
wildermind: and what is `offset` defined as?
yield__ has quit [Remote host closed the connection]
Swyper has quit [Ping timeout: 245 seconds]
<havenwood>
wildermind: i don't see a `<<` on that line?
<havenwood>
"undefined method `<<' for nil:NilClass"
yield_ has joined #ruby
yield_ has quit [Ping timeout: 250 seconds]
DTZUZO has joined #ruby
conta has quit [Read error: Connection reset by peer]
millerti has quit [Read error: Connection reset by peer]
AJA4350 has quit [Ping timeout: 244 seconds]
conta has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
<ryouba>
Oh man
<ryouba>
"<<" is one of the Ruby things I miss the most in Matlab.
AJA4350 has joined #ruby
nadir has joined #ruby
conta has quit [Quit: conta]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
asio has quit [Ping timeout: 252 seconds]
ldnunes has quit [Ping timeout: 245 seconds]
_joes_ has quit [Remote host closed the connection]
_joes_ has joined #ruby
_whitelogger has joined #ruby
ldnunes has joined #ruby
suukim has joined #ruby
yokel has quit [Ping timeout: 276 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
yield_ has joined #ruby
yokel has joined #ruby
<uplime>
wouldn't it just be .append or += in most languages?
yield_ has quit [Ping timeout: 258 seconds]
dsmythe_ has joined #ruby
tdy1 has quit [Ping timeout: 276 seconds]
gb_away has quit [Ping timeout: 244 seconds]
dsmythe has quit [Ping timeout: 250 seconds]
gb_away has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
cthulchu has joined #ruby
jenrzzz has joined #ruby
<adam12>
dionysus69: Not sure if you're still working on this, but I took your gist and made a smaller gist with a few tests. I think I see the issue? but its too hard to really tell without seeing the method call invocation.
<adam12>
dionysus69: What I think you're seeing is some_method(foo: true) is getting passed to method_missing as (args = [{foo: true}]), which you're then trying to splat.
<adam12>
dionysus69: I added a keyword arg splat to method_missing and use a predicate to determine if we want to use args or kwargs. I'm sure there's a better way but I can't think of it right now. https://gist.github.com/adam12/a5fa8602357cd849ff39535bd137ee56
nicb has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
yield_ has joined #ruby
RedSnarf has joined #ruby
nicb has quit [Client Quit]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
cow[moo] has joined #ruby
<_ikke_>
Why does rubocop warn for useless assignent in this code: Net::HTTP::Post.new(uri, initheader = {"Content-Type" => "application/json"})
<ytti>
because initheader is not used
<havenwood>
_ikke_: do you subsequently use initheader
<ytti>
Content-Type: "application/json"
<ytti>
i guess that's not valid sym
Swyper has quit [Remote host closed the connection]
<_ikke_>
havenwood: no, initheader is a named argument in the initializer for Post
<ytti>
no is not
<havenwood>
_ikke_: it's not named though, it's positional
<_ikke_>
Ah ok, I thought it was not the 2nd parameter
<_ikke_>
Was confused by the signature of HTTPGenericRequest.new
<_ikke_>
Thanks
<_ikke_>
I find the documentation kind of confusing
shadeslayer has joined #ruby
<adam12>
_ikke_: Sometimes people use the assignment like that to indicate it's intent (ie, if you wanted to call it `headers` to remember what it does).
AJA4351 has joined #ruby
<adam12>
_ikke_: If you wanted to Rubocop from complaining, you could likely prefix the argument with an underscore. So _initheader = ...
<phaul>
_ikke_: you should be looking at HTTPRequest not HTTPGenericRequest, as that's the direct parent
<phaul>
and it's new signature is different
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<phaul>
&ri Net::HttpRequest.new
<rubydoc>
Found no entry that matches class Net::HttpRequest class method new
<adam12>
I wonder how long it will take before we see some RubyKaigi 2019 recordings on YT.
GodFather has quit [Ping timeout: 250 seconds]
AJA4350 has quit [Remote host closed the connection]
Swyper has joined #ruby
AJA4350 has joined #ruby
Rapture has joined #ruby
GodFather has joined #ruby
Swyper has quit [Remote host closed the connection]
_joes_ has quit [Remote host closed the connection]
_joes_ has joined #ruby
asio has joined #ruby
Swyper has joined #ruby
Inline has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
AJA4351 is now known as AJA4350
spacesuitdiver has joined #ruby
aupadhye has quit [Remote host closed the connection]
<ryouba>
uplime: not in Matlab.
_joes_ has quit [Ping timeout: 258 seconds]
<ryouba>
say, what was that micro framework again that a number of people in here prefer over sinatra?
<ryouba>
i don't mean Nancy, Cuba or Angelo
<havenwood>
ryouba: Roda
<ryouba>
yeees! jeremy evan's! thanks, havenwood
lxsameer has quit [Quit: out]
<adam12>
Roda is awesome.
sameerynho has joined #ruby
<ryouba>
colleague just started something new in Angelo ... wanted to ask if he had looked at Roda also. apparently his motivation were the builtin websockets and SSE support.
agent_white has joined #ruby
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4351 has joined #ruby
<adam12>
Roda has a message bus plugin. It works well for single-direction communication (so no websockets) and has (iirc) better browser support than SSE.
<adam12>
I use Roda with websockets on one project, but in reality it's actually Iodine, since Roda just hands the socket back to Iodine.
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
yield_ has joined #ruby
Puffball has quit [Quit: Puffball]
renich has joined #ruby
Swyper has quit [Remote host closed the connection]
jcarl43 has joined #ruby
yield_ has quit [Remote host closed the connection]
reber__ has joined #ruby
Eiam has joined #ruby
reber__ has quit [Remote host closed the connection]
reber has quit [Ping timeout: 255 seconds]
Puffball has joined #ruby
duderonomy has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
orbyt_ has joined #ruby
lucasb has joined #ruby
Swyper has joined #ruby
Puffball has quit [Quit: Puffball]
hiroaki has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ltem has joined #ruby
pupsikov has joined #ruby
jefffrails35 has joined #ruby
_joes_ has joined #ruby
nahra has joined #ruby
yield_ has joined #ruby
Swyper has quit [Remote host closed the connection]
houhoulis has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
tdy1 has quit [Ping timeout: 276 seconds]
conta has quit [Quit: conta]
Dbugger has joined #ruby
pupsikov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mitt3ns has joined #ruby
yield_ has quit [Ping timeout: 255 seconds]
agent_white has quit [Ping timeout: 258 seconds]
nowhere_man has joined #ruby
Dbugger has quit [Quit: Leaving]
alem0lars has quit [Ping timeout: 258 seconds]
AJA4350 has joined #ruby
extrowerk has joined #ruby
<extrowerk>
Hi
<extrowerk>
I'm with the HaikuPorts team here and currently working on updating our ruby port. Ist there a ruby-hacker channel, or sholud i dump my core here?
gix has joined #ruby
polishdub has joined #ruby
jenrzzz has joined #ruby
<depesz>
i have plain hash. is there any special method to iterate over both keys and values? for now I'm doing: hash.each.to_a.flatten.each
jottr has quit [Ping timeout: 244 seconds]
<depesz>
but perhaps there is some easier thing?
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
<balo>
depesz: do you need a particular order? What's wrong with hash.each { |k,v| puts "#{k} => #{v}" }
<balo>
?
<depesz>
balo: because i need to do the same thing with k and v
ellcs has joined #ruby
<depesz>
and i'd prefer not to repeat the code, or have internal loop.
<depesz>
it's sanity checking code for hash that will be used later on.
jenrzzz has quit [Ping timeout: 250 seconds]
ldnunes has quit [Ping timeout: 250 seconds]
<balo>
so the block would be: check(k); check(v); ? does not seem too bad to me
<depesz>
well, in my case the check is 2 lines only, so I don't put it in separate function.
<balo>
it's on you. i'd put into a method and call it twice
<depesz>
so for now it is "pretty long line 1" "pretty long line 2", and both of them repeat with the value, and not key.
<depesz>
i'll go with hash.to_a.flatten. seems easier.
<balo>
it's explicit and clear what is it doing. and method calling is cheaper than generating intermediate arrays i think
jenrzzz has joined #ruby
yield_ has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
cloaked1 has quit [Remote host closed the connection]
sauvin has quit [Read error: Connection reset by peer]
yield_ has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 250 seconds]
ldnunes has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
clemens3_ has quit [Ping timeout: 255 seconds]
jottr has joined #ruby
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
<extrowerk>
Question: On Haiku without any special configure switches rubygems.rb lands in the "/boot/system/lib/ruby/2.6.0/" folder, which then gets packaged and becomes read-only. Of course, gem doesn't like this as it tries to write it. It makes troubles (AFAIK) on differen platforms too. Is there any workaround for this?
ramfjord has joined #ruby
ldnunes has joined #ruby
duderonomy has joined #ruby
ldnunes has quit [Ping timeout: 258 seconds]
jottr has quit [Ping timeout: 255 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4351 has joined #ruby
[Butch] has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
nowhere_man has quit [Ping timeout: 245 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yield_ has joined #ruby
orbyt_ has joined #ruby
ldnunes has joined #ruby
kyrylo has joined #ruby
yield_ has quit [Ping timeout: 258 seconds]
duderonomy has joined #ruby
jottr has joined #ruby
kyrylo has quit [Ping timeout: 258 seconds]
duderonomy has quit [Client Quit]
fphilipe_ has joined #ruby
elated has joined #ruby
<elated>
I'd like construct an image with a function from x,y to color. What's a well suited library for that?
<elated>
given I already have the function
ogres has joined #ruby
cthulchu has quit [Ping timeout: 245 seconds]
feelextra has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<feelextra>
hello, i have a question about migrations in Rails: when i have a model file for a table and run a migration that alters the table, does the model file change as well?
fluxAeon has joined #ruby
fluxAeon is now known as flux__aeon
suukim has quit [Quit: Konversation terminated!]
spacesuitdiver has quit [Remote host closed the connection]
clemens3_ has joined #ruby
bvdw6 has quit [Remote host closed the connection]
feelextra has quit [Ping timeout: 245 seconds]
thunderbirdtr has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]