havenwood changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.9: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || logs @ http://irclog.whitequark.org/ruby/
tatsuo has quit [Remote host closed the connection]
<banister> bougyman doesnt it do exactly what he said
<banister> "Must specify both proxyPort and proxyHost (or neither)"
<banister> both true, or both false
<bougyman> yes, it seems to.
<bougyman> but farking confusing.
<bougyman> trying to save keystrokes, I guess?
<bougyman> or is this an idiom i'm just dumb to?
<banister> bougyman it's stupid, you can just use ==
<banister> !!foo == !!bar
freerobby has joined #ruby
lightt has quit [Ping timeout: 276 seconds]
<banister> same thing
<bougyman> ok, but the double-bang is the right choice here?
nadir has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<banister> wait, xor does the opposite
<banister> sorry
<bougyman> banister: that's wrong.
<banister> oh got it cos it's if rather than unless
<bougyman> yeah.
bmorrison has joined #ruby
<banister> so you could rewrite it as: raise "foo" unless !!foo == !!bar
<banister> so == is the opposite of ^
jancel has quit [Remote host closed the connection]
<banister> foo == bar is equivalent to !(foo ^ bar)
<banister> where foo/bar are bools
<bougyman> right on.
<banister> bougyman yeah if you dont cast to bool (!! just casts to a bool) then you get god knows what behavoiur is defined for ^ for that type
<bougyman> understood.
<banister> interesting trick thanks for sharing
<bougyman> I think this is an internal practice, I see it all over this codebase.
<banister> yeah it's fucked, i've never seen it before
<banister> i'd rather use `==` it's less arcane
duckpuppy has joined #ruby
<bougyman> agreed.
rueben_ has quit [Ping timeout: 250 seconds]
<banister> Weet niet wat the fuck je praat
duckpuppy has quit [Ping timeout: 252 seconds]
tatsuo has joined #ruby
blackmesa has quit [Ping timeout: 244 seconds]
johnDoe111 has joined #ruby
Vile` has joined #ruby
dukedave has quit [Ping timeout: 264 seconds]
jpinnix_______ has quit [Ping timeout: 264 seconds]
yo61 has quit [Ping timeout: 264 seconds]
tjohnson has quit [Ping timeout: 264 seconds]
joaomdmoura__ has quit [Ping timeout: 264 seconds]
shelling__ has quit [Ping timeout: 264 seconds]
colstrom has quit [Ping timeout: 264 seconds]
meinside has quit [Ping timeout: 264 seconds]
bcavileer has quit [Ping timeout: 264 seconds]
Eleeleth has quit [Ping timeout: 264 seconds]
alxndr has quit [Ping timeout: 264 seconds]
tfitts has quit [Ping timeout: 264 seconds]
jxf has quit [Ping timeout: 264 seconds]
vikid has quit [Ping timeout: 264 seconds]
Meow-J has quit [Ping timeout: 264 seconds]
grvgr has quit [Ping timeout: 264 seconds]
vcoinminer has quit [Ping timeout: 264 seconds]
lancetw has quit [Ping timeout: 264 seconds]
jord has quit [Ping timeout: 264 seconds]
ELCALOR has quit [Ping timeout: 264 seconds]
flyinprogrammer has quit [Ping timeout: 264 seconds]
ijij_ has quit [Ping timeout: 264 seconds]
bove has quit [Ping timeout: 264 seconds]
HashNuke__ has quit [Ping timeout: 264 seconds]
frem_ has quit [Ping timeout: 264 seconds]
zero7 has quit [Ping timeout: 264 seconds]
spastorino has quit [Ping timeout: 264 seconds]
acerna has quit [Ping timeout: 264 seconds]
Travis-42 has quit [Ping timeout: 264 seconds]
andersh has quit [Ping timeout: 264 seconds]
boxrick1 has quit [Ping timeout: 264 seconds]
LinuxHippie has quit [Ping timeout: 264 seconds]
kapowaz has quit [Ping timeout: 264 seconds]
aphprentice has quit [Ping timeout: 264 seconds]
<surrounder> banister: getting there ;)
n_blownapart has joined #ruby
<banister> surrounder lol
pmarreck has quit [Ping timeout: 264 seconds]
mitsuhiko has quit [Ping timeout: 264 seconds]
jimeh has quit [Ping timeout: 264 seconds]
podman has quit [Ping timeout: 264 seconds]
deepak_ has quit [Ping timeout: 264 seconds]
bttf has quit [Ping timeout: 264 seconds]
mroth has quit [Ping timeout: 264 seconds]
adamf has quit [Ping timeout: 264 seconds]
daemonwrangler has quit [Ping timeout: 264 seconds]
kireevco has quit [Ping timeout: 264 seconds]
jmhmccr has quit [Ping timeout: 264 seconds]
<banister> surrounder that's a cool dutch expression, almost as good as kanker homotje
dukedave has joined #ruby
vikid has joined #ruby
Eleeleth has joined #ruby
alxndr has joined #ruby
meinside has joined #ruby
<surrounder> haha
bcavileer has joined #ruby
jpinnix_______ has joined #ruby
<banister> r we being hax0red
jaguarmagenta has joined #ruby
flyinprogrammer has joined #ruby
joaomdmoura__ has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
grvgr has joined #ruby
tjohnson has joined #ruby
jxf has joined #ruby
tfitts has joined #ruby
shelling__ has joined #ruby
tubuliferous_ has joined #ruby
vcoinminer has joined #ruby
ELCALOR has joined #ruby
aphprentice has joined #ruby
acerna has joined #ruby
frem_ has joined #ruby
kireevco has joined #ruby
<eam> looks like the irccloud is raining
podman has joined #ruby
maladr0it has joined #ruby
<banister> heh
mleung has quit [Ping timeout: 250 seconds]
HashNuke__ has joined #ruby
mroth has joined #ruby
ijij_ has joined #ruby
jmhmccr has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
adamf has joined #ruby
andersh has joined #ruby
bove has joined #ruby
n_blownapart has quit [Client Quit]
pmarreck has joined #ruby
spastorino has joined #ruby
deepak_ has joined #ruby
boxrick1 has joined #ruby
jord has joined #ruby
lancetw has joined #ruby
daemonwrangler has joined #ruby
colstrom has joined #ruby
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Travis-42 has joined #ruby
jimeh has joined #ruby
mitsuhiko has joined #ruby
kapowaz has joined #ruby
zero7 has joined #ruby
Rodya_ has joined #ruby
yo61 has joined #ruby
dorje has joined #ruby
frem_ has quit [Client Quit]
jaguarmagenta has quit [Ping timeout: 260 seconds]
tubuliferous_ has quit [Ping timeout: 240 seconds]
Dios has joined #ruby
LinuxHippie has joined #ruby
mrmortondk has quit [Quit: Textual IRC Client: www.textualapp.com]
Meow-J has joined #ruby
bttf has joined #ruby
mleung has joined #ruby
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Dios has quit [Max SendQ exceeded]
Dios has joined #ruby
skweek has quit [Ping timeout: 250 seconds]
diegoviola has quit [Quit: WeeChat 1.5]
allcentury has joined #ruby
matp has joined #ruby
ur5us has quit [Remote host closed the connection]
aupadhye has joined #ruby
smathy is now known as smathy_afk
allcentury has quit [Ping timeout: 250 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
hightower2 has quit [Ping timeout: 276 seconds]
Fuzai has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<Fuzai> Hi there, is there anyone around that's familiar with UUIDTools and specifically namespaces that could shed some light on this for me? I'm familiar with UUID's but I feel like I'm failing to grasp the concepts/logic/reasoning/use of uuid namespaces. Thanks!
johnDoe111 has joined #ruby
certainty has joined #ruby
freerobby has quit [Quit: Leaving.]
whathappens has quit [Quit: Leaving...]
jabreity__ has quit [Changing host]
jabreity__ has joined #ruby
jabreity__ has quit [Changing host]
jabreity__ has joined #ruby
jabreity__ is now known as jabreity
moeabdol has joined #ruby
nankyokusei has joined #ruby
APhilp has quit [Ping timeout: 246 seconds]
rcvalle has quit [Quit: rcvalle]
johnDoe111 has quit [Ping timeout: 276 seconds]
LaT0rtue has joined #ruby
LaT0rtue has quit [Client Quit]
certainty has quit [Ping timeout: 276 seconds]
jrafanie has quit [Ping timeout: 276 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
moeabdol has quit [Ping timeout: 264 seconds]
ixti has joined #ruby
APhilp has joined #ruby
Wolland has joined #ruby
griffindy has joined #ruby
gnufied has joined #ruby
APhilp has quit [Ping timeout: 258 seconds]
dorje has quit [Ping timeout: 272 seconds]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Wolland has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
kies has quit [Ping timeout: 250 seconds]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
arescorpio has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
marr has quit [Remote host closed the connection]
postmodern has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby
Yiota has joined #ruby
RobertBirnie has joined #ruby
gnufied has quit [Quit: Leaving]
echosystm has joined #ruby
coffeecupp has quit [Ping timeout: 258 seconds]
<echosystm> i need to run a ruby script as an executable on a server
jenrzzz has quit [Ping timeout: 240 seconds]
<echosystm> it depends on a particular ruby version and various gems
<echosystm> with rvm, i used to use an alias to do this
<echosystm> how do you do this with rbenv?
<echosystm> ie. i want to just ./run-my-program without setting up any rbenv stuff in advance
davedev24 has quit []
tatsuo has quit [Remote host closed the connection]
skweek has joined #ruby
<shevy> Fuzai I think a madman did UUID
devbug has joined #ruby
Coldblackice has quit [Ping timeout: 250 seconds]
taylorrf has joined #ruby
blackmesa has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
postmodern has joined #ruby
duckpuppy has joined #ruby
replay has quit []
hutch34 has joined #ruby
aberen has joined #ruby
duckpuppy has quit [Ping timeout: 244 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
<maladr0it> what's so hard about uuid?
<maladr0it> (speaking from ignorance)
Dios has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Dios has joined #ruby
aberen has quit [Ping timeout: 258 seconds]
<shevy> you never saw one
AcidCras_ has joined #ruby
coffeecupp has joined #ruby
allcentury has joined #ruby
AcidCrash has quit [Ping timeout: 250 seconds]
djbkd has quit [Quit: My people need me...]
lightt has joined #ruby
vdamewood has joined #ruby
amclain has quit [Quit: Leaving]
allcentury has quit [Ping timeout: 260 seconds]
vdamewood has quit [Max SendQ exceeded]
ash_workz has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tildes_ has quit [Ping timeout: 252 seconds]
ensyde__ has joined #ruby
mleung has quit [Quit: mleung]
certainty has joined #ruby
sumobob has quit [Ping timeout: 250 seconds]
vdamewood has joined #ruby
Rodya_ has quit [Remote host closed the connection]
karmatr0n has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
achamian has joined #ruby
karmatr0n has quit [Ping timeout: 250 seconds]
coffeecupp has quit [Ping timeout: 260 seconds]
Wolland has joined #ruby
achamian has quit [Ping timeout: 272 seconds]
coffeecupp has joined #ruby
LoneHerm_ has joined #ruby
Wolland has quit [Ping timeout: 250 seconds]
Rodya_ has joined #ruby
sneakers has joined #ruby
dopie has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
sneakers has quit [Ping timeout: 250 seconds]
ElFerna has quit []
ElFerna has joined #ruby
gnufied has joined #ruby
coffeecupp has quit [Ping timeout: 250 seconds]
MrBusiness3 is now known as MrBusiness
flashpoint9 has joined #ruby
sp4rrow has joined #ruby
mistermocha has quit [Remote host closed the connection]
kus has joined #ruby
kus has quit [Max SendQ exceeded]
xlegoman has joined #ruby
Niham has joined #ruby
symm- has quit [Ping timeout: 264 seconds]
Yzguy has joined #ruby
Yzguy has quit [Max SendQ exceeded]
jaguarmagenta has joined #ruby
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Ronis_BR has joined #ruby
<Ronis_BR> guys
<Ronis_BR> I'm building ruby from sources and I'm getting and error related with libxml2 when trying to install nokogiri
<bougyman> install it
<Ronis_BR> I have to installations, in one everything is fine
<bougyman> and libxslt
<bougyman> nokogiri needs them both
<Ronis_BR> bougyman: it is all installed
<bougyman> no it isn't.
<maladr0it> hey guys is ruby used for anything other than web dev?
<bougyman> libxslt-dev and libxml2-dev ?
<bougyman> (or -devel)
<bougyman> maladr0it: yes.
<bougyman> maladr0it: I don't do web dev.
<Ronis_BR> bougyman: it works if I do NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri
<bougyman> I use ruby for infrastructure automation, mostly.
<bougyman> Ronis_BR: ok, so you have the system libraries installed, then.
<bougyman> nokogiri bundles its own if you don't use that ENV var.
<maladr0it> awesome. i really like scripting languages but don't like web dev
<Ronis_BR> bougyman: but I need to use the bundle
<maladr0it> just job searching atm
<bougyman> and they may not build on your env for whatever reason.
<bougyman> maladr0it: for what position?
<Ronis_BR> bougyman: I notice that in the machine that it is working, ruby is installed in /usr/local/lib
<bougyman> I have some system engineering positions open, this may be serendipity.
<maladr0it> i'm a fresh grad so basically anything haha
<Ronis_BR> bougyman: on the other, it is in /usr/local/lib64
<bougyman> oh, hah.
<maladr0it> i have experience doing automation though
<bougyman> hard to get a job as a system engineer fresh out of school.
<bougyman> unless you have work exp, too.
<maladr0it> i did a year of work exp
<Ronis_BR> bougyman: do you think this make any difference?
rodfersou has quit [Quit: leaving]
<bougyman> it could, Ronis_BR
<maladr0it> they liked me so much they offered me stupid money to stay but i moved country
<Ronis_BR> bougyman: how can I make ruby be installed in /usr/local/lib?
<bougyman> --prefix=/usr/local
jaguarmagenta has quit [Ping timeout: 252 seconds]
pilne has quit [Quit: Quitting!]
<Ronis_BR> bougyman: but it is in /usr/local
<bougyman> You're confusing me now.
<Ronis_BR> bougyman: the problem is with /usr/local/lib dir
<Ronis_BR> bougyman: in one installation, the files are being installed in /usr/local/lib
<Ronis_BR> bougyman: on the other, in /usr/local/lib64
<Ronis_BR> I have no idea why
<bougyman> same os?
<Ronis_BR> bougyman: same os, two machines with the same configuration
moeabdol has joined #ruby
allcentury has joined #ruby
Dios has quit [Quit: Textual IRC Client: www.textualapp.com]
moeabdol has quit [Ping timeout: 252 seconds]
allcentury has quit [Ping timeout: 250 seconds]
johnDoe111 has joined #ruby
<Ronis_BR> bougyman: no idea?
certainty has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
Dimik has quit [Ping timeout: 250 seconds]
karmatr0n has joined #ruby
TubaraoSardinha has joined #ruby
coffeecupp has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has quit [Ping timeout: 250 seconds]
karmatr0n has quit [Ping timeout: 252 seconds]
Vingador has joined #ruby
yqt has quit [Ping timeout: 276 seconds]
Wolland has joined #ruby
MrBusiness has quit [Quit: Leaving]
LoneHerm_ has quit [Remote host closed the connection]
vdamewood has quit [Quit: Life beckons.]
flashpoint9 has quit [Remote host closed the connection]
aeterne has quit [Remote host closed the connection]
Wolland has quit [Ping timeout: 258 seconds]
Rodya_ has joined #ruby
axsuul has joined #ruby
jackjackdripper has joined #ruby
lightt has quit [Remote host closed the connection]
coffeecupp has quit [Quit: leaving]
hutch34 has quit [Ping timeout: 272 seconds]
roamingdog has joined #ruby
mostlybadfly has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has joined #ruby
sandstrom has joined #ruby
pragmatism has quit [Quit: Connection.close!]
taylorrf has quit [Remote host closed the connection]
haraigo has quit [Ping timeout: 252 seconds]
jancel has joined #ruby
braincrash has quit [Quit: bye bye]
wjimenez5271 has joined #ruby
karmatr0n has joined #ruby
mistermocha has joined #ruby
dionysus69 has joined #ruby
duckpuppy has joined #ruby
kiki_lamb has quit [Quit: leaving]
blackmesa has joined #ruby
kiki_lamb has joined #ruby
tildes_ has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
Niham has joined #ruby
braincrash has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
duckpuppy has quit [Ping timeout: 244 seconds]
aberen has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
RobertBirnie has joined #ruby
k3rn31 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
aberen has quit [Ping timeout: 250 seconds]
nando293921 has joined #ruby
saneax is now known as saneax_AFK
sepp2k has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Rodya_ has quit [Ping timeout: 250 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
Vingador has quit [Remote host closed the connection]
allcentury has joined #ruby
ElFerna has quit [Ping timeout: 244 seconds]
karmatr0n has quit [Read error: Connection reset by peer]
karmatr0n has joined #ruby
jancel has quit [Remote host closed the connection]
djbkd has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
sepp2k has quit [Quit: Leaving.]
certainty has joined #ruby
skade has joined #ruby
kareeoleez has joined #ruby
gnufied has quit [Quit: Leaving]
gix has quit [Ping timeout: 264 seconds]
certainty has quit [Ping timeout: 244 seconds]
achamian has joined #ruby
dmitrij_2691 has quit [Quit: 0x1a7d7ccd7]
gix has joined #ruby
Wolland has joined #ruby
flashpoint9 has joined #ruby
achamian has quit [Ping timeout: 276 seconds]
solocshaw has quit [Ping timeout: 250 seconds]
k3rn31 has joined #ruby
Wolland has quit [Ping timeout: 250 seconds]
learath has joined #ruby
<learath> hey, I'm trying to load a fairly large json (~400m) and getting an out of memory error
<learath> Are there any simple steps I can take, short of just shrinking the json?
skade has quit [Quit: Computer has gone to sleep.]
<TubaraoSardinha> learath: You can either increase the memory limit (or overall memory) of the environment you are trying to run
<TubaraoSardinha> Or break the json in smaller chunks and parse incrementaly
<learath> How do I increase the memory limit?
pawnbox has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
jancel has joined #ruby
<learath> ah the java way
terminalrecluse has joined #ruby
yatish27 has joined #ruby
griffindy has quit [Ping timeout: 276 seconds]
der-landgraf has quit [Quit: WeeChat 1.5]
VeryBewitching has quit [Quit: Konversation terminated!]
der-landgraf has joined #ruby
pawnbox has quit [Remote host closed the connection]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
craigp has quit [Ping timeout: 260 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
flashpoint9 has quit [Remote host closed the connection]
swills has quit [Ping timeout: 240 seconds]
jancel has quit [Remote host closed the connection]
Ronis_BR has quit [Ping timeout: 276 seconds]
echosystm has quit [Ping timeout: 240 seconds]
arescorpio has quit [Quit: Leaving.]
dtoast has joined #ruby
aberen has joined #ruby
freerobby has joined #ruby
dtoast has quit [Client Quit]
aberen has quit [Ping timeout: 244 seconds]
echosystm has joined #ruby
jaguarmagenta has joined #ruby
echosystm has left #ruby [#ruby]
lightt has joined #ruby
Ronis_BR has joined #ruby
yfeldblum has quit [Remote host closed the connection]
roamingdog has quit [Remote host closed the connection]
haraigo has joined #ruby
Madplatypus has joined #ruby
Rodya_ has joined #ruby
jaguarmagenta has quit [Ping timeout: 252 seconds]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
kgrz has joined #ruby
last_staff has joined #ruby
saneax_AFK is now known as saneax
Rodya_ has quit [Ping timeout: 250 seconds]
allcentury has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 244 seconds]
howdoi has joined #ruby
johnDoe111 has joined #ruby
allcentury has quit [Ping timeout: 276 seconds]
sp4rrow has joined #ruby
pawnbox has joined #ruby
certainty has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
nankyokusei has joined #ruby
freerobby has quit [Quit: Leaving.]
p337rB has joined #ruby
sumobob has joined #ruby
certainty has quit [Ping timeout: 258 seconds]
nankyokusei has quit [Ping timeout: 276 seconds]
tildes_ has quit [Ping timeout: 272 seconds]
p337rB has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
Wolland has joined #ruby
maletor has joined #ruby
postmodern has quit [Quit: Leaving]
snath has quit [Ping timeout: 276 seconds]
Wolland has quit [Ping timeout: 250 seconds]
xlegoman has quit [Read error: Connection reset by peer]
darkxploit has quit [Read error: Connection reset by peer]
skade has joined #ruby
swills has joined #ruby
pawnbox has joined #ruby
raeoks has joined #ruby
Ronis_BR has quit [Remote host closed the connection]
swills has quit [Remote host closed the connection]
tildes_ has joined #ruby
sandstrom has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
karmatr0n has quit [Ping timeout: 276 seconds]
jordanm has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
giz|work has joined #ruby
kareeoleez has quit [Remote host closed the connection]
maladr0it has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
kareeoleez has joined #ruby
jancel has joined #ruby
smathy_afk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
thoraxe has quit [Ping timeout: 244 seconds]
craigp has joined #ruby
giz|work has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
kareeoleez has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
darkxploit has joined #ruby
jancel has quit [Ping timeout: 276 seconds]
TubaraoSardinha has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
axxyhtrx has joined #ruby
achamian has joined #ruby
A124 has quit [Ping timeout: 260 seconds]
mistermocha has quit [Ping timeout: 250 seconds]
A124 has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
fenre has joined #ruby
kies has joined #ruby
freerobby has joined #ruby
ta_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
haraigo has quit [Ping timeout: 246 seconds]
sauvin has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
allcentury has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
thoraxe has joined #ruby
freerobby has quit [Quit: Leaving.]
allcentury has quit [Ping timeout: 276 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
certainty has joined #ruby
A124 has quit [Quit: '']
certainty has quit [Ping timeout: 244 seconds]
sphex has quit [Ping timeout: 260 seconds]
A124 has joined #ruby
sphex has joined #ruby
TomyLobo has joined #ruby
Wolland has joined #ruby
maletor has joined #ruby
Wolland_ has joined #ruby
darkxploit has quit [Ping timeout: 258 seconds]
skade has quit [Ping timeout: 240 seconds]
Wolland has quit [Ping timeout: 250 seconds]
kareeoleez has joined #ruby
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
kareeoleez has quit [Remote host closed the connection]
terminalrecluse has joined #ruby
kareeoleez has joined #ruby
giz|work has joined #ruby
moeabdol has joined #ruby
blur3d has quit [Quit: blur3d]
Macaveli has joined #ruby
tildes_ has quit [Ping timeout: 252 seconds]
certainty has joined #ruby
kareeoleez has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 264 seconds]
Ch4rAss has joined #ruby
Antiarc has quit [Quit: No Ping reply in 180 seconds.]
darkxploit has joined #ruby
Antiarc has joined #ruby
kareeoleez has joined #ruby
sumobob has quit [Ping timeout: 258 seconds]
skade has joined #ruby
jancel has joined #ruby
kgrz has quit [Ping timeout: 250 seconds]
raviShankarJha has joined #ruby
yfeldblum has joined #ruby
solars has joined #ruby
giz|work has quit [Ping timeout: 244 seconds]
sepp2k has joined #ruby
jancel has quit [Ping timeout: 258 seconds]
sandelius has joined #ruby
kareeole_ has joined #ruby
MrBusiness has joined #ruby
kareeole_ is now known as kareeoleez_
kareeoleez has quit [Ping timeout: 276 seconds]
kareeoleez_ is now known as kareeoleez
bmorrison has quit [Quit: bmorrison]
MrBusiness has quit [Client Quit]
Coldblackice has joined #ruby
skade has quit [Ping timeout: 276 seconds]
firstdayonthejob has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
Rodya_ has joined #ruby
ta_ has joined #ruby
jas02 has joined #ruby
haraigo has joined #ruby
TomyLobo has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
axxyhtrx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allcentury has joined #ruby
last_staff has joined #ruby
tmtwd has joined #ruby
aganov has joined #ruby
codecop has joined #ruby
ur5us has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 276 seconds]
Asher has quit [Quit: Leaving.]
MrBusiness has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
firstdayonthejob has quit [Ping timeout: 260 seconds]
sandstrom has joined #ruby
nankyokusei has joined #ruby
axxyhtrx has joined #ruby
maletor has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
agit0 has quit [Quit: zzzZZZ….]
nankyokusei has quit [Ping timeout: 250 seconds]
giz|work has joined #ruby
pepee has quit [Quit: bye $IRC]
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blockchan has joined #ruby
Dimik has joined #ruby
pepee has joined #ruby
nadir has joined #ruby
MrBusiness has quit [Quit: Leaving]
nobitanobi has joined #ruby
Ch4rAss has quit [Ping timeout: 240 seconds]
Noxilex has joined #ruby
ur5us has joined #ruby
polll has joined #ruby
Ch4rAss has joined #ruby
nhhc has joined #ruby
sauvin has joined #ruby
norc has joined #ruby
tvw has joined #ruby
ur5us has quit [Ping timeout: 276 seconds]
Wolland_ has quit []
giz|work has quit [Ping timeout: 250 seconds]
Spami has joined #ruby
agit0 has joined #ruby
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
rbr has joined #ruby
vondruch has joined #ruby
c0mrad3 has joined #ruby
aries_liuxueyang has joined #ruby
flashpoint9 has joined #ruby
pawnbox has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
Axy has joined #ruby
pawnbox has joined #ruby
andikr has joined #ruby
TomyWork has joined #ruby
blockchan has quit [Ping timeout: 250 seconds]
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blockchan has joined #ruby
Mia has quit [Ping timeout: 252 seconds]
flashpoint9 has quit [Ping timeout: 244 seconds]
mistermocha has joined #ruby
duckpuppy has joined #ruby
ensyde__ has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
nobitanobi has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 258 seconds]
duckpuppy has quit [Ping timeout: 244 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
A124 has quit [Quit: '']
blackmesa has quit [Ping timeout: 244 seconds]
flughafen_ has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
sarbs has joined #ruby
scorphus has quit [Ping timeout: 260 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
nando293921 has quit [Ping timeout: 264 seconds]
A124 has joined #ruby
sepp2k has quit [Quit: Leaving.]
Noxilex has quit [Ping timeout: 250 seconds]
roamingdog has joined #ruby
noobsu_ has joined #ruby
tmtwd has quit [Ping timeout: 276 seconds]
giz|work has joined #ruby
k3rn31 has joined #ruby
polll has quit [Quit: leaving]
polll has joined #ruby
polll has quit [Client Quit]
polll has joined #ruby
Rodya_ has joined #ruby
jud^ has joined #ruby
nertzy3 has joined #ruby
MrBusiness has joined #ruby
pawnbox has quit [Remote host closed the connection]
roamingdog has quit [Ping timeout: 246 seconds]
darkxploit has quit [Read error: Connection reset by peer]
nertzy2 has quit [Ping timeout: 258 seconds]
pawnbox has joined #ruby
jud has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
eGGshke has joined #ruby
lessless has joined #ruby
allcentury has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.5]
pepee has quit [Read error: Connection reset by peer]
pepee has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
<flughafen_> morning
giz|work has quit [Ping timeout: 260 seconds]
edwinvdgraaf has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
edwinvdg_ has joined #ruby
johnDoe111 has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
danieli has quit [Changing host]
danieli has joined #ruby
edwinvdgraaf has quit [Ping timeout: 258 seconds]
johnDoe111 has quit [Ping timeout: 244 seconds]
certainty has quit [Ping timeout: 244 seconds]
emptyflask has quit [Remote host closed the connection]
sameerynho has joined #ruby
ash_workz has joined #ruby
djbkd has quit [Quit: My people need me...]
achamian has quit []
darkxploit has joined #ruby
pawnbox has quit [Remote host closed the connection]
<adaedra> Hej hej
Staticillmatic has joined #ruby
moeabdol has joined #ruby
<flughafen_> hej adaedra
coffeecupp has joined #ruby
giz|work has joined #ruby
MrBusiness2 has joined #ruby
znz_jp has quit [Remote host closed the connection]
Niham has joined #ruby
polll has quit [Quit: leaving]
jud^ is now known as jud
moeabdol has quit [Ping timeout: 252 seconds]
jud has quit [Changing host]
jud has joined #ruby
znz_jp has joined #ruby
MrBusiness has quit [Ping timeout: 258 seconds]
Staticillmatic has quit [Ping timeout: 244 seconds]
al2o3-cr has joined #ruby
ocbtec has joined #ruby
ecksit has joined #ruby
ksinkar has joined #ruby
aberen has joined #ruby
phredus has quit [Remote host closed the connection]
pepee has quit [Quit: bye $IRC]
mikecmpbll has joined #ruby
elementaru has joined #ruby
<ksinkar> has anyone here used the Ruby Shell library recently? I am using it, but other than echo, I cannot access any other shell commands which are available in my shell through my PATH.
<norc> ksinkar: What library is that?
zacstewart has quit [Ping timeout: 264 seconds]
nobitanobi has joined #ruby
Silthias has joined #ruby
phredus has joined #ruby
mark_66 has joined #ruby
pawnbox has joined #ruby
alfiemax has quit [Ping timeout: 250 seconds]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thamster has joined #ruby
thamster has quit [Client Quit]
johnbat26 has joined #ruby
thamster has joined #ruby
thamster has left #ruby [#ruby]
jazz1 has joined #ruby
blackgoat has quit [Ping timeout: 272 seconds]
joonty has joined #ruby
jaruga___ has joined #ruby
pawnbox_ has joined #ruby
senayar has joined #ruby
crdpink has quit [Ping timeout: 250 seconds]
ICantCook has quit [Ping timeout: 244 seconds]
pawnbox has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
certainty has joined #ruby
giz|work has quit [Ping timeout: 240 seconds]
crdpink has joined #ruby
TheHodge has joined #ruby
diegoaguilar has joined #ruby
rikkipitt has joined #ruby
axsuul has quit [Ping timeout: 240 seconds]
sandelius has joined #ruby
yatish27 has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Dimik has quit [Ping timeout: 250 seconds]
der-landgraf has quit [Quit: WeeChat 1.5]
der-landgraf has joined #ruby
nobitanobi has quit [Remote host closed the connection]
zacstewart has joined #ruby
der-landgraf has quit [Client Quit]
der-landgraf has joined #ruby
tmtwd has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
madgen has joined #ruby
allcentury has joined #ruby
diegoaguilar has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Quit: Leaving.]
axxyhtrx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bish has joined #ruby
<Bish> can i have a multiple .sub?
<Bish> multiline*
<norc> Bish: what do you mean? multiline regexp?
<Bish> >> "tes\nt".scan /test/
<ruby[bot]> Bish: # => [] (https://eval.in/586620)
<norc> Bish: use //x
spikeheadon has joined #ruby
<norc> Bish: that way whitespace and comments (!) are ignored inside the regular expression.
spikey has joined #ruby
<Bish> >> "tes\nt".scan /test/x
spikey has quit [Max SendQ exceeded]
<ruby[bot]> Bish: # => [] (https://eval.in/586621)
<gregf_> i think /m
<Bish> :o
<norc> Every non-trivial regexp should use this as you can inline comment the blocks and bits. :)
<Bish> gregf_: /m is not ruby i think
<norc> gregf_: No, /m is for multiline matches
<norc> Or.. it might be.
certainty has quit [Ping timeout: 264 seconds]
allcentury has quit [Ping timeout: 240 seconds]
<norc> gregf_: //m just causes newline characters to be matched by .
<Bish> okay, but that might be enough
<norc> Bish: Or you could simply gsub("\n", '') first
pawnbox has joined #ruby
<jhass> .delete("\n")
<jhass> stop deleting characters with gsub already
spikeheadon has quit [Ping timeout: 246 seconds]
* Bish uses gsub just so jhass gets mad
<Bish> DU JHASST MICH
darkxploit has quit [Ping timeout: 252 seconds]
nankyokusei has joined #ruby
p337rB has joined #ruby
<norc> jhass: Fair point.
zacstewart has quit [Ping timeout: 272 seconds]
<gregf_> rammstein
Ch4rAss has quit [Quit: leaving]
nankyokusei has quit [Ping timeout: 250 seconds]
diegoaguilar has joined #ruby
jaruga___ has quit [Quit: jaruga___]
p337rB has quit [Ping timeout: 276 seconds]
lightt has quit [Remote host closed the connection]
ksinkar` has joined #ruby
ksinkar` has left #ruby [#ruby]
Ch4rAss has joined #ruby
ksinkar has quit [Ping timeout: 258 seconds]
<Bish> >> "<a href=\"tes\nt\">".scan /<a [^>]*>/
<ruby[bot]> Bish: # => ["<a href=\"tes\nt\">"] (https://eval.in/586625)
<Bish> what exactly do i need /m for?
xfbs has joined #ruby
jaruga___ has joined #ruby
xfbs has quit [Read error: Connection reset by peer]
jazz2 has joined #ruby
ecksit has quit [Ping timeout: 250 seconds]
<jazz2> Bish: sorry disconnected, when using anchors the m modifier is useful.
<gregf_> Bish: use a parser :|
<gregf_> oh, no *ignore me*
<Bish> if i wasn't only checking lings. i would
<Bish> lings, derp.
<jazz2> parser is better yeah, but maybe the case is simple enough to not need it.
<norc> Regexp means "REGular Expressions for Xml Parsing"
<norc> They must be great to handle XML.
<jazz2> :)
darkxploit has joined #ruby
<Bish> well actually software works cool if people did nice html
jazz1 has quit [Ping timeout: 276 seconds]
<Bish> but people tend to
<norc> Bish: That is what Nokogiri excels at by the way. Parsing broken html/xml
<Bish> <a href="ht\ntp://this\t-is-a-link\nt\tsomewhere.com">a</a>
jazz2 is now known as jazz1
mdw has joined #ruby
certainty has joined #ruby
nobitanobi has joined #ruby
<jhass> jazz1: ruby is different, m doesn't affect ^ or $, only .
<gregf_> >> p "ht\ntp://this\t-is-a-link\nt\tsomewhere.com".gsub!(/\s+/,"");
<ruby[bot]> gregf_: # => "http://this-is-a-linktsomewhere.com" ...check link for more (https://eval.in/586632)
nobitanobi has quit [Remote host closed the connection]
<jazz1> jhass: ah. ok makes sense. thanks :)
<norc> Bish: Why are you not using a proper xml/html parser?
Snowy has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
Snowy has quit [Remote host closed the connection]
Ch4rAss has left #ruby [#ruby]
Snowy has joined #ruby
axxyhtrx has joined #ruby
darkxploit has quit [Ping timeout: 250 seconds]
giz|work has joined #ruby
<flughafen_> is anybody here using vimmonster forruby completion in vim
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
<gregf_> *just types it all* :|
alfiemax has joined #ruby
blockchan has quit [Ping timeout: 246 seconds]
<norc> flughafen_: you know that vi has autocompletion builtin right?
<gregf_> writing java using textpad could'nt be worse :|
<jazz1> are you doing that?
<flughafen_> norc: yeah, but i find it isn't that good.
<gregf_> jazz1: you mean me? *started off that way* :)
znz_jp has quit [Ping timeout: 250 seconds]
marr has joined #ruby
<jazz1> yep i meant you, & that sounds tedious.
sarlalian has quit [Ping timeout: 258 seconds]
<gregf_> jazz1: tedious , sure.. but you learn quite a bit
sarlalian has joined #ruby
AcidCras_ is now known as AcidCrash
<jazz1> true
tjbiddle has joined #ruby
koooge has quit [Quit: Leaving...]
sepp2k has joined #ruby
certainty has quit [Ping timeout: 252 seconds]
blockchan has joined #ruby
jaguarma_ has joined #ruby
darkxploit has joined #ruby
rikkipitt has quit [Quit: Leaving...]
colegatron_origi has joined #ruby
johnDoe111 has joined #ruby
blackmesa has joined #ruby
Ishido has joined #ruby
platzhirsch has joined #ruby
blockchan1 has joined #ruby
duckpuppy has joined #ruby
blockchan has quit [Ping timeout: 264 seconds]
jaguarmagenta has quit [Ping timeout: 276 seconds]
colegatron has quit [Ping timeout: 276 seconds]
toretore has joined #ruby
yatish27 has joined #ruby
darkxploit has quit [Ping timeout: 240 seconds]
johnDoe111 has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
moeabdol has joined #ruby
tmtwd has quit [Ping timeout: 258 seconds]
giz|work has quit [Ping timeout: 244 seconds]
duckpuppy has quit [Ping timeout: 276 seconds]
sameerynho has quit [Ping timeout: 244 seconds]
tvw has quit [Ping timeout: 264 seconds]
axsuul has joined #ruby
Ch4rAss has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
Ch4rAss has left #ruby [#ruby]
giz|work has joined #ruby
axsuul has quit [Ping timeout: 272 seconds]
jaguarma_ has quit [Remote host closed the connection]
lessless has left #ruby ["Textual IRC Client: www.textualapp.com"]
evidex has joined #ruby
aupadhye has quit [Ping timeout: 272 seconds]
sp4rrow has quit [Quit: Textual]
darkxploit has joined #ruby
nobitanobi has joined #ruby
ixti has quit [Quit: WeeChat 1.5]
allcentury has joined #ruby
raviShankarJha has quit []
duncannz has quit [Remote host closed the connection]
coffeecupp has quit [Quit: leaving]
nobitanobi has quit [Remote host closed the connection]
tatsuo has joined #ruby
noobsu_ has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 240 seconds]
joonty has joined #ruby
lxsameer has joined #ruby
tatsuo has quit [Remote host closed the connection]
nobitanobi has joined #ruby
tatsuo has joined #ruby
nobitanobi has quit [Remote host closed the connection]
jancel has joined #ruby
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ruby
pawnbox has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 250 seconds]
jancel has quit [Ping timeout: 250 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
yatish27 has quit [Remote host closed the connection]
symm- has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
bruce_lee has joined #ruby
flughafen_ has quit [Quit: WeeChat 1.3]
tatsuo has quit [Remote host closed the connection]
nobitanobi has joined #ruby
certainty has joined #ruby
jaruga___ has quit [Ping timeout: 260 seconds]
nobitanobi has quit [Remote host closed the connection]
certainty has quit [Ping timeout: 244 seconds]
kknight has joined #ruby
johnDoe111 has joined #ruby
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lala2004 has joined #ruby
ICantCook has joined #ruby
<lala2004> hey -- i'm learning to code -- ruby -- does everything have to be in a function definition: https://gist.github.com/anonymous/85be6886678f8090ab62303218d9ca9e
neanderslob has quit [Remote host closed the connection]
<lala2004> i'm getting: undefined method `try_spin' for main:Object (NoMethodError)
<lala2004> but i clearly define it
<lala2004> oh -- order!!! got it
madgen has quit [Ping timeout: 276 seconds]
Couch has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
<norc> lala2004: By the way, in Ruby functions are called "methods" :)
<lala2004> thanks! i'm new to computers
tatsuo has joined #ruby
jaruga___ has joined #ruby
<norc> lala2004: But yeah, Ruby executes code from top to bottom. There is no static analysis like in C, where you can call a function before you declare it (in the same file).
<lala2004> that must be because it doesn't compile
<norc> lala2004: Well actually it does.
<lala2004> or it has too . . . but it does it at runtime (whatever that means)?
<norc> Yes!
<norc> In that respect Ruby is similar to Java.
moeabdol1 has joined #ruby
<workmad3> norc: err, java needs compilation to bytecode before it can run on the JVM
<norc> workmad3: And Ruby does exactly that.
<workmad3> norc: not explicitly
<lala2004> so -- there is a virtual machine that directly abstracts into, say, x86?
johnmilton has quit [Remote host closed the connection]
<norc> lala2004: Yes.
<workmad3> lala2004: since 1.9, yes
<norc> workmad3: 2.0
<norc> Or was it 1.9?
<workmad3> norc: I thought YARV became MRI with 1.9 :)
* norc shrugs
<lala2004> yarv?
<lala2004> mri?
vondruch has quit [Remote host closed the connection]
<lala2004> sorry . . .
<norc> lala2004: MRI is Ruby slang for "Matz Ruby Interpreter"
<workmad3> YARV == Yet Another Ruby VM... MRI == Matz's Ruby Interpreter
<lala2004> which is a virtual machine
<jhass> lala2004: ignore them, all this is completely irrelevant for you currently
<lala2004> like a wrapper around the procesor
<workmad3> jhass: it's friday, let us shave yaks :P
<lala2004> jhass: sorry, I'm terrible at ignoring things -- i know it is a weakness
devbug has quit [Ping timeout: 252 seconds]
moeabdol has quit [Ping timeout: 272 seconds]
<norc> workmad3: Im curious though, what did you mean by "not explicitly" ?
<workmad3> norc: for java, you need to run `javac` in order to get the bytecode, the JVM doesn't actually include the source->bytecode compiler as part of the VM
<workmad3> norc: while with ruby, the source->bytecode compilation is part of the interpreter
<workmad3> and there's no separate compilation step
<norc> workmad3: Fair enough.
<norc> You could enforce it to be separate though.
<norc> Ship people ISeqs :D
<workmad3> you could, if you had a bytecode standard for the VM that you were commited to keeping stable
<norc> workmad3: The biggest problem though is that it needs require/autoloading support.
<norc> (in order to seamlessly ship a library as an iseq binary)
<workmad3> norc: that's not a huge problem... the bigger problem is `eval` ;)
<norc> evaling works..
<workmad3> not if you remove the source->bytecode compiler from the runtime and enforce the use of ISeqs
<norc> What do you mean?
<workmad3> eval needs to compile the string as ruby code... if you're going to remove the bytecode compiler and rely on ISeqs, then eval doesn't have a mechanism to compile with...
nobitanobi has joined #ruby
nobitanobi has quit [Remote host closed the connection]
<norc> Oh you actually meant Kernel#eval there.
<workmad3> yeah
<norc> Fuck that.
<workmad3> agreed... but it's part of the language, and makes switching to a more java-esque VM style more difficult :)
<norc> workmad3: Though I think if there was enough support to make require/autoloading work with binary ISeqs, it could help a lot with the startup time of things like rails apps.
colegatron_origi has quit [Quit: Leaving]
<norc> But I guess I should actually profile this first before making such claims.
camilasan has quit [Remote host closed the connection]
sandelius has joined #ruby
truenito has joined #ruby
<workmad3> similarly, afaik there's not a commitment to having a stable VM bytecode in ruby currently either, which is the real stumbling block... without that, there's always the potential issue of an ISeq not working with your ruby version (solvable, but only if you're fine with just caching compiled ISeqs and throwing them away if there's any issues for a recompile from source)
<workmad3> I think python does that though, so it's probably not a big deal, and could help startup times :)
<norc> Considering we have had grammar changes even in minor versions, cross-version compability has never been much of a big feature of Ruby.
<norc> Yeah they do.
<norc> workmad3: Im wondering whether this could actually be the more sane approach to an app preloader like Spring.
allcentury has joined #ruby
<norc> Since you would essentially only be preloading something that has non side-effect.
camilasan has joined #ruby
<workmad3> norc: yeah... but imagine the error messages when you get told that your program won't load because `unexpected byte 0xff was encountered in ISeq` rather than a sensible parser Syntax error in a source file ;)
<lala2004> so LLVM is bytecode, could the yarv run that?
kknight has quit [Quit: Leaving]
<workmad3> lala2004: no
<norc> lala2004: No
<norc> lala2004: Ruby uses a custom VM, not a very complex one either.
vondruch has joined #ruby
<lala2004> llvm is specific to cland?
<lala2004> clang?
<norc> lala2004: no
<norc> llvm is specific to llvm.
<lala2004> ok . . .
<workmad3> lala2004: no... but the LLVM VM is a different VM to the ruby VM, which means it runs a different bytecode
<norc> clang is just a compiler frontend for llvm
<lala2004> what is the relationship between clang . . . oh got it
<lala2004> norc: are there other frontends for llvm?
<norc> lala2004: Plenty!
<lala2004> so what could run llvm?
<workmad3> lala2004: bytecode is just a term for "We compiled our source into a machine code representation that corresponds to a virtual machine in our runtime"
<norc> lala2004: Rubinius is probably the best example, consideirng we are in #ruby.
<lala2004> oh -- thanks -- so bytecode is for a vm, where a binary is for specific hardware?
sdothum has joined #ruby
giz|work has quit [Ping timeout: 250 seconds]
<norc> lala2004: Sure, I think that view is fine.
<lala2004> ha -- probably wrong but gets me to the next step at least
<norc> It seems quite correct actually.
<workmad3> lala2004: pretty much... there's nothing really stopping you from creating custom hardware that implements the instruction set of a VM, but I'm not aware that anyone has ever bothered :)
mdw has quit [Quit: Sleeping Zzzzz]
<norc> lala2004: In the end its just fancy terms. In reality you have so many levels of abstractions. If you compile C code, you have the following layers
truenito has quit [Ping timeout: 250 seconds]
<lala2004> as a beginner, it seems everything i think is wrong in some way
allcentury has quit [Ping timeout: 272 seconds]
<lala2004> at least code runs -- that is a certain definition of reality
<norc> lala2004: C source code > Abstract Syntax Tree > (1-3 levels of) Intermediate Representation > (Possibly a VM) > Assembly > Instructions > Microcode
<lala2004> nice! that helps
<workmad3> lala2004: sometimes you need to learn something that isn't completely accurate in order to get a base of knowledge to understand the more accurate version
<elomatreb> Isn't the microcode independent from the program, basically CPU firmware?
<norc> lala2004: And then within that, Ruby emulates a virtual machine.
<norc> elomatreb: Correct.
<norc> elomatreb: firmware is a bit generic though, effectively its what allows modern processors to offer CISC but still get pipeline benefits from RISC.
<norc> (since it breaks CISC into RISC operations)
<elomatreb> norc: I think I just misunderstood your example above. (Close-to-metal programming isn't anything I want to have anything to do with)
nankyokusei has joined #ruby
<workmad3> elomatreb: modern CPUs don't actually run something like the x86 instruction set... instead they have what amounts to a compilation unit as part of the processer that accepts x86 machine code and compiles it into instructions for an internal microcode that's simpler and easier for the CPU to optimise
joonty has quit [Quit: This computer has gone to sleep]
babblebre has joined #ruby
<workmad3> elomatreb: that's the Instructions > Microcode step norc meant (or at least, my understanding of it... I'm not much of a low-level coder either)
<norc> workmad3: Correct.
<elomatreb> I read the Wikipedia article on RISC once, that's basically anything I ever learned about that :shrug:
<norc> workmad3: The biggest benefit is that it allows for out-of-order execution. :)
<norc> (Technically its not necessary, but it makes it far more effective)
<norc> Or parallelism rather.
<workmad3> elomatreb: as you can probably see, the distinction is somewhat more fuzzy nowadays :) and it wasn't ever particularly sharp anyway
nankyokusei has quit [Ping timeout: 240 seconds]
<norc> lala2004: Anyway. The point was to show that in programming you have many layers of abstractions. And Rubys VM is on the left side.
<workmad3> ^ there's a classic saying - "Every problem in programming can be solved by an extra layer of indirection"
<norc> lala2004: So you would have "Ruby VM" > "C Code" > etc.
KINGSABRI has quit [Remote host closed the connection]
<elomatreb> I'm continuously impressed that computers do anything, ever
kent\n has quit [Read error: Connection reset by peer]
hakunin_ has joined #ruby
<workmad3> norc: technically, "C Code" sits off to the side of that, as the Ruby VM doesn't emit C Code, it emits instructions... but it's compiled from C Code :)
hakunin has quit [Read error: Connection reset by peer]
fenre has quit [Ping timeout: 260 seconds]
<norc> workmad3: Yeah I suppose.
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nobitanobi has joined #ruby
techietrash has quit [Ping timeout: 264 seconds]
<workmad3> elomatreb: yeah... the scariest thing about being a programmer is to realise just how fragile the entire edifice of the modern world is
<elomatreb> workmad3: Or how impressive it is that we can talk to people using a few grams of carefully etched sand
polll has joined #ruby
nobitanobi has quit [Remote host closed the connection]
seitensei has quit [Ping timeout: 250 seconds]
<workmad3> elomatreb: a few grams of carefully etched sand that only achieves anything by pretending that everything is a number!
biox has quit [Ping timeout: 260 seconds]
<workmad3> really shows how powerful Gödelisation is...
ash_workz has quit [Remote host closed the connection]
<lala2004> norc: how can there be anything lower than instructions?
<norc> lala2004: the CPU is effectively running an interpreter of its own.
joonty has joined #ruby
biox has joined #ruby
techietrash has joined #ruby
<elomatreb> lala2004: The lowest level of "instructions" on your CPU are just logic gates of two transistors
<lala2004> ok -- so 0x37 might instruct the processor to xor two registers, you are saying that below that there is hardware incorporated instructions?
seitensei has joined #ruby
<norc> lala2004: an instruction gets decoded into microinstructions, and these microinstructions again consist of single operations.
<elomatreb> lala2004: Even a XOR gate is built using four NAND gates
hk238 has joined #ruby
<lala2004> got it -- so the corpus of x86 instructions takes some number of transistors to execute
<norc> lala2004: an xor needs to connect registers to the alu, set the ALU to do things, and then force the cpu to jump to the next instruction.
<lala2004> say that is "n" transistors -- why do we now have billions >> n?
<elomatreb> because you can't reconfigure transistors on the fly
<workmad3> lala2004: something as simple as xor on two registers probably would pass through directly into a single microcode instruction... but the x86 instruction set has much more complicated instructions
<norc> lala2004: modern CPUs are really complex designs.
polll has quit [Quit: leaving]
<lala2004> but still x86 worked on 1/100th (or even less) of the transistors of more recent chips
<norc> lala2004: For example during a single cycle a modern x86 CPU can execute up to 4 instructions.
yqt has joined #ruby
<workmad3> lala2004: I don't know if they're supported on modern CPUs, but some processors had instructions for things like squareroots, sine and cosine, etc.
<lala2004> is there something like a pie chart of what transistors on a modern chip are used for?
<norc> lala2004: dont think in terms of transistors.
<norc> lala2004: You cannot sensibly understand it from that perspective.
<workmad3> ^ it's like trying to understand an airplane in terms of atoms
<elomatreb> But it's quite enlightening to understand how a computer is even able to operate. Maybe not for programming, but in general
<lala2004> fair enough -- but why would i want 4B transistors versus 4000 if 4000 is all it takes to run all x86 opcodes
<norc> lala2004: that diagram is as low as you can understand it without losing yourself.
davedev24 has joined #ruby
<norc> lala2004: Look at that, and then begin to understand that modern processors are unbelievably complex.
<lala2004> thanks
<workmad3> elomatreb: if you want something fun - you can also construct all basic logic gates from NOR gates... and you can construct a NOR gate from a single transistor
<norc> and then start building arithmetic operations
<norc> try to build a half-adder without looking at the wiki
<lala2004> well, i'm impressed -- my teacher said that ruby coders don't understand how things work
<norc> then a full adder
<lala2004> that i should learn c because i would learn what the computer does
<elomatreb> workmad3: In Germany you actually do that in school if you pick CS in the higher grades
<norc> lala2004: C is a fine language but has different goals.
<workmad3> lala2004: if you learn C, you learn what a PDP11 does...
<norc> lala2004: C is useful when you need to write language close to the hardware.
<norc> For Kernel development there are only 2 sensible languages (a few others have been used successfully though)
<norc> C and possibly C++.
<workmad3> it has about as much actual resemblance to modern hardware as ruby... but it has 30+ years of intensive compiler optimisation behind it
<norc> lala2004: But if the task is to quickly provide a website, then C is not the right task because you are too close to the hardware.
<norc> In essence: Ruby developers don't _care_ about the hardware (as opposed to dont know)
<elomatreb> lala2004: If you really want to use a compiled language you could check out Rust (https://www.rust-lang.org/). Almost all the benefits with few of the risks of C
flashpoint9 has joined #ruby
k3rn31 has joined #ruby
nobitanobi has joined #ruby
<lala2004> does rust give you the h/w knowledge
<ytti> rust has no run time
<ytti> it can be used for anything
<lala2004> ytti: what does that mean?
<ytti> it means it's as low level a it gets
<lala2004> ah -- nice
<norc> Just dont try Kernel development with it. :-P
joonty has quit [Remote host closed the connection]
<ytti> (i disagree greatly if C is fine language, i don't think it is, i think large amount of poor quality software is attributed to C being too hard to program right)
<elomatreb> Unless you're developing actual drivers you probably shouldn't be interested in HW knowledge for programming
<workmad3> lala2004: tbh, no language will really give you h/w knowledge (not even C)... the main thing C will give you is working knowledge of an ancient processor, and manual memory management
joonty1 has joined #ruby
<lala2004> workmad3: i see
<norc> ytti: Well its fine for specific tasks, which is kernels and drivers.
rodfersou has joined #ruby
<workmad3> lala2004: what gives you hardware knowledge is having to interface with hardware (like elomatreb said)
<lala2004> got it
Emmanuel_Chanel has joined #ruby
<elomatreb> If you're really interesting in Hardware get a Arduino or some similar microcontroller chip. Quite fun to play with
<elomatreb> *interested
certainty has joined #ruby
<workmad3> lala2004: C doesn't really expose you to things like having to move data from memory to registers, the instruction counter, etc. and it definitely won't expose you to the microcode optimisations of modern hardware... it's surprisingly far away from actual hardware for something that's claimed as 'low level' by so many :)
ramfjord has quit [Ping timeout: 272 seconds]
<lala2004> so -- breaking code, ida and the like might give one that knowledge
tlaxkit has joined #ruby
chouhoulis has joined #ruby
<norc> workmad3: And yet C requires you to be *aware* of all these things. If you have misaligned data, your program might crash. If you dont write cache line aware core, you suffer from extreme performance penalties.
<norc> *code
<workmad3> norc: yeah, but it needs you to be aware of them in a way that's closer to PDP11s hardware than modern hardware
<workmad3> norc: that doesn't make it 'close to the metal', it makes it annoying ;)
<norc> Heh.
<norc> workmad3: The headache I got yesterday when I learned why exactly I had to enable the A20 gate during boot sequence.
<norc> Unbelievable.
<workmad3> norc: compilers make up for a lot of the inconsistency though, so C compiles down to something pretty close to optimal for the underlying hardware in most cases
<norc> Not to mention why one of the common ways to do it was through the keyboard controller (that provoked a real wtf)
<lala2004> ok -- sorry, very basic again -- if I have a hash: freq = Hash['large' => 0, 'small' => 0, 'tiny' => 0, 'lose' => 0] and I want to increase 'large' by one?
<norc> workmad3: Indeed. Though cache line awareness is something the programmer has to do, the compiler can not help.
<norc> Or page boundary awareness.
<workmad3> lala2004: freq['large'] += 1
<lala2004> ok
<lala2004> simple enough!
<workmad3> lala2004: also, I'd suggest using a hash literal - `freq = { 'large' => 0, 'small' => 0, ... }`
certainty has quit [Ping timeout: 260 seconds]
<norc> workmad3: And sadly the only way you can write good code there, is if you understand cache lines and paging.
<lala2004> is there an easy way to display all hash values at the end
<lala2004> or do i need to iterate it?
<workmad3> lala2004: `p freq`
<norc> lala2004: Id say start by iterating!
<norc> lala2004: Try things out.
<norc> Get experience. Get your hands dirty.
<workmad3> (if in doubt, `puts` and `p` give you insight into lots of things)
<Bish> btw
<Bish> my regex was /<a .../ to detect links
<Bish> someone did <a\n -_-
<workmad3> Bish: welcome to why you shouldn't use regexp to try and parse HTML :P
<Bish> well even if its broken html?
CloCkWeRX has quit [Ping timeout: 264 seconds]
johnmilton has joined #ruby
<norc> Bish: Did you have a reason not to use an XML/HTML parser?
nobitanobi has quit [Remote host closed the connection]
joonty1 is now known as joonty
<Bish> well that regex was sufficent until now
<Bish> i really only wanted links, that's all i needed
<norc> lala2004: By the way! https://eval.in/ allows you to share code *and* have it executed. (gists are great for everything else though)
johnDoe111 has joined #ruby
duckpuppy has joined #ruby
<norc> Bish: see, with nokogiri it would be: document.css(‘a’)
<workmad3> Bish: `<a\n` isn't broken HTML, afaik
swills has joined #ruby
<lala2004> norc: cool -- appreciate any tips on my code -- that was much easier than i thought
<lala2004> simulating a game i'm making for school -- a roulette wheel
<norc> lala2004: Considering you just started, just focus on figuring things out.
<norc> lala2004: aside from the usual "use 2-space indention, not tabs" that you hear in this channel I wouldn't really care to comment on else.
<lala2004> ok -- well that works -- i love the switch syntax
<norc> Otherwise you would be busy for a day rewriting this.
gnufied has joined #ruby
mistermocha has joined #ruby
k3rn31 has quit [Quit: Computer has gone to sleep.]
<lala2004> ok -- well, i'm excited that i got something to work
<lala2004> thanks for all the understanding too
<norc> lala2004: It looks generally fine otherwise.
<norc> So you are on a good path.
<lala2004> i'll take it
<lala2004> good day all
lala2004 has left #ruby [#ruby]
johnDoe111 has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 260 seconds]
Guest35287 has quit [Quit: leaving]
allcentury has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
axsuul has joined #ruby
swills has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
vondruch has quit [Quit: Ex-Chat]
blockchan1 has quit [Ping timeout: 250 seconds]
deadnull_ has joined #ruby
chouhoulis has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
preller has joined #ruby
rodfersou has quit [Quit: leaving]
syath has joined #ruby
axsuul has quit [Ping timeout: 276 seconds]
jaguarmagenta has joined #ruby
AcidCrash has quit []
CloCkWeRX has joined #ruby
Fredrich010 has joined #ruby
Fredrich010 is now known as AcidCrash
davedev24 has quit [Remote host closed the connection]
<Bish> workdmad3 i never said <a\n would be the reason why the html is broken
kareeoleez has quit [Ping timeout: 250 seconds]
<Bish> workmad3: *
<Bish> it can get much worse than that :D
kareeoleez has joined #ruby
preller has quit [Quit: leaving]
<jhass> ?tabnick
<ruby[bot]> pro-tip - use tab completion for nicks. avoids typos in nicks.
<Bish> i scrolled up in irssi somehow couldn't tab during that
preller has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
<jhass> get weechat :P
<Bish> i like irssi
jaguarmagenta has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
rodfersou has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
preller has quit [Quit: leaving]
flashpoint9 has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 258 seconds]
blockchan has joined #ruby
nobitanobi has quit []
chouhoulis has quit [Remote host closed the connection]
blockchan1 has joined #ruby
matp has quit [Remote host closed the connection]
matp has joined #ruby
blockchan has quit [Ping timeout: 252 seconds]
Yiota has joined #ruby
Silthias has joined #ruby
Wildfyr has joined #ruby
<shevy> real men need real GUIs
<Bish> i feel like text interfaces are way more manly
hutch34 has joined #ruby
johnDoe111 has joined #ruby
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yiota has quit [Ping timeout: 272 seconds]
joonty has quit [Quit: This computer has gone to sleep]
hanmac has joined #ruby
<jhass> what does usability have to do with my gender?
alfiemax has quit [Ping timeout: 272 seconds]
<workmad3> jhass: it has very little to do with your gender, but it has a lot to do with cultural gender-specific stereotypes
<jhass> doesn't sound like a good situation then
lightt has joined #ruby
rikkipitt has joined #ruby
<apeiros> Bish: in what way? that most interfaces are dicks to users?
<shevy> lol
blackgoat has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
<shevy> text interfaces are a lot easier to do right
<apeiros> in a way. in a way they're a lot more difficult.
swills has joined #ruby
moeabdol2 has joined #ruby
<Bish> i think different
swills has quit [Remote host closed the connection]
romistrub has joined #ruby
<jhass> different from/than?
lightt has quit [Remote host closed the connection]
<romistrub> hi all
<Bish> apeiros: in a way that interfaces are a lot closer to the "engine" like a motorengine of a car => manly
<jhass> what a sad statement
<jhass> anyway
<Bish> if you have a sort of syntax you can often reuse something
<jhass> ?offtopic
<ruby[bot]> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<Bish> more flexieble etcpp, but as jhass said
<Bish> jhass: i wasn't 100% serious about that one :D
moeabdol1 has quit [Ping timeout: 250 seconds]
<jhass> sarcasm doesn't prevent reproduction
<romistrub> how do I create a subclass of String and then set its value as something from within a function? Is there something like my_string.value = "xyz"? I don't think it makes sense to do self = "xyz" from within a function
<apeiros> romistrub: a) don't do it, b) #replace
<jhass> romistrub: don't subclass string, wrap it
k3rn31 has joined #ruby
<romistrub> jhass: apeiros I'll look into wrapping, thanks!
<Bish> jhass: what is this supposed to mean?
<Bish> does*
<Bish> is?
<apeiros> Bish: that your sarcasm is complicit in keeping stereotypes alive
<Bish> jesus christ, it's really easy to fall into the PC-trap in irc
ElFerna has joined #ruby
<apeiros> that's a rather sad excuse
Niham has joined #ruby
duckpuppy has joined #ruby
<apeiros> "oh no, don't hit on me you bad bad evil PC people you - *I* didn't do anything wrong!!!"
<apeiros> that's unmanly, btw. :-p
<Bish> excuse for what, there was nothing done wrong, the statement "real men need guis" is already sexist in a way, and it was not serious
<romistrub> google searched "wrap ruby class" and I'm getting "wrap ruby class method"
<jhass> romistrub: look into SimpleDelegator
<Bish> i gonna stop here, but you're overdoing it
<apeiros> Bish: sure. keep yourself telling that.
<jhass> apeiros: Bish #ruby-offtopic. now.
symm- has quit [Ping timeout: 258 seconds]
zacstewart has joined #ruby
<workmad3> jhass: do I need to go to #ruby-offtopic if I want to make a comment that your previous statement is like a teacher telling off bad children? :)
<jhass> yes!
<workmad3> ok, will do!
chipotle has quit [Ping timeout: 240 seconds]
<jhass> <3
certainty has joined #ruby
jazz2 has joined #ruby
kinnie has joined #ruby
ldnunes has joined #ruby
jazz1 has quit [Ping timeout: 276 seconds]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
m_antis has joined #ruby
sandelius has joined #ruby
zacstewart has quit [Ping timeout: 258 seconds]
joonty has joined #ruby
certainty has quit [Ping timeout: 258 seconds]
<romistrub> okay, how do I puts to terminal while in a subclass of TCPSocket
synthroid has joined #ruby
<romistrub> I'm getting a broken pipe error, presumably because there's no socket open yet and it's trying to do TCPSocket#puts
<Bish> romistrub: just do it </shialeabouf>
<Bish> oh, i get it, sorry
troulouliou_div2 has joined #ruby
<Bish> that's a good question *awaits the answer*
<romistrub> Bish... que¿
<toretore> STDOUT.puts
<romistrub> toretore: thanks!
<Bish> dayum that was easy.
bobina22 has joined #ruby
jazz3 has joined #ruby
sergio_101 has joined #ruby
* jhass sees a tendency
Snowy has quit [Quit: ragequit]
jazz2 has quit [Ping timeout: 244 seconds]
<jhass> romistrub: prefer composition over inheritance, ask yourself whether you really need to subclass all that stuff
m_antis has quit [Ping timeout: 250 seconds]
Yiota has joined #ruby
<romistrub> jhass: but... but... I'm just so used to using inheritance!
<jhass> baaad reason :P
<romistrub> jhass: is there a good reference or article on what you're talking about?
<jhass> pretty sure Clean Code talks about it
<romistrub> enh, I'm not an old dog
<romistrub> is that ruby-specific?
<jhass> nope, the examples use Java
<jhass> but apply to all OOP really
<jhass> I guess POODR could mention it too? never read it
symm- has joined #ruby
pawnbox has quit [Remote host closed the connection]
<romistrub> can you show me an example, then, of a simple, composed system?
troulouliou_div2 has quit [Remote host closed the connection]
jancel has joined #ruby
<toretore> romistrub: better: describe your current use case and then we'll describe how to do it with composition
<romistrub> (is there any way to disable all of the "==" messages [status updates] in the web-based freenode IRC client?)
mistermocha has quit [Ping timeout: 250 seconds]
<romistrub> toretore:
<romistrub> okay
<shevy> ewww webchat clients
<sandelius> this is pretty short and easy to grasp about the topic https://lucaguidi.com/2016/06/07/the-penguin-that-cannot-fly.html
<jhass> romistrub: yup, three bars at the top left, options
<sandelius> composition that is
<toretore> (or tell you that it is in fact a valid use of inheritance :P )
<shevy> can penguins fly?
<sandelius> no that's the problem :)
<sandelius> read
dionysus69 has joined #ruby
<apeiros> romistrub: it's relatively simple: don't subclass classes you don't own
<romistrub> jhass: thx
<shevy> this code is well documented
<shevy> class Penguin < Bird
<shevy> # LOL I'm a penguin
<romistrub> apeiros: gotcha, simple in principal
<sandelius> shevy haha right
<apeiros> "the idea is borrowed from Go" - I almost made a mess with my drink at that point :D
<romistrub> So I'm creating a WebSocket server, which is basically a TCPSocket with some special encoding, decoding, and control functionality
<romistrub> I know there are existing WebSocket servers, but I'm just getting back into programming and needed to get my hands dirty
<toretore> i don't think you can classify a websocket as-a tcpsocket
<Bish> the pengiun article doesn't provide a solution but one that doesn't exist :o
<sandelius> Bish no but it points out the problem with inheritance :)
<sandelius> not all inheritance is bad tho
<romistrub> toretore: disagree, programatticaly speaking they seem the same; an ideal case for inheritance, as their functions are almost identical, but with some pre-and-post-processing going on frame-by-frame
<toretore> romistrub: well, if that's the case then inheritance is ok
<toretore> romistrub: but you have to be really sure that there aren't any exceptions
<jhass> romistrub: see this websocket implementation: https://github.com/crystal-lang/crystal/blob/master/src/http/web_socket/protocol.cr#L34 it simply wraps an IO, it composes over it. It can do websocket over any kind of IO for free!
<romistrub> jhass: smart, over any IO
<toretore> i've thought the same many times and inherited something, only to discover that some assumptions made in the superclass aren't true for my case
nerium has joined #ruby
c355e3b has joined #ruby
<Bish> that ruby doesn't have ++ hurts me for the first time :( ouchy
<romistrub> Hah! I forgot how much I suck at reading someone else's code
<sandelius> off topic: I havent done any real PHP work but in most languages we use connection pools for creating new e.g database connections. But in PHP it seems like a new connection is created upon each request? Can this really be?
<Bish> sandelius: yes, php scripts lifecycles is during the request
rikkipitt has quit [Remote host closed the connection]
<Bish> starts and ends with it
<toretore> it probably could. iirc, a php script is.. what bish said
jaruga___ has quit [Ping timeout: 264 seconds]
Gasher has joined #ruby
<sandelius> Bish but but but wont the dataabse slap you in the face if you get many requests?
jaruga___ has joined #ruby
Xentil has joined #ruby
<Bish> it probably does, but i guess they mysql module of php does some hacky things to recycles connections between multiple requests
<Bish> (just a guess, don't know)
flashpoint9 has joined #ruby
<sandelius> you would end up with an insane amount of open connections
<Bish> depends if you stall them / limit the amount of multiple requests
<sandelius> (porting a php project to ruby)
diegoaguilar has quit [Ping timeout: 250 seconds]
last_staff has quit [Ping timeout: 250 seconds]
ElFerna has quit [Ping timeout: 252 seconds]
<Bish> but your understanding is right, atleast some sort of connection has to be created every request
<norc> sandelius: if you know from the beginning well enough that its offtopic that you designate it as "offtopic:", start the conversation in #ruby-offtopic
<norc> Not here.
<norc> ?offtopic
<ruby[bot]> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<sandelius> norc sry
<Bish> but you can have "too many connections" error in ruby, too, so there is basicially no difference
davedev24 has joined #ruby
triangles has joined #ruby
<romistrub> jhass: am I crazy, is there a class *within* a class in your link?
blackmesa has joined #ruby
<jhass> sure!
<jhass> both classes and modules can be used as namespaces, true for Crystal and Ruby
<apeiros> >> Class < Module
<ruby[bot]> apeiros: # => true (https://eval.in/586751)
<norc> romistrub: The only notable difference between classes and modules is: classes can be instantiated and modules can be included from.
<apeiros> romistrub: ^
<apeiros> them classes be modules!
<jhass> there's even a couple of enums within the class! (Ruby doesn't have those ;) )
<norc> romistrub: Otherwise they are the same thing.
<Bish> sandelius: basicially jhass didn't want to help you, he just wanted to show off crystal :p
<Bish> romistrub: *
<Bish> sorry
<jhass> sssh
craigp has quit [Ping timeout: 250 seconds]
<romistrub> lol
<Bish> jhass: do you have perfect threading/fibering by now :p
<jhass> who has
armin has joined #ruby
<jhass> but no
pawnbox has joined #ruby
<Bish> well atleast one that uses 1+ core
<norc> apeiros: What kind of syntax is that. o_o
Vile` has quit [Ping timeout: 244 seconds]
<jhass> a single core is more than enough to beat ruby! :P
<norc> Is op< just short for kind_of?
<Bish> >> Class.method(:<)
<ruby[bot]> Bish: # => #<Method: Class(Module)#<> (https://eval.in/586752)
<Bish> :o
<apeiros> norc: < is "is subclass", not "is kind of"
<norc> Ah. Fancy.
<apeiros> instantiation vs. inheritance
tk__ has joined #ruby
<norc> Thing I learn.
edwardly has quit [Ping timeout: 250 seconds]
last_staff has joined #ruby
p337rB has joined #ruby
<apeiros> it's nice because `class Class < Module` maps neatly to `Class < Module`
<jhass> Bish: all ears if you have a ruby example showing websockets implemented using composition though
<toretore> `Class < Module` by itself looks a little wrong to me
<Bish> jhass: just wanted to mock you :D i love the idea of crystal
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
<jhass> >> c = Class; m = Module; c < m # feeling better toretore ? :P
<ruby[bot]> jhass: # => true (https://eval.in/586754)
<Bish> can't wait until it's "done"
<toretore> yes that's better :)
blackmesa has quit [Ping timeout: 260 seconds]
<romistrub> seriously, this reads like magic
freerobby has joined #ruby
<Bish> i don't understand how class X < Y can work if Class has a method :<
<Bish> guess it's static syntax
<jhass> Bish: there's some production stuff already using it afaik
<jhass> yes, class changes the grammar for the rest of the line
<Bish> guessed so
<apeiros> toretore: did you try turning them off and on again? :-p
AndyBotwin has quit [Ping timeout: 276 seconds]
infra-red has joined #ruby
rikkipitt has joined #ruby
<romistrub> what's this "record PacketInfo, opcode : Opcode" etc.,
<jhass> romistrub: you realize this ain't ruby, yeah? :P
<romistrub> jhass: I'm retarded
<romistrub> lol
<romistrub> it looks so similar in some spaces
der-landgraf has quit [Quit: WeeChat 1.5]
<jhass> romistrub: but to answer, it's a macro defining a struct with the given name and fields
<romistrub> okay, makes sense
<romistrub> that said, what lang is it?
<romistrub> so deceptively similar to RUby
<jhass> http://crystal-lang.org/api/toplevel.html#record%28name%2C*properties%29-macro
<jhass> it's Crystal
syath has quit [Quit: WeeChat 1.2]
<romistrub> oh shazam, I thought that was the name of the websocket implementation :|
fmcgeough has joined #ruby
infra-red has quit []
davedev24 has quit [Remote host closed the connection]
<romistrub> reading Crystal was like listening to Dutch while being a native english speaker
davedev24 has joined #ruby
<Bish> crystal not even once
<romistrub> it sounds so close that you think you're having a stroke
<Bish> have u thought about that one BEFORE deciding for the name?
<romistrub> Bish: hilarious :P
der-landgraf has joined #ruby
<romistrub> dibs on crystaladdict.com
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
der-landgraf has quit [Client Quit]
der-landgraf has joined #ruby
deadnull_ is now known as _deadnull
lxsameer has quit [Ping timeout: 252 seconds]
xlegoman has joined #ruby
noobsu has joined #ruby
terminalrecluse has joined #ruby
phredus has quit [Remote host closed the connection]
phredus has joined #ruby
<romistrub> I still have no idea what everybody was talking about when they were talking about wrapping... :| hahah
xlegoman has left #ruby [#ruby]
<jhass> class WebSocket < TcpSocket -> class WebSocket; def initialize(socket); @socket = socket; end;
ramortegui has joined #ruby
dstarh has joined #ruby
jancel has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
cdg has joined #ruby
blockchan1 has quit [Ping timeout: 244 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
ta_ has quit [Remote host closed the connection]
<romistrub> jhass: gotcha, thanks
blockchan has joined #ruby
<romistrub> jhass: and why do I prefer that exactly? :P
eljimbo has quit [Quit: This computer has gone to sleep]
<jhass> you have 100% control, now _and_ in the future, what interface your class provides
<romistrub> jhass: okay, thank u
<jhass> you don't have to worry about how any behavior _or changes of behavior_ of your parent class will affect the interface of your class
jasondotstar has joined #ruby
swills has joined #ruby
lxsameer has joined #ruby
roamingdog has quit [Ping timeout: 276 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<jhass> and finally it usually also makes your class more flexible by duck typing on the class it wraps, so you can just substitute TCPSocket for FakeSocket in your tests for example
craigp has joined #ruby
axxyhtrx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Madplatypus has quit [Quit: Connection closed for inactivity]
jancel has joined #ruby
<romistrub> jhass: thanks; is all this info in that book u linked me to?
<jhass> uh, I don't remember, probably not exactly like it
<jhass> but it sets the right mindset for sure
<romistrub> I'm definitely more of an Epimethius than Promethius type, so style books could serve me well
roamingdog has joined #ruby
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eGGshke has quit [Quit: Leaving...]
hutch has joined #ruby
<hutch> good morning :)
certainty has joined #ruby
<romistrub> morning hutch
blackmesa has joined #ruby
edwardly has quit [Max SendQ exceeded]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
certainty has quit [Ping timeout: 258 seconds]
tatsuo has quit [Remote host closed the connection]
_deadnull is now known as deadnull_
chouhoulis has joined #ruby
aegis3121 has joined #ruby
tlaxkit has quit [Quit: ¡Adiós!]
gregf has quit [Quit: WeeChat 1.5]
Snowy has joined #ruby
gregf has joined #ruby
aegis3121 has quit [Ping timeout: 246 seconds]
kies has quit [Ping timeout: 276 seconds]
<Bish> how do i neatly get the time of yesterday? -24h
<Bish> i always end up substracting seconds, but that sucks
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
blaxter has joined #ruby
<toretore> what do you mean the time of yesterday, a Time object representing now - 24h?
<Bish> yep
<toretore> yes, then by subtracting 86400
<chris2> wrong for a leap second :P
<shevy> hmm
<hutch> would Time.now - 1.day work ?
<toretore> >> 1.day
<ruby[bot]> toretore: # => undefined method `day' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/586765)
<Bish> thats rails
<Bish> afaik
<hutch> i was wondering about that…my mistake
<chris2> also just a multiplier
<toretore> Fixnum#day is `self * 86400`
<toretore> or Numeric#day whatever it is
pawnbox has quit [Quit: gotta go guys.]
raeoks has joined #ruby
miqlas-H has joined #ruby
axsuul has joined #ruby
miqlas-H has left #ruby [#ruby]
jrafanie has joined #ruby
pawnbox has joined #ruby
deavidsedice has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 260 seconds]
malconis has joined #ruby
dionysus70 has joined #ruby
<Bish> mails.filter { sent_at > Time.now-3600*24 }.count
<Bish> still gotta love ruby for lines like that
rippa has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
malconis has quit [Remote host closed the connection]
dionysus70 is now known as dionysus69
<Bish> especially if you keep in mind that that executes a sql statement
malconis has joined #ruby
swills has quit [Remote host closed the connection]
<chris2> ... in postgresql just use current_date - 1
jaguarmagenta has joined #ruby
axsuul has quit [Ping timeout: 252 seconds]
swills has joined #ruby
zacstewart has joined #ruby
<Bish> chris2: there underlying database doesn't really matter, just wanted people to know about my progasm about DSL with blocks
kareeole_ has joined #ruby
<Bish> sequel changed my view of programming and jeremy evans is a genius, is he here HI JEREMY!
<chris2> unless you end up looking at the clock for each mail :P
<Bish> well, no that won't happen
<Bish> Time.now gets evaluated and turned to a string in the sql query
<chris2> totally obvious from the code :P
nertzy2 has joined #ruby
<Bish> well, imho it is
<Bish> atleast after i said sql
jaguarmagenta has quit [Ping timeout: 258 seconds]
kareeoleez has quit [Ping timeout: 258 seconds]
swills has quit [Remote host closed the connection]
aegis3121 has joined #ruby
ChiefAlexander has joined #ruby
nertzy3 has quit [Ping timeout: 264 seconds]
Niham has joined #ruby
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
jrafanie has joined #ruby
mdw has joined #ruby
qasaur has joined #ruby
mdw has quit [Max SendQ exceeded]
roamingdog has quit []
CloCkWeRX has quit [Ping timeout: 260 seconds]
mdw has joined #ruby
mdw has quit [Max SendQ exceeded]
mdw has joined #ruby
jancel has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
jaruga___ has quit [Quit: jaruga___]
swills has joined #ruby
kinnie has quit [Quit: Bye]
mrmortondk has joined #ruby
frem_ has joined #ruby
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
leitz has joined #ruby
sandelius has joined #ruby
sankarshanmudkav has joined #ruby
sankarshanmudkav has left #ruby [#ruby]
<romistrub> So I'm trying to pass event handlers as lambdas into a function so that they can be called and passed certain variables (I thought this was their major use-case); but I keep getting a "undefined local variable: connection" (Name Error)
palms has joined #ruby
Yiota has joined #ruby
<romistrub> the error occurs at line 387
blackgoat has quit [Ping timeout: 276 seconds]
<Bish> .gsub(/\n\n/,'')
<Bish> :p
jaruga___ has joined #ruby
allcentury has quit [Ping timeout: 272 seconds]
<romistrub> say what.... :|
symm- has quit [Ping timeout: 244 seconds]
<romistrub> too much whitespace? :P
<toretore> romistrub: you are confused about the syntax
<romistrub> oh, simple as that, eh?
<toretore> you are calling a method, lambda, and trying to give it two arguments, connection & message
<Bish> romistrub: lambda { |param1,param2| doStuff(param1) }
Yiota has quit [Ping timeout: 240 seconds]
<romistrub> .... embarrassing lol... thanks guys
<Bish> or lambda { |namedParam:nil,anotherNamedParam:nil| }
<romistrub> Bish: that for default values?
johnDoe111 has joined #ruby
<workmad3> romistrub: optional named params
<romistrub> ah
<Bish> you can also give "unamed" parameter default values
<Bish> as in lambda { |param1=nil,param2=nil| }
ChiefAlexander has quit [Remote host closed the connection]
<romistrub> aren't they named param1 and param2? :P
k3rn31 has joined #ruby
ChiefAlexander has joined #ruby
<Bish> ofc they're named in the lambda itself, but they will be assigned by the order of the parameters
<workmad3> yeah... I should have said 'optional keyword params' rather than named params :)
daivyk has joined #ruby
<romistrub> wait, so I think I see what you're saying
davedev2_ has joined #ruby
<romistrub> when you call it, you can name the param like f.call(namedParam2:val, namedParam1:val) ?
<Bish> yes
<romistrub> cool
andikr has quit [Remote host closed the connection]
<Bish> useful for methods with many many params which also need default values
lubekpl has joined #ruby
<romistrub> in those cases I prefer passing hashes
johnDoe111 has quit [Ping timeout: 260 seconds]
<romistrub> maybe not the best stylistically
<shevy> :D
<Bish> romistrub: haha! there comes the fun part
<Bish> you can still do that
<Bish> with the splat operator
<romistrub> splat operator?
<apeiros> though, if your method takes many arguments, you should take a moment to reconsider your API
<romistrub> right o
saneax is now known as saneax_AFK
<romistrub> haha apeiros
<apeiros> sometimes it is right, but often it's a code smell.
blockchan has quit [Quit: blockchan]
<Bish> >> def test(one:'hi :3'); puts *args; end; test(*{one:'ho'})
<ruby[bot]> Bish: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/586769)
<Bish> NUUU
<romistrub> was that a typo, or is a "code smell" actually a thing?
<apeiros> my CS prof's opinion was 2-3 args max (I don't have any such opinion, but I think it's still a nice guideline)
<norc> Bish: NameError: undefined local variable or method 'args' for main:Object
<norc> Is what I would expect. :p
<Bish> yeah i did something wrong
davedev24 has quit [Ping timeout: 250 seconds]
<norc> Wait, splat on a Hash?
CloCkWeRX has joined #ruby
<Bish> guess you cannot use splat on literal
<norc> asm>> *{}
<ruby[bot]> norc: I have disassembled your code, the result is at https://eval.in/586770
<apeiros> prolly should have been **{}
<norc> asm>> foo(**{})
<ruby[bot]> norc: I have disassembled your code, the result is at https://eval.in/586771
<apeiros> it's pointless, though, as ruby will take the last hash as named args anyway
<norc> What does splat on a Hash do?
<Bish> oh yeah it was doublesplat
<apeiros> >> def foo(bar: ,baz: ); baz; end; foo({bar:1, baz: 2})
<ruby[bot]> apeiros: # => 2 (https://eval.in/586772)
<Bish> norc: exactly for that use case
<Bish> def test(one:); puts one; end; myArgs = {one:'ho'};test(**myArgs)
<Bish> >> def test(one:); puts one; end; myArgs = {one:'ho'};test(**myArgs)
<ruby[bot]> Bish: # => ho ...check link for more (https://eval.in/586773)
<apeiros> ^ kwargsplatlesshappiness
<norc> Bish: Ah.
<norc> Oh it should make sense.
<Bish> it's so awesome, just learned about it
schmoot has joined #ruby
<Bish> because you cannot call def test x=1,y=2 with only setting y, while x staying default
<norc> asm>> foo(**a)
<ruby[bot]> norc: I have disassembled your code, the result is at https://eval.in/586774
<norc> apeiros: That is some real disgusting crap there.
<apeiros> norc: wait for the implications. consider this: `def foo(a={}, b:); b; end; foo({b:1})` - what should it do?
<norc> apeiros: return nil?
<Bish> first param is a hash... so?
edwinvdg_ has quit [Ping timeout: 258 seconds]
craigp has quit [Ping timeout: 260 seconds]
<norc> Why is it splatted? What
<norc> Oh
<apeiros> norc: in that case, you mean it should raise ;-)
<norc> apeiros: Oh yea.
<apeiros> (because b is required)
<norc> Why the heck
<Bish> WHAT
<apeiros> but yeah, I'd have the same expectation.
<Bish> why?
<norc> asm >> foo({b:1})
<norc> asm >> foo({b:1})
<apeiros> and with those words, spreading confusion and disbelief, I'll leave the stage - toodles ;-p
<norc> asm>> foo({b:1})
<ruby[bot]> norc: I have disassembled your code, the result is at https://eval.in/586778
<norc> FCALL|KWARG
<norc> :(
<Bish> but well, if it worked as expected it would be awesome
<Bish> i understand why, i guess
Spami has quit [Quit: Leaving]
<Bish> it will prefer keyword calling, since a has a defualt value
<norc> apeiros: Okay I get it now.
<apeiros> the reason was a rushed out hack-syntax for a make-shift kwarg syntax in ruby 1.9
<Bish> but.. that's weird
<apeiros> without actually having kwargs
<norc> apeiros: Apparently passing a hash literal adds the KWARG flag.
<norc> apeiros: If you stuff the Hash into a variable first its gone.
<Bish> that's really confusing
jancel has joined #ruby
<norc> >> def foo(a={}, b:); b; end; a = {b:1}; foo(a) # should raise
<ruby[bot]> norc: # => 1 (https://eval.in/586779)
<norc> Or not? o_p
<Bish> wow, is there actually a way to change a to a specified hash?
eljimbo has joined #ruby
sergey_makagon has joined #ruby
<Bish> apeiros: but imho that's not an implication, thats a stupid implementation
certainty has joined #ruby
raeoks has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
<romistrub> >> def foo(a={}, b:); a; end; foo({c:1})
hackeron has quit [Remote host closed the connection]
<apeiros> Bish: it's an implication of what I said before. and the reason of what I said before is, indeed, a stupid implementation.
<norc> apeiros: I remember that a long while ago kwargs were implemented by Ruby implicitly providing a Hash
<TomyWork> is there a more elegant way to express "ARGV.length == 1 and ARGV[0] == 'foo'"?
JesseH2 has joined #ruby
tubuliferous_ has joined #ruby
<apeiros> TomyWork: ARGV == ['foo']
<TomyWork> neat
<norc> apeiros: Which lead to some bizarre iseq assembly, because accessing these kwargs would actually call Hash#[]
<TomyWork> thanks
<Bish> well it's not as bad as i expected
<Bish> b is required, and if you have b defined it will actually use that one
<Bish> >> def foo(a={}, b:); [a,b]; end; foo({:a=>4},b:3)
<ruby[bot]> Bish: # => [{:a=>4}, 3] (https://eval.in/586782)
<Bish> okay, no, it's bad
naftilos76 has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
<Bish> >> def foo(a={}, b:1); [a,b]; end; foo({:b=>4})
<ruby[bot]> Bish: # => [{}, 4] (https://eval.in/586783)
<Bish> this is worse, :o
<TomyWork> FCALL, not to be confused with FUCALL
<norc> apeiros: It makes no sense to me.
<Bish> so stupid!
<apeiros> norc: it's the result of trying to be backwards compatible to 1.9's syntax
lxsameer has joined #ruby
<apeiros> you have to look at it from that perspective and suddenly it makes sense. it doesn't make it any less stupid, tho.
<norc> apeiros: How about this:
<norc> apeiros: https://eval.in/586787
<norc> Let's see if you spot the most bizarre thing that barely any Ruby programmer has heard about.
<apeiros> norc: flip-flop?
nando293921 has joined #ruby
<norc> Im amazed. :)
<norc> apeiros: I have yet to find a book that even mentions it.
<apeiros> I haven't seen many actually useful use-cases of those
<apeiros> the best one so far has been something to extract data from logs
<apeiros> not sure I could reconstruct it. it printed while the flip-flop was true.
Mon_Ouie has joined #ruby
<norc> Well Im sure it could be extremely helpful in obfuscated code contests.
<apeiros> haha, that anyway.
<apeiros> but I think you can win those using Ox0dea's numeric ruby stuff :o)
ChiefAlexander has quit [Remote host closed the connection]
<TomyWork> so "if a .. b" evaluates as true from the time a first became true to the time a is no longer true and b starts and stops being true?
<norc> TomyWork: Correct.
<TomyWork> awesome
emptyflask has joined #ruby
phredus has quit [Remote host closed the connection]
d10n-work has joined #ruby
<norc> TomyWork: chrisseaton made some research that showed that out of 1 million lines of code only 1 line on average used this operator.
lxsameer has quit [Ping timeout: 250 seconds]
SilverKey has joined #ruby
phredus has joined #ruby
agent_white has joined #ruby
lxsameer has joined #ruby
SilverKey has quit [Client Quit]
<agent_white> Mornin'
<Bish> apeiros destroyed my happiness.
<romistrub> agent_white: morning
<Bish> how can i ever use **{} again
<apeiros> Bish: soooo… business as usual?
<Bish> why do they actually make implicit conversion of hash with symbols to args
<Bish> without that, everything would be fine
<Bish> you would've to use **{} and all good
jancel has quit [Remote host closed the connection]
<apeiros> as I said - 1.9
<Bish> hdsfhdshf
ChiefAlexander has joined #ruby
johnDoe111 has joined #ruby
<Bish> is there really no way around that? geze?
xapak has joined #ruby
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
<xapak> Hello.
tjbiddle has joined #ruby
Rodya_ has joined #ruby
<Bish> xapak: hi
norc has quit [Ping timeout: 250 seconds]
polishdub has joined #ruby
<xapak> Do you know what this means in Ruby (between quotes)? "$!"
<xapak> Cannot find definition.
<Bish> xapak: magic variable containing current error
<xapak> Saw a "raise $!" in a code
<xapak> Hmm...
<shevy> xapak there is a good reference, zenspider
<Bish> so that just reraises the error
TomyWork has quit [Ping timeout: 244 seconds]
<apeiros> xapak: that's verbose for plain `raise`
<apeiros> (raise reraises the current error by default anyway)
karmatr0n has joined #ruby
<apeiros> ?quickref xapak
<apeiros> ah, shevy was faster *and* included the correct subsection :)
<shevy> yay I beat a bot! \o/
kies has joined #ruby
johnDoe111 has quit [Ping timeout: 276 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
<xapak> shevy, Bish, apeiros, thank you very much. :)
swills has quit [Ping timeout: 250 seconds]
<apeiros> shevy: you call me a bot? :(
<shevy> the ruby[bot]
mistermocha has joined #ruby
<shevy> it even has the bot as part of its name, unlike the sneaky ruboto bot
<shevy> well... that one has had bot as part of its name too actually
<shevy> but people did not notice that!
xapak has left #ruby [#ruby]
terrabl has joined #ruby
polishdub has quit [Read error: Connection reset by peer]
<platzhirsch> Anyone working with pact here?
<Bish> apeiros: when will that be fixed! fix it now!
<apeiros> Bish: fix what?
<terrabl> Hey guys, Is there any reason that I would be getting a TestController is not a module (TypeError) in this code? It is saying that TestController is not a module? https://gist.github.com/terrabl/e7fb88ba471b21d9fdbc996a97ad1188
<Bish> that weird kwdshit
polishdub has joined #ruby
mistermocha has quit [Ping timeout: 250 seconds]
<apeiros> terrabl: you'd get it when some other code earlier defines it as a class
<apeiros> >> class X; end; module X; end
<ruby[bot]> apeiros: # => X is not a module (TypeError) ...check link for more (https://eval.in/586821)
<apeiros> also you can't invoke an instance method directly on the class (create, defined on line 6, upper file, invoked in line 9, lower file)
SilverKey has joined #ruby
<terrabl> I figured out what I did wrong, i accidently made a class TestController inside of the file I was requiring inside of loadtestcontroller.rb
<terrabl> I thought as a module I can just call the function as long as I required it in the file?
<terrabl> Like calling create from scheduler would run the TestControllers.create method?
ChiefAlexander has quit [Remote host closed the connection]
<apeiros> no, that's not how it works
snath has joined #ruby
tildes_ has joined #ruby
<terrabl> Sorry I'm new to ruby could you explain or point me in a direction that will help me understand.
<terrabl> I like the concept of modules, and need to implement them, but I think I am correlating them too closely to user defined regular old classes
tjbiddle has quit [Quit: tjbiddle]
<apeiros> terrabl: I'm a bit busy at the moment, so excuse me for just telling you to read a tutorial or book. class- vs. instance-methods is relatively basic.
saneax_AFK is now known as saneax
<apeiros> i.e. should be covered by any introductionary material
Niham has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jas02 has quit [Quit: jas02]
tildes_ has quit [Ping timeout: 264 seconds]
william_ has joined #ruby
<terrabl> apeiros: yeah i guess its probably something I could have looked up myself, sorry for bothering you.
diegoviola has joined #ruby
<apeiros> not a bother. asking is fine. just ain't got time now.
dhollinger has joined #ruby
ChiefAlexander has joined #ruby
aegis3121 has quit [Ping timeout: 250 seconds]
matejkonrad has joined #ruby
aganov has quit [Remote host closed the connection]
kareeole_ has quit [Remote host closed the connection]
swills has joined #ruby
sergey_makagon has quit []
mtkd has quit [Ping timeout: 276 seconds]
marr123 has joined #ruby
marr has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
marr123 is now known as marr
aegis3121 has joined #ruby
despai has joined #ruby
mtkd has joined #ruby
Asher has joined #ruby
kies has quit [Ping timeout: 244 seconds]
taylorrf has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
TomyLobo has joined #ruby
certainty has joined #ruby
ramfjord has joined #ruby
tjbiddle has joined #ruby
learath has left #ruby [#ruby]
certainty has quit [Ping timeout: 244 seconds]
aberen has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rodfersou is now known as rodfersou|lunch
haraigo has quit [Ping timeout: 250 seconds]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
rkazak has joined #ruby
hobodave has joined #ruby
chopin has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 276 seconds]
chopin has joined #ruby
kgrz has joined #ruby
rikkipitt has quit [Remote host closed the connection]
hutch34 has joined #ruby
jancel has joined #ruby
shinnya has joined #ruby
agit0 has quit [Read error: Connection reset by peer]
emptyflask has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
RobertBirnie has joined #ruby
johnDoe111 has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
sandstrom has quit [Quit: My computer has gone to sleep.]
aep-shoutlet has joined #ruby
jancel has quit [Ping timeout: 252 seconds]
Rodya_ has joined #ruby
lxsameer has joined #ruby
cschneid has joined #ruby
<cschneid> How fast is array#reverse? I assume O(n)?
darkxploit has quit [Quit: Leaving]
<aep-shoutlet> is x || false logically equivalent to x, or would values like nil be passed through in the second but transformed to false in the first?
pawnbox has joined #ruby
<Bish> aep-shoutlet: wyh dont u just test it
<aep-shoutlet> irb experiment confirms the behavior is different, thanks!
jaguarmagenta has quit [Ping timeout: 244 seconds]
johnDoe111 has quit [Ping timeout: 260 seconds]
<apeiros> cschneid: O(n) is its algorithmic complexity. not to be confused with performance ("fast")
Rodya_ has quit [Ping timeout: 250 seconds]
tatsuo has joined #ruby
<cschneid> yeah yeah. I know. I just want to verify that what I'm doing won't blow up in time if I give it a longer array
kareeoleez has joined #ruby
moeabdol2 has quit [Ping timeout: 264 seconds]
Gasher has quit [Quit: Leaving]
kareeoleez has quit [Remote host closed the connection]
senayar has quit []
GinoManWorks_ has joined #ruby
<apeiros> "I know, I'll still use the wrong terminology". never ceases to draw a smile on my face…
nando293921 has quit [Ping timeout: 252 seconds]
tatsuo has quit [Ping timeout: 260 seconds]
GinoManWorks has quit [Ping timeout: 260 seconds]
william_ has quit [Quit: Saindo]
<cschneid> yeah, I get the difference between "fast" and "algorithmic complexity" but one is much longer to type :)
<cschneid> mostly I had code like: ` @lines = @lines.reverse.drop_while{|l| ! l.controller? }.reverse ` -- where I want to remove "everything after the last element that returns true to `.controller?`
cajone has left #ruby [#ruby]
AlexJakeGreen has joined #ruby
znz_jp has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
rueben_ has joined #ruby
<apeiros> you could use .reverse_each.find_index. will be a little bit more code, though.
kareeoleez has joined #ruby
<cschneid> yeah. I'll probably leave this until it's too slow
aberen has joined #ruby
emptyflask has joined #ruby
cajone has joined #ruby
kareeoleez has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
ncthom91 has joined #ruby
amclain has joined #ruby
sandstrom has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
raeoks has joined #ruby
<apeiros> oh, just learned that &. does not short-circuit :(
terminalrecluse has joined #ruby
Wildfyr has left #ruby [""Sayonara""]
kies has joined #ruby
vasilakisfil has quit [Ping timeout: 272 seconds]
kareeoleez has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
evidex has quit [Ping timeout: 250 seconds]
whathappens has joined #ruby
emptyflask has quit [Remote host closed the connection]
hutch34_ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
smathy has joined #ruby
emptyflask has joined #ruby
inukshuk_ has joined #ruby
swills has quit [Ping timeout: 240 seconds]
inukshuk_ has quit [Client Quit]
kareeoleez has quit [Ping timeout: 246 seconds]
joonty has quit [Quit: This computer has gone to sleep]
qasaur has joined #ruby
alfiemax has joined #ruby
aegis3121 has quit [Ping timeout: 246 seconds]
kareeoleez has joined #ruby
pld has joined #ruby
bumao has quit [Quit: ZNC 1.6.3 - http://znc.in]
Couch has quit [Ping timeout: 240 seconds]
kareeoleez has quit [Ping timeout: 272 seconds]
taylorrf has quit [Remote host closed the connection]
[Butch] has joined #ruby
SCHAAP137 has joined #ruby
davedev24 has joined #ruby
troulouliou_div2 has joined #ruby
hutch34_ has quit [Ping timeout: 272 seconds]
davedev24 has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 240 seconds]
certainty has joined #ruby
davedev2_ has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
hutch34_ has joined #ruby
David_H_Smith has quit [Remote host closed the connection]
axl_ has joined #ruby
David_H_Smith has joined #ruby
jancel has joined #ruby
johnbat26 has quit [Ping timeout: 260 seconds]
<terrabl> Can you pass variables to a module method?
taylorrf has joined #ruby
hutch34 has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
VeryBewitching has joined #ruby
swills has joined #ruby
mistermocha has joined #ruby
danostrowski has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
hutch34_ has quit [Ping timeout: 240 seconds]
madgen has joined #ruby
nando293921 has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
p0p0pr37_ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
<terrabl> Nevermind that was a stupid question, something else was wrong.
hutch34_ has joined #ruby
aberen has quit [Ping timeout: 276 seconds]
p0p0pr37 has quit [Ping timeout: 250 seconds]
p0p0pr37_ is now known as p0p0pr37
tildes_ has joined #ruby
mistermocha has joined #ruby
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kareeoleez has joined #ruby
ramfjord has joined #ruby
DTZUBDUB has quit [Read error: Connection reset by peer]
rkazak has quit [Ping timeout: 276 seconds]
tubuliferous_ has quit [Ping timeout: 250 seconds]
noobsu has quit [Remote host closed the connection]
kareeoleez has quit [Ping timeout: 250 seconds]
moeabdol2 has joined #ruby
qasaur has joined #ruby
lubekpl has joined #ruby
lubekpl has quit [Client Quit]
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
kareeoleez has joined #ruby
DroidBurgundy has joined #ruby
platzhirsch has quit [Ping timeout: 258 seconds]
<romistrub> newbie question: what's the best way to grab the first two letters of a string, and also chop those letters off the string at the same time?
johnDoe111 has joined #ruby
beatdown is now known as mosh
ChiefAlexander has quit [Remote host closed the connection]
mosh has quit [Changing host]
mosh has joined #ruby
kareeoleez has quit [Remote host closed the connection]
Rodya_ has joined #ruby
mleung has joined #ruby
mhib has joined #ruby
biberu has joined #ruby
aberen has joined #ruby
<romistrub> found it... it's slice! :)
mdw has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
matejkonrad has quit [Read error: Connection reset by peer]
tk__ has quit [Quit: ばいばい]
wrkrcoop has joined #ruby
rcvalle has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
<wrkrcoop> if i put a rescue and end statement at the end of my method, will that just catch any exception?
whathappens has quit [Remote host closed the connection]
kareeoleez has joined #ruby
rodfersou|lunch is now known as rodfersou
<gregf_> >> "foo"[/../]
<ruby[bot]> gregf_: # => "fo" (https://eval.in/586881)
panpainter has joined #ruby
<shevy> wrkrcoop if you just do rescue, without any specific exception, it is equivalent to: "rescue Exception", so yeah, this means you should rescue everything
whathappens has joined #ruby
Dreamer3_ has joined #ruby
<al2o3-cr> gregf_: that won't work
aberen has quit [Ping timeout: 252 seconds]
<wrkrcoop> shevy yeah i was going to put this at the end of my method https://gist.github.com/ellismarte/a9dcecac3abb36cb02f4ddfd53bc288d
<smathy> shevy, actually it's equivalent to rescue StandardError /cc wrkrcoop
hutch34_ has quit [Quit: WeeChat 1.5]
kareeoleez has quit [Remote host closed the connection]
<shevy> ah
<wrkrcoop> is this standard practice? i imagine you can’t predict all possible errors so youd need something like this …
<gregf_> al2o3-cr: oh missed the chop bit
duckpupp1 has joined #ruby
<wrkrcoop> seems sort of like try catch ...
<shevy> wrkrcoop dunno. people tend to say to "rescue the specific exception instead"... but I had to deal with specific errors let me find that...
<smathy> wrkrcoop, not really standard, no. Idiomatic Ruby generally doesn't rely on exceptions for normal flow.
<al2o3-cr> gregf_: :p
<gregf_> >> "foobar"[2..-1]
<ruby[bot]> gregf_: # => "obar" (https://eval.in/586882)
<smathy> wrkrcoop, and fwiw, try/catch in ruby is something different.
<wrkrcoop> smathy: so how do you protect against unknown errors?
<smathy> *throw/catch sorry.
<smathy> wrkrcoop, mostly people just don't, they let unknown errors crash out.
<shevy> wrkrcoop https://gist.github.com/shevegen/72d00f5c10469eaf6686afec26f49ca4 - I was not really thinking about it, but if I would rewrite that part, I'd probably just do a non-specific rescue instead :P
aberen has joined #ruby
<wrkrcoop> smathy: shit … doesn’t that bring down the server?
devbug has joined #ruby
devbug has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 252 seconds]
<shevy> I managed to have all these different errors too! one as a hdd crash :(
<wrkrcoop> shevy: thanks for sharing that with me
<smathy> wrkrcoop, depends on what "server" means, but generally people are writing ruby in environments that don't have a problem with that.
mark_66 has quit [Remote host closed the connection]
<wrkrcoop> smathy: oh … didnt know that
<smathy> wrkrcoop, eg. a web server process which just triggers a 500 and logs the exception.
jancel has quit [Remote host closed the connection]
<smathy> wrkrcoop, or a cron job which emails admin and exits.
<wrkrcoop> hmmm so now im thinking i dont need that exception ….
<smathy> ...or a sidekiq or job worker process that either logs and exits, or logs and requeues.
<wrkrcoop> alright thanks for the info ^^
<smathy> Np.
flashpoint9 has joined #ruby
AlexJakeGreen has quit [Quit: Leaving]
kareeoleez has joined #ruby
last_staff has quit [Quit: last_staff]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mdw has quit [Quit: Sleeping Zzzzz]
synthroid has quit []
banister has joined #ruby
emptyflask has quit [Remote host closed the connection]
flashpoint9 has quit [Ping timeout: 260 seconds]
emptyflask has joined #ruby
kareeoleez has quit [Ping timeout: 264 seconds]
pilne has joined #ruby
<kallisti5> uugh.. Have to work with soap... I hate xml.
<kallisti5> REXML::XPath.each(doc, "//[self::description or self::id]").each {|des| agents.push({"id" => des[1].to_s, "description" => des[0].to_s})}
flashpoint9 has joined #ruby
<kallisti5> trying to turn two items into a hash'ed array
huyderman has quit [Remote host closed the connection]
pragmatism has joined #ruby
<kallisti5> But getting description, then id, then description
<kallisti5> ... there must be an easier way :-\
dorje has joined #ruby
taylorrf has quit [Remote host closed the connection]
sumobob has joined #ruby
ChiefAlexander has joined #ruby
dorje_ has joined #ruby
kareeoleez has joined #ruby
huyderman has joined #ruby
<shevy> it's XML
dorje has quit [Ping timeout: 272 seconds]
dorje_ is now known as dorje
chouhoul_ has joined #ruby
mg^ has quit [Quit: Leaving]
aegis3121 has joined #ruby
<shevy> I'd use temporary variables if only due to readability alone
<shevy> "//[self::description or self::id]" looks weird
chouhou__ has joined #ruby
tomchapin has joined #ruby
tomchapin has quit [Client Quit]
kareeoleez has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 244 seconds]
norc has joined #ruby
firstdayonthejob has joined #ruby
chouhoul_ has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
kies has quit [Ping timeout: 260 seconds]
Snowy has quit [Remote host closed the connection]
aegis3121 has quit [Ping timeout: 244 seconds]
aberen has quit [Ping timeout: 260 seconds]
prestorium has joined #ruby
tildes_ has quit [Ping timeout: 240 seconds]
<romistrub> I have a loop in a thread and I want to shut down the thread after the loop exits, any idea how?
dorje has quit [Read error: Connection reset by peer]
johnDoe111 has joined #ruby
<norc> romistrub, Thread.exit
rikkipitt has joined #ruby
TheCubeLord has joined #ruby
TheCubeLord has quit [Changing host]
TheCubeLord has joined #ruby
<romistrub> I put did my_thread = Thread.new { my_thread.exit }; will that work?
<toretore> romistrub: the thread will shut down when there is no more code to execute
dorje has joined #ruby
certainty has joined #ruby
<toretore> Thread.new{ while work_to_be_done; do_work; end }
<romistrub> gotcha; thx
<norc> romistrub, also remember to Thread#join
<romistrub> what's that?
<norc> &ri Thread#join
<norc> apeiros, who is responsible for `derpy? It is still linking 2.3.0 docs
johnDoe111 has quit [Ping timeout: 244 seconds]
<al2o3-cr> norc: adaedra
dorje_ has joined #ruby
SilverKey has quit [Quit: Halted.]
despai has quit [Quit: Connection closed for inactivity]
kareeoleez has joined #ruby
* norc pokes adaedra in the eye
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dorje has quit [Ping timeout: 250 seconds]
dorje_ is now known as dorje
<pilne> i think my first two "significant" projects are going to be porting my ghost blog to jekyll, and doing something simple with rails, anything else similar worth taking a look at (not my first language, first true dive into ruby though).
<norc> pilne, yes - I have a fairly useful recommendation:
leitz has quit [Ping timeout: 276 seconds]
aberen has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
<norc> Pick something you like.
deadnull_ has quit [Quit: Bye]
ec has joined #ruby
<norc> pilne, https://www.ruby-toolbox.com/ could be a useful thing to find stuff you might need.
<pilne> i like both of those! i enjoy doing my blog, but not juggling several node versions, and I enjoy the idea of creating interesting websites :)
<pilne> ty, going there now :)
symm- has joined #ruby
mostlybadfly has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
SilverKey has joined #ruby
kareeoleez has quit [Ping timeout: 272 seconds]
ChiefAlexander has joined #ruby
aberen has quit [Ping timeout: 252 seconds]
Snowy has joined #ruby
sergey_makagon has joined #ruby
noobsu_ has joined #ruby
blaxter has quit [Quit: foo]
guacamole has quit [Quit: leaving]
guacamole has joined #ruby
mwlang has joined #ruby
kgrz has quit [Ping timeout: 264 seconds]
freerobby has quit [Quit: Leaving.]
rafa2000 has joined #ruby
leitz has joined #ruby
rafa2000 has quit []
noobsu_ has quit [Ping timeout: 260 seconds]
freerobby has joined #ruby
kareeoleez has joined #ruby
tildes_ has joined #ruby
Rodya_ has joined #ruby
Snowy has quit [Remote host closed the connection]
freerobby has quit [Client Quit]
blaxter has joined #ruby
Snowy has joined #ruby
rikkipitt has quit [Remote host closed the connection]
kareeole_ has joined #ruby
sergey_makagon has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kareeoleez has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
malconis has joined #ruby
kent\n has joined #ruby
kent\n has quit [Changing host]
kent\n has joined #ruby
aep-shoutlet has quit [Quit: Connection closed for inactivity]
troulouliou_div2 has quit [Remote host closed the connection]
kareeole_ has quit [Ping timeout: 276 seconds]
romistrub has quit [Quit: Page closed]
rafa2000 has joined #ruby
sergey_makagon has joined #ruby
kareeoleez has joined #ruby
jancel has joined #ruby
Coldblackice has joined #ruby
<raz> hmm anyone here happen to know how to wrap PTY.spawn, so a spawned 'stty size' will return terminal dimensions other than '0 0'? (because the latter screws with many tty-expected programs, which kinda defeats the purpose of using PTY to begin with :/ )
howdoi has quit [Quit: Connection closed for inactivity]
<raz> i've tracked it down to an ioctl TIOCGWINSZ that PTY.spawn apparently doesn't patch up (on purpose? by oversight? am i doing this wrong?)
jaruga___ has quit [Quit: jaruga___]
diegoviola has quit [Quit: WeeChat 1.5]
aegis3121 has joined #ruby
kareeoleez has quit [Ping timeout: 272 seconds]
jancel has quit [Ping timeout: 250 seconds]
<leitz> In an initialize, are the assignments done in order? That is, can the second one use the output from the first?
aberen has joined #ruby
<shevy> initialize is a method like any other method
<shevy> normal ruby rules apply to it as well
nando293921 has quit [Ping timeout: 276 seconds]
Snowy has quit [Remote host closed the connection]
chouhou__ has quit [Remote host closed the connection]
<ghr> leitz like this? https://eval.in/586898
rafa2000 has quit [Quit: rafa2000]
loocash has joined #ruby
kareeoleez has joined #ruby
aberen has quit [Ping timeout: 260 seconds]
<leitz> ghr, if you put and @ in front of the 'a' in line 5, yes. Just tested that, and it works.
elementaru has quit [Remote host closed the connection]
<ghr> ah. so you want to read about instance variables (the ones with the @ infront of them) and attribue accessors :)
<leitz> So "@b = @a + b"
yqt has quit [Ping timeout: 250 seconds]
<leitz> Yeah, I'm setting up an initialize that will generate a name, based on gender.
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<leitz> @gender comes before @name.
Mon_Ouie has joined #ruby
Meow-J has quit [Quit: Connection closed for inactivity]
jackjackdripper has joined #ruby
<al2o3-cr> raz: show code as to what you're trying to do
kareeoleez has quit [Ping timeout: 260 seconds]
axsuul has joined #ruby
<raz> al2o3-cr: ruby -r pty -e 'PTY.spawn("stty size") { |r, _w, pid| puts r.read }'
<raz> when you run this, it will print '0 0'
hackeron has joined #ruby
<raz> when you run 'stty size' directly, it will display your current terminal size
<raz> i need the command running inside PTY.spawn to think it's running in a terminal that has a size that is not 0 0 (because many programs can't deal with that zero-size and crash) :)
<leitz> I'm pausing my reading of "programming ruby" to actually code. Trying to clean up a lot of my earlier misunderstandings with new misunderstandings.
cdg has quit [Remote host closed the connection]
<leitz> Taking a break now and then to read "The Ruby Way" when I'm too brain dead to code. Working through a cold/flu/something.
nando293921 has joined #ruby
<ghr> heh, yeah gotta be _doing_ rather than just reading. I'd say instance variables are pretty fundamental though, so put it high on your list
danostrowski has joined #ruby
pepee has joined #ruby
<shevy> yes, programming is an active art
<leitz> Yeah, I've often made the mistake or reading more than coding. Trying to get back to Ruby, and be happy with the basics. Since Part 1 of "Programming Ruby" can handle 90% of what I want to do, I'm better off setting it down.
<leitz> "The Ruby Way" is mostly because Hal is a nice guy and I need something to read now and again.
djbkd has joined #ruby
mdw has joined #ruby
nando293921 has quit [Ping timeout: 252 seconds]
cwenner has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
cwenner has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.5]
helpa-bot has joined #ruby
mistermocha has quit [Remote host closed the connection]
sergey_m_ has joined #ruby
helpa has quit [Remote host closed the connection]
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.1 Aria]
kareeoleez has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
certainty has joined #ruby
rflot has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
<terrabl> Does anyone have any preferances on a ruby gem that can plot a bunch of data points?
sandstrom has quit [Quit: My computer has gone to sleep.]
bobina22 has quit [Quit: Leaving]
sergey_makagon has quit [Ping timeout: 244 seconds]
vqrs_ has quit [Ping timeout: 244 seconds]
al2o3-cr has joined #ruby
vqrs has joined #ruby
mistermocha has joined #ruby
rflot has joined #ruby
iooner has quit [Ping timeout: 260 seconds]
<norc> terrabl, how about the classic: graphviz
kirun has joined #ruby
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
<leitz> Yeah, coding lets your great idea for getting a name come back with "Hi, I'm #<SQLite3::ResultSet:0x7fe4037b2390>".
iooner has joined #ruby
<leitz> Glad Ruby is so fun, otherwise I'd cry.
<norc> leitz, welcome to #inspect
certainty has quit [Ping timeout: 250 seconds]
<leitz> By the way, I fixed the errlr.
<leitz> error
loocash has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 250 seconds]
<wrkrcoop> how do i return an error and a message with that error?
<norc> wrkrcoop, a classic way is to simply raise an exception.
sauvin has quit [Read error: Connection reset by peer]
<norc> # fail ParseError, "unbalanced paranthesis"
sergey_m_ has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agit0 has joined #ruby
<wrkrcoop> norc so … do i just call raise with the error message?
sergey_makagon has joined #ruby
<toretore> {status: :error, message: "Something went wrong"}
DroidBur_ has joined #ruby
yqt has joined #ruby
<toretore> {status: :success, value: whatever}
<norc> &ri Kernel#raise wrkrcoop
pld has quit [Quit: Connection closed for inactivity]
Azure has quit [Remote host closed the connection]
ramfjord has joined #ruby
<norc> wrkrcoop, generally you should should either pass an exception class, or exception class and an error message.
taylorrf has joined #ruby
<wrkrcoop> hmm ok
blackmesa has quit [Ping timeout: 260 seconds]
<norc> wrkrcoop, and it is useful to use your own exception class, so it can be caught specifically
<ule> do you guy sknow if there is a command to list all listeners?
<norc> ule, listeners?
<ule> I don't know if this is default from rails
<ule> or if it's something people implemented here at work
<ule> I'm gonna do some research here
<ule> they call pubsub
DroidBurgundy has quit [Ping timeout: 244 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
DroidBur_ has quit [Ping timeout: 240 seconds]
<norc> ule, you need to give us more than that. pubsub sounds like publish subscribe pattern...
<toretore> ule: it is definitely not something that ruby has built-in; it's a library, be it rails or something else
<norc> ule, are you talking about something in Ruby? Something in some library? Some application?
mleung has quit [Quit: mleung]
helpa-bot has joined #ruby
DroidBurgundy has joined #ruby
p337rB_ has joined #ruby
<ule> cool
yfeldblum has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
smathy is now known as smathy_afk
helpa has quit [Remote host closed the connection]
<ule> yeah.. it's publish subscribe pattern
<ule> I thought it's a default in Rails
<terrabl> If there is a gem availible for rails does that mean i can use it in regular scripting ruby too?
<terrabl> Like I want to use the gruff graphing gem
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
<toretore> terrabl: it depends; for this particular gem probably yes
symm- has quit [Ping timeout: 250 seconds]
symm- has joined #ruby
<terrabl> Awesome. Is there a way to tell?
p337rB has quit [Ping timeout: 264 seconds]
<norc> ule, even Rails is a huge pile of libraries
<toretore> no
<norc> ule, you have to be more specific still.
<norc> ule, gist some code you have.
jackjackdripper has quit [Quit: Leaving.]
<toretore> terrabl: most gems are not rails-specific
<norc> terrabl, like I just said, all rails is is a huge collection of different gems, most of which you can use separately.
<norc> (Only very few have interdependencies)
smathy_afk is now known as smathy
dorje has quit [Ping timeout: 276 seconds]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
Dimik has joined #ruby
<al2o3-cr> raz: pty, doesn't play nicely here
sneakerhax has quit [Ping timeout: 240 seconds]
<raz> al2o3-cr: yup. i found winsize= in io/console now. but i can't figure out how to use it.
Rodya_ has joined #ruby
<al2o3-cr> raz how'd you mean use it?
DroidBurgundy has quit []
<raz> al2o3-cr: well, i tried all kinds of variants of creating an IO and feeding that to spawn, but nothing works. this stuff is not very well documented ;)
mistermocha has quit [Remote host closed the connection]
emptyflask has quit [Remote host closed the connection]
sphex has quit [Ping timeout: 260 seconds]
aberen has joined #ruby
sphex has joined #ruby
multi_io has quit [Ping timeout: 250 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
<shevy> ruby is so good, it does not need any documentation!!!
tildes_ has quit [Ping timeout: 240 seconds]
<al2o3-cr> lol
multi_io has joined #ruby
aberen has quit [Ping timeout: 260 seconds]
kies has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
wrkrcoop has joined #ruby
johnDoe111 has joined #ruby
B1n4r10 has joined #ruby
ben010 has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
aberen has joined #ruby
mistermocha has joined #ruby
jas02 has joined #ruby
<ben010> can anyone help a new ruby (on rails) convert set up his local vagrant dev env from a server? i've got 85% of it, but struggling to know how best to do the last 15%.
mistermocha has quit [Remote host closed the connection]
whathappens has quit [Quit: Leaving...]
wrkrcoop has quit [Quit: wrkrcoop]
craigp has joined #ruby
dasher00 has joined #ruby
johnbat26 has joined #ruby
<jhass> ?anyone ben010
<ruby[bot]> ben010: Just ask your question, if anyone has or can, they will respond.
rikkipitt has joined #ruby
aberen has quit [Ping timeout: 244 seconds]
<ben010> so i have the local vagrant vm going, have the db setup with the server data, but i'm not sure how to best migrate the code, which is on an amazon server and code in bitbucket. should i bitbucket clone the files to the default nginx www directory? then manually replace the necessary code files with any server settings... should i manually copy the files first then set up the bitbucket connection and see which files are different. sh
kies has quit [Ping timeout: 272 seconds]
<ben010> elsewhere with symlinks?
johnmilton has quit [Remote host closed the connection]
<ben010> i think i've manually installed the server identical versions of ruby/rails/etc.
Guest48707 is now known as dionyziz
mistermocha has joined #ruby
TheCubeLord has quit [Quit: I'm Leaving Bye]
prooftechnique has left #ruby ["Palaver https://palaverapp.com/"]
UserInNeed has quit [Ping timeout: 258 seconds]
noobsu has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
sergey_makagon has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
djbkd has joined #ruby
danostrowski has joined #ruby
UserInNeed has joined #ruby
danostrowski has quit [Client Quit]
spider-mario has joined #ruby
cdg has joined #ruby
<palms> ben010: have you considered using any config mgmt software? that might be a bit excessive for your use case. Perhaps a cloud-init script is what you are looking for. As for best practices, I would create my own nginx vhost tailored for RoR and use that in lieu of the default, then clone my code to somewhere like /var/www/current
kareeoleez has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 244 seconds]
blaxter has quit [Read error: Connection reset by peer]
<palms> as for cfg mgmt, using chef, salt, and puppet would be useful because you would use the same code for vagrant as you would for AWS, potentially.
ur5us has joined #ruby
certainty has joined #ruby
<ben010> when you say config management is that like capistrano or something? i don't want to tamper with the server in fear that my present level of ruby/ror stupidity is dangerous.
danostrowski has joined #ruby
<palms> Yes, a capistrano-like deploy would handle the things like deploying rails while chef, puppet or salt would manage system users, nginx, mysql, etc.
<ben010> can i use those cfg management tools without changes to live server?
blaxter has joined #ruby
mistermocha has joined #ruby
<palms> it's more involved. i would stand it up side by side and keep instances immutable.
k3rn31 has quit [Quit: Computer has gone to sleep.]
ItSANgo__ has quit [Quit: Leaving...]
<ben010> as in on the server create a parallel application which i then set up to use config management? and then i migrate that parallel setup?
<palms> ansible is another option as well. i don't intend to promote any cfg mgmt over another
moeabdol2 has quit [Ping timeout: 240 seconds]
SilverKey has quit [Quit: Halted.]
<palms> i think that's a good general practice overall, cfg mgmt or not. If you bork prod, you have no bail plan.
swills has quit [Ping timeout: 272 seconds]
certainty has quit [Ping timeout: 260 seconds]
whathappens has joined #ruby
kareeoleez has joined #ruby
<ben010> i agree, but i'm just sort of stepping in to do a small job on their code, so i'm limited in what i can do. i was just trying to set up a local dev environment so i could work.
mistermocha has quit [Ping timeout: 276 seconds]
nando293921 has joined #ruby
nhhc has quit [Quit: Leaving]
<terrabl> Hey guys I made this SO question if you guys could check it out maybe : http://stackoverflow.com/questions/37755515/changing-the-format-from-a-mysql-datetime-format-to-a-different-type-in-ruby
Noxilex has joined #ruby
SilverKey has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
miqlas-H has joined #ruby
kareeoleez has quit [Ping timeout: 250 seconds]
dhruvasagar has joined #ruby
dhruvasagar has left #ruby ["WeeChat 1.5"]
<palms> ben010: if you need to get your code onto your local vm using vagrant, you should just need to do something like `config.vm.synced_folder ".", "/vagrant", type: "nfs"` if you have the code checked out locally
swills has joined #ruby
<palms> then you can bash something on it like `config.vm.provision "shell", path: "config-vm.sh"` with all of your nginx, etc stuff
cajone has quit [Read error: Connection reset by peer]
rikkipitt has quit [Remote host closed the connection]
raeoks has quit [Quit: Textual IRC Client: www.textualapp.com]
sepp2k has quit [Quit: Leaving.]
<al2o3-cr> terrabl: Time.parse ?
kareeoleez has joined #ruby
jancel has joined #ruby
cajone has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
<terrabl> so time.parse.strftime?
<al2o3-cr> tbh, i don't quite follow your question
ruby-lang129 has joined #ruby
<al2o3-cr> >> require 'time'; Time.parse("2016-06-09 14:29:34")
<ruby[bot]> al2o3-cr: # => 2016-06-09 14:29:34 +0000 (https://eval.in/586965)
<terrabl> Hmm, I guess I'm just trying to turn 2016-06-09 14:29:34 into 14:29_20160609
jaguarmagenta has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper1 has joined #ruby
kareeoleez has quit [Ping timeout: 264 seconds]
<al2o3-cr> >> require 'time'; t = Time.parse("2016-06-09 14:29:34"); t.strftime("%H:%M_%Y%m%d")
<ruby[bot]> al2o3-cr: # => "14:29_20160609" (https://eval.in/586966)
xlegoman has joined #ruby
naftilos76 has quit [Ping timeout: 272 seconds]
p337rB_ has quit [Ping timeout: 250 seconds]
<adaedra> norc: I'll look at that, but is there really a huge difference between 2.3.0 and 2.3.1 docs?
naftilos76 has joined #ruby
<al2o3-cr> adaedra: not really
<terrabl> Still not working... its just outputting 2016-06-09 13:28:34 +0000
Rodya_ has joined #ruby
<al2o3-cr> terrabl: what did you try?
<terrabl> Exactyl what you put. It makes sense but I dont know what it isnt working
noobsu has quit [Remote host closed the connection]
<terrabl> I'm looking at DateTime.parse right now
jaguarmagenta has quit [Ping timeout: 246 seconds]
sergey_makagon has joined #ruby
sergey_makagon has quit [Remote host closed the connection]
ljarvis has joined #ruby
<ljarvis> moin
<al2o3-cr> >> require 'date'; dt = DateTime.parse("2016-06-09 14:29:34"); dt.strftime("%H:%M_%Y%m%d")
<ruby[bot]> al2o3-cr: # => "14:29_20160609" (https://eval.in/586967)
<al2o3-cr> terrabl: it works!
blackmesa has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
<terrabl> Thanks friend!
<al2o3-cr> yw friend :)
<norc> adaedra, honestly I don't know - but I feel our bot should point to the most recent docs regardless.
<norc> Just looks a bit more professional.
workmad3 has joined #ruby
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra> I'll take a look later.
<norc> Alright, thank you. :)
jackjackdripper1 has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
B1n4r10 has quit [Read error: Connection reset by peer]
tildes_ has joined #ruby
miqlas-H has quit [Ping timeout: 244 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
kareeoleez has joined #ruby
jazz3 has quit [Ping timeout: 244 seconds]
johnDoe111 has joined #ruby
dorje has joined #ruby
miqlas-H has joined #ruby
B1n4r10 has joined #ruby
tildes_ has quit [Ping timeout: 260 seconds]
kareeoleez has quit [Ping timeout: 250 seconds]
dorje_ has joined #ruby
diegoviola has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
tatsuo has joined #ruby
tatsuo has quit [Remote host closed the connection]
tatsuo has joined #ruby
dorje has quit [Ping timeout: 264 seconds]
dorje_ is now known as dorje
danostrowski has joined #ruby
eljimbo has quit [Quit: This computer has gone to sleep]
gix has quit [Quit: Client exiting]
ChiefAlexander has quit [Remote host closed the connection]
rueben_ has quit [Ping timeout: 240 seconds]
CSWookie has joined #ruby
mikeliss has joined #ruby
ItSANgo has joined #ruby
<CSWookie> Hey folks, how can I get the second argument passed to my script, or a default if none was passed? ARGV[2] or "fred"?
emptyflask has joined #ruby
dorje has quit [Read error: Connection reset by peer]
wrkrcoop has joined #ruby
<ljarvis> CSWookie: ARGV[2] || "fred"
gix has joined #ruby
tvon has joined #ruby
dorje has joined #ruby
<CSWookie> So in ruby, || is boolean or and && is boolean and?
mikecmpbll has joined #ruby
<CSWookie> I've never written any Ruby before, and I'm learning by hacking together a Vbunch of Vagrantfiles
gix has quit [Client Quit]
<ljarvis> CSWookie: ||/&& is logical or/and
dorje has quit [Client Quit]
tvon has quit [Client Quit]
<ljarvis> they have higher precedance than or/and keywords
troulouliou_dev has joined #ruby
<CSWookie> Thanks!
hobodave_ has joined #ruby
blackgoat has joined #ruby
<ljarvis> precedence*
<ljarvis> prece dance
B1n4r10 has quit [Ping timeout: 240 seconds]
hobodave has quit [Ping timeout: 260 seconds]
mikeliss has quit [Quit: mikeliss]
mostlybadfly has quit [Quit: Connection closed for inactivity]
karmatr0n has quit [Read error: No route to host]
karmatr0n has joined #ruby
Silthias has quit [Ping timeout: 244 seconds]
<norc> CSWookie, also think of "and" and "or" as control flow operators, rather than boolean logic.
<norc> CSWookie, so they belong into the same category as "if" or "else"
stan has quit [Ping timeout: 260 seconds]
jancel has quit [Remote host closed the connection]
whathappens has quit [Remote host closed the connection]
<terrabl> How would I use a graphing tool to graph this json data? https://gist.github.com/terrabl/1bee2ee18b3793cf3f4671e965b44080
whathappens has joined #ruby
mistermocha has joined #ruby
kareeoleez has joined #ruby
certainty has joined #ruby
Silthias has joined #ruby
<ljarvis> or, just think "I should never use and/or"
<norc> ljarvis, never say never.
stan has joined #ruby
<norc> ljarvis, the general rule of thumb is:
<ljarvis> neverrr
kraken has joined #ruby
moeabdol2 has joined #ruby
kraken is now known as kraken_
<norc> ljarvis, when you have to use parens because && or "and" have the wrong predecence, use the other operator.
<norc> (same goes for ||/"or")
<kraken_> Hey, what is the difference between :: and . ? I don't get whats happening when for instance Net::HTTP is called, what is the :: doing?
<ljarvis> correct, but since &&/|| are higher precedence anyway, you pretty much can't go wrong to just straight avoid and/or. When you start worrying about parens your code is probably too complex
<shevy> kraken_ . is shorter :)
<shevy> kraken_ for Net::HTTP that is different than .
<havenwood> kalleth: The `::` is a namespace separator, in your case between the `Net` module and `HTTP` class.
<havenwood> oops, mt
<havenwood> kraken_: ^
<kraken_> So it's bassically saying that Net is the module, HTTP is the class within it?
<ljarvis> you can also use it to call class methods but you shouldn't
<norc> kraken_, or class.
<havenwood> kraken_: The `.` is for calling methods.
<norc> kraken_, classes and modules are practically the same - in this particular example Net could also be a class.
<havenwood> kraken_: Nested classes within modules with modules within classes, however.
mistermocha has quit [Ping timeout: 244 seconds]
<kraken_> So for instances, Net::HTTP::Get.new is this: Net module, calling the HTTP class within this module calling the Get class within this class, calling the .new method within the Get class?
mistermo_ has joined #ruby
haraigo has joined #ruby
<ljarvis> there's no "calling", you're just referring to it by resolution
kareeoleez has quit [Ping timeout: 258 seconds]
<ljarvis> but yes, Net is a module, HTTP is a class, Get is a nested class
<havenwood> kraken_: The one "calling" is the `.new` class method.
certainty has quit [Ping timeout: 264 seconds]
<ljarvis> ^
<ljarvis> every call i be resolving classes and calling methods
<norc> kraken_, maybe it becomes more obvious if you use the top space name resolution
<ljarvis> day
moeabdol2 has quit [Ping timeout: 246 seconds]
<kraken_> hmm
<norc> kraken_, for example ::Array will refer to the top level array
<norc> regardless of whether you have a local Array class.
<kraken_> So, correct me if I'm wrong, but :: is just used to access a class within a class
<norc> No.
<kraken_> ahhgg
djbkd has joined #ruby
<norc> kraken_, it is used to access a namespace.
<ljarvis> I can paste the link again if it helps
<kraken_> Got i ljarvis
jancel has joined #ruby
<kraken_> I'm going to check that out
<kraken_> thanks all
<kraken_> I think I'm on the right track now
<norc> kraken_, the namespace resolution operator also gives you access to a classes singleton methods, that may be where your confusion is coming from.
blaxter has quit [Quit: KTHXBYE]
<wrkrcoop> if i put a rescue statemnet at the end of a method, and i dont use a begin statement, do i need to include the end?
<norc> mmm
<ljarvis> >> ::Array::new::[](1)
<ruby[bot]> ljarvis: # => nil (https://eval.in/586993)
<norc> wrkrcoop, kind of
<wrkrcoop> in other words if there is not begin do i need an end?
<norc> wrkrcoop, well you can use it inside a def;end block
<norc> Possibly inside a class/module block too, but Im not sure about that.
<wrkrcoop> norc: yeah in my def end block i have a rescue statement … i got an error saying ‘theres an extra end’ and then i removed it and it went away ...
jenrzzz has joined #ruby
<norc> ljarvis, okay instance methods too.
whathappens has quit [Remote host closed the connection]
<wrkrcoop> so there’s no ned for an end to a resuce?
<norc> wrkrcoop, there always is!
<norc> wrkrcoop, except you already have one from your def.
Madplatypus has joined #ruby
<wrkrcoop> oh ...
<norc> def;rescue;end
<norc> begin;rescue;end
<LiquidInsect> You need to end the block that contains the rescue
<wrkrcoop> i see
<norc> wrkrcoop, you can of course nest them as required. :)
Akuma has joined #ruby
Akuma has quit [Client Quit]
<wrkrcoop> norc: what do u mean nest them?
<wrkrcoop> u mean begin rescue end inside a def end?
<norc> def; begin; rescue; end; end
<norc> wrkrcoop, yes.
<wrkrcoop> i see
<wrkrcoop> thanks :d
<wrkrcoop> :D
sheperson has joined #ruby
<norc> wrkrcoop, of course its a pointless excercise if there is no code surrounding the begin block.
whathappens has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
<norc> >> class Foo; rescue NameError; end
<ruby[bot]> norc: # => nil (https://eval.in/586994)
<norc> That works too apparently. :)
<norc> wrkrcoop, seems like do/end blocks are exempt from this.
johnmilton has joined #ruby
art-solopov has joined #ruby
eljimbo has joined #ruby
gix has joined #ruby
whathappens has quit [Remote host closed the connection]
ruby-lang129 has quit [Quit: Page closed]
<sheperson> which one of these two is preferred, why?
rikkipitt has joined #ruby
kareeoleez has joined #ruby
<ljarvis> neither of them
<sheperson> do you have a better solution
<sheperson> ?
<ljarvis> what does persist! return?
<norc> sheperson, for style the second.
<sheperson> I am looking for the style
<sheperson> ljarvis: it would return the object itslef
<ljarvis> I would suggest stop caring about returning explicit true/false, and return truthly/falsely
<ljarvis> sheperson: perfect, then I'd use valid? && persist!
<ljarvis> or: persist! if valid? which basically do the same thing
<ljarvis> nil if it fails, the object if it succeeds
<ljarvis> done.
<sheperson> def save; valid? && persist!; end
<ljarvis> si
<ljarvis> persist! if valid? might be preferred, up to you style wise
<norc> Either way ljarvis. Since the question seems to have been directed as whether return early or not, the answer is still to always return early if you can.
<ljarvis> the question what "which of these two is preferred"
<havenwood> sheperson: `valid? and persist` and `persist! if valid?` are the control flow ways
<ljarvis> pfft
johnmilton has quit [Ping timeout: 260 seconds]
kraken_ has quit [Quit: Leaving]
<norc> ljarvis, if you cannot extrapolate the question from that gist then Im sorry.
<ljarvis> apology accepted
Noxilex has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
freerobby has joined #ruby
kareeoleez has quit [Ping timeout: 246 seconds]
<sheperson> norc: I was looking for return early or not
noobsu_ has joined #ruby
<norc> sheperson, that does not invalidate ljarvis's opinion though. But generally if the choice is to return early or not - return early.
<sheperson> yes, I see
xlegoman has quit [Read error: Connection reset by peer]
mikecmpbll has quit [Ping timeout: 250 seconds]
iooner has quit [Ping timeout: 260 seconds]
<ljarvis> I concur, I was just trying to point out a better way altogether, if it was more complex I would have done what norc suggested (version 2)
sleazoid has joined #ruby
Rodya_ has quit [Ping timeout: 250 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jas02 has quit [Quit: jas02]
kareeoleez has joined #ruby
noobsu_ has quit [Ping timeout: 252 seconds]
shinnya has joined #ruby
mrmortondk has quit [Read error: Connection reset by peer]
sleazoid has quit [Ping timeout: 250 seconds]
ips|malc has joined #ruby
kies has joined #ruby
iooner has joined #ruby
kareeoleez has quit [Ping timeout: 244 seconds]
spejamchr has joined #ruby
sheperson has quit [Quit: sheperson]
iooner has quit [Excess Flood]
johnDoe111 has joined #ruby
johnmilton has joined #ruby
iooner has joined #ruby
jancel has quit [Remote host closed the connection]
qasaur has joined #ruby
kareeoleez has joined #ruby
ChiefAlexander has joined #ruby
johnDoe111 has quit [Ping timeout: 244 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
duckpupp1 has quit [Ping timeout: 240 seconds]
Liam` is now known as lstanley
Mon_Ouie has quit [Quit: WeeChat 1.5]
kareeoleez has quit [Ping timeout: 276 seconds]
aberen has joined #ruby
whathappens has joined #ruby
sergio_101 has quit [Quit: Textual IRC Client: www.textualapp.com]
hobodave_ has quit [Quit: Computer has gone to sleep.]
ChiefAlexander has quit [Quit: Leaving...]
GinoManWorks_ has quit [Read error: Connection reset by peer]
whathapp_ has joined #ruby
whathapp_ has quit [Read error: Connection reset by peer]
mhib has quit [Remote host closed the connection]
whathapp_ has joined #ruby
whathapp_ has quit [Read error: Connection reset by peer]
whathapp_ has joined #ruby
rodfersou has quit [Quit: leaving]
mwlang has quit [Quit: mwlang]
whathappens has quit [Ping timeout: 240 seconds]
whathapp_ has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
aberen has quit [Ping timeout: 276 seconds]
spejamchr has quit [Quit: Page closed]
terrabl has quit [Quit: Page closed]
SilverKey has quit [Quit: Halted.]
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
danostrowski has joined #ruby
postmodern has joined #ruby
ecksit has joined #ruby
rippa has quit [Read error: Connection reset by peer]
whathappens has quit [Ping timeout: 240 seconds]
ncthom91 has joined #ruby
kareeoleez has joined #ruby
<agent_white> >> ((self.class)..(self.class))
<ruby[bot]> agent_white: # => Object..Object (https://eval.in/587008)
Gasher has joined #ruby
axl_ has quit [Quit: axl_]
Rodya_ has joined #ruby
kareeoleez has quit [Ping timeout: 252 seconds]
VeryBewitching has quit [Quit: Konversation terminated!]
swills has quit [Ping timeout: 244 seconds]
certainty has joined #ruby
<ljarvis> heh
<LiquidInsect> ...is that a Range of classes?
<ljarvis> it's two classes
<ljarvis> if range max == range min they can be anything
<ljarvis> >> nil..nil
<ruby[bot]> ljarvis: # => nil..nil (https://eval.in/587009)
<ljarvis> >> false..false
<ruby[bot]> ljarvis: # => false..false (https://eval.in/587010)
<ljarvis> etc
<LiquidInsect> Go home Ruby, you're drunk
<ljarvis> quite
ldnunes has quit [Quit: Leaving]
k3rn31 has joined #ruby
certainty has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 258 seconds]
naftilos76 has quit [Ping timeout: 246 seconds]
johnDoe111 has joined #ruby
kavanagh has joined #ruby
dopie has quit [Quit: Leaving]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol2 has joined #ruby
kareeoleez has joined #ruby
bruce_lee has quit [Ping timeout: 260 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
mistermo_ is now known as mistermocha
al2o3-cr has quit [Quit: WeeChat 1.5]
smathy is now known as smathy_afk
johnDoe111 has quit [Ping timeout: 244 seconds]
<postmodern> when writing a data structure where certain fields default to other values or fields, what is the ruby idiom for determining if the field was omitted? present? myfield? has_field?
kareeoleez has quit [Ping timeout: 246 seconds]
gigetoo has joined #ruby
emptyflask has quit [Ping timeout: 240 seconds]
<norc> postmodern, I cannot recall seeing this idiom anywhere. My first instinct tells me "omitted?" is the most accurate.
dhollinger has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
jaguarmagenta has joined #ruby
nando293921 has quit [Ping timeout: 252 seconds]
<ytti> &win 12
Ishido has quit [Remote host closed the connection]
solars has joined #ruby
kareeoleez has joined #ruby
yfeldblum has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: leaving]
al2o3-cr has joined #ruby
hobodave has joined #ruby
maloik has quit [Remote host closed the connection]
jaguarmagenta has quit [Ping timeout: 272 seconds]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maloik has joined #ruby
minimalism has joined #ruby
<norc> asm>> a.b ^ a.b ^ a.b
<ruby[bot]> norc: I have disassembled your code, the result is at https://eval.in/587015
<norc> cschneid, that is an awful lot of ruby method calls.
blackmesa has quit [Ping timeout: 276 seconds]
kareeoleez has quit [Ping timeout: 260 seconds]
polll has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
ips|malc has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ecksit has quit [Ping timeout: 244 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
blackmesa has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
al2o3-cr has quit [Ping timeout: 276 seconds]
rikkipitt has quit [Remote host closed the connection]
B1n4r10 has joined #ruby
moeabdol2 has quit [Ping timeout: 250 seconds]
c0mrad3 has quit [Quit: Connection closed for inactivity]
ta_ has joined #ruby
dhollinger has joined #ruby
palms has quit [Ping timeout: 252 seconds]
<cschneid> norc: sure. But everything is a method call in ruby :) It's still a hell of a lot faster than any other data structure I could be using.
<cschneid> s/any other/any other one that I reach for normally, I'm sure there's something silly out there that's better/
jancel has joined #ruby
daivyk has quit [Quit: Quit]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<norc> cschneid, if the hash method is implemented in C directly, you get to do shortcuts. :)
kirun has quit [Quit: Client exiting]
B1n4r10 has quit [Ping timeout: 264 seconds]
<cschneid> yeah, sure. But then I'd have to go write a C extension for something that isn't a performance hit. I already took the big performance hit by choosing ruby in the first place :)
jancel has quit [Ping timeout: 250 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
kareeoleez has joined #ruby
ur5us has quit [Remote host closed the connection]
aberen has joined #ruby
davedev2_ has joined #ruby
Noxilex has joined #ruby
al2o3-cr has joined #ruby
mikecmpbll has joined #ruby
n_blownapart has joined #ruby
hutch has quit [Ping timeout: 250 seconds]
kareeoleez has quit [Ping timeout: 258 seconds]
postmodern has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Client Quit]
davedev24 has quit [Ping timeout: 250 seconds]
aberen has quit [Ping timeout: 260 seconds]
freerobby has quit [Quit: Leaving.]
d5sx43 has joined #ruby
d5sx43 has quit [Client Quit]
<shevy> :(
dstarh has joined #ruby
Meow-J has joined #ruby
kareeoleez has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
m_antis has joined #ruby
zeroDi has joined #ruby
PlasmaStar has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
kareeoleez has quit [Ping timeout: 250 seconds]
dhollinger has quit [Quit: WeeChat 1.4]
postmodern has joined #ruby
SilverKey has joined #ruby
agent_white has joined #ruby
<adaedra> &ri Array norc
kavanagh has quit [Ping timeout: 240 seconds]
<norc> <3 adaedra
<adaedra> That was harder than I though, the URI is hardcoded _twice_
PlasmaStar has joined #ruby
<jhass> hopefully not any longer
flashpoint9 has joined #ruby
<adaedra> I want my lawyer.
e4xit has joined #ruby
<norc> I'm present adaedra.
certainty has joined #ruby
choke has joined #ruby
<norc> As your lawyer I advise you to not-repeat-yourself.
<jhass> :D
rikkipitt has joined #ruby
okdas has quit [Ping timeout: 272 seconds]
<adaedra> well, there are two URIs:
<adaedra> &ri String Net::HTTP
johnbat26 has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
kies has quit [Ping timeout: 244 seconds]
* norc opens a feature request for interpolating strings into strings
okdas has joined #ruby
okdas has quit [Changing host]
okdas has joined #ruby
<adaedra> If this was the only problem `derpy had, I would be happy :)
fikse has joined #ruby
<norc> :)
tubuliferous_ has quit [Ping timeout: 240 seconds]
* adaedra pats `derpy anyways
certainty has quit [Ping timeout: 250 seconds]
neanderslob has joined #ruby
allcentury has joined #ruby
<choke> i hate when i'm a bonehead... having all sorts of rspec issues with an AMS and after an hour realize i forgot to add "_serializer" onto the file
aegis3121 has quit [Quit: Textual IRC Client: www.textualapp.com]
Noxilex has quit [Ping timeout: 250 seconds]
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
aries_liuxueyang has joined #ruby
polishdub has quit [Quit: Leaving]
wrkrcoop has quit [Quit: wrkrcoop]
prestorium has quit [Quit: Leaving]
biberu has quit [Read error: Connection reset by peer]
asahi has joined #ruby
emptyflask has joined #ruby
rikkipitt has quit [Remote host closed the connection]
<asahi> hello, if I do require 'foo.rb', does a new scope get created for whatever is in foo.rb? that is, any variable definitions in foo.rb are not available from the calling scope?
kavanagh has joined #ruby
<lupine> well, that depends entirely on what's in foo.rb
<asahi> suppose it's a bunch of local variable definitions
<lupine> constants will end up in your scope
<shevy> asahi local vars won't be available, constants are
<lupine> local variables will not
<asahi> okay, thank you
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tref has joined #ruby
freerobby has joined #ruby
gigetoo has quit [Ping timeout: 246 seconds]
danostrowski has joined #ruby
gigetoo has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
<lupine> of course, the required file might do weird things with TOPLEVEL_BINDING
mtkd has joined #ruby
Coldblackice has quit [Ping timeout: 258 seconds]
cschneid has quit [Remote host closed the connection]
globalall0c has joined #ruby
globalall0c has left #ruby [#ruby]
ben010 has quit [Ping timeout: 250 seconds]
Rodya_ has quit [Remote host closed the connection]
fikse has quit [Quit: leaving]
SilverKey has quit [Quit: Halted.]
sumobob has quit [Quit: WeeChat 1.5]
johnDoe111 has joined #ruby
art-solopov has quit [Quit: Konversation terminated!]
duncannz has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
toretore has quit [Ping timeout: 264 seconds]
duckpupp1 has joined #ruby
jackjackdripper has quit [Ping timeout: 260 seconds]
jancel has joined #ruby
lightt has joined #ruby
agent_white has quit [Quit: bai]
johnDoe111 has quit [Ping timeout: 260 seconds]
kavanagh has quit [Remote host closed the connection]
kavanagh has joined #ruby
karmatr0n has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
duckpupp1 has quit [Ping timeout: 244 seconds]
jancel has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
xlegoman has joined #ruby
JesseH2 has quit [Remote host closed the connection]
<heftig> >> 1
<ruby[bot]> heftig: # => 1 (https://eval.in/587018)
<heftig> >> def a(a=nil); a; end; a(**{})
diegoaguilar has joined #ruby
<ruby[bot]> heftig: # => nil (https://eval.in/587019)
diegoaguilar has quit [Max SendQ exceeded]
<heftig> >> def a(a=nil); a; end; a(**Hash.new)
<ruby[bot]> heftig: # => {} (https://eval.in/587020)
<heftig> the heck is this ^
polll has quit [Quit: leaving]
tildes_ has joined #ruby
spider-mario has quit [Remote host closed the connection]
dorje has joined #ruby
yeticry has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
bruce_lee has quit [Remote host closed the connection]
xlegoman has quit [Read error: Connection reset by peer]
<jhass> a reason to avoid Hash.new without arguments? :P
norc has quit [Read error: Connection reset by peer]
chouhoulis has quit [Ping timeout: 244 seconds]
<jhass> >> def a(a=nil); a; end; h1 = {}; h2 = Hash.new; [a(**h1), a(**h2)]
<ruby[bot]> jhass: # => [{}, {}] (https://eval.in/587021)
<jhass> curious
dorje has quit [Client Quit]
codepete has quit []
codepete has joined #ruby
freerobby has quit [Quit: Leaving.]
<jhass> asm>> def a(a=nil); a; end; a(**{})
<ruby[bot]> jhass: I have disassembled your code, the result is at https://eval.in/587022
solars has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<jhass> asm>> def a(a=nil); a; end; a(**Hash.new)
<ruby[bot]> jhass: I have disassembled your code, the result is at https://eval.in/587023
xlegoman has joined #ruby
<jhass> so the parser already eats it in the first case?
mostlybadfly has joined #ruby
ocbtec has quit [Quit: leaving]
jancel has joined #ruby
moeabdol2 has joined #ruby
asahi has left #ruby [#ruby]
kappy has joined #ruby
dorje has joined #ruby
ljarvis has quit [Ping timeout: 276 seconds]
arescorpio has joined #ruby
marr has quit [Ping timeout: 276 seconds]
dorje has quit [Ping timeout: 244 seconds]
dorje has joined #ruby
ramfjord_ has joined #ruby
wrkrcoop has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
certainty has joined #ruby
dorje_ has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
kareeoleez has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
dorje has quit [Ping timeout: 244 seconds]
dorje_ is now known as dorje
danostrowski has joined #ruby
ramfjord_ has quit [Ping timeout: 240 seconds]
zeroDi has quit [Ping timeout: 258 seconds]
lightt has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
certainty has quit [Ping timeout: 272 seconds]
kareeoleez has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 258 seconds]
firstdayonthejob has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Client Quit]
Vile` has joined #ruby
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
Xentil has quit [Ping timeout: 260 seconds]
kavanagh has quit [Quit: That's all folks!]
Bugboy1028 has joined #ruby
jaguarmagenta has joined #ruby
zeroDi has joined #ruby
sandstrom has joined #ruby
moeabdol2 has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
kareeoleez has joined #ruby
ramfjord has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
jaguarmagenta has quit [Ping timeout: 252 seconds]
kareeoleez has quit [Ping timeout: 244 seconds]
mistermocha has quit [Remote host closed the connection]
SilverKey has joined #ruby
banister has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
chopin has quit [Ping timeout: 272 seconds]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
johnDoe111 has joined #ruby
emptyflask has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
tildes_ has quit [Ping timeout: 250 seconds]
tildes_ has joined #ruby
qasaur has joined #ruby
mistermocha has joined #ruby
Azure has joined #ruby
binaryplease has quit [Read error: Connection reset by peer]
duckpupp1 has joined #ruby
johnDoe111 has quit [Ping timeout: 260 seconds]
binaryplease has joined #ruby
jancel has quit [Remote host closed the connection]
kareeoleez has joined #ruby
mistermocha has quit [Ping timeout: 244 seconds]
aberen has joined #ruby
cdg has quit [Remote host closed the connection]
duckpupp1 has quit [Ping timeout: 258 seconds]
cdg has joined #ruby