<geggam>
it correlates to the mapping and the sort doesnt lose the index.. so i create a dynamic port mapping for autoscaling ( sort of ) cassandra nodes with stunnel configuratons
<geggam>
cassandra isnt autoscaling per se but i have everything ready to do the synchronizing if said db dies
<geggam>
now i can drop this on all the application servers and rest assured they are all connecting to the same system
<geggam>
happy fathers day btw
shinnya has quit [Ping timeout: 240 seconds]
Guest13022 has quit [Remote host closed the connection]
Rodya_ has quit [Remote host closed the connection]
creshiem has quit [Quit: WeeChat 1.8]
Rodya_ has joined #ruby
skweek has joined #ruby
jenrzzz has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby
Sauvin has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
questionaboutrai has joined #ruby
<questionaboutrai>
hello
ornerymoose has quit [Quit: ornerymoose]
confused4life has joined #ruby
<confused4life>
If I have a class C, e.g. String, what is the difference between C.methods and C.instance_methods?
<dragoonis>
effectively I'm looking for static analysis tools for ruby, python ..etc to give the team a sense of consistency
coderhut has joined #ruby
ur5us has quit [Remote host closed the connection]
<dragoonis>
Can someone tell me what the Ruby one is called? or link me to the right place? thanks!
<dragoonis>
Respectively - need code sniffers / static analysis tools to check such compliance
<GorillaApe>
I have a class called Client. Client class uses two types of connections implemented in different classes(ClassA, ClassB). Which is a clean way to provide some kind of events to client instance? For example when ClassB looses connection I want Client to be notified.
<GorillaApe>
I tried delegate but I am not sure whether it is ok
coderhut has quit [Client Quit]
coderhut has joined #ruby
<dragoonis>
ljarvis, i know about rubocop, yeah
coderhut has quit [Client Quit]
Fernando-Basso has joined #ruby
coderhut has joined #ruby
coderhut has quit [Client Quit]
coderhut has joined #ruby
rgr has quit [Quit: rgr]
ketan has joined #ruby
coderhut has quit [Client Quit]
coderhut has joined #ruby
ketan has quit [Ping timeout: 240 seconds]
<elomatreb>
dragoonis: There is no *official* Ruby style guide, if that's what you were looking for. The most commonly used one is probably https://github.com/bbatsov/ruby-style-guide, which Rubocop follows by default
<dminuoso>
elomatreb: There should be.
vuoto has joined #ruby
<dminuoso>
I vote that my style be promoted to the official style _rules_.
<dminuoso>
Clearly my style is superior to yours.
<dragoonis>
elomatreb, thanks! I'm really just looking for the most community adopted one - which rubocop is going with, so that's good
<elomatreb>
I don't know, I always break the official ones because they mandate single quotes which are a pain to type on QWERTZ
marr has joined #ruby
<dminuoso>
elomatreb: Use US layout like a real programmer
<elomatreb>
But how will I umlaut
sekmo has quit [Read error: Connection reset by peer]
bvcosta has quit [Remote host closed the connection]
ryzokuken_ has quit [Quit: Leaving]
<leah2>
ged: hey. for legacy reasons i use bluecloth 1... do you know if anyone implemented fenced code blocks (```) for it?
pupsicle_ is now known as dropsh0t
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
<workmad3>
_mak: depends massively on the size and architecture of the software in question
ledestin has joined #ruby
bvcosta has joined #ruby
brent__ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
mim1k has joined #ruby
zapata has quit [Ping timeout: 255 seconds]
ledestin has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
__Yiota has quit [Client Quit]
brent__ has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ruby
gnufied has joined #ruby
type01 has joined #ruby
<type01>
Hello everyone.
ta_ has joined #ruby
simmaniac has joined #ruby
<dropsh0t>
Hi
zapata has joined #ruby
sysvalve has quit [Ping timeout: 240 seconds]
<type01>
An API I am making a request to is giving some details in the HTTP status (a full sentence). I'm looking to parse that but it looks like net/http has no way to access the raw status and instead response.code returns the number 403 only.
<elomatreb>
As in the words after the status codes?
jameser has joined #ruby
Rodya_ has joined #ruby
<type01>
elomatreb yes
raul782 has joined #ruby
<elomatreb>
Tried response#message?
<type01>
elomatreb it is blank.
<type01>
elomatreb oh sorry message says "Forbidden", but there's an entire sentence after that too.
Rodya_ has quit [Client Quit]
<type01>
elomatreb I verified this with Postman and curl (verbose mode)
<elomatreb>
Personally I'd question the API if it does something like that
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has quit [Ping timeout: 240 seconds]
<octomancer>
i'd say that the server is pushing it's luck to abuse the reason-phrase like that
<octomancer>
much better to return it in an X- header
<type01>
elomatreb exactly :D me too. Just that I have to live with it.
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
nanoz has joined #ruby
patarr has joined #ruby
shinnya has joined #ruby
Mutter has joined #ruby
<dionysus69>
I need help with string manipulation and setting up validation. i need to validate if the number is 9 digit long and that all of the string chars are digits. also I need to verify that first 3 digits are of following combination tel_codes = [514, 551, 555, 557, 558, 559, 568, 570, 571, 574, 577, 591, 592, 593, 595, 596, 597, 598, 599] and I also need to escape string before doing all this, people may enter number as 599-01-10-12 or 593110022 or
<dionysus69>
when it comes to escaping, I need to escape anything but 0-9
psychicist__ has joined #ruby
A124 has quit [Quit: '']
<elomatreb>
By escaping you mean stripping them from the string?
<dionysus69>
yep, stripping down only to 9 digit number sequence
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
<dionysus69>
if it is escaped and there are no 9 digits and first 3 digits dont match any of those codes, i need to throw validation error in rails
<dionysus69>
if you think I should rather use regex for this, let me know. I am not sure which one is better in terms of performance or other variables
DLSteve has joined #ruby
cadillac__ has joined #ruby
<elomatreb>
You can use String#tr to strip everything but numbers first, and then I'd probably check the length and then the first three digits
Mutter has quit [Remote host closed the connection]
<dionysus69>
I would check first 3 digits with substring(3) method
<dionysus69>
ok let me try :)
bvcosta has quit [Remote host closed the connection]
A124 has joined #ruby
kasisnu_ has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
rkazak has joined #ruby
kasisnu has quit [Ping timeout: 246 seconds]
aenialis has joined #ruby
rkazak has quit [Client Quit]
<dragoonis>
Hey dionysus69
<dionysus69>
yep
<dionysus69>
haha nope, from Georgia
<dragoonis>
k
<dragoonis>
diff person
<dionysus69>
no prob ))
aenialis has quit [Ping timeout: 255 seconds]
haylon has joined #ruby
aenialis has joined #ruby
nankyokusei has joined #ruby
camonz has joined #ruby
Bhootrk_ has quit [Read error: Connection reset by peer]
chat has joined #ruby
type01 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mutter has quit [Client Quit]
<Cork>
elomatreb: thx for the help!
hutch34 has joined #ruby
oleo has joined #ruby
PatrikasZvaigzde has joined #ruby
jameser has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
<dragoonis>
If I wanted to check if a cookbook is correct, kind of like static analysis - what's the tool for this?
<dragoonis>
just to make sure the cookbook is passable, and executable (on target server), but I want to check such things are build time on the CI servers
jameser has quit [Client Quit]
konsolebox has joined #ruby
bsamorim has joined #ruby
<bsamorim>
Hello, guys! Do blank spaces have semantic value in ruby?
<ljarvis>
dont do that if you are on ruby 2.2+ or can alias methods
<ljarvis>
that's the worst way to do if of all possible ways
<ineb>
i would not suggest it either
conta has quit [Ping timeout: 246 seconds]
hobodave has joined #ruby
Mutter has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
brent__ has quit [Ping timeout: 260 seconds]
patarr_ has joined #ruby
Cohedrin has joined #ruby
Mutter has quit [Client Quit]
Mutter has joined #ruby
<ineb>
however, it is part of the language. methods can be treated like blocks , procs, lambdas and therefore can be bind/unbind, passed around and called in whatever context you like
patarr has quit [Ping timeout: 268 seconds]
<ineb>
and it can be useful, for example in autoloading systems
<ineb>
like active support
synthro__ has quit [Remote host closed the connection]
Mutter has quit [Remote host closed the connection]
joonty has quit [Quit: This computer has gone to sleep]
joonty has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
ozcanesen has joined #ruby
kies has quit [Ping timeout: 240 seconds]
rgiscard has quit [Quit: Gone fishing]
Silthias has joined #ruby
nitric has joined #ruby
im0nde has quit [Ping timeout: 246 seconds]
cam27 has quit [Ping timeout: 268 seconds]
cam27_ has joined #ruby
brent__ has joined #ruby
yokel has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
Mutter has joined #ruby
Burgestrand has joined #ruby
patarr_ has quit [Ping timeout: 246 seconds]
Mutter has quit [Client Quit]
el_ocho[m] has quit [Ping timeout: 255 seconds]
el_ocho[m] has joined #ruby
marxarelli has joined #ruby
dionysus69 has joined #ruby
yokel has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
ivanskie has joined #ruby
<ivanskie>
hi
Mutter has joined #ruby
<ivanskie>
is it possible to check which platform ruby is running in, and do a require '' based on that?
<ljarvis>
ivanskie: yep
Burgestrand has quit [Quit: Closing time!]
<ivanskie>
cool
type01 has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
rgiscard has joined #ruby
Mutter has quit [Remote host closed the connection]
hobodave has joined #ruby
synthroid has joined #ruby
marxarelli is now known as marxarelli|afk
<mikecmpbll>
i prefer the worst ways to do things
<mikecmpbll>
way more fun that way.
MrBismuth has joined #ruby
MrBusiness has quit [Ping timeout: 258 seconds]
gusrub has joined #ruby
ohjn__ has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
renchan has quit [Quit: Leaving...]
patarr has joined #ruby
<baweaver>
mikecmpbll: #perl is over thataway <-
eightlimbed has joined #ruby
<dminuoso>
mikecmpbll: worst-case program.
[ohjn] has quit [Ping timeout: 246 seconds]
amclain has joined #ruby
nobitanobi has quit [Remote host closed the connection]
mikecmpbll has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
aufi has quit [Quit: Leaving]
patarr has joined #ruby
ryzokuken_ has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
<ivanskie>
speaking of scope... how can I create a logger thing. that is accessible anywhere in the app?
<ivanskie>
i already have a support module which has methods available everywhere. but im just scratching my head how can I still be able to do logger.info() or logger.warn().. etc etc
duderonomy has joined #ruby
<ivanskie>
you can't do logger.{sev}(msg) can you?
gusrub has quit [Remote host closed the connection]
<ivanskie>
google doesn't seem to be helping right now or im just not asking the right question
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli|afk is now known as marxarelli
patarr has joined #ruby
centrx has quit []
<ivanskie>
oooh mixlib-log
roshanavand has quit [Quit: roshanavand]
aenialis has quit [Ping timeout: 240 seconds]
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
Eiam has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
ketan has quit [Ping timeout: 260 seconds]
Mutter has joined #ruby
geggam has quit [Remote host closed the connection]
nrk has quit [Ping timeout: 240 seconds]
im0nde has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
kasisnu has quit [Remote host closed the connection]
theunraveler has quit []
dragoonis has quit [Quit: This computer has gone to sleep]
Mutter has quit [Client Quit]
Emmanuel_Chanel has joined #ruby
Mutter has joined #ruby
Rodya_ has joined #ruby
meshsmith has quit [Remote host closed the connection]
A_ron has joined #ruby
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby
tenderlove has quit [Remote host closed the connection]
patarr has quit [Ping timeout: 268 seconds]
Silthias has left #ruby [#ruby]
solocshaw has joined #ruby
Mutter has quit [Ping timeout: 246 seconds]
resnik2 has joined #ruby
__Yiota has joined #ruby
A_ron has quit [Client Quit]
Dimik has joined #ruby
<resnik2>
Trying to read a bundle of certs via openssl routines. It seems I'm missing something.
jinie_ has joined #ruby
coderhut has joined #ruby
skweek has joined #ruby
psychicist__ has joined #ruby
ferr has quit [Quit: WeeChat 1.8]
daivyk has joined #ruby
andrzejk_ has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
nrk has joined #ruby
resnik2 has quit [Quit: Leaving]
joelwallis has joined #ruby
patarr has quit [Ping timeout: 255 seconds]
antgel has quit [Ping timeout: 260 seconds]
duderonomy has quit [Ping timeout: 240 seconds]
aenialis has joined #ruby
gusrub has joined #ruby
im0nde has quit [Ping timeout: 258 seconds]
cam27_ has quit [Quit: cam27_]
TomyWork has quit [Ping timeout: 240 seconds]
ryzokuken_ has quit [Remote host closed the connection]
ryzokuken_ has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
__Yiota has joined #ruby
Hunter1 has quit [Remote host closed the connection]
patarr has joined #ruby
Hunter1 has joined #ruby
millerti has joined #ruby
kies has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
lmc has joined #ruby
im0nde has joined #ruby
hobodave has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
DLSteve has joined #ruby
Rodya_ has quit [Quit: Leaving...]
meshsmith has joined #ruby
type01 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Vingador has joined #ruby
simmaniac has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
hobodave has quit [Ping timeout: 260 seconds]
cam27 has joined #ruby
hobodave_ has joined #ruby
PaulCape_ has quit [Quit: .]
gmoney has joined #ruby
PaulCapestany has joined #ruby
aenialis has quit [Ping timeout: 240 seconds]
workmad3_ has joined #ruby
sysvalve has joined #ruby
ryzokuken_ has quit [Ping timeout: 260 seconds]
workmad3 has quit [Disconnected by services]
workmad3_ is now known as workmad3
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mitt3ns has joined #ruby
atom3_ has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
solocshaw1 has joined #ruby
eightlimbed has quit [Ping timeout: 255 seconds]
ForeignBiscuit has joined #ruby
ResidentBiscuit has quit [Ping timeout: 240 seconds]
ben__ has joined #ruby
marr123 has joined #ruby
peteretep_ has joined #ruby
Aeyris_ has joined #ruby
valentin has joined #ruby
dukedave_ has joined #ruby
marr has quit [Killed (verne.freenode.net (Nickname regained by services))]
marr123 is now known as marr
stephenh_ has joined #ruby
err_ok_ has joined #ruby
wsmoak_ has joined #ruby
ewilliam____ has joined #ruby
Murda has joined #ruby
_DanN_ has joined #ruby
async_pr1 has joined #ruby
rprimus_ has joined #ruby
birdyond1ugs has joined #ruby
rprimus_ is now known as Guest22648
saschavo1d has joined #ruby
unreal_ has joined #ruby
radic_ has joined #ruby
jottr_ has joined #ruby
ForeignBiscuit has quit [Ping timeout: 260 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
znz_jp0 has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
x0f has joined #ruby
BackEndCoder_ has joined #ruby
rideh- has joined #ruby
lel- has joined #ruby
canton7_ has joined #ruby
kitallisii has joined #ruby
Bilge- has joined #ruby
omninonsense has joined #ruby
unsymbol_ has joined #ruby
DarkArc has joined #ruby
leonthemisfit_ has joined #ruby
nfsnobody- has joined #ruby
solocshaw has quit [*.net *.split]
el_ocho[m] has quit [*.net *.split]
jottr has quit [*.net *.split]
aurelien has quit [*.net *.split]
saschavoid has quit [*.net *.split]
vali has quit [*.net *.split]
agent_white has quit [*.net *.split]
user has quit [*.net *.split]
mlehrer has quit [*.net *.split]
bathtub_shark has quit [*.net *.split]
lel has quit [*.net *.split]
unsymbol has quit [*.net *.split]
err_ok has quit [*.net *.split]
dukedave has quit [*.net *.split]
Aeyris has quit [*.net *.split]
gbailey has quit [*.net *.split]
stephenh has quit [*.net *.split]
ewilliam___ has quit [*.net *.split]
wsmoak has quit [*.net *.split]
peteretep has quit [*.net *.split]
DK2 has quit [*.net *.split]
\13k has quit [*.net *.split]
BackEndCoder has quit [*.net *.split]
rileyy has quit [*.net *.split]
radic has quit [*.net *.split]
sparr has quit [*.net *.split]
giraffe has quit [*.net *.split]
ejnahc has quit [*.net *.split]
BTRE has quit [*.net *.split]
rideh has quit [*.net *.split]
voltai[m] has quit [*.net *.split]
heftig has quit [*.net *.split]
SCHAPiE has quit [*.net *.split]
aredridel has quit [*.net *.split]
znz_jp has quit [*.net *.split]
ben_____ has quit [*.net *.split]
birdyondrugs has quit [*.net *.split]
async_prince has quit [*.net *.split]
unreal has quit [*.net *.split]
Dark_Arc has quit [*.net *.split]
balazs_ has quit [*.net *.split]
Bilge has quit [*.net *.split]
atom3 has quit [*.net *.split]
akkad has quit [*.net *.split]
drcode has quit [*.net *.split]
canton7 has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
nebiros has quit [*.net *.split]
rprimus has quit [*.net *.split]
kitallis has quit [*.net *.split]
x0f_ has quit [*.net *.split]
nfsnobody has quit [*.net *.split]
leonthemisfit has quit [*.net *.split]
_br___ has quit [*.net *.split]
_DanN__ has quit [*.net *.split]
klaas has quit [*.net *.split]
snapcase has quit [*.net *.split]
_moep_ has quit [*.net *.split]
bkutil has quit [*.net *.split]
solocshaw1 is now known as solocshaw
canton7_ is now known as canton7
BackEndCoder_ is now known as BackEndCoder
kitallisii is now known as kitallis
Aeyris_ is now known as Aeyris
wsmoak_ is now known as wsmoak
dukedave_ is now known as dukedave
stephenh_ is now known as stephenh
peteretep_ is now known as peteretep
Elysia has joined #ruby
\13k has joined #ruby
err_ok_ is now known as err_ok
meshsmith has quit [Remote host closed the connection]
aredridel has joined #ruby
_br__ has joined #ruby
akkad has joined #ruby
iamayam has quit [Ping timeout: 240 seconds]
duracrisis has quit [Ping timeout: 240 seconds]
mlehrer has joined #ruby
ejnahc has joined #ruby
giraffe has joined #ruby
rileyy has joined #ruby
radic_ has quit [Ping timeout: 260 seconds]
nadir has joined #ruby
gbailey has joined #ruby
x0f has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 260 seconds]
ujjain has quit [Ping timeout: 260 seconds]
user has joined #ruby
x0f has joined #ruby
iamayam has joined #ruby
DK2 has joined #ruby
duracrisis has joined #ruby
radic has joined #ruby
ResidentBiscuit has joined #ruby
klaas has joined #ruby
_moep_ has joined #ruby
ujjain has joined #ruby
nebiros has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
BTRE has joined #ruby
SCHAPiE has joined #ruby
sparr has joined #ruby
Murda has quit [Quit: Murda]
el_ocho[m] has joined #ruby
Sauvin has quit [Ping timeout: 255 seconds]
Burgestrand has joined #ruby
aenialis has joined #ruby
balazs_ has joined #ruby
voltai[m] has joined #ruby
heftig has joined #ruby
vqrs has quit [Ping timeout: 260 seconds]
infernix has quit [Ping timeout: 260 seconds]
vircung has quit [Ping timeout: 260 seconds]
bkutil has joined #ruby
snapcase has joined #ruby
vircung has joined #ruby
vqrs has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
coderhut has quit [Quit: Page closed]
ResidentBiscuit has quit [Read error: Connection reset by peer]
Burgestrand has quit [Quit: Closing time!]
mtkd has joined #ruby
bvcosta has quit [Remote host closed the connection]
nupizdets has joined #ruby
bvcosta has joined #ruby
nobitanobi has joined #ruby
Dimik has quit [Ping timeout: 255 seconds]
Danny has joined #ruby
infernix has joined #ruby
Danny is now known as Guest12863
im0nde has quit [Quit: im0nde]
nobitanobi has quit [Ping timeout: 240 seconds]
im0nde has joined #ruby
uZiel has quit [Remote host closed the connection]
duderonomy has joined #ruby
bvcosta has quit [Ping timeout: 255 seconds]
patarr has quit [Ping timeout: 268 seconds]
BSaboia has joined #ruby
aenialis has quit [Quit: WeeChat 1.8]
uZiel has joined #ruby
roshanavand has joined #ruby
konsolebox has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
andrzejk_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ResidentBiscuit has joined #ruby
graft has quit [Ping timeout: 240 seconds]
joelwallis has quit []
graft has joined #ruby
Papierkorb has quit [Ping timeout: 260 seconds]
cfec0b8d has quit [Ping timeout: 240 seconds]
harfangk has joined #ruby
Cohedrin has joined #ruby
ketan has joined #ruby
lmc has quit [Remote host closed the connection]
lmc has joined #ruby
konsolebox has joined #ruby
im0nde has quit [Quit: im0nde]
patarr has joined #ruby
im0nde has joined #ruby
ketan has quit [Ping timeout: 240 seconds]
jaruga_________ has quit [Quit: jaruga_________]
skweek has quit [Ping timeout: 240 seconds]
lmc has quit [Ping timeout: 240 seconds]
MarkBilk_ has joined #ruby
im0nde has quit [Client Quit]
im0nde has joined #ruby
TomyLobo2 has joined #ruby
lmc has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
andrzejk_ has joined #ruby
MarkBilk has quit [Ping timeout: 246 seconds]
Dimik has joined #ruby
lmc has quit [Client Quit]
<brent__>
I need to right a rspec test for a class method, and however need to stub out what goes on inside that method, whats being called and what variables should be assigned inside the method i'm testing. I can't seem to find any good resource on how to stub out stuff inside the method you are calling
<ineb>
i want a class which auto initializes with certain members with certain values. then on initialize there are required parameters and optional parameters which will use the provided default values in that class. i came up with this but i dont know if its a bad idea or if there are simpler solutions https://paste.xinu.at/S4M/
zapata has quit [Ping timeout: 255 seconds]
<ineb>
i think this could go in a module named 'initializable' or so. so a class can include it and only needs to provide some DEFAULT_OPTS and required parameters.
ivanskie has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
meshsmith has joined #ruby
solocshaw has quit [Ping timeout: 258 seconds]
<elomatreb>
ineb: One problems with solutions like that is that they silently ignore invalid (e.g. typoed) params
gigetoo has quit [Ping timeout: 260 seconds]
kies has quit [Read error: Connection reset by peer]
jjunior_ has quit [Quit: Connection closed for inactivity]
<dropsh0t>
ineb: and you can't override getters or setters.
<dropsh0t>
I've seen that pattern used before. I just think it's messy/lazy.
TomyLobo3 has quit [Ping timeout: 240 seconds]
<elomatreb>
Most of the times if you have that many parameters your class is doing too much anyway
<ineb>
its only for configuration
bvcosta has quit [Remote host closed the connection]
<ineb>
but with some control over the settings
bvcosta has joined #ruby
nupizdets has quit [Ping timeout: 240 seconds]
<dropsh0t>
Use a Struct or something
hutch34 has quit [Ping timeout: 240 seconds]
<ineb>
wasnt able to do it with only mentioning the parameters once.
kies has joined #ruby
<ineb>
could be done with splat now that i think of it tough
bvcosta has quit [Ping timeout: 240 seconds]
simmaniac has joined #ruby
TomyLobo has joined #ruby
sysvalve has quit [Ping timeout: 268 seconds]
weathermaker has joined #ruby
weathermaker has quit [Client Quit]
ResidentBiscuit has quit [Ping timeout: 240 seconds]
jphase has quit [Remote host closed the connection]
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ktreese>
Anyone help me on outputting some variables? My end goal is to output the original hostname, and next to it, the modified value. Ideally, I'd really like to line everything up in a column, but if that's asking too much, then just getting the output for each line side by side would be nice
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ljarvis>
ktreese: you want String#format / String#% or sprintf. You'll have to best guess the widest hostname, though. Otherwise your best shot is to collect them all and keep track of the longest, then pad out the rest when you print them
ldnunes has quit [Quit: Leaving]
<ljarvis>
also you can reduce the 2 branches into 1 that just removes those prefixes
<ktreese>
ok -- looks like 55 is my longest length
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<ktreese>
ljarvis: thx. How do I handle the $2 variables?
bougyman has joined #ruby
bougyman has joined #ruby
velu_aon[m] has quit [*.net *.split]
aidalgol has quit [*.net *.split]
torarne has quit [*.net *.split]
gil_ has quit [*.net *.split]
hsiktas has quit [*.net *.split]
joevandyk has quit [*.net *.split]
RealMarc has quit [*.net *.split]
jtd has quit [*.net *.split]
edgr has quit [*.net *.split]
Muz has quit [*.net *.split]
eregon has quit [*.net *.split]
scott4000 has quit [*.net *.split]
knowtheory has quit [*.net *.split]
sysanthrope has quit [*.net *.split]
redondos has quit [*.net *.split]
graingert has quit [*.net *.split]
edwardly has quit [*.net *.split]
jpinnix has quit [*.net *.split]
arvindsaik has quit [*.net *.split]
g3funk has quit [*.net *.split]
pskosinski has quit [*.net *.split]
herwin has quit [*.net *.split]
inukshuk has quit [*.net *.split]
mc_fail has quit [*.net *.split]
mc_fail_ has joined #ruby
herwin has joined #ruby
arvindsa- has joined #ruby
sysanthrope has joined #ruby
jtd has joined #ruby
edgr has joined #ruby
Muz_ has joined #ruby
pskosinski has joined #ruby
<ljarvis>
ktreese: what do you mean?
inukshuk has joined #ruby
scott4000 has joined #ruby
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
hsiktas has joined #ruby
RealMarc has joined #ruby
pskosinski is now known as Guest11871
knowtheory has joined #ruby
graingert has joined #ruby
jpinnix has joined #ruby
eregon has joined #ruby
<ktreese>
ljarvis: nm. I meant like this. puts "%-55s %s" % [hostname, $2]
patarr_ has quit [Ping timeout: 260 seconds]
g3funk has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
dyyylan has quit [Ping timeout: 240 seconds]
TinkerTyper has quit [Ping timeout: 240 seconds]
bokayio has quit [Ping timeout: 240 seconds]
<ljarvis>
ktreese: yes, that's correct
uranellus_ has quit [Ping timeout: 240 seconds]
<ktreese>
ljarvis: thank you for the help! This gets me what I need :)
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
dyyylan has joined #ruby
bokayio has joined #ruby
skweek has joined #ruby
TinkerTyper has joined #ruby
Guest80106 has joined #ruby
velu_aon[m] has joined #ruby
torarne has joined #ruby
mim1k has joined #ruby
<ktreese>
ljarvis: I am intrigued by reducing the 2 branches into 1. I'm new to ruby, so what does that mean?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<ljarvis>
ktreese: line 5 checks for the presence of some prefixes and then proceeds to remove them in the output, correct?
<ktreese>
correct
Dimik has joined #ruby
<ljarvis>
ktreese: so, check your 2 regexps. They look almost identical, except for this part, right? "(vgt|dev|test|prod|tst|prd)"
<ljarvis>
so, all your code is doing is removing those. Nothing more
<ktreese>
ah -- yes. I'm doing this because some of our legacy hostnames do not have the listed prefixes, thus won't match
<ljarvis>
your regexp on line 7 would match the same string the previous regexp would match, and it's much more simple; so I say just keep that one, and remove those prefixes if they exist when you print the output
<ktreese>
I see -- cool. I'd have to figure out how to do that
patarr has joined #ruby
<ljarvis>
yep :-) anyway, if there's more code you need inside those branches, then you'd better leave it, but if it's this simple, then there's no point in multiple branches when the second branch condition is just a slightly simplified version of the first, and the branch body is almost identical
mim1k has quit [Ping timeout: 258 seconds]
<ktreese>
:ljarvis makes sense. I'll consider refactoring. What I'm doing here is building a role fact for Puppet based on the hostname of the machine
codelurker has joined #ruby
<ljarvis>
cool. Btw, another suggestion: you can use `File.foreach(filename) do |line|` instead of open + each_line
<ktreese>
sweet -- much cleaner. I like it! thx
dropsh0t has quit [Quit: Leaving]
eightlimbed has joined #ruby
hutch34 has joined #ruby
marxarelli has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
simmaniac has quit [Quit: Leaving]
brent__ has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
fxa has quit [Quit: Leaving]
<ktreese>
ljarvis: would removing the prefixes be along the lines of using something like a sed?
<ktreese>
like a slice?
WillC has joined #ruby
Danny has joined #ruby
ltem has quit [Quit: Leaving]
Danny is now known as Guest53821
bobasfs has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
Guest53821 has quit [Ping timeout: 240 seconds]
bobasfs has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
codelurker has quit [Quit: Leaving]
WillC has left #ruby [#ruby]
millerti has joined #ruby
haylon has quit []
pale3 has quit [Read error: Connection reset by peer]
pale3 has joined #ruby
Muz_ is now known as Muz
Muz has quit [Changing host]
Muz has joined #ruby
ktreese has quit []
bvcosta has quit [Remote host closed the connection]
bvcosta has joined #ruby
cadillac__ has joined #ruby
omab has quit [Ping timeout: 240 seconds]
a-person has joined #ruby
bvcosta has quit [Ping timeout: 258 seconds]
a-person has quit [Remote host closed the connection]
nacsurte has joined #ruby
<nacsurte>
how can i read a stringIO object with open()
<nacsurte>
or is that just not possible
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
TomyLobo has quit [Ping timeout: 246 seconds]
cschneid_ has quit [Ping timeout: 240 seconds]
kobain has joined #ruby
aef has joined #ruby
Guest80106 has quit [Changing host]
Guest80106 has joined #ruby
Guest80106 is now known as aidalgol
minimalism has joined #ruby
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
jphase has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
Mutter has joined #ruby
Mutter has quit [Remote host closed the connection]
<yorickpeterse>
nacsurte: I don't think that's possible no