rbennacer has quit [Remote host closed the connection]
northrup has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hahuang65 has joined #ruby
ellistaa has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
<ellistaa>
if i run exec ruby in terminal it seems to start a ruby process, how can i end that process without killing the processs?
rkazak has joined #ruby
freerobby has quit [Quit: Leaving.]
rojomisin has quit [Ping timeout: 250 seconds]
discounted has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bronson has quit [Remote host closed the connection]
Limix has quit [Quit: Limix]
zacstewart has quit [Ping timeout: 244 seconds]
ta_ has quit [Read error: Connection reset by peer]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
spider-mario has quit [Remote host closed the connection]
hxegon is now known as hxegon_afk
ellistaa has quit [Quit: ellistaa]
Limix has joined #ruby
jsaak has quit [Ping timeout: 276 seconds]
jsaak has joined #ruby
ta_ has joined #ruby
agent_white has quit [Quit: donewithworkGoinHome]
rbennacer has joined #ruby
yfeldblu_ has joined #ruby
ellistaa has joined #ruby
marr has quit [Remote host closed the connection]
kus has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kus has quit [Max SendQ exceeded]
ellistaa has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 250 seconds]
ellistaa has joined #ruby
ellistaa has quit [Client Quit]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ellistaa has joined #ruby
<Arcaire>
graft: We still see people running Ruby 1.9 or Ruby 1.8
<Arcaire>
2.2 is fine
ta_ has quit [Read error: Connection reset by peer]
kalz has quit [Quit: exit]
kalzz has quit [Quit: exit]
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
blur3d has joined #ruby
Guest43 has joined #ruby
ellistaa has quit [Client Quit]
Guest43 has quit [Client Quit]
skolman_ has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ellistaa has joined #ruby
Xeago_ has quit [Ping timeout: 260 seconds]
ellistaa has quit [Read error: Connection reset by peer]
ellistaa has joined #ruby
ta_ has joined #ruby
ellistaa has quit [Client Quit]
terminal_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rbennacer has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
bronson has joined #ruby
`tim` has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
<ruby-lang235>
0.0
GodFather has quit [Remote host closed the connection]
nando293921 has joined #ruby
GodFather has joined #ruby
Limix has quit [Ping timeout: 276 seconds]
zeroDivisible has joined #ruby
oncall-pokemon has joined #ruby
freerobby has joined #ruby
johnny56_ has quit [Ping timeout: 264 seconds]
rodfersou|afk is now known as rodfersou
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
freerobby1 has joined #ruby
johnny56_ has joined #ruby
n008f4g_ has quit [Ping timeout: 276 seconds]
freerobby has quit [Read error: Connection reset by peer]
brianpWins has quit [Ping timeout: 260 seconds]
CloCkWeRX has quit [Ping timeout: 246 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chipotle has quit [Quit: cheerio]
<iddk>
!help
<iddk>
asdfadf
<iddk>
help
rodfersou has quit [Quit: leaving]
<havenwood>
iddk: Please don't spam the bot.
rbennacer has joined #ruby
iddk has quit [Quit: Page closed]
rbennace_ has joined #ruby
chipotle has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
brianpWins has joined #ruby
whathappens has quit [Remote host closed the connection]
ta_ has quit [Read error: Connection reset by peer]
rbennacer has quit [Ping timeout: 244 seconds]
whathappens has joined #ruby
hays_ has quit [Quit: No Ping reply in 180 seconds.]
bronson has quit [Remote host closed the connection]
<zacts>
so is 2.3.* an unstable / testing branch of ruby?
whathapp_ has joined #ruby
<zacts>
(i.e. are the odd minor versioned 2.3.* unstable, whereas the even numbered minor versions 2.2.* are stable?)
<zacts>
of ruby
<havenwood>
zacts: 2.3.1 is the latest stable Ruby.
hays has joined #ruby
saneax_AFK is now known as saneax
<havenwood>
zacts: Nope.
<zacts>
oh, so all features in 2.3.1 will always remain in future versions?
<zacts>
so I should be using 2.3.1 on my local laptop versus 2.2.5
ta_ has joined #ruby
<havenwood>
zacts: Because you're a Christmas behind on 2.2.5.
<zacts>
heh, I see cool
<zacts>
I'll use 2.3.1 then
dn` has quit [Read error: Connection reset by peer]
tjohnson has quit [Quit: Connection closed for inactivity]
whathappens has quit [Ping timeout: 260 seconds]
ruby-lang235 has quit [Ping timeout: 250 seconds]
CloCkWeRX has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
mjuszczak has quit []
whathappens has joined #ruby
zeroDivisible has quit [Ping timeout: 260 seconds]
tvon has joined #ruby
dikaio has joined #ruby
kareeoleez has joined #ruby
blaxter has quit [Read error: Connection reset by peer]
Logico has quit [Quit: Saindo]
whippythellama has quit [Quit: WeeChat 1.5]
whathapp_ has quit [Ping timeout: 244 seconds]
akitada has joined #ruby
ur5us has joined #ruby
kareeoleez has quit [Ping timeout: 252 seconds]
rcvalle has quit [Quit: rcvalle]
yfeldblum has joined #ruby
yfeldblu_ has quit [Ping timeout: 252 seconds]
benlieb has quit [Quit: benlieb]
bronson has joined #ruby
Limix has joined #ruby
zacstewart has joined #ruby
chouhoulis has quit [Remote host closed the connection]
whathappens has quit [Quit: Leaving...]
rkazak has joined #ruby
nettoweb has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
trinaldi has joined #ruby
Limix has quit [Quit: Limix]
nettoweb has quit [Client Quit]
devbug has quit [Quit: ZZZzzz…]
edavis has joined #ruby
nettoweb has joined #ruby
nettoweb has quit [Client Quit]
shadowdf has quit [Ping timeout: 260 seconds]
Guest43 has joined #ruby
Guest43 has quit [Client Quit]
ta_ has quit [Read error: Connection reset by peer]
rkazak has quit [Quit: Sleep.....ing....]
weemsledeux has joined #ruby
jhack has joined #ruby
dopamean_ has quit [Quit: WeeChat 1.3]
bluOxigen has quit [Ping timeout: 252 seconds]
nanoz has joined #ruby
ta_ has joined #ruby
rkazak has joined #ruby
zacstewart has quit [Ping timeout: 252 seconds]
elifoster has quit [Ping timeout: 244 seconds]
Coldblackice has quit [Ping timeout: 276 seconds]
cdg has quit [Remote host closed the connection]
pawnbox has joined #ruby
benlieb has joined #ruby
cdg has joined #ruby
jhack has quit [Quit: jhack]
ensyde has joined #ruby
elifoster has joined #ruby
rkazak has quit [Quit: Sleep.....ing....]
pawnbox has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 252 seconds]
Limix has joined #ruby
symm- has quit [Ping timeout: 276 seconds]
Coldblackice has joined #ruby
emilford has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
crystal7_ has joined #ruby
ta_ has joined #ruby
crystal77 has quit [Read error: Connection reset by peer]
trinaldi has quit [Quit: zzz]
diegoaguilar has joined #ruby
jhack has joined #ruby
jhack has quit [Client Quit]
jaguarmagenta has quit [Ping timeout: 252 seconds]
crystal7_ has quit [Read error: Connection reset by peer]
crystal77 has joined #ruby
solocshaw has quit [Ping timeout: 276 seconds]
flashpoint9 has joined #ruby
xcesariox has joined #ruby
crystal77 has quit [Read error: Connection reset by peer]
crystal7_ has joined #ruby
zacstewart has joined #ruby
Es0teric has joined #ruby
Yiota_ has joined #ruby
discounted has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
crystal7_ has quit [Read error: Connection reset by peer]
crystal77 has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
SilverKey has joined #ruby
SilverKey has quit [Client Quit]
<pipework>
havenwood: We need to start a new naming convention for ruby so we can easily 'include' apostrophes. users_.oranges for a single user's oranges, users__oranges, etc.
govg has joined #ruby
<pipework>
Remove the uncertainty of plurality or ownership!
ta_ has quit [Read error: Connection reset by peer]
<zacts>
ruby.json_for_versioning_here
Yiota_ has quit [Ping timeout: 250 seconds]
<zacts>
:-P
Infinite_187 has quit [Ping timeout: 260 seconds]
discounted has joined #ruby
howdoico1 has joined #ruby
ta_ has joined #ruby
crystal77 has quit [Ping timeout: 246 seconds]
CloCkWeRX has quit [Ping timeout: 244 seconds]
mjuszczak has joined #ruby
Ebok has joined #ruby
ramfjord_ has quit [Ping timeout: 246 seconds]
crystal77 has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
emilford has quit [Ping timeout: 252 seconds]
malcolmva has quit [Ping timeout: 250 seconds]
discounted has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dikaio has joined #ruby
discounted has joined #ruby
benlieb has quit [Quit: benlieb]
crystal77 has quit [Read error: Connection reset by peer]
crystal77 has joined #ruby
crdpink has joined #ruby
seitensei has quit [Quit: "For a good time, try: 'curl -L http://bit.ly/10hA8iC | bash' ;)"]
discounted has quit [Client Quit]
zacstewart has quit [Ping timeout: 240 seconds]
crdpink2 has quit [Ping timeout: 250 seconds]
crystal77 has quit [Read error: Connection reset by peer]
crystal77 has joined #ruby
Infinite_182 has joined #ruby
tax has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
malcolmva has joined #ruby
ta_ has joined #ruby
crystal77 has quit [Read error: Connection reset by peer]
crystal7_ has joined #ruby
urbanmonk has quit [Quit: urbanmonk]
Infinite_182 has quit [Ping timeout: 250 seconds]
syndikate has joined #ruby
<syndikate>
Hello guys
rojomisin has joined #ruby
<havenwood>
syndikate: Happy Ruby to you!
<syndikate>
same to you havenwood
<syndikate>
I am stuck with a small problem
<havenwood>
syndikate: Pray tell?
mattp_ has quit [Ping timeout: 240 seconds]
<syndikate>
I have a function with a case statement inside, I have defined a variable before the case statement, and initialising it in one of the case when clause, but it is unavailable in the next case where clause
<syndikate>
havenwood, what is that am doing wrong here..
<baweaver>
?gist
<ruby[bot]>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
crystal7_ has quit [Read error: Connection reset by peer]
<baweaver>
if you paste your code there, it'll be a lot easier to help
mattp_ has joined #ruby
crystal77 has joined #ruby
<syndikate>
Oh sorry, hold on
<baweaver>
not a problem
<bazz_>
if I have an [ ["1","a"],["2","b"] ] is to possible to sort it based on one of the "sub-members" specifically ?? for instance by "1" and "2" array members
howdoico1 has quit [Quit: WeeChat 1.4]
<baweaver>
bazz_ what have you tried?
crystal77 has quit [Read error: Connection reset by peer]
<bazz_>
I'm not sure if I'm implementing the "connections properly" mind if I invest you into greater detail?
<bazz_>
do you mind if I ask for high-level advice form you? It requires some minutes
<baweaver>
now then, syndikate... What are you trying to do?
<baweaver>
bazz_ might take me some minutes to answer
<bazz_>
oh yes, help syndikate I'll be OK
<bazz_>
baweaver, I'll write down the thoughts anyways
* baweaver
is also cooking food :D
<bazz_>
o, nvrmnd then
<bazz_>
Enjoy your food :)
<baweaver>
na, don't worry about it
CloCkWeRX has joined #ruby
<bazz_>
OK xD
<baweaver>
just means I take a few more clicks to answer
<bazz_>
Are you familiar with Redis? ZSets?
<baweaver>
vaguely
<baweaver>
I know it's a KV store that runs Lua
Coldblackice has quit [Ping timeout: 250 seconds]
<baweaver>
syndikate line 7 does something that'll break it
<baweaver>
syndikate but in any case, what's the expected input and output?
<syndikate>
baweaver, actullay I initialise $myVar = nil
<syndikate>
so that is a typo
ta_ has joined #ruby
crystal77 has quit [Read error: Connection reset by peer]
<syndikate>
baweaver, so when I try to do the add function it fails
crystal7_ has joined #ruby
<baweaver>
syndikate because right now I think you might need to solve this a different way, but seeing your expected input and output would help with that.
<baweaver>
syndikate or a problem description if you have one
saneax is now known as saneax_AFK
<syndikate>
baweaver, okay how do I do it? What I am trying to do is create a class instance and then run various methods of that class using switch
htmldrum has quit [Ping timeout: 244 seconds]
<baweaver>
syndikate do you have an example of a line I can see?
<syndikate>
Sure, hold on
<bazz_>
baweaver, I spent a couple minutes writing my scenario but it's a bit too much for the chatroom .. and a code example would be too time-consuming, I'll trust myself to handle it. Thanks for your help thus far
<baweaver>
bazz_ we'll be about if you need some advice.
braincrash has quit [Quit: bye bye]
nanoz has quit [Quit: <3]
blackgoat has quit [Quit: WeeChat 1.4]
Eiam_ has joined #ruby
rojomisi1 has joined #ruby
JesseH2 has quit [Quit: Leaving]
JesseH has joined #ruby
saneax_AFK is now known as saneax
JesseH has quit [Changing host]
JesseH has joined #ruby
rojomisin has quit [Ping timeout: 240 seconds]
crdpink2 has joined #ruby
crdpink has quit [Ping timeout: 276 seconds]
braincrash has joined #ruby
arescorpio has joined #ruby
godzillaenlacasa has quit [Quit: ZZZZZ....]
Limix has quit [Quit: Limix]
xMopxShell has quit [Ping timeout: 246 seconds]
<bazz_>
>> [[2,"a"], [1, "z"]].sort_by { |a, b| a }
<brent__>
but still seemed too long, it's a codewars problem i was doing
<brent__>
how would you do it?
crystal7_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scepticulous has joined #ruby
<brent__>
the problem was given n, find the # of trailing zeros of the n!
<brent__>
i ended up caving, and looking at the solutions, looks like you had to use an algorithm i wasn't familiar with to get it to pass quick enough
ta_ has quit [Read error: Connection reset by peer]
cpup has quit [Ping timeout: 240 seconds]
troys has joined #ruby
htmldrum has quit [Ping timeout: 260 seconds]
cpup has joined #ruby
znz_jp has quit [Quit: kill -QUIT $$]
troys is now known as troys_
vStone has joined #ruby
benlieb has quit [Quit: benlieb]
saneax is now known as saneax_AFK
<vStone>
is '@must_be_an_array = [@must_be_an_array].flatten' generally accepted code to make sure something is always an array?
<Radar>
brent__: trailing zeros of what? Do you have an example?
PedramT has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
pLaToOn has joined #ruby
<pLaToOn>
moin
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jordanm has joined #ruby
raeoks has joined #ruby
PedramT has joined #ruby
jud has joined #ruby
jud has quit [Changing host]
jud has joined #ruby
pelegreno has quit [Remote host closed the connection]
pelegreno has joined #ruby
dionysus69 has joined #ruby
tildes_ has quit [Ping timeout: 276 seconds]
emilford has joined #ruby
PedramT has quit [Remote host closed the connection]
emilkarl has joined #ruby
emilford has quit [Ping timeout: 252 seconds]
jaguarmagenta has quit [Remote host closed the connection]
codecop has joined #ruby
htmldrum has quit [Ping timeout: 276 seconds]
firstdayonthejob has quit [Ping timeout: 276 seconds]
toretore has joined #ruby
govg has quit [Ping timeout: 244 seconds]
tvw has joined #ruby
lkba has joined #ruby
htmldrum has joined #ruby
djbkd has joined #ruby
ponga has joined #ruby
Moosashi has quit [Quit: Moosashi]
anisha has joined #ruby
PedramT has joined #ruby
ponga has left #ruby [#ruby]
discounted has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
govg has joined #ruby
discounted has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Moosashi has joined #ruby
dikaio has joined #ruby
lkba_ has joined #ruby
elifoster has quit [Quit: sleep]
pawnbox has quit [Remote host closed the connection]
dikaio has quit [Client Quit]
pawnbox has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
Coldblackice has joined #ruby
aganov has joined #ruby
sjums_ is now known as sjums
biberu has joined #ruby
dikaio has joined #ruby
hahuang61 has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
Phanes has quit [K-Lined]
Phanes has joined #ruby
Phanes has quit [Changing host]
Phanes has joined #ruby
Phanes has quit [K-Lined]
bronson has joined #ruby
devbug has joined #ruby
ljames has quit [Ping timeout: 260 seconds]
rbennacer has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 252 seconds]
Alina-malina has quit [Ping timeout: 260 seconds]
tagaulap has joined #ruby
dopie has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
Amnez777 has quit [Ping timeout: 276 seconds]
PedramT has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
lvn has quit [Remote host closed the connection]
hahuang65 has joined #ruby
andikr has joined #ruby
grenierm has quit [Quit: grenierm]
zenspider has quit [Ping timeout: 276 seconds]
saramic has quit []
PedramT has joined #ruby
hahuang61 has quit [Ping timeout: 250 seconds]
Dimik has quit []
pawnbox has quit [Remote host closed the connection]
Seich_ has quit [Ping timeout: 250 seconds]
djbkd has quit [Remote host closed the connection]
vdamewood has quit [Ping timeout: 276 seconds]
rbennacer has joined #ruby
pawnbox has joined #ruby
jimmybomb has joined #ruby
<jimmybomb>
hey guys, just wondering this is more about api design. if i have a url like api/item. and lets say i want to bulk update multiple items, is it better to have an endpoint like so "Post api/item/bulk-update" and post gazilion item in the body or is it better to do a gazilion async calls using promises to "put /api/item/x" ?
TheWhip has quit [Remote host closed the connection]
Seich has joined #ruby
antgel has joined #ruby
isxek has joined #ruby
grenierm has joined #ruby
rbennacer has quit [Ping timeout: 244 seconds]
htmldrum has quit [Ping timeout: 276 seconds]
nerium has joined #ruby
Xeago_ has joined #ruby
emilford has joined #ruby
dopie has quit [Ping timeout: 250 seconds]
Prawnzy has quit [Remote host closed the connection]
moeabdol has quit [Ping timeout: 260 seconds]
Coldblackice has quit [Ping timeout: 260 seconds]
bluOxigen has joined #ruby
CausaMortis has joined #ruby
PedramT has quit [Remote host closed the connection]
<canton7>
are you an idealist or a pragmatist? :P
emilford has quit [Ping timeout: 276 seconds]
zenspider has joined #ruby
<jimmybomb>
im an idealist
<jimmybomb>
but programming is so hard im fine with anything
discounted has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rbennacer has joined #ruby
mark_66 has joined #ruby
mikecmpbll has joined #ruby
htmldrum has joined #ruby
lsmola has joined #ruby
Devalo has joined #ruby
Snowy has joined #ruby
igam has joined #ruby
<aiguu_>
@canton7: Why not have `POST|PUT /api/items` be bulk update, and `POST /api/items/:id` be a single update.
igam has quit [Remote host closed the connection]
igam` has joined #ruby
hahuang65 has quit [Ping timeout: 276 seconds]
<canton7>
sure, that works
PedramT has joined #ruby
Devalo has quit [Ping timeout: 250 seconds]
infra-red has joined #ruby
infra-red has quit [Remote host closed the connection]
<jimmybomb>
@alguu_: yeah but is that better than having multiple async call ?
moeabdol has joined #ruby
Xeago_ has quit [Read error: Connection reset by peer]
discounted has joined #ruby
htmldrum has quit [Ping timeout: 276 seconds]
rbennacer has quit [Ping timeout: 246 seconds]
Couch has joined #ruby
jaruga___ has joined #ruby
roshanavand has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
rbennacer has joined #ruby
PedramT has quit [Remote host closed the connection]
<apeiros>
"by running it" -> "via an automated test"
<apeiros>
I thought that was obvious
PedramT has quit [Remote host closed the connection]
<syndikate>
Yeah, I think I understood that part. My confusion was when I write the test for a function which provides lines of output, how do I verify that
<apeiros>
a string with multiple lines is still a string. and you can still test it with assert_equal.
TheWhip has joined #ruby
<syndikate>
yes, I had one more question, but I guess I need to work a bit more, Ty.
roshanavand has quit [Ping timeout: 276 seconds]
troulouliou_div2 has joined #ruby
<syndikate>
Ah yes, so this was the actual trouble
<syndikate>
When I call the function, it actually calls another function which prints the output
<syndikate>
So, assert is never recieving the output
minimalism has quit [Quit: minimalism]
<syndikate>
That second function prints stuff line by line, and I can not think of a way to assert that as it is never returned
drptbl has joined #ruby
<apeiros>
syndikate: for future reference - you do realize that "testing a function" is *not* "testing an input/output application", yes?
<apeiros>
(also it's methods in ruby, not functions)
brent__ has quit [Quit: Connection closed for inactivity]
RegulationD has joined #ruby
platzhirsch has joined #ruby
Yiota has joined #ruby
<apeiros>
if you want to test a method which prints output, you can do that by stubbing/mocking the IO it prints to. in this case, probably $stdout. just make sure you don't interfere with your test-framework.
davedev24 has joined #ruby
<syndikate>
Oh okay, methods. actually no I am not much aware of testing. Could you explain that a bit more
<apeiros>
this assumes that you can pass in the io to which the method prints.
kp666 has quit [Ping timeout: 246 seconds]
dANOKELOFF has joined #ruby
<apeiros>
if you have to actually modify $stdout, then it's a bit more messy, but still same principle. `$stdout = io; method_which_prints_to_stdout; $stdout = STDOUT; …assert…`
<syndikate>
Okay, just as a side note, theoretically how is testing of a function done then? Not by checking outputs?
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zapata has quit [Ping timeout: 260 seconds]
<apeiros>
methods
<syndikate>
yes, sorry methods
RegulationD has quit [Ping timeout: 260 seconds]
<apeiros>
theoretically? by comparing expected behavior with actual behavior.
Azure has quit [Remote host closed the connection]
<syndikate>
So that behavior, is output, right?
Yiota has quit [Ping timeout: 276 seconds]
<apeiros>
in ruby, there's 5 basic types of behavior: return value, yielded value(s), raised exception, thrown value, side effects
<apeiros>
output to an IO falls into the side effects category
<apeiros>
other side effects: modifications on the file system, changes to a database, etc.
davedev24 has quit []
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Xeago_ has joined #ruby
yfeldblum has joined #ruby
pandaant has joined #ruby
<apeiros>
and when you test side effects, you have to decide whether you do a unit test, which is isolated, or a system test, which makes use of the external systems (db, filesystem, webservice etc.)
djbkd has joined #ruby
kp666 has joined #ruby
zapata has joined #ruby
<apeiros>
if you do a unit test, you isolate the test by using a test double (stubbing or mocking the test dependency, in your case the IO)
<apeiros>
oh, failed to mention one important class of side effects: modifying the state of your application.
<syndikate>
Oh okay, these were all unknown to me, I thought testing means validating output
PedramT has quit [Remote host closed the connection]
<syndikate>
Could you please help me figure with an example how I can write unit test for this function then? I know you have already explained, but I want to have a bit more clarity
fedexo has quit [Ping timeout: 250 seconds]
<syndikate>
method*
gdp has joined #ruby
<syndikate>
So, do I print the lines and make the method return true?
lkba_ has quit [Ping timeout: 244 seconds]
<apeiros>
I've already provided you an example. two even.
PedramT has joined #ruby
<syndikate>
Yes, I saw it. So this is my final doubt, once I print everything I make the function return true, is that how it should be?
elaptics is now known as elaptics`away
djbkd has quit [Ping timeout: 252 seconds]
elaptics`away is now known as elaptics
<apeiros>
I do not know what your method does. so how am I supposed to judge whether `true` is a sensible return value for it?
htmldrum has joined #ruby
<apeiros>
I generally consider a status value, self or nil as sensible return values for methods with side effects. status values being an information on whether the side effect was applicable or failed. but depending on the specifics, I much rather have an exception instead.
emilford has joined #ruby
<syndikate>
Oh okay
<tobiasvl>
also you don't have to return true itself for the return value to be truthy
<tobiasvl>
depending on what you test for
govg has quit [Quit: leaving]
<syndikate>
Currently I get a nil
pawnbox has joined #ruby
<apeiros>
if the method is supposed to just print stuff, then nil is IMO fine.
mrgrieves has joined #ruby
<apeiros>
c.f. Kernel#puts, which returns nil too.
nadir has quit [Quit: Connection closed for inactivity]
Caerus|Away is now known as Caerus
devbug has quit [Quit: ZZZzzz…]
binaryplease has joined #ruby
zacstewart has quit [Ping timeout: 250 seconds]
Xiti` has joined #ruby
roshanavand has joined #ruby
yfeldblum has quit [Ping timeout: 276 seconds]
emilkarl has joined #ruby
<shevy>
ujjain class Foo; @bar = 5; end will be different from: @bar = 5 without any classes, and also different from: class Foo; def initialize; @bar = 5; end; end
<shevy>
a simple way to test for it could be via reader methods; and default the @ivars to nil when they are not initialized
<shevy>
I am not completely sure how python does it. They don't use a special @ symbol but use "self.foo =" or something like that right? not sure
Xiti has quit [Ping timeout: 246 seconds]
<ujjain>
ah ok, I see.
banister has quit [Ping timeout: 252 seconds]
<shevy>
I guess the most common way is the "class Foo; def initialize; @bar = 5; end; end" variant
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
<shevy>
for the second variant, I sometimes do something such as: module Foo; @config = YAML.load_file('path/to/lots/of/config/values.yml') ... like when I need a per-project config file
roshanavand has quit [Client Quit]
<ujjain>
I'm trying to find out if @expectedException is in @messages, but the result is 4 instead of my expected 1. puts @messages.select{|m| m.include? "#{@expectedException}"}
bronson has joined #ruby
nando293921 has quit [Ping timeout: 250 seconds]
<shevy>
hmm that looks weird
<ujjain>
I don't know how you can even let gherkins tests check for variables though. I know that $bar and $foo worked fine for me, but not sure they were the solution.
<shevy>
do you know the content of @messages?
digneety has joined #ruby
<shevy>
aha
<shevy>
ok so if the global variables work, it must be a scope issue
<shevy>
can you put the code that works with the global variables on a gist?
<apeiros>
^ would be the reason. combined with how Time.mktime is supposed to be used.
marr has joined #ruby
<enslavedtuna>
oh i was thrown of because i thought it did month correctly, but that was just because my example used 01 as it's month! I'll look up the correct usage, thanks
solars has joined #ruby
<toretore>
you're looking for Time.iso8601
djbkd has quit [Ping timeout: 240 seconds]
<apeiros>
remember to `require 'time'` for that one.
d0lph1n98 has joined #ruby
blaxter has joined #ruby
Moosashi has quit [Quit: Moosashi]
workmad3 has joined #ruby
govg has joined #ruby
joonty has joined #ruby
saneax_AFK is now known as saneax
emilford has joined #ruby
madgen has quit [Ping timeout: 240 seconds]
PedramT has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
Moosashi has joined #ruby
devbug has quit [Quit: Lances at dawn!]
lessless has joined #ruby
<lessless>
is it possible to a rescue in the enumerator block similar to how it is used in the methods?
<apeiros>
you can rescue anywhere
<apeiros>
also, "is it possible" -> just try in pry (or irb)
<heftig>
well, you can't do "do rescue end" but you can do "do begin rescue end end"
<apeiros>
um, yeah, "valid syntax implied".
emilford has quit [Ping timeout: 276 seconds]
sangeet has joined #ruby
TheWhip has joined #ruby
<heftig>
apeiros: I wonder if `do begin ... rescue ... end end` is common enough for `do ... rescue ... end` to be considered
<sangeet>
hello
yfeldblum has joined #ruby
* Caerus
greets #ruby
<Caerus>
:D
<apeiros>
heftig: you could run an analysis over github and/or popular gems?
<sangeet>
facing issue with installing carrierwave-base64 gem. Any help ?
sgambino has joined #ruby
<sangeet>
bump !!!
<sangeet>
!!
<shevy>
Caerus!
<apeiros>
sangeet: "facing issue" is your idea of a problem description?
<apeiros>
also spammy "bump!!" and "!!" messages are not welcome.
<Caerus>
gem install carrierwave-base64?
Ispira has quit [Quit: Connection closed for inactivity]
<shevy>
I think Ox0dea or jhass told me what the share link is good for :P
CausaMortis has joined #ruby
rbennacer has quit [Ping timeout: 260 seconds]
joonty has quit [Ping timeout: 276 seconds]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
der-landgraf has quit [Quit: WeeChat 1.4]
dionysus69 has quit [Ping timeout: 244 seconds]
CausaMortis has quit [Client Quit]
CausaMortis has joined #ruby
rbennacer has joined #ruby
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
mtkd has quit [Ping timeout: 252 seconds]
mtkd has joined #ruby
<Caerus>
I need an opinion. Would you say WEB REST API has completely overtaken SOAP? or is there a case where a WEB SOAP Service would still be relevant/needed?
blackgoat has joined #ruby
blackgoat has quit [K-Lined]
rbennacer has quit [Ping timeout: 240 seconds]
<Caerus>
I might be confused because the terms seem to overlap, I'm by no means versed in this matter so sorry in advance if it's dumb :P
glcx has joined #ruby
<Ox0dea>
Caerus: What is WEB?
glcx has quit [Remote host closed the connection]
ur5us has joined #ruby
<Sebastia1Thorn>
well, same same but different kind of. When i build stuff i build rest
sgambino has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
<voidDotClass>
Caerus, if i have an incoming date coming in as unix milliseconds, and i want to save that to a db column in rails, any ideas what the best way to do that is?
<Caerus>
lmao omg
* Caerus
cratered
<voidDotClass>
?
<Ox0dea>
voidDotClass: I bet your choice of database has a tailor-made column type for dates and times.
<hanmac>
depends on the database i would use Timestamp type
comforte has joined #ruby
<Caerus>
<--- confusing other unsuspecting newbies since joining #ruby \o/
emilford has joined #ruby
<comforte>
Hey, what's a small ruby installation actually in size on a disk? I am just using python and it's like 80M... like java :)
<voidDotClass>
yeah it has a date column which i'm using
rbennacer has quit [Ping timeout: 276 seconds]
<voidDotClass>
question is how to convert the timestamp into the date
<apeiros>
voidDotClass, Ox0dea: mind you, Time#to_i will give you seconds, not milliseconds. but I hope you know how to get one from the other.
digneety has quit [Ping timeout: 276 seconds]
<voidDotClass>
apeiros, yep, *1000
<Ox0dea>
voidDotClass: Time has #to_date and Time.at accepts a Unix timestamp.
<apeiros>
voidDotClass: and Time.at is the reverse
<arahael>
connor_goodwolf: you can get that down to about ~26MB fairly easily,
<Ox0dea>
apeiros: o/
<apeiros>
Ox0dea: sniper!
<hanmac>
hm did Time#to_f return the miliseconds or the nanoseconds?
janelleb has quit [Disconnected by services]
<Ox0dea>
I'm seeing microseconds here.
janelleb_ has quit [Quit: leaving]
<shevy>
I'm seeing dead people!
blackmes1 has quit [Ping timeout: 260 seconds]
<shevy>
I guess nanoseconds may only be useful for laser people
<Ox0dea>
With some microsecond-y goodness as well.
<Ox0dea>
Er, no, I guess those are nanoseconds.
<apeiros>
yes, it includes a fractional part. yet still seconds ;-)
<apeiros>
and iirc only milliseconds are precise, the microseconds can already deviate. but that's from memory, so might be wrong.
Azure has joined #ruby
Azure has quit [Read error: Connection timed out]
jaguarmagenta has quit [Ping timeout: 240 seconds]
<apeiros>
Time#usec if you want the fractional part precisely.
mdw has joined #ruby
Devalo has joined #ruby
<syndikate>
Hey again, so I have figured and is capturing stdio and comparing now
Azure has joined #ruby
* Caerus
double-checks...
<apeiros>
ah, it was nanoseconds which Time#to_f can't represent: "Note that IEEE 754 double is not accurate enough to represent the number of nanoseconds since the Epoch"
<Caerus>
"Beginning Ruby 2nd edition" only references Time class when introducing date and time :(
<Caerus>
oh well
PedramT has joined #ruby
neanderslob has quit [Remote host closed the connection]
zeroDivisible has quit [Ping timeout: 276 seconds]
<Ox0dea>
Caerus: That's probably because Time is in core, whereas Date is part of the standard library.
<Ox0dea>
Still, quite an oversight. :/
mjuszczak has joined #ruby
xcesariox has joined #ruby
arahael has left #ruby ["WeeChat 1.0.1"]
joonty has joined #ruby
<workmad3>
Ox0dea: hmm... I thought Date was in core too, but DateTime wasn't, and there are extensions to Date in stdlib too
<Caerus>
yeah, it's struck me as weird because I have some programming background but I thought it was the ruby way, I would have eventually stumbled upon it tho, haven't really browsed stdlib.
<Caerus>
thanks for the clarification
Madplatypus has quit [Quit: Connection closed for inactivity]
<Ox0dea>
>> Date rescue $! # workmad3
<ruby[bot]>
Ox0dea: # => #<NameError: uninitialized constant Date ...check link for more (https://eval.in/565070)
<workmad3>
ah, ok :)
<apeiros>
workmad3: Date used to be in stdlib. not sure how it is now since the rewrite of it in C
<apeiros>
apparently it's still in stdlib (having caught up with the backlog :D)
n008f4g_ has quit [Ping timeout: 260 seconds]
* workmad3
goes back to writing bash
lxsameer has quit [Quit: WeeChat 1.4]
<apeiros>
that sounds like fun
* apeiros
goes back to seed the mssql db
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sigurding has quit [Quit: sigurding]
skade has quit [Quit: Computer has gone to sleep.]
<workmad3>
apeiros: yeah... writing a script to separate a couple of apps that were sharing a database (the decision was made years ago, taken this long for it to finally be sorted)
skade has joined #ruby
sigurding has joined #ruby
skade has quit [Client Quit]
skade has joined #ruby
skade has quit [Client Quit]
charliesome has joined #ruby
Ishido has joined #ruby
skade has joined #ruby
skade has quit [Client Quit]
Gasher has quit [Ping timeout: 252 seconds]
Devalo has quit [Ping timeout: 250 seconds]
voidDotClass has quit [Ping timeout: 276 seconds]
Moosashi has quit [Quit: Moosashi]
rbennacer has joined #ruby
Xeago_ has quit [Remote host closed the connection]
shadowdf has joined #ruby
idefine has joined #ruby
Meeh has quit [Quit: Screw u guys, I'm going home!]
ropeney has joined #ruby
Gasher has joined #ruby
ropeney has quit [Client Quit]
shadowdf has left #ruby [#ruby]
rbennacer has quit [Ping timeout: 252 seconds]
idefine has quit [Ping timeout: 260 seconds]
Pupeno has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
PedramT has quit [Remote host closed the connection]
PedramT has joined #ruby
Pupeno has joined #ruby
Bloomer has joined #ruby
bronson has joined #ruby
ur5us has joined #ruby
rbennacer has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
Pupeno_ has joined #ruby
voidDotClass has joined #ruby
gnufied has joined #ruby
voidDotClass has quit [Client Quit]
mdw has quit [Quit: Sleeping Zzzzz]
voidDotClass has joined #ruby
stef204 has joined #ruby
Pupeno_ has quit [Read error: Connection reset by peer]
voidDotClass has quit [Client Quit]
bahar has quit [Ping timeout: 260 seconds]
voidDotClass has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
voidDotClass has quit [Client Quit]
voidDotClass has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
bronson has quit [Ping timeout: 252 seconds]
fsvehla has joined #ruby
mjuszczak has quit []
stef204 has quit [Remote host closed the connection]
stef204 has joined #ruby
PedramT has quit [Remote host closed the connection]
emilkarl[away] is now known as emilkarl
PedramT has joined #ruby
freerobby has joined #ruby
jaiks has joined #ruby
rbennacer has quit [Ping timeout: 240 seconds]
johnmilton has joined #ruby
madgen has joined #ruby
deadnull_ has joined #ruby
flashpoint9 has joined #ruby
jaiks has quit [Client Quit]
PedramT has quit [Remote host closed the connection]
rodfersou has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
Ishido has quit [Remote host closed the connection]
Ebok has joined #ruby
akkmaxon has joined #ruby
malconis has joined #ruby
Dysp has joined #ruby
Ishido has joined #ruby
akkmaxon has quit [Client Quit]
PedramT has quit [Remote host closed the connection]
norc has joined #ruby
<norc>
Greetings #ruby
nullwarp has joined #ruby
sgambino has joined #ruby
ramortegui has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
<lubekpl>
norc: greetings traveler!
<norc>
So. Are there any Ruby/Ruby-like implementations suitable for embedding into other languages?
<apeiros>
mruby
futilegames has quit [Quit: futilegames]
ChiefAlexander has joined #ruby
JakFrist has quit [Ping timeout: 244 seconds]
<norc>
apeiros: Sweet. By Matz too, don't know how I missed this.
PedramT has joined #ruby
<Dysp>
Mjello. Anyone with knowledge of RubyXL? I am trying to iterate over rows until it is empty and then write. I'm inexperienced with both RubyXL and loops, so help would be appreciated.
<Dysp>
norc: Thank you. Changing the line to if val.nil? == false
<Dysp>
Doesn't really change anything
IrishGringo has quit [Ping timeout: 246 seconds]
<norc>
Dysp: Use "unless val.nil?" or "if !val.nil?"
<norc>
Dysp: It is just style, not a functional change.
akem has joined #ruby
bronson has joined #ruby
<Dysp>
Yeah. Hm. I dunno how to attack this.
<norc>
Dysp: The problem can only arise when your block is yielded so that row is nil.
<norc>
Now the real question is why that happens.
<norc>
It basically tries to execute the following:
<norc>
>> nil[0]
<ruby[bot]>
norc: # => undefined method `[]' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/565204)
<Dysp>
Hm.
emilford has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
<Dysp>
norc: Part of my problem is that I don't know what "worksheet" actually holds. It's an array with huuuuge values.
bronson has quit [Ping timeout: 252 seconds]
umdstu has joined #ruby
<norc>
Dysp: I would byebug/pry into it and explore it interactively to figure out the problem
mostlybadfly has quit [Quit: Connection closed for inactivity]
<Dysp>
I am using pry - how would you do it with Pry?
IrishGringo has joined #ruby
<norc>
What does workbook[0] return?
lxsameer has joined #ruby
<norc>
Does it return a Workbook object?
<norc>
A Worksheet?
<umdstu>
no matter how many times I build ruby with openssl, it never seems to actually be included in the final ruby build. always “cannot load such file”
<umdstu>
ruby-2.2.2 and openssl-1.0.1
<Dysp>
workbook[0] returns a worksheet
<Dysp>
worksheet[0] returns row 0
futilegames has quit [Ping timeout: 244 seconds]
sfr^ has joined #ruby
PedramT has quit [Read error: Connection reset by peer]
<Dysp>
norc: Basicly what I wanna do is iterate through column A until it hits an empty cell - and then write my data. While I normally can solve these newbie-problems, this problem is a combination of areas I poorly understand. Loops & RubyXL API. If it was just one thing that was wrong, it would be easier to solve.
<Dysp>
Too many variables in my misunderstanding ^^
TomyLobo has quit [Read error: Connection reset by peer]
<norc>
Dysp: Think of them as just arrays.
codecop has quit [Remote host closed the connection]
PedramT has quit [Remote host closed the connection]
TheWhip has quit [Remote host closed the connection]
futilegames has joined #ruby
TheWhip has joined #ruby
moeabdol has quit [Ping timeout: 276 seconds]
<norc>
Dysp: Also note that "puts obj.to_s" is redundant. puts will implicitly call to_s no matter what you pass to it.
<norc>
So you can just use "puts val"
<Dysp>
Ah okay
<Dysp>
Coolio
<norc>
Anyhow, the code looks fine at first glance.
<Dysp>
But it doesn't work and I don't know why not.
Ishido has quit [Remote host closed the connection]
<Dysp>
Damn programming. So hard.
TomyLobo has joined #ruby
djbkd has joined #ruby
drptbl_ has joined #ruby
<norc>
Dysp: Does access through [] work properly? i.e. worksheet[0][0]
andikr has quit [Remote host closed the connection]
eljimmy has quit [Quit: This computer has gone to sleep]
<norc>
Dysp: Well the best thing you can try is throwing this into your pry: worksheet.each.with_index { |row, i| p i, row }
djbkd has quit [Ping timeout: 250 seconds]
<norc>
Try to identify the offending row.
ramfjord has joined #ruby
rodfersou has joined #ruby
swills has joined #ruby
rbennacer has joined #ruby
<Dysp>
I don't understand what you just wrote.
rbennacer has quit [Remote host closed the connection]
PedramT has joined #ruby
rodfersou has quit [Client Quit]
rbennacer has joined #ruby
<norc>
Dysp: .each returns an Enumerator object which can be chained with other things like .with_index to inject an index into the block.
<norc>
Dysp: "p obj" is basically "puts obj.inspect"
diegoviola has joined #ruby
Elvin has joined #ruby
<Dysp>
*Looking Enumerables up*
<norc>
Dysp: *Enumerator
<Dysp>
:D
<norc>
Dysp: Though Enumerable methods return Enumerator objects.
<norc>
If you are familiar with Iterators from say C++ they are the same concept.
PedramT has quit [Remote host closed the connection]
futilegames has quit [Quit: futilegames]
<Dysp>
Just going to ask you if it was iterators
<Dysp>
Due to a google search
<Dysp>
Problem is - I am new to everything. Ruby is my first programming language.
<Dysp>
So even when people answer my basic questions, they tend to introduce several new terms I have to look up and understand.
<norc>
Dysp: The idea is simple. If your class has some sort of container semantics and implements the method #each, yielding each successive element, then you can include the module "Enumerable" and get all the methods for free.
<Dysp>
But I am getting there. Slowly.
jonathanwallace_ has quit [Ping timeout: 244 seconds]
moos3 has quit [Quit: Lost terminal]
ChiefAlexander has quit [Remote host closed the connection]
freerobby has joined #ruby
<Dysp>
See, here is what I mean. You think you are answering a question with a simple answer, but you are in fact not (no offence, I really do appreciate help and getting these kind of answer provokes me to look up terminology I do not comprehend).
ChiefAlexander has joined #ruby
jonathanwallace_ has joined #ruby
<Dysp>
I have a sense of what a class is. A container I dont know of. The word "semantics" I need to look up, because english is not my first language. Method I get. Yield is something I understand poorly.
<norc>
Dysp: Oh, I kind of stepped over your remark that Ruby is your first programming language, my apologies mate.
<Dysp>
etc etc. Oh well, no time for whine. Google awaits. Thank you so much for your help ^^
moeabdol has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
<norc>
Dysp: Once you grasp the concept of Enumerators, you understood one of the core concepts of Ruby (these are basically one of the most common Ruby things around)
`tim` has joined #ruby
<hanmac>
Dysp: like a Bookshelf object can have a #each method (and Enumerable) to iterate over the Book objects inside of it.
<Dysp>
Indeed! And that is my next step. I will go through some more guides and videos to get a grasp of things
bsharitt has joined #ruby
<Dysp>
I shall return! But now. Off work I am. Thank you for your attention
PedramT has joined #ruby
Xeago_ has quit [Remote host closed the connection]
Dysp has quit [Quit: Page closed]
Xeago_ has joined #ruby
duckpuppy has joined #ruby
carella has joined #ruby
Veejay has left #ruby ["WeeChat 0.4.2"]
<norc>
Ox0dea: By the way, what happened to your suggestion to Enumerable#any? and the like for things like ary.any?(Fixnum)
skade has quit [Quit: Computer has gone to sleep.]
zacstewart has quit [Ping timeout: 252 seconds]
haylon has joined #ruby
<haylon>
In my gemspec, can I specify a source per dependency, or should I do that in the Gemfile?
<apeiros>
sources are not the concern of a gemspec
mjuszczak has joined #ruby
mjuszczak has quit [Max SendQ exceeded]
charliesome has joined #ruby
mjuszczak has joined #ruby
kareeoleez has quit [Ping timeout: 260 seconds]
cjbottaro has quit [Ping timeout: 260 seconds]
sj has joined #ruby
lsmola has quit [Ping timeout: 246 seconds]
djbkd_ has joined #ruby
hxegon_afk is now known as hxegon
idefine has joined #ruby
tercenya has quit []
LastWhisper____ has joined #ruby
LastWhisper____ has quit [Read error: Connection reset by peer]
LastWhisper____ has joined #ruby
LastWhisper____ has quit [Read error: Connection reset by peer]
Ebok has joined #ruby
karapety_ has joined #ruby
blackmes1 has joined #ruby
aupadhye has quit [Ping timeout: 250 seconds]
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tercenya has joined #ruby
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
djbkd_ has quit [Ping timeout: 260 seconds]
<haylon>
apeiros: I should do it in the Gemfile explicitly then
nanoz has joined #ruby
claw has joined #ruby
blackmes1 has quit [Ping timeout: 246 seconds]
kareeoleez has joined #ruby
tax has quit [Ping timeout: 260 seconds]
infra-red has joined #ruby
codecop has joined #ruby
b7u3f1ng3r has joined #ruby
Yxhuvud has quit [Ping timeout: 250 seconds]
rbennace_ has joined #ruby
rbennace_ has quit [Remote host closed the connection]
rbennacer has quit [Read error: Connection reset by peer]
rbennacer has joined #ruby
jonathanwallace_ has joined #ruby
yeticry has quit [Quit: leaving]
hobodave has joined #ruby
chouhoul_ has joined #ruby
whathappens has quit [Remote host closed the connection]
7F1AA241K has quit [Remote host closed the connection]
whathappens has joined #ruby
fsvehla has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
diegoaguilar has quit [Remote host closed the connection]
swills has quit [Quit: Leaving]
lubekpl has joined #ruby
zacstewart has joined #ruby
PedramT has joined #ruby
whathappens has quit [Remote host closed the connection]
fsvehla has quit [Quit: fsvehla]
infra-red has quit []
ta_ has quit [Read error: Connection reset by peer]
fsvehla has joined #ruby
zacstewart has quit [Ping timeout: 252 seconds]
blackmes1 has joined #ruby
PedramT has quit [Ping timeout: 240 seconds]
ferr has quit [Quit: WeeChat 1.4]
deadnull_ has joined #ruby
Elvin has joined #ruby
karapety_ has quit [Remote host closed the connection]
ta_ has joined #ruby
karapetyan has joined #ruby
roelof has quit [Ping timeout: 250 seconds]
karapetyan has quit [Read error: Connection reset by peer]
mwlang has joined #ruby
karapetyan has joined #ruby
mjuszczak has quit []
kaleido has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
solocshaw1 has joined #ruby
karapety_ has joined #ruby
freerobby has quit [Quit: Leaving.]
karapetyan has quit [Read error: Connection reset by peer]
<kaleido>
x = 5 and i want to create server 1 - server5 based on whatever value x has
deadnull_ has quit [Quit: Bye]
karapety_ has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
<kaleido>
im a noob but im also drawing a blank but it seems like it should be very simple
solocshaw1 is now known as solocshaw
whathappens has joined #ruby
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
blackmes1 has quit [Ping timeout: 246 seconds]
mjuszczak has joined #ruby
LastWhisper____ has joined #ruby
<apeiros>
what do you mean by server1 - server5? strings? local variables? methods?
<kaleido>
strings
<kaleido>
sorry
`tim` has joined #ruby
<apeiros>
kaleido: what have you tried so far?
jonathanwallace_ has quit [Ping timeout: 265 seconds]
tbeg has joined #ruby
<kaleido>
staring at sublime text with a blank expression on my face, honestly. im trying to do this while on a series of conf calls
<apeiros>
o0
<apeiros>
on a series of conf calls?
<apeiros>
it's an interview question?
elaptics is now known as elaptics`away
<kaleido>
no, i promise im not cheating. i dont even do this for more than a hobby
davedev2_ has quit [Remote host closed the connection]
<apeiros>
what ways do you know in ruby to iterate from 1 to x?
davedev24 has joined #ruby
tagaulap has quit [Quit: Connection closed for inactivity]
cjbottaro has joined #ruby
idefine has quit [Remote host closed the connection]
RegulationD has quit [Remote host closed the connection]
idefine has joined #ruby
tvsutton_ has quit [Quit: Quit]
ferr1 has quit [Quit: WeeChat 1.4]
jgt has joined #ruby
edwinvdgraaf has joined #ruby
<kaleido>
im trying to write a very basic webpage that will generate tmsh commands for an f5
chopin has joined #ruby
<kaleido>
could i (1..x).each do |yay|
SilverKey has joined #ruby
<apeiros>
ok. that's a good start. and how do you append to an array?
jonathanwallace_ has joined #ruby
idefine_ has joined #ruby
<kaleido>
.push?
davedev24 has quit [Ping timeout: 250 seconds]
greves has joined #ruby
<greves>
hello, just trying to install the bourbon gem on windows and just installed ruby via the installer, getting this error message and nothing helpful from a quick google: C:\ruby\2.3.0\bin\ruby.exe: No such file or directory -- /cygdrive/c/ruby/2.3.0/bin/gem (LoadError)
<apeiros>
kaleido: yes. and given `yay = 2`, how do you get "server2"?
zeroDivisible has joined #ruby
idefine has quit [Ping timeout: 252 seconds]
CausaMortis has quit [Ping timeout: 260 seconds]
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
the question was only concerned about the `"server" + yay` part. but that won't work because String#+ expects a String, and yay is an Integer
<apeiros>
>> yay = 2; "server" + yay
<ruby[bot]>
apeiros: # => no implicit conversion of Fixnum into String (TypeError) ...check link for more (https://eval.in/565525)
idefine_ has quit [Remote host closed the connection]
<apeiros>
so if you want to use +, you have to convert yay to a String first
<havenwood>
pipework: it's from RubyGems though, so ships with Ruby
whathappens has quit [Remote host closed the connection]
emilford has joined #ruby
Gasher has quit [Ping timeout: 276 seconds]
<pipework>
havenwood: Ah yeah I've seen that, I didn't know that was rubygems adding it though. Explains why I didn't really find where it was before in bundler's source. :D
giz|work has quit [Ping timeout: 260 seconds]
Authenticator has left #ruby [#ruby]
Ebok has quit [Quit: This computer has gone to sleep]
last_staff has quit [Quit: last_staff]
al2o3-cr has joined #ruby
blackmes1 has joined #ruby
dellavg has joined #ruby
SilverKey has joined #ruby
LoneHerm_ has joined #ruby
grenierm has joined #ruby
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bnobu has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ebok has joined #ruby
n008f4g_ has joined #ruby
jaruga___ has joined #ruby
roshanavand_ has joined #ruby
synthroid has joined #ruby
tax has quit [Ping timeout: 240 seconds]
nerium has joined #ruby
bnobu has joined #ruby
synthroi_ has quit [Ping timeout: 244 seconds]
scepticulous has joined #ruby
Gasher has joined #ruby
codecop has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 276 seconds]
roshanavand_ has quit [Ping timeout: 252 seconds]
<kaleido>
is there a simple/elegant way to take a value from one array and make it the key, and a value from a second array and make it the value in a hash? the values will have the same index
<andromedian>
what does def set_results_layout(default: :grid)
<andromedian>
def set_results_layout(default: :grid) what does exactly (default: grid) does? Where I can read more in order to understand it?
<adaedra>
between ( and ) are the function parameters
<adaedra>
the form with key: value are called keyword arguments or "kwargs" for short. The latter should be a good thing to give Google for lot of resources on them.
Spami has quit [Quit: This computer has gone to sleep]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Ping timeout: 240 seconds]
failshell has quit [Remote host closed the connection]
fmcgeough has quit [Quit: fmcgeough]
rodfersou has joined #ruby
e4xit has quit [Quit: Right I'm out!]
kareeoleez has quit [Remote host closed the connection]
mdw has joined #ruby
sp4rrow has joined #ruby
roshanavand has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
carella has quit [Ping timeout: 276 seconds]
blackmes1 has quit [Ping timeout: 260 seconds]
bazz_ has quit [Read error: Connection reset by peer]
giz|work has quit [Ping timeout: 260 seconds]
whathappens has joined #ruby
_blizzy_ has joined #ruby
_blizzy_ has quit [Remote host closed the connection]
FooMunki has quit [Quit: FooMunki]
idefine has joined #ruby
whathapp_ has joined #ruby
vdamewood has joined #ruby
FooMunki has joined #ruby
djbkd_ has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
kareeoleez has joined #ruby
milesmatthias has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
idefine has quit [Remote host closed the connection]
idefine_ has joined #ruby
<andromedian>
thanks adaedra I understand that is a keyword argument but is this consider like one? I guess I don't get the ruby code inside the argument
mdw has quit [Quit: Sleeping Zzzzz]
<adaedra>
I don't understand your question
whathappens has quit [Ping timeout: 276 seconds]
idefine_ has quit [Remote host closed the connection]
n|9932 has joined #ruby
<adaedra>
(default: :grid): your declaring a keyword argument `default` which has for default value `:grid`