graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
herbmillerjr has joined #ruby
ZzZombo has quit [Remote host closed the connection]
FastJack has quit [Ping timeout: 240 seconds]
FastJack has joined #ruby
idiocrash has joined #ruby
esrse has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
arescorpio has joined #ruby
kotepillar_ has joined #ruby
RougeR has quit [Ping timeout: 252 seconds]
AJA4350 has quit [Quit: AJA4350]
weaksauce has joined #ruby
thy0 has quit [Quit: TTFN]
bmurt has joined #ruby
safetypin has joined #ruby
safetypin has quit [Quit: ZZZzzz…]
kent\n has quit [Quit: No Ping reply in 180 seconds.]
bmurt has quit [Ping timeout: 240 seconds]
safetypin has joined #ruby
kent\n has joined #ruby
safetypin has quit [Client Quit]
bmurt has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
pwnd_nsfw has joined #ruby
lektrik has joined #ruby
mwlang has quit [Ping timeout: 240 seconds]
im0nde has joined #ruby
braincrash has quit [Quit: bye bye]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
soulisson has joined #ruby
<soulisson>
Hi. Is there a library in ruby to send and receive netbios/llmnr/mdns requests and responses?
<woodruffw>
Resolv::MDNS is part of the stdlib, not familiar with anything for netbios or llmnr though
<soulisson>
woodruffw, thank you
<woodruffw>
np
Azure has quit [Read error: Connection reset by peer]
bsamorim has joined #ruby
Azure has joined #ruby
arescorpio has quit [Quit: Leaving.]
<bsamorim>
Guys, I have a nested module Foo::Bar in my code. If I load my app, calling Foo::Bar.constants doesn't show me Foo::Bar's classes, but I can successfully invoke all its classes in the same scope
<bsamorim>
What could be causing it? The app is loaded by invoking "irb -r /path/to/base_file.rb"
Freshnuts has joined #ruby
kotepillar_ has quit [Quit: kotepillar_]
ventures has joined #ruby
<ventures>
evening folks, so if I have an existing ruby app, and I want to integrate oh, a user voting system (ala reddits) to an app where all my data is stored in ActiveRecord
kotepillar_ has joined #ruby
<ventures>
what would be the safest cleverest way to go about it
<ventures>
in making it a useful ranking system
<bsamorim>
ventures: rewriting the whole thing in python
<ventures>
I don’t like ruby but I’m not rewriting mastodon
kotepillar_ has quit [Client Quit]
<ventures>
I don’t much care for mastodon’s layout and internationalization and I’d be happy if they accept the changes I’m gonna make but, they will be drastic
kotepillar_ has joined #ruby
<ventures>
it seems easy enough to work on, I also am doing a lot of Elixir now so ruby is no big deal. though personally I would not have pulled it as a weapon of choice
RougeR has joined #ruby
<ventures>
oh wait i’m in #ruby.. sorry guys
<ventures>
DSL’s are beautiful!
<bsamorim>
i guess that Ruby is one of those languages that can yield very bad code if abused
<ventures>
anyway any thoughts on a reddit like system? I guess I don’t really need to segregate by date unless I’m sorting by votes
<bsamorim>
what do you mean by "integrating"?
<bsamorim>
How would their interaction go about?
DTZUZO has joined #ruby
kotepillar_ has quit [Quit: kotepillar_]
bsamorim has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
BTRE has quit [Remote host closed the connection]
ss_much has quit [Quit: Connection closed for inactivity]
BTRE has joined #ruby
lytol_ has quit [Remote host closed the connection]
hays_ has joined #ruby
<hays_>
i was wondering what people think of this pattern: https://bpaste.net/show/cec01c8f1a04 I am using a class variable which is usually a no-no
<hays_>
but it seems right, since i actually do want the variable to inherit to subclasses
<pwnd_nsfw>
Why would you have to use a class variable?
<pwnd_nsfw>
attr_accessor?
<hays_>
how would you do it
<pwnd_nsfw>
does that not inherit?
<hays_>
i want do be able to do Point.handler_map(:int16).new
<pwnd_nsfw>
As opposed to Point.new.handler_map(:int16)?
<hays_>
allowing me to avoid a large case statement
<hays_>
do you mean Point.new.handler_map(:int16).new ?
<hays_>
that seems inefficient
<pwnd_nsfw>
I have nfi what you're doing at this point
<hays_>
creating a PointINT16 object
<hays_>
based on having a variable with :int16 in it
<hays_>
without case variable; when :int16; foo=PointINT16.new; when :int32, etc. etc.
eckhardt has joined #ruby
<pwnd_nsfw>
Seems incredibly redundant, at least with this example, to even have different classes
<pwnd_nsfw>
I'm sure a more mature example may shed light on that, but currently it doesn't make sense
<pwnd_nsfw>
Could just stick with type attribute in Point object
kapil___ has quit [Quit: Connection closed for inactivity]
graphene has quit [Remote host closed the connection]
bomb has joined #ruby
graphene has joined #ruby
jottr has joined #ruby
yohji has joined #ruby
za1b1tsu has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
<zxq2>
how are you supposed to know what methods generate what exceptions? in mnay cases the documentation sucks
jottr has quit [Ping timeout: 272 seconds]
jottr has joined #ruby
za1b1tsu has quit [Read error: Connection reset by peer]
LiftLeft2 has quit [Quit: Bye]
za1b1tsu has joined #ruby
kapil___ has joined #ruby
govg has joined #ruby
ur5us has quit [Remote host closed the connection]
esrse has quit [Ping timeout: 246 seconds]
Freshnuts has quit [Quit: Leaving]
jottr has quit [Ping timeout: 244 seconds]
ZzZombo has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jottr has joined #ruby
tristanp has joined #ruby
akem__ is now known as akem
tristanp has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 240 seconds]
kotepillar_ has quit [Quit: kotepillar_]
discopatrick has joined #ruby
yohji has quit [Ping timeout: 246 seconds]
cabotto has quit []
chichou has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
TheBloke- is now known as TheBloke
charlielor has joined #ruby
xall has joined #ruby
jottr has joined #ruby
kotepillar_ has joined #ruby
ZzZombo has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai>
Hi, I have a JSON string from Instagram's page and I've created a class for that. https://dpaste.de/UvYE
<AndreYuhai>
But I would like to create an "is_video?" method.
<AndreYuhai>
But just on the returned objects from [ ] square brackets
<AndreYuhai>
For example: "some_json_obj[1].is_video?" How could I make this work ?
<AndreYuhai>
Guess I would have to create a class for edge objects too and then put the method there.
yohji has joined #ruby
thy0 has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
gnufied has quit [Ping timeout: 272 seconds]
jcalla has joined #ruby
kotepillar_ has quit [Quit: kotepillar_]
akem has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
bmurt has joined #ruby
jottr has joined #ruby
dviola has joined #ruby
impermanence has joined #ruby
AJA4350 has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
impermanence has quit [Ping timeout: 272 seconds]
akem has joined #ruby
knight33 has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
yohji has quit [Ping timeout: 252 seconds]
herbmillerjr has quit [Quit: Konversation terminated!]
herbmillerjr has joined #ruby
vondruch has quit [Ping timeout: 244 seconds]
gnufied has joined #ruby
gnufied has quit [Remote host closed the connection]
gnufied has joined #ruby
mike11 has quit [Quit: Leaving.]
jottr has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
yohji has joined #ruby
desperek has joined #ruby
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
InfinityFye has joined #ruby
nowhere_man has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sdegutis has joined #ruby
<sdegutis>
Hi, is there a method in the stdlib that "groups" a flat array by a given function? For example [0,1,2,3,4,5,6].something{|n| n % 3 == 0 } would become [[0,1,2], [3,4,5], [6]]
<sdegutis>
havenwood: in real life I've got an array of documentation strings where every once in a while one starts with 'module ' and I want to group all the ones afterward with that since they belong to that module
<sdegutis>
havenwood: the reason for .each_slice(2) is because .chunk gives me [[true, ['module Foo']], [false, [doc_strings...], ...]
<sdegutis>
In that pattern.
graphene has quit [Remote host closed the connection]
<NL3limin4t0r>
sdegutis: Does #slice_before fit your issue?
<havenwood>
it is a flatten(1), not a flatten, fwiw
<havenwood>
(which should be fine here)
<havenwood>
sdegutis: nice
stan has joined #ruby
AndreYuhai has quit [Quit: Page closed]
<sdegutis>
How do you pass a regular "function" (method defined in root of file) to foo.map ?
<havenwood>
sdegutis: by root of file, do you mean top level in Ruby or something else?
<sdegutis>
yes
<sdegutis>
havenwood: I'm inside a .map{} in that block and I'm going to write .map{} inside that other map, and I'm trying to avoid defining the inner mapping method there
<sdegutis>
So I'm putting it at the top level of the file, but now I forgot how to pass it.
<sdegutis>
I haven't done Ruby professionally in like 6 years.
<NL3limin4t0r>
So the this `.map { |e| some_method(e) }` can be replaced by `.map(&method(:some_method))`.
<NL3limin4t0r>
I guess that's what you mean.
jottr has quit [Ping timeout: 252 seconds]
<sdegutis>
Yeah that.
<sdegutis>
Thanks NL3limin4t0r.
<NL3limin4t0r>
You can also do that for instance methods if you ever need to.
<havenwood>
I like the new syntax for that that's been proposed for that: .map(&.:some_method)
<sdegutis>
Yeah I've done it with &:foo in the past on instance methods
<NL3limin4t0r>
>> str = 'a'; %w[s d f a k e a].map(&str.method(:==))
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arup_r has quit [Remote host closed the connection]
NL3limin4t0r is now known as NL3limin4t0r_afk
sdegutis has left #ruby [#ruby]
brandoncc has joined #ruby
fluxAeon has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
za1b1tsu has joined #ruby
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
yohji has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
knight33 has joined #ruby
jottr has joined #ruby
conta1 has joined #ruby
graphene has quit [Remote host closed the connection]
rippa has joined #ruby
graphene has joined #ruby
conta1 has quit [Quit: conta1]
brandoncc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
Pisuke has joined #ruby
MyMind has quit [Ping timeout: 252 seconds]
charlielor has quit [Quit: charlielor]
beowuff has joined #ruby
ivanskie has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
conta1 has joined #ruby
aufi has quit [Ping timeout: 252 seconds]
akem__ is now known as akem
conta1 has quit [Client Quit]
bmurt has joined #ruby
cagomez has joined #ruby
Dbugger has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
thejs has quit [Ping timeout: 246 seconds]
marz_d`ghostman has joined #ruby
sagax has quit [Remote host closed the connection]
<marz_d`ghostman>
Why can I declare a module, a method inside it and invoke the inject(:+) method directly? I though I need to include Enumerable first?
lxsameer has joined #ruby
thejs has joined #ruby
knight33 has quit [Ping timeout: 252 seconds]
jcarl43 has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
[Butch] has joined #ruby
lxsameer has joined #ruby
aupadhye has joined #ruby
brandoncc has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
charlielor has joined #ruby
lxsameer has joined #ruby
Beams has quit [Quit: .]
yohji has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
chichou has quit [Ping timeout: 244 seconds]
DTZUZO has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
aupadhye has quit [Quit: Leaving]
RougeR has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
lxsameer has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
lxsameer has quit [Ping timeout: 245 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
lxsameer has joined #ruby
arup_r has quit [Client Quit]
RougeR has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
RougeR has quit [Ping timeout: 246 seconds]
<apeiros>
marz_d`ghostman: don't know what you mean. can you gist actual reproducible code?
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
jottr has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 264 seconds]
lxsameer has joined #ruby
Cthulu201 has joined #ruby
akem has joined #ruby
krawchyk has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
za1b1tsu has joined #ruby
arup_r has joined #ruby
lxsameer has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
za1b1tsu has joined #ruby
krawchyk has quit [Quit: krawchyk]
lxsameer has quit [Ping timeout: 246 seconds]
GodFather_ has joined #ruby
krawchyk has joined #ruby
sagax has joined #ruby
InfinityFye has quit [Quit: Leaving]
duderonomy has joined #ruby
lxsameer has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charlielor has quit [Quit: charlielor]
lxsameer has quit [Ping timeout: 252 seconds]
charlielor has joined #ruby
thejs has quit [Ping timeout: 272 seconds]
ivanskie has joined #ruby
lxsameer has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RougeR has joined #ruby
bmurt has joined #ruby
jottr has joined #ruby
orbyt_ has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
armyriad has quit [Ping timeout: 272 seconds]
samort7 has joined #ruby
akem has quit [Ping timeout: 246 seconds]
armyriad has joined #ruby
lxsameer has joined #ruby
wolfshappen has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
wolfshappen has joined #ruby
arup_r has quit []
lxsameer has joined #ruby
SeepingN has joined #ruby
sauvin has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 240 seconds]
akem has joined #ruby
sameerynho has joined #ruby
LiftLeft has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 272 seconds]
discopatrick has quit [Quit: Connection closed for inactivity]
lxsameer has joined #ruby
charlielor has quit [Quit: charlielor]
charlielor has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
charlielor has quit [Client Quit]
charlielor has joined #ruby
orbyt_ has joined #ruby
lxsameer has joined #ruby
orbyt_ has quit [Client Quit]
th1nkpad has joined #ruby
dan64 has joined #ruby
thinkpad has quit [Ping timeout: 272 seconds]
th1nkpad is now known as thinkpad
lxsameer has quit [Ping timeout: 244 seconds]
charlielor has quit [Quit: charlielor]
tdy has joined #ruby
dan64 has quit [Ping timeout: 244 seconds]
jottr has quit [Ping timeout: 240 seconds]
lunarkittychan is now known as usagimimibot
usagimimibot is now known as lunarkittychan
thy0 has quit [Quit: TTFN]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charlielor has joined #ruby
thy0 has joined #ruby
DTZUZO has joined #ruby
orbyt_ has joined #ruby
jottr has joined #ruby
dellavg_ has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 252 seconds]
tdy has quit [Ping timeout: 240 seconds]
charlielor has quit [Quit: charlielor]
thejs has joined #ruby
reber has quit [Remote host closed the connection]
croberts has quit [Ping timeout: 252 seconds]
Dbugger has quit [Ping timeout: 240 seconds]
jp has quit [Ping timeout: 252 seconds]
dviola has quit [Quit: WeeChat 2.2]
dorian has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
krawchyk has quit [Quit: krawchyk]
Azure has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
<dorian>
question about circular references: do i have to manage them manually or no?
code_zombie has joined #ruby
DTZUZO has joined #ruby
sanscoeur has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
cd is now known as tty
desperek has quit [Quit: xoxo]
DTZUZO has quit [Ping timeout: 245 seconds]
DTZUZO has joined #ruby
<leah2>
no, ruby's gc handles them fine
cagomez has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<dorian>
leah2: how far back does that go?
<dorian>
(not that i have to support it; just for my own edification)
<apeiros>
dorian: I wouldn't be surprised if it went back to the original ruby
<apeiros>
given that afaik ruby started out with a mark & sweep gc, which has no issues with circular refs.
<dorian>
ah yes
<leah2>
dorian: since always
<dorian>
good to know
* dorian
inured to perl Scalar::Util::weaken
\void has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
<apeiros>
it's been 2 decades since I did perl, so no idea what that's supposed to mean
<dorian>
it's a thing you have to do to decrement the reference count of a data object so it gets properly GC'd
<dorian>
(if circular, that is)
<dorian>
anyway no bother
<apeiros>
perl uses a counting gc?
<dorian>
yeah there was talk of moving to mark and sweep a while back but i think they gave up on that
<dorian>
("a while back" being like 15 years)
lxsameer has joined #ruby
croberts has joined #ruby
tdy has joined #ruby
chouhoulis has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
mustmodify has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
g- has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
leitz has joined #ruby
lytol_ has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
<mememeIAMMEE>
Any simpler, easier to remember, ways to write it? Trying to stuff a bunch of new syntax in my head for an interview in 3 days. Never touched Ruby in my life.
<mememeIAMMEE>
Many differences from my usual
za1b1tsu has joined #ruby
cagomez has quit [Remote host closed the connection]
<havenwood>
mememeIAMMEE: Instead of a default proc of an empty Array, you can manually make sure there's an Array for your value before shoveling: