<cthu|>
throws me NoMethodError: undefined method `key?' for nil:NilClass
<cthu|>
on line 8
<cthu|>
al2o3-cr, I think it works cuz you use symbolic links. I don't use them. I just do => cuz it feels more fair.
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
<cthu|>
lol
<cthu|>
same error with fetch
<cthu|>
omfg
<cthu|>
why?!
<cthu|>
oh
<cthu|>
I think I know
<cthu|>
it's cuz blocks don't have access to this
<cthu|>
which is stupid af
<cthu|>
I think I had this issue before
mikecmpbll has quit [Quit: inabit. zz.]
cschneid has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
<cthu|>
I wonder if blocks that use do end can use the context.
JoeA2552 has joined #ruby
Guest44017 has joined #ruby
<cthu|>
now I have to have an ugly temp_event = temp_event || {} in each iteration because of the fact that I don't have the context. that's sad. Can I add arbitrary arguments to blocks? Like f.each_line { |line, temp_event={}|
Guest44017 has quit [Ping timeout: 252 seconds]
tdy has quit [Ping timeout: 244 seconds]
<cthu|>
omfg
<cthu|>
I don't have match?
<cthu|>
no string.match? no regex.match?
ByronJohnson has joined #ruby
<cthu|>
okay, I'm gonna use the ugliest ===
<cthu|>
cuz 2.2
davidw has quit [Ping timeout: 244 seconds]
cschneid has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
cschneid has quit [Ping timeout: 245 seconds]
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JoeA2552 has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
JoeA2552 has quit [Client Quit]
D4rK51D3 has joined #ruby
AJA4350 has quit [Remote host closed the connection]
<D4rK51D3>
hi everybody
r29v has joined #ruby
<havenwood>
D4rK51D3: hi
<D4rK51D3>
i just have a simple question, i dont know if maybe somebody can help, i just want to make a facebook autoposter in ruby, to work maybe in localhost as a webpage, or maybe just as a executable, is ruby the right language to do this?
jcalla has quit [Ping timeout: 246 seconds]
<D4rK51D3>
autoposter (MULTI-poster, post a single post but in many different groups at the same time with a simple click
<D4rK51D3>
is this possible in ruby? is it the right language for this? anybody ? :|
JoeA2552 has joined #ruby
<cthu|>
why Ruby?
JoeA2552 has quit [Client Quit]
<cthu|>
it makes sense to use JS in this case
<cthu|>
locally in browser
<cthu|>
unless heavy backend is involved
<cthu|>
also, D4rK51D3 I believe there are many solutions that can be easily employed. Generally, it's either you hack and make it hard for FB to know that it's automated or you use its API. In the latter case you don't care about the language. In the former, however, you wanna use JS
sarink has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<D4rK51D3>
i dont know, ive just enrolled in a ruby course and i think it is much easier than python
<cthu|>
oh, if you're a student, you probably don't wanna start messing with a task like this. Unless you feel confident with APIs
<D4rK51D3>
but i really dont have an idea
<cthu|>
also I wouldn't say Python is more complex or easier than Ruby. They're different, but have approximately the same level
masterasia has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<D4rK51D3>
so you mean in ruby this task would be much harder? or more difficult?
<havenwood>
D4rK51D3: Pretty much any modern language is perfectly fine for making an HTTP API client. Ruby is a fine choice.
JoeA2552 has joined #ruby
sarink has quit [Ping timeout: 246 seconds]
<D4rK51D3>
i definitely would use facebook API
<D4rK51D3>
i need to pull lot of info from facebook so i will need the API, nothing about spamming, facebook has rules about multiposting, since you respect those rules no problem
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<D4rK51D3>
koala?
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esrse has joined #ruby
<D4rK51D3>
Koala is a Facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), the Marketing API, the Atlas API, realtime updates, test users, and OAuth validation
<D4rK51D3>
WOW
davidw has joined #ruby
connermcd has joined #ruby
<D4rK51D3>
so my idea wouold be to make a "website" hosted in localhost, and from there manage my multipostings, receibe feedback from the facebook API, how about that?
JoeA2552 has joined #ruby
<D4rK51D3>
is that a good/bad idea?, what is your expert opinion?
<hays>
is there anything like the pickaxe book that is up to date
davidw has quit [Ping timeout: 246 seconds]
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
sgen_ has joined #ruby
masterasia has joined #ruby
darkhanb has joined #ruby
cschneid has joined #ruby
<hays>
heh
<hays>
i see you have a new article out :)
davidw has quit [Ping timeout: 272 seconds]
ansraliant has joined #ruby
KeyJoo has joined #ruby
sauvin has joined #ruby
davidw_ has joined #ruby
quipa_ has quit [Remote host closed the connection]
armyriad has quit [Ping timeout: 250 seconds]
tdy has quit [Ping timeout: 272 seconds]
sarink has joined #ruby
davidw_ has quit [Ping timeout: 250 seconds]
sarink has quit [Ping timeout: 250 seconds]
<zenspider>
rawr
jtdowney has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ogres has quit [Quit: Connection closed for inactivity]
sgen_ has quit [Ping timeout: 250 seconds]
laaron has joined #ruby
hutch has quit [Ping timeout: 272 seconds]
JoeA2552 has joined #ruby
cthu| has joined #ruby
_whitelogger has joined #ruby
za1b1tsu has joined #ruby
_whitelogger has joined #ruby
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
marz_d`ghostman has quit [Quit: Page closed]
jthomas1 has joined #ruby
_whitelogger has joined #ruby
JoeA2552 has joined #ruby
jthomas1 has quit [Ping timeout: 244 seconds]
cschneid has joined #ruby
lightstalker has quit [Ping timeout: 240 seconds]
lightstalker has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neuraload has joined #ruby
JoeA2552 has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
roshanavand has joined #ruby
cnsvc has joined #ruby
laaron has joined #ruby
laaron- has quit [Remote host closed the connection]
cschneid has quit [Ping timeout: 244 seconds]
cthu| has quit [Ping timeout: 268 seconds]
cthu| has joined #ruby
_whitelogger has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
BH23 has quit [Ping timeout: 245 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mike11 has joined #ruby
BH23 has joined #ruby
neuraload has quit [Quit: Leaving]
conta has joined #ruby
ansraliant has quit [Quit: My planet needs me]
tiff has joined #ruby
reber has joined #ruby
tiff has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
laaron has quit [Remote host closed the connection]
elphe has joined #ruby
neuraload has joined #ruby
gix has joined #ruby
neuraload has quit [Ping timeout: 240 seconds]
esrse has quit [Quit: happy new year]
kapil____ has joined #ruby
lxsameer has joined #ruby
sameerynho has quit [Ping timeout: 246 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
marz_d`ghostman has joined #ruby
<marz_d`ghostman>
I've created a /config/initializers/production.rb & test.rb . . . to initialize things. However, how do I select which one should be included when I run it in production and test?
elphe has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
laaron has joined #ruby
roshanavand has joined #ruby
marz_d`ghostman has quit [Quit: Page closed]
FrankD has quit [Read error: Connection reset by peer]
powerbit has quit [Ping timeout: 250 seconds]
BH23 has quit [Ping timeout: 250 seconds]
powerbit has joined #ruby
powerbit has quit [Excess Flood]
elphe has joined #ruby
powerbit has joined #ruby
powerbit has quit [Excess Flood]
elphe has quit [Ping timeout: 268 seconds]
powerbit has joined #ruby
elphe has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
keden has joined #ruby
ur5us has joined #ruby
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
quipa has joined #ruby
elphe has quit [Ping timeout: 272 seconds]
quipa has quit [Max SendQ exceeded]
quipa has joined #ruby
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
elphe has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
rubydoc has quit [Ping timeout: 246 seconds]
yxhuvud has joined #ruby
phaul has quit [Ping timeout: 244 seconds]
KeyJoo has joined #ruby
phaul has joined #ruby
rubydoc has joined #ruby
cd has quit [Quit: cd]
elphe has quit [Ping timeout: 272 seconds]
elphe has joined #ruby
laaron- has quit [Remote host closed the connection]
laaron has joined #ruby
bobthebutcher has joined #ruby
Mike11 has quit [Ping timeout: 250 seconds]
cschneid has joined #ruby
ur5us has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 250 seconds]
elphe has joined #ruby
bobthebutcher has quit [Quit: WeeChat 1.9.1]
patteh_ has joined #ruby
donofrio has quit [Remote host closed the connection]
<hays>
i am thinking i should just read the pickaxe book
<hays>
and then just read the changelogs of ruby from 1.9
cschneid has quit [Ping timeout: 245 seconds]
mostlybadfly has joined #ruby
<al2o3-cr>
hays: look @ /topic for book references.
lucasb has joined #ruby
neuraload has joined #ruby
elphe has quit [Quit: leaving]
AJA4350 has joined #ruby
keden has quit [Ping timeout: 246 seconds]
keden has joined #ruby
agent_white has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
dviola has joined #ruby
s2013 has joined #ruby
reber has quit [Remote host closed the connection]
larissa has quit [Ping timeout: 252 seconds]
larissa has joined #ruby
szulak_ has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
jcalla has quit [Ping timeout: 272 seconds]
comet23 has joined #ruby
jcalla has joined #ruby
<comet23>
how do you wrap values around?
<al2o3-cr>
say what?
<comet23>
like i have an array
<al2o3-cr>
yes.
<comet23>
['a','b','c']
<al2o3-cr>
ok.
<comet23>
i want a counter to keep going back to a when it reaches c
<comet23>
not get nil
donofrio has joined #ruby
<al2o3-cr>
comet23: can you paste an example of input/output? (with comments)
<comet23>
i don't have any code i just wanted to know for future reference
<al2o3-cr>
you don't need a counter.
<phaul>
class Array; def infinitie_each(&block); (1..).map { each }.inject(:+); end; end # :)
<al2o3-cr>
hays: Enumerator#with_index is so you can have an index other 0
clemens3 has quit [Ping timeout: 272 seconds]
clemens3_ has joined #ruby
<hays>
yeah, so .map returns an Enumerator, which still contains enough information to create an index
roshanavand has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
<al2o3-cr>
"which still contains enough information to create an index" ?
conta has quit [Quit: conta]
<al2o3-cr>
hays: what does that mean?
<al2o3-cr>
&>> Enumerator.instance_methods(false)
<rubydoc>
# => [:each_with_index, :with_index, :with_object, :next_values, :each_with_object, :peek, :feed, :peek_v ...check link for more (https://carc.in/#/r/5vb5)
<hays>
just trying to say that the Enumerator still has access to the array, so it can provide indices. I wasn't thinking of .map returning anything, which doesn't make sense
donofrio has joined #ruby
<phaul>
hays, when those methods return an Enumerator they don't actually run the iteration yet (at the point of return). Enumerator just encapsulates a reference to them, and can call them later when they have a block. It's lazy.
sgen_ has joined #ruby
<hays>
yes
<al2o3-cr>
hays: simalar to generators in python.
kapil____ has quit [Quit: Connection closed for inactivity]
sgen_ has quit [Remote host closed the connection]
<al2o3-cr>
eg hays
<al2o3-cr>
&>> e = (1..10).to_enum; [e.take(3), e.next]
<havenwood>
al2o3-cr: got a brand new Ruby as a present! \o/
<nchambers>
havenwood: i really liked that infinite range operator (article). can't wait to use ruby 2.6!
<havenwood>
nchambers: yay!
<al2o3-cr>
havenwood: i got that early :)
<havenwood>
al2o3-cr: ruby 2.7.0dev ;)
neuraload has joined #ruby
<al2o3-cr>
havenwood: hehe ;)
thejs has joined #ruby
<blockchan>
Hello everyone. I was wondering if anyone encountered this weird error with eventmachine I have. UDP socket does not receive packets from network, but when I send something from localhost it suddenly starts receiving packets from network correctly
<cthulchu_>
I had to do ugly temp_event = temp_event || {} in there to fix it
<uplime>
i can see why you would want something a bit cleaner :D
<cthulchu_>
yeah :)
quipa has quit [Max SendQ exceeded]
quipa has joined #ruby
<cthulchu_>
also, I have a different question. I have a hash and an array with hashes. I need to make sure that all the fields in this hash are present in each hash of the array. I'm gonna do this using two nested .each in one .select. It's three nested loops. I mean, I don't expect them to be too large, but the code becomes hard to read.
<cthulchu_>
maybe there are hacks like hash.includes(hash)
reber has joined #ruby
<cthulchu_>
although I need it to do regex inclusion
<cthulchu_>
so I guess not
<cthulchu_>
anyhow, will write a method for this
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donofrio has quit [Ping timeout: 245 seconds]
quipa has quit [Max SendQ exceeded]
quipa has joined #ruby
laaron has joined #ruby
quipa has quit [Max SendQ exceeded]
Emmanuel_Chanel has joined #ruby
quipa has joined #ruby
quipa has quit [Remote host closed the connection]
quipa has joined #ruby
<al2o3-cr>
cthulchu_: deffo not json?
quipa has quit [Read error: Connection reset by peer]
<cthulchu_>
hm?
<cthulchu_>
crap
<cthulchu_>
I think sometimes I do : instead of =>
<al2o3-cr>
ffs
<cthulchu_>
but in that case everything is =>
<cthulchu_>
ah, right, I do json when I need to pretty print
<cthulchu_>
anyhow, I don't think it relates
JoeA2552 has joined #ruby
<al2o3-cr>
ok, good.
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
cthu| has joined #ruby
cthulchu_ has quit [Ping timeout: 250 seconds]
<cthu|>
I kinda hesitate to do nested selects
<cthu|>
they have a weirdass syntax
<cthu|>
hm
<cthu|>
okay, select is not the way to go
<cthu|>
I guess I'll just do the old good each and select them manually
<cthu|>
really, some of these blocks are just lame. don't know how you use them freely when they are so limited
garyserj has joined #ruby
SeepingN has joined #ruby
clemens3_ has quit [Ping timeout: 245 seconds]
clemens3_ has joined #ruby
<cthu|>
wtf
<cthu|>
there's arr.each that passes the object and there's arr.each_index that passes the index. Where's the one that passes both like hash.each?
<cthu|>
ot I guess once we have an index, we don't need the val cuz we can get it pretty quickly?
<leftylink>
"It is the block's responsibility to store the value in the hash if required"
<phaul>
fair point leftylink
<uplime>
thanks leftylink
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
laaron has joined #ruby
cschneid has quit [Ping timeout: 245 seconds]
laaron- has quit [Remote host closed the connection]
sarink has quit [Remote host closed the connection]
dionysus69 has quit [Quit: ZNC 1.7.1+deb2+b1 - https://znc.in]
hutch has quit [Ping timeout: 246 seconds]
agent_white has quit [Quit: brb]
<cthu|>
this feeling when you finished a large piece of new functionality, but haven't yet run the code. And you try it and... it works just as you expect...
<cthu|>
this feeling of "now I have to look to find where it fails" :(