havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
ramfjord has quit [Ping timeout: 240 seconds]
jcarl43 has quit [Quit: WeeChat 2.1]
taylorzr has joined #ruby
scrptktty has quit [Quit: Connection closed for inactivity]
cthulchu has quit [Ping timeout: 248 seconds]
nicht has quit [Ping timeout: 240 seconds]
cozachk has quit [Quit: Leaving]
herbmillerjr has joined #ruby
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 264 seconds]
SeepingN_ has quit [Quit: The system is going down for reboot NOW!]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
caleBOT has joined #ruby
edwardly has quit [Ping timeout: 268 seconds]
kurko_ has joined #ruby
caleBOT has quit [Ping timeout: 248 seconds]
rshetty has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
rshetty has quit [Ping timeout: 264 seconds]
apeiros has quit [Ping timeout: 265 seconds]
cagmz has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
nicht has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r29v has quit [Quit: r29v]
cadillac_ has quit [Ping timeout: 240 seconds]
NightMonkey has quit [Quit: ZNC - http://znc.in]
cadillac_ has joined #ruby
apeiros has joined #ruby
NightMonkey has joined #ruby
BloopMonster has quit [Ping timeout: 248 seconds]
NightMonkey has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NightMonkey has joined #ruby
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
edwardly has quit [Ping timeout: 265 seconds]
kryptoz has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
Es0teric has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
r29v has joined #ruby
kmurphy4 has joined #ruby
keggsmurph21 has joined #ruby
keggsmurph21 has quit [Remote host closed the connection]
kmurphy4 has quit [Remote host closed the connection]
kmurphy4 has joined #ruby
kmurphy4 has quit [Remote host closed the connection]
r29v has quit [Quit: r29v]
cyberg has quit [Quit: Leaving]
r29v has joined #ruby
BTRE has quit [Ping timeout: 256 seconds]
r29v has quit [Client Quit]
ramfjord has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
kryptoz has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 256 seconds]
raynold has quit [Quit: Connection closed for inactivity]
MagePsycho has quit [Ping timeout: 245 seconds]
BTRE has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
r29v has joined #ruby
bradleyprice has joined #ruby
aiguuu has joined #ruby
punnie has quit [Quit: Connection closed for inactivity]
nicht has quit [Ping timeout: 245 seconds]
r29v has quit [Client Quit]
graphene has quit [Remote host closed the connection]
kurko_ has quit [Quit: Textual IRC Client: www.textualapp.com]
bradleyprice has quit [Ping timeout: 240 seconds]
graphene has joined #ruby
raynold has joined #ruby
MagePsycho has joined #ruby
jnollette has quit [Quit: ZNC 1.6.5 - http://znc.in]
r29v has joined #ruby
jnollette has joined #ruby
r29v has quit [Client Quit]
tty has quit [Ping timeout: 240 seconds]
rshetty has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
mynameisdebian has joined #ruby
rshetty has quit [Ping timeout: 245 seconds]
nicht has joined #ruby
Alina-malina has quit [Ping timeout: 256 seconds]
caleBOT has joined #ruby
nowhere_man has joined #ruby
darkhanb has joined #ruby
kryptoz has joined #ruby
alex`` has quit [Ping timeout: 276 seconds]
caleBOT has quit [Ping timeout: 240 seconds]
aiguuu has quit [Quit: leaving]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
akaiiro has quit [Ping timeout: 265 seconds]
Alina-malina has joined #ruby
akaiiro has joined #ruby
Ethan has quit [Quit: ZNC 1.7.0+deb0+bionic1 - https://znc.in]
cadillac_ has quit [Quit: I quit]
braincrash has quit [Quit: bye bye]
r29v has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r29v has quit [Client Quit]
kapil___ has joined #ruby
BloopMonster has joined #ruby
braincrash has joined #ruby
herbmillerjr has quit [Quit: Konversation terminated!]
kryptoz has quit [Remote host closed the connection]
eletious has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
Ethan has joined #ruby
akkiguru has joined #ruby
Ethan has quit [Client Quit]
Guest64032 has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
Nicmavr is now known as Guest73109
karapetyan has joined #ruby
nicht has quit [Ping timeout: 256 seconds]
donofrio has joined #ruby
starseed0000 has quit [Ping timeout: 255 seconds]
karapetyan has quit [Ping timeout: 260 seconds]
caleBOT has joined #ruby
zlogan2003 has joined #ruby
mynameisdebian has joined #ruby
kryptoz has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
kryptoz has quit [Remote host closed the connection]
starseed0000 has joined #ruby
donofrio has quit [Remote host closed the connection]
roamingdog has quit []
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
caleBOT has quit [Remote host closed the connection]
Xeago_ has joined #ruby
kvda has quit [Quit: Textual IRC Client: www.textualapp.com]
Xeago has quit [Ping timeout: 240 seconds]
Xeago_ is now known as Xeago
mynameisdebian has quit [Remote host closed the connection]
akkiguru has quit [Ping timeout: 256 seconds]
donofrio has joined #ruby
zlogan2003 has quit [Ping timeout: 240 seconds]
Axy has quit [Ping timeout: 248 seconds]
brettgilio has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
brettgilio has quit [Remote host closed the connection]
brettgilio has joined #ruby
Anthony_Bourdain has quit [Quit: Such jupe, many nick, w0w...]
brettgilio has quit [Remote host closed the connection]
bradleyprice has joined #ruby
rshetty has joined #ruby
nowhere_man has joined #ruby
bradleyprice has quit [Ping timeout: 268 seconds]
anisha has joined #ruby
ur5us has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
r29v has joined #ruby
AJA4350 has quit [Quit: AJA4350]
unshackled has joined #ruby
DTZUZO has joined #ruby
ramfjord has joined #ruby
rshetty has joined #ruby
Asher has quit [Quit: Leaving.]
sauvin has joined #ruby
rshetty has quit [Ping timeout: 245 seconds]
Asher has joined #ruby
mikhael_k33hl has joined #ruby
<mikhael_k33hl> I'm using sinatra and I have an init.rb inside a folder. How do I require or include all other files inside the folder within my init.rb? Dir[__dir__].each {|file| require file} doesn't seem to work
dionysus69 has joined #ruby
r29v has quit [Quit: r29v]
<mikhael_k33hl> I guess I'll go with Dir[File.basename(File.join(__dir__, '*.rb'))].each do |file| , thought there was a more elegant way to do it. :(
<mikhael_k33hl> typo, that was suppose to be :)
mikhael_k33hl has left #ruby [#ruby]
aiguuu has joined #ruby
wget has quit [Ping timeout: 240 seconds]
wget has joined #ruby
wget has quit [Changing host]
wget has joined #ruby
Inline has quit [Quit: Leaving]
aceruser has joined #ruby
mynameisdebian has joined #ruby
pwnd_nsfw` has joined #ruby
tolerablyjake has joined #ruby
pwnd_nsfw has quit [Ping timeout: 264 seconds]
aupadhye has joined #ruby
tolerablyjake has quit [Client Quit]
alex`` has joined #ruby
hfp_work has quit [Ping timeout: 264 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
erratic has quit [Ping timeout: 240 seconds]
taylorzr has quit [Ping timeout: 245 seconds]
apeiros has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 268 seconds]
jraavis has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
hfp_work has joined #ruby
andikr has joined #ruby
rshetty has joined #ruby
rshetty has quit [Ping timeout: 255 seconds]
dionysus69 has joined #ruby
rshetty has joined #ruby
amar has joined #ruby
mtkd has joined #ruby
konsolebox has quit [Ping timeout: 248 seconds]
amar has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
aceruser has quit [Ping timeout: 240 seconds]
aceruser has joined #ruby
cgfbee has quit [Remote host closed the connection]
Technato1 has joined #ruby
Technato1 has quit [Ping timeout: 265 seconds]
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
cgfbee has joined #ruby
Technato1 has joined #ruby
chkhanch has quit [Ping timeout: 256 seconds]
rshetty has quit [Remote host closed the connection]
caleBOT_ has joined #ruby
yohji has joined #ruby
Technato1 has quit [Ping timeout: 265 seconds]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
pauliesaint has joined #ruby
weaksauce has quit [Ping timeout: 240 seconds]
akaiiro has quit [Ping timeout: 265 seconds]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
sysvalve has joined #ruby
vindvaki has joined #ruby
vindvaki has quit [Client Quit]
akkiguru has joined #ruby
crankharder has quit [Ping timeout: 264 seconds]
claudiuinberlin has joined #ruby
caleBOT_ has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
apeiros has joined #ruby
TomyWork has joined #ruby
biberu has joined #ruby
rshetty has joined #ruby
graphene has quit [Remote host closed the connection]
BloopMonster has quit [Ping timeout: 240 seconds]
graphene has joined #ruby
Burgestrand has joined #ruby
mozzarella has quit [Quit: WeeChat 2.0.1]
clemens3 has joined #ruby
kryptoz has joined #ruby
ramfjord has quit [Ping timeout: 265 seconds]
akkiguru has quit [Ping timeout: 256 seconds]
akkiguru has joined #ruby
Dbugger has joined #ruby
Mike11 has joined #ruby
guille-moe has joined #ruby
lele has quit [Ping timeout: 256 seconds]
schleppel has joined #ruby
conta has joined #ruby
kryptoz has quit [Remote host closed the connection]
lele has joined #ruby
ramfjord has joined #ruby
sylario has joined #ruby
bradleyprice has joined #ruby
aiguuu has quit [Quit: leaving]
mozzarella has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
bradleyprice has quit [Ping timeout: 248 seconds]
graphene has quit [Remote host closed the connection]
amar has joined #ruby
amar has quit [Read error: Connection reset by peer]
graphene has joined #ruby
naku has joined #ruby
amar has joined #ruby
Mia has quit [Ping timeout: 256 seconds]
<naku> I have problems with irb / rails console on linux. Sometimes when i type it starts inseting \r and empty space. Like: Shift.where(asd: "dd")\r .where(something_else: "dd")\r
jraavis has joined #ruby
<havenwood> mikh, ah, they left. anyhoo: Dir.glob('*.rb', base: __dir__) { |filename| require filename }
<havenwood> naku: Does it still happen if you disable Spring?
<havenwood> export DISABLE_SPRING
<havenwood> export DISABLE_SPRING=1
<naku> okay set it and try to reproduce
caleBOT_ has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<naku> echo $DISABLE_SRING
<naku> 1
<naku> irb(main):002:0> Driver.select(:id, :name).joins(:shifts)..merge(Shift.in_time_range(Time.now - 6.hours, Time.now + 30.minutes)).merge(Shift.normal)\r .merge(Shift.in_time_range(Time.now - 6.hours, Time.now + 30.minutes)).merge(Shift.normal)\r .merge(Shift.in_time_range(Time.now - 6.hours, Time.now +
<naku> 30.minutes)).merge(Shift.normal)\r
<naku> Still nasty stuff in console
<naku> btw. echo $DISABLE_SPRING outputs 1
<havenwood> naku: Does `spring stop` say it's stopped? Maybe not Spring-related.
<naku> it says: Spring is not running
<naku> I really have no idea why this happens
<havenwood> naku: You might want to also try the #RubyOnRails channel.
<havenwood> naku: Sounds like a Readline issue, but I don't know what's going on.
caleBOT_ has quit [Ping timeout: 268 seconds]
<havenwood> naku: Time to switch to Pry? :-P
<naku> haha! Hmmm...
Xiti has quit [Quit: Xiti]
Xiti has joined #ruby
<naku> From "i dont care" to "pry is the best" in 5 minutes.
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
naku has left #ruby ["Leaving"]
<apeiros> havenwood: what what whaaaat? Dir.glob has a base kwarg? OMIGOSH THIS IS AWESOME!
<apeiros> so much annoying code I can cut out, aaahahaha, niiice!
<havenwood> apeiros: Recent addition! :-D
reber has joined #ruby
<havenwood> apeiros: And: Dir[blarg, base: '...']
<apeiros> hm? Dir::[] is Dir.glob, so that's expected?
<havenwood> apeiros: yeah, Dir.glob with File::FNM_SHORTNAME and no block
tty has joined #ruby
<apeiros> o0
<havenwood> >> File.constants.grep /\AFNM/
<ruby[bot]> havenwood: # => [:FNM_NOESCAPE, :FNM_PATHNAME, :FNM_DOTMATCH, :FNM_CASEFOLD, :FNM_EXTGLOB, :FNM_SYSCASE, :FNM_SHORTN ...check link for more (https://eval.in/1032599)
<apeiros> now you make me look up File::FNM_SHORTNAME
<apeiros> "Valid only on Microsoft Windows" ok
<apeiros> that went right to /brain/trash
<havenwood> haha, yeah - that's as far as i got with it too
<havenwood> the DOTMATCH is interesting - actually matches . and ..
<havenwood> Dir.glob('??', File::FNM_DOTMATCH).include?('..') #=> true
chkhanch has joined #ruby
def_jam has quit [Read error: Connection reset by peer]
NL3limin4t0r_afk is now known as NL3limin4t0r
<havenwood> >> File.fnmatch('?', '/', File::FNM_PATHNAME)
<ruby[bot]> havenwood: # => false (https://eval.in/1032620)
<havenwood> >> File::FNM_PATHNAME | File::FNM_DOTMATCH
<ruby[bot]> havenwood: # => 6 (https://eval.in/1032624)
def_jam has joined #ruby
eb0t has joined #ruby
graphene has quit [Read error: Connection reset by peer]
amar has quit [Ping timeout: 260 seconds]
graphene has joined #ruby
eblip has quit [Ping timeout: 240 seconds]
<havenwood> interesting they just use bitwise OR of the consts for the flags
<havenwood> >> File.constants.grep(/\AFNM/).reduce(0) { |acc, const| acc | File.const_get(const) }
<ruby[bot]> havenwood: # => 31 (https://eval.in/1032635)
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
ur5us has joined #ruby
starseed0000 has quit [Ping timeout: 245 seconds]
kapil___ has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
rann has quit []
rann has joined #ruby
rajdesai has joined #ruby
camilasan has quit [Ping timeout: 264 seconds]
camilasan has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
rawste has joined #ruby
camilasan has joined #ruby
rajdesai has quit [Remote host closed the connection]
ur5us has joined #ruby
kapil___ has quit []
rippa has joined #ruby
kapil___ has joined #ruby
cabotto has joined #ruby
pauliesaint has quit [Ping timeout: 240 seconds]
darkhanb has quit [Ping timeout: 248 seconds]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
DarkUnicorn has quit []
DarkUnicorn has joined #ruby
rajdesai has joined #ruby
BloopMonster has joined #ruby
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
cabotto has quit [Remote host closed the connection]
tvw has joined #ruby
Mike11 has quit [Quit: Leaving.]
TomyWork has quit [Quit: Leaving]
ineb has quit [Quit: WeeChat 2.1]
conta has quit [Quit: conta]
Nomekrax has left #ruby ["!invoke void"]
craysiii has quit []
craysiii has joined #ruby
rajdesai has quit [Remote host closed the connection]
<apeiros> havenwood: that's common for C flag stuff
jraavis has joined #ruby
<zenspider> yup yup. summable enums
<zenspider> you see the same thing all across unix. file perms, etc.
<apeiros> yepp. bitfields. convenient stuff for set behaviour.
n3b has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 248 seconds]
cabotto has joined #ruby
chmurifree is now known as chmuri
FernandoBasso has joined #ruby
caleBOT has joined #ruby
cabotto has quit [Ping timeout: 264 seconds]
n3b has joined #ruby
Sina has quit []
Sina has joined #ruby
KnownSyntax has quit []
KnownSyntax has joined #ruby
caleBOT has quit [Ping timeout: 240 seconds]
cyberg has joined #ruby
cabotto has joined #ruby
cabotto has quit [Remote host closed the connection]
Es0teric has joined #ruby
biberu has quit []
rajdesai has joined #ruby
lele has quit [Ping timeout: 245 seconds]
akkiguru has quit [Ping timeout: 240 seconds]
herbmillerjr has joined #ruby
lele has joined #ruby
cabotto has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
jrafanie has joined #ruby
cabotto has quit []
tty has quit [Quit: tty]
pauliesaint has joined #ruby
bradleyprice has joined #ruby
rajdesai has quit [Remote host closed the connection]
chmuri has quit [Excess Flood]
chmurifree has joined #ruby
rajdesai has joined #ruby
bradleyprice has quit [Ping timeout: 276 seconds]
TinkerT has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
TinkerT has joined #ruby
pauliesaint has quit [Remote host closed the connection]
pauliesaint has joined #ruby
eb0t is now known as eblip
\void has quit [Quit: So long, and thanks for all the fish.]
pauliesaint has quit [Remote host closed the connection]
hfp_work has quit [Quit: bye]
pauliesaint has joined #ruby
pauliesaint has left #ruby [#ruby]
pauliesaint has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
pauliesaint has quit [Remote host closed the connection]
pauliesaint has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
ldnunes has joined #ruby
Technato1 has joined #ruby
karapetyan has joined #ruby
def_jam is now known as eb0t
kryptoz has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
bak1an has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
pauliesaint has quit [Remote host closed the connection]
pauliesaint has joined #ruby
Technato1 has quit [Ping timeout: 265 seconds]
Technato1 has joined #ruby
aceruser has quit [Ping timeout: 265 seconds]
jcalla has joined #ruby
ramfjord has joined #ruby
hfp_work has joined #ruby
tvw has quit []
Inline has joined #ruby
chkhanch has quit [Ping timeout: 240 seconds]
yqt has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
bradleyprice has joined #ruby
epochwolf has quit []
epochwolf has joined #ruby
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
kryptoz has quit [Remote host closed the connection]
fmcgeough has joined #ruby
rajdesai has quit [Remote host closed the connection]
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
bradleyprice has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
rajdesai has joined #ruby
jraavis has joined #ruby
Technato1 has quit [Ping timeout: 256 seconds]
agent_white has quit [Quit: leaving]
fmcgeough has quit [Quit: fmcgeough]
AJA4350 has joined #ruby
TomyWork has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
fmcgeough has joined #ruby
rshetty has joined #ruby
codymj has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
rajdesai has quit [Remote host closed the connection]
herbmillerjr has quit [Quit: Konversation terminated!]
rajdesai has joined #ruby
hanmac has quit [Ping timeout: 276 seconds]
anisha has quit [Ping timeout: 256 seconds]
fiftysix has joined #ruby
<fiftysix> hi!
<fiftysix> some years ago, i wrote a little script with a helpful library called Nokogiri ... is that still the simplest way of extracting info from (not too badly written) HTML? or should something else be used nowadays?
hanmac has joined #ruby
Technato1 has joined #ruby
_seanc_ has joined #ruby
rshetty has quit [Ping timeout: 260 seconds]
soniya29 has joined #ruby
simmaniac has joined #ruby
sysvalve has quit [Disconnected by services]
simmaniac is now known as sysvalve
simmaniac has joined #ruby
<quintasan> fiftysix: Nokogiri is still the go to library if you want to scrape HTML.
<fiftysix> okay, thank you quintasan! no need to scrape, i already have it downloaded to disk. just need to extract some info.
karapetyan has joined #ruby
bsamorim has joined #ruby
Hexafox[I] has quit [Quit: Leaving]
bmurt has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
bmurt has quit [Max SendQ exceeded]
bmurt has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
apparition has joined #ruby
Rapture has joined #ruby
soniya29 has quit [Ping timeout: 265 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
knight33 has joined #ruby
rawste has quit [Ping timeout: 245 seconds]
rikkipitt has joined #ruby
soniya29 has joined #ruby
<fiftysix> quintasan, is there a simple way to print just the text contained in a nokogiri result node?
<fiftysix> (i.e. without any <span>s or <em>s or whatever that might be contained in that text)
RougeR has quit [Ping timeout: 240 seconds]
<elomatreb> Doesn't #text do that?
rajdesai has quit [Remote host closed the connection]
caleBOT has joined #ruby
<fiftysix> elomatreb, aha! much better than #inner_html, thanks!
clemens3 has quit [Ping timeout: 240 seconds]
aupadhye has quit [Quit: Leaving]
bmurt has quit [Ping timeout: 255 seconds]
kapil___ has joined #ruby
Guest73109 has quit [Read error: Connection reset by peer]
<fiftysix> hmm, this one is more difficult now: <p><span>Blah</span>Foobar</p> ... i've already extracted "Blah", but now I want "Foobar" without the "Blah" ... is there a way to do that? Or do I have to somehow #remove the <span> first?
Nicmavr has joined #ruby
Nicmavr is now known as Guest51251
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
npgm has joined #ruby
<fiftysix> awesome, almost done. just need to put it into CSV
subr has joined #ruby
subroot has joined #ruby
<elomatreb> The standard library contains a pretty good CSV library
GodFather has quit [Ping timeout: 240 seconds]
BloopMonster has quit [Ping timeout: 265 seconds]
rikkipitt has quit [Quit: Leaving...]
<fiftysix> The result: https://gist.github.com/sixtyfive/aa636b7befcded15d8d19736cab8d087 (thank you again, elomatreb and quintasan!)
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
<apeiros> fiftysix: you… have directories which are named .html?!?
* apeiros needs to learn the short-cut for interrobang
YokoBR has joined #ruby
<elomatreb> Web site crimes
<apeiros> `info.scan(/(\n.*)/).last.first` --> just `info.scan(/\n.*/).last`
<fiftysix> apeiros, no.
<apeiros> fiftysix: then why `next if File.directory?(filename)`?
<apeiros> your glob guarantees that there'll ever only be things which end in ".html"
chkhanch has joined #ruby
<fiftysix> apeiros, omg how awkward! that's from a snippet I copied from StackExchange :-(
<YokoBR> hi there
<YokoBR> please, I'm receiving this error msg .rvm/gems/ruby-2.2.6/gems/activesupport-4.1.16/lib/active_support/dependencies.rb:247:in `require': incompatible library version - /home/jeff/.rvm/gems/ruby-2.2.6/gems/pg-0.17.1/lib/pg_ext.so (LoadError)
Mike11 has joined #ruby
Technato1 has quit [Ping timeout: 256 seconds]
<apeiros> YokoBR: is there a question in that?
Es0teric has joined #ruby
<YokoBR> sorry apeiros
<apeiros> no need to apologize. I'm just trying to help you getting help :)
elomatreb has quit [Quit: ZNC - https://znc.in]
elomatreb has joined #ruby
<YokoBR> I'm really new to ruby. Like, never used it. I'm helping a friend to move his app from a server to another, but it seems that his app is too outdated. I'm trying to fix the gems versions on Gemfile, but totally forgot to remove Gemfile.lock
<apeiros> you shouldn't really remove Gemfile.lock
<apeiros> instead you should use the appropriate bundler commands to upgrade the app as much as possible.
<apeiros> `bundle update` is usually a good first step (how good depends to a good bit on the quality of the Gemfile)
<YokoBR> I've remove it, removed some gems version requirements, but I'm stuck at this error activesupport-4.2.10/lib/active_support/dependencies.rb:274:in `require': incompatible library version - /home/jeff/.rvm/gems/ruby-2.2.6/gems/pg-1.0.0/lib/pg_ext.so (LoadError)
amar_ has joined #ruby
<apeiros> can you gist the full exception (that line is the most important, though)?
amar_ has quit [Ping timeout: 256 seconds]
<YokoBR> sure
veloutin has quit [Ping timeout: 244 seconds]
shinnya has joined #ruby
veloutin has joined #ruby
fiftysix has quit [Ping timeout: 256 seconds]
troys has joined #ruby
chkhanch has quit [Quit: Leaving]
chkhanch has joined #ruby
dviola has joined #ruby
anisha has joined #ruby
Burgestrand has quit [Quit: Closing time!]
jraavis has joined #ruby
amar_ has joined #ruby
discopatrick has joined #ruby
fiftysix has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
amar_ has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
soniya29 has quit [Ping timeout: 256 seconds]
soniya29 has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
akaiiro has joined #ruby
<apeiros> YokoBR: sorry, offline life interrupts me…
<YokoBR> apeiros: what is that "offline life"? never heard about it lol
eckhardt_ has joined #ruby
Es0teric has joined #ruby
troulouliou_dev has joined #ruby
karapetyan has joined #ruby
subr has quit [Read error: Connection reset by peer]
subroot has quit [Read error: Connection reset by peer]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
cagomez has joined #ruby
biberu has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
eletious has quit [Disconnected by services]
soniya29 has quit [Ping timeout: 256 seconds]
slm1 has joined #ruby
fiftysix has quit [Ping timeout: 256 seconds]
Zaab1t has joined #ruby
<apeiros> YokoBR: can you gist your Gemfile? it seems you are missing a `gem 'pg'` in it.
guille-moe has quit [Ping timeout: 260 seconds]
howdoi has joined #ruby
cthulchu has joined #ruby
<YokoBR> aspiers: it has gem pg. I was using only in production group, then I set it in general
tolerablyjake has joined #ruby
flips has quit [Quit: bbl ...]
mikecmpbll has joined #ruby
<apeiros> YokoBR: you can edit existing gists and add files
<apeiros> yeah, `rails server -e development` so your dev config says pg, so you need pg not only in prod.
fiftysix has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
TomyWork has quit [Remote host closed the connection]
<YokoBR> gems/pg-0.21.0/lib/pg.rb:4:in `require': incompatible library version - /home/jeff/.rvm/gems/ruby-2.2.6/gems/pg-0.21.0/lib/pg_ext.so (LoadError)
<apeiros> if you remember, that's the original error (just with slightly different versions), where I asked you for the full exception ;-)
<YokoBR> yep, I've just changed the pg version
<YokoBR> and ran it in development mode
loincloth has quit []
<YokoBR> but both production and development modes thrown the same error
<apeiros> which version is your postgres db?
lxsameer has quit [Ping timeout: 264 seconds]
andikr has quit [Remote host closed the connection]
<YokoBR> 9.1 I guess
<apeiros> "guess" is not good enough.
<apeiros> "It works with PostgreSQL 9.0 and later." is why I ask.
amar_ has joined #ruby
yohji has quit [Remote host closed the connection]
amar_ has quit [Ping timeout: 248 seconds]
fiftysix has quit [Ping timeout: 256 seconds]
karapetyan has quit [Remote host closed the connection]
apparition has quit [Quit: Bye]
<YokoBR> Oh, it's 9.0 or later for sure
<YokoBR> I'm just between 9.1 and 9.3
<zxq2> i'm trying to determine when IO::select might raise an IOError. the documentation i've looked at has been no help. any pointers?
jcarl43 has joined #ruby
alessand1o has joined #ruby
<apeiros> YokoBR: in that case, open a shell in a directory without gemfile and try whether the following works: `gem install pg; irb -r pg`
<zxq2> more generally, in ruby, it seems difficult in some cases to determine what exceptions a method might raise.
<apeiros> oh, actually it seems 1.0.0 is already out. so probably better `gem install -v 0.21.0 pg; irb -r pg`
dionysus69 has joined #ruby
<apeiros> zxq2: sadly that's true.
sysvalve has quit [Quit: Leaving]
<apeiros> other than code analysis, there's no real way. and code analysis even needs to consider underlying methods.
amar_ has joined #ruby
alessand1o has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<zxq2> gotcha thanks
codymj has quit [Remote host closed the connection]
cyberg has quit [Read error: Connection reset by peer]
<YokoBR> did it
<YokoBR> but same error
akaiiro has quit [Ping timeout: 260 seconds]
simmaniac has quit [Ping timeout: 255 seconds]
<apeiros> well then, I really need the full exception. so something goes with your pg gem. are you sure that there are no other installations or remnants of old installations of pg on your computer?
<apeiros> (the db, not the gem)
Zaab1t has quit [Quit: Zaab1t]
BloopMonster has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 276 seconds]
rshetty has joined #ruby
ramfjord has joined #ruby
discopatrick has quit []
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
discopatrick has joined #ruby
rawste has joined #ruby
r29v has joined #ruby
paraxial has quit [Ping timeout: 264 seconds]
ramfjord_ has joined #ruby
sameerynho has joined #ruby
paraxial has joined #ruby
scrptktty has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
canurabus has joined #ruby
<darix> omg it is apeiros
lytol has joined #ruby
<canurabus> Hi all. Im having some trouble understanding a ruby code snippet ( < 10 lines): https://8n1.org/13401/ee0b. This custom hash class overloads the [] method, but I don't understand what the 'inject' part is actually doing.
<canurabus> ive read the docs for inject, but I dont understand how its being used here or how to invoke the specialized [] method.
fiftysix has joined #ruby
fluxAeon has quit [Quit: Textual IRC Client: www.textualapp.com]
karapetyan has joined #ruby
lxsameer has joined #ruby
<Demos[m]> what's the convention for initialize methods that can initialize the class as if it were a dict?
<Demos[m]> I've just been doing def initialize(params = {}) @whatever = params.fetch(...) end
fluxAeon has joined #ruby
trippafagioli has joined #ruby
<trippafagioli> Hi, I'm pretty new at ruby and i was wondering, how can I tell ubuntu to run a ruby script whenever it boots up?
caleBOT has quit [Remote host closed the connection]
<havenwood> trippafagioli: These days, Ubuntu uses SystemD for startup init.
<havenwood> trippafagioli: Alternatively, you can trigger cronjobs on boot.
caleBOT has joined #ruby
fiftysix has quit [Ping timeout: 248 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
<trippafagioli> thanks a lot! I'll check and see if I can manage to run it
mikecmpbll has quit [Quit: inabit. zz.]
caleBOT has quit [Ping timeout: 255 seconds]
lxsameer has joined #ruby
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
apeiros has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 255 seconds]
cyberg has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
flips has joined #ruby
trippafagioli has quit [Ping timeout: 276 seconds]
claudiuinberlin has joined #ruby
lxsameer has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
soniya29 has joined #ruby
starseed0000 has joined #ruby
lxsameer has quit [Ping timeout: 265 seconds]
psychicist__ has joined #ruby
lxsameer has joined #ruby
petrichorx_ has joined #ruby
<elomatreb> canurabus: Still relevant?
rshetty has quit [Remote host closed the connection]
bsamorim has quit [Ping timeout: 240 seconds]
rshetty has joined #ruby
amar_ has quit [Remote host closed the connection]
amar_ has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
soniya29 has quit [Ping timeout: 245 seconds]
samosaphile has joined #ruby
soniya29 has joined #ruby
lxsameer has joined #ruby
akaiiro has joined #ruby
<samosaphile> hey, any idea how to write something in ruby which takes hex and converts to IP? like ... example input: 55905E48 desired output: 85.144.94.72
lxsameer has quit [Ping timeout: 256 seconds]
<Zarthus> irb(main):008:0> IPAddr.new "55905E48".hex, Socket::AF_INET
<Zarthus> => #<IPAddr: IPv4:85.144.94.72/255.255.255.255>
clemens3 has joined #ruby
BloopMonster has quit [Ping timeout: 256 seconds]
GodFather has joined #ruby
akaiiro has quit [Ping timeout: 248 seconds]
rawste has quit [Quit: Sleep....]
lxsameer has joined #ruby
<samosaphile> oh, didn't know it'd be that easy
<samosaphile> but what if you wanted to ignore the 255 part or not print/show it
<havenwood> >> '55905E48'.scan(/../).map(&:hex).join('.')
<Zarthus> that's just the return value of IPAddr#inspect
<ruby[bot]> havenwood: # => "85.144.94.72" (https://eval.in/1032980)
dionysus69 has quit [Ping timeout: 260 seconds]
<havenwood> >> IPAddr.new("55905E48".hex, Socket::AF_INET).to_s
<ruby[bot]> havenwood: # => uninitialized constant IPAddr (NameError) ...check link for more (https://eval.in/1032981)
<havenwood> #=> "85.144.94.72"
dionysus69 has joined #ruby
amar_ has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 248 seconds]
petrichorx_ has quit []
rawste has joined #ruby
petrichorx_ has joined #ruby
<havenwood> >> ['55905E48'].pack('H*').unpack('C*').join('.')
<ruby[bot]> havenwood: # => "85.144.94.72" (https://eval.in/1032982)
caleBOT_ has joined #ruby
<havenwood> >> ['55905E48'].pack('H*').bytes.join
<ruby[bot]> havenwood: # => "851449472" (https://eval.in/1032983)
<havenwood> >> ['55905E48'].pack('H*').bytes.join('.')
<ruby[bot]> havenwood: # => "85.144.94.72" (https://eval.in/1032984)
<havenwood> samosaphile: Those ^ are a few ways.
<samosaphile> wow, thanks so much havenwood and Zarthus
lxsameer has joined #ruby
mniip has quit [Ping timeout: 624 seconds]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
GodFather_ has joined #ruby
karapetyan has quit [Remote host closed the connection]
<samosaphile> ...no idea how that works tho ._.
bsamorim has joined #ruby
<elomatreb> On the other hand, IPAddr can also deal correctly with IPv6 addresses
<havenwood> samosaphile: Happy to help you understand if you're interested.
lxsameer has quit [Ping timeout: 260 seconds]
trippafagioli has joined #ruby
karapetyan has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> samosaphile: This one, for example: '55905E48'.scan(/../).map(&:hex).join('.')
jrafanie has joined #ruby
<havenwood> samosaphile: '55905E48'.scan(/../) #=> ["55", "90", "5E", "48"]
<samosaphile> havenwood: im interested .. just don't know where to begin.. like i really don't understand any of it :/
<havenwood> samosaphile: So you scan for every two characters, which is one hex octet.
<havenwood> samosaphile: Do you know what hex is?
<samosaphile> ye, like base 16
dionysus69 has quit [Quit: dionysus69]
<havenwood> samosaphile: Yup, so two chars are from "00" (0) to "FF" (255).
<havenwood> >> '00'.hex
<ruby[bot]> havenwood: # => 0 (https://eval.in/1032986)
<havenwood> >> 'FF'.hex
<ruby[bot]> havenwood: # => 255 (https://eval.in/1032987)
<samosaphile> i see..
<havenwood> samosaphile: So if you map every two characters to the hex value: ["55", "90", "5E", "48"].map(&:hex) #=> [85, 144, 94, 72]
<havenwood> >> '55'.hex
<ruby[bot]> havenwood: # => 85 (https://eval.in/1032988)
dionysus69 has joined #ruby
<havenwood> samosaphile: Then you can turn an Array into a String: [85, 144, 94, 72].join('.') #=> "85.144.94.72"
<havenwood> samosaphile: Put it together, and: '55905E48'.scan(/../).map(&:hex).join('.')
<havenwood> samosaphile: Every two characters (each octet), mapped to hex, and joined by dots.
karapetyan has quit [Ping timeout: 260 seconds]
<havenwood> samosaphile: the `/../` is Regexp, if you're not familiar.
<elomatreb> And the difference between the hex number and the dotted-decimal notation is really just notational convention, they all just represent a 32-bit integer
<havenwood> same with the bytes too
<elomatreb> dotted-decimal used to be more relevant when we had subnet classes, but CIDR subnets don't have to stick to the "boundaries" it shows
<samosaphile> going to ask noob questions
<havenwood> Speaking of packing an unpacking, the previous feedback on my silly project was great. If anyone else has suggestions, I'm all ears!: https://github.com/havenwood/digest-sip_hash/blob/master/lib/digest/sip_hash.rb
<havenwood> 'somepseudorandomlygeneratedbytes' seems not so psuedo-random ;-P
<samosaphile> when you did >> '55'.hex <-- what does the dot behind hex do? dot = method? is there a way to find like a list of like dot commands in ruby intrepreter?
soniya29_ has joined #ruby
<havenwood> samosaphile: It's syntax that denotes calling a method.
<samosaphile> k
whathappens has joined #ruby
<Zarthus> havenwood: it doens't get said enough, but you (and a lot of the ruby ops) really go the extra mile when it comes to offering support. It's really nice to see, and on behalf of myself and probably all the lost souls you've helped; Thank you.
<elomatreb> Ruby syntax allows you to leave the parentheses off method calls, '55'.hex is equivalent to '55'.hex(), which may be a little more familiar if you're coming from other languages
<havenwood> Zarthus: I appreciate the kind words. Thank you for helping too!!
<samosaphile> sorry, am abit slow... this probably going to take me like 2 weeks to actually get it lol
<samosaphile> :/
<havenwood> samosaphile: '55' is the "receiver" of the method call. You "send" it a method call, and it "responds".
soniya29 has quit [Ping timeout: 256 seconds]
<samosaphile> ok
<havenwood> samosaphile: String#hex is the method. The class of '55' is String.
<havenwood> >> '55'.class
<ruby[bot]> havenwood: # => String (https://eval.in/1032989)
<havenwood> '55'.method(:hex).owner
<havenwood> #=> String
<havenwood> >> '55'.respond_to? :hex
<ruby[bot]> havenwood: # => true (https://eval.in/1032990)
<havenwood> >> '55'.send :hex
<ruby[bot]> havenwood: # => 85 (https://eval.in/1032991)
trippafagioli has quit [Quit: Lost terminal]
<havenwood> samosaphile: It kinda looks like gibberish, but if you want to see how Ruby is parsing the code, you can enable a debug mode to look at each rule of parse.y (the Yacc grammar) that's being used: ruby -yydebug -e "'55'.hex"
<havenwood> samosaphile: You can see how Ruby is lexing and parsing the code:
<havenwood> >> require 'ripper'; Ripper.lex "'55'.hex"
<ruby[bot]> havenwood: # => [[[1, 0], :on_tstring_beg, "'"], [[1, 1], :on_tstring_content, "55"], [[1, 3], :on_tstring_end, "'"] ...check link for more (https://eval.in/1032992)
<havenwood> >> require 'ripper'; Ripper.sexp "'55'.hex"
<ruby[bot]> havenwood: # => [:program, [[:call, [:string_literal, [:string_content, [:@tstring_content, "55", [1, 1]]]], :".", [ ...check link for more (https://eval.in/1032993)
whathappens has quit [Remote host closed the connection]
<havenwood> samosaphile: Note, at the lexing step, Ruby doesn't know what the dot does yet, just that it's a dot: :on_period, "."
<samosaphile> i'm actually still confused over <Zarthus> that's just the return value of IPAddr#inspect like where do you add #inspect in irb(main):008:0> IPAddr.new "55905E48".hex, Socket::AF_INET => #<IPAddr: IPv4:85.144.94.72/255.255.255.255>
<Zarthus> It's implicit
<Zarthus> irb (the REPL I was using) automatically calls #inspect on the last returned value
<havenwood> It's only once the grammar is parsed that the dot becomes a method call:
<havenwood> >> RubyVM::InstructionSequence.compile("'55'.hex").to_a.last
<ruby[bot]> havenwood: # => [1, [:trace, 1], [:putstring, "55"], [:opt_send_without_block, {:mid=>:hex, :flag=>16, :orig_argc=>0 ...check link for more (https://eval.in/1032994)
<Zarthus> I'm not sure if that is helping his confusion, havenwood :P
<samosaphile> IPAddr.new("55905E48".hex, Socket::AF_INET).to_s <- this does work tho... not sure why doing .to_s makes it ignore 255 part
<Zarthus> samosaphile: .to_s is short for "to_string", a method defined in IPAddr meant to convert the value to a normal string
<havenwood> Zarthus: Yeah, probably not. Sometimes it's nice to have a bit of context that's over your head though, rather than nothing.
<havenwood> Zarthus: If the question of "what is this dot!??!" is burning enough.
<Zarthus> :)
<samosaphile> lol
<havenwood> Sometimes you just need to know enough to know that you don't care to know more. ;-P
<Zarthus> next week we'll dive into the assembly of it all :P
<havenwood> wheee!
starseed0000 has quit [Remote host closed the connection]
starseed0000 has joined #ruby
whathappens has joined #ruby
<Zarthus> samosaphile: in laymans terms, think of #inspect as "give me some value that I can use for debugging", and #to_s as "give me something I can use/read", though it's not true for all scenarios
<havenwood> First gem I've seen using RubyVM::AST.parse: https://github.com/ioquatix/covered
<Zarthus> i can't believe he managed to get the gem name "covered"
pauliesaint has quit [Ping timeout: 245 seconds]
jrich523_ has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
jrich523 has quit [Ping timeout: 260 seconds]
bradleyprice has joined #ruby
jrich523_ has quit [Ping timeout: 240 seconds]
mniip has joined #ruby
sauvin has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tolerablyjake has joined #ruby
caleBOT_ has quit [Read error: Connection reset by peer]
<samosaphile> too much new info at same time, braincrashed x_x..
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<samosaphile> gg
amar has joined #ruby
knight33 has joined #ruby
nicht has joined #ruby
fiftysix has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
bradleyp_ has joined #ruby
bradleyp_ has quit [Remote host closed the connection]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mynameisdebian has joined #ruby
bradleyprice has quit [Ping timeout: 265 seconds]
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #ruby
bradleyprice has joined #ruby
mtkd has quit []
mikecmpbll has joined #ruby
fiftysix has quit [Ping timeout: 240 seconds]
hfp_work has quit [Quit: bye]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r29v has quit [Quit: r29v]
zlogan2003 has joined #ruby
starseed0000 has quit [Ping timeout: 265 seconds]
dionysus69 has quit [Quit: dionysus69]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
soniya29_ has quit [Quit: Leaving]
BloopMonster has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
za1b1tsu has joined #ruby
caleBOT has joined #ruby
tolerablyjake has joined #ruby
guille-moe has joined #ruby
hfp_work has joined #ruby
discopatrick has quit [Quit: Connection closed for inactivity]
hfp_work has quit [Client Quit]
blackmesa has joined #ruby
fredlinhares has joined #ruby
cthulchu_ has joined #ruby
starseed0000 has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
cthulchu has quit [Ping timeout: 268 seconds]
petrichorx_ has quit [Quit: Connection closed for inactivity]
mtkd has joined #ruby
blackmesa1 has joined #ruby
graphene has quit [Remote host closed the connection]
pauliesaint has joined #ruby
graphene has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
quobo has joined #ruby
blackmesa1 has quit [Ping timeout: 256 seconds]
FernandoBasso has quit [Quit: Page closed]
cincy_kal has joined #ruby
tdy has joined #ruby
<cincy_kal> Can anyone give me insight into running methods asynchronously?
<cincy_kal> lets say you have a large amount of data being aggregated in a method. The method does something like:
tty has joined #ruby
<cincy_kal> 1. get base object: User 2. get user contact info 3. get user posts 4. get user comments 5. get user upvotes 6. get user downvotes, etc and then you return that all in an aggregated data structure
blackmesa1 has joined #ruby
<elomatreb> Ruby itself does not offer any async features beyond bare threads, you'll want to check out a gem like concurrent-ruby that offers e.g. a Promise implementation
<cincy_kal> if each step of the method takes a while (for example's sake lets say 2 seconds), then you have 12+ seconds of execution. Now if you could spawn each of those steps off asynchronously, it would go much faster
<havenwood> cincy_kal: Are you talking about Rails queries?
<cincy_kal> not necessarily. basically I have a larger complicated database. running a report requires aggregating this data. I do have concurrent-ruby gem and tried using Concurrent::Future but any time i get the value it is always nil whereas if i do it without async i get the values just fine
gnufied__ has joined #ruby
<havenwood> cincy_kal: Are you talking ActiveRecord here?
<havenwood> Sequel?
<cincy_kal> I use Sequel
<havenwood> cincy_kal: concurrent-ruby should work fine with Sequel - have a gist of your futures code?
ur5us has joined #ruby
<cincy_kal> i can make one real quick
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #ruby
<havenwood> cincy_kal: 12+ seconds sounds like something that needs query optimizations, or if that's not possible, maybe jobs for workers that get returned via channels
<havenwood> cincy_kal: what DB?
<havenwood> cincy_kal: what web framework?
<havenwood> multiple seconds is too many seconds!
<elomatreb> Or too many records :P
ur5us has quit [Ping timeout: 255 seconds]
biberu has quit []
<cincy_kal> sequel, postgresql, padrino
^mtkd has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
hfp_work has joined #ruby
<cincy_kal> I agree multiple seconds is too many. there is a LOT of data spread among tables, but also mutations that data goes through. I have eagerloaded as much of the data as possible.
hfp_work has quit [Client Quit]
za1b1tsu has quit [Ping timeout: 240 seconds]
caleBOT has quit [Remote host closed the connection]
Es0teric has quit [Quit: Computer has gone to sleep.]
<havenwood> cincy_kal: Are your pg index and cache hit rate approaching 100%?
tvw has joined #ruby
<cincy_kal> its indexed. and i exaggerated the times a bit, I was mostly looking for some insight into splitting the logic asynchronously
za1b1tsu has joined #ruby
blackmesa1 has quit [Ping timeout: 256 seconds]
Es0teric has joined #ruby
cincy_kal has quit [Ping timeout: 252 seconds]
r29v has joined #ruby
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
lele has quit [Ping timeout: 265 seconds]
lele has joined #ruby
<canurabus> saw this description the ruby docs for object.instance_variable_set: Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class's author to attempt to provide proper encapsulation. The variable did not have to exist prior to this call."
<canurabus> :)
<bougyman> aa/69
ur5us has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
knight33 has joined #ruby
knight33 has quit [Client Quit]
kapil___ has quit [Quit: Connection closed for inactivity]
schleppel has quit [Read error: Connection reset by peer]
zenspider has quit [Read error: Connection reset by peer]
zenspider has joined #ruby
za1b1tsu has quit [Ping timeout: 264 seconds]
clemens3 has quit [Ping timeout: 256 seconds]
YokoBR has quit [Ping timeout: 252 seconds]
noobineer has quit [Remote host closed the connection]
zenspider has quit [Changing host]
zenspider has joined #ruby
naftilos76 has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
blackmesa1 has joined #ruby
sameerynho has quit [Ping timeout: 256 seconds]
naftilos76 has quit [Quit: Leaving]
r29v has quit [Quit: r29v]
sotrhraven has joined #ruby
<sotrhraven> Hello
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<sotrhraven> I know that ruby runs on a vm and they are working on a jit compiler. Would it be possible to have backend compiling? To say gcc, similar to what nim is doing with their compiler.
clemens3 has joined #ruby
hfp_work has joined #ruby
noobineer has joined #ruby
hfp_work has quit [Client Quit]
canurabus has quit [Quit: Leaving]
jrafanie has joined #ruby
caleBOT has joined #ruby
zlogan85 has joined #ruby
zlogan2003 has quit [Read error: Connection reset by peer]
noobineer has quit [Ping timeout: 256 seconds]
hfp_work has joined #ruby
clemens3 has quit [Remote host closed the connection]
kujira has joined #ruby
kujira has quit [Client Quit]
hays_ has quit [Ping timeout: 256 seconds]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
alex`` has quit [Quit: WeeChat 2.1]
<zenspider> sotrhraven: yes and no. to what end? why are you asking?
psychicist__ has quit [Ping timeout: 265 seconds]
hfp_work has quit [Quit: bye]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<sotrhraven> well, you could get the speed of a compiled binary. Also targeting several back ends such as clang, js etc...
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sotrhraven> It feels backwards to me tbh seeing that ruby is written in c. Also ffi with those backend languages would be much easier.
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
jrafanie has joined #ruby
hfp_work has joined #ruby
jrafanie has quit [Client Quit]
lele has quit [Ping timeout: 256 seconds]
<sotrhraven> I am curious. Been looking at other languages and how things have been done. Ruby is my favorite.
jrafanie has joined #ruby
lele has joined #ruby
venmx has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
paraxial has joined #ruby
tolerablyjake has quit [Remote host closed the connection]
jrafanie has quit [Client Quit]
<zenspider> sotrhraven: no. "compiling" doesn't necessarily imply speed. Ruby is incredibly dynamic and does a bunch of stuff that makes in inherently slow(er). Nor would it mean much of anything to FFI (I'm not even sure what you are implying there).
jrafanie has joined #ruby
venmx has quit [Ping timeout: 240 seconds]
samosaphile has quit [Ping timeout: 252 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<konsolebox> sotrhraven: you can also write c++
<sotrhraven> ok not implying anything. I must just not understand the topic.
<sotrhraven> yes, c++ I might go do that
<sotrhraven> sorry like I said was just wandering, I seem to have wandered to far
ur5us has quit [Ping timeout: 240 seconds]
mynameisdebian has quit [Remote host closed the connection]
lele has quit [Ping timeout: 256 seconds]
lele has joined #ruby
^mtkd has quit []
tdy has quit [Ping timeout: 255 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ldnunes has quit [Quit: Leaving]
lytol has quit [Remote host closed the connection]
tdy has joined #ruby
kujira has joined #ruby
chkhanch has quit [Ping timeout: 240 seconds]
InfinityFye has joined #ruby
InfinityFye has left #ruby [#ruby]
whathappens has quit [Remote host closed the connection]
raynold has joined #ruby
sameerynho has joined #ruby
<zenspider> sotrhraven: "you could get the speed of a compiled binary" yeah, you kinda are. but it's no big deal, just needs clarifying
akaiiro has joined #ruby
<elomatreb> If you want a Ruby-like syntax that compiles to what I think you mean you might check out Crystal
<sotrhraven> elomatreb: I have looked into Crystal. Currently I have problems running it on my distro.
<elomatreb> I can't really help with that, sorry
<Demos[m]> hm looking at it now
<Demos[m]> I've used nim quite a bit
<sotrhraven> no worries, I will get back to figuring out Nim.
<sotrhraven> Ruby will always be my favorite though
<Demos[m]> yeah I just learned ruby over the past month or so and it's like lisp but extremely no parentheses
<Demos[m]> also ruby tooling <3
<elomatreb> Lisp used up the Strategic Parentheses Reserve
rawste has quit [Quit: Sleep....]
<sotrhraven> yes, blocks are awesome, and the tooling is excellent
<sotrhraven> also the expressiveness
<Demos[m]> yeah the flexable syntax
<Demos[m]> nim has that too, at least a bit
<sotrhraven> true
Mia has quit [Ping timeout: 256 seconds]
<sotrhraven> gonna go grab some grub, also I am in florida and just heard some wicked thunder. Nice talking to all of you.
reber has quit [Remote host closed the connection]
sotrhraven has quit [Quit: Konversation terminated!]
tdy has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
BloopMonster has quit [Ping timeout: 240 seconds]
caleBOT__ has joined #ruby
mynameisdebian has joined #ruby
ellcs has joined #ruby
whathappens has joined #ruby
RougeR has joined #ruby
caleBOT has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
whathappens has quit [Ping timeout: 265 seconds]
taylorzr has joined #ruby
zlogan85 has quit [Ping timeout: 256 seconds]
starseed0000 has quit [Ping timeout: 245 seconds]
d5sx43 has joined #ruby
d5sx43 has quit [Client Quit]
rshetty has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
starseed0000 has joined #ruby
bsamorim has quit [Ping timeout: 240 seconds]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cyberg has quit [Remote host closed the connection]
r29v has joined #ruby
r29v has quit [Client Quit]
Dbugger has quit [Quit: Leaving]
donald has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
taylorzr has quit [Ping timeout: 256 seconds]
donald has left #ruby [#ruby]
cthulchu_ has quit [Ping timeout: 248 seconds]
mynameisdebian has quit [Remote host closed the connection]
zachk has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
amar has quit [Remote host closed the connection]
whathappens has joined #ruby
whathappens has quit [Client Quit]
\void has joined #ruby
npgm has quit [Quit: Connection closed for inactivity]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
bradleyprice has quit [Remote host closed the connection]