<jaegerca>
If I have a service that accepts data, but I want to be able to have it accept data in different way, like an activerecord object vs the results of an sql query, vs serialized attributes, what pattern would I use to deal with this?
D100 has joined #ruby
griffindy has joined #ruby
JeanCarloMachado has joined #ruby
whathappens has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 245 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
harfangk has joined #ruby
madsa has joined #ruby
tlahtoani is now known as monshelzina
monshelzina is now known as tlahtoani
cgibsonmm has joined #ruby
griffindy has quit [Ping timeout: 260 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
cgibsonmm has quit [Remote host closed the connection]
govg has quit [Ping timeout: 264 seconds]
skweek has quit [Ping timeout: 240 seconds]
cgibsonmm has joined #ruby
cgibsonmm has quit [Remote host closed the connection]
cgibsonm_ has joined #ruby
saslam has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
nobitanobi has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Ping timeout: 245 seconds]
izaac has quit [Ping timeout: 240 seconds]
d^sh has quit [Ping timeout: 240 seconds]
saslam has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp has quit [Remote host closed the connection]
jshjsh has joined #ruby
matp has joined #ruby
d^sh has joined #ruby
cahoots has joined #ruby
JoshS has quit [Ping timeout: 240 seconds]
elado has joined #ruby
izaac has joined #ruby
bruce_lee has quit [Ping timeout: 276 seconds]
bruce_lee has joined #ruby
<elado>
I'm having an issue with some http requests from ruby, and I'm not sure why. code like `require 'open-uri'; open('https://google.com').read` fails with `Net::OpenTimeout: execution expired` on my computer but works on others. ruby 2.4.0 on macOS 10.12.3. any pointers on how to debug this?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 248 seconds]
harai_ has quit [Ping timeout: 264 seconds]
kohta has joined #ruby
<elado>
similar requests from node.js or simple curl work. also, some requests do work for me (e.g. https://twitter.com).
gloscombe_ has quit [Ping timeout: 276 seconds]
duderonomy has joined #ruby
genpaku has quit [Remote host closed the connection]
enterprisey has joined #ruby
xall has joined #ruby
djuber` has quit [Ping timeout: 255 seconds]
sanguisdex has joined #ruby
sanguisdex has quit [Client Quit]
blackwind_123 has quit [Ping timeout: 248 seconds]
<acalycine>
I have a list of names and their corresponding shortened names. I want to see if a variable matches any keys in the list and if it does, make that variable match the shortened name (value) instead. Here's my hash that contains them: https://gist.github.com/tnmto/5f8d93b0a0db8f59ff4a15a61e08dbce.
cgibsonm_ has quit [Remote host closed the connection]
Chagel has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 245 seconds]
ecuanaso has joined #ruby
amclain has quit [Quit: Leaving]
Chagel has joined #ruby
djuber` has joined #ruby
Phenix has joined #ruby
ramfjord has joined #ruby
Chagel has quit [Ping timeout: 240 seconds]
Chagel has joined #ruby
cahoots has quit [Ping timeout: 240 seconds]
<baweaver>
acalycine: what have you tried?
ramfjord has quit [Ping timeout: 240 seconds]
<baweaver>
and notice the use of the word "if" in your original question
<acalycine>
Yep, I could use a set of conditions, it's probably the second part when the variable will be redefined I have some trouble with
<baweaver>
then you've already figured it out
<baweaver>
if you have conditionals you already know the conditions by which it's redefined
<baweaver>
what's the issue?
<baweaver>
Give it about 10-15m of thinking, using a conditional, and see what you come up with
ta has quit [Read error: Connection reset by peer]
<baweaver>
share the code back here once you have.
ta has joined #ruby
<baweaver>
part of programming is being able to think these things through, so I want to see what happens when you've had some time to contemplate it.
jameser_ has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
GarouDan has quit [Quit: Konversation terminated!]
needhelp has joined #ruby
pawnbox has joined #ruby
needhelp is now known as Guest13669
<Guest13669>
hi, i'm a pretty new ruby coder, i wonder how i can add different parts of an array? like it's ["1", "2", "3", "3", "2", "1"], and i want to 1 + 2 + 3 and 3 + 2 + 1 then compare the sums
jtdowney has quit [Quit: ZNC]
pawnbox has quit [Ping timeout: 264 seconds]
<Guest13669>
should i use array.inject or something?
yfeldblu_ has quit [Remote host closed the connection]
<Guest13669>
In Russia regular bus tickets usually consist of 6 digits. The ticket is called lucky when the sum of the first three digits equals to the sum of the last three digits. Write a function to find out whether the ticket is lucky or not.
<Guest13669>
then they test with a lot of numbers so i can't really fool it
nofxx has joined #ruby
<baweaver>
Then find a way to get the array into two parts
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
brandon_ has quit [Ping timeout: 255 seconds]
xall has quit [Ping timeout: 245 seconds]
brandon_ has joined #ruby
pawnbox has quit [Ping timeout: 276 seconds]
triangles3 has joined #ruby
hutch34 has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
johnny56_ has joined #ruby
kht has joined #ruby
triangles2 has quit [Ping timeout: 248 seconds]
tmtwd has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
zapata has quit [Quit: WeeChat 1.7]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
markholmes has joined #ruby
danielpclark has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 240 seconds]
nofxxx has joined #ruby
nofxx has quit []
bruce_lee has quit [Read error: Connection reset by peer]
danielpclark has joined #ruby
VladGh has quit [Ping timeout: 255 seconds]
Channel6 has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
triangles3 has quit [Quit: Leaving]
VladGh has joined #ruby
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
nowhereman has quit [Ping timeout: 260 seconds]
kht has quit [Ping timeout: 256 seconds]
nobitanobi has joined #ruby
xall has joined #ruby
xall_ has joined #ruby
xall has quit [Ping timeout: 240 seconds]
xall_ has quit [Ping timeout: 256 seconds]
dagelf has quit [Remote host closed the connection]
dagelf has joined #ruby
tlahtoani has quit [Quit: Connection closed for inactivity]
huddy has quit [Quit: Connection closed for inactivity]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AnoHito_ has quit [Read error: Connection reset by peer]
aryaching has joined #ruby
charliesome has joined #ruby
AnoHito_ has joined #ruby
patarr has joined #ruby
cschneid_ has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 255 seconds]
nobitanobi has quit [Remote host closed the connection]
kht has joined #ruby
Channel6 has quit [Quit: Leaving]
jetpack_joe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
blackbom1 has quit [Ping timeout: 245 seconds]
ifctj has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 240 seconds]
kht has quit [Ping timeout: 245 seconds]
pawnbox has joined #ruby
Phenix is now known as Teddy
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
sanguisdex has joined #ruby
saslam_ has joined #ruby
sanguisdex has quit [Client Quit]
saslam has quit [Ping timeout: 240 seconds]
dc4 has joined #ruby
Toordog- has joined #ruby
<Toordog->
hi, i'm following a short tutorial about using ruby to perform api call and use URI.encode_www_form but for some reason, the line from the tutorial is not working. https://hastebin.com/depikuqopu.coffeescript
nadir has quit [Quit: Connection closed for inactivity]
<Toordog->
the book i'm following was written for a previous version of the API i think
<Toordog->
from the puppetdb documentation about converting from previous version to latest, i don't see anything wrong other than the URL to reach the endpoint that changed.
<apeiros>
so the complaint comes from puppetdb, not ruby?
<Toordog->
but the ruby function to encode the URI is confusing me and i cannot figure out how the url would look like to compare with the doc
<Toordog->
apeiros i try to resolve an issue with puppetdb api query, but i use ruby to do it ...
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
that much I understood. but is it a ruby exception because a ruby method misses a parameter, or is it the puppetdb API which returns an error?
ta has quit [Read error: Connection reset by peer]
<Toordog->
at this point the puppetdb return an error because i malform my URI, I would like to be able to translate the parameter pass in the function encode_www_form into the final URI so i can compare with teh doc if something is wrong.
<Toordog->
is it possible?
djbkd has joined #ruby
tomphp has joined #ruby
blackbom1 has joined #ruby
karapetyan has quit [Remote host closed the connection]
pawnbox has joined #ruby
pawnbox has quit [Remote host closed the connection]
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
lenwood has joined #ruby
ta has joined #ruby
blackbom1 has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
brent__ has joined #ruby
yfeldblum has quit [Quit: Leaving...]
Burgestrand has joined #ruby
blackwind_123 has joined #ruby
hahuang65 has quit [Ping timeout: 255 seconds]
brent__ has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
karapetyan has joined #ruby
<apeiros>
Toordog-: sorry, reallife interrupted
karapetyan has quit [Remote host closed the connection]
<Toordog->
don't worry :) middle of the night for me,
<apeiros>
Toordog-: yes, it is possible. all stuff you transmit via http is just text after all (well, or binary, but encode_www_form isn't binary)
<Toordog->
ok
karapetyan has joined #ruby
<apeiros>
hm, and http2 is binary too I guess. but I assume you're not using http2 :D
karapetyan has quit [Remote host closed the connection]
<Toordog->
i don't believe i use http2
<Toordog->
or i haven't seen it specified anywhere
<apeiros>
I'm not even sure net/http supports it yet
phaza_ has joined #ruby
pawnbox has joined #ruby
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
lxsameer has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
patarr has joined #ruby
Mia has quit [Ping timeout: 245 seconds]
karapetyan has joined #ruby
cschneid_ has joined #ruby
karapetyan has quit [Read error: Connection reset by peer]
<matthewd>
acalycine: You'll need to get the value from each hash, to decide whether it's the one you're looking for -- but the main point is the iteration over the array
<matthewd>
apeiros: Heh, you were being actually helpful, so ¯\_(ツ)_/¯
<apeiros>
matthewd: sure, but it's IMO better if it's a single person who has a plan than rando's shouting stuff (even if helpful)
<apeiros>
at least I hate it when I have a plan on how to lead somebody to their solution and others disrupt it with helpful shouts :)
<matthewd>
acalycine: Is this your data, btw, or from elsewhere?
<acalycine>
From somewhere else.
<matthewd>
Okay, I won't bother telling you that the venueName choices seem unwise, then :)
<acalycine>
Haha, how so?
<matthewd>
Sponsorships change; these are likely to not line up year to year
balazs has quit [Remote host closed the connection]
jhack has quit [Client Quit]
jhack has joined #ruby
acalycine has quit [Quit: bye]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has joined #ruby
jameser has joined #ruby
jameser has quit [Client Quit]
hutch34 has quit [Ping timeout: 240 seconds]
blackbom1 has joined #ruby
jameser has joined #ruby
markholmes has quit [Ping timeout: 255 seconds]
jetpack_joe has joined #ruby
milardovich has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tmtwd has joined #ruby
millerti has joined #ruby
milardovich has quit [Ping timeout: 258 seconds]
Devalo has joined #ruby
kobain has joined #ruby
leitz has joined #ruby
renchan has joined #ruby
Devalo has quit [Ping timeout: 264 seconds]
jameser has joined #ruby
dionysus69 has joined #ruby
tmtwd has quit [Ping timeout: 240 seconds]
jameser has quit [Client Quit]
jameser has joined #ruby
whiteline_ has joined #ruby
polysics has quit [Remote host closed the connection]
whiteline_ has quit [Remote host closed the connection]
polysics has joined #ruby
byte512 has joined #ruby
JoshS has joined #ruby
jared_nyc has quit [Quit: Connection closed for inactivity]
jshjsh has joined #ruby
tlahtoani has joined #ruby
pawnbox has quit [Remote host closed the connection]
UserJosh has quit [Ping timeout: 256 seconds]
nankyokusei has joined #ruby
polysics has quit [Ping timeout: 245 seconds]
JoshS has quit [Ping timeout: 256 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aryaching has joined #ruby
jameser has joined #ruby
shinnya has joined #ruby
Rodya_ has joined #ruby
markholmes has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
nankyokusei has quit [Ping timeout: 256 seconds]
govg has quit [Ping timeout: 240 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
dionysus70 is now known as dionysus69
milardovich has joined #ruby
milardovich has quit [Read error: Connection reset by peer]
<leitz>
I think my brain is melting. I've been watching Robert Martin's Clean Code videos and reading the book. Working on the same code I started two years ago when I started getting into Ruby. Trying to face all the refactoring that needs to be done...
blackmesa has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
milardovich has quit [Client Quit]
iwmrby has joined #ruby
jhack has quit [Quit: jhack]
nankyokusei has joined #ruby
renchan has quit [Remote host closed the connection]
nobitanobi has joined #ruby
nobitanobi has quit [Read error: No route to host]
nobitanobi has joined #ruby
<leitz>
Is it reasonable to have an instance of a class be passed to a different class for modifications?
polysics has joined #ruby
nobitanobi has quit [Ping timeout: 255 seconds]
pawnbox has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simmib has quit [Remote host closed the connection]
JoshS has joined #ruby
simmib has joined #ruby
markholmes has quit [Remote host closed the connection]
jshjsh has quit [Ping timeout: 256 seconds]
EckT_ has joined #ruby
blackmesa has joined #ruby
EckT has quit [Ping timeout: 248 seconds]
simmib has quit [Remote host closed the connection]
simmib_ has joined #ruby
jay_east has joined #ruby
djuber` has joined #ruby
jay_east has quit [Max SendQ exceeded]
karapetyan has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
leitz has quit [Quit: Nappy time]
simmib_ has quit [Ping timeout: 260 seconds]
railswebdev has joined #ruby
Guest69 has joined #ruby
grh has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
polysics has quit []
sylario has joined #ruby
vnzvg has joined #ruby
karapetyan has quit [Remote host closed the connection]
jameser has joined #ruby
ryan_notabot has joined #ruby
lenwood has quit [Ping timeout: 258 seconds]
lxsameer has joined #ruby
ryan_notabot has quit [Remote host closed the connection]
ryan_notabot has joined #ruby
Azure has joined #ruby
DLSteve has joined #ruby
jameser has quit [Max SendQ exceeded]
karapetyan has joined #ruby
pragmaticus has joined #ruby
Rodya_ has quit [Quit: Leaving...]
mwlang has joined #ruby
blackbom1 has quit [Ping timeout: 252 seconds]
tomphp has joined #ruby
matp has quit [Remote host closed the connection]
matp has joined #ruby
ifctj has quit [Ping timeout: 258 seconds]
karapetyan has quit [Ping timeout: 245 seconds]
leitz has joined #ruby
leitz has quit [Client Quit]
EckT_ has quit [Read error: Connection reset by peer]
UnknownSoldier is now known as Mumm-ra
EckT has joined #ruby
nadir has joined #ruby
pawnbox has joined #ruby
jameser has joined #ruby
nobitanobi has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
pilne has joined #ruby
montyboy has quit [Ping timeout: 245 seconds]
xen0fon has joined #ruby
montyboy has joined #ruby
hutch34 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Mumm-ra is now known as Tau
dviola has quit [Quit: WeeChat 1.7]
xall_ has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
dionysus69 has joined #ruby
lenwood has joined #ruby
JeanCarloMachado has joined #ruby
vnzvg has quit [Remote host closed the connection]
karapetyan has joined #ruby
EckT_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
EckT has quit [Ping timeout: 264 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
xall_ has quit [Ping timeout: 240 seconds]
ocbtec has joined #ruby
adfg has joined #ruby
montyboy has quit [Ping timeout: 240 seconds]
montyboy has joined #ruby
pawnbox has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 248 seconds]
xen0fon has quit [Ping timeout: 255 seconds]
naftilos76 has joined #ruby
jshjsh has joined #ruby
Silthias1 has joined #ruby
Devalo has joined #ruby
Silthias has quit [Ping timeout: 256 seconds]
JoshS has quit [Ping timeout: 245 seconds]
hutch34 has joined #ruby
govg has joined #ruby
JeanCarloMachado has quit [Ping timeout: 256 seconds]
xall_ has joined #ruby
EckT_ has quit [Quit: -a- IRC for Android 2.1.32]
Devalo has quit [Ping timeout: 264 seconds]
nankyokusei has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 258 seconds]
karapetyan has joined #ruby
lenwood has quit [Ping timeout: 255 seconds]
shinnya has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
nobitanobi has quit [Remote host closed the connection]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has joined #ruby
patarr has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
adfg has quit [Remote host closed the connection]
pawnbox has joined #ruby
karapetyan has quit [Remote host closed the connection]
<leitz>
If you want to include a mixin that is a separate file, you also have to require it?
hutch34 has quit [Ping timeout: 240 seconds]
blackbom1 has joined #ruby
simmib has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
chouhoulis has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
blackbom1 has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 240 seconds]
Devalo has joined #ruby
xall_ has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
leitz has quit [Quit: Nappy time]
karapetyan has quit [Ping timeout: 240 seconds]
simmib has quit [Remote host closed the connection]
simmib_ has joined #ruby
simmib_ has quit [Remote host closed the connection]
simmib_ has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
renchan has joined #ruby
tlahtoani has quit [Quit: Connection closed for inactivity]
Anonymoose2 has joined #ruby
simmib_ has quit [Remote host closed the connection]
simmib_ has joined #ruby
reverberations has quit [Ping timeout: 240 seconds]
Channel6 has joined #ruby
dcluna has quit [Ping timeout: 240 seconds]
dcluna has joined #ruby
<apeiros>
include operates on modules
<apeiros>
require operates on files
<apeiros>
so yes, you have to load the code containing the module before including it
<apeiros>
oh dear, they went offline again?
simmib_ has quit [Ping timeout: 256 seconds]
hanmac has quit [Ping timeout: 256 seconds]
roflmyeggo has joined #ruby
malconis has joined #ruby
simmib has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
simmib has quit [Remote host closed the connection]
<agent_white>
Nilium: Because zsh is handling the IO and passing it into irb. Right?
<Nilium>
No.
<agent_white>
(I'm not entirely sure, just after a quick gooble search I'm seeing some other issues similar that have been solved with switching over to bash)
<verumnost>
tbh I've been using it for a year like this
<verumnost>
zsh I mean
<verumnost>
I don't know what happened
<agent_white>
Oh! So it's been fine before? And did you try seeing what happens when you switch to using bash?
<agent_white>
Nilium sounds like he knows better than I.
ryan_notabot has joined #ruby
<verumnost>
agent_white: yes and no
karapetyan has quit [Remote host closed the connection]
<Nilium>
What OS are you using?
<Nilium>
Nevermind, I see osx above.
<verumnost>
yeap
karapetyan has joined #ruby
<agent_white>
verumnost: Yeah I'm not sure; just looks like it has something to do with zsh not using readline() but its own version of it (ZLE).
* agent_white
shrugs
<Nilium>
When you start irb, do you have a prompt showing irb(main):001:0> or something?
bkxd has joined #ruby
lanc has quit [Quit: zzZZZZzzZZZZzzZZzzZZZZzzzzzzzzz]
<verumnost>
Nilium: yes of course
<Nilium>
K, so it's at least running irb and not straight ruby.
<Nilium>
Can you start a new terminal that goes directly to bash without hitting zsh?
<verumnost>
bash prompt appears like "bash-3.2$"
<verumnost>
hmm I have no idea how
<verumnost>
let me try
bkxd has quit [Ping timeout: 240 seconds]
govg has joined #ruby
grh has quit [Ping timeout: 240 seconds]
<Nilium>
And how'd you install Ruby?
<Nilium>
Also, other option would be to just disable oh-my-zsh and start a new terminal.
<Nilium>
oh-my-zsh adds aliases for a few things that can interfere with things. I usually just comment them out, but I mostly just want to rule out zsh because I don't think it's the cause.
karapetyan has quit [Ping timeout: 240 seconds]
<verumnost>
rvm
hutch34 has joined #ruby
cdg has joined #ruby
<verumnost>
I would have uninstalled it at first but I have been using it for a year
<Nilium>
Can you disable rvm and start irb?
<verumnost>
what does it have to do ? rvm is for keeping different ruby versions
<Nilium>
It does some interesting things to your shell to do that.
<Nilium>
Also, type 'alias' in your shell and see if irb, cd, ruby, etc. show up
sfiguser__ has joined #ruby
_sfiguser has quit [Ping timeout: 240 seconds]
<verumnost>
no they are not there
<verumnost>
at least irb
<verumnost>
ha
<verumnost>
Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
<verumnost>
I don't know what happened this time , first time I see this
<verumnost>
You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.io/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
Derperperd has joined #ruby
<Nilium>
Did you update OS X recently?
<verumnost>
yes
<Nilium>
That probably did it.
<verumnost>
apple fucked me
<verumnost>
I see
<Nilium>
Weird part is, bash should've complained
last_staff has joined #ruby
<Nilium>
Wait, do you have system bash or a more recent version installed?
cats has quit [Quit: BURN HIS HOUSE DOWN]
bkxd has joined #ruby
<Nilium>
System bash wouldn't complain, an updated version would because it'd be built against a non-system readline.
cats has joined #ruby
<verumnost>
I have no idea
<verumnost>
I mean bash is one of the things it just works
hutch34 has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
Mr_Pancake has quit [Ping timeout: 276 seconds]
Mr_Pancake has joined #ruby
grh has joined #ruby
karapetyan has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
browndawg has quit [Quit: Leaving]
_sfiguser has joined #ruby
sfiguser__ has quit [Ping timeout: 260 seconds]
roflmyeggo has quit [Remote host closed the connection]
dviola has quit [Quit: WeeChat 1.7]
diego1 has joined #ruby
diego1 has quit [Client Quit]
karapetyan has quit [Ping timeout: 255 seconds]
karapetyan has joined #ruby
dionysus69 has joined #ruby
<verumnost>
seems like rvm reinstall all --force is required
Devalo has quit []
<verumnost>
rvm pkg install readline first
<verumnost>
wtf
<agent_white>
verumnost: PS - You should try out pry :) It's irb but more sparkles.
rvca has joined #ruby
bkxd has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.5]
<verumnost>
binding.pry ?
bkxd has quit [Ping timeout: 256 seconds]
nowhereman has quit [Quit: Konversation terminated!]
nowhereman has joined #ruby
chouhoulis has quit [Remote host closed the connection]
danielpclark has quit [Ping timeout: 256 seconds]
karapetyan has quit [Remote host closed the connection]
brent__ has quit [Remote host closed the connection]
montyboy has quit [Ping timeout: 245 seconds]
johnny56_ has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
johnny56_ has joined #ruby
verumnost has quit [Ping timeout: 264 seconds]
grh has quit [Ping timeout: 248 seconds]
minimalism has joined #ruby
bkxd has joined #ruby
dkphenom has joined #ruby
hyperionel has quit [Remote host closed the connection]
nowhereman has quit [Remote host closed the connection]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
danielpclark has joined #ruby
nertzy has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 240 seconds]
montyboy has joined #ruby
JuliusDelta has joined #ruby
rvca has quit [Quit: Leaving]
blackbom1 has joined #ruby
cdg has quit [Remote host closed the connection]
rvca has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Remote host closed the connection]
nankyokusei has quit [Remote host closed the connection]
madhatter has quit [Client Quit]
bkxd has quit [Ping timeout: 252 seconds]
madhatter has joined #ruby
jshjsh has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
xall_ has quit [Ping timeout: 255 seconds]
JeanCarloMachado has joined #ruby
JuliusDelta has quit [Remote host closed the connection]
JuliusDelta has joined #ruby
<darix>
binding.irb?
dionysus69 has joined #ruby
grh has joined #ruby
minimalism has quit [Ping timeout: 258 seconds]
JuliusDelta has quit [Ping timeout: 255 seconds]
Guest69 has joined #ruby
bkxd has joined #ruby
dionysus69 has quit [Quit: dionysus69]
railswebdev has joined #ruby
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
grh has quit [Ping timeout: 255 seconds]
zzxc has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
<zzxc>
Hey everyone, what do people recommend for a development set up now adays?
<szulak>
sublime & terminal ;)
wilbert has quit [Ping timeout: 256 seconds]
<zzxc>
Huh, thats the first reference I've heard to sublime in probably 6 months.
<szulak>
Did you give it a try>
<szulak>
?
<zzxc>
szulak: Yeah I used sublime for a long time, but mostly for Python. I thought it had been dethroned in favor of Atom though.
<szulak>
well, there is never-ending war between Sublime, Atom, Brackets and whatever else exist. I gave each of them 2 weeks, and stayed with Sublime.
dkphenom has joined #ruby
<zzxc>
I understand that. Sublime was nice. Hell of a lot faster and more stable than Atom in my experience.
hutch34 has joined #ruby
<szulak>
that's right
pilne has quit [Quit: Quitting!]
bkxd has joined #ruby
<szulak>
if you're looking for fully featured IDE, as far as I know the only meaningful choice would be RubyMine
agent_white has quit [Quit: bbl]
<zzxc>
I've been trying to get spacemacs set up, but thus far every time I fix something two issues pop up. It might just might just be that I don't grock something correctly.
<zzxc>
This is my first project I've tried building using Ruby so that is entirely like.
dkphenom has quit [Ping timeout: 252 seconds]
pilne has joined #ruby
grh has joined #ruby
<zzxc>
As for RubyMine: I'm a huge fan of IDEs. Its kind of needed for some languages like Java, but I'd rather not take that route unless I can't find a better option.
bkxd has quit [Ping timeout: 248 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
* Nilium
switched to spacemacs for a couple months then went back to vim.
<Nilium>
Oddly enough, an emacs package server breaking is what caused it -- I couldn't get emacs to start because spacemacs tried to auto-update, installed truncated files, and basically left everything inoperable
<Nilium>
So I went back to vim and didn't bother trying to fix it.
ta has quit [Quit: Leaving...]
phenix has joined #ruby
<zzxc>
Nilium: Yeah I'm not a huge fan of how they have there package system set up. I understand why they automcatically clear out other packages, unless you specific otherwise, but its a pain to get anything but what they have set up working.
<Nilium>
Yeah. It's really nice, magit's probably the only thing I sorely miss though.
Cohedrin_ has joined #ruby
<Nilium>
Vim emulation was handy but certain things were unbelievably slow (e.g., g/blah/norm! xyz is a guaranteed coffee break if it hits enough lines).
xlegoman has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.7]
<zzxc>
Yeah I use spacemacs currently for Rust and well Orgmode. Its a pretty nice system for the most part, but it has its pitfalls. Plus I loathe lisp with a passion.
JuliusDelta has joined #ruby
<Nilium>
The lisp bit doesn't bother me as much, and I mainly work in Go, so emacs and vim both have good options there.
<zzxc>
Vim is still kind of in the were position where key pieces are still being updated for async in vim 8.
<Nilium>
Org mode was also nice
bkxd has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
karapetyan has quit [Remote host closed the connection]
<Nilium>
Especially having things like easy to modify tables. That was pretty great.
<Nilium>
Even better since we use GitLab and it can actually render those docs
<zzxc>
Yep. Jekyll also supports orgmode.
govg has quit [Ping timeout: 264 seconds]
grh has quit [Ping timeout: 240 seconds]
<Nilium>
I think the only other thing I didn't like at the time was that I couldn't find a good way to get it to work in a terminal. Startup time's not great on spacemacs, and I couldn't work out the whole emacs server thing at the time.
<Nilium>
I should probably look at setting that up again.
bkxd has quit [Ping timeout: 240 seconds]
Zamyatin has joined #ruby
ta has joined #ruby
karapetyan has joined #ruby
<zzxc>
Yep. Well I might hit up the spacemacs gitter account and see if they can help me troubleshoot if I can't any hints.
rrios has joined #ruby
blackbom1 has joined #ruby
<Nilium>
I should check that out some time. My mistake might've just been going it alone on the whole thing.
<zzxc>
Haha yeah. Chat rooms are great for that type of thing. I'm just sad IRC seem to be falling by the wayside.
<zzxc>
Anyways got to go. Girlfriend just got up, said shes dying, and wants food.
<Nilium>
Ciao
dviola has quit [Quit: WeeChat 1.7]
<zzxc>
Take it easy Nilium & szulak
r__rios has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
gix has quit [Ping timeout: 240 seconds]
johnny56_ has joined #ruby
govg has joined #ruby
bkxd has joined #ruby
blackmesa has joined #ruby
blackbom1 has quit [Ping timeout: 276 seconds]
minimalism has joined #ruby
gix has joined #ruby
ocbtec has quit [Quit: leaving]
bkxd has quit [Ping timeout: 245 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
xen0fon has quit [Quit: xen0fon]
mas886 has joined #ruby
lxsameer has quit [Quit: WeeChat 1.6]
leah2 has quit [Ping timeout: 264 seconds]
ur5us has quit [Ping timeout: 260 seconds]
Azure has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
bkxd has joined #ruby
<mas886>
I'm on a class called "Res" which have some functions on it, how do I run a program from this own class calling it's methods without getting "undeclared"?
<mas886>
maquing a "require" of the same class doesn't seem to work...
ur5us has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
leah2 has joined #ruby
UnknownSoldier has joined #ruby
bkxd has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
johnny56_ has joined #ruby
hutch34 has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
<toretore>
?code mas886
<ruby[bot]>
mas886: We can't help you without your code, please post it to https://gist.github.com
Xeago has quit [Changing host]
Xeago has joined #ruby
Azure|dc has quit [Ping timeout: 248 seconds]
BackEndCoder has quit [Excess Flood]
minimalism has quit [Quit: minimalism]
Guest69 has joined #ruby
railswebdev has joined #ruby
Azure has joined #ruby
BackEndCoder has joined #ruby
last_staff has quit [Quit: last_staff]
hutch34 has quit [Ping timeout: 248 seconds]
brent__ has joined #ruby
minimalism has joined #ruby
hutch34 has joined #ruby
brent__ has quit [Ping timeout: 245 seconds]
bkxd has joined #ruby
__Yiota has joined #ruby
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
jshjsh has joined #ruby
clauswitt has joined #ruby
chouhoulis has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 256 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zzxc>
\q
<zzxc>
err sorry about that
bkxd has joined #ruby
zeroDi has quit [Ping timeout: 264 seconds]
JuliusDelta has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
<ruby[bot]>
Guest13669: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<apeiros>
Guest13669: you have to assing the array to variables
<apeiros>
objects don't have names
<apeiros>
variables do
<Guest13669>
ty
<ljarvis>
oO
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phenix has quit [Quit: Connection closed for inactivity]
<Guest13669>
how tho? i still kinda cant do anything with the arrays like wouldn't i already need a name if i wanna assign them to variables
<ljarvis>
Guest13669: what does this return? ("123456").split("").each_slice(3).to_a
<Guest13669>
[["1", "2", "3"], ["4", "5", "6"]]
<ljarvis>
right, so an array with 2 arrays inside it, correct?
<Guest13669>
yeah
nertzy has quit [Ping timeout: 258 seconds]
<ljarvis>
Guest13669: do you know how variable assignment works?
<Guest13669>
kinda dont know what a variable is
<ljarvis>
in your code, hey and bye are variables
<Guest13669>
yeah
rkazak has quit [Read error: Connection reset by peer]
<ljarvis>
think of them as labels that are assigned to objects. Do you know what objects are?
<Guest13669>
object is like the backbone of ruby, like everything is an object i've heard
<ljarvis>
ok, so talk me through your code. On line 2 you refer to array0, which is a variable you haven't yet defined. What made you do that?
<Guest13669>
just tried to call the first array or the first array within the array kinda
rkazak has joined #ruby
<ljarvis>
ok, but array0 doesn't exist. It doesn't yet mean anything. On line one you have an expression, do you know what that is?
Pongles has quit [Ping timeout: 260 seconds]
<Guest13669>
no sorry
anotherpi has joined #ruby
<anotherpi>
hello!
<ljarvis>
that's ok, it's not important. What is important is that the expression `("123456").split("").each_slice(3).to_a` returns the array you mention. The problem is that the return value isn't assigned anywhere. So it's evaluated but nothing ever happens to it
<ljarvis>
Guest13669: make sense?
Pongles has joined #ruby
<Guest13669>
yeah so i gotta continue writing stuff on the first line before i can use the arrays?
<ljarvis>
bingo. You need to assign it to a variable. You already know how to do that since you do it on line 2 and 3. So give that a go and update your code, then show us what you have
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis>
remember to do it on gist.github.com and not pastebin :)
<anotherpi>
i use guard and emacs. the guard emacs notifier is (for me) anoying. i would like to disable it, did someone have the same problem before ?
<Guest13669>
thansk i'll try :D
<ljarvis>
anotherpi: I'm not sure, but there's a guard IRC channel that might be able to help -- #guard
mikeXsh has quit [Quit: Connection closed for inactivity]
<anotherpi>
oh, ok thanks :)
marsjaninzmarsa has quit [Remote host closed the connection]
JoshS has joined #ruby
msmith has joined #ruby
jshjsh has quit [Ping timeout: 256 seconds]
marsjaninzmarsa has joined #ruby
Mon_Ouie has joined #ruby
genpaku has joined #ruby
Nilium_ is now known as Nilium
<Guest13669>
i gotta confess i don't know how, i'm searching like mad on google but people just do it manually like they don't plan on getting random numbers
<ljarvis>
what are you searching for?
karapetyan has joined #ruby
<Guest13669>
variable ruby, object into variable ruby, array into variable ruby, stuff like that
<ljarvis>
ok, is this definitely the code you want? `("123456").split("").each_slice(3).to_a`
<Guest13669>
well 123456 will be a random number
<Guest13669>
it will be (ticket)
<ljarvis>
ok, but you want to split this random number in half correct?
<Guest13669>
well i want to split it into 3 numbers usually
<ljarvis>
ok, can this ticket only ever be 6 digits long?
patarr has joined #ruby
karapetyan has quit [Ping timeout: 255 seconds]
<Guest13669>
it will be up to 8 in 1 case and as low as nothing in another case
<Guest13669>
but generally 6
<ljarvis>
ok, but lets assume it's 7 at some point, that'll return this: [["1", "2", "3"], ["4", "5", "6"], ["7"]] -- is that what you want?
msmith has quit [Remote host closed the connection]
xlegoman has joined #ruby
msmith has joined #ruby
msmith has quit [Remote host closed the connection]
<Guest13669>
as long as i can discard the last array
JeanCarloMachado has quit [Ping timeout: 258 seconds]
<ljarvis>
ok, and if it's 2, you have [["1", "2"]] -- correct?
<Guest13669>
yeah
<ljarvis>
I'm trying to identify why your code splits the ticket into arrays of 3 numbers and then sums them before comparing the numbers. What's the goal?
<Guest13669>
In Russia regular bus tickets usually consist of 6 digits. The ticket is called lucky when the sum of the first three digits equals to the sum of the last three digits. Write a function to find out whether the ticket is lucky or not. Return true if so, otherwise return false.
patarr has quit [Ping timeout: 256 seconds]
<ljarvis>
brilliant, ok. So, if there's not 6 digits we're not lucky, and can always return false, yeah?
<Guest13669>
yea
<ljarvis>
ok lets start small, do you know what a function is?
pancakebreakfast has joined #ruby
<Guest13669>
well not really tbh
<ljarvis>
ok. Is this specifically a Ruby test? are you learning Ruby?
<Guest13669>
yeah, maybe i should read more before i do tests idk
<ljarvis>
well it depends if it's a Ruby test. I would argue that if it is, it's a bad one. Because Ruby doesn't really have "functions" -- so I imagine if it was a Ruby test, it would not be worded this way
<ljarvis>
Where did this test come from?
hutch34 has joined #ruby
<Guest13669>
codewars
<ljarvis>
What language?
<Guest13669>
a lot of languages but also ruby
cyphase has quit [Ping timeout: 240 seconds]
<ljarvis>
So this test is part of the codewars Ruby tutorial? if so I don't remember it
<Guest13669>
it's just a kata i thought i could do lol
<anotherpi>
ljarvis: 12300321 is a lucky ticket too
<ljarvis>
ah it's a kata, ok
<Guest13669>
logistics was easy but coding it is hard
<ljarvis>
well snap they do actually call it a function, sigh
TheMoonMaster has quit [Quit: Later!]
<ljarvis>
Guest13669: where did you get the each_slice code from?
tristanp has quit [Remote host closed the connection]
<Guest13669>
stackexchange i think, found it by googling it
<ljarvis>
ok, I really think the best advice I can give is to go through the beginners tutorial on Ruby. This will teach things like variables, objects, expressions and functions/methods, which are basic building blocks
<ljarvis>
this test isn't hard, but it's impossible if you don't know these basics
bokayio has quit [Ping timeout: 240 seconds]
nikivi has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
hutch34 has quit [Ping timeout: 248 seconds]
<ljarvis>
and you should be wary copy pasting code. for example, the code you grabbed from stack exchange whilst valid, isn't helpful for this test
toretore has quit [Ping timeout: 260 seconds]
jason^ has quit [Ping timeout: 240 seconds]
pleiosaur has quit [Ping timeout: 240 seconds]
<Guest13669>
hmm
bokayio has joined #ruby
nikivi has joined #ruby
pleiosaur has joined #ruby
jason^ has joined #ruby
JeanCarloMachado has joined #ruby
centrx has quit [Remote host closed the connection]
Andrevan has quit [Quit: WeeChat 1.7]
brent__ has joined #ruby
tristanp has quit [Remote host closed the connection]
<anotherpi>
Guest13669: i just code the solution
<anotherpi>
do you want it?
<ljarvis>
uh
<ljarvis>
come on..
<anotherpi>
lol?
<Guest13669>
i wanna look at it i wont cheat i will just see how it's done i wont submit it for fake kyu
<anotherpi>
it's an exercice, may you want to do it by yourself