jancel has quit [Read error: Connection reset by peer]
ta_ has quit [Ping timeout: 260 seconds]
hackeron has quit [Ping timeout: 276 seconds]
KINGSABRI has quit [Ping timeout: 250 seconds]
<shevy>
wrkrcoop you can define them like: module Foo; def self.foo; puts 'hi from foo()'; end; def foo; Foo.foo; end; end; Foo.foo
KINGSABRI has joined #ruby
Nanuq has quit [Remote host closed the connection]
flashpoint9 has quit [Remote host closed the connection]
ixti has quit [Quit: WeeChat 1.5]
nankyokusei has joined #ruby
saneax is now known as saneax_AFK
karmatr0n has quit [Ping timeout: 260 seconds]
Nanuq has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Read error: No route to host]
CloCkWeRX has joined #ruby
Azure has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 250 seconds]
Azure has joined #ruby
hackeron has joined #ruby
arescorpio has joined #ruby
joneshf-laptop has quit [Ping timeout: 246 seconds]
djbkd has quit [Quit: My people need me...]
jhack has joined #ruby
roshanavand_ has quit [Quit: This computer has gone to sleep]
govg has quit [Ping timeout: 260 seconds]
nareiber has joined #ruby
govg has joined #ruby
dsea has quit [Read error: Connection reset by peer]
wolffles has quit [Quit: wolffles]
jancel has joined #ruby
chouhoulis has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
jhack has quit [Ping timeout: 276 seconds]
dsea has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
zeroDi has quit [Quit: WeeChat 1.5]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has joined #ruby
swills has joined #ruby
sneakerhax has quit [Ping timeout: 246 seconds]
skolman_ has quit [Remote host closed the connection]
skolman_ has joined #ruby
amclain has quit [Quit: Leaving]
idefine has quit [Ping timeout: 260 seconds]
der-landgraf has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
skolman_ has quit [Ping timeout: 276 seconds]
bronson has joined #ruby
der-landgraf has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
someish has joined #ruby
idefine has joined #ruby
<someish>
Why do I have to write application_results[“app_name”][0][0] to get the first result for that particular “app_name”? Why doesn’t the code I wrote allow me to access it like this application_results[“app_name”][0] … https://gist.github.com/saturday/64daae33bd3050885b7c45a03fc410b4
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blaxter has quit [Read error: Connection reset by peer]
skweek has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
hahuang65 has quit [Ping timeout: 276 seconds]
psf has quit [Changing host]
psf has joined #ruby
idefine has quit [Ping timeout: 252 seconds]
xall has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 252 seconds]
zigzag_ has joined #ruby
emptyflask has quit []
govg has joined #ruby
idefine has joined #ruby
hahuang65 has joined #ruby
ropeney has joined #ruby
idefine has quit [Ping timeout: 260 seconds]
<Radar>
someish: because you're using the shovel operator
<_kraken>
Do I need to initialize all my variables in an initialize method for a particular class or can I define them outside the methods in that class?
<_kraken>
Is a class just composed of methods? AKA, nothing outside the methods?
mbreedlove has quit [Ping timeout: 252 seconds]
mbreedlove has joined #ruby
koooge has joined #ruby
astrobunny has joined #ruby
arescorpio has quit [Quit: Leaving.]
kareeole_ is now known as kareeoleez
xall has joined #ruby
karmatr0n has quit [Ping timeout: 276 seconds]
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has joined #ruby
ur5us has quit [Remote host closed the connection]
nankyokusei has joined #ruby
m_antis has quit [Ping timeout: 276 seconds]
znz_jp has quit [Remote host closed the connection]
blackmesa has joined #ruby
xall has quit [Ping timeout: 250 seconds]
LoneHerm_ has joined #ruby
idefine has quit [Ping timeout: 260 seconds]
znz_jp has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<pipework>
_kraken: Ruby is quite dynamic.
allcentury has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
<pipework>
Methods needn't even exist until runtime, and sometimes don't exist at all times in runtime.
<pipework>
Quite the magical thing.
blackmesa has quit [Ping timeout: 244 seconds]
voucher has joined #ruby
LoneHerm_ has quit [Ping timeout: 240 seconds]
beauby has quit [Ping timeout: 244 seconds]
tildes_ has joined #ruby
jose9991 has left #ruby [#ruby]
voucher has left #ruby [#ruby]
kgrz has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
karmatr0n has joined #ruby
yfeldblum has quit [Remote host closed the connection]
chopin has quit [Remote host closed the connection]
TheWhip has joined #ruby
beauby has joined #ruby
p1k has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
terminalrecluse has joined #ruby
bronson has joined #ruby
nerium has quit [Quit: nerium]
tref has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
crystal77 has joined #ruby
johnbat26 has joined #ruby
idefine has joined #ruby
<tref>
anyone used the mapbox-rails gem?
<beauby>
Hi there. I have a conditional module inclusion in my gem (`if defined?(ActionController); require 'rails-specific-stuff'; end;`). For testing purposes, how can I load ActionController before my gem itself? (using rspec)
idefine has quit [Ping timeout: 252 seconds]
stannard has joined #ruby
kareeoleez has quit [Remote host closed the connection]
gusrub has joined #ruby
ta_ has joined #ruby
anisha has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
viz has joined #ruby
viz has quit [Client Quit]
yaewa has joined #ruby
ta_ has quit [Ping timeout: 260 seconds]
paatalaBhairavi has joined #ruby
tildes_ has quit [Ping timeout: 250 seconds]
paatala_bhairavi has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
moei has quit [Ping timeout: 240 seconds]
paatala_bhairavi has quit [Client Quit]
paatalaBhairavi has quit [Client Quit]
yfeldblum has joined #ruby
<_kraken>
Do you guys use blocks and procs alot with methods? These confuse me so fucking much
SilverKey has joined #ruby
<beauby>
_kraken: Yeah they are useful when you want to pass an arbitrary function around (for instance taking a `formatter` lambda/prock as a parameter)
<bazzy>
change your spec before changing the code!!
blackmesa has joined #ruby
<pipework>
_kraken: They can be really useful, but I typically try not to make an excuse for them where they aren't necessary in code I share with others.
<pipework>
Though DSLs and nice method interfaces are welcome.
<beauby>
bazzy: was your comment for me?
araujo_ has quit [Quit: Leaving]
<bazzy>
it's for everyone!~
<bazzy>
I'm learning TDD :D
<beauby>
Oh I see :)
<bazzy>
does this sound right?
<bazzy>
to answer (why change spec before change code)
<bazzy>
if you created tests already .. and then you think "Ou .. I am going to change how my thingy works.. then you want to change your spec (tests) FIRST! before changing the code! it helps breath life into your idea and provides the new tests first so you can work on getting them to pass!
<bazzy>
is there a better clearer answer to "WHY change spec before code" ?
allcentury has joined #ruby
hk238 has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
jenrzzz_ has quit [Ping timeout: 250 seconds]
ravishankarjha has joined #ruby
karmatr0n has quit [Ping timeout: 250 seconds]
<beauby>
bazzy: Philosophically, in TDD, you define behavior in your spec, and you make your code fulfill the specs. The spec is the contract. Plus, if you change your code first and your spec later, you're clouded with your implementation.
duncannz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
<bazzy>
beauby, elaborate
duncannz has quit [Max SendQ exceeded]
<bazzy>
"clouded with your impl"
<bazzy>
you mean mentally
<bazzy>
impl details are extranneous
duncannz has joined #ruby
bobbycvi_ has quit [Quit: ...]
allcentury has quit [Ping timeout: 276 seconds]
<beauby>
bazzy: There's a chance if you write code first you will be biased when writing the spec
sauvin has joined #ruby
<bazzy>
Are there any considerations to take when you maintain a codebase that lacks a testing framework, and you want to create one.. or an approach proven?
moeabdol has joined #ruby
moeabdol has quit [Client Quit]
xall has joined #ruby
moeabdol has joined #ruby
pushpak has joined #ruby
pushpak has quit [Client Quit]
A5101 has joined #ruby
LoneHerm_ has joined #ruby
kareeoleez has joined #ruby
kareeoleez has quit [Remote host closed the connection]
kareeoleez has joined #ruby
wilbert has quit [Ping timeout: 260 seconds]
Coldblackice has joined #ruby
galeido_ has joined #ruby
galeido has quit [Ping timeout: 276 seconds]
tref has quit [Quit: tref]
galeido_ is now known as galeido
galeido has quit [Changing host]
galeido has joined #ruby
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
d0nn1e has quit [Ping timeout: 265 seconds]
aganov has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
d0nn1e has joined #ruby
_kraken has quit [Remote host closed the connection]
neanderslob has quit [Read error: Connection reset by peer]
emilkarl has joined #ruby
noobsu has joined #ruby
emilkarl is now known as emilkarl[away]
emilkarl[away] is now known as emilkarl
binaryplease has joined #ruby
neanderslob has joined #ruby
crdpink has quit [Excess Flood]
crdpink has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
astrobunny has quit [Remote host closed the connection]
duoi has joined #ruby
shlomo has joined #ruby
blackgoat has joined #ruby
troulouliou_div2 has joined #ruby
FooMunki has joined #ruby
astrobunny has joined #ruby
wigust has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 250 seconds]
brunto has quit [Ping timeout: 260 seconds]
ma489 has joined #ruby
startupality has joined #ruby
WebDevB has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
noService has joined #ruby
pawnbox has joined #ruby
blackgoat has quit [Ping timeout: 276 seconds]
LoneHerm_ has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 244 seconds]
astrobunny has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
roshanavand_ has quit [Client Quit]
blackgoat has joined #ruby
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
binaryplease has joined #ruby
codeurge has joined #ruby
brunto has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
minimalism has quit [Quit: minimalism]
chipotle_ has quit [Ping timeout: 252 seconds]
roshanavand_ has joined #ruby
workmad3 has joined #ruby
hangelo has joined #ruby
blackgoat has quit [Ping timeout: 244 seconds]
psf has joined #ruby
<shevy>
power-insta-quitting!
Coldblackice_ has quit [Ping timeout: 244 seconds]
moeabdol has joined #ruby
prestorium has quit [Quit: Leaving]
hangelo has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
psf has quit [Changing host]
psf has joined #ruby
roshanavand_ has quit [Quit: This computer has gone to sleep]
Shashikant86 has joined #ruby
blackgoat has joined #ruby
evidex has joined #ruby
ropeney has quit [Quit: Leaving]
startupality has quit [Quit: startupality]
blaxter has joined #ruby
ropeney has joined #ruby
codecop has quit [Ping timeout: 246 seconds]
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality has joined #ruby
yosafbridge has quit [Quit: Leaving]
duoi has quit [Ping timeout: 260 seconds]
das_j has joined #ruby
vondruch_ has joined #ruby
duoi has joined #ruby
drewo has joined #ruby
<das_j>
Hello, I'm a newbie and I'm currently trying to run a rakefile through bundler using `bundle exec rake rake-target`. The output of the command is "Could not find rake-10.5.0 in any of the sources" and "use bundle install". Using bundle install just tells me that the package is already installed.
Tyrant_ has quit [Quit: Tyrant_]
<das_j>
What should I do in this case?
Zggb_ has joined #ruby
duoi has quit [Excess Flood]
horaceheaven has quit [Ping timeout: 260 seconds]
duoi has joined #ruby
Devalo has joined #ruby
vondruch has quit [Ping timeout: 265 seconds]
polysics has joined #ruby
labaleine has quit [Ping timeout: 260 seconds]
chip_ has quit [Ping timeout: 252 seconds]
Masonn has joined #ruby
tgeeky has quit [Ping timeout: 260 seconds]
<das_j>
Oh and of course, rake is in my gem path
Masonn has quit [Read error: Connection reset by peer]
drewo has quit [Ping timeout: 244 seconds]
Zggb_ is now known as Zggb
horaceheaven has joined #ruby
tgeeky has joined #ruby
pandaant has joined #ruby
Devalo has quit [Ping timeout: 260 seconds]
<das_j>
`bundle exec rake --version` shows me 10.5.0 which seems to be correct
codecop has joined #ruby
horaceheaven has quit [Quit: horaceheaven]
das_j has quit [Quit: Page closed]
davidblko has joined #ruby
WhatsGoingOn has quit [Remote host closed the connection]
chip_ has joined #ruby
d0lph1n98 has joined #ruby
allcentury has joined #ruby
brunto has quit [Ping timeout: 246 seconds]
saneax is now known as saneax_AFK
dionysus69 has joined #ruby
stannard has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
polysics has quit [Ping timeout: 260 seconds]
blaxter has quit [Quit: foo]
yosafbridge has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
startupality has quit [Quit: startupality]
blaxter has joined #ruby
hydr8d has quit [Ping timeout: 244 seconds]
pLaToOn has joined #ruby
<pLaToOn>
moin
the_drow has quit [Quit: This computer has gone to sleep]
v0dro has joined #ruby
marr has quit [Ping timeout: 250 seconds]
Hyuk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has joined #ruby
astrobunny has joined #ruby
Gasher has joined #ruby
v0dro has quit [Ping timeout: 276 seconds]
jgt3 has quit [Ping timeout: 240 seconds]
emilkarl has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
Shashikant86 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kholbekj has joined #ruby
astrobunny has quit [Ping timeout: 260 seconds]
qasaur has joined #ruby
cultureulterior1 has joined #ruby
LoneHermit has joined #ruby
sdothum has joined #ruby
yosafbridge has quit [Read error: Connection reset by peer]
<Zarthus>
you're doing a thing but you haven't stubbed it yet
<Zarthus>
because it doesn't know how to mock it, it throws an error instead
Shashikant86 has quit [Max SendQ exceeded]
<jokke>
Zarthus: see the last line
<Zarthus>
does it support regexes?
<jokke>
according to docs it does
binaryplease has quit [Ping timeout: 240 seconds]
<Zarthus>
if it does, should it not be a Regexp class instead of a string?
<jokke>
yeah that's what i thought too
<jokke>
and that's how i mocked the request
<Zarthus>
also your regex seems weird to me
duoi has quit [Ping timeout: 260 seconds]
yosafbridge has joined #ruby
<jokke>
it's basically just a /^#{Regexp.escape(url)}.*/
<Zarthus>
hm, no nevermind. you just didn't provide a top level domain
<Zarthus>
or rather, the url is weird because it's not what you'd normally expect an url to look like
<Zarthus>
I think you need to remove the quot marks in your #stub_request code
drewo has quit [Ping timeout: 250 seconds]
<jokke>
weirdest of all: if i run the test by itself (by running rake test path/to/test/that/fails.rb) i get no error
duoi has joined #ruby
jds has quit [Quit: Connection closed for inactivity]
mdw_ has joined #ruby
m_antis has joined #ruby
umdstu has joined #ruby
rxgcow has quit [Remote host closed the connection]
ixti has joined #ruby
<jokke>
i mock the request in the setup block
<kholbekj>
quit
kholbekj has quit [Quit: leaving]
gnufied has joined #ruby
<jokke>
of the parent class of my test
cdg has joined #ruby
kam270 has joined #ruby
kam270 has quit [Max SendQ exceeded]
<jokke>
(i hate minitest, i just have to use it for this project)
mdw has quit [Ping timeout: 260 seconds]
v0dro has joined #ruby
aupadhye has quit [Quit: Leaving]
jgt3 has joined #ruby
pLaToOn has quit [Quit: Leaving]
noService has quit [Ping timeout: 260 seconds]
pwnd_nsfw` has joined #ruby
crdpink has quit [Excess Flood]
bronson has joined #ruby
<Zarthus>
nobody likes mocking http requests
crdpink has joined #ruby
<apeiros>
?nobody
<ruby[bot]>
apeiros is nobody
<apeiros>
true. I do.
brunto has joined #ruby
noService has joined #ruby
<Zarthus>
Nobody much prefers mocking HTTP requests over mocking non-http requests?
* Zarthus
stab in the wild
rtl has quit [Ping timeout: 250 seconds]
humding3r has quit [Ping timeout: 250 seconds]
Kallis has joined #ruby
startupality has quit [Quit: startupality]
p1k has joined #ruby
<apeiros>
what's a non-http request?
pwnd_nsfw has quit [Ping timeout: 250 seconds]
ferr has joined #ruby
<apeiros>
jokke: show your stub_request code?
<p1k>
what's a sane way to monkey-patch a class that uses alias to avoid collision
<p1k>
e.g. I need to patch :load, but the inheriting class calls alias :load, :_load and then defines a new :load etc.
<apeiros>
a sane way to monkey-patch a class is to not monkey-patch it
rtl has joined #ruby
<apeiros>
sounds like you want to reinvent alias_method_chain?
kies has joined #ruby
<apeiros>
oh, misread
<apeiros>
monkey patch the descendant to then?
bronson has quit [Ping timeout: 252 seconds]
<p1k>
yeah I need to patch the :load which will become :_load
startupality has joined #ruby
humd1ng3r has joined #ruby
cdg has quit [Remote host closed the connection]
rodfersou has joined #ruby
ravishankarjha has quit [Remote host closed the connection]
jaruga____ has quit [Quit: jaruga____]
v0dro has quit [Ping timeout: 252 seconds]
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
<shevy>
p1k isn't that simple? I mean you can temporarily define/alias methods and also remove them at will again via... either remove_method or undefine_method
<shevy>
though the original implementation there sounds quite crazy already
blackmesa has joined #ruby
jaruga___ has joined #ruby
jaruga___ is now known as jaruga____
Ch4rAss has quit [Ping timeout: 260 seconds]
emilkarl is now known as emilkarl[away]
emilkarl[away] is now known as emilkarl
ldnunes has joined #ruby
Ch4rAss has joined #ruby
Masonn has joined #ruby
mg^ has quit [Ping timeout: 240 seconds]
jancel has joined #ruby
<p1k>
buckets of joy monkey patching someone else's library to add logging
<apeiros>
ah those moments when you wish ruby had a tiny bit of AOP
evidex has quit [Ping timeout: 240 seconds]
wigust has joined #ruby
wigust has quit [Client Quit]
noobsu_ has quit [Remote host closed the connection]
<shevy>
you still want ruby to be hypercard!!!
<apeiros>
hypercard didn't have aop
<apeiros>
and no, I don't want ruby to be hypercard either :)
mg^ has joined #ruby
neanderslob has quit [Remote host closed the connection]
<TheBrayn>
I want everything to be hypercard
vondruch_ has quit [Quit: Ex-Chat]
BaroMeter has joined #ruby
vondruch has joined #ruby
symm- has quit [Ping timeout: 260 seconds]
nettoweb has joined #ruby
senayar has quit [Remote host closed the connection]
|2701 has joined #ruby
solars has quit [Ping timeout: 250 seconds]
senayar has joined #ruby
lewis1711 has joined #ruby
shibly has joined #ruby
drewo has joined #ruby
<lewis1711>
why can't an enumerator be cloned?
pawnbox has quit [Remote host closed the connection]
hanmac has quit [Ping timeout: 250 seconds]
<lewis1711>
I mean it's just a glorified pointer surely
shibly has left #ruby [#ruby]
ravishankarjha has joined #ruby
allcentury has joined #ruby
LoneHermit has joined #ruby
drewo has quit [Ping timeout: 244 seconds]
flashpoint9 has joined #ruby
halfamind has joined #ruby
labaleine has joined #ruby
halfamind has quit [Client Quit]
noobsu has joined #ruby
mbreedlove has quit [Ping timeout: 246 seconds]
m_antis has quit [Ping timeout: 260 seconds]
pawnbox has joined #ruby
wdi14 has joined #ruby
evidex has joined #ruby
LoneHermit has quit [Ping timeout: 252 seconds]
<wdi14>
Hello everybody. I'm new to Ruby and I need help to translate this code from javascript to Ruby
duncannz has quit [Remote host closed the connection]
<wdi14>
Hello everybody. I'm new to Ruby and I need help to translate this code from javascript to Ruby http://jsbin.com/punasozuti/edit?js,console
jancel has quit [Remote host closed the connection]
ponga has joined #ruby
<gregf_>
wdi14: how are you willing to pay? *waits with bated breath*
<apeiros>
lewis1711: iirc it's implemented via fibers (and used to be continuations - not sure though)
TheWhip has quit [Remote host closed the connection]
<wdi14>
gregf_: Yes but I'd like to learn also
<gregf_>
wow, so much business login in the view :|
<gregf_>
s/login/logic/
<wdi14>
gregf_: otherwise I'd had used fiverr or something else
rodfersou has quit [Ping timeout: 260 seconds]
<apeiros>
gregf_: just wait for an actual question? :)
labaleine has quit [Ping timeout: 276 seconds]
mg^ has quit [Ping timeout: 276 seconds]
aries_liuxueyang has quit [Ping timeout: 252 seconds]
nadir has joined #ruby
Devalo has joined #ruby
evidex has quit [Ping timeout: 240 seconds]
hanmac has joined #ruby
mbreedlove has joined #ruby
labaleine has joined #ruby
halfamind has joined #ruby
<apeiros>
wdi14: what gregf_ plays at is that at the moment it can be read as "please do it for me", and that's not what we do. you do the work, and we help when you have questions.
senayar has quit [Remote host closed the connection]
<wdi14>
apeiros: Thanks
senayar has joined #ruby
GodFather has joined #ruby
<wdi14>
apeiros: and gregf_ let me redo my question. Please, anyone here could help me to translate this http://jsbin.com/punasozuti/edit?js,console to Ruby? Thanks
TheWhip has joined #ruby
<wdi14>
apeiros: and gregf_ , sorry
lewis1711 has quit [Ping timeout: 260 seconds]
<apeiros>
wdi14: how do you imagine that help works?
chouhoulis has joined #ruby
<wdi14>
Well, idealist the person should ask for help (politely) and receive
<wdi14>
Is that right? for you apeiros
chouhoulis has quit [Remote host closed the connection]
<gregf_>
wdi14: what apeiros said is quite true, but tbh, you can map that 1 - 1 in ruby. remove the 'var' and curly braces '{' , '}'?
TheWhip has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<toretore>
wdi14: your question makes it seem like you have made no effort on your own and are expecting someone to just do the work for you
<wdi14>
toretore:
rodfersou has joined #ruby
<wdi14>
Ok
<gregf_>
also imho its too much logic. all you need is 4 statements of the type 1) "You must travel through " 2) "Change at Union Square." - almost always 3) "Your journey continues through" 4) "n stops in total." 5) ""
<apeiros>
wdi14: ok. not what I meant. yes, we will help you. do you have a specific problem?
Devalo has quit [Ping timeout: 276 seconds]
<gregf_>
anyways, we're not here to write the code for you. you learn it better when you try it yourself. come back here after you've tried something as apeiros has said :)
synthroid has joined #ruby
stannard has joined #ruby
<wdi14>
apeiros: where could I show you my code in Ruby? Gist?
<apeiros>
yes, gist is excellent
<gregf_>
wdi14: write tests as well
GodFather has quit [Remote host closed the connection]
<toretore>
wdi14: what is the purpose of all this?
<flips>
I understand Rails guidelines to be that I should type myhash = {} instead of Hash.new (?) ... But, how would I then type something like: your_hash = Hash.new { |hash, key| hash[key] = Array.new } ?
<apeiros>
wdi14: you have to either run it via `ruby trainSystem.rb` or add a shebang. otherwise your shell thinks it's bash.
<apeiros>
and the error you get is from *bash*, your *shell*. not ruby. which is expected if you try to run ruby code through bash.
<apeiros>
so until you updated your error gist to the proper problem, there's nothing for me to do.
<wdi14>
apeiros: forget about this gist with the error
<wdi14>
apeiros: it's very confusing
<apeiros>
no gist with the full error you get = no help from me.
evidex has joined #ruby
pandaant has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 244 seconds]
<norc>
If a derived class has no initializer, and I add one like this; def initialize(*args); @foobar = 1; super(*args); end -- could this possibly have any side effect that Im not seeing directly?
horaceheaven has joined #ruby
swills has joined #ruby
<norc>
Actually take away the assignment to an instance variable.
<apeiros>
norc: it'll also pass along a block passed to new
<norc>
apeiros: Ahh.
<norc>
That must be it.
Jet4Fire has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 260 seconds]
<apeiros>
and assuming the superclass does not have an initialize method either, you'll probably get an exception from super
<norc>
apeiros: Oh it does. The block was the reason.
<norc>
apeiros: And interesting that just showed me why keyword_super exists.
Zggb has quit [Quit: Connection closed for inactivity]
<norc>
The only way to pass a block along is if you bind it to a proc which is expensive.
<apeiros>
I did?
mtkd has joined #ruby
<norc>
But keyword_super passes the block without procifying it.
<norc>
apeiros: Mm, that would introduce an additional block still, but not as expensive I supose.
<apeiros>
wdi14: and there we are: `NameError: undefined local variable or method `trainLines' for main:Object`
borodin has joined #ruby
<apeiros>
14:13 apeiros: I'll assume it's something along "NameError, no method or variable trainLines"?
nankyokusei has joined #ruby
dionysus69 has quit [Ping timeout: 250 seconds]
<wdi14>
apeiros: Yes, you said that
astrobunny has joined #ruby
<apeiros>
but great that we now got you up to speed with properly reporting a problem.
Zggb has joined #ruby
<apeiros>
rubys variable scoping works differently from javascript
<norc>
apeiros: And you meant super(*args) { |*a| yield(*a) } rather than just keyword_super (which I still hate)
<apeiros>
`def … end` starts a new lexical context. no outer local variable is accessible by it.
<apeiros>
norc: super == super(*args) :)
* norc
passes binding_of_caller to apeiros
dstarh has joined #ruby
<apeiros>
norc: super != super()
<apeiros>
norc: and yes, that's super-quirky ;-)
KINGSABRI_ has joined #ruby
<norc>
apeiros: super == super(*args) { |*a| yield(*a) }
<apeiros>
yepp
<norc>
apeiros: That key difference is what gave me an interesting headache today
<apeiros>
your minimal definition of "do something and don't care about args": def initialize(*); super; end
<norc>
Hehe.
johnmilton has quit [Remote host closed the connection]
<apeiros>
your minimal definition of "do something and don't care about args, but suppress any block passed": def initialize(*args); super(*args, &nil); end
<norc>
Which there was a way to forward the block.
<norc>
*Wish.
<wdi14>
apeiros: so how should I model my code for that?
iamvery_ has joined #ruby
<ytti>
norc, block is just proc, you can forward it as any variable, by reference
<norc>
ytti: block is not proc.
horaceheaven has quit [Quit: horaceheaven]
<norc>
ytti: blocks are not objects, procs are.
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has quit [Ping timeout: 260 seconds]
swills has quit [Ping timeout: 276 seconds]
astrobunny has quit [Ping timeout: 260 seconds]
drewo has joined #ruby
Guest12433 has quit [Ping timeout: 260 seconds]
<apeiros>
seems my message didn't get through the disco
<apeiros>
wdi14: proper: make it a class and assign @trainLines to an instance variable
stannard has quit [Remote host closed the connection]
<apeiros>
quick-shot: make trainLines a constant like this: TrainLines
<apeiros>
norc: yes, would be nice. who knows, maybe ruby optimizes that case if it doesn't see `block` referenced other than as `&block`?
Weavel has joined #ruby
<apeiros>
nobu & co have done more amazing optimizations than that before…
SShrike has joined #ruby
pawnbox has joined #ruby
<norc>
apeiros: From my experience Ruby only does local optimizations, but I haven't looked at the entire compile.c
aagdbl has joined #ruby
<aagdbl>
does anyone know of a migration framework which can be used for non database tasks?
mg^ has joined #ruby
drewo has quit [Ping timeout: 240 seconds]
<p1k>
aagdbl: what are you migrating -- curious
halfamind has joined #ruby
<aagdbl>
chef data bags
SShrike has quit [Client Quit]
<aagdbl>
actually i could use it for quite a few chef operations like uploading cookbooks, databags, etc
<p1k>
like a migrationframeworkfactoryframework ?
jancel has quit [Remote host closed the connection]
<aagdbl>
i have no clue what that means :)
<norc>
apeiros: Come to think of it the best way is actually: def initialize(*args); super(*args, &Proc.new); end
<norc>
apeiros: At least that won't create a new proc unconditionally.
<apeiros>
but it'll add a method call overhead
<apeiros>
and a constant lookup
<aagdbl>
just something that creates unique migration, maybe stores the info locally in a yaml or something that is commited. and gives me up and down methods
<norc>
apeiros: The method will be called regardless if you bind it using &foo
pawnbox has quit [Ping timeout: 276 seconds]
<norc>
(Don't think that bit can be made visible in assembly though)
<apeiros>
I mean the ".new" call
<p1k>
aagdbl: I think that shouldn't be hard to write yourself -- but I don't know of an abstract one
skweek has joined #ruby
papachan has joined #ruby
blackgoat has quit [Quit: WeeChat 1.4]
cultureulterior1 has left #ruby ["Leaving"]
<apeiros>
btw., &proc works too. shorter than &Proc.new (and maybe a const lookup less)
<norc>
apeiros: I was wrong. How is this proc object being created o_o
<apeiros>
I don't know the inner workings. but proc/Proc.new invoked without a block will use the block of the caller's scope
<p1k>
aagdbl: I've done schema where I couldn't use AR and I found that a module wrapping the versioned class with a method for obtaining / caching the correct version from the database worked well enough
hightower2 has quit [Ping timeout: 240 seconds]
<p1k>
but it was a different use case
marr has joined #ruby
<norc>
apeiros: You must pass a block to Proc.new, and indeed I am passing one in the call at the end f {}
ocbtec has joined #ruby
<apeiros>
they'll also complain if the caller's scope doesn't have one
<norc>
But it seems like Ruby creates without Ruby methods.
<norc>
It just pulls one out of its magical hat.
<norc>
So its free, right?
<norc>
:-)
wilsonc91 has joined #ruby
<apeiros>
noooooo idea :D
<apeiros>
I rarely ever look under the hood. I just observe performance metrics. and this is actually one I've never tested.
<norc>
apeiros: There are a few benchmarks around that show that procifying is a lot more expensive.
<apeiros>
norc: you mean `def foo(&block); bar(&block); end` is always more expensive than `def foo; bar(&block); end`?
<apeiros>
whoops
<apeiros>
norc: you mean `def foo(&block); bar(&block); end` is always more expensive than `def foo; bar(&proc); end`?
<norc>
apeiros: def f(&b); b.call; end is more expensive than def f; yield; end
synthroid has quit []
<apeiros>
yes
<norc>
apeiros: And the last statement somewhat yes.
<norc>
apeiros: If the method can be called without a block its cheaper. If not it is the same.
LoneHermit has joined #ruby
<apeiros>
but `def f(&b); @nested.f(&b); end` is less expensive than `def f; @nested.f { |*args| yield(*args) }; end`
<norc>
(Proc.new has that habit of not doing anything if no block is around)
<norc>
apeiros: Are you sure about that?
<apeiros>
yes
<norc>
It just introduces a call overhead over turning a block into a proc.
ramortegui has joined #ruby
araujo_ has joined #ruby
<norc>
And the only cost there is passing arguments.
<apeiros>
though it's a bit dated, might need rechecking. but had a lenghty argument with a rails core dev and they checked and confirmed
ravishankarjha has quit [Read error: Connection reset by peer]
<norc>
(Which since they are basically passed as pointers internally is practically for free)
<norc>
apeiros: Is that possibly from pre 2.0 times?
ravishankarjha has joined #ruby
moeabdol has quit [Ping timeout: 250 seconds]
<apeiros>
might have been 1.9. and I know arg passing has been heavily reworked in both 2.2 and 2.3, so might indeed be high time to recheck that wisdom :)
Madplatypus has quit [Quit: Connection closed for inactivity]
<norc>
apeiros: Ill check into that.
araujo_ has quit [Max SendQ exceeded]
iooner has left #ruby ["Bye!"]
<apeiros>
iirc it was both faster and less gc stress
akiTendo has joined #ruby
araujo_ has joined #ruby
araujo has quit [Ping timeout: 252 seconds]
araujo__ has joined #ruby
LoneHermit has quit [Ping timeout: 260 seconds]
brunto has quit [Ping timeout: 240 seconds]
ftnsdf has joined #ruby
araujo_ has quit [Ping timeout: 252 seconds]
johnmilton has joined #ruby
gheegh has joined #ruby
iamvery_ has quit [Quit: Leaving...]
blackmesa has quit [Ping timeout: 260 seconds]
dubin has joined #ruby
perlgod has joined #ruby
youch has quit [Ping timeout: 244 seconds]
moeabdol has joined #ruby
<dubin>
Is there a version of Ruby that can be used to script on a windows server?
<manveru>
not sure if it's 2.2 or 2.3, but the ruby i have to make this work with is 2.1 anyway
<heftig>
manveru: eh, just use +
<manveru>
yeah :)
griffindy has joined #ruby
jancel has joined #ruby
[ace] has quit [Ping timeout: 244 seconds]
solars has quit [Ping timeout: 260 seconds]
jancel has quit [Remote host closed the connection]
jancel has joined #ruby
duoi has quit [Ping timeout: 260 seconds]
johnmilton has joined #ruby
Rickmast_ has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Remote host closed the connection]
astrobunny has quit [Ping timeout: 244 seconds]
astrobunny has joined #ruby
Dysp has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
horaceheaven has joined #ruby
Rickmasta has joined #ruby
idefine has joined #ruby
johnmilton has quit [Remote host closed the connection]
rodfersou|afk has quit [Ping timeout: 260 seconds]
johnmilton has joined #ruby
idefine has quit [Remote host closed the connection]
lxsameer has quit [Quit: WeeChat 1.5]
duoi has joined #ruby
idefine has joined #ruby
rodfersou|afk has joined #ruby
[ace] has joined #ruby
allcentury has joined #ruby
<Dysp>
Hi there! When I return an object from a function, how are they defined? Are they not defined at all and should be manually assigned to a variable I can then pass on to another function/whatever?
OTORelic has joined #ruby
riobe has quit [Ping timeout: 244 seconds]
<benzrf>
Dysp: what do you mean?
<Dysp>
If I have a function that returns x, how do I - outside that function - address this object?
<benzrf>
uh oh
<benzrf>
Dysp: do you have a C background?
<Dysp>
I could of course do x = function
<Dysp>
Nothing. Complete newb.
<benzrf>
oh, hold on
<benzrf>
are you english as a second language, then?
<benzrf>
sorry, just reacting to the word 'address' :p
<Dysp>
HAh, yes. I think people are getting to know me a little too well in here ^^
<benzrf>
its usage there struck me as either C-user or person-who-doesn't-natively-speak-english
blackmesa has joined #ruby
idefine has quit [Ping timeout: 260 seconds]
<Dysp>
Lets go with number two!
<benzrf>
not to say that it's not comprehensible - just a little bit unusual :)
<benzrf>
when you return a value from a function, the only thing that happens is that the function call expression evaluates to that value
asfasdf has joined #ruby
<Dysp>
Indeed. So how to pass on the entire object?
<Dysp>
I am working with arrays, to be exact.
<benzrf>
in ruby, 'value' is synonymous with 'object'
<benzrf>
if you want to result in some object, just return that object
<Dysp>
Alrighty.. Thats kinda what I thought, actually.
codecop has quit [Remote host closed the connection]
<Dysp>
So, without assigning the object to a variable, how can I use it?
<Dysp>
Also, what happens if I return several objects?
<benzrf>
'return several objects'?
<benzrf>
you can only return one object
<Dysp>
return x, y, z
<benzrf>
that returns an array
<Dysp>
I see.
<benzrf>
it's just shorthand for "return [x, y, z]"
<Dysp>
So what I am doing is getting return [[..], [..], [..]]
<benzrf>
ok
<benzrf>
so then if i say your_func(), that expression will evaluate to that array
pawnbox has joined #ruby
m_antis has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
rbennacer has joined #ruby
idefine has joined #ruby
rbennacer has quit [Remote host closed the connection]
WebDevB has quit [Remote host closed the connection]
ixti has quit [Quit: WeeChat 1.5]
rbennacer has joined #ruby
mbreedlove has quit [Ping timeout: 240 seconds]
<Dysp>
benzrf: Which mean I would have to assign the individual arrays in the array to variables, before I can pass them on to a new function?
astrobunny has quit [Remote host closed the connection]
eljimmy has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
Devalo has joined #ruby
LoneHerm_ has joined #ruby
araujo has quit [Max SendQ exceeded]
<benzrf>
Dysp: not necessarily
araujo has joined #ruby
<Dysp>
No?
<benzrf>
you can put any expression you want as a function argument
evidex has quit [Ping timeout: 240 seconds]
araujo has quit [Read error: Connection reset by peer]
<benzrf>
doesn't have to be a variable
<Dysp>
In my case I think it has to
<Dysp>
:PÆ
pawnbox has quit [Ping timeout: 252 seconds]
<Dysp>
But you have clarified some stuff for me, so I can work around it, that is for sure. So thank you.
moeabdol has quit [Ping timeout: 276 seconds]
duoi has quit [Ping timeout: 260 seconds]
mbreedlove has joined #ruby
startupality has quit [Quit: startupality]
ChiefAlexander has quit [Remote host closed the connection]
evidex has joined #ruby
rbennacer has quit [Ping timeout: 250 seconds]
Devalo has quit [Ping timeout: 250 seconds]
bweston92 has joined #ruby
flughafen_ has joined #ruby
<apeiros>
Dysp: `foo(bar())` - takes directly the return value from bar() as argument - no intermediary variable necessary
<apeiros>
Dysp: `foo().bar()` - directly call bar on the return value from foo - no intermediary variable necessary
LoneHerm_ has quit [Ping timeout: 276 seconds]
duoi has joined #ruby
hobodave has joined #ruby
rbennacer has joined #ruby
<Dysp>
Yes. I get that. My problem is the way I am trying to build the script; if I did that, I would have to call the function several times instead of once.
hutch34 has quit [Quit: WeeChat 1.5]
<Dysp>
But it definetly has something to do with me not correctly understanding how to optimize code. But I am learning. I've already made the script work as it should once; I am doing my first rewrite. :p
ixti has joined #ruby
haxrbyte has quit [Remote host closed the connection]
<apeiros>
haxrbyte has joined #ruby
ftj has joined #ruby
hutch34 has joined #ruby
jackdaniel has quit [Quit: Lost terminal]
ChiefAlexander has joined #ruby
kareeoleez has quit [Remote host closed the connection]
nando293921 has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rkazak has joined #ruby
SilverKey has joined #ruby
skweek has quit [Ping timeout: 250 seconds]
bmurt has joined #ruby
dumdedum is now known as blaxter
<apeiros>
it'd have been really swelte if foo(**nil) would work :-/
nando293921 has quit [Ping timeout: 252 seconds]
shlomo has quit [Quit: WeeChat 1.5]
flughafen_ has quit [Ping timeout: 276 seconds]
skade has quit [Quit: Computer has gone to sleep.]
jfabre has joined #ruby
statelesscode has quit [Ping timeout: 260 seconds]
skade has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 244 seconds]
agent_white has joined #ruby
VeryBewitching has joined #ruby
jfabre_ has joined #ruby
jfabre has quit [Client Quit]
jfabre_ is now known as jfabre
jfabre has quit [Client Quit]
drewo has joined #ruby
ule is now known as jsp
jsp has quit [Changing host]
jsp has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<agent_white>
Mornin'
pat__ has quit [Ping timeout: 276 seconds]
edwinvdgraaf has joined #ruby
maxxe has joined #ruby
arlek has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
drewo has quit [Ping timeout: 240 seconds]
ChiefAlexander has joined #ruby
synthroid has joined #ruby
Snowy has joined #ruby
cdg has joined #ruby
`tim` has joined #ruby
nankyokusei has joined #ruby
mtkd has quit [Ping timeout: 244 seconds]
aufi has joined #ruby
mtkd has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
Zggb has quit [Quit: Connection closed for inactivity]
skweek has joined #ruby
Zamyatin has joined #ruby
SilverKey has quit [Quit: Halted.]
maxxe has quit [Quit: leaving]
Zamyatin has quit [Max SendQ exceeded]
Zamyatin has joined #ruby
noService has quit [Ping timeout: 252 seconds]
ta_ has quit [Read error: Connection reset by peer]
MadWasp has joined #ruby
ta_ has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
<MadWasp>
hi, is there any documentation on how a gem server works internally? like an api you’d have to provide when writing your own server
<zacts>
I'm going to be making a simple Sinatra web server today
<gregf_>
er, server or app :)
dsea has quit [Quit: Leaving]
dsea has joined #ruby
kareeoleez has quit [Remote host closed the connection]
purrkode has joined #ruby
kareeoleez has joined #ruby
kareeoleez has quit [Remote host closed the connection]
dsea has quit [Changing host]
dsea has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
amclain has joined #ruby
karmatr0n has quit [Ping timeout: 246 seconds]
pawnbox has joined #ruby
OTORelic has quit [Quit: WeeChat 1.4]
bluOxigen has quit [Read error: Connection reset by peer]
araujo has joined #ruby
araujo has joined #ruby
bluOxigen has joined #ruby
whathappens has joined #ruby
drewo has joined #ruby
noobsu has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kareeoleez has joined #ruby
norc has joined #ruby
riobe_ has joined #ruby
<norc>
There was a module/class that had constants for the C sizeof of various internal types. Can someone give me a pointer at what Im looking for?
<zacts>
gregf_: oops s/server/app/
diegoaguilar has joined #ruby
<norc>
Ah. They are in Fiddle after all. Must have looked at the wrong page.
startupality has quit [Quit: startupality]
perlgod_ has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
aegis3121 has quit [Ping timeout: 252 seconds]
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
kareeoleez has quit [Ping timeout: 260 seconds]
riobe has quit [Ping timeout: 240 seconds]
moeabdol has joined #ruby
diegoaguilar has joined #ruby
synthroid has joined #ruby
startupality has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
wrkrcoop has joined #ruby
<wrkrcoop>
how can i get my json objects printed in my console in a readable way?
diegoaguilar has joined #ruby
<apeiros>
?jsonobject
<ruby[bot]>
there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
perlgod has quit [Ping timeout: 276 seconds]
<apeiros>
@ wrkrcoop ^
stunder001 has joined #ruby
morenoh149 has joined #ruby
senayar has quit []
<wrkrcoop>
apeiros: can u repeat that i cleared the chat room
<manveru>
that one is fun too, if you want to output pretty json
<manveru>
i still have no clue why they chose such a weird name though
dionysus69 has joined #ruby
<wrkrcoop>
soo pp comes with standard library?
<manveru>
yeah
<manveru>
stdlib is full of fun and scary things
hutch34 has joined #ruby
<wrkrcoop>
so require ‘pp’ then pp(obj)?
Gasher has quit [Ping timeout: 260 seconds]
<wrkrcoop>
so easy
howdoi has joined #ruby
<manveru>
do you know about irb?
Devalo has quit [Ping timeout: 276 seconds]
norc has quit [Ping timeout: 250 seconds]
<jhass>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<manveru>
yeah, but pry is not in stdlib
<manveru>
you can pry irb from my dead cold hands :P
DynamicM` has joined #ruby
CJKinni has joined #ruby
DynamicMetaFlow has quit [Remote host closed the connection]
perlgod_ is now known as perlgod
jsp is now known as ule
ule has quit [Changing host]
ule has joined #ruby
KINGSABRI_ has quit [Quit: No Ping reply in 180 seconds.]
nettoweb has joined #ruby
KINGSABRI_ has joined #ruby
kareeoleez has joined #ruby
Zamyatin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
manveru: no worries. you can keep it ;-p
<manveru>
:D
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
pry > irb by a landslide.
perlgod has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jgt3 has quit [Ping timeout: 252 seconds]
mistermocha has joined #ruby
ChiefAlexander has quit [Read error: Connection reset by peer]
riobe_ has quit [Ping timeout: 250 seconds]
karmatr0n has quit [Remote host closed the connection]
kareeoleez has quit [Ping timeout: 276 seconds]
horaceheaven has quit [Quit: horaceheaven]
riobe_ has joined #ruby
labaleine has joined #ruby
ChiefAlexander has joined #ruby
moeabdol has quit [Quit: WeeChat 1.4]
<tubbo>
irb is still useful to learn
<tubbo>
in cases where pry is not an option
astrobunny has joined #ruby
saneax_AFK is now known as saneax
thirax has left #ruby ["Leaving"]
<labaleine>
Hello ! I want to delete a task from an array which is quite easy arr.delete(x). But it is actually not working in my code. The only way I find is to put an index to my array and then use delete_at. But I don't want this.
horaceheaven has joined #ruby
<toretore>
?code labaleine
<ruby[bot]>
labaleine: We can't help you without your code, please post it to https://gist.github.com
<labaleine>
I specifically want the user to type exactly what needs to be deleted
rbennacer has quit [Remote host closed the connection]
xue has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
drewo has joined #ruby
ChiefAlexander has joined #ruby
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
codecop has joined #ruby
<jhass>
can we throw repl.it into the trashcan already?
saneax is now known as saneax_AFK
Ch4rAss has quit [Ping timeout: 240 seconds]
malconis has joined #ruby
noService has quit [Ping timeout: 276 seconds]
chopin_ has quit []
<ullu>
I find this curious: h = Hash.new([]); h[:one] << "foo"; h[:two] << "bar" # => ["foo","bar"]
<ullu>
h.class # => Hash
codecop has quit [Remote host closed the connection]
<ullu>
what happened to the keys?
<jhass>
ullu: Hash doesn't clone #default, it just assigns the same object
<ullu>
or is the array the key?
kareeoleez has joined #ruby
<norc>
ullu, it becomes more obvious this way:
emilkarl is now known as emilkarl[away]
skolman_ has joined #ruby
riobe_ has quit [Remote host closed the connection]
riobe_ has joined #ruby
emilkarl[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<aegis3121>
The key :one doesnt exist, so it pulls up its default and pushes that in there. The key :two doesn't exist so it pulls up its default (the same Array) and pushes them into there. None of these are assignments, so it's never assigned.
<ullu>
jhass: so the key refs are essentially ignored/absorbed?
riobe_ has quit [Remote host closed the connection]
mog has left #ruby ["Leaving"]
<jhass>
no, I'm not sure what you're going at with the keys
<norc>
>> ary = []; h = Hash.new(ary); h[:one] << "foo"; h[:two] << "bar"; p ary # ullu
<jhass>
ullu: ^ Hash.new's first argument is simply setting #default
<jhass>
#default's value is returned for missing keys
<jhass>
norc: crashes ruby if you try to access an instance var the other doesn't have, right?
* ullu
schooled on hashes
<norc>
jhass, nope. Instance variables will return nil if not defined.
<norc>
jhass, but if the classes are not compatible this will very quickly crash you are correct.
<ullu>
jhass: yes, I was aware of the default arg, but the behavior threw me -- thanks to y'all for clarifying
nareiber has quit [Ping timeout: 250 seconds]
tatsuo has quit [Remote host closed the connection]
mozzarella has quit [Ping timeout: 246 seconds]
kareeoleez has joined #ruby
last_staff has joined #ruby
<norc>
jhass, though the more I think about it, I cannot see a reason this should ever crash.
mtkd has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
v0dro has joined #ruby
riobe_ has quit [Ping timeout: 244 seconds]
<norc>
All the rbasic klass is used for is method dispatch, and some interrogation like #ancestors.
mtkd has joined #ruby
<norc>
It will probably cause problems if your class has its own allocator though.
Symbiosisz has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 244 seconds]
mozzarella has joined #ruby
Symbiosisz has joined #ruby
<ullu>
norc: your example above prints [] (empty array) -- now I'm confused again, is the default val not getting populated because no key assignments have been made?
mog has joined #ruby
riobe_ has joined #ruby
<mog>
how do i point bundle to my rubygems dir properly?
kareeoleez has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
<mog>
it keeps trying to find gems in my system dir
<mog>
but not where it actually installed them
<norc>
ullu, check your code. You didnt paste it right if you got an empty array.
dionysus69 has joined #ruby
ruby-lang745 has joined #ruby
<norc>
>> ary = []; h = Hash.new(ary); h[:one] << "foo"; h[:two] << "bar"; p ary # ullu
skade has quit [Quit: Computer has gone to sleep.]
<norc>
If I take over this job, do you think apeiros will pay me?
<eam>
I'll pay attention, how about that
hahuang65 has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
manveru: coloration, completion, $ and ? like apeiros said, ls, and binding.pry invocation
tatsuo has quit [Remote host closed the connection]
<eam>
+@ and -@ are super dangerous, I think, considering the unreliable behavior of them being parsed as methods
m_antis has joined #ruby
<eam>
a non issue if you don't touch 'em I mean, but if you do ...
skade has joined #ruby
<norc>
It immediately became clear they could be abused to a great extend to write obfuscated code.
saush has joined #ruby
rbennacer has joined #ruby
skade has quit [Client Quit]
meatchicken has joined #ruby
allcentury has quit [Quit: WeeChat 1.2]
karmatr0n has joined #ruby
<saush>
I followed ruby repo on github and wanted to know how is a new version released? As in, whenever someone contributes it goes on the truck branch now. So what happens when a new version has to be released?
<apeiros>
meeh, bot
<apeiros>
I ducked something up in the user & channel manager. after a while its track of the users starts to become incorrect
<eam>
ruby is authoritatively developed out of a subversion repo, but the info is mirrored over to github
kareeoleez has joined #ruby
<eam>
there are release tags in most SCM systems
<eam>
afaik the ruby on github uses trunk instead of master because of svn
nofxx has quit [Ping timeout: 260 seconds]
Masonn has quit [Ping timeout: 250 seconds]
symm- has joined #ruby
nofxx has joined #ruby
ramfjord has joined #ruby
kareeoleez has quit [Ping timeout: 244 seconds]
aupadhye has quit [Quit: Leaving]
drewo has quit [Ping timeout: 240 seconds]
v0dro has quit [Ping timeout: 260 seconds]
<saush>
eam: I see that that there are branches made such as ruby_2_2, ruby_2_3 etc. So at the time of release all the commits from trunk have to be merged with this branches. Is this the way it is?
<mog>
rake cant seem to find my gems LoadError: cannot load such file -- google/api_client
<mog>
even though it was running from within my gems /home/mog/rubygems/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
<eam>
saush: usually the way to reason about it is tagging a particular point on trunk
<jhass>
mog: it sounds like you're reinventing chruby/rvm/rbenv
trav408 has joined #ruby
<jhass>
or chgems at least
<mog>
i dont have root on this box so i set the gems dir to my home dir
<mog>
but it doesnt seem like its looking correctly when rake is run
jackjackdripper has joined #ruby
startupality has quit [Quit: startupality]
giz|work has joined #ruby
<mog>
my gem env looks right too
drewo has joined #ruby
<jhass>
mog: might be easier to just bundle install --path vendor/bundle and bundle exec everything
purrkode has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sumobob has quit [Quit: WeeChat 1.3]
ramfjord has joined #ruby
skolman_ has quit [Remote host closed the connection]
sumobob has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skolman_ has joined #ruby
morenoh149 has joined #ruby
mdw has quit [Quit: Sleeping Zzzzz]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
symm- has quit [Ping timeout: 260 seconds]
banister has joined #ruby
moeabdol has quit [Read error: Connection reset by peer]
moeabdol has joined #ruby
stunder001 has joined #ruby
banister has quit [Client Quit]
skolman_ has quit [Ping timeout: 240 seconds]
cdg has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
djbkd has quit [Remote host closed the connection]
rbennacer has quit [Remote host closed the connection]
saush has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
beauby has quit [Ping timeout: 276 seconds]
skalfyfan has joined #ruby
djbkd has joined #ruby
<shevy>
do you people write a lot of boilerplate for your classes? or are you classes minimalistic
aegis3121 has quit [Ping timeout: 252 seconds]
zast has quit [Remote host closed the connection]
<Zarthus>
i write far too much and complete far too little
m_antis has quit [Remote host closed the connection]
<Zarthus>
i divide my classes like I'm writing java, not ruby.
<Zarthus>
¯\_(ツ)_/¯
chosen1 has joined #ruby
kareeoleez has joined #ruby
purrkode has joined #ruby
halfamind has quit [Quit: Leaving.]
<nofxx>
Zarthus, I often don't believe it's working... so few lines =D
<shevy>
Zarthus yeah I am noticing that in my classes too
aegis3121 has joined #ruby
<shevy>
not just the code itself though, also more and more comments and structures within the comments
<nofxx>
then, "exceptions" make it ugly... haha noticed? 80% of the code for 5% of the problem? only the exception
<nofxx>
yeah, worst than paretto
<Zarthus>
I do a lot of comments when they're necessary
B1n4r10 has joined #ruby
<Zarthus>
but if my class is about keeping a list of potatoes on Jerries farm, just a class named PotatoList should give a sufficient description of what it is
yfeldblum has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
<nofxx>
use rubocop/lint integrated on your editor, I'm coding way better with yellow/red arrows next to the line number
finisherr has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
<Zarthus>
the rubocop intelij plugin doesn't work on windows
<nofxx>
emacs ftw
<norc>
Zarthus, so you try to adhere to the Law of Demeter? Java strongly encourages Wrapper classes ontop of Factories ontop of Wrappers classes to its extremes...
finisherr has quit [Client Quit]
<Zarthus>
nah, not that much
finisherr has joined #ruby
rbennacer has joined #ruby
mistermocha has joined #ruby
roshanavand_ has quit [Quit: This computer has gone to sleep]
jackjackdripper has quit [Ping timeout: 260 seconds]
saneax is now known as saneax_AFK
nankyokusei has quit [Ping timeout: 244 seconds]
tildes_ has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
halfamind has joined #ruby
Masonn has joined #ruby
symm- has joined #ruby
sergey_makagon has quit []
AndroidLoverInSF has quit [Quit: Leaving]
mozzarel1 is now known as mozzarella
banister has joined #ruby
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wrkrcoop has joined #ruby
banister has quit [Client Quit]
diegoaguilar has quit [Remote host closed the connection]
skade has joined #ruby
banister has joined #ruby
weaksauce has joined #ruby
bluOxigen has quit [Ping timeout: 260 seconds]
startupality has quit [Quit: startupality]
bluOxigen has joined #ruby
dionysus69 has quit [Ping timeout: 250 seconds]
geekbri has joined #ruby
nofacade has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
Regulati_ has joined #ruby
hightower2 has joined #ruby
ramfjord has joined #ruby
johnathon has joined #ruby
minimalism has joined #ruby
maucar has joined #ruby
johnathon is now known as disconnekted
RegulationD has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby
tildes_ has quit [Ping timeout: 244 seconds]
asher128__ has joined #ruby
<asher128__>
Hi I'm a beginner. Can you please tell me what the unless does here: has_command(:puppet, puppet_path) unless puppet_path.nil?
<asher128__>
I need to adapt it and use if instead of unless
<asher128__>
Thank youi
ta__ has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
CloCkWeRX has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
<weaksauce>
it runs that line unless the puppet_path variable is nil.
<Zarthus>
asher128__: unless is a negation. It means 'if !puppet_path.nil?'
<Zarthus>
converting it to use an if is redundant
<asher128__>
weaksauce, ok, i'll use if !puppet_path.nil?
dionysus69 has quit [Ping timeout: 260 seconds]
<asher128__>
weaksauce, zenguy_pc thank you guys
<Zarthus>
why the arbitrary change?
<shevy>
asher128__ if puppet_path
<asher128__>
shevy, yeah it is simpler :)
<asher128__>
weaksauce, zenguy_pc, shevy, Zarthus: I'm a Python programmer and I'm thinking about learning ruby. What are, for you guys, the advantages of Ruby over Python?
<weaksauce>
insignificant whitespace
<shevy>
I found that my brain needs a bit longer for "unless" statements... my brain works faster with "if"
xall has joined #ruby
<asher128__>
shevy, you are not the only one :)
<weaksauce>
sane package manager
<shevy>
asher128__ you can model ruby how you think
<asher128__>
shevy, is it because there is not 1 way to do something? you are free to do things as you want?
<shevy>
the whole rails ecosystem sorta is like that - a way to think
duoi has quit [Ping timeout: 260 seconds]
<shevy>
nah
<shevy>
perl has the same philosophy but I always found it to get into my way
<shevy>
I even kept on stumbling over forgetting to use a ";" as line terminator every now and then
<weaksauce>
asher128__ everything is an object and you can metaprogram things to do what you want (to your own downfall sometimes)
<asher128__>
weaksauce, everything is an object on Python too
d0nn1e has quit [Ping timeout: 244 seconds]
<asher128__>
weaksauce, what I want to know is what is the big advantage of ruby
<jhass>
wrkrcoop: use .select because it reads a lot better
<wrkrcoop>
jhass: is .each not better than .select / reduce?
<jhass>
?better
<ruby[bot]>
"Best" and "better" are subjective. Try to use a different term.
<wrkrcoop>
jhass: so reduce select have no benefits over each?
<jhass>
they do quite different stuff
<jhass>
almost incomparable I'd say
<jhass>
for "filtering an array" select/reject are the best because they require the least boilerplate code and read thus a lot better
Snowy has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wrkrcoop>
jhass: got it
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nareiber has joined #ruby
tfitts has quit [Quit: Connection closed for inactivity]
skade has quit [Quit: Computer has gone to sleep.]
wrkrcoop has quit [Quit: wrkrcoop]
noService has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
curses has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
brunto has joined #ruby
ma489 has joined #ruby
blackmesa has joined #ruby
Weavel has quit [Quit: There's nothing dirtier than a giant ball of oil]
<weaksauce>
asher128__ the best reason to use ruby is because exit works and doesn't give you a snarky response
brunto has quit [Read error: Connection reset by peer]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
tildes_ has quit [Ping timeout: 276 seconds]
ctp has joined #ruby
hutch34 has joined #ruby
Devalo has quit [Remote host closed the connection]
brunto has joined #ruby
brunto has quit [Read error: Connection reset by peer]
skolman_ has joined #ruby
PedramT has quit [Remote host closed the connection]
Devalo has joined #ruby
ta__ has quit [Remote host closed the connection]
whathappens has quit [Remote host closed the connection]
jhack has quit [Quit: jhack]
yfeldblum has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
Yxhuvud has quit [Remote host closed the connection]
dopie has joined #ruby
johnny56_ has joined #ruby
dopie has quit [Client Quit]
stunder001 has joined #ruby
harrymoreno has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
Snowy has quit [Remote host closed the connection]
noobsu has joined #ruby
morenoh149 has quit [Ping timeout: 246 seconds]
s1kx has joined #ruby
impi0us has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
impi0us has left #ruby [#ruby]
flashpoint9 has joined #ruby
harrymoreno is now known as morenoh149
flashpoint9 has quit [Read error: Connection reset by peer]
Asher has joined #ruby
flashpoint9 has joined #ruby
blackthor has joined #ruby
maucar has quit [Quit: Leaving]
<zacts>
shevy: this opal looks cool for Ruby -> JavaScript
ur5us has joined #ruby
<zacts>
I might try to make some Atom editor plugins with Opal
<tgeeky>
hmm... I must be missing something. How does one load a .rb file into IRB (or pry, in this case), and keep the context of the file in the interactive sesions?
<tgeeky>
session*
<tgeeky>
it loads the file fine (with require, or -r), runs whatever is in the file, then forgets the context and gives me a blank pry shell
<zacts>
I do bash-$ irb -I .
<zacts>
and then
<jhass>
tgeeky: better to turn it around, add require "pry"; binding.pry to the file and run the file
<zacts>
irb-$ require 'file-without-rb-extension'
<zacts>
(perhaps my way isn't the best)
<jhass>
zacts: -r does basically that ;)
<zacts>
ah cool
<zacts>
:-)
geekbri has quit []
<jhass>
won't let you access local variables from the file, which I gather they want
ta_ has joined #ruby
<tgeeky>
yeah
<tgeeky>
i need to inspect them
nando293921 has joined #ruby
<tgeeky>
ah, so binding.pry is basically a breakpoint
<jhass>
yeah
<tgeeky>
roger. thanks jhass!
<tgeeky>
jhass: out of curiosity, why does the alternate method not show the local context?
<tgeeky>
I guess in libraries without any state, it doens't make sense to
purrkode has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
because local variables at the top level are file local
<jhass>
your irb/pry session is basically a new "file"
<tgeeky>
jhass: any plugins to make this process killer, or at least better?
<jhass>
(unless specially invoked in the context of one, which binding.pry does, Binding describes a scope)
<jhass>
tgeeky: I like pry-byebug, pry-rescue, pry-doc and pry-stack_explorer for my debugger pry
nettoweb has joined #ruby
weemsledeux has joined #ruby
Snowy has joined #ruby
xall has quit [Ping timeout: 252 seconds]
nankyokusei has joined #ruby
shinnya has quit [Ping timeout: 276 seconds]
<tgeeky>
jhass: thanks again. I got them all plus pry-nav.
<jhass>
looks like pry-nav recommends to use pry-byebug instead ;)
<tgeeky>
oh. yes. pry-nav is old
<tgeeky>
it failed lol
duoi has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
wrkrcoop has joined #ruby
yqt has joined #ruby
xall has joined #ruby
jancel has joined #ruby
labaleine has joined #ruby
duoi has joined #ruby
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
danostrowski has joined #ruby
Yxhuvud has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
mdw has joined #ruby
purrkode has joined #ruby
minimalism has quit [Quit: minimalism]
cdg has joined #ruby
skolman__ has joined #ruby
skolman_ has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banister has joined #ruby
chris2 has quit [Ping timeout: 260 seconds]
astrobunny has quit [Ping timeout: 276 seconds]
jhack has joined #ruby
ta_ has quit [Remote host closed the connection]
labaleine has quit [Read error: Connection reset by peer]
jhack has quit [Ping timeout: 240 seconds]
swills has quit [Ping timeout: 260 seconds]
dopie has joined #ruby
sneakerhax has joined #ruby
idefine has quit [Remote host closed the connection]
opus_ has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
mynameisbrian has joined #ruby
<mynameisbrian>
self.each { |current_num| result = yield(result, current_num) }
<mynameisbrian>
is there a better way to write that? I don't want each's return value, I want result
karmatr0n has quit [Ping timeout: 260 seconds]
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mynameisbrian>
so if I write a method, I would have to put result after each
SilverKey has quit [Quit: Halted.]
<Papierkorb>
mynameisbrian: what is that method supposed to really do?
drewo has quit [Ping timeout: 276 seconds]
<mynameisbrian>
It's inject()
<mynameisbrian>
I'm rewriting it just to learn how to do it
nando293921 has quit [Ping timeout: 240 seconds]
SilverKey has joined #ruby
synthroid has quit []
<Papierkorb>
mynameisbrian: in that case, looks fine to me. It's a three-liner.
<mynameisbrian>
yeah mine only handles arrays, I haven't learned about ranges yet
Snowy has quit [Read error: Connection reset by peer]
Snowy has joined #ruby
bobbycvi has joined #ruby
<mynameisbrian>
well when I added it to Range it still worked for that example
labaleine has joined #ruby
<tgeeky>
jhass: it seems that pry-stack_explorer was causing a warning/error, so I removed the gem (someone claimed that byebug provides identical functionality)
<tgeeky>
jhass: but now, my binding.pry lines are ignored
<tgeeky>
jhass: instead, when pry opens I see a debuger of Pry#evaluate_ruby
<jhass>
:o
<tgeeky>
jhass: not actually ignored; if I remove all binding.pry statements, then it just runs cleanly (no output)
<tgeeky>
any suggestions? :O
<Papierkorb>
mynameisbrian: add it to module Enumerable instead :P
Don_John has joined #ruby
Don_John has quit [Remote host closed the connection]
<jhass>
tgeeky: haven't seen that before, sorry :(
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kaleido has joined #ruby
banister has joined #ruby
<mynameisbrian>
yeah I'll try that
<mynameisbrian>
do people commonly use loop?
<mynameisbrian>
loop do and so on
<Papierkorb>
mynameisbrian: I don't need an infinite that often, no. (But when you do, ...)
<Papierkorb>
*infinite loop
mistermocha has quit [Remote host closed the connection]
riobe__ has joined #ruby
jhack has joined #ruby
<mynameisbrian>
I see, thanks for all the info Papierkorb
riobe__ has quit [Remote host closed the connection]
mistermocha has joined #ruby
<mynameisbrian>
I need to find another learning resource. I'm using Perl Monk, when I'm finished, I'll read a book or something
<mynameisbrian>
I'm only on the beginnner of Perl Monk right now though
<Papierkorb>
mynameisbrian: Begin building something cool and then learn on the way what you're missing
<mynameisbrian>
yeah I have some project ideas
<Papierkorb>
mynameisbrian: you already understood enumerables and stuff, IMO you're wasting your time by continuing on writing micro 'projects'
riobe_ has quit [Ping timeout: 260 seconds]
<hightower2>
Hey, how can I place a bunch of text as "DATA" section at the end of a Ruby script? (I'm looking for an equivalent of Perl's __DATA__ and <DATA>)
blackgoat has joined #ruby
dopie has quit [Ping timeout: 260 seconds]
<mynameisbrian>
well that's what I mean, I have ideas of things I'm going to build
<lewis1711>
if I have an array "xs", how to get an enumerator starting at a particular index in the array?
firstdayonthejob has joined #ruby
A124 has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<lewis1711>
oh nm, xs[index..-1].to_enum
<kyle__>
Can you have a class methind something like def keys<<(newkey)
ChiefAlexander has joined #ruby
* kyle__
could have sworn there were a way of doing that, but can't make it work atm.
bollullera has joined #ruby
johnmilton has joined #ruby
beauby has joined #ruby
akiTendo has joined #ruby
Es0teric has joined #ruby
noobsu has quit [Read error: Connection reset by peer]
Masonn has quit [Ping timeout: 244 seconds]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
e4xit has quit [Quit: Right I'm out!]
ctp has joined #ruby
johnmilton has quit [Remote host closed the connection]
minimalism has joined #ruby
bollullera has left #ruby [#ruby]
johnmilton has joined #ruby
e4xit has joined #ruby
<jhass>
kyle__: in a.b << c the method b is called on a with no arguments and then the method << is called on the return value of b with the argument c
nanoz has quit [Ping timeout: 276 seconds]
sepp2k has quit [Quit: Leaving.]
sphex has quit [Remote host closed the connection]
tfitts has joined #ruby
<kyle__>
jhass: So in that case b would have to be it's own class?
<kyle__>
Ahh.
pawnbox has joined #ruby
moeabdol has joined #ruby
<jhass>
kyle__: you could in fact rewrite the expression to a.b.<<(c), still valid ruby
<kyle__>
Yeah, but it's not what I was intending. Also explains why what I was doing wasn't working. I'll use the word 'append' instead of << instead. Easy enough.
johnmilton has quit [Ping timeout: 260 seconds]
rbennacer has quit [Ping timeout: 244 seconds]
pawnbox has quit [Ping timeout: 252 seconds]
arlek has quit [Ping timeout: 240 seconds]
akiTendo has quit [Quit: akiTendo]
hutch34 has quit [Quit: WeeChat 1.5]
sphex has joined #ruby
eljimmy has joined #ruby
moeabdol has quit [Ping timeout: 276 seconds]
hobodave has quit [Ping timeout: 240 seconds]
nwhirschfeld has quit [Ping timeout: 240 seconds]
aegis3121 has quit [Ping timeout: 260 seconds]
jancel has joined #ruby
halfamind has quit [Quit: Leaving.]
chouhoul_ has joined #ruby
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
horaceheaven has quit [Quit: horaceheaven]
jancel has quit [Ping timeout: 260 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
XxJMGxX has joined #ruby
curses has quit [Remote host closed the connection]
skolman__ has quit [Remote host closed the connection]
skolman_ has joined #ruby
dopie has joined #ruby
crystal77 has joined #ruby
johnmilton has joined #ruby
skalfyfan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
purrist has joined #ruby
Zamyatin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
purrist has quit [Remote host closed the connection]
greg has joined #ruby
skalfyfan has joined #ruby
greg has quit [Remote host closed the connection]
RegulationD has joined #ruby
tax has joined #ruby
Oclair has joined #ruby
skolman_ has quit [Ping timeout: 252 seconds]
pawnbox has joined #ruby
Regulati_ has quit [Ping timeout: 250 seconds]
aghalarp has joined #ruby
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
skalfyfan has quit [Ping timeout: 240 seconds]
astrobunny has joined #ruby
skylerto has joined #ruby
<aghalarp>
Newbie question: Am I supposed to update Ruby and RubyGems separately? Or are the two things the same? Rubygems is part of Ruby? So if I update Ruby, I'll have also updated Rubygems?
wilbert has quit [Ping timeout: 260 seconds]
<skylerto>
uh, afaik you don't ever update Rubygems specifically.
astrobunny has quit [Read error: Connection reset by peer]
<skylerto>
You can update your copy of gems.
pawnbox has quit [Ping timeout: 250 seconds]
astrobunny has joined #ruby
<Radar>
aghalarp: Ruby and RubyGems are updated separately.
<skylerto>
+1
Gasher has quit [Quit: Leaving]
jancel has joined #ruby
<smathy>
gem update --system
<aghalarp>
Is it recommended to update rubygems then?
<aghalarp>
or only if there's an issue
zeroDi has quit [Quit: WeeChat 1.5]
<skylerto>
depends
<skylerto>
your system wide gems you should keep up to date.
<Radar>
Yes, it's recommended to update rubygems.
<aghalarp>
Btw I'm completely new to ruby so I have no gems at all yet
<aghalarp>
and I pretty much have no idea what I'm doing! :)
noobsu has joined #ruby
<smathy>
At least you know that much.
<aghalarp>
The plan is to type and click things until they break.
ChiefAlexander has quit [Quit: Leaving...]
<Radar>
aghalarp: that's what I get paid to do every day
<smathy>
So say we all.
<toretore>
just put a rescue nil after youll be fine
skylerto has quit [Quit: leaving]
skylerto_ has joined #ruby
<aghalarp>
Also I guess now is a good time to ask: RVM vs rbenv?
nettoweb has joined #ruby
skylerto_ has quit [Client Quit]
stunder001 has quit [Ping timeout: 276 seconds]
skylerto has joined #ruby
<jhass>
RVM but chruby before both ;)
<smathy>
rbenv, but chruby before both.
danostrowski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vdamewood has joined #ruby
<aghalarp>
hm... never really gave chruby a look
<havenwood>
no switcher, but chruby if you must
<aghalarp>
What's the most popular these days?
stunder001 has joined #ruby
dopie has quit [Ping timeout: 244 seconds]
<jhass>
rvm is probably still the most used but chruby should be used more often than rbenv
<jhass>
note that chruby is younger, and rvm is the oldest, you got some legacy and some people who never had a reason to move