<havenwood>
thatsmrmetalhead: Install your gems and carry on!
<thatsmrmetalhead>
thank you man.
<Ox0dea>
thatsmrmetalhead: You got "No such file or directory" from an argument you passed to `ruby`.
<thatsmrmetalhead>
does echo $path update it?
northfurr has joined #ruby
symm- has quit [Client Quit]
speaking1ode has joined #ruby
Guest88361 has joined #ruby
<havenwood>
thatsmrmetalhead: No, it just prints the env var. Alternatively you could print it with: printenv PATH
Vertroa has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
QpQ4 has joined #ruby
<thatsmrmetalhead>
alright... so, had two tabs open in terminal, one where I was installing ruby and one where I was resting in the directory I was trying to work in
<thatsmrmetalhead>
first tab didn't update... did not know that could happen
<havenwood>
thatsmrmetalhead: Turn it off and turn it back on again.
Vertroa has joined #ruby
AccordLTN has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
AccordLTN has quit [Client Quit]
j_mcnally has joined #ruby
yalcin has joined #ruby
nerfando has joined #ruby
sandstrom has joined #ruby
thatsmrmetalhead has quit [Ping timeout: 240 seconds]
<ruboto_>
r0_0, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<r0_0>
my apologies will go to gist
craysiii has quit [Read error: Connection reset by peer]
sandstrom has quit [Read error: Connection reset by peer]
aadam21 has quit [Ping timeout: 276 seconds]
justmytwospence has joined #ruby
sandstrom has joined #ruby
preyalone has quit [Quit: Connection closed for inactivity]
<justmytwospence>
hey, total ruby noobie here. I'd like to write a rake task that runs two processes simultaneously (one for livereload and one to regenerate static blog files). Is this possible?
tuelz has quit [Ping timeout: 264 seconds]
okbutwhy has joined #ruby
morfin has joined #ruby
sandstrom has quit [Client Quit]
argentdrake has joined #ruby
<Ox0dea>
justmytwospence: "Processes" in the Linux sense?
darkf has joined #ruby
<pontiki>
are you using jekyll?
sandstrom has joined #ruby
<pontiki>
¯\_(ツ)_/¯
houhoulis has quit [Remote host closed the connection]
cmolenda has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlphaAtom has joined #ruby
Darmani has quit [Ping timeout: 252 seconds]
AlphaAtom has quit [Client Quit]
<pontiki>
justmytwospence: knock-knock
<justmytwospence>
pontiki: yep
<pontiki>
using guard-livereload?
<justmytwospence>
I'm trying to simplify a workflow that includes `bundle exec guard` and `jekyll build --watch` together
<pontiki>
instead of a rake task, better to use foreman
<justmytwospence>
ooh didn't know about foreman
<justmytwospence>
looks like just the thing
<pontiki>
but with jekyll 3, even better than that, is put your jekyll build with incremental building inside the guardfile itself
<pontiki>
without specifying the --watch option on the jekyll build
<justmytwospence>
do you have any examples of such a configuration
<choke>
I'll resist however futile it is... it's night -- not morning.
sandstrom has joined #ruby
<Ox0dea>
Some men just want to watch the world burn.
Xeago has quit [Remote host closed the connection]
kalopsian has quit [Ping timeout: 260 seconds]
chussenot has joined #ruby
<choke>
Nah, it's really not that complicated... if it's 4-5-6 am and I say good morning, it's because it's morning for me -- i don't need to care what it is for others... i come on and say "good morning everyone!" because I just woke up... I say good night or goodbye when i leave... it's all in context of my location, not everyone elses...
sandstrom has quit [Client Quit]
kalopsian has joined #ruby
iateadonut has joined #ruby
Z00t has quit [Remote host closed the connection]
djellemah has joined #ruby
Z00t has joined #ruby
<Ox0dea>
Now *that's* complicated. Much simpler for it to just always be morning.
iateadonut1 has quit [Ping timeout: 265 seconds]
<choke>
nah... if someone says morning, say morning back... if someone says afternoon say afternoon back... evening <-> evening... night <-> night
<choke>
whatever is said, repeat back.. pretty simple ;)
symm- has quit [Ping timeout: 264 seconds]
<adaedra>
said by the one who corrected first.
gusrub has quit [Quit: Leaving]
howdoi has joined #ruby
Makorak has joined #ruby
<adaedra>
Morning, Ox.
<Ox0dea>
Morning, Ada.
blackgoat has quit [Ping timeout: 250 seconds]
aadam21 has joined #ruby
chipotle has quit [Quit: cheerio]
<choke>
morning adaedra ( i did say morning back, but i did inform not necessarily correct )
quaristice has joined #ruby
TomyWork has joined #ruby
<adaedra>
and it's precisely to avoid long discussions about "nah it's ... here" that we use UGT.
tmtwd has joined #ruby
certainty has joined #ruby
sarkis has joined #ruby
<choke>
meh -- this "ugt" is just over thinking the problem... i'll continue to use words in context of what time it is for me, 'cause it's what really makes sense.
<choke>
I use that line every time someone tells me that me and my daughter are going to "hell" since she's gay and I support her anyway... always tell them: "Awesome, we could use a vacation and norway seems like a beautiful place."
vondruch has joined #ruby
<adaedra>
heh.
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
ta has quit [Remote host closed the connection]
einarj has joined #ruby
antgel has joined #ruby
certainty has quit [Ping timeout: 255 seconds]
agent_white has joined #ruby
mark3 has joined #ruby
certainty has joined #ruby
diegoviola has quit [Quit: WeeChat 1.3]
<shevy>
norway is full of ice and snow
Oog has quit []
<adaedra>
awesome
sandstrom has joined #ruby
<adaedra>
Or should I say, "åwæsøme"?
roshanavand has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
ur5us has joined #ruby
<pontiki>
"Did we win the trip?!?! OMG!!"
kalopsian has quit [Ping timeout: 265 seconds]
aadam21 has quit [Ping timeout: 276 seconds]
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Zackio has quit [Read error: Connection reset by peer]
supergeek has joined #ruby
Zackio has joined #ruby
chipotle has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
agent_white has joined #ruby
aufi has joined #ruby
<choke>
welp, the misses just got home so off to bed... goodnight all
roshanav_ has joined #ruby
praveen has quit [Ping timeout: 256 seconds]
bascht has quit [Quit: WeeChat 1.2]
roshanavand has quit [Read error: Connection reset by peer]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SOLDIERz has quit [Ping timeout: 265 seconds]
bascht has joined #ruby
bigkevmcd has joined #ruby
aspiers has joined #ruby
Makorak has quit [Read error: No route to host]
edwinvdgraaf has joined #ruby
supergeek has quit [Quit: WeeChat 1.4]
rodfersou has joined #ruby
roshanav_ has quit [Remote host closed the connection]
LMity has quit [Ping timeout: 255 seconds]
agent_white has quit [Ping timeout: 255 seconds]
asmodlol has joined #ruby
<shevy>
pontiki haha what a great name
dn` has joined #ruby
<shevy>
https://en.wikipedia.org/wiki/Hell,_Michigan "In the early 1930s, Pinckney, Michigan postmaster W. C. Miller began to receive requests from stamp and postmark collectors for cancellations: Hell had no post office"
Xeago has joined #ruby
ziprar has joined #ruby
<adaedra>
choke: it's morning here.
ziprar is now known as zipace
roshanavand has joined #ruby
<adaedra>
but good night.
kalopsian has joined #ruby
praveen__ has quit [Remote host closed the connection]
blackgoat has joined #ruby
harai54 has quit [Ping timeout: 276 seconds]
howdoicomputer has joined #ruby
bluOxigen_ has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
jondot has joined #ruby
blaxter has quit [Ping timeout: 240 seconds]
<pontiki>
also good night, even if it is 3am
karapetyan has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blaxter has joined #ruby
howdoicomputer has quit [Ping timeout: 260 seconds]
KineticX has quit [Remote host closed the connection]
bluOxigen has joined #ruby
ajf- has joined #ruby
waka has quit [Remote host closed the connection]
waka has joined #ruby
bluOxigen_ has quit [Ping timeout: 245 seconds]
drptbl has joined #ruby
sftrabbit has joined #ruby
dcunit3d has quit [Quit: WeeChat 1.3]
blackgoat has quit [Ping timeout: 245 seconds]
<atmosx>
hello
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ni291187 has joined #ruby
axsuul has joined #ruby
chouhoulis has joined #ruby
dcunit3d has joined #ruby
ni291187 has left #ruby [#ruby]
asteel has joined #ruby
<asteel>
is
dcunit3d has quit [Client Quit]
<asteel>
is self the counterpart to JavaScript "this"?
dcunit3d has joined #ruby
dcunit3d has quit [Client Quit]
<asteel>
self = Ruby... this = JavaScript?
choke has quit [Ping timeout: 260 seconds]
drptbl_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
dcunit3d has joined #ruby
dcunit3d has quit [Client Quit]
hannelita has joined #ruby
drptbl has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Ping timeout: 240 seconds]
pandaant has quit [Remote host closed the connection]
Gnut has quit [Ping timeout: 272 seconds]
<yorickpeterse>
pretty much
asmodlol has quit [Ping timeout: 276 seconds]
jondot has joined #ruby
<asteel>
pretty much or exactly the same?
ta has joined #ruby
TakumoKatekari is now known as Takumo
<adaedra>
this is JS has some weird behaviors
hannelita has quit [Ping timeout: 255 seconds]
<asteel>
but what about Ruby?
<adaedra>
self, in Ruby, is always the object the current method is called on
gregf___ has joined #ruby
asmodlol has joined #ruby
DoubleMalt has joined #ruby
gregf___ has quit [Client Quit]
quaristice has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asteel>
so variable.method_b would have some function and then that function returns self self would ALWAYS be the thing that called the method?
axsuul has quit [Ping timeout: 265 seconds]
dcunit3d has joined #ruby
quaristice has joined #ruby
dcunit3d has quit [Client Quit]
chipotle has quit [Quit: cheerio]
Xeago has quit [Remote host closed the connection]
mdw has joined #ruby
TheHodge has joined #ruby
karapety_ has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
dcunit3d has joined #ruby
usershel_ has quit [Read error: Connection reset by peer]
Snowy has joined #ruby
Xeago has joined #ruby
simi has joined #ruby
<shevy>
asteel you call method_b on what object variable is there
quaristice has quit [Client Quit]
<asteel>
I'm confused
dcunit3d has quit [Client Quit]
<asteel>
how does self work?
<asteel>
I just got the hang of this
usershell has joined #ruby
<asteel>
can you explain it like you would to a 5 year old please?
blackmes1 has joined #ruby
aadam21 has joined #ruby
praveen has joined #ruby
dcunit3d has joined #ruby
tuelz has joined #ruby
<adaedra>
asteel: when doing foo.bar, inside of bar, self is foo
<asteel>
why do people use the confusing foo bar example
<adaedra>
everything is an object in Ruby, there are no functions, only methods (so always bound to an object) and you are always in the context of an object
<shevy>
it is simple
dc1 has joined #ruby
dcunit3d has quit [Client Quit]
<adaedra>
those are the standard english metasyntactic variables
pawnbox has quit [Remote host closed the connection]
<shevy>
asteel cat = Cat.new; cat.meow()
chipotle has joined #ruby
toretore has joined #ruby
praveen has quit [Ping timeout: 240 seconds]
<asteel>
ok?
<shevy>
ok
juddey has quit [Ping timeout: 264 seconds]
* asteel
is still confused
pawnbox has joined #ruby
tuelz has quit [Ping timeout: 245 seconds]
<asteel>
so phone.call self.ring means self is phone?
huyderman has joined #ruby
<adaedra>
no, inside of call method it will be
dpg_ has quit [Ping timeout: 260 seconds]
domgetter has joined #ruby
jbrhbr has quit [Quit: Leaving.]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
<adaedra>
when doing phone.call, you say "call the `call` method on the `phone` object", so the code inside `call` will be executing with `self` set to what is currently `phone`
Emmanuel_Chanel has joined #ruby
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
dcunit3d has joined #ruby
karapety_ has quit [Remote host closed the connection]
<asteel>
and that's always like that?
djbkd has quit [Remote host closed the connection]
vifino has quit [Quit: Who turned this off?! D:<]
dcunit3d has quit [Client Quit]
dEPy has quit [Ping timeout: 260 seconds]
dcunit3d has joined #ruby
karapetyan has joined #ruby
grassdog has quit [Quit: Be back later ...]
karapetyan has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
asteel has quit [Remote host closed the connection]
blackmes1 has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
acke_ has joined #ruby
lacuna has quit [Remote host closed the connection]
<shevy>
pretty legit person
kies^ has quit [Read error: Connection reset by peer]
<adaedra>
ah, gone already?
Azure has quit [Read error: Connection reset by peer]
platzhirsch has joined #ruby
Azure has joined #ruby
acke has quit [Ping timeout: 255 seconds]
Rickmasta has quit [Ping timeout: 240 seconds]
Spleeze has quit [Ping timeout: 240 seconds]
wnd has quit [Ping timeout: 256 seconds]
joonty has joined #ruby
wnd has joined #ruby
FernandoBasso has joined #ruby
lipoqil has joined #ruby
saltsa_ has joined #ruby
sluukkonen has quit [Ping timeout: 276 seconds]
timmow_ has quit [Ping timeout: 250 seconds]
saltsa has quit [Ping timeout: 250 seconds]
marens has quit [Remote host closed the connection]
Affix has quit [Ping timeout: 250 seconds]
gregf_ has joined #ruby
Spleeze has joined #ruby
Rickmasta has joined #ruby
Affix has joined #ruby
gregf_ has quit [Quit: leaving]
Affix is now known as Guest18754
rkazak has quit [Quit: Sleep.....ing....]
marens has joined #ruby
marens has quit [Changing host]
marens has joined #ruby
sluukkonen has joined #ruby
timmow has joined #ruby
gregf_ has joined #ruby
praveen has joined #ruby
colegatron has quit [Ping timeout: 276 seconds]
asmodlol has quit [Ping timeout: 265 seconds]
Helheim has joined #ruby
_main_ has joined #ruby
sepp2k has joined #ruby
asmodlol has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Client Quit]
dionysus69 has quit [Ping timeout: 265 seconds]
emilkarl has joined #ruby
aadam21 has quit [Ping timeout: 276 seconds]
Tempesta has joined #ruby
__main__ has quit [Ping timeout: 265 seconds]
_main_ is now known as __main__
djbkd has joined #ruby
dwfait has joined #ruby
huyderman has quit [Read error: Connection reset by peer]
okbutwhy has joined #ruby
huyderman has joined #ruby
karapetyan has joined #ruby
sergey_makagon has joined #ruby
ur5us has quit [Remote host closed the connection]
platzhirsch has quit [Ping timeout: 255 seconds]
colegatron has joined #ruby
vifino has joined #ruby
chouhoulis has joined #ruby
praveen has quit [Remote host closed the connection]
rdark has joined #ruby
krz has quit [Ping timeout: 255 seconds]
<shevy>
hmm if we have a string "foobar", and store this in a .yml file, the proper way for this would be to become: "--- foobar\n" right?
karapetyan has quit [Remote host closed the connection]
arup_r has joined #ruby
hannelita has joined #ruby
jschmid has joined #ruby
<shevy>
because strangely enough, I have something here where "foobar" becomes "--- foobar\n...\n" in a .yml file
<apeiros>
"Three dots ( “...”) indicate the end of a document without starting a new one"
framling has quit [Remote host closed the connection]
jondot has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sankaber has joined #ruby
grassdog has joined #ruby
GBrawl has joined #ruby
roshanav_ has joined #ruby
roshanavand has quit [Read error: Connection reset by peer]
Ishido has joined #ruby
usershel_ has joined #ruby
GBrawl has quit [Client Quit]
usershell has quit [Ping timeout: 246 seconds]
grassdog has quit [Ping timeout: 260 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
cmolenda has quit [Remote host closed the connection]
puria has quit [Ping timeout: 276 seconds]
Jackneill has joined #ruby
platzhirsch has left #ruby [#ruby]
<ljarvis>
AI?
A124 has quit [Quit: '']
<shevy>
hehehe
jmignault has quit [Ping timeout: 240 seconds]
cassioscabral has joined #ruby
hannelita has joined #ruby
dlitvak has joined #ruby
<adaedra>
A soul?
Z00t has quit [Ping timeout: 264 seconds]
dc1 has quit [Quit: WeeChat 1.3]
dc1 has joined #ruby
dcunit3d has quit [Quit: WeeChat 1.3]
dc1 has quit [Client Quit]
dcunit3d has joined #ruby
<shevy>
lol
nettoweb has joined #ruby
howdoicomputer has joined #ruby
aadam21 has joined #ruby
puria has joined #ruby
cassioscabral has quit [Ping timeout: 265 seconds]
webhat_ is now known as webhat
kalopsian has quit [Ping timeout: 260 seconds]
cmolenda has joined #ruby
kalopsian has joined #ruby
praveen has joined #ruby
hanneli has joined #ruby
howdoicomputer has quit [Ping timeout: 240 seconds]
dlitvak_ has joined #ruby
Coldblackice has quit [Ping timeout: 246 seconds]
dlitvak has quit [Ping timeout: 276 seconds]
hannelita has quit [Ping timeout: 264 seconds]
hannelitaa has joined #ruby
Bloomer has quit [Remote host closed the connection]
hanneli has quit [Ping timeout: 264 seconds]
__main__ has quit [Read error: Connection reset by peer]
__main__ has joined #ruby
chouhoulis has joined #ruby
dwfait has quit [Remote host closed the connection]
prestorium has joined #ruby
symbol_ has joined #ruby
blackmes1 has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
dwfait has joined #ruby
stamina has joined #ruby
FooMunki has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
dwfait has quit [Remote host closed the connection]
d0nn1e has quit [Ping timeout: 250 seconds]
xet7 has joined #ruby
pawnbox has quit [Remote host closed the connection]
bluOxigen has joined #ruby
pawnbox has joined #ruby
d0nn1e has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
axsuul has joined #ruby
casadei has joined #ruby
symbol_ has quit [Quit: WeeChat 1.1]
kalopsian has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
ascarter_ has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
tulak has joined #ruby
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
Blaguvest has joined #ruby
roshanav_ has quit [Remote host closed the connection]
cornerma1 has joined #ruby
aadam21 has quit [Ping timeout: 276 seconds]
tuelz has joined #ruby
praveen has quit [Remote host closed the connection]
casadei has quit [Read error: Connection reset by peer]
casadei has joined #ruby
cmolenda has quit []
cornerman has quit [Ping timeout: 245 seconds]
cornerma1 is now known as cornerman
c355e3b has joined #ruby
CloCkWeRX has joined #ruby
Xeago has joined #ruby
tuelz has quit [Ping timeout: 256 seconds]
stevenxl has quit [Ping timeout: 272 seconds]
skade has joined #ruby
lacuna has quit [Remote host closed the connection]
jondot has joined #ruby
roshanavand has joined #ruby
dling has quit [Read error: Connection reset by peer]
dling has joined #ruby
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
ferr has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
praveen has joined #ruby
chussenot has quit [Quit: chussenot]
aadam21 has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
dwfait has joined #ruby
platzhirsch has joined #ruby
ascarter_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Melpaws has quit [Remote host closed the connection]
Cohedrin has joined #ruby
lucasb has joined #ruby
bruce__lee has joined #ruby
hannelitaa has quit [Remote host closed the connection]
ajf- has joined #ruby
pulgolino has joined #ruby
Xeago has quit [Remote host closed the connection]
lacuna has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 264 seconds]
pawnbox has joined #ruby
Xeago has joined #ruby
rodfersou has quit [Ping timeout: 264 seconds]
Cohedrin has quit [Ping timeout: 255 seconds]
bruce_lee has quit [Ping timeout: 272 seconds]
Xeago_ has joined #ruby
ajf- has quit [Client Quit]
kalopsian has joined #ruby
sigurding has quit [Quit: sigurding]
bluOxigen_ has joined #ruby
hannelita has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
bluOxigen has quit [Ping timeout: 265 seconds]
pdoherty has joined #ruby
rodfersou has joined #ruby
praveen has quit [Remote host closed the connection]
zh2683 has joined #ruby
robbyoconnor has joined #ruby
zh2683 has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
roshanavand has joined #ruby
sandstrom has joined #ruby
_whitelogger has joined #ruby
voker57 has joined #ruby
voker57 has quit [Changing host]
voker57 has joined #ruby
aryaching has joined #ruby
<lucasb>
maybe /\#{5}/ ?
tvw has joined #ruby
postmodern has quit [Quit: Leaving]
<siaw>
lucasb: i’ll try
<DirtyFInn>
That seems to work
<siaw>
lucasb: yes it does work. thanks a lot :)
chouhoulis has joined #ruby
tvw has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Ping timeout: 256 seconds]
<toretore>
/#####/
_whitelogger_ has joined #ruby
_whitelogger has quit [Ping timeout: 240 seconds]
voker57 has joined #ruby
voker57 has quit [Changing host]
voker57 has joined #ruby
<siaw>
i’m reading a list of files with links. but when the files are read in the terminal ruby shows me a extra bunch of space that i want to to get rid of. like this "http://goo.gl/KUcXzm "
nerfando has joined #ruby
johnny56 has joined #ruby
<siaw>
but i want it to ignore the extra space and returen "http://goo.gl/KUcXzm”
<siaw>
how do i achieve this?
dionysus69 has quit [Ping timeout: 256 seconds]
<chris2>
url.strip
nerfando has quit [Max SendQ exceeded]
nerfando has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aupadhye has joined #ruby
nerfando has quit [Max SendQ exceeded]
nerfando has joined #ruby
axsuul has quit [Ping timeout: 255 seconds]
johnny56_ has quit [Ping timeout: 264 seconds]
Elysia has quit [Remote host closed the connection]
Elysia has joined #ruby
scripore has joined #ruby
devbug has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
sigurding has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<sandstrom>
Is there a performance benefit to freezing strings that are defined as constants? Or is that only when the strings are 'inline'
jondot has joined #ruby
<yorickpeterse>
There might be a small gain, but that depends on how the strings are used
<apeiros>
there's (with current rubies) never a performance benefit
<yorickpeterse>
If they're defined as contants there's still the overhead of constant lookups
<apeiros>
there's a memory benefit with ruby 2.2+ if you use *literally* the form "foo".freeze
<apeiros>
and that's unrelated to what they're assigned to
waka has quit [Remote host closed the connection]
<sandstrom>
Ah, okay (I thought them being a constant might make a difference)
sftrabbit has quit [Quit: sftrabbit]
<sandstrom>
(Because being a constant, they shouldn't be allocated more than once regardless)
<apeiros>
variables are orthogonal to objects
<apeiros>
an object is not a constant
<apeiros>
the constant is a constant, and it may reference an immutable object
<sandstrom>
Yes, but my understanding was that e.g. `1000.times { "foo".freeze }` would only allocate once, but that `my_var = 'foo'; 1000.times { my_var }` (similar to it being a constant) also allocates once, frozen or not
jackcom has joined #ruby
bruce__lee has quit [Changing host]
bruce_lee has joined #ruby
bruce__lee is now known as bruce_lee
<apeiros>
the term for "foo" is literal
<apeiros>
and yes, "foo".freeze would only allocate once in 2.2+
linc01n has quit [Ping timeout: 256 seconds]
<sandstrom>
I know, but isn't that already the case with `my_var = 'foo'; 1000.times do { my_var }` ?
<shevy>
bruce_lee! what are you doing here on #ruby, off with you to enter the #dragon !
B1n4r10 has joined #ruby
<apeiros>
sandstrom: in the 1000.times part it won't allocate anything. so it depends on how often you run the my_var = 'foo' part.
ajf- has joined #ruby
aadam21_ has joined #ruby
<jackcom>
shevy: hello :_
aadam21 has quit [Ping timeout: 276 seconds]
<sandstrom>
apeiros Got it, thanks discussing this with me! :)
<shevy>
1000.times do { my_var } would be powerful new syntax if it would work :)
inukshuk_ has joined #ruby
linc01n has joined #ruby
inukshuk_ has quit [Client Quit]
dcunit3d has quit [Ping timeout: 240 seconds]
Xeago_ has quit [Remote host closed the connection]
quaristice has joined #ruby
solenoids has quit [Ping timeout: 256 seconds]
dwfait has joined #ruby
gagrio has quit [Ping timeout: 272 seconds]
B1n4r10 has quit [Ping timeout: 256 seconds]
roshanav_ has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
troulouliou_div2 has joined #ruby
aadam21_ has quit [Remote host closed the connection]
harai54 has joined #ruby
gagrio has joined #ruby
blackmes1 has quit [Ping timeout: 276 seconds]
lubekpl has joined #ruby
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GinoManWorks_ has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
tuelz has joined #ruby
praveen has joined #ruby
moeSeth has quit [Quit: Connection closed for inactivity]
harai54 has quit [Ping timeout: 272 seconds]
lucasb_ has joined #ruby
howdoicomputer has joined #ruby
<siaw>
need some help. i have to files. one with tweets and place holders other with links on each line. i want to replace each placeholder in the tweets with one link from the links.txt file. i’m doing something like this which is not working https://gist.github.com/siaw23/929e7c479910631ac7af any help?
lxsameer has quit [Quit: Leaving]
antgel has quit [Ping timeout: 250 seconds]
sdothum has joined #ruby
krz has joined #ruby
antgel has joined #ruby
rob_ has joined #ruby
lucasb has quit [Ping timeout: 240 seconds]
quaristice has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
praveen has quit [Ping timeout: 256 seconds]
<rob_>
anyone use vim and rubocop with rbenv? i've installed 2.3.0 and rubocop but i get this error: parser/current is loading parser/ruby22, which recognizes 2.2.x-compliant syntax, but you are running 2.3.0.
chipotle has quit [Quit: cheerio]
solenoids has joined #ruby
<rob_>
ive tried upgrading parser gem, vim-rubocop and rubocop
jmignault has joined #ruby
roshanavand has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 246 seconds]
dlitvak_ has quit [Remote host closed the connection]
Z00t has joined #ruby
<Bish>
siaw: well, since you do gsub, every match will be replaced with the same link
<Bish>
in first iteration of while
<siaw>
Bish: i figured that. i don’t want all matches to be replaced. i want to replace EACH match with something else
<siaw>
Bish: any options?
<Bish>
one sec
bkxd_ has joined #ruby
<siaw>
ok
bkxd has quit [Ping timeout: 240 seconds]
<Bish>
>> count=0;"#####".gsub(/#/) { |x| x = links[count+=1] }
<ruboto_>
Bish # => undefined local variable or method `links' for main:Object (NameError) ...check link for more (https://eval.in/500439)
<Bish>
one of the coolest things you can do in ruby imho
<ljarvis>
disagree
elaptics is now known as elaptics`away
<ljarvis>
one of the worst things*
<apeiros>
heh
<apeiros>
I'm leaning towards ljarvis' "disagree"
<lucasb>
oh, cool. the trick is to reuse the same default block, then. thanks!
<Bish>
i didn't say it's good practice
<apeiros>
it's cool that you can do it
<ljarvis>
actually that's not true, I agree it's "cool" -- but it's not a good idea imo
whiteline has joined #ruby
<Bish>
yep, that's what i meant
scripore has quit [Quit: This computer has gone to sleep]
<apeiros>
but IMO if you do it, you're having a huge red flag in your code screaming "make me a proper class"
<ljarvis>
aye
roshanavand has quit [Ping timeout: 240 seconds]
<apeiros>
I guess we're all on the same page :D
<Bish>
but i admit, i have used it for helper scripts.
<ljarvis>
well that's ok, I have done a lot worse for helper scripts
<ljarvis>
a *lot* worse
<Bish>
as long as ruby doesn't segfault, it's gud.
<Bish>
16gb ram usage, np
<norc>
include >> TypeError: wrong argument type Class (expected Module) -- I never thought Id see the day that this error message has a reasonable use case!
<ljarvis>
why?
dcunit3d has joined #ruby
<norc>
I was refactoring a mixin into a parent class, and reverted the change but forgot to delete the class (it had the same name). Rails autoloading meant it then tried to include the left over class.
<ljarvis>
ah :)
<ljarvis>
I actually get that message quite often because I name things class by habit
<ljarvis>
and then try to include it
<ljarvis>
because composition ftw
DEA7TH has joined #ruby
DEA7TH is now known as ProbabilityDistr
ProbabilityDistr is now known as DEA7TH
troulouliou_div2 has quit [Remote host closed the connection]
JDiPierro has joined #ruby
roshanavand has joined #ruby
<norc>
Im wondering why you cannot include a class though.
<norc>
I mean it kind of makes sense that inheriting from module is not very sensible.
nerfando has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asmodlol has quit [Ping timeout: 264 seconds]
johnny56_ has joined #ruby
<ljarvis>
why would incuding a class be sensible? they're instantiated by design
hakunin has quit [Remote host closed the connection]
<Mon_Ouie>
I showed an example, chaining it with #with_index is an example of what enumerators can be used for
danron has quit [Ping timeout: 264 seconds]
sftrabbit has quit [Quit: sftrabbit]
<volty>
yap, thx, but I was asking just about Enumerable.select without block. To me it seems redundant because you select nothing (no filtering there)
atomical_ has joined #ruby
<volty>
(nothing = all pass)
Vertroa has joined #ruby
skade has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<lucasb>
the enumerator returned still works as a selector, so one use could be to delay the selection further in the code
El3ktra has joined #ruby
<volty>
lucasb: they all pass, no selection without block
circ-user-hOXbS has quit [Quit: circ-user-hOXbS]
sepp2k has quit [Quit: Leaving.]
<volty>
where to post code/proposal ?
<lucasb>
[1,2,3].select.each {|x| x.odd? } #<-- this still selects the odd ones
<volty>
enum_block could be called inject_block, maybe
bensarz has joined #ruby
smactive has joined #ruby
<volty>
hints / suggestion ?
<volty>
s
roshanavand has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
gagrio has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
GGMethos has joined #ruby
<adaedra>
ror15: what's correct_guess and correct_answer? What is the full error? Also, if you put a file extension (i.e. .rb) in the filename field, you get syntax coloring, which is nicer to read.
stevenxl has quit [Client Quit]
<adaedra>
er, just correct_answer actually.
stevenxl has joined #ruby
stevenxl has joined #ruby
<Mon_Ouie>
volty: Do you know about Enumerable#lazy?
djbkd has joined #ruby
ferr has joined #ruby
<volty>
Mon_Ouie: yes, going to re-read. What about enum_block ?
<adaedra>
ror15: your correct_answer method return a boolean (true/false), which have no < or > operations. You can't compare booleans.
<Mon_Ouie>
Not sure what you're looking for. It can be rewritten using each_with_object though.
<volty>
Mon_Ouie: no, it cannot, I tried it yesterday
<Mon_Ouie>
each_with_object(y, &block)
<volty>
yes, but when you have an open resource, to pass from within a block, it doesn't work
<ror15>
Oh I see. how do I get it to pass a test where @correct_answer = guess == answer
<ror15>
I'm not sure how to write the method
<Mon_Ouie>
Any example?
JDiPierro has quit []
colegatron has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<volty>
the example is there, under comments (TagLib::FileRef ...)
<adaedra>
ror15: I'm not sure to see what you want to do.
<ror15>
adaedra: I'd like correct_answer to be true when guess == answer
djbkd has quit [Ping timeout: 240 seconds]
<ror15>
adaedra: But then be able to put a less than, greater than comparison to correct_guess and guess
<volty>
Enumerator.lazy.select { .... } eliminates the need for lazy_select, but Enumerable.select without block is not coherent (imho)
maikowblue has joined #ruby
<Mon_Ouie>
Why not?
roshanavand has joined #ruby
<volty>
I answered above - because when chaining you lose the Enumerator (lazy enumeration) and get Array
yb_drowe has joined #ruby
sftrabbit has joined #ruby
<Mon_Ouie>
You can do lazy.select.with_index if you want lazy enumeration
aadam21_ has joined #ruby
sandstrom has joined #ruby
<Mon_Ouie>
Oh nevermind, you cannot
yb_drowe has quit [Max SendQ exceeded]
mistermocha has joined #ruby
lucasb has quit [Quit: leaving]
<volty>
It's what I said. Look, never mind. I am not in mood to argue. I need that piece of enum_block. If there are smart coders that need it, or think it could be useful to include in Enumerable (call it inject_block), nice, if not nothing
<Mon_Ouie>
You can do enum_for(:select).with_index though, not sure why it's not done automatically
karapetyan has joined #ruby
northfurr has joined #ruby
aadam21 has quit [Ping timeout: 240 seconds]
A124 has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
skade has quit [Ping timeout: 276 seconds]
einarj has quit [Remote host closed the connection]
Gnut has joined #ruby
[Butch] has joined #ruby
gambl0re has quit [Read error: Connection reset by peer]
SCHAAP137 has quit [Remote host closed the connection]
<havenwood>
volty: no need for apology, just a nit!
davedev24 has joined #ruby
<havenwood>
volty: Fun to compare with RubyVM::InstructionSequence.
<adaedra>
ror15: what do you want to compare? You can't compare booleans.
<lucasb>
I don't get it. what's the difference between 'a = a || b' and 'a || a = b' ?
<ror15>
adaedra: I took out the boolean comparison since that isn't a thing. Comparing guess and answer now works. I was just thinking about it incorrectly. Thanks for the input:)
dlitvak has quit [Ping timeout: 276 seconds]
<lucasb>
intuitively they look the same to me, but I think I'm missing some detail
<Mon_Ouie>
lucasb: Consider the case where a is actually some_object.some_field
<havenwood>
lucasb: With the former `a` is always reassigned even it it exists.
symm- has joined #ruby
<Mon_Ouie>
In that case, with some_object.some_field = some_object.some_field || b'… ^
babblebre has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
davedev24 has quit [Ping timeout: 255 seconds]
<Mon_Ouie>
A common case where this can be noticed is when you have a Hash with a default value (like Hash.new(0))
roshanavand has quit [Ping timeout: 260 seconds]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sgambino has joined #ruby
AckZ has quit []
mdw has quit [Quit: Sleeping Zzzzz]
<lucasb>
so... the only difference is that 'obj.attr = obj.attr' may have some side effect? since attributes assignment are really method calls?
northfurr has joined #ruby
<volty>
>> class Test; attr_accessor :x; end; t = Test.new; t.x || t.x = 3; t.x
mistermocha has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 260 seconds]
<bruce_lee>
\(^_^)/ @all
<mchu>
what does this error mean?
<volty>
mah, nevermind. got tired
<mchu>
undefined method `empty?' for 1:Fixnum
<aegis3121>
it means the method "empty?" isn't defined for the FixNum class.
<ljarvis>
mchu: it means 1 -- an instance of Fixnum does not implement the method "empty?"
jacyzon has quit [Quit: Connection closed for inactivity]
<havenwood>
>> 42.empty?
<ruboto_>
havenwood # => undefined method `empty?' for 42:Fixnum (NoMethodError) ...check link for more (https://eval.in/500559)
roshanavand has joined #ruby
<Mon_Ouie>
Which in turns means you have an integer where you were expecting some other kind of object
<aegis3121>
In pure Ruby #empty? is only defined for Array (I believE)
<ljarvis>
ENV and Hash both define it
<mchu>
Mon_Ouie: so.. im getting an integer instead of an object?
<Sou|cutter>
or Hash or Set
<aegis3121>
Okay, those too :)
<ljarvis>
and other stuff in stdlib
<ljarvis>
but yeah
B1n4r10 has joined #ruby
<aegis3121>
Collections
roshanavand has quit [Remote host closed the connection]
<ljarvis>
:)
<bruce_lee>
I'm new to ruby, how can I find out the width of the current terminal? I tried "require 'terminal-size'", but this doesn't work when pipe something to my ruby-script
<aegis3121>
(roughly)
roshanavand has joined #ruby
Xeago has joined #ruby
<bruce_lee>
anybody a hint?
<ljarvis>
aegis3121: and String (which is arguably a collection)
<ljarvis>
bruce_lee: Terminfo
<Mon_Ouie>
No, Integers are a kind of objects, but you can't ask if an integer is #empty?
<volty>
havenwood: RubyVM::InstructionSequence sometime in the future, now I am trying to tweak some smoke (lib) for c++ extensions and qtbindings. btw, for info, i reinstalled nokogiri with system libs, but it always crashes when used with qtbindgins. the good is that it crashes only at the exit, when the qt application gets destroyed.
<apeiros>
ljarvis: a lot of people have trouble understanding that the `nil:NilClass` is essentially "#{subject.inspect}:#{subject.class}"
<apeiros>
+additionally
sigurding has quit [Quit: sigurding]
<ljarvis>
ah ok
<ljarvis>
interesting
sh1rt has joined #ruby
davedev24 has quit [Ping timeout: 255 seconds]
<apeiros>
at least IME
dlitvak has joined #ruby
dlitvak has quit [Remote host closed the connection]
<ljarvis>
I agree that Ruby exceptions could be better, but they're not too bad either
<ljarvis>
Elixir does this well imo
Vertroa_ has joined #ruby
<apeiros>
I find ruby exceptions quite good given the medium
<ljarvis>
Prolog does it best :)
<ljarvis>
yep
jschmid has quit [Ping timeout: 240 seconds]
<apeiros>
but you have to take a couple of minutes when you "meet" them the first time and understand, how they're structured.
<apeiros>
and plenty of people sadly fail there.
<apeiros>
or as you said, lack the understanding of ruby's object & method model
codecop has joined #ruby
Vertroa has quit [Ping timeout: 265 seconds]
sergey_makagon has quit []
<volty>
imho it has more to do with understanding the classifications in general, before oo aspects in general — enough to think that you cannot send :fly to an elephant, or :dive to a flower
<ljarvis>
clearly someone hasn't seen Dumbo
<apeiros>
nor groot
<apeiros>
though groot is more a tree than a flower :)
<volty>
yes but Dumbo is a [particular] specialization :)
<malice>
e.g. Python uses tuples, but I think that Ruby's Arrays are as good
ferr has quit [Ping timeout: 272 seconds]
<malice>
But I also thought that I could use the nested functions
<tjohnell>
Anyone here ever been deep in the Faraday library code?
Renich has joined #ruby
<apeiros>
malice: a nested def will not define a private function in ruby
griffindy has joined #ruby
<apeiros>
it'll just define a method in the same scope the current method is
failshell has joined #ruby
<apeiros>
i.e. you'll have the same effect if you place the def outside (just that it a) will be defined even without running the outer method, and b) doesn't get redefined on each call)
Z00t has joined #ruby
sigurding has joined #ruby
usershel_ has quit [Read error: Connection reset by peer]
<malice>
apeiros: So the closest solution I can get is to define a method, and create some "main" function to run all the code, but define variables as member variables?
iamnix is now known as ianix
jbrhbr has quit [Quit: Leaving.]
lemur has quit [Remote host closed the connection]
<apeiros>
malice: you could use procs. but really, it's the old "don't write fortran in cobol" adage
cdg has quit [Remote host closed the connection]
usershell has joined #ruby
jbrhbr has joined #ruby
cdg has joined #ruby
<malice>
apeiros: tbh defining class looks the most natural way out from the problem in here
SenpaiSilver has quit [Quit: Leaving]
<apeiros>
classes are usually the way in ruby
<malice>
:)
<malice>
Thanks for your help!
podman has joined #ruby
psyq has joined #ruby
<apeiros>
from a glance at your python, you can omit the OrderedDict - Hash in ruby is ordered
<lucasb>
apeiros: just a note: I think the outer method *must* be run, before the inner method will be defined (right?)
kerunaru has joined #ruby
<apeiros>
and the rest - class FooParser, then add all the python functions there, and mark some of them private
mchu has joined #ruby
<apeiros>
lucasb: correct
tectonic has joined #ruby
ur5us has joined #ruby
<apeiros>
just parsing the outer method won't define the inner.
<apeiros>
same as an `if false; def foo; …; end; end` won't define foo
howdoicomputer has joined #ruby
<malice>
apeiros: Well I thought so at the beginning, but it uses internals of hash, and for now I just want to re-write the code(and I want the code to work)
<argentdrake>
I'm having trouble with hashes, I've generated 1 mil random nums, and I want to put them into a hash using their random nums as keys, if the key already exists, I would like to increment the value at the key so that I may count how many times a number occured. Code available if needed, just figured it was a simple request.
kalopsian has joined #ruby
<malice>
so when I get there I will probably get rid of OrderedHash
sftrabbit has joined #ruby
juddey has joined #ruby
<apeiros>
argentdrake: always gist what you've done so far, what it does, and what you expected it to do instead ;-)
cdg has quit [Ping timeout: 265 seconds]
pdoherty has joined #ruby
<apeiros>
argentdrake: but counting hashes are a common problem and the solution is usually `counter = Hash.new(0); …; counter[item] += 1; …`
nettoweb has joined #ruby
<argentdrake>
apeiros: Thank you, i'll look into that ^^
<malice>
argentdrake: trie could be more optimal in this case
<apeiros>
hm, 2.3 does not have count_by, was that announced for 3.0?
<argentdrake>
malice: Never heard of trie, i'll have to look that up
<malice>
argentdrake: Not sure if that's in ruby, but should be easy to implement.
Puffball has quit [Remote host closed the connection]
<apeiros>
malice: there's no native one in ruby, and a ruby implementation will almost certainly not be wroth it
<lucasb>
this closure idiom can be emulated by defining local variables inside a method and return a proc, can't it?
finisherr has joined #ruby
<apeiros>
lucasb: emulated where? in what language?
<malice>
apeiros: I do not know Ruby well, and it looks like you do; so if you say so, I trust that you know better than me.
Puffball has joined #ruby
vF3hNGxc47h8 has joined #ruby
<lucasb>
in Ruby. I mean, iiuc, in Python and Perl, this is common to do. The idiom that malice was trying to do.
<apeiros>
malice: objects in ruby are somewhat big and method call overhead kills you. so unless you have an actual algorithmical advantage and a problem which scales, it's rarely worth it
mdw has joined #ruby
<apeiros>
-al, apparently :-|
<pizzaops>
jackcom: Have you heard of “the internet”?
mfb2 has quit [Remote host closed the connection]
lacuna has quit [Read error: Connection reset by peer]
<apeiros>
I wish there were a proper variety of native datastructures in stdlib :-/
lacuna has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<adaedra>
apeiros: do a pr.
<cscheib>
win 12
mdw has quit [Read error: Connection reset by peer]
<apeiros>
adaedra: that'd require me to implement those first natively and sanely :)
<cscheib>
grr
<apeiros>
and you know how much time I have…
solenoids has quit [Ping timeout: 240 seconds]
<apeiros>
would be fun, though
TheAnachron has joined #ruby
<TheAnachron>
Hey guys
<TheAnachron>
I seem to have some mess with my ruby gems
spider-mario has joined #ruby
mdw has joined #ruby
<TheAnachron>
some are in ~/.gem/ruby/2.3.0/gems, some are still in 2.2.0
<TheAnachron>
That must have happened on the last ruby/gem update I made.
<adaedra>
It's normal.
<TheAnachron>
What's the best way to fix this?
<TheAnachron>
If I try to run "sup" it will say: Command not found.
<adaedra>
Re-install the gems you need in 2.3.
<TheAnachron>
ok thanks, I'm kinda new to ruby
<TheAnachron>
So I'm quite sure this is a noobish question :P
<adaedra>
Gems are tied to ruby ABI version.
<TheAnachron>
So can I just delete the old 2.2.0 folder?
mwlang has joined #ruby
<adaedra>
If you don't use 2.2 anymore, sure.
momomomomo has joined #ruby
<apeiros>
TheAnachron: depending on what you used to install/update ruby, you can actually ask it to update all gems for the new ruby. e.g. with rvm's upgrade command.
<TheAnachron>
okay!
<TheAnachron>
It seems like my build cancels too now :/
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<TheAnachron>
apeiros: I've tried to update with gem update but that won't work on this level, since its ruby dependent I guess
<TheAnachron>
apeiros: so gem can only update within the same ruby version, right?
<apeiros>
gem knows nothing about your other ruby versions, so you're correct, that can't work.
<apeiros>
gem update is to update a gem installed for the currently used ruby
<TheAnachron>
apeiros: not completely right, if I do "gem env" it actually knows which ruby version I am on :P
<TheAnachron>
apeiros: but I am guessing it wont make use of it anywhere in the code.
<apeiros>
TheAnachron: I didn't say it knew nothing about your *current* ruby
<apeiros>
I said it knows nothing about your *other* rubies.
<TheAnachron>
alright.
<TheAnachron>
I've come to conclusion to reinstall the dependencies of sup first before trying to install that one again
<TheAnachron>
Maybe there was some issues with them which did not pop up
<TheAnachron>
going for xapian-ruby
<TheAnachron>
Now that worked! Wooohoo.
<TheAnachron>
I'm happy again.
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nfk|laptop>
i'm using kate right now but is there anything better for editing ruby source code?
<nfk|laptop>
open source only, please
weemsledeux has joined #ruby
<pizzaops>
So, I’m trying to match against the is_a? value of an object, but when I try to do object.is_a? == ExpectedClass, I get Uninitialized Constant etc etc. In this case the class type is not anywhere in the code so I’m not just missing a require, it’s dynamically generated from the properties of an object.
<TheAnachron>
nfk|laptop: Atom, Brackets, LimeText ... Vim
<pizzaops>
Is there any way around this?
<pizzaops>
FWIW object.is_a? == object.class works
<nfk|laptop>
TheAnachron, vim is even worse, especially syntax highlighting wise
<nfk|laptop>
as for the rest, thanks, looking into them now
dwefe has joined #ruby
<pizzaops>
nfk|laptop: you know you can customize that right...
<TheAnachron>
nfk|laptop: how is vim worse in syntax highlighting????
agit0 has joined #ruby
<pizzaops>
VIM has fantastic syntax highlighting.
<nfk|laptop>
pizzaops, effort
<TheAnachron>
nfk|laptop: gain.
<nfk|laptop>
i have better things to do than try haggling with vim
sarkis has quit [Ping timeout: 240 seconds]
<pizzaops>
“haggling"
aegis3121 has joined #ruby
<pizzaops>
Just install Janus if you want to be lazy, and you’ll get what you want.
<TheAnachron>
He really is a GUI power user :p
gregf has joined #ruby
<pizzaops>
It’s a curlbash, and adds a ton of features to v im.
<nfk|laptop>
would struggling or fighting sound better?
<adaedra>
This smells editors war.
<pizzaops>
adaedra: we’re not telling them to use VIM, just that vim doesn’t have bad syntax highlighting :)
<Ox0dea>
nfk|laptop: Could you at least take a moment to justify your as yet unsubstantiated claim that Vim's syntax highlighting is bad?
<pizzaops>
I don’t care what nfk|laptop uses.
lemur has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
<adaedra>
pizzaops: thanks for the confirmation.
futilegames has left #ruby [#ruby]
stevenxl has quit [Quit: leaving]
<nfk|laptop>
TheAnachron, i was doing file management with coreutils and writing tutorials on CLI 12 years ago and now I'm old enough to be using a graphical text editor, keep your 1337 opinions to yourself
mfb2 has joined #ruby
dlitvak has joined #ruby
<TheAnachron>
nfk|laptop: I use both Vim and Sublime Text 3.
<TheAnachron>
nfk|laptop: Just because I suggest you as VIM of ONE of the OPTIONS you dont need to say such things ok!
<pizzaops>
oh god. time to mute nfk|laptop
art-solopov has joined #ruby
<adaedra>
Ok everyone, move that to -offtopic and come back to ruby.
ta has quit [Remote host closed the connection]
<TheAnachron>
I never left ruby <3 :D
<pizzaops>
I’m so glad I can’t see whatever’s being said, now.
mdw has quit [Read error: Connection reset by peer]
<Ox0dea>
pizzaops: You're missing out.
<pizzaops>
I think I’ll be fine :D
yqt has joined #ruby
mdw has joined #ruby
Xeago has quit [Remote host closed the connection]
<nfk|laptop>
totally, i'm laughing so much my laptop is shaking
<adaedra>
sigh.
solenoids has joined #ruby
<adaedra>
I forgot this channel was full of 12 years old.
<pizzaops>
I’ve got a Ruby question we could discuss, if anybody’s interested...
<adaedra>
What are you waiting for?
<nfk|laptop>
hey, that means i would have been writing those tutorials being 0 years old
<pizzaops>
I asked it earlier and nobody responded, and I didn’t want to spam it again.
<shevy>
:D
duckpuppy has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
<pizzaops>
But basically, I’m working with a library that dynamically generates object types, from whatever this particular REST API has available
malconis has joined #ruby
malconis has quit [Remote host closed the connection]
ror15 has joined #ruby
<pizzaops>
and I’m trying to test objects in an array for their class, e.g. item.is_a? == ObjectType
axsuul has joined #ruby
<pizzaops>
But I can’t figure out how to get passed the fact that the ObjectType doesn’t exist in the raw code, it’s dynamically generated
malconis has joined #ruby
<lucasb>
argentdrake: still here? do you wanted something like this? 10.times.map { rand 1..5 }.each_with_object(Hash.new(0)) {|e,h| h[e] += 1 }
momomomomo has quit [Quit: momomomomo]
<pizzaops>
so I get uninitialized constant
sarkis has joined #ruby
guacamol_ has joined #ruby
guacamol_ has quit [Client Quit]
<lucasb>
for all: how do I shorten this code? each_with_object(Hash.new(0)) {|e,h| h[e] += 1 }
<aegis3121>
Sure, particularly with terms of precedence.
<adaedra>
`foo bar { }` and `foo bar do end` will do different things.
gambl0re has quit [Remote host closed the connection]
<aegis3121>
But I would say, most of the time, for someone learning it new, it's easier to think of things at their simplest.
* aegis3121
shrugs
gambl0re has joined #ruby
steffkes has quit [Ping timeout: 256 seconds]
<lucasb>
{} for one line, do...end for multi lines, simple rule :)
<aegis3121>
That's also a pretty accepted style, though I've heard others :)
xet7 has quit [Quit: Leaving]
futilegames has joined #ruby
<pizzaops>
Whichever one is more like Perl.
* pizzaops
ducks
<Ox0dea>
lucasb: What do you do when a refactoring changes which you should use?
phreakocious has joined #ruby
<lucasb>
Ox0dea: I... I don't understand :)
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sigurding has quit [Quit: sigurding]
jxs_ has joined #ruby
steffkes has joined #ruby
JakFrist has joined #ruby
futilegames has quit [Client Quit]
<Ox0dea>
It's the same trouble you get into when leaving the braces off single-statement blocks in C, only not near as consequential.
JakFrist has quit [Client Quit]
usershell has quit [Read error: Connection reset by peer]
zachk has quit [Ping timeout: 250 seconds]
tjohnell has quit [Ping timeout: 252 seconds]
mdw has quit [Quit: Sleeping Zzzzz]
lxsameer has quit [Quit: Leaving]
prestorium has quit [Quit: Leaving]
user083 has quit [Quit: leaving]
howdoico1 has joined #ruby
usershell has joined #ruby
<lucasb>
Ox0dea: ah, ok. now I understand what you meant. If it's my code, I'll always follow that rule, changing from braces to keyword and vice versa when I need one or more lines. If it's somebody else code, then... I have to live with it.
usershell has quit [Remote host closed the connection]
aadam21_ has joined #ruby
howdoicomputer has quit [Ping timeout: 276 seconds]
<lucasb>
Interesting, I haven't seen that, but his rule makes sense. thanks for the link, Ox0dea.
aadam21 has quit [Ping timeout: 260 seconds]
<Ox0dea>
Sure thing.
<scrndddy>
hey there. i'm deciding which technology to build an API in and looking at both ruby(grape) and some node frameworks. i'm pretty comfortable in both languages at this point. i know i shouldn't be worried about performance at this point, but is ruby really going to be that much slower than node? i've seen some pretty ugly benchmarks. will i be able to practically scale a ruby app down the road without my head exploding?
agentmeerkat has joined #ruby
argentdrake has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
<apeiros>
scrndddy: if you have to worry about ruby being too slow, you pretty much will have the same issue with node. the difference isn't *that* big.
mdw has joined #ruby
Vertroa has joined #ruby
dlitvak has joined #ruby
<apeiros>
or put differently: chances that bad code fucks up your performance is magnitudes more likely than the actual performance difference.
sandstrom has quit [Quit: My computer has gone to sleep.]
axsuul has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
FernandoBasso has joined #ruby
axsuul has joined #ruby
justmytwospence has joined #ruby
axsuul has quit [Max SendQ exceeded]
<scrndddy>
apeiros: hmm i see
justmytwospence has quit [Client Quit]
axsuul has joined #ruby
<scrndddy>
apeiros: what about the blocking aspect of ruby vs node being async?
justmytwospence has joined #ruby
<scrndddy>
in the end running ruby multithreaded should make up for that in theorym correct?
<scrndddy>
theory*
mdw has quit [Ping timeout: 276 seconds]
kith has quit [Quit: kith]
howdoico1 has quit [Ping timeout: 250 seconds]
malconis has joined #ruby
hannelita has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 256 seconds]
lacuna has quit [Read error: Connection reset by peer]
tomchapin has joined #ruby
malconis has quit [Client Quit]
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
mntnman has quit [Quit: WeeChat 1.3]
tectonic has quit []
<apeiros>
scrndddy: you can code async in ruby just fine. that's not a language property.
Dimik has joined #ruby
sandstrom has joined #ruby
<apeiros>
node lacking threading otoh can be rather bugging.
<apeiros>
though I think I heard there's efforts in that regard.
bMalum has quit [Read error: Connection reset by peer]
cdg_ has joined #ruby
tectonic has joined #ruby
<scrndddy>
it's like the more i look into it the more confused i become about which techology to use
dhollinger has quit [Quit: WeeChat 1.3]
benlieb has quit [Quit: benlieb]
<apeiros>
scrndddy: it won't matter much. you'll probably be able to do it with either.
user083 has joined #ruby
tomjoro has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
jschmid has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BSaboia has joined #ruby
axsuul has joined #ruby
momomomomo has quit [Quit: momomomomo]
phantummm has quit [Ping timeout: 250 seconds]
benlieb has joined #ruby
dhollinger has joined #ruby
kerunaru has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
griffindy has joined #ruby
justmytwospence has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
axsuul has joined #ruby
malconis has joined #ruby
Channel6 has joined #ruby
Darmani has joined #ruby
<Darmani>
Hey kids<33
dlitvak_ has joined #ruby
PedramT has quit [Remote host closed the connection]
dlitvak has quit [Ping timeout: 260 seconds]
jbrhbr has quit [Quit: Leaving.]
Vertroa_ has joined #ruby
PedramT has joined #ruby
malconis has quit [Client Quit]
JuanS has left #ruby [#ruby]
Vertroa has quit [Ping timeout: 265 seconds]
malice has quit [Remote host closed the connection]
davedev2_ has joined #ruby
<lucasb>
[false, true].sample(10) only returns 2 elements :( and .cycle or .cycle.to_a doesn't work. I think have to use a map somehow.
tomchapi_ has joined #ruby
* Darmani
waves to lucasb
tomchapin has quit [Ping timeout: 272 seconds]
<lucasb>
o/ Darmani
davedev24 has quit [Ping timeout: 250 seconds]
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
`[min, foo, max].sort[1]` in the meantime.
smactive has joined #ruby
<maletor>
cool but i don't need a max
<maletor>
it'd be unclear if i specified Float::INFINITY for instnace
<Ox0dea>
Maybe some day.
fmcgeough has quit [Quit: fmcgeough]
<maletor>
my max is unbounded (except by practical limits of memory)
mlakewood has quit [Ping timeout: 264 seconds]
mlakewood has joined #ruby
nerfando has joined #ruby
ellistaa has joined #ruby
atomical_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ellistaa>
i have a class that inherits from API and when it try to call request in API using super from the inherited class my instance variables aren’t being instantiated. can someone tell me how to get them instantiated?
rkazak has quit [Ping timeout: 265 seconds]
lucasb has quit [Quit: leaving]
smactive has quit [Ping timeout: 256 seconds]
PedramT has quit [Ping timeout: 264 seconds]
nerfando has quit [Client Quit]
synthroid has quit []
PedramT has joined #ruby
<volty>
ellistaa: the constructors get called twice - once till super, then all over again // but it's tricky and can't remember well now. can you post that bit of offending code ?
<ducklobster>
bnagy: i didn't actually subclass, i am just trying to mimic the []= syntax
<ducklobster>
shevy: i guess i don't understand the []= syntax in the method definition
<ellistaa>
does anything look wrong with this line of code: response = HTTParty.get(@base_uri + endpoint + '.json', :query => options, :headers => {:user_key => @user_key})
<volty>
Ox0dea: nice code, going to save it in snippets.rb :)
<shevy>
ducklobster the []= is not where your error is at, just read the error message
ta has joined #ruby
mlakewood has joined #ruby
underplank has joined #ruby
maikowblue has quit [Ping timeout: 276 seconds]
<shevy>
for instance if you add one { and one } then that error goes away
mfb2 has quit [Remote host closed the connection]
freerobby has joined #ruby
aadam21_ has quit [Remote host closed the connection]
<Ox0dea>
I question whether that should live on Object, but it's nifty.
failshell has joined #ruby
wedw has joined #ruby
mchu has quit [Quit: mchu]
dlitvak has joined #ruby
<domgetter>
I don't think it goes in Enumerable, since it can be used on more than just enumerable things. The only other candidates are BasicObject and Kernel, but those seem worse...
Xeago has quit [Ping timeout: 245 seconds]
lacuna has quit [Remote host closed the connection]
acke has joined #ruby
pawnbox has joined #ruby
<cscheib>
how would you guys do this (very simple) exercise differently? It took me way longer than it should have to complete this, which means I need to practice a lot more, heh. https://gist.github.com/cscheib/e069b2a92cf453aed8e5
mfb2 has joined #ruby
lacuna has joined #ruby
lemur has joined #ruby
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
cscheib: That could just be `Hash.new(0)`.
<cscheib>
that notation doesn't share the object?
<Ox0dea>
It does, but 0 is a singleton.
<cscheib>
ah ok
<Ox0dea>
Also, you're never mutating, just re-assigning.
<cscheib>
true
<cscheib>
I have just run into the same-object issue and programmed my brain to avoid it with vigilance
mfb2_ has joined #ruby
cpup has quit [Ping timeout: 264 seconds]
TomyLobo has quit [Ping timeout: 240 seconds]
wedw has left #ruby ["NedaMise"]
kies^ has quit [Ping timeout: 265 seconds]
failshell has quit [Ping timeout: 246 seconds]
pawnbox has quit [Ping timeout: 264 seconds]
acke has quit [Ping timeout: 260 seconds]
smo` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mfb2 has quit [Ping timeout: 276 seconds]
Oog has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
binaryplease has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<domgetter>
cscheib: since you don't need the original words, just their lengths, after the split you could .map(&:length) and then shove the different lengths into the hash without having to ask the word in that block, but its up to you
gambl0re has quit []
kalopsian has quit [Ping timeout: 256 seconds]
siaw has joined #ruby
siaw has quit [Client Quit]
Keltia has quit [Changing host]
Keltia has joined #ruby
<cscheib>
domgetter: slick. good call
scripore has quit [Quit: This computer has gone to sleep]
<Ox0dea>
>> 'this is a test'.split.group_by(&:size).map { |k, v| [k, v.size] }.to_h # cscheib
hannelita has quit [Remote host closed the connection]
mdw has quit [Read error: Connection reset by peer]
mdw has joined #ruby
braincrash has joined #ruby
jbrhbr has quit [Quit: Leaving.]
mdw has quit [Client Quit]
phantummm has quit [Quit: WeeChat 1.3]
nunchuck has joined #ruby
YourKicks is now known as Channel6
dmr8 has quit [Quit: Leaving]
zotherstupidguy has joined #ruby
<domgetter>
Ox0dea: #send will call private methods
<domgetter>
but that was outside the scope of the explanation
<Ox0dea>
Fair enough.
<Ox0dea>
[ace]: Hm?
jbrhbr has joined #ruby
<Ox0dea>
The only significant recourse to cleanup would be if Hash#map mapped values and returned a Hash, but of course you sometimes want to map keys too.
<cscheib>
domgetter++
chimche has quit [Quit: Leaving.]
<Ox0dea>
[[:a, 1], [:b, 2]].reduce({}, :[]=) would be nice, but we can't splat here. :/
kalopsian has joined #ruby
lemur has quit [Remote host closed the connection]
mmercer has joined #ruby
<mmercer>
lo all; what is the difference between "ruby" and ":ruby" when referring to variables ?
hannelita has joined #ruby
<cscheib>
the second is a symbol
<cscheib>
mmercer ^
<Ox0dea>
"The building is a symbol, as is the act of destroying it."
<cscheib>
I won't try to go any more in depth, the others will take care of that :P
<domgetter>
mmercer: when there's a colon before a word, it's not a variable
karapetyan has joined #ruby
<domgetter>
it can't refer to a value, it's just itself, like a string
<mmercer>
hmmm
<mmercer>
kk
aadam21_ has joined #ruby
KineticX has quit [Remote host closed the connection]
<domgetter>
they're also used to associate with values in hashes, but that's for when you learn about Hashes
<mmercer>
domgetter: lol, thats ironically what im working through right now; trying to figure out why my Vagrantfile isnt doing what I want it to do XD
aadam21_ has quit [Ping timeout: 246 seconds]
nettoweb has joined #ruby
dlitvak has joined #ruby
kalopsian has quit [Ping timeout: 240 seconds]
<domgetter>
ah okay, well then to be a little more specific, symbols are created once in memory so :hello is the same as a later :hello, so they're efficient in memory to use them to associate with values in hashes
pawnbox has quit [Ping timeout: 240 seconds]
<domgetter>
a hash is just an unordered list of key-value pairs where the keys are unique
roshanavand has quit [Remote host closed the connection]
n0xff has quit [Quit: leaving]
<domgetter>
so if you use symbols (which are made in memory once), it's easy to use unique keys
agent_white has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
<domgetter>
{:a => 3, :b => "hello"} this is a hash where the symbol :a is associated with the value 3, and :b is associated with the string "hello"
casadei has quit [Remote host closed the connection]
<domgetter>
we could have used strings, but it would be slower and possibly more buggy {"a" => 3, "b" => "hello"}
<domgetter>
so if you just think of them as strings for the sake of hashes, you'll be relatively safe