spider-mario has quit [Read error: Connection reset by peer]
freerobby has quit [Quit: Leaving.]
freerobby has joined #ruby
charliesome has joined #ruby
workmad3 has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlphaAtom has quit [Read error: Connection reset by peer]
marr has quit []
jonee has quit [Ping timeout: 252 seconds]
workmad3 has quit [Ping timeout: 246 seconds]
AlphaAtom has joined #ruby
skweek has joined #ruby
leafybas_ has joined #ruby
matcouto has joined #ruby
Fredrich010 has quit [Ping timeout: 240 seconds]
phutchins has joined #ruby
clx has joined #ruby
<matcouto>
Is it possible to have something like that? "2".to_i.call(:years) ?? Basically, what I want to do is to build this 2.years. I've got two string fields, one with the number and other with the time(days/weeks/years).
leafybasil has quit [Ping timeout: 246 seconds]
crime has quit [Quit: Connection closed for inactivity]
<adaedra>
.send
Fredrich010 has joined #ruby
Fredrich010 has quit [Read error: Connection reset by peer]
<adaedra>
and remember to never trust user input.
leafybas_ has quit [Ping timeout: 256 seconds]
Fredrich010 has joined #ruby
wildlander has joined #ruby
<adaedra>
sigh.
<matcouto>
adaedra good point. Thanks a lot!!!
<adaedra>
?crosspost
<ruboto>
Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
alcipir has quit [Ping timeout: 260 seconds]
mary5030 has joined #ruby
phutchins has quit [Ping timeout: 268 seconds]
yqt has quit [Ping timeout: 260 seconds]
<Ox0dea>
shevy: Refinements are "ugly" how?
mary5030 has quit [Remote host closed the connection]
<Ox0dea>
Because you do the refining from within a block...?
blue_deref has quit [Quit: Taking myself out of hear.]
Guest41758 has quit [Quit: This computer has gone to sleep]
Rickmasta has joined #ruby
mary5030 has joined #ruby
blue_deref2 has joined #ruby
blue_deref2 has quit [Remote host closed the connection]
jjx_ has joined #ruby
<jjx_>
How can I get all aliases of a particular method?
blue_deref has joined #ruby
<Ox0dea>
jjx_: I don't think you can, but are you sure you need to do this?
<jjx_>
Ox0dea: I don't need to, I was just wondering if it was possible to do this ...
HoloIRCUser1 has joined #ruby
<Ox0dea>
jjx_: Aliased methods aren't "equal" in any sense meaningful enough to warrant comparison, so you won't be able to grab them programmatically.
vigintas has quit [Ping timeout: 268 seconds]
krazyj has joined #ruby
<jjx_>
Ox0dea: Yeah I didn't want to do this to compare them. It was for something else. Oh well...
MeMoc has quit [Quit: Connection closed for inactivity]
mary5030 has quit [Remote host closed the connection]
<shevy>
Ox0dea the whole syntax
<krazyj>
hey folks… does anyone know if i can init an instance of Sinatra::Base with something like `Sinatra.new(bind: ‘123.456.789.0’)`?
Guest41758 has joined #ruby
<Ox0dea>
shevy: There is no additional syntax for refinements.
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<weaksauce>
it's nice to see that apple has made terminal better over the years. I haven't tried it in 10 but windows cmd has always been pretty terrible... resize on the fly not allowed. copy and paste is not a first class citizen, etc.
wildlander has quit [Quit: Saliendo]
ruby-lang755 has left #ruby [#ruby]
AlphaAtom has quit [Read error: Connection reset by peer]
tkuchiki has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
towski_ has quit [Remote host closed the connection]
Fredrich010 has quit [Ping timeout: 240 seconds]
Uranio has quit [Ping timeout: 255 seconds]
wlch has joined #ruby
Fredrich010 has joined #ruby
workmad3 has joined #ruby
dikaio has joined #ruby
vanillapeach has joined #ruby
Rickmast_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Fredrich010 has quit [Ping timeout: 240 seconds]
crazydiamond has quit [Ping timeout: 260 seconds]
<shevy>
that's microsoft for ya - users must always use windows
symm- has joined #ruby
<shevy>
I mean a window user interface :-)
SuMo_D has quit [Quit: Off into this... Real world place...]
<shevy>
krazyj are you sure your colleague knows what he is doing
<shevy>
other than that, extend self used like that is the lazy way to make module-methods there
<krazyj>
ok
<shevy>
so you can use for example:
<shevy>
Mull::Container.server
<shevy>
def server; Sinatra::Base; end
<shevy>
sorta funny names he picked there
<shevy>
the server method returns ... sinatra base.....
<shevy>
always remember the hardest rule in programming - which is to give things a proper name :-)
<krazyj>
thought it was weird… he’s an interesting guy
<krazyj>
:P
<krazyj>
smart tho
<shevy>
take Ox0dea for instance... he so wanted to be known as 0x0dea instead
<shevy>
I try to not outsmart my future self
htmldrum has joined #ruby
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
Asher has quit [Quit: Leaving.]
ghr has quit [Ping timeout: 240 seconds]
zarubin has joined #ruby
jamto11 has joined #ruby
ghr has joined #ruby
howdoicomputer has joined #ruby
<Ox0dea>
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
diegoaguilar has joined #ruby
<Ox0dea>
-- Brian Kermithands
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
unreal has joined #ruby
zarubin has quit [Ping timeout: 264 seconds]
jamto11 has quit [Ping timeout: 250 seconds]
leafybasil has joined #ruby
howdoicomputer has quit [Ping timeout: 260 seconds]
unreal_ has quit [Ping timeout: 255 seconds]
alcipir has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
diegoaguilar has joined #ruby
mengu has quit [Remote host closed the connection]
alcipir has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
O47m341 has joined #ruby
bruno- is now known as Guest43121
chopin has joined #ruby
SuzieQueue has quit [Ping timeout: 250 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
RegulationD has joined #ruby
baroquebobcat has joined #ruby
workmad3 has joined #ruby
Guest43121 has quit [Ping timeout: 265 seconds]
nycjv321 has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
moeabdol has joined #ruby
Fredrich010 has quit [Ping timeout: 240 seconds]
Rickmasta has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
baroquebobcat has quit [Read error: Connection reset by peer]
clx has quit [Ping timeout: 240 seconds]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baroquebobcat has joined #ruby
ramfjord has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
hakunin_ has joined #ruby
hakunin has quit [Read error: Connection reset by peer]
Asher has joined #ruby
Fredrich010 has joined #ruby
jenrzzz has joined #ruby
alcipir has joined #ruby
Yzguy has quit [Quit: Zzz...]
symm- has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
alcipir has quit [Ping timeout: 252 seconds]
Fredrich010 has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
chipotle has quit [Quit: cheerio]
rshetty has joined #ruby
hololeap has joined #ruby
vigintas has joined #ruby
rgb-one has joined #ruby
htmldrum has quit [Ping timeout: 255 seconds]
wlch has quit [Quit: Leaving]
vigintas has quit [Ping timeout: 268 seconds]
Toto has joined #ruby
Toto is now known as Guest89101
mary5030 has joined #ruby
Fredrich010 has joined #ruby
chopin has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 240 seconds]
clx has joined #ruby
Guest89101 has quit [Ping timeout: 246 seconds]
verdoc has quit [Read error: Connection reset by peer]
darkf has joined #ruby
devbug has joined #ruby
mary5030 has quit [Ping timeout: 250 seconds]
verdoc has joined #ruby
clx has quit [Ping timeout: 240 seconds]
roxtrongo has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
johnny56_ has quit [Remote host closed the connection]
chipotle has quit [Ping timeout: 265 seconds]
rshetty has quit [Remote host closed the connection]
`based_pdev` has quit [Ping timeout: 260 seconds]
rshetty has joined #ruby
hanmac has quit [Quit: Leaving.]
CloCkWeRX has joined #ruby
trosborn has quit [Quit: trosborn]
troyready has quit [Remote host closed the connection]
chipotle has joined #ruby
psy_ has joined #ruby
symm- has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
clx_ has quit [Ping timeout: 252 seconds]
moeabdol has joined #ruby
moeabdol has quit [Client Quit]
kohgpat has quit [Ping timeout: 240 seconds]
jamto11 has quit [Remote host closed the connection]
relix has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moeabdol has joined #ruby
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jamto11 has joined #ruby
<gambl0re>
anyone here?
<Ox0dea>
There are dozens of us.
<gambl0re>
hi
tmtwd has joined #ruby
baweaver has joined #ruby
willardg has joined #ruby
blackmesa has joined #ruby
verdoc has quit [Ping timeout: 246 seconds]
kohgpat has joined #ruby
pontiki has quit [Ping timeout: 246 seconds]
yeticry has quit [Read error: Connection reset by peer]
rshetty_ has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
Asher has quit [Quit: Leaving.]
lkba_ has quit [Remote host closed the connection]
howdoicomputer has joined #ruby
rshetty has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 256 seconds]
demonlove has quit [Quit: Leaving]
davedev2_ has quit [Remote host closed the connection]
lkba has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
ramfjord has quit [Quit: Lost terminal]
mollusk_ has quit [Ping timeout: 250 seconds]
devbug_ has joined #ruby
yeticry has joined #ruby
fedexo has quit [Read error: Connection reset by peer]
jamto11 has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 265 seconds]
devbug has quit [Ping timeout: 240 seconds]
devbug_ has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
alcipir has quit [Ping timeout: 244 seconds]
verdoc has joined #ruby
workmad3 has joined #ruby
tmtwd has joined #ruby
benlovell has joined #ruby
grambo has joined #ruby
wharr has joined #ruby
trosborn has joined #ruby
Gnomethrower has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
trosborn has quit [Client Quit]
wharr_ has quit [Ping timeout: 244 seconds]
grambo has quit [Quit: Leaving]
benlovell has quit [Ping timeout: 240 seconds]
patdohere has joined #ruby
AlphaAtom has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
AlphaAtom has joined #ruby
willardg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mengu has joined #ruby
vigintas has joined #ruby
clx has joined #ruby
CloCkWeRX has quit [Ping timeout: 268 seconds]
AlphaAtom has quit [Read error: Connection reset by peer]
AlphaAtom has joined #ruby
symm- has quit [Ping timeout: 260 seconds]
radgeRayden has joined #ruby
mengu has quit [Ping timeout: 268 seconds]
vigintas has quit [Ping timeout: 246 seconds]
clx has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
bruno- is now known as Guest48629
RegulationD has joined #ruby
danieli has quit [Quit: *does an epic backflip into nowhere*]
Guest48629 has quit [Ping timeout: 260 seconds]
RegulationD has quit [Ping timeout: 244 seconds]
zipace has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mm_ has joined #ruby
yardenbar has joined #ruby
arup_r has quit [Quit: Leaving]
kohgpat has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
grambo has joined #ruby
pontiki has joined #ruby
ajb- has quit [Quit: Bye.]
grambo has quit [Client Quit]
alem0lars has joined #ruby
grambo has joined #ruby
grambo has quit [Client Quit]
grambo has joined #ruby
mm_ has quit [Read error: Connection reset by peer]
duderonomy has quit [Read error: Connection reset by peer]
ajb- has joined #ruby
mm_ has joined #ruby
pontiki has quit [Ping timeout: 240 seconds]
ajb- has quit [Changing host]
ajb- has joined #ruby
p1k has quit [Ping timeout: 244 seconds]
yardenbar has quit [Ping timeout: 256 seconds]
ajb- is now known as ajb
kohgpat has joined #ruby
mm_ has quit [Read error: Connection reset by peer]
zipace has quit [Changing host]
zipace has joined #ruby
jenrzzz has joined #ruby
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 268 seconds]
jamto11 has joined #ruby
yardenbar has joined #ruby
DrCode has quit [Ping timeout: 256 seconds]
jamto11 has quit [Ping timeout: 264 seconds]
chipotle has quit [Quit: cheerio]
hiyosi has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
keen_______ has joined #ruby
tkuchiki has joined #ruby
keen______ has quit [Ping timeout: 240 seconds]
baweaver has quit [Remote host closed the connection]
rehat has quit [Remote host closed the connection]
based_pdev_ has quit [Read error: Connection reset by peer]
based_pdev_ has joined #ruby
shinenelson has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
fantazo has joined #ruby
chipotle has joined #ruby
Cyther has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
bruno- is now known as Guest33400
cwong_on_irc has quit [Quit: Leaving.]
hanmac has joined #ruby
Outlastsheep has quit [Ping timeout: 272 seconds]
ahegyi has joined #ruby
Guest33400 has quit [Ping timeout: 244 seconds]
howdoicomputer has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago has joined #ruby
howdoicomputer has quit [Ping timeout: 240 seconds]
grambo has quit [Quit: Leaving]
pontiki has joined #ruby
rshetty_ has quit [Remote host closed the connection]
firstdayonthejob has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
andykingking has joined #ruby
blackmesa has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
pontiki has quit [Ping timeout: 250 seconds]
p1k has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
aspiers has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
workmad3 has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
benlovell has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
clx has joined #ruby
alcipir has joined #ruby
benlovell has quit [Ping timeout: 240 seconds]
jamto11 has joined #ruby
z4j5 has quit [Ping timeout: 255 seconds]
alcipir has quit [Ping timeout: 250 seconds]
jamto11 has quit [Ping timeout: 256 seconds]
minimalism has quit [Quit: leaving]
kohgpat has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
vigintas has joined #ruby
matcouto has joined #ruby
ndrei has joined #ruby
armyriad has quit [Ping timeout: 264 seconds]
armyriad has joined #ruby
skade has joined #ruby
minimalism has joined #ruby
vigintas has quit [Ping timeout: 265 seconds]
^mg^ has joined #ruby
blue_deref has quit [Quit: bbn]
devoldmx_ has joined #ruby
wharr_ has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
armyriad has quit [Ping timeout: 244 seconds]
matp has quit [Excess Flood]
ajb is now known as ajb-
matp has joined #ruby
wharr has quit [Ping timeout: 244 seconds]
mg^^ has quit [Ping timeout: 244 seconds]
hfp_work has quit [Ping timeout: 256 seconds]
bigmac_ has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
helpa has quit [Remote host closed the connection]
armyriad has joined #ruby
helpa has joined #ruby
GnuYawk has quit [Ping timeout: 246 seconds]
hfp_work has joined #ruby
armyriad has quit [Max SendQ exceeded]
bigmac_ has joined #ruby
armyriad has joined #ruby
armyriad has quit [Max SendQ exceeded]
Trieste has quit [Ping timeout: 264 seconds]
armyriad has joined #ruby
RegulationD has joined #ruby
bruno- has joined #ruby
bruno- is now known as Guest66730
blackmesa has joined #ruby
Trieste has joined #ruby
bkxd has quit [Quit: leaving]
_mak has left #ruby [".."]
apfeluser has joined #ruby
RegulationD has quit [Ping timeout: 265 seconds]
relix has joined #ruby
Guest66730 has quit [Ping timeout: 250 seconds]
alcipir has joined #ruby
last_staff has joined #ruby
BlackCoyote has quit [Quit: Leaving]
jenrzzz has joined #ruby
karapetyan has joined #ruby
alcipir has quit [Ping timeout: 255 seconds]
skade has quit [Ping timeout: 246 seconds]
skade has joined #ruby
sl33k has joined #ruby
pontiki has joined #ruby
trosborn has joined #ruby
pontiki has quit [Ping timeout: 252 seconds]
skade has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 255 seconds]
tkuchiki has joined #ruby
jonee has joined #ruby
p1k has quit [Ping timeout: 246 seconds]
SCHAAP137 has joined #ruby
trosborn has quit [Quit: trosborn]
tkuchiki has quit [Ping timeout: 240 seconds]
Trieste has quit [Ping timeout: 250 seconds]
trosborn has joined #ruby
lkba has quit [Ping timeout: 250 seconds]
Trieste has joined #ruby
Voker57 has joined #ruby
jonee has quit [Quit: ChatZilla 0.9.92 [Firefox 41.0.2/20151015172900]]
jamto11 has joined #ruby
yardenbar has quit [Ping timeout: 260 seconds]
User458764 has joined #ruby
tkuchiki has joined #ruby
jamto11 has quit [Ping timeout: 240 seconds]
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
dawkirst has joined #ruby
karapetyan has quit [Remote host closed the connection]
Trieste has quit [Ping timeout: 260 seconds]
karapetyan has joined #ruby
Trieste has joined #ruby
roxtrongo has quit [Remote host closed the connection]
tkuchiki has joined #ruby
roxtrong_ has joined #ruby
htmldrum has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
KnownSyntax has quit [Quit: Leaving]
karapetyan has quit [Ping timeout: 260 seconds]
DoubleMalt has joined #ruby
bigmac__ has joined #ruby
KnownSyntax has joined #ruby
Trieste has quit [Ping timeout: 250 seconds]
bigmac_ has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 246 seconds]
Trieste has joined #ruby
last_staff has quit [Quit: last_staff]
atomical has joined #ruby
bruno- has joined #ruby
bruno- is now known as Guest13386
postmodern has quit [Quit: Leaving]
clx_ has joined #ruby
Guest13386 has quit [Ping timeout: 244 seconds]
clx has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
chipotle has quit [Quit: cheerio]
apfeluser has quit [Quit: Leaving]
workmad3 has joined #ruby
alcipir has joined #ruby
ahegyi has quit [Ping timeout: 244 seconds]
tkuchiki has quit [Remote host closed the connection]
pontiki has joined #ruby
benlovell has joined #ruby
alcipir has quit [Ping timeout: 244 seconds]
niftylettuce has quit [Quit: Connection closed for inactivity]
pontiki has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
benlovell has quit [Ping timeout: 255 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
ndrei has quit [Ping timeout: 240 seconds]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
User458764 has quit [Ping timeout: 240 seconds]
hiyosi has joined #ruby
davedev2_ has joined #ruby
everbot has quit [Ping timeout: 250 seconds]
User458764 has joined #ruby
p1k has joined #ruby
vigintas has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
stamina has joined #ruby
bruno-_ has joined #ruby
ahegyi has joined #ruby
nettoweb has joined #ruby
vigintas has quit [Ping timeout: 246 seconds]
kohgpat has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
Tempesta has quit [Quit: Going offline, see ya! (( www.adiirc.com )]
Xeago has quit [Remote host closed the connection]
davedev24 has joined #ruby
Fredrich010 has quit [Ping timeout: 256 seconds]
davedev__ has joined #ruby
andykingking has quit [Quit: Leaving.]
Tempesta has joined #ruby
kohgpat has quit [Ping timeout: 244 seconds]
Tempesta has quit [Client Quit]
davedev2_ has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
mengu has joined #ruby
Fredrich010 has joined #ruby
Tempesta has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
htmldrum has quit [Ping timeout: 240 seconds]
Jackneill has joined #ruby
allcentury has joined #ruby
alcipir has joined #ruby
chipotle has joined #ruby
dionysus69 has joined #ruby
Blaguvest has joined #ruby
alcipir has quit [Ping timeout: 240 seconds]
vigintas has joined #ruby
tkuchiki has joined #ruby
dawkirst has quit [Remote host closed the connection]
hfp_work has quit [Ping timeout: 264 seconds]
dawkirst has joined #ruby
dikaio has quit [Quit: ........]
alcipir has joined #ruby
hfp_work has joined #ruby
vigintas has quit [Ping timeout: 265 seconds]
tkuchiki has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lkba has joined #ruby
tkuchiki has joined #ruby
alcipir has quit [Ping timeout: 244 seconds]
blackmesa has quit [Quit: WeeChat 1.3]
RegulationD has joined #ruby
tkuchiki has quit [Remote host closed the connection]
workmad3 has joined #ruby
krazyj has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
sulky has quit [Ping timeout: 240 seconds]
alcipir has joined #ruby
RegulationD has quit [Ping timeout: 260 seconds]
User458764 has joined #ruby
sulky has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roxtrongo has joined #ruby
Gnomethrower has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 252 seconds]
moeabdol has quit [Ping timeout: 255 seconds]
roxtrong_ has quit [Ping timeout: 268 seconds]
alcipir has quit [Ping timeout: 268 seconds]
spider-mario has joined #ruby
subscope has joined #ruby
pontiki has joined #ruby
kohgpat has joined #ruby
Fredrich010 has quit [Remote host closed the connection]
Alina-malina has quit [Ping timeout: 252 seconds]
sl33k has quit [Quit: sl33k]
alcipir has joined #ruby
sl33k has joined #ruby
steffkes has joined #ruby
pontiki has quit [Ping timeout: 268 seconds]
elaptics`away is now known as elaptics`
alcipir has quit [Ping timeout: 240 seconds]
houhouli_ has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
edwardly has quit [Ping timeout: 240 seconds]
Fredrich010 has joined #ruby
karapetyan has joined #ruby
crazydiamond has joined #ruby
step1step2_ has quit [Quit: Leaving]
step1step2 has joined #ruby
yfeldblum has joined #ruby
sl33k has quit [Quit: sl33k]
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Outlastsheep has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
howdoicomputer has joined #ruby
tkuchiki has joined #ruby
leafybasil has joined #ruby
Rollabunna has joined #ruby
govg has quit [Ping timeout: 246 seconds]
leafybasil has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 246 seconds]
User458764 has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
sameerynho has joined #ruby
govg has joined #ruby
benlovell has joined #ruby
FernandoBasso has joined #ruby
lxsameer has quit [Ping timeout: 265 seconds]
karapetyan has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<shevy>
wake up people!
karapetyan has joined #ruby
Mon_Ouie has joined #ruby
workmad3 has joined #ruby
benlovell has quit [Ping timeout: 272 seconds]
govg has quit [Ping timeout: 256 seconds]
joncol has joined #ruby
leafybasil has joined #ruby
<joncol>
Is it common to have a constructor in a module that you define? It seems a bit ugly to have to explicitly remember to call your constructor from every class that includes your module...?
karapetyan has quit [Ping timeout: 250 seconds]
cornerma1 has joined #ruby
jenrzzz has joined #ruby
leafybasil has quit [Remote host closed the connection]
rshetty has joined #ruby
cornerman has quit [Ping timeout: 250 seconds]
cornerma1 is now known as cornerman
moeabdol has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
ndrei has joined #ruby
vigintas has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
<Diabolik>
hi shevy
govg has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
mengu has quit []
<Diabolik>
>forever alone
<shevy>
joncol you can probably add some post-include hooks
workmad3 has joined #ruby
everbot has joined #ruby
L8 has joined #ruby
L8 is now known as Guest37498
<joncol>
shevy: nice idea, I'll read up on those.
workmad3 has quit [Ping timeout: 240 seconds]
rshetty has quit [Remote host closed the connection]
Mark__ has joined #ruby
Mark__ has left #ruby [#ruby]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
sdothum has joined #ruby
tkuchiki has joined #ruby
lxsameer_ has joined #ruby
sameerynho has quit [Ping timeout: 264 seconds]
leafybasil has joined #ruby
FernandoBasso has quit [Quit: WeeChat 1.3]
Guest37498 is now known as L8
L8 has quit [Changing host]
L8 has joined #ruby
naztharune has joined #ruby
ponga has joined #ruby
phutchins has joined #ruby
clx_ has quit [Ping timeout: 250 seconds]
charliesome_ has joined #ruby
ruurd has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
phutchins has quit [Ping timeout: 244 seconds]
skade has joined #ruby
jamto11 has joined #ruby
govg has quit [Ping timeout: 240 seconds]
govg has joined #ruby
<purplexed^>
how often is currying, functional composition, and lambdas used in Ruby... ?
leafybasil has quit [Remote host closed the connection]
<purplexed^>
is it prevalent, or is it something that the language allows, but only few use
<purplexed^>
It seems counter intuitive to use these approaches, if the code is supposed to easily understandable
lxsameer_ has quit [Ping timeout: 252 seconds]
sameerynho has joined #ruby
workmad3 has joined #ruby
jamto11 has quit [Ping timeout: 246 seconds]
<jhass>
I don't see proc currying much used, if at all
<purplexed^>
lambdas seem much more usable... it's popping up in many languages
naztharune has quit [Quit: naztharune has no reason]
teclator has quit [Remote host closed the connection]
roxtrongo has quit [Remote host closed the connection]
pontiki has joined #ruby
The_Phoenix has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
ruurd has quit [Quit: ZZZzzz…]
tk__ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lxsameer_ has joined #ruby
dionysus69 has joined #ruby
pontiki has quit [Ping timeout: 264 seconds]
sameerynho has quit [Ping timeout: 264 seconds]
<joncol>
I don't know about Ruby, but in languages like Haskell, ML, etc currying is very prevalent.
<purplexed^>
yes, but I was asking specifically about Ruby :-)
<purplexed^>
i realize it will be prevalent in pure functional languages ofcourse
leafybasil has joined #ruby
cwong_on_irc has joined #ruby
pontiki has joined #ruby
<purplexed^>
I'm just learning Ruby as a C# developer, and I would like to understand what are common techniques, eventhough the language does alot more
<adaedra>
purplexed^: read code.
<shevy>
purplexed^ lambda is used quite a lot, look at the rack code
<joncol>
purplexed^: Studying the other languages' use of currying/partial application can be useful also for Ruby, I think.
<purplexed^>
that sounds in efficient, if I can ask developers with experience, what is prevalent
skade has quit [Quit: Computer has gone to sleep.]
<purplexed^>
adaedra: I can't figure out something is prevalent, other than asking other developers with much more experience than I have in the language. I can read code sure... but that doesn't really ask my question.... and will need to track it from reading code... and that's why I need to ask other with experience
Feyn has quit [Quit: Leaving]
<purplexed^>
s/ask/answer
<shevy>
you could try to ask if anyone here is using a lot of lambdas :)
<purplexed^>
I thought my question was quite concise :)
workmad3 has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
<shevy>
yeah, save for lambdas the rest is not used
<purplexed^>
okay
<purplexed^>
thanks
RegulationD has joined #ruby
Alina-malina has joined #ruby
fantazo has quit [Quit: Verlassend]
moeabdol has joined #ruby
arup_r has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
Rollabunna has quit [Remote host closed the connection]
<purplexed^>
yes, and it is, .. but if it's a concept usually lost on the general population of Ruby developers, then I find it will cost more in development time, than using something that's "useful" but not normally understood.
Thomas-0725 has quit [Client Quit]
gregoriokusowski has joined #ruby
<joncol>
purplexed^: You might be right.
<joncol>
I guess it depends on in what context you're writing code.
alcipir has joined #ruby
sameerynho has joined #ruby
<purplexed^>
yeah, and what team an so forth
<joncol>
yes.
karapetyan has joined #ruby
<purplexed^>
I'm a senior dev, so I need to take it into account
Thomas-0725 has joined #ruby
<purplexed^>
my interns will probably get very confused
<purplexed^>
but they already know about lambdas :)
everbot has quit [Ping timeout: 246 seconds]
L8 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kohgpat has quit [Ping timeout: 240 seconds]
<joncol>
But if you find a really nice application of currying, you could use that as an excuse to teach them about it ?
Fredrich010 has quit [Ping timeout: 264 seconds]
<purplexed^>
We don't currently use Ruby in our organisation, but I have two new projects that I think would be good to do in Ruby...
<purplexed^>
all the developers are either Java or .NET folks
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<purplexed^>
so finding a good level to begin with, in coding style, is important
<joncol>
purplexed^: Same situation here, but we're currently using C++. I just started up a new project using Ruby.
lxsameer_ has quit [Ping timeout: 268 seconds]
<purplexed^>
oh, cool :) ... how are people reacting to it ?
alcipir has quit [Ping timeout: 255 seconds]
arup_r has quit [Ping timeout: 252 seconds]
<joncol>
Thus far, it's only me that's using it. (We're only two programmers)
nettoweb has joined #ruby
<purplexed^>
ah, okay :)
<purplexed^>
we are 30 -some developers
<joncol>
But development speed is much higher than C++, for many things.
zenguy_pc has quit [Read error: Connection reset by peer]
<purplexed^>
what business area are you working in, and why do you consider Ruby a good match ?
alcipir has joined #ruby
<purplexed^>
I work in media
Coldblackice has quit [Ping timeout: 252 seconds]
trosborn has quit [Quit: trosborn]
Fredrich010 has joined #ruby
<purplexed^>
I'm working on a platform, where I can monitor servers, for CPU, Memory, HD-space, and verify if a port to a remote host is open. Since our ops team is unreliable we need to do that ourselves. And since we are multi platform, I needed a language that works equally well on Linux and Windows.
<joncol>
Medical simulations. And we're currently doing an architectural rehaul, where we want to be able to support multiple connected devices, tablets etc. Our current C++ monolith is not very well suited to this. I quickly evaluated the following languages before we went with Ruby: Haskell (too exotic, hard to find people that know it), Python (no real benefits over Ruby), C# (boring :), Clojure (see Haskell).
<purplexed^>
And i looked to Octopus Deploy, ... where it has agents on the client-servers... and I can ship code to it for scheduling and running
charliesome has joined #ruby
<joncol>
purplexed^: nice
<purplexed^>
joncol: okay, that sounds cool
simi has quit [Ping timeout: 272 seconds]
<purplexed^>
I agree, eventhough Haskell is a nice language, it will be hard to find people who can code it
<purplexed^>
I guess I don't agree C# is boring ;)
howdoicomputer has joined #ruby
<joncol>
purplexed^: A more real disadvantage might be that it's still pretty Microsoft centric, even though that seems to be chaning.
phutchins has joined #ruby
alcipir has quit [Ping timeout: 256 seconds]
<purplexed^>
yeah, ... if you have heard about Roslyn, and if you know how much their developers are emphasizing cross-platform support... it's very interesting what is happening. Also, they are working with Docker, to create containers specific for Windows
<purplexed^>
being MS based is not a valid argument for not choosing their tools anymore :)
lxsameer_ has joined #ruby
Fredrich010 has quit [Ping timeout: 260 seconds]
sameerynho has quit [Ping timeout: 260 seconds]
<purplexed^>
but being bound by their platform(s) is
devoldmx_ has quit [Remote host closed the connection]
pepperbreath1 has joined #ruby
otherj has joined #ruby
<joncol>
Yes, that's good stuff (Roslyn etc)... So why did you go with Ruby instead of C#?
charliesome has quit [Client Quit]
<purplexed^>
i'm working away from MS these days, trying to choose more "free" platforms.. like using nosql databases when I can
Fredrich010 has joined #ruby
<purplexed^>
Because I need to install the .NET framework
<purplexed^>
that's my main reason
leafybas_ has joined #ruby
<joncol>
OK, your systems don't already have it?
<purplexed^>
the second is that Ruby seems like a language that's open to code change, by shipping code over the wire
<purplexed^>
well, like I mentioned, we use both linux and windows
pepperbreath has quit [Ping timeout: 246 seconds]
<purplexed^>
the main project I'm working on should work for both Linux and Windows
<joncol>
OK, I see. Well Ruby is nice. I'm not totally liking the duck typing thing and having no real way except tests to verify that objects implement a certain interface...
howdoicomputer has quit [Ping timeout: 268 seconds]
<purplexed^>
and I don't like that C# is compiled for this scenarip
<purplexed^>
-p+o
phutchins has quit [Ping timeout: 272 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
`tim` has joined #ruby
<purplexed^>
no, there are several things in Ruby that makes me feel uncomfortable... from a compiled language perspective
<purplexed^>
but there are again several things that makes it applicable for my project
<joncol>
Btw, have you tried Rubocop? Really nice way of enforcing common style and finding simple bugs.
<joncol>
Static code analysis gem.
<purplexed^>
no, but I'll look into that, thanks
<joncol>
Easily integratable into Emacs, if you happen to use that :)
<joncol>
Also other editors I'm sure.
rshetty has joined #ruby
<purplexed^>
you can do the same in C# with Roslyn, in your unit tests, because the code because objects
<purplexed^>
becomes*
<purplexed^>
the whole codebase becomes a syntaxtree
<purplexed^>
and you can query it like it was a xml document or something like that
<jhass>
most aliases properly appear as such in the docs, for the rest you usually can judge by them having the exact same docs
<mu_>
jhass: When aliasing a method, does a new method get created that's just a copy of original method?
<jhass>
that depends on the type of alias used
willardg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
alias_method does create a copy, alias only adds the name
<jhass>
thus the former is a method call and the latter is syntax btw
<jhass>
on the C level often the same C function is just bound to multiple names
chipotle has quit [Quit: cheerio]
<mu_>
jhass: Isn't alias_method wasteful then? It creates a new method instead of just creating an alias that references the old method.
rshetty has quit [Remote host closed the connection]
<jhass>
well, you won't do it in loops at runtime or anything like that, only when your program gets loaded. So the discussion is pretty mood, in Ruby anyway
zotherstupidguy has joined #ruby
karapetyan has quit [Remote host closed the connection]
govg has quit [Ping timeout: 250 seconds]
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
govg has joined #ruby
hays has quit [Ping timeout: 244 seconds]
mollusk_ has joined #ruby
mu_ has quit [Quit: Page closed]
demonlove has quit [Quit: Leaving]
atomical has joined #ruby
dionysus69 has quit [Quit: dionysus69]
demonlove has joined #ruby
arup_r has joined #ruby
<shevy>
and gone he is again!
<shevy>
he always has to go somewhere
<adaedra>
some people have something called "a life", shevy. you should try it.
<crime>
busy guy, aliasing all those methods
<crime>
burnt
govg has quit [Ping timeout: 255 seconds]
kohgpat has joined #ruby
codecop has joined #ruby
<shevy>
adaedra oh yeah I also always disconnect from IRC
clx_ has joined #ruby
zotherstupidguy has quit [Ping timeout: 250 seconds]
cmoneylulz has quit [Remote host closed the connection]
<demonlove>
'-'
clx__ has joined #ruby
clx_ has quit [Ping timeout: 250 seconds]
joncol has quit [Quit: leaving]
devoldmx has joined #ruby
beast has joined #ruby
crazydiamond has quit [Remote host closed the connection]
zotherstupidguy has joined #ruby
rshetty has joined #ruby
BlackGear has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
ibouvousaime has quit [Read error: Connection reset by peer]
simi has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
leafybasil has joined #ruby
kohgpat has quit [Ping timeout: 250 seconds]
tk__ has quit [Quit: ばいばい]
cmoneylulz has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crime>
If I wanted to have a program take input in, but with prompts and such, is there a repl gem I should use, or should I just do it all with .gets?
BlackGear has quit [Max SendQ exceeded]
moeabdol has quit [Ping timeout: 272 seconds]
zotherst1 has joined #ruby
BlackGear has joined #ruby
<apeiros>
crime: puts & gets works. but check out stdlib's readline
<apeiros>
also take a look at the highline gem
zotherstupidguy has quit [Ping timeout: 268 seconds]
<crime>
hey jhass, if you wanted, I could gist each rule in a gist, and then you could link to the gist and a lot of clients inline gists right into the buffer
<crime>
so they wouldnt have to click on it
asad_ has quit [Ping timeout: 246 seconds]
<crime>
or even a simple bot to just say it out loud into chat or privmsg it to the person
alcipir has joined #ruby
djellemah has quit [Ping timeout: 250 seconds]
<jhass>
crime: we'll eventually add them to the bot from a DB shared with the site
ruurd has joined #ruby
<crime>
i only mention it because it would humanize the process a bit more, and could potentially lower friction when someone gets rule'd on
Yzguy has joined #ruby
tmtwd has joined #ruby
howdoicomputer has quit [Ping timeout: 264 seconds]
weihan has joined #ruby
alcipir has quit [Ping timeout: 256 seconds]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
patdohere has joined #ruby
symm- has joined #ruby
patdohere has quit [Max SendQ exceeded]
gregf has joined #ruby
sankaber has joined #ruby
ibouvousaime has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
AlphaAtom has joined #ruby
gregf has quit [Quit: WeeChat 1.3]
UnMorenoBlanco1 has joined #ruby
<UnMorenoBlanco1>
i want to become a backend developer. Which plattform is better Node.JS or Ruby on rails?
Guest____ has joined #ruby
ruurd_ has joined #ruby
Guest____ has left #ruby [#ruby]
<shevy>
someone wants to get nick banned
<UnMorenoBlanco1>
is forbidden to ask here?
<shevy>
UnMorenoBlanco1 why did you pick this nick
<UnMorenoBlanco1>
cause i like it
<UnMorenoBlanco1>
mmmm
<UnMorenoBlanco1>
donald trump racism here?
<shevy>
UnMorenoBlanco1 come on buddy, show that I am wrong - change your nick
<jhass>
UnMorenoBlanco1: what's better, a hammer or a saw? Both have their uses and things they do better
<UnMorenoBlanco1>
why i must change my nick?
step1step2_ has joined #ruby
govg has quit [Ping timeout: 250 seconds]
eminencehc has joined #ruby
<Ox0dea>
crime: Which IRC clients inline gists?
<crime>
irssi and weechat I think have plugins in for it, irccloud has some .js for it
steffkes has joined #ruby
steffkes has joined #ruby
User458764 has joined #ruby
anaeem1_ has joined #ruby
<crime>
what client are you on? i bet someone has written one for yours too
<crime>
I found that then: idk weechat myself, but I dont think that /pastebuf command is issued automatically for those urls
<crime>
so an additional hook would be needed to pattern match the urls you were looking for and the use that command on them
<crime>
so its less easy than I thought, but still not that hard
p1k has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
pathrocle has quit [Remote host closed the connection]
zotherst1 has quit [Ping timeout: 250 seconds]
pathrocle has joined #ruby
rshetty has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
roxtrongo has joined #ruby
moeabdol has joined #ruby
zotherstupidguy has joined #ruby
eminencehc has quit [Remote host closed the connection]
pathrocle has quit [Ping timeout: 255 seconds]
diegoaguilar has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
tmtwd has quit [Ping timeout: 255 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
eminencehc has joined #ruby
gregoriokusowski has quit [Quit: gregoriokusowski]
gregf has joined #ruby
bmurt has joined #ruby
alcipir has joined #ruby
hmsimha has quit [Ping timeout: 265 seconds]
RegulationD has joined #ruby
Pathfinder_ has quit [Remote host closed the connection]
gregoriokusowski has joined #ruby
RegulationD has quit [Ping timeout: 265 seconds]
uber has quit [Ping timeout: 255 seconds]
<crime>
if I require something I've already required, i get back false. does this mean that in large projects, if something is required across files that there is a cache that checks if something has already been required?
roxtrong_ has joined #ruby
govg has joined #ruby
rshetty has quit [Remote host closed the connection]
mrtomme has quit [Ping timeout: 260 seconds]
Mon_Ouie has quit [Ping timeout: 260 seconds]
Asher has joined #ruby
nertzy has joined #ruby
rshetty has joined #ruby
mrtomme has joined #ruby
fedexo has joined #ruby
roxtrongo has quit [Ping timeout: 272 seconds]
ruurd_ has quit [Quit: ZZZzzz…]
<Ox0dea>
crime: That's exactly right.
<Ox0dea>
More specifically, Kernel#require does its deduplication by looking into $LOADED_FEATURES and bailing early if it finds the target therein.
<crime>
ah
<crime>
is there a list of special globals somewhere I can peruse?
uber has joined #ruby
bruno-_ has quit [Ping timeout: 255 seconds]
<crime>
like within ruby, i mean
asad_ has joined #ruby
steffkes has quit [Ping timeout: 255 seconds]
<asad_>
This is so weird...can someone explain why the global variable gets reset?
<crime>
so being that $LOADED_FEATURES is just a list of paths, I could potentially do all of my requiring in one file by just pushing into that array. is that what Gemfiles are doing, or is that another component?
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
webopsx has joined #ruby
weihan has quit [Ping timeout: 240 seconds]
roxtrong_ has quit [Remote host closed the connection]
skweek has joined #ruby
phutchins has joined #ruby
devoldmx has joined #ruby
rbennacer has quit [Remote host closed the connection]
bruno- has joined #ruby
bruno- is now known as Guest40721
janelleb has joined #ruby
ruby__ has joined #ruby
phutchins has quit [Ping timeout: 250 seconds]
symm- has quit [Ping timeout: 250 seconds]
devoldmx has quit [Ping timeout: 260 seconds]
asad_ has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
<Ox0dea>
asad_: For what it's worth, $SAFE can only be 0 or 1 in 2.3, but your previous example is indeed a little confusing.
<Ox0dea>
$SAFE is created with rb_define_virtual_variable(), but so are "scope-local" globals like $~ and friends, so I'm not sure what's happening.
<jhass>
crime: no, $LOADED_FEATURES tracks what has been loaded, it's not a work queue for the loader. Loading happens as you call require (or more specifically as it calls Kernel#load)
<jhass>
crime: bundler restricts what can be loaded, it does so by resetting $LOAD_PATH to the list of gems and preventing rubygems from auto activating gems
webopsx has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crime>
so then each gem just has a path associated, or a url or w/e, and bundler requires each one?
<jhass>
crime: Bundler.require is merely a convenience function that can (but doesn't have to) called after that setup and that tries to guess and execute a require call for each gem listed
<jhass>
crime: actually loading gems is not bundlers main job, that's just optional bonus. Its main job is what _can_ be loaded (required)
<asad_>
Ox0dea: Perhaps $SAFE isn't a global variable? It just looks like one?
<jhass>
*defining what
<jhass>
or *restricting what rather
<Ox0dea>
asad_: Sure, but $~ isn't a global variable either.
<jhass>
well, a mix of both actually
`tim` has joined #ruby
trabulmonkee has joined #ruby
<jhass>
crime: and yes, Gem::Specification#require_paths is what Rubygems normally adds to the $LOAD_PATH when activating a gem
<jhass>
crime: bundler reads that too, disables Rubygems activation and prepopulates $LOAD_PATH with the entries for the gems listed in the Gemfile.lock
<asad_>
Ox0dea: Yeah, $~ isn't a global
<Ox0dea>
asad_: Right, many variables with $ in their heads aren't.
<crime>
so then if I can just use a gemfile, messing with $LOAD_PATH by hand probably isnt the greatest idea
<Ox0dea>
Clearly $SAFE is different from the other "non-global globals", but it's unclear what exactly is going on.
tuxero has quit [Client Quit]
<Ox0dea>
$SAFE is "binding-local" or something.
Motoservo has joined #ruby
ItSANgo has quit [Ping timeout: 250 seconds]
Asher has quit [Quit: Leaving.]
<Ox0dea>
I grant that it's a little weird, but hey, free sandboxes!
eminencehc has quit [Remote host closed the connection]
asad_ has quit [Ping timeout: 246 seconds]
<crime>
jhass, so thats just regular ruby, so then a gem could potentially detect the ruby version or the platform, or basically anything and then issue a different array for the files variable in Gem::Specification
asad_ has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 250 seconds]
<jhass>
crime: mh, I'm not sure, there's a certain serialization happening to the specification and I'm not sure if the original gemspec is reparsed on activation
<jhass>
I wouldn't be surprised if it's parsed on gem build only
diegoaguilar has joined #ruby
willardg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zotherstupidguy has quit [Ping timeout: 260 seconds]
<crime>
hm
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
but your gem should have a single entry point to require anyway and you could switch on RUBY_PLATFORM there
VeryBewitching has joined #ruby
<crime>
so I could require something in a project, and then that code could determined what else was needed depending on the environment, add the relevant code to $LOAD_PATH and then call require again on the additional components
skweek has quit [Ping timeout: 260 seconds]
<jhass>
no, you should never need to mess with $LOAD_PATH really
<crime>
im speaking hypothetical at this point, but it seems like it'd be possible to dynamically require different code based on the output of any arbitrary ruby code
Motoservo has quit [Quit: Shhh. I'm trying to get some sleep here.]
janelleb has quit [Ping timeout: 260 seconds]
<jhass>
all your require's should be relative to your gem's base load path
Contigi777 has joined #ruby
asad_ has quit [Ping timeout: 246 seconds]
Motoservo has joined #ruby
<jhass>
my_foo.rb: case RUBY_PLATFORM; when /linux/; require "my_foo/linux_support"; when /win32/; require "my_foo/windows_support"; else; whine!; end
<crime>
ah
<crime>
i gotcha
bigmac__ has quit [Ping timeout: 264 seconds]
<crime>
then all the other guy would have to do is require 'my_foo' and it'll figure it out
<jhass>
yeah
<crime>
but that could be anything, day of the week, moon phase, etc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgorbach has joined #ruby
janelleb has joined #ruby
ljt has quit [Client Quit]
dotrb has quit [Quit: Lost terminal]
alcipir has quit [Ping timeout: 246 seconds]
relix has joined #ruby
ljt has joined #ruby
patdohere has quit [Read error: Connection reset by peer]
Soda has quit [Remote host closed the connection]
baweaver has joined #ruby
<Ox0dea>
Would `::?` as a "safe resolution operator" be completely insane?
<Ox0dea>
I'm trying to think of when it would be okay to fall back on the enclosing namespace if an expected entity turned up absent.
ta_ has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
Foo::?Bar.?new ? ugh
JammyHammy has quit [Read error: Connection reset by peer]
<crime>
hey really dumb question, working on my little text game, if a do some_object = nil, GC will eventually pick it up, right? even if it has instance variables and stuff attached to it, as long as I dont reference the object after I assign it to nil, it should get recycled
jenrzzz has joined #ruby
baweaver has quit [Remote host closed the connection]
<crime>
what about ^?
<crime>
er, just ^
<crime>
cuz you're going UP a namespace
alcipir has joined #ruby
arooni has joined #ruby
swgillespie has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
hectortrope has quit [Quit: WeeChat 0.4.2]
<jhass>
correct, objects without a reference will be collected
edwardly has joined #ruby
<jhass>
some_object = nil will make some_object reference nil instead of whatever it referenced previously
<crime>
also how exactly do I do that, because I get an error when I try to do self = nil
nemo_ has joined #ruby
<jhass>
self isn't an external reference, it doesn't count into the GC's checking
edwardly has quit [Changing host]
edwardly has joined #ruby
alcipir has quit [Ping timeout: 250 seconds]
UnMorenoBlanco1 has quit [Read error: Connection reset by peer]
ruurd has quit [Quit: ZZZzzz…]
bryanray has quit [Ping timeout: 260 seconds]
Yzguy has joined #ruby
UnMorenoBlanco1 has joined #ruby
UnMorenoBlanco1 has quit [Max SendQ exceeded]
UnMorenoBlanco1 has joined #ruby
UnMorenoBlanco1 has quit [Max SendQ exceeded]
UnMorenoBlanco1 has joined #ruby
UnMorenoBlanco1 has quit [Max SendQ exceeded]
karapetyan has joined #ruby
UnMorenoBlanco1 has joined #ruby
UnMorenoBlanco1 has quit [Max SendQ exceeded]
UnMorenoBlanco1 has joined #ruby
UnMorenoBlanco1 has quit [Max SendQ exceeded]
UnMorenoBlanco1 has joined #ruby
<Ox0dea>
crime: ^ is a method, so that wouldn't work.
<Ox0dea>
Well, it'd work for classes/modules that weren't constants, but that'd be weird.
<crime>
hm idk i was spitballing
patdohere has joined #ruby
hololeap has quit [Ping timeout: 268 seconds]
<shevy>
crime what kind of text game? a dungeon style game?
<crime>
yeah, I'll gist it in a few minutes
<shevy>
\o/
<crime>
eventually it'll have a readline interface
dfinninger has joined #ruby
<Ox0dea>
crime: Not io/console, then?
<crime>
not yet
<crime>
ive been running around a bit, have only actually had a little while to sit down and work on it
<crime>
its terrible
<UnMorenoBlanco1>
anyone here is doing the specialization of ruby on rails in coursera?
<jhass>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<crime>
if there was a #coursera channel, thatd be a good place too, but sadly there isnt one
freerobby has joined #ruby
<shevy>
I once wanted to write a ruby nethack in *curses
zotherstupidguy has joined #ruby
felltir has joined #ruby
<crime>
yeah I found this gem dispel
<crime>
gonna refurbish it a bit eventually
clx has joined #ruby
clx__ has quit [Ping timeout: 252 seconds]
<crime>
dispel as in, dispel curses
<al2o3-cr>
Sup! rubies
yqt has joined #ruby
<al2o3-cr>
tick tock
<crime>
variables with no sigil in a method definition are local to that method, right?
<shevy>
yeah
<shevy>
they won't persist outside the method
<crime>
mk
symm- has joined #ruby
kimegede has quit [Quit: Leaving...]
diegoaguilar has quit [Remote host closed the connection]
<shevy>
require 'gtksourceview3' TypeError: superclass mismatch for class InitError
fedexo has quit [Ping timeout: 246 seconds]
<shevy>
hmm
moss has quit [Ping timeout: 246 seconds]
<shevy>
I sorta lost gtksourceview support in the transition from ruby gtk2 to ruby gtk3
<shevy>
yeah you can simplify on dm.process_attack(HERO, MONSTER)
gambl0re has quit [Ping timeout: 240 seconds]
<crime>
i know it could be better, but i would like to make it functional first
<crime>
defender = nil doesnt do what I thought it would, how can I set the instance that an arg is referring to to nil?
<shevy>
defender is only available within your method there anyway
sgambino has joined #ruby
<shevy>
remember, you set a persistent constant prior to invoking the method with those two arguments: MONSTER = RandomMonster.new(3)
<crime>
right
<crime>
OH
<crime>
so if process_attack was receiving RandomMonster.new(3), then would that work?
jonnie has joined #ruby
skade has joined #ruby
sgambino has quit [Client Quit]
<shevy>
defender is only local to your method
<shevy>
via RandomMonster.new, you create a new instance from your class RandomMonster, then assign this to the local variable defender, which will be available in your method
Nanuq has joined #ruby
skade has quit [Client Quit]
<shevy>
people usually define a method called initialize, and pass in the required data, and assign to @foo instance variables
<shevy>
so you could do:
<crime>
but if I do defender = nil in that definition, will the instance of RandomMonster.new be assigned to nil or just the local variable?
<shevy>
the earlier instance of RandomMonster will be gone
beauby has joined #ruby
<shevy>
but really use instance variables, they are the way to go when you wish to have persistent data; and if you don't want them anymore, you can assign them to nil, or simply remove them altogether via e. g. remove_instance_variable(:@foo)
<al2o3-cr>
why apply a instance to a constant?
ta has joined #ruby
<crime>
could I so @some_var at the top level of a file? or should I use another class to house player and monster objects?
skade has joined #ruby
jamto11 has quit [Remote host closed the connection]
<shevy>
yeah you can use @var at the top level
<shevy>
ideally you would namespace your @ under the same module or class name
<shevy>
like module Dungeon; class Player ... or something
<crime>
yeah I can separate this out to their respective files at some point
nemo_ has quit [Remote host closed the connection]
Rickmasta has joined #ruby
patdohere has quit [Read error: Connection reset by peer]
gambl0re has joined #ruby
yqt has quit [Ping timeout: 256 seconds]
saddad has joined #ruby
JammyHammy has joined #ruby
arooni has quit [Ping timeout: 246 seconds]
m3_del has joined #ruby
bmurt has joined #ruby
<crime>
so shevy, if I had an array of entities within the game, with entities being members of classes or modules like players or characters, when I needed to kill an object, I could just set that position in the array to nil, and as long as method definitions dont mention a specific instance, it will be destroyed?
bmurt has quit [Client Quit]
devoldmx has joined #ruby
workmad3 has joined #ruby
rshetty has quit [Remote host closed the connection]
zarubin has joined #ruby
devoldmx has quit [Ping timeout: 255 seconds]
Fredrich010 has quit [Remote host closed the connection]
houhoulis has joined #ruby
<al2o3-cr>
Someone explain polymorphism
freerobby has quit [Quit: Leaving.]
cwong_on_irc has joined #ruby
cwong_on_irc has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 240 seconds]
cwong_on_irc has joined #ruby
HANJIN has quit [Quit: HANJIN]
steffkes has joined #ruby
AccordLTN has quit []
<crime>
is it like generics
zarubin has quit [Ping timeout: 260 seconds]
AccordLTN has joined #ruby
<saddad>
providing the same interface to interact with a bunch of different types/objects
houhoulis has quit [Ping timeout: 246 seconds]
Rickmast_ has joined #ruby
Jardayn has joined #ruby
<al2o3-cr>
saddad: Thanks -> :)
<al2o3-cr>
thought i was tripping there for a moment
<saddad>
no worries
<al2o3-cr>
come play hangman everyone in channel 8
<crime>
sounds like you want to map! instead if you are mutating the original string
steffkes has quit [Read error: Connection reset by peer]
<karapetyan>
is there map for String class?
kimegede has joined #ruby
<crime>
no but .split("") gives back an array of each character
<crime>
so some_string.split("").map { |ch| ch.upcase! if some_conditions }
<al2o3-cr>
String#chars
<kimegede>
Would I be able to use the "factory_girl_rails" gem to generate some data for my development while clicking around? (Or is't only for test fixtures?)
<jhass>
Qantourisc: let me guess, wrong channel? ;)
<Qantourisc>
yep
<Qantourisc>
off by one :p
ruurd has quit [Quit: ZZZzzz…]
Musashi007 has joined #ruby
chipotle has quit [Quit: cheerio]
ef has quit [Remote host closed the connection]
jgt has quit [Ping timeout: 240 seconds]
choke has quit [Remote host closed the connection]
Rickmast_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<al2o3-cr>
who had a commodore 64?
* Coraline
raises a hand
<al2o3-cr>
first one i had being only early 30's
xxneolithicxx has quit [Remote host closed the connection]
Soda has joined #ruby
pandaant has quit [Remote host closed the connection]
saddad has quit [Ping timeout: 268 seconds]
<al2o3-cr>
10 PRINT ...
dikaio has joined #ruby
<al2o3-cr>
memories
Fredrich010 has quit [Remote host closed the connection]
* al2o3-cr
stay with you forever
<Coraline>
I learned Assembly on the C64 so I could do hi-res graphics.
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
<Coraline>
I was just a little kid
xxneolithicxx has joined #ruby
xxneolithicxx has quit [Max SendQ exceeded]
<al2o3-cr>
Coraline: atari, amiga, acorn, spectrum any of these too?
hays has joined #ruby
xxneolithicxx has joined #ruby
<Coraline>
I first got online with an Atari ST
xxneolithicxx has quit [Max SendQ exceeded]
<Coraline>
It was my music computer. Built-in MIDI.
<al2o3-cr>
nice :)
<Coraline>
I used Video Toaster on an Amiga as well.
ahegyi has quit [Ping timeout: 250 seconds]
xxneolithicxx has joined #ruby
pygospa has quit [Quit: leaving]
<al2o3-cr>
best pda i ever owned was the psion 3c 1mb Ram I think
<al2o3-cr>
awesome little thing that was
pygospa has joined #ruby
<al2o3-cr>
amiga 500 series ah the days
<Coraline>
I had a Palm Pilot with a cell phone acccessory that plugged into the back. Using it I thought that having a combination PDA and cell phone was the worst idea ever.
ljt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<al2o3-cr>
heh, yeah i had the gsm pcmia card 14.4kbs wow, slow isn't the word
<al2o3-cr>
forgot what the language was on the psion now :(
<sl33k>
lazy question…rails has so much dsl and my knowledge of ruby isnt 100%. I know :foo has to do with symbols (which i didnt quite get). But its used in this syntax here: get :help
<sl33k>
just need some layman explanation to help me read along
<jhass>
get(:help), it's just calling the method get and passes the symbol :help
Musashi007 has quit [Quit: Musashi007]
<apeiros>
:foo has as much to do with symbols as "foo" with strings - namely, it is a literal
<sl33k>
jhass: so a symbol is simply a special kind of value
<sl33k>
and used for syntactic sugar
<jhass>
sl33k: pretty much
<sl33k>
cos some languages might have used. get “home” instead
cwong_on_irc has quit [Quit: Leaving.]
<jhass>
sl33k: and that should even work there too
<finisherr>
I guess it behaves as I thought the docs explained
<finisherr>
ok
<sl33k>
jhass: thanks mate.
<jhass>
sl33k: rails blurs the borders a bit sometimes, but generally you use a symbol if you want to compare, say {foo: 1}[:foo], something == :bar, case whateve; when :foo; when :bar; end; and so on
lxsameer has quit [Quit: Leaving]
<jhass>
sl33k: don't use a symbol if you want to use it for its string value, "foo".upcase, "foo".size == 3, "foo".chars
codecop has quit [Remote host closed the connection]
freerobby has joined #ruby
<sl33k>
jhass: yeah. your enum reference makes sense in that context
buharin has joined #ruby
<buharin>
Hash.new {|hash, key| hash[key] = [] }
<buharin>
I cannt get this is default value
ibouvousaime has joined #ruby
<sl33k>
in java we have stuff like View.HOME and then you could do a static import and just write HOME in code. but you cant do HOME.toUppercase()
workmad3 has quit [Ping timeout: 265 seconds]
<buharin>
but what is it?
<sl33k>
HOME here is :home albeit finer syntac
<jhass>
buharin: that sets Hash#default_proc, which is invoked when a key is accessed that doesn't exist
fschuindt1 has joined #ruby
<buharin>
ok
Musashi007 has joined #ruby
<buharin>
so when I invoke hash[:one] << "uno" it is invoked
<buharin>
but what it do
<jhass>
buharin: well, did you think about it? guess and explain it to me
<buharin>
what does |hash, key| hash[key] = []
<jhass>
buharin: which ruby tutorial do you follow?
<buharin>
koans
<jhass>
redo the section about blocks, or use something more verbose that explains blocks
<buharin>
ok
Fredrich010 has joined #ruby
<fschuindt1>
Guys, how can I do this: a = %w(mike zac robert) so: b = ["dan", "eric", a, "erika"] should produce an mixed array as: dan, eric, mike, zac, robert, erika. ?
<jhass>
fschuindt1: *a
<buharin>
jhass, but see this
<buharin>
Hash.new([])
<fschuindt1>
jhass: lovely! whats the name of this? naver heard of
<buharin>
the default value is [] array
<buharin>
but why after adding two values
ibouvousaime has quit [Client Quit]
<jhass>
buharin: yes, but the same object for all keys
<buharin>
hash[:one] << "uno"
<sl33k>
jhass: do you like rails?
<buharin>
and the next
ibouvousaime has joined #ruby
phutchins has joined #ruby
<buharin>
it added to the same object for all keys
<buharin>
why?
devoldmx has joined #ruby
<buharin>
it is working like that
eminencehc has quit [Remote host closed the connection]
<jhass>
sl33k: it's okay for what it is, I think I prefer it over comparable frameworks of other languages
<jhass>
buharin: because it's the same object all the time
<sl33k>
jhass: whats its alternative in rails?
<buharin>
and if we do Hash.new("bullshit")
workmad3 has joined #ruby
<jhass>
>> h = Hash.new([]); [h[:a].object_id, h[:b].object_id]
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Fredrich010 has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
willardg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Fredrich010 has joined #ruby
<oz>
/afk
EllisTAA has joined #ruby
WillAmes has quit [Remote host closed the connection]
WillAmes has joined #ruby
step1step2 has quit [Quit: Leaving]
_blizzy_ has joined #ruby
chopin has joined #ruby
<sl33k>
jhass: why dont they just write: provide(title, “About”) instead of provide(:title, “About”)?
<sl33k>
is it a quirk in the language?
<sl33k>
title can be a variable
<jhass>
sl33k: both are valid and do different things
<sl33k>
i can only guess one sets a variable, other sets a symbol.
<jhass>
as you said title is a local variable or method call
<jhass>
no
<jhass>
it doesn't set anything
<jhass>
and you can't set a symbol anyway
<jhass>
that'd be like setting 1
<sl33k>
so what is the “About”
<jhass>
1 = "a"
<jhass>
a string?
<sl33k>
okay not “set”, declaration?
<jhass>
it calls the method provide, the first variant passes the return value of the local variable or method call title as first argument, the second variant passes the symbol :title as first argument. Both pass the the string "About" as second argument
<jhass>
no, it doesn't declare anything either
<sl33k>
template generators allow you to set (dynamic) variable placeholders. Rails seem to favor symbols. I just wonder why
<jhass>
the method provide may define things based on the arguments
<jhass>
but it may not either
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
dfinninger has joined #ruby
<sl33k>
still doesnt help my why :symbol and not variable symbol
<jhass>
sl33k: please just accept it for now, we're just wasting our time here otherwise. It'll start to make sense soon enough, the more you use it, I promise.
<sl33k>
jhass: alright. :|
<sl33k>
:D
pygospa has quit [Remote host closed the connection]
<jhass>
I've given you all the explanations there are, if it didn't click by now it'll just take time
chipotle has quit [Ping timeout: 265 seconds]
galeido has quit [Quit: Going offline, see ya! (www.adiirc.com)]
devoldmx has joined #ruby
nfk has joined #ruby
chipotle has joined #ruby
blizzy has joined #ruby
chipotle has quit [Client Quit]
_blizzy_ has quit [Ping timeout: 246 seconds]
harryk has quit [Remote host closed the connection]
ruby__ has quit [Ping timeout: 246 seconds]
<apeiros>
sl33k: assume provide took a string instead of a symbol as first arg. then ask your question again:
<apeiros>
> why don't they just write: provide(title, "About") instead of provide("title", "About")?
<apeiros>
and then tell me the answer
<sl33k>
apeiros: that makes sense. title is undefined. “title” and hence :title are literals
<sl33k>
:D
<sl33k>
just weird. i’d carry on.
<apeiros>
you can do: title = "title"; provide(title, "About"). the same way you can do title = :title; provide(title, "About")
<sl33k>
yeah...
<apeiros>
i.e., "title", :title, 12, /foo/ - those are all *values*. title on the other hand is a variable, which *references* a value (unless it's a method call, then it'd return/evaluate to a value)
<sl33k>
apeiros: i follow :)
cwong_on_irc has joined #ruby
<apeiros>
if you do `x = 12; foo(x)` you do not pass x (the variable), you pass 12 (the value, referenced by x)
<al2o3-cr>
>> "this got me some headache".partition(/[\s]/).reject {|n| n.ord == 32 }.map { |s| s.chars.map.with_index { |c, i | i.even? ? c.upcase : c.downcase }*''}*' '
<geezyx>
application.get_obj() would return an Application::SomeObject instance
dotix has joined #ruby
<geezyx>
obj = application.get_obj()
RegulationD has quit [Ping timeout: 240 seconds]
Azure has joined #ruby
<geezyx>
finally, obj.save would use the Application::Service instance that it somehow inherits or references, to make the API call to save that object
al2o3-cr has quit [Ping timeout: 264 seconds]
<geezyx>
banging my head against the wall on this...
al2o3-cr has joined #ruby
jordanloky has joined #ruby
last_staff has quit [Read error: Connection reset by peer]
duncannz has joined #ruby
yfeldblum has joined #ruby
baweaver has joined #ruby
ruurd has joined #ruby
cornerma1 has joined #ruby
minimalism has quit [Quit: leaving]
ruurd has quit [Client Quit]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
cyle has joined #ruby
cornerman has quit [Ping timeout: 250 seconds]
sdothum has joined #ruby
cornerma1 is now known as cornerman
ruurd has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
dotix has quit [Quit: Leaving]
subscope has quit [Quit: Leaving]
Musashi007 has quit [Quit: Musashi007]
Asher has quit [Ping timeout: 246 seconds]
ItSANgo has joined #ruby
BraddPit1 has joined #ruby
sepp2k has joined #ruby
rshetty has joined #ruby
arup_r has quit [Quit: Leaving]
workmad3 has joined #ruby
Asher has joined #ruby
phillips1012 has quit [Ping timeout: 268 seconds]
solenoids has joined #ruby
arooni has quit [Ping timeout: 246 seconds]
skcin7 has quit [Ping timeout: 240 seconds]
rshetty has quit [Ping timeout: 250 seconds]
thelastinuit has joined #ruby
thelastinuit has quit [Client Quit]
everbot has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<crime>
sl33k: symbols evalute to themselves. variables evaluate to whatever value they hold or nil
<crime>
sl33k: so :name will ALWAYS give back :name, and name could give back "crime" or "sl33k" or anything
<al2o3-cr>
sherlock i think i've done it
<al2o3-cr>
>> "shit i need to stop drinking beer".split(/ /).map{ |s| s.chars.map.with_index { |c,i| (i%2).zero? ? c.upcase : c.downcase }.join }.join(' ')
<Ox0dea>
For constructing the jump targets in a brainfuck interpreter.
jonnie has quit [Ping timeout: 264 seconds]
<Ox0dea>
I probably should've un-golfed it, but the utility of #each_with_index is there.
<al2o3-cr>
In what case would you use and index other than 0
<al2o3-cr>
i mean lua use starts at 1 but..
PlasmaStar has joined #ruby
<crime>
yea boi
<al2o3-cr>
crime: what is boi?
<pipework>
mmm lua
<pipework>
al2o3-cr: sk8rboi bruh, get2no
<sl33k>
who minds explaining the comparative advantage of modules (it seems like a collection of static methods in java so far ).
<crime>
lua's metatables are the second easiest way to think about metaprogramming
<pipework>
sl33k: Mixins and namespaces are pretty neat.
<al2o3-cr>
setmetatable(self, {})
* sl33k
runs away. not on that level yet
<pipework>
Lua's pretty great, it has functions, tables, and 6(technically 8) data types.
<Ox0dea>
pipework: Right, but sl33k is presently under the misapprehension that they're only for namespacing.
<pipework>
Ox0dea: My advice: get2no
<waxjar>
i did some lua today, i missed a str.split function badly
<Ox0dea>
pipework: Pardon?
<al2o3-cr>
technically all objects are (tables/hashes/dicts) to an extent
<sl33k>
pipework: i just noticed that i added a helper method to some module and I had it magically. I wondered why it wasnt some class like in the controllers
<crime>
yeah lua is great until you have to do any kind of work with it
<sl33k>
also its weird not tying classes to file names in dynamic lang, but convenient
<Ox0dea>
ja: That is, how did you end up with "bad" keys in the first place?
<Ox0dea>
sl33k: The Stockholm syndrome is strong in this one.
<pipework>
sl33k: There are loaders, like rails uses, that do assume that constant paths are relative to file paths.
Or1on has quit [Quit: gone]
<ja>
Ox0dea: I have an Active Record model with a bunch of attribute aliases, and #attributes returns the unaliased versions, so I want to rekey that attribute hash with my aliases
howdoicomputer has quit [Ping timeout: 252 seconds]
<sl33k>
Ox0dea: you lose me
<crime>
i never knew there was a real reason, it made sense to me because [-1] is last, [0] is first, and [1] and is second
<Ox0dea>
ja: Yeah, fair enough.
zarubin has quit [Ping timeout: 240 seconds]
<crime>
i guess its the continuity of it
cndiv has joined #ruby
<Ox0dea>
crime: It's the only choice whose "drawbacks" exist between keyboard and chair.
phutchins has joined #ruby
<ja>
I guess I'll just steal facet's Hash#rekey *shrugs*
<al2o3-cr>
i like the way Lua uses ... as oppose to *args
<pipework>
ja: Why not just use Hash#delete?
<Ox0dea>
al2o3-cr: Does ... go both ways like splat does?
<al2o3-cr>
no
<crime>
I actually prefer *args, because it has a name to it
<Ox0dea>
And because it goes both ways.
<Ox0dea>
Symmetry is bliss.
<crime>
lua has no default parameter values either which i hate
<pipework>
In attributes[key.upcase], replace key.upcase with the new key name.
<crime>
sure var = var or some_val
<crime>
but thats one more line
hiyosi has joined #ruby
zarubin has joined #ruby
<crime>
ive read a bit of lua and i see the same idioms over and over and i just think that with a small bit of tinkering, these could be language features that we would have to spend lines on
marr has joined #ruby
<al2o3-cr>
crime: you know what Lua was a config language
<crime>
of course, lua owes its speed largely in part to its regularity and minimalism
<crime>
yeah
<crime>
SOL was data entry, LUA was config
<ja>
pipework: that's a lot more convoluted than `attributes.rekey(attribute_aliases)`
<pipework>
I'm more fond of using just plain ruby than using someone's library to have a shorter calling interface when it's something as trivial as this, really.
firstdayonthejob has quit [Quit: WeeChat 1.4-dev]
<Ox0dea>
That way lies NIH madness, mind.
phutchins has quit [Ping timeout: 250 seconds]
<pipework>
Ox0dea: When it's renaming keys in a hash?
<pipework>
The value of a library that does that is so small that I'd rather not incur any cost of including it.
<Ox0dea>
pipework: How many of Facets' conveniences does ja need to "need" before depending on it becomes justified?
firstdayonthejob has joined #ruby
<pipework>
Ox0dea: When the cost of maintenance and complexity are no longer trivial.
<crime>
Jim Weirich thought it was convenient enough...
zarubin has quit [Ping timeout: 264 seconds]
<pipework>
Appeal to authority much?
<crime>
I've tackled this before in lua projects where it's "oh well we don't want to have to depend on penlight"
<crime>
but it works, it's stable, and it saves my time
charliesome has joined #ruby
<pipework>
If you've already got facets on hand and are using it to great success, then I'd say to continue using it. But adding it to not write the simple thing I wrote, that's a bit silly to me.
<crime>
sure
<crime>
i wouldnt depend on penlight just to save a couple function definitions either
<crime>
but in larger projects it definitely pays for itself
<crime>
idk about facets but I would assume the principle applies
bigmac_ has joined #ruby
<pipework>
I don't personally know the facets library.
<pipework>
I feel a lot more confident about trusting ruby core than I do about facets.
xet7 has joined #ruby
bmurt has joined #ruby
<al2o3-cr>
ruby vs lua (voice speaks in my head) and says ruby ruby ruby
dfinninger has quit [Remote host closed the connection]
folbo has quit [Quit: Lost terminal]
mag42c has quit [Quit: mag42c]
chopin has quit [Remote host closed the connection]
<al2o3-cr>
lua hasn't got a patch on ruby
<al2o3-cr>
even though it's a nice language
<crime>
idk they each serve their own masters
<al2o3-cr>
speed, thats probably it
<pipework>
Lua's pretty great at a lot of things.
<crime>
luajit is extremely well optimized, mike pall is a mad scientist
<crime>
metaprogramming is a breeze with mt's
<al2o3-cr>
metaprogramming isn't with ruby?
<crime>
not imo
Voker57 has quit [Remote host closed the connection]
<Ox0dea>
Wat.
<pipework>
Not as good as lua's, imo.
<ja>
pipework: Of course, yes. I still think attributes.each { |(key, val)| attributes[attribute_aliases[key]] = attributes.delete(key) } is pretty long compared to just attributes.rekey(attribute_aliases)
<al2o3-cr>
Well, opinions are opinions
<crime>
like DSLs and dynamic methods? I personally dont like the cognitive overhead
<pipework>
ja: Yeah, length, but it's trivial to understand exactly what's going on because it's all just ruby.
<pipework>
Ruby Core, nothing more.
<ja>
pipework: Also, I'd need to stick attributes in a variable instead of it being a method call
<pipework>
ja: I don't know what that's supposed to mean in this context.
jonnie has joined #ruby
<crime>
but if rekey were in Ruby Core, would your opinion change?
<ja>
pipework: My `attributes` is a method, not a variable.
<pipework>
ja: I still don't know what you're trying to convey.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pipework>
ja: Activemodel attributes are a method, yes.
<ja>
pipework: I can't mutate the return value
<al2o3-cr>
Ox0dea: When is your next hospital appointment? jk (LOL)
<pipework>
ja: You can, it just doesn't change the name of the attribute internally, just the representation of it when you call #attributes
<Ox0dea>
al2o3-cr: Run it for a laugh.
ljt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ja>
pipework: Sorry, of course I can mutate the return value, but… yes… now I'm confused… and it's really noisy here…
<ja>
pipework: Besides, it wouldn't just be attributes.each { |(key, val)| attributes[attribute_aliases[key]] = attributes.delete(key) }
vdamewood has joined #ruby
<al2o3-cr>
Ox0dea: Awesome!!!
<ja>
it would be, in my case, local_record.attributes.each { |(key, val)| local_record.attributes[local_record.class.attribute_aliases[key]] = local_record.attributes.delete(key) }, which is very long
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ja>
and it wouldn't work because I'd call #attributes multiple times, getting new hash instances every time, is what I meant by "I can't mutate the return value"
<pipework>
ja: ActiveModel's attributes stuff is a bit weird to want to rename though, you'll be dealing with modifying their assumptions and then you're tied to them.
<waxjar>
ja: create a static method somewhere so you can reuse it? while you're at it, let it return a new hash instead of mutating the original?
<pipework>
I'd look for a better path than what you're doing, really.
<al2o3-cr>
Ox0dea: hanman the second you, that's made my night that =)
<Ox0dea>
al2o3-cr: I feel the need to clarify that I am not yhara.
zarubin has joined #ruby
lkba has quit [Ping timeout: 260 seconds]
<al2o3-cr>
:P
bonhoeffer has joined #ruby
<ja>
pipework: What do you mean "modifying their assumptions"? The problem is I'm using a third-party database schema with really messed up column names which I've aliased to something more reasonable
<Ox0dea>
al2o3-cr: shevy never did link to specific instances of the sort of code that gained hanmac this reputation; could you?
<ja>
waxjar: Yeah, I just stole #rekey from facet and implemented an #aliased_attributes using that on ActiveRecord::Base, so it's all good now :D
<al2o3-cr>
Ox0dea: probably not now, but believe me 1 for 1
<pipework>
But I also wouldn't go with this renaming business, I'd just make an object that's an activemodel object that delegates ruby-friendly methods to the actual activerecord instance using their weird column names.
<ja>
Hmm, interesting idea, pipework
sdwrage has joined #ruby
<pipework>
ja: Think decorator pattern. In this case, maybe steveklabnik's draper would work.
<ja>
Maybe I should look into that. I don't have much experience with using ActiveModel other than through ActiveRecord.
swgillespie has joined #ruby
EllisTAA has joined #ruby
<pipework>
ja: I just feel that making activerecord objects even more complex, especially in an way that's not the norm for those kinds of objects might be an idea you rue having executed on.
dikaio has quit [Ping timeout: 268 seconds]
Motoservo has quit [Quit: Motoservo]
<pipework>
I've done it myself, to myself, and for others. When it's to myself, I just hate it and it sucks. When I do it for others, it's because they just want to use the model objects they're comfortable with and are usually somewhat afraid of things that aren't model objects to deal with directly.
<pipework>
I'm generally more a fan of presenters, but a decorator would let this object appear more like the object you expect.
<ja>
pipework: But a few lines of calls to `alias_attribute` just seem a lot easier/cleaner than having to create a decorator model. It's worked great until now when I had to use #attributes.
bonhoeffer has joined #ruby
<pipework>
ja: If that works really whale for you without any hiccups or unexpected behaviour, go for it.
<pipework>
If something gets a bit fucky, you might reach for an alternative.
<ja>
Or, well, it's been a bit annoying that #inspect doesn't use the aliased attributes either, so I ended up writing an override for #inspect... >_>
<ja>
so it's actually already a bit fucky right now, I guess, haha
grambo has quit [Quit: Leaving]
<pipework>
I made this weird little fun bit that built in extra attributes onto models that were dynamical. Basically, it was just a has_many with delegates and redefining a lot of methods including inspect. Similar to what you're doing.
<zenspider>
ja: stop fighting active record so much. it's only going to cause pain and suffering in the long run
<pipework>
The reason I did it like I did with modifying the expected behaviour of activerecord objects was because I had to make the whole thing duck type to current assumptions and not introduce anything too different for other developers. Had it been for more enlightened folk, I'd have done it differently.
lkba has joined #ruby
jonnie has quit [Ping timeout: 240 seconds]
bonhoeffer has quit [Read error: Connection reset by peer]
<al2o3-cr>
ja: don't worry i think that all the time
benlieb has joined #ruby
<pipework>
It's probably a good idea to adopt the notion that activerecord objects are more someone else's objects than they yours in terms of ownership of internal behaviour.
<ja>
pipework: "for more enlightened folk", lol
diegoaguilar has joined #ruby
<ja>
al2o3-cr: well, sometimes it worse than other times, right? :D
chipotle has quit [Read error: Connection reset by peer]
<ja>
pipework: that sounds like a very good idea indeed
chipotle has joined #ruby
<al2o3-cr>
ja: oui
alcipir has quit [Ping timeout: 252 seconds]
tubuliferous_ has quit [Ping timeout: 252 seconds]
Under has quit [Read error: Connection reset by peer]
<pipework>
It's some-time-of-day o' clock, time to booze.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bonhoeffer_ has quit [Ping timeout: 240 seconds]
alcipir has joined #ruby
Motoservo has joined #ruby
<ja>
booze can be a great help when you're dealing with insane database schemas
<Ox0dea>
ja: Strive for the Ballmer peak.
<ja>
hahaha, yeah, that's always my goal
arthurnn has quit [Quit: bye...]
diegoaguilar has quit [Max SendQ exceeded]
trosborn has joined #ruby
htmldrum has quit [Ping timeout: 240 seconds]
<ja>
xkcd is full of truths
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
swgillespie has joined #ruby
rubyscraper has joined #ruby
diegoaguilar has joined #ruby
<Ox0dea>
>> send def drink?; Time.now.strftime('%A')[-1] == ?y; end