<jhass>
for starters you can drop the return true if and false
doodlehaus has joined #ruby
davasaurous has quit [Remote host closed the connection]
<tomato_omelette>
ok - thanks
Takle_ has quit [Remote host closed the connection]
davasaurous has joined #ruby
<zenspider>
diegoviola: thanks
startupality has quit [Quit: startupality]
<zenspider>
yup. return true if a || b ; false is entirely equivalent to: a || b
oo_ has quit [Remote host closed the connection]
<tomato_omelette>
that's a bad habit of mine
<tomato_omelette>
thanks
lucyinthesky has joined #ruby
<diegoviola>
it does not sadden me at all if someone thinks I need more experience, all the contrary... I just need to find a job asap to be able to help my family, and this recruiter was a bit rude, so that's what bothered me
<diegoviola>
but I'm hoping to find something soon
<tomato_omelette>
dear god, I love Ruby
<benzrf>
dear god ruby is kind of awful
renderful has quit [Remote host closed the connection]
<jhass>
but yeah, not sure if that approach is really much better
<tomato_omelette>
oooo Ruby 2.0
<jhass>
should work with %w likewise
jlast has joined #ruby
<tomato_omelette>
interesting - I haven't seen %i before
dseitz has quit [Quit: later]
oo_ has joined #ruby
<jhass>
it's symbols
<tomato_omelette>
thanks folks -- that should do it, I was just feeling like that was an ugly method, I appreciate your feedback.
<jhass>
on the meta level this should probably just delegate to the unit model
<jhass>
I feel like listing knows a bit too much about it there
<zenspider>
tomato_omelette: sometimes code is ugly
o0oo0o has quit [Remote host closed the connection]
HACKING-FACEBOOK has quit [Ping timeout: 272 seconds]
drewvanstone has quit [Read error: Connection reset by peer]
<tomato_omelette>
I'll take your advice
<zenspider>
I'd go with jhass' code since it is one hash lookup and not a send to (presumably) a hash lookup
<zenspider>
you don't need the %i tho, I don't think
<jhass>
zenspider: can I also drag you into replacing all uses of #send with #public_send please? :P
<tomato_omelette>
will do, I like it.
<zenspider>
jhass: meh
<zenspider>
private is stupid. so... no.
<jhass>
:(
<jhass>
why is private stupid?
jenrzzz has joined #ruby
butblack has joined #ruby
devoldmx33 has quit [Remote host closed the connection]
<zenspider>
doesn't actually provide any value but a false sense of security
davasaurous has quit [Remote host closed the connection]
<jhass>
maybe to the ruby beginner
<jhass>
I see it declarative, "this is not intended for you, you loose my support if you're going to call this"
<zenspider>
so does :nodoc:
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fgo_ has joined #ruby
<jhass>
and since I tend to try write short methods that keep one level of abstraction I do quite like to have quite a few of them
<jhass>
not for tools like pry
beneggett has joined #ruby
<jhass>
or even .methods
<jhass>
also declared in code > declared in comments
sevenseacat has joined #ruby
<jhass>
but it's all opinion at this point
drewvanstone has joined #ruby
<zenspider>
yeah. well... I prefer to have all my methods public. Who knows how they're gonna get used? maybe it'll help someone
<banisterfiend>
zenspider do u have any public rails projects? i'm curious how you write rails code
lucyinthesky has left #ruby ["Leaving"]
<banisterfiend>
ibet it's really idiosyncratic ;)
Kricir has joined #ruby
MattB2 has quit []
<zenspider>
banisterfiend: that's the only place I have to use private is in the controllers
Joufflu has joined #ruby
<zenspider>
seattle.rb has a couple rails apps, but none that I was primary on
<zenspider>
and they're all fairly standard afaict
doodlehaus has quit [Remote host closed the connection]
<banisterfiend>
zenspider yeah, but i wasn't actually implying that, i was just curious how you write rails code, are you following the whole DCI thing?
<banisterfiend>
where you Repository objects and so on..
<jhass>
anyway, real point about #send/#public_send comes into play if you call foreign code, you might call private API without noticing
drewvanstone has quit [Read error: Connection reset by peer]
Synthead has quit [Remote host closed the connection]
nkumari has quit [Remote host closed the connection]
yetanotherdave has quit [Ping timeout: 255 seconds]
aspires has quit []
jaequery has joined #ruby
drewvanstone has joined #ruby
lucyinthesky has joined #ruby
mloveless has quit [Remote host closed the connection]
<zenspider>
banisterfiend: no, I never really grokked DCI. seems like needless complexity
<zenspider>
I prefer sinatra if I'm really forced to do webby stuff
<zenspider>
but that's rarely the case anyways
x1337807x has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<banisterfiend>
zenspider so what do you work on mostly and in which language?
russt has quit [Quit: russt]
galeido has joined #ruby
<zenspider>
open source. ruby.
tomeara has joined #ruby
gsd has joined #ruby
<zenspider>
tho I'm currently writing scheme / racket
aspires has joined #ruby
<banisterfiend>
zenspider you get paid to work on open source?
phutchins has joined #ruby
charliesome has quit [Ping timeout: 256 seconds]
Tricon has joined #ruby
anaeem1 has joined #ruby
charliesome has joined #ruby
baweaver has quit [Remote host closed the connection]
anaeem1 has quit [Read error: Connection reset by peer]
anaeem1 has joined #ruby
reinaldob has quit [Remote host closed the connection]
yetanotherdave has joined #ruby
conniemj has quit [Quit: (null)]
sinequanon has joined #ruby
kl has quit [Ping timeout: 250 seconds]
Shazaum has quit [Quit: Leaving]
Arnie25 has joined #ruby
arooni-mobile has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anaeem1 has quit [Ping timeout: 250 seconds]
josephndenton has joined #ruby
stunder has quit [Quit: Screw you guys I'm going home]
phutchins has quit [Ping timeout: 258 seconds]
divi has quit [Ping timeout: 240 seconds]
Tricon has quit [Remote host closed the connection]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
karmatr0n has quit [Remote host closed the connection]
checkit has quit [Ping timeout: 258 seconds]
Kricir has quit [Remote host closed the connection]
jimms has quit [Remote host closed the connection]
sinequanon has quit [Ping timeout: 265 seconds]
mrgrieves has quit [Ping timeout: 264 seconds]
x1337807x has joined #ruby
ghr has joined #ruby
echooo1 has joined #ruby
lampd1 has joined #ruby
melik__ has joined #ruby
robustus has quit [Ping timeout: 255 seconds]
fabrice31 has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
maestrojed has quit [Quit: Computer has gone to sleep.]
bmichelsen has joined #ruby
echooo has quit [Ping timeout: 240 seconds]
baweaver has joined #ruby
mrgrieves has joined #ruby
tvw has quit []
melik_ has quit [Ping timeout: 258 seconds]
robustus has joined #ruby
zacstewart has joined #ruby
disKounted has joined #ruby
aspires has quit []
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fabrice31 has quit [Ping timeout: 264 seconds]
fgo_ has quit [Ping timeout: 244 seconds]
dandaman has joined #ruby
kireevco has quit [Read error: Connection reset by peer]
<dandaman>
i have a switch statement, how do i do when 5..<infinity>?
doritostains has quit [Quit: doritostains]
<waxjar>
Float::INFINITY
silkfox has quit [Ping timeout: 240 seconds]
kireevco has joined #ruby
<waxjar>
dunno if that'd work in a Range with an Integer as the start, though
<waxjar>
seems to work fine :)
<dandaman>
waxjar: you get what im trying to do though? is using Float::INFINITY the best option here?
<dandaman>
my switch is for when it is 2, 3-4, or 5+
<dandaman>
im a ruby newb so i wanna learn the best way to do it instead of a way that just works :\\
<jhass>
dandaman: look at your input, what are the possible values
<jhass>
then think about it, if it's not 2, if it's not 3-4, what can it still be?
robbyoconnor has joined #ruby
<dandaman>
jhass: it's based on the number of seats on a plane, so i suppose we wont have a plane with 1000000 passengers anytime in the near future...
<jhass>
we also probably won't have one with 0 seats
<jhass>
open question is what about 1
Sirupsen has joined #ruby
<waxjar>
case statements can have an else clause :)
<dandaman>
jhass: that's covered before we get into the switch
<dandaman>
waxjar: yeah im just doing 5..1000 and my else breaks it
<jhass>
waxjar: that's what I'm getting at ;)
marr has quit [Ping timeout: 264 seconds]
<jhass>
dandaman: so when would it ever reach the else
jasooon has joined #ruby
<waxjar>
if none of the when clauses match
<waxjar>
sorry, i thought that was a question. lol
<dandaman>
jhass: when a user accidentally puts in the wrong input
ghostmoth has quit [Quit: ghostmoth]
davasaurous has joined #ruby
<jhass>
like?
melik___ has joined #ruby
sea_local has quit [Remote host closed the connection]
rshetty has joined #ruby
JoshGlzBrk has joined #ruby
JoshGlzBrk has quit [Remote host closed the connection]
quimrstorres has joined #ruby
melik__ has quit [Ping timeout: 264 seconds]
sea_local has joined #ruby
Akagi201 has quit []
divi has joined #ruby
segfalt has quit [Quit: Connection closed for inactivity]
xymbol has joined #ruby
quimrstorres has quit [Ping timeout: 244 seconds]
TheLastExile has joined #ruby
sargas has joined #ruby
eind has joined #ruby
<ohaibbq>
dandaman case statements can use conditionals for the "when"
<eval-in__>
mozzarella => undefined local variable or method `a' for main:Object (NameError) ... (https://eval.in/226508)
<mozzarella>
only seems to work with assignments
braincrash has joined #ruby
<eam>
only assignments can create local variables
timonv_ has joined #ruby
chrishough has joined #ruby
<eam>
>> is just a method call on an object, doesn't create anything
<eval-in__>
eam => /tmp/execpad-082a36db1c22/source-082a36db1c22:2: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' ... (https://eval.in/226509)
<eam>
whoops
<mozzarella>
lel
Cache_Money has joined #ruby
<eam>
if ruby had explicit declaration this would be more clear imo
<eam>
and real blocks around things like conditionals
arquebus has quit [Quit: Konversation terminated!]
dts has quit [Read error: Connection reset by peer]
Dopagod has joined #ruby
michael_mbp has quit [Excess Flood]
timonv_ has quit [Ping timeout: 264 seconds]
ghr has joined #ruby
michael_mbp has joined #ruby
jimbach has quit [Remote host closed the connection]
skysploit has quit []
ghr has quit [Ping timeout: 255 seconds]
mary5030_ has quit [Remote host closed the connection]
mjwhitta has joined #ruby
mary5030 has joined #ruby
JCii8_ has joined #ruby
mjwhitta has quit [Client Quit]
mary5030_ has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
echooo has joined #ruby
klmlfl has quit [Remote host closed the connection]
JCii8 has quit [Ping timeout: 244 seconds]
arup_r has joined #ruby
gsd has joined #ruby
rubie has quit [Quit: Page closed]
Photism has joined #ruby
marcdel_ has joined #ruby
divi has joined #ruby
aligo has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
mary5030 has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
aspires has joined #ruby
mary5030 has joined #ruby
tkuchiki has joined #ruby
melik_____ has quit [Quit: (null)]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
arup_r has quit [Quit: Leaving.]
kyb3r_ has joined #ruby
n_blownapart has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gsd has joined #ruby
aspires has quit []
tacit7 has quit [Quit: Leaving.]
renderful has joined #ruby
siso has quit [Quit: siso]
arescorpio has quit [Remote host closed the connection]
renderful has quit [Ping timeout: 258 seconds]
<n_blownapart>
evening. kindly critique this section of a ruby koan. it should be getting a score of 1050 but I can't find the problem. . thanks: http://pastie.org/9743952
keen___________8 has quit [Quit: Tiarra 0.1+svn-39209: SIGTERM received; exit]
Lilian has quit [Ping timeout: 250 seconds]
dandaman has joined #ruby
psy has joined #ruby
keen_ has joined #ruby
<n_blownapart>
I realize it's basic. I don't understand how to put the conditional statements within the block. ^
<sevenseacat>
fix you indentation
<sevenseacat>
becuase all your ends are in the wrong place
dandaman has left #ruby [#ruby]
krz has quit [Quit: WeeChat 1.0.1]
rshetty has quit [Remote host closed the connection]
atomical has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Areessell>
I usually throw end up with Formatter (in this case) being a module, then having a Formatter::Base and Formatter::Mine < Formatter::Base but that's getting tiring
bluOxigen has quit [Ping timeout: 244 seconds]
tlarevo has joined #ruby
karmatr0n has quit [Remote host closed the connection]
<quazimodo>
eam: I'm having trouble. aruba is being weird
<quazimodo>
when i spawn my program using PTY I can interactively read and write to it
<quazimodo>
i switched to aruba to make testing easier, now it's not allowing that
sinequanon has quit [Remote host closed the connection]
butblack has left #ruby [#ruby]
dts has quit [Read error: Connection reset by peer]
<eam>
n_blownapart: you probably want accum = count.reduce :+ after you put data in count
sinequanon has joined #ruby
<eam>
quazimodo: what's aruba?
ebbflowgo has joined #ruby
<quazimodo>
eam: the binary just prints "hi", then does a loop and foo = gets; puts "you said #{foo}"
<eam>
oh
<ebbflowgo>
hi
<quazimodo>
aruba is an rspec/cucumber test helper for cli programs
<eam>
quazimodo: yes, the terminal interaction is important in that context
<quazimodo>
eam how so?
echooo1 has joined #ruby
<eam>
not because gets depends on a tty, but because when you type in a terminal and hit "enter", the "enter" which sends data is a terminal operation
<quazimodo>
so my stdin needs to send enter?
echooo has quit [Ping timeout: 240 seconds]
<n_blownapart>
eam I put it everywhere after the four if statements possible. everything else is correct?
<quazimodo>
that's not the problem
<quazimodo>
first thing it does is puts
<quazimodo>
I cant even get that from the stdout till aruba terminates the process
<quazimodo>
i dno... something weirds going oon
framling has joined #ruby
xymbol has quit [Ping timeout: 264 seconds]
sinequanon has quit [Remote host closed the connection]
<eam>
quazimodo: you haven't describe what you're doing different when it doesn't work, but it's probably the case that it's either not connected to your terminal, or your terminal settings are changed such that the line isn't being sent
apeiros_ has quit [Ping timeout: 255 seconds]
Arnie25 has quit [Ping timeout: 265 seconds]
boombadaroomba has joined #ruby
amclain has quit [Quit: Leaving]
echevemaster has quit [Quit: WeeChat 1.0.1]
<quazimodo>
eam: it's hard to describe to you. I'm too ignorant of the features to be able to even articulate the scenario
<quazimodo>
long story short
hmsimha has quit [Ping timeout: 255 seconds]
<eam>
is this linux
<pontiki>
THIS IS SPARTA
<quazimodo>
my binary does a puts "hi" first, and the spawned process's stdout *doesn't* have that in it till I terminate it, at which point something called @output_cache on the aruba spawend object holds the "hi"
* eam
kicks ruby into the well
<quazimodo>
weird eh
<quazimodo>
am i supposed to flush things?
<eam>
quazimodo: perhaps aruba (whatever that is?) is connected to both the process's stdin and stdout
<eam>
you can use "lsof" to look at that
bigmac has quit [Ping timeout: 255 seconds]
<pontiki>
aruba does connect up around the stdin/stdout/stderr of the process under test
<eam>
pontiki: wtf is aruba
<pontiki>
i haven't explored the innards, but it's testing is based on that
<pontiki>
it's a cucumber extension for testing command line programs
<eam>
cucumber extension sounds filthy
<n_blownapart>
!!
boombadaroomba has quit [Ping timeout: 245 seconds]
<pontiki>
it came built in to methadone, and i used it a bit there
<pontiki>
now i don't bother, don't bother much with cucumber unless i have to
<quazimodo>
eam: so what if it is?
<quazimodo>
eam: you can't have connected to both and be ok??
davasaurous has quit [Remote host closed the connection]
neoxquick has quit [Read error: Connection reset by peer]
<eam>
well, you'll need aruba to send the data to gets
kurstin has quit [K-Lined]
<quazimodo>
jee i wish i knew linux pipes/io better
renderful has joined #ruby
jlast has joined #ruby
<quazimodo>
boxing... bbl
tagrudev has joined #ruby
<n_blownapart>
eam so that accum is in the wrong place on the fourth line?
chu has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
preyalone has quit [Quit: Connection closed for inactivity]
econerd4ever has quit [Remote host closed the connection]
<n_blownapart>
I'm getting a blank space in the output 4;1; . ^
nagaraj has joined #ruby
mikepack has quit [Remote host closed the connection]
jenrzzz has joined #ruby
bmichelsen has quit [Quit: ZZZzzz…]
SCHAAP137 has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
blueOxigen has joined #ruby
charliesome has quit [Quit: zzz]
devoldmx has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 240 seconds]
fandi has joined #ruby
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
jonr22 has joined #ruby
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Client Quit]
sski has joined #ruby
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
codecop has joined #ruby
crdpink has quit [Ping timeout: 258 seconds]
sinkensabe has joined #ruby
Kricir has quit [Remote host closed the connection]
<n_blownapart>
hi last shot at this tonight. anyone see why I am not seeing a score from this accum = score.reduce(:+) statement? thank you : http://pastie.org/9744079
jonr22 has joined #ruby
noop has joined #ruby
nrsk has joined #ruby
jonr2219 has quit [Ping timeout: 245 seconds]
josephndenton has joined #ruby
bal1 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
<n_blownapart>
the puts statement is present pastie.org/9744095 but there is no output.
econerd4ever has joined #ruby
nfk has joined #ruby
reinaldob has joined #ruby
crdpink has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jonr2219 has joined #ruby
fgo_ has joined #ruby
ta has quit [Remote host closed the connection]
Xiti has quit [Quit: Xiti]
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
puppeh has left #ruby ["Leaving..."]
jonr2219 has quit [Read error: Connection reset by peer]
josephndenton has quit [Ping timeout: 265 seconds]
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
jonr22 has joined #ruby
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AliRezaTaleghani has joined #ruby
disKounted has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
AliRezaTaleghani has quit [Max SendQ exceeded]
jonr22 has joined #ruby
AliRezaTaleghani has joined #ruby
reinaldob has quit [Ping timeout: 240 seconds]
AliRezaTaleghani has quit [Max SendQ exceeded]
andikr has joined #ruby
AliRezaTaleghani has joined #ruby
AliRezaTaleghani has quit [Max SendQ exceeded]
aspires has quit []
excoin-arturo has left #ruby [#ruby]
<BraddPitt>
well, are the 3 conditions being satisfied?
<BraddPitt>
line 10, 11 and 14 need to be true, and 15 needs to be not true
<BraddPitt>
I would suggest putting a `puts` statement after each of those points to see where you are and are not getting
crdpink has quit [Excess Flood]
timonv_ has joined #ruby
crdpink has joined #ruby
<n_blownapart>
BraddPitt, thanks very much . please stand by if you have time
<BraddPitt>
sure thing
clauswitt has joined #ruby
jonr22 has quit [Remote host closed the connection]
<n_blownapart>
BraddPitt, 15 should be not true?
jonr22 has joined #ruby
dseitz has joined #ruby
adriancb has quit [Remote host closed the connection]
<BraddPitt>
if 15 is true, then like 19 is skipped
<BraddPitt>
s/like/line
<BraddPitt>
so conversely, if you want line 19 to execute, line 15 HAS to be false
jonr22 has quit [Remote host closed the connection]
jonr22 has joined #ruby
timonv_ has quit [Remote host closed the connection]
hiyosi has joined #ruby
<n_blownapart>
BraddPitt, I'm expecting a score of 1050, since there is one 5 thrown with the dice.
krisquigley has joined #ruby
timonv_ has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
<BraddPitt>
hopefully the puts statement will point you in the right direction
<n_blownapart>
thanks very much BraddPitt I'm on it
ht__th has joined #ruby
oo_ has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
econerd4ever has quit [Ping timeout: 272 seconds]
fgo_ has quit [Ping timeout: 244 seconds]
cmckee has joined #ruby
Hijiri has quit [Ping timeout: 240 seconds]
JCii8_ has quit [Ping timeout: 244 seconds]
jonr2219 has joined #ruby
oo_ has joined #ruby
xymbol has quit [Ping timeout: 255 seconds]
fantazo has joined #ruby
<n_blownapart>
so the thing is BraddPitt . throwing 3 ones ( first if statements) wins you 1000 points. so I'm expecting line 24 accum variable to do the math: 1050. Is it out of the proper scope ?
i5um41ru has joined #ruby
<i5um41ru>
please help on how to install dbi on ruby
jonr2219 has quit [Read error: Connection reset by peer]
jonr22_ has joined #ruby
timonv_ has quit [Remote host closed the connection]
jonr22 has quit [Ping timeout: 240 seconds]
mary5030 has joined #ruby
ajaiswal has quit [Quit: Leaving]
ajaiswal has joined #ruby
relampago has joined #ruby
jonr22_ has quit [Read error: Connection reset by peer]
<n_blownapart>
by the way, there is a puts statement on line 24 'puts accum = count.reduce(:+)' ^^
jonr22 has joined #ruby
rumitte has joined #ruby
rumitte is now known as Guest1882
relampago has quit [Client Quit]
jonr22 has quit [Read error: Connection reset by peer]
aganov has joined #ruby
jonr2219 has joined #ruby
<BraddPitt>
right n_blownapart, but in order for the `count << 1000` to execute, h[k] must be 1 AND v.size must be >= 3
Takle has joined #ruby
<BraddPitt>
that condition is never met with the current input
<BraddPitt>
we get v.size 1 and h[k] value 1, or we get v.size 4 and h[k] value 4
despai has joined #ruby
mary5030 has quit [Ping timeout: 265 seconds]
jonr22 has joined #ruby
davasaurous has joined #ruby
<n_blownapart>
BraddPitt, one sec new pastie coming with some added lines.
jonr2219 has quit [Read error: Connection reset by peer]
ecksit has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr22 has joined #ruby
Abhijit has quit [Ping timeout: 250 seconds]
<BraddPitt>
why do you think that?
jonr2219 has joined #ruby
Blizzy has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
<n_blownapart>
k[1] = 4, k[5] = 1 << the output amounts to this {1=>4, 5=>1} BraddPitt
Mothore_ has quit [Ping timeout: 255 seconds]
hmsimha has joined #ruby
<n_blownapart>
because the rules of the game are that three ones win you 1000 points, and a five wins you 50 points.
Macaveli has joined #ruby
<n_blownapart>
this is a partial solution to a dice game from the ruby koans. BraddPitt
benzrf is now known as benzrf|offline
fabrice31 has joined #ruby
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
<BraddPitt>
yes, but in a nested `if` statement, you need to satisfy ALL outer layers in order for the inner statement to execute
rothman has joined #ruby
rothman has left #ruby [#ruby]
bigkevmcd has joined #ruby
arup_r has quit [Remote host closed the connection]
<n_blownapart>
the score arg is score([1,1,1,5,1]) , the first 'throw' , so are not all the if statements satisfied?
<n_blownapart>
BraddPitt, ^
<pontiki>
how would line 17 ever be executed if line 13 is true?
Trynemjoel has quit [Ping timeout: 265 seconds]
arup_r has joined #ruby
<BraddPitt>
h[k] cannot be both == 1 and == to 5
jonr2219 has joined #ruby
xcesariox has quit [Read error: Connection reset by peer]
<n_blownapart>
pontiki, thanks for that, should I use case statements here?
<pontiki>
i don't know, i don't know what this is supposed to do
LekeFly has joined #ruby
jonr2219 has quit [Remote host closed the connection]
jonr2219 has joined #ruby
michael_mbp has quit [Excess Flood]
ta has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
ghostlines has joined #ruby
HayesHimself has joined #ruby
yetanotherdave has quit [Quit: Lost terminal]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
michael_mbp has joined #ruby
<n_blownapart>
the blocks and group_by give us this: {1=>4, 5=>1}, which groups the die throws. with the first throw, there are 4 one's thrown, and 1 five. according to the rules, a minimum of 3 ones thrown scores 1000, and every 5 thrown scores only 50.
Hijiri has quit [Ping timeout: 272 seconds]
jonr22 has quit [Remote host closed the connection]
lidaaa has quit [Ping timeout: 244 seconds]
jonr22 has joined #ruby
<BraddPitt>
besides that, do combinations matter?
<BraddPitt>
or ordering?
econerd4ever has joined #ruby
dumdedum has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
Trynemjoel has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
<n_blownapart>
no. there are a bunch of rules based just on numbers thrown of certain numbers. i.e. 3 thrown of a 2,3 or 4 score 100 times that number. BraddPitt
Hijiri has joined #ruby
jonr22 has joined #ruby
arup_r has quit [Remote host closed the connection]
<BraddPitt>
then I think a case statement is most appropriate
sinkensabe has quit []
<n_blownapart>
3 3's scores 300
<BraddPitt>
ah
<BraddPitt>
yeah, this is a bit more advanced
<BraddPitt>
with so many combinations in games like dice or poker, a decision tree is the best bet
<n_blownapart>
BraddPitt, ok, thanks so much. I'm going to slog through it tomorrow. much appreciated
Takle_ has joined #ruby
<BraddPitt>
sure thing
tastycode has quit [Quit: tastycode]
<n_blownapart>
pax
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
lemur has quit [Remote host closed the connection]
lemur has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
jonr22 has quit [Read error: Connection reset by peer]
jonr22 has joined #ruby
tacit7 has quit [Quit: Leaving.]
josephndenton has joined #ruby
Takle_ has quit [Read error: Connection reset by peer]
echooo has joined #ruby
bmichelsen has joined #ruby
Takle has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
jlast has joined #ruby
jonr22 has joined #ruby
n_blownapart has quit [Remote host closed the connection]
lemur has quit [Ping timeout: 258 seconds]
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
josephndenton has quit [Ping timeout: 245 seconds]
x1337807x has joined #ruby
Trynemjoel has quit [Ping timeout: 265 seconds]
jonr22 has joined #ruby
jonr2219 has quit [Read error: Connection reset by peer]
nitrocell has joined #ruby
sski has quit [Remote host closed the connection]
robbyoconnor has quit [Remote host closed the connection]
jonr2219 has quit [Read error: Connection reset by peer]
xymbol has joined #ruby
<xcesariox>
sevenseacat: but i backspace and join them together already bookmarks = JSON.parse(last_response.body)
doev has joined #ruby
<sevenseacat>
not in the code you posted, you didnt
<sevenseacat>
so do that, and run your test again
sski has joined #ruby
nitrocell has left #ruby [#ruby]
<xcesariox>
yup but in my own sublime text editor i did that
<xcesariox>
and ran the test
nitrocell has joined #ruby
timonv_ has quit [Remote host closed the connection]
<sevenseacat>
did you fix all of the times you did that?
<xcesariox>
same error
<sevenseacat>
you did it more than once.
econerd4ever has quit [Ping timeout: 240 seconds]
<sevenseacat>
no its not.
Xeago has quit [Ping timeout: 244 seconds]
jonr2219 has joined #ruby
<xcesariox>
what do you mean
jonr22 has quit [Read error: Connection reset by peer]
mloveless has joined #ruby
<xcesariox>
sevenseacat: i still getting same error, so you are not solving my problem with my code
redjack1964_ has joined #ruby
<sevenseacat>
you fixed one instance where you had a line break in between JSON.parse and response.body
<sevenseacat>
now fix the rest of them
<xcesariox>
sevenseacat: where are the other erroes
rshetty has joined #ruby
<xcesariox>
sevenseacat: errors"
<sevenseacat>
on the line the test error points to.
yfeldblum has quit [Ping timeout: 258 seconds]
<sevenseacat>
thats why you have a test error.
jonr2219 has quit [Remote host closed the connection]
<xcesariox>
sevenseacat: jesus
<xcesariox>
sevenseacat: thanks for waking me up
<sevenseacat>
i am not here to solve your problem with your code. im here to help you solve it.
<xcesariox>
sevenseacat: solved.
<sevenseacat>
:)
<xcesariox>
sevenseacat: i had 2 lines the same format hahaha
ta has joined #ruby
<sevenseacat>
yes, you did.
jonr22 has joined #ruby
<xcesariox>
sevenseacat: the rspec didn't mention which line it was, but keep saying that, so i look top and bottom, and like OH the bottom was the same stupid format.
xymbol has quit [Ping timeout: 250 seconds]
redjack1964 has quit [Ping timeout: 258 seconds]
ta has quit [Read error: Connection reset by peer]
<xcesariox>
sevenseacat: this first sinatra test that i am doing, i setup the datamapper but i don't understand how the test can run successful if the database hasn't been created
jonr2219 has joined #ruby
jonr22 has quit [Read error: Connection reset by peer]
<xcesariox>
sevenseacat: is it just running the ruby file by itself to see if the code is correct and it doesn't need to connect to the database?
<browndawg>
Is there a way to say `x = my_function` in ruby? So that x's value becomes equal to the function(not it's return value) and I can do stuff like x(params) later?
bigkevmcd has joined #ruby
dangerousdave has joined #ruby
cleopatra has quit [Ping timeout: 264 seconds]
thrawtle has quit [Quit: Leaving]
larissa has joined #ruby
certainty has quit [Ping timeout: 256 seconds]
arup_r_ has joined #ruby
arup_r has quit [Ping timeout: 264 seconds]
<sinanislekdemir>
browndawg: I suppose you mean how a "lambda" is written in Ruby?
Guest1882 has quit [K-Lined]
<sinanislekdemir>
from a little blog, i can give this example;
<sinanislekdemir>
twice = -> (x) { 2 * x }
<sinanislekdemir>
twice.call(5) # => 10
<sinanislekdemir>
for the details, you may make a little search about "Lambdas in Ruby". FYI, Writing a lambda syntax is shortened beginning from version 1.9
<browndawg>
I mean even if it copies the function, it's fine
josephndenton has joined #ruby
<shevy>
an alias is just a pointer
dcunit3d has quit [Ping timeout: 255 seconds]
<shevy>
what is the main method doing?
<browndawg>
and I would declare that how?
<tobiasvl>
browndawg: if an alias is all you need: alias_method :greet, :sayHi
<browndawg>
^ so no syntactic sugar for it?
clauswitt has joined #ruby
fandi has quit [Read error: Connection reset by peer]
<sinanislekdemir>
well actually, as far as i know, alias_method can be redefined, its just a pointer as shevy already mentioned, so the main point is, why to use a "copy" method? what is the benefit or scenario of this usage. Maybe from that point of view, we may find some different approach. Or else, here is where my knowledge ends and i will be looking for the right answer :)
josephndenton has quit [Ping timeout: 255 seconds]
fgo_ has joined #ruby
<browndawg>
no benefit
<browndawg>
python programmer asked how I'd do it in ruby
<gregf_>
in php for ex: $func = function($var){ echo "Hello $var"; }; $func("shevy");
<gregf_>
or perl: $func = sub { print "hello " . shift || "shevy"; }; $func->("shevy");
doev has quit [Ping timeout: 255 seconds]
<gregf_>
its assigning a coderef to a variable and calling it, so a proc/lambda or what tobiasvl said with aliasing :/
<tobiasvl>
I also mentioned method() so!
<tobiasvl>
I win
<gregf_>
yeah, programming is hard as it is :/
kamilc__ has joined #ruby
giuseppesolinas has joined #ruby
SOLDIERz has joined #ruby
nastri has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
quimrstorres has joined #ruby
rshetty has quit [Remote host closed the connection]
georgedrummond has quit [Remote host closed the connection]
bmichelsen has quit [Quit: ZZZzzz…]
SOLDIERz has quit [Ping timeout: 240 seconds]
Brando753 has quit [Ping timeout: 250 seconds]
nagaraj1 has quit [Ping timeout: 244 seconds]
fandi has joined #ruby
LekeFly has quit [Remote host closed the connection]
xymbol has joined #ruby
nagaraj has joined #ruby
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
gccostabr has quit [Quit: ZZZzzz…]
msgodf has quit [Ping timeout: 250 seconds]
<ddv>
whut rubygems.org is redesigned
Takle has quit [Read error: No route to host]
pandaant has joined #ruby
Takle has joined #ruby
Abhijit_ has joined #ruby
Abhijit_ has quit [Changing host]
Abhijit_ has joined #ruby
charliesome has joined #ruby
rkalfane has joined #ruby
Abhijit has quit [Ping timeout: 272 seconds]
<sinanislekdemir>
ddv: i just realised that :) and it hurts my eyes
bmichelsen has joined #ruby
<maasha>
tru dat - invasive color
jaequery has joined #ruby
ReRixo has quit [Ping timeout: 258 seconds]
mkaesz has quit [Ping timeout: 240 seconds]
siso has quit [Read error: Connection reset by peer]
<jheg>
is it possible to iterate over [1..x] and create variables for each one
<jheg>
?
<gregf_>
or file in `svn diff --summarize -rr259459:r260366 | grep -e ^M -e ^A | awk '{print $2}'` ; do echo "$(pwd)/$file"; done
<gregf_>
bah :/ wrong chat sorry
<jheg>
like [1..10].each do |num|; var_name = ‘’; end
<tobiasvl>
gregf_: svn?!?!
<gregf_>
yeah :/
<gregf_>
multiple with git and svn. svn is a pain :/
<jheg>
but create new vars each time so var1, var2, … and so on
phutchins has joined #ruby
postmodern has quit [Quit: Leaving]
<tobiasvl>
jheg: what version of ruby are you on?
<jheg>
2.1.1
<sinanislekdemir>
jheg: you may use instance_variable_set
<maasha>
jheg: sounds nasty. You can do parallel assignment though: x, y = [1, 2]
jaequery has quit [Ping timeout: 240 seconds]
<sinanislekdemir>
like instance_variable_set('@variable_'+i.to_s, 12312)
<tobiasvl>
or local_variable_set
<tobiasvl>
in > 2.1
<maasha>
><
<jheg>
ah perfect sinanislekdemir
kevinxu has joined #ruby
<jheg>
thanks thats just what io was trying to do with a counter for each player
<jheg>
thanks
<jheg>
thanks tobiasvl
kevinxu is now known as Guest5945
<sinanislekdemir>
i need to read more about the changes after 2.1 :) thanks for the update tobiasvl :)
_JamieD_ has joined #ruby
Guest5945 has quit [Max SendQ exceeded]
fgo_ has quit [Ping timeout: 244 seconds]
<jheg>
maasha: Its so I can ask the user how many players want to play and then iterate through [1..num_of_players] and create a Player object for each one
freerobby has joined #ruby
<sinanislekdemir>
jheg, why not use a list?
<jheg>
so I can target each one directly rather than accessing each object from an array
<tobiasvl>
jheg: array of player objects?
<jheg>
yea
codecop has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
rshetty has joined #ruby
<jheg>
sinanislekdemir: a list?
<tobiasvl>
an array
<sinanislekdemir>
i meant array :) i was writing python here :D
<jheg>
thats what i currently have but it means I have to access each object from the array rather than simply calling a var
<tobiasvl>
jheg: why is that a problem? var1 vs var[1]
<jheg>
because my program iterates each player object to take a turn which is fine but
krz has joined #ruby
<sinanislekdemir>
or better using a class as a collection and writing an iterator
arooni-mobile has joined #ruby
<jheg>
if a player wanted to sit out a round then i thought it would be easier if I could just leave out a var
doodlehaus has quit [Remote host closed the connection]
gccostabr has joined #ruby
Aswebb has joined #ruby
Mothore_ has quit [Ping timeout: 258 seconds]
Alina-malina has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
keen__ has joined #ruby
fgo_ has joined #ruby
rshetty has quit [Remote host closed the connection]
reinaldob has joined #ruby
keen_ has quit [Ping timeout: 245 seconds]
hiyosi has joined #ruby
Abhijit__ has joined #ruby
fgo_ has quit [Ping timeout: 256 seconds]
<Macaveli>
Can I ask activerecord questions here? Or is that more rails
<maasha>
I am impressed: tokyocabinet
Abhijit_ has quit [Ping timeout: 272 seconds]
Abhijit__ is now known as Abhijit
<mostlybadfly>
<3 pry
spider-mario has joined #ruby
<mostlybadfly>
Helped me figure out what an old method did hehe
bmichelsen has quit [Quit: ZZZzzz…]
jimbach has joined #ruby
Techguy305|2 has quit [Read error: Connection reset by peer]
Techguy305|2 has joined #ruby
AFKGeek has quit [Quit: Fades into the shadows]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
BaconOverflow has joined #ruby
<Macaveli>
i would be lost with pry
workmad3 is now known as wm3|away
atomical has joined #ruby
dkphenom has joined #ruby
giuseppesolinas has joined #ruby
jlast has quit [Ping timeout: 258 seconds]
jimbach has quit [Ping timeout: 258 seconds]
Abhijit has quit [Ping timeout: 264 seconds]
Abhijit has joined #ruby
kl has joined #ruby
<kl>
hey, i'm looking at ruby web frameworks - is it (easily) possible to only use, say, the routing module from sinatra, without loading up all its other functionality?
bjornar has quit [Remote host closed the connection]
mloveless has joined #ruby
startupality has quit [Quit: startupality]
Techguy305 has joined #ruby
Techguy305|2 has quit [Ping timeout: 255 seconds]
michael_mbp has quit [Excess Flood]
jonr22 has joined #ruby
michael_mbp has joined #ruby
doev has joined #ruby
arup_r has quit [Remote host closed the connection]
Trieste has joined #ruby
fgo_ has joined #ruby
mloveless has quit [Ping timeout: 244 seconds]
SOLDIERz has quit [Quit: Be back later ...]
SOLDIERz has joined #ruby
Aswebb has quit [Remote host closed the connection]
<apeiros_>
kl: there are separate router gems. extracting functionality from frameworks might be quite difficult.
paulfm has joined #ruby
certaint1 is now known as certainty
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eguneys>
when I run bundle for my Gemfile, it downloads 0.6, how do I force the latest version always?
klmlfl_ has joined #ruby
atomical has joined #ruby
<thomasfedb>
eguneys, "bundle update"
lkba has joined #ruby
tylersmith has joined #ruby
francisfish has joined #ruby
<thomasfedb>
eguneys, although that will update everything in your gemfile.
i5um41ru has joined #ruby
<thomasfedb>
workmad3, hello.
<robert45>
hi guys, when trying to run webrick I get "Rails 2.3.2 application starting on http://0.0.0.0:3000" but nothing is listening to that port, no process is launched, any advice how to troubleshoot this? Im very new to ror
josephndenton has joined #ruby
<eguneys>
woaw that worked thomasfedb: o.O
<thomasfedb>
robert45, perhaps try #rubyonrails, and provide more info
<thomasfedb>
eguneys, *shocked*
<thomasfedb>
eguneys, happy to help
<robert45>
thanks
<workmad3>
eguneys: bundler records all the versions it initially installed in 'Gemfile.lock' so that you always install the intended versions
gaussblurinc1 has quit [Quit: Leaving.]
<eguneys>
ok ok
<workmad3>
eguneys: to change a version, you need to explicitly update... you can do a bulk update as thomasfedb said, or update a specific gem with 'bundle update <gem_name>'
<havenwood>
robert45: 2.3.2 is tooo old
vyorkin has joined #ruby
<workmad3>
thomasfedb: hi :)
Seich has joined #ruby
dcunit3d has quit [Ping timeout: 265 seconds]
<havenwood>
robert45: but yeah, #rubyonrails is a better place to ask ;)
<thomasfedb>
workmad3, it's been a while. all well i trust?
fgo_ has joined #ruby
sprihodko has quit [Quit: (null)]
lmickh has joined #ruby
<workmad3>
thomasfedb: can't complain too much, I guess :)
aboudreault has joined #ruby
<thomasfedb>
workmad3, same here, still have legs, etc.
antgel has quit [Ping timeout: 258 seconds]
eguneys has quit [Quit: ERC (IRC client for Emacs 25.0.50.1)]
<robert45>
thomasfedb tx
klmlfl has quit [Ping timeout: 258 seconds]
ebbflowgo has joined #ruby
aclearma_ has quit [Quit: I'm out!]
antgel has joined #ruby
eind has joined #ruby
Spami has joined #ruby
moritzs has joined #ruby
livathinos has quit []
Shazaum has joined #ruby
last_staff has quit [Quit: last_staff]
freerobby has quit [Quit: Leaving.]
tvon has joined #ruby
zacstewart has joined #ruby
bal1 has quit [Quit: bal1]
SOLDIERz has quit [Quit: Be back later ...]
snath has joined #ruby
SOLDIERz has joined #ruby
larissa has joined #ruby
fgo_ has quit [Ping timeout: 255 seconds]
rotor has joined #ruby
Xiti has joined #ruby
robert45 has quit [Quit: • IRcap • 8.6 •]
kwd has quit [Quit: kwd]
kp666 has quit [Quit: Leaving]
DrShoggoth has joined #ruby
nkumari has quit [Remote host closed the connection]
quimrstorres has quit [Remote host closed the connection]
SOLDIERz has quit [Ping timeout: 240 seconds]
doev has joined #ruby
quimrstorres has joined #ruby
BTRE has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
Hijiri has quit [Quit: WeeChat 1.0.1]
evanjs has joined #ruby
bayed has quit [Quit: Connection closed for inactivity]
Photism has quit [Quit: Leaving]
AFKGeek has quit [Quit: Fades into the shadows]
aclearman037 has joined #ruby
dumdedum has joined #ruby
fabrice31 has quit [Remote host closed the connection]
mleone has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: zzz]
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ilof>
Hi, I have a variable with fixnum and I would like to get hex string in network byte order. For example a=4444. I would like to get "\x11\x5c". Any ideas?
georgedrummond has quit [Remote host closed the connection]
mrsolo has joined #ruby
doev has quit [Ping timeout: 258 seconds]
einarj has quit [Remote host closed the connection]
<pipework>
ruber: Just one line? Does it happen when you run `pry` on its own?
perturbation has joined #ruby
<ruber>
pipework: (see _pry_.hooks.errors to debug)
<ruber>
pipework: Error: Cannot find local context. Did you use `binding.pry`?
<ruber>
pipework: That's it.
<ruber>
pipework: No pry alone works.
<epitron>
ruber: you should ask in #pry
<pipework>
ruber: You'll want to try `pry` on its own and gist the contents of that file
<perturbation>
hi all! Anyone know what the difference is between a = %w(foo bar baz) and a = *%w(foo bar baz) (if any)?
<pipework>
You can most definitely also do what epitron says.
shanlar- has quit [Ping timeout: 240 seconds]
ylluminate has joined #ruby
<pipework>
When in doubt, doubt everything but epitron.
<ruber>
pipework: What I can't understand is why there are no line references to the loaded file.
<epitron>
lolol
<epitron>
yes, epitron doubts himself for you
dumdedum has quit [Quit: foo]
<pipework>
perturbation: Have you tried using both as arguments to a method?
maasha has quit [Ping timeout: 246 seconds]
<ruber>
There's just nothing to debug with.
<pipework>
ruber: You'll want to gist the source of that file. The problem might be that you need to update your pry gem, maybe.
chu has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<epitron>
I just discovered something crazy
<pipework>
See if the problem persists with `pry -r my_file.rb`
<ruber>
pipework: pry gem up to date
razieliyo has quit [Ping timeout: 265 seconds]
<pipework>
epitron: call me maybe?
<jhass>
perturbation: the later wastes a few cycles
georgedrummond has quit [Remote host closed the connection]
<pipework>
jhass: lol :D
<epitron>
you can swipe with two hands on android
<rpag>
ruber, the error is happening in pry-stack_explorer
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruber>
pipework: pry -r worked. Thanks.
<epitron>
in sideways mode it's great
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
<pipework>
epitron: You gotta flip it turnways.
<epitron>
yes!
<perturbation>
I'm trying to follow what's going on with someone else's source (which is where I saw that. irb says that a and b are equal after something like 'a = %2(1 2 3); b = *%w(1 2 3)'
<pipework>
Also, yeah I accidentally discovered that recently. I started trying to do that with two hands, but it was hard to not fuck up.
<epitron>
rotate the edge side topwise
ctp has joined #ruby
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pipework>
perturbation: Oh, yeah with the assignment, that's just like destructuring.
<jhass>
perturbation: how about you actually post the code you have doubts about
<ruber>
pipework: However I still get NoMethodError: undefined method errors when calling methods which are clearly defined in the module.
<pipework>
When you splat the array out, you're passing each element of the array in as the value of the assignment to the variable, and ruby takes that splatted array of args and turns it back into an array
<jhass>
perturbation: there's no = in there
moritzs has quit [Ping timeout: 272 seconds]
nkumari has joined #ruby
<jhass>
perturbation: and in this case it turns the items into individual arguments of the method
<perturbation>
I could have sworn it was... gah. So that's just 'call with this array that can have optional args' then?
<perturbation>
oh
<perturbation>
thanks jhass
BTRE has joined #ruby
<epitron>
perturbation: what's %2 do?
lolmaus has quit [Quit: Konversation terminated!]
<perturbation>
typo of '%w' :/
<jhass>
epitron: look on your keyboard ;)
<epitron>
ahh
<epitron>
jhass: my keyboard is virtual - look at the scrollback!
<jhass>
lame excuses!
fantazo has quit [Quit: Verlassend]
freerobby has joined #ruby
despai has joined #ruby
nkumari has quit [Remote host closed the connection]
airdeluxe has quit [Quit: Leaving]
claudiuinberlin has quit [Quit: Leaving.]
josephnd1nton has quit [Ping timeout: 244 seconds]
nkumari has joined #ruby
timonv_ has quit [Remote host closed the connection]
wolf4ood has quit [Quit: (null)]
<c_nick>
sorry was away.. Well lets say module1 has class1 which has a public variable C .. i have assigned it somewhere.. now i want to access this variable in another File
tacit7 has joined #ruby
tacit71 has joined #ruby
<jhass>
c_nick: remove any abstractions, they hide your problem
<jhass>
preferably show code
AlexRussia has quit [Changing host]
AlexRussia has joined #ruby
tacit71 has quit [Client Quit]
Aswebb has quit []
quimrstorres has quit [Remote host closed the connection]
Shaded has joined #ruby
<Shaded>
Hey
<Shaded>
I have a heroku app, that has a rb script
airdeluxe has joined #ruby
airdeluxe has quit [Client Quit]
<Shaded>
It's supposed to update a json file, but it doesn't seem like it writes to the server
<Shaded>
I'm doing this from heroku's cli
airdeluxe has joined #ruby
<Shaded>
and I feel like I'm not doing it right
sailias has joined #ruby
<Shaded>
the command I'm doing is heroku run -a appname ruby create create_json.rb
tacit7 has quit [Ping timeout: 255 seconds]
<Shaded>
and it reacts and puts updating text into the command line, no errors, but just doesn't write it to the server
<jhass>
#heroku
valeriansaliou has quit [Quit: Be back later ...]
t7y9r has joined #ruby
econerd4ever has quit [Remote host closed the connection]
chrishough has joined #ruby
econerd4ever has joined #ruby
<pipework>
Shaded: I don't think you have write access to anything but a temp directory.
konsolebox has quit [Ping timeout: 272 seconds]
moritzs has joined #ruby
<Shaded>
That seems like it'll be the case
<Shaded>
How can I make the rb script run and write on the main server
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
<Shaded>
Must be some other way to 'sudo' it or whatever
<Shaded>
Heroku is weird
ctp has joined #ruby
<workmad3>
Shaded: no, there's not a way to write out to the filesystem arbitrarily on heroku
<workmad3>
Shaded: the only thing you have access to is a tmp directory, and that's not shared between dynos
kapott has joined #ruby
<pipework>
Shaded: You can't. Just put it somewhere else.
<pipework>
Like write the file and push it to S3 or something.
<Shaded>
Oh hm
<Shaded>
That's incredibly weird
renderful has quit [Remote host closed the connection]
<workmad3>
Shaded: that's heroku
<pipework>
Not really. It's a shared host, they all suck, but it's not weird for them to be that controlling.
<workmad3>
Shaded: they basically went "Setting up a filesystem that is shared between multiple app servers is hard to do... lets not let people write to the file system!"
FooMunki has joined #ruby
Aswebb has joined #ruby
mloveless has joined #ruby
<Shaded>
Anyone have a "Fuck Heroku" tshirt I can buy?
konsolebox has joined #ruby
<Shaded>
>_>
quimrstorres has joined #ruby
ringarin has quit [Quit: Leaving]
sinanislekdemir has quit [Read error: Connection reset by peer]
Takle_ has quit [Read error: No route to host]
<workmad3>
anyway, time for me to run away for the day
<c_nick>
its simple all i want is the string without the 65536
kireevco2 has joined #ruby
kireevco2 has quit [Max SendQ exceeded]
<jhass>
.sub(/\d{4,}/, '')
kireevco1 has quit [Read error: No route to host]
kireevco1 has joined #ruby
<atmosx>
c_nick: that's going to work, but a better way would be to convert that string into a time object without miliseconds or whatever that is. using strftime("")
agjacome has joined #ruby
CorySimmons has quit [Quit: Bye!]
melik_____ has joined #ruby
kireevco has quit [Ping timeout: 255 seconds]
fgo_ has joined #ruby
kireevco has joined #ruby
kireevco1 has quit [Read error: Connection reset by peer]
ctp has quit [Quit: I've got an 8 hour ticket to dream land. ZZZzzz…]
quimrstorres has quit [Remote host closed the connection]
<atmosx>
c_nick: actually working on jhass's example a more readable regex would be str.sub(/\:\d{5,}/, '')
econerd4ever has quit [Remote host closed the connection]
<c_nick>
Time.now.strftime("%Y-%m-%d %H:%M:%S")
<atmosx>
c_nick: exactly
<atmosx>
Time.now.strftime("%Y-%m-%d %H:%S").to_s
<c_nick>
So its 4
<jhass>
why to_s?
econerd4ever has joined #ruby
uber_hulk has quit [Quit: nini]
<atmosx>
ah yeah it's already a string
<c_nick>
d{4} should do .. comma meaning 4 or more .. but how many more
freerobby has joined #ruby
jheg has joined #ruby
SOLDIERz has quit [Ping timeout: 264 seconds]
tylersmith has quit [Ping timeout: 258 seconds]
<eam>
worth noting that fractional representation of miliseconds aren't accurate
adriancb has quit [Remote host closed the connection]
<c_nick>
puts str.sub(/(:\d\d\d+)/, '') # 2014-11-27 00:04 This is the value << how did this work
boombadaroomba has joined #ruby
<c_nick>
eam: the reason to exclude it
brendenb has quit [Ping timeout: 258 seconds]
az7ar has joined #ruby
<c_nick>
unfortunately they are getting generated from one of the functions in my library (where i have no control on)
tylersmith has joined #ruby
St_Marx has quit [Quit: WeeChat 1.0.1]
brendenb has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TDJACR_ has joined #ruby
weemsledeux has joined #ruby
prasselpikachu has quit [Ping timeout: 250 seconds]
econerd4ever has quit [Ping timeout: 255 seconds]
nastri has quit [Ping timeout: 244 seconds]
krisquigley has joined #ruby
<c_nick>
rmv_exp = /:d{2}\s/ k = str.sub(rmv_exp, '') puts k doesn't work
<jhass>
because it's more than 2 digits?!
russt has joined #ruby
<c_nick>
oh i forgot i did a %H:%M:%S
<c_nick>
thats 2 now
Megtastique has quit []
<c_nick>
Got it .. i was missing the backslash rmv_exp = /:\d{2,4}\s/ k = str.sub(rmv_exp, ' ') puts k
Jackneill has joined #ruby
chrisja has joined #ruby
<c_nick>
Thanks Guys
krisquigley has quit [Ping timeout: 258 seconds]
nkumari has joined #ruby
prasselpikachu has joined #ruby
FooMunki has quit [Quit: FooMunki]
_honning_ has quit [Remote host closed the connection]
magikid has joined #ruby
noop has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
despai has quit [Quit: This computer has gone to sleep]
zacstewart has quit [Ping timeout: 256 seconds]
xaxisx has joined #ruby
econerd4ever has joined #ruby
kiyote23 has joined #ruby
kl has quit [Ping timeout: 245 seconds]
ohaibbq has joined #ruby
tacit71 has joined #ruby
tacit7 has quit [Ping timeout: 255 seconds]
xaxisx has quit [Client Quit]
ctp has joined #ruby
bracky_ has joined #ruby
c_nick has left #ruby [#ruby]
josephnd1nton has joined #ruby
baweaver has joined #ruby
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
silkfox has quit [Ping timeout: 272 seconds]
magikid has left #ruby ["Leaving"]
brendenb has quit [Ping timeout: 258 seconds]
tacit71 has quit [Ping timeout: 255 seconds]
bracky has quit [Ping timeout: 244 seconds]
magikid has joined #ruby
josephndenton has quit [Ping timeout: 264 seconds]
brendenb has joined #ruby
lolmaus has joined #ruby
adriancb has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
georgedr_ has joined #ruby
ramfjord has joined #ruby
twistedpixels is now known as zz_twistedpixels
kaspertidemann has quit []
codecop has joined #ruby
ta_ has joined #ruby
freerobby has quit [Quit: Leaving.]
ta has quit [Read error: Connection reset by peer]
georgedrummond has joined #ruby
TDJACR_ has quit [Excess Flood]
freerobby has joined #ruby
vyorkin has quit [Quit: WeeChat 1.0.1]
despai has joined #ruby
TDJACR_ has joined #ruby
Takle_ has quit [Read error: No route to host]
despai has quit [Client Quit]
Takle has joined #ruby
samuel02 has quit [Remote host closed the connection]
GPH|work has quit [Ping timeout: 244 seconds]
georgedr_ has quit [Ping timeout: 265 seconds]
divi has quit [Ping timeout: 265 seconds]
despai has joined #ruby
TDJACR_ has quit [Excess Flood]
roolo has joined #ruby
gugabra has joined #ruby
Cyberheb has joined #ruby
andikr has joined #ruby
Ankhers has quit [Remote host closed the connection]
<magikid>
I'm looking to get involved with a ruby project. Any favorites that you'd recommend?
msgodf has joined #ruby
<ericwood>
pretty much anything I've ever written
pika_pika has quit [Quit: Leaving]
Ankhers has joined #ruby
sk87 has joined #ruby
mengu has joined #ruby
atmosx has quit [Ping timeout: 250 seconds]
testcore has quit [Ping timeout: 250 seconds]
Dopagod has quit [Read error: Connection reset by peer]
TDJACR_ has joined #ruby
TDJACR_ has quit [Max SendQ exceeded]
roolo has quit [Ping timeout: 250 seconds]
atmosx has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
testcore has joined #ruby
TDJACR_ has joined #ruby
TDJACR_ has quit [Max SendQ exceeded]
drewvanstone has quit [Quit: Lost terminal]
xaxisx has joined #ruby
prasselpikachu has quit [Ping timeout: 272 seconds]
o0oo0o has quit [Ping timeout: 250 seconds]
tomato_omelette has quit [Ping timeout: 244 seconds]
TDJACR_ has joined #ruby
xaxisx has quit [Client Quit]
o0oo0o has joined #ruby
msmith_ has quit [Remote host closed the connection]
xaxisx has joined #ruby
Asher has quit [Quit: Leaving.]
sk87 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Takle_ has joined #ruby
TDJACR_ has quit [Excess Flood]
gugabra has quit [Quit: Page closed]
msmith_ has joined #ruby
msmith_ has quit [Remote host closed the connection]
msmith_ has joined #ruby
msmith_ has quit [Remote host closed the connection]
baweaver has joined #ruby
msmith_ has joined #ruby
TDJACR_ has joined #ruby
prasselpikachu has joined #ruby
eka has joined #ruby
fdelacruz has joined #ruby
nkumari has quit [Remote host closed the connection]
<eka>
hi, any clue why when using pry-byebug binding.pry in a sinatra app all that is typed is echoed? it wasn't happening some time ago, can't tell what changed though
zacstewart has joined #ruby
Takle has quit [Ping timeout: 272 seconds]
georgedr_ has joined #ruby
blahwoop has quit [Remote host closed the connection]
despai has joined #ruby
despai has quit [Client Quit]
rdark has quit [Quit: leaving]
georgedrummond has quit [Ping timeout: 245 seconds]
ceej is now known as ceej_irccloud
georgedrummond has joined #ruby
sinkensabe has joined #ruby
fabrice31 has joined #ruby
anaeem1 has joined #ruby
georgedr_ has quit [Ping timeout: 258 seconds]
georged__ has joined #ruby
nkumari has joined #ruby
bracky_ has quit [Ping timeout: 265 seconds]
dcunit3d has joined #ruby
rylev has joined #ruby
georgedrummond has quit [Ping timeout: 245 seconds]
graydot has joined #ruby
ghr has joined #ruby
magikid has quit [Quit: Leaving]
sinkensabe has quit [Ping timeout: 240 seconds]
fabrice31 has quit [Ping timeout: 240 seconds]
zacstewart has quit [Ping timeout: 240 seconds]
queequeg1 has quit [Ping timeout: 240 seconds]
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
georged__ has quit [Ping timeout: 250 seconds]
Hijiri has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
ghr has quit [Ping timeout: 258 seconds]
havenwood has quit [Remote host closed the connection]
econerd4ever has quit [Remote host closed the connection]
havenwood has joined #ruby
Prawnzy has quit [Remote host closed the connection]
pricees_ has quit [Remote host closed the connection]
georgedrummond has joined #ruby
TDJACR has joined #ruby
pricees_ has joined #ruby
LBRapid has quit [Ping timeout: 258 seconds]
quimrstorres has joined #ruby
chabier has joined #ruby
mclee has joined #ruby
valeriansaliou has joined #ruby
georgschlenkhoff has joined #ruby
az7ar is now known as az7ar_away
x1337807_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
georgschlenkhoff has left #ruby ["Textual IRC Client: www.textualapp.com"]
prasselpikachu has quit [Ping timeout: 256 seconds]
nkumari has quit [Remote host closed the connection]
LBRapid has joined #ruby
Xeago has joined #ruby
matchaw has joined #ruby
it0a has quit [Ping timeout: 258 seconds]
jonr22 has joined #ruby
samuel02 has joined #ruby
konsolebox has joined #ruby
bigkevmcd has joined #ruby
pricees_ has quit [Remote host closed the connection]
pricees_ has joined #ruby
einarj has joined #ruby
pricees_ has quit [Client Quit]
einarj_ has joined #ruby
digital-ghost has joined #ruby
ybit3 has quit [Remote host closed the connection]
maximski has quit []
prasselpikachu has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
valeriansaliou has quit [Ping timeout: 245 seconds]
dcarmich has joined #ruby
jonr22 has quit [Ping timeout: 258 seconds]
digital-ghost has quit [Client Quit]
digital-ghost has joined #ruby
henesy has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
einarj has quit [Ping timeout: 250 seconds]
digital-ghost has quit [Client Quit]
ferr has quit [Ping timeout: 255 seconds]
ferr has joined #ruby
quimrstorres has quit [Remote host closed the connection]
t7y9r has quit [Ping timeout: 240 seconds]
benzrf|offline is now known as benzrf
chrishough has joined #ruby
henesy has joined #ruby
t7y9r has joined #ruby
quimrstorres has joined #ruby
einarj_ has quit [Remote host closed the connection]
jonr22 has joined #ruby
quimrstorres has quit [Remote host closed the connection]
georgedrummond has quit [Remote host closed the connection]
fdelacruz has quit [Quit: EPIC5-1.1.10[1781] - amnesiac : Press [ESC] to detonate or any other key to explode]
axisys has joined #ruby
axisys has quit [Changing host]
axisys has joined #ruby
jheg has quit [Quit: jheg]
mary5030 has joined #ruby
paulfm_ has joined #ruby
kl_ has joined #ruby
georgedrummond has joined #ruby
dts is now known as WillBot
blahwoop has joined #ruby
paulfm has quit [Ping timeout: 245 seconds]
decoponio has quit [Quit: Leaving...]
<blahwoop>
webdestroya are uhere
quimrstorres has joined #ruby
ghr has joined #ruby
ebbflowgo has left #ruby [#ruby]
paulfm_ is now known as paulfm
nkumari has joined #ruby
WillBot is now known as dts
troyready has quit [Ping timeout: 256 seconds]
rylev has quit [Remote host closed the connection]
mjuszczak has joined #ruby
mkyurche_ has joined #ruby
ghr has quit [Ping timeout: 250 seconds]
adriancb has quit [Remote host closed the connection]
adriancb has joined #ruby
theotherstupidgu has joined #ruby
fgo_ has joined #ruby
jonr22 has quit [Remote host closed the connection]
chabier has quit [Remote host closed the connection]
sinkensabe has joined #ruby
nkumari has quit [Remote host closed the connection]
samuel02 has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
georgedr_ has joined #ruby
georgedrummond has quit [Ping timeout: 258 seconds]
AlSquirrel has quit [Quit: This computer has gone to sleep]
krisquigley has joined #ruby
nkumari has joined #ruby
robbyoconnor has joined #ruby
andikr has quit [Remote host closed the connection]
ricengel has joined #ruby
chabier has joined #ruby
robbyoconnor has quit [Client Quit]
fgo_ has quit [Ping timeout: 264 seconds]
ricengel has quit [Client Quit]
Megtastique has joined #ruby
airdeluxe has quit [Ping timeout: 250 seconds]
mkyurche_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kireevco has quit [Quit: Leaving.]
kireevco has joined #ruby
cleopatra has joined #ruby
krisquigley has quit [Ping timeout: 250 seconds]
kireevco has quit [Client Quit]
queequeg1 has joined #ruby
stunder has quit [Remote host closed the connection]
mleung has joined #ruby
kireevco has joined #ruby
kireevco has quit [Remote host closed the connection]
Areessell has joined #ruby
abuzze_ has joined #ruby
jasooon has joined #ruby
siso has joined #ruby
<mary5030>
had a quick question, so if i have array [a,b,c,d] how can i create a subarray of the ones that returns true
davidhq has joined #ruby
<mary5030>
for ex a.exist? == true and b.exist == true
quimrstorres has quit [Remote host closed the connection]
<apeiros_>
mary5030: check Array#select
<pontiki>
mary5030: take a look at Array#select
sinkensabe has quit [Remote host closed the connection]
<mary5030>
right so i used select like this: [a,b,c,d].select { |e| s.exist == true} so this only returns the true ones but i want to check in the same line if that number of elements is great or == to 2
queequeg1 has quit [Ping timeout: 255 seconds]
abuzze has quit [Ping timeout: 255 seconds]
<pontiki>
err. what is s, and what is s.exist ?
<mary5030>
sorry that is the part i left off of my question, so yes how can i check if the size of this sub array is 2 or greater
<mary5030>
yes
<mary5030>
i meant e.exist
<mary5030>
sorry
einarj has joined #ruby
evanjs has quit [Remote host closed the connection]
ramfjord has joined #ruby
<pontiki>
ok, what does e.exist do?
anaeem1_ has joined #ruby
<mary5030>
return true or false
nkumari has quit [Remote host closed the connection]
<twistedpixels>
I have a question if anyone has time to look at it for me: I have some code here (http://pastebin.com/UKtQh0f5) and for some reason it never enters that if statement even though I know the key is "song"
<twistedpixels>
anyone know why?
<twistedpixels>
inb4 something easy
dcunit3d has joined #ruby
CpuID has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
CpuID has quit [Changing host]
CpuID has joined #ruby
maletor has joined #ruby
einarj has quit [Remote host closed the connection]
ghr has joined #ruby
paulfm has quit []
sinkensabe has quit [Remote host closed the connection]
<pontiki>
is it because of the next guard?
<pontiki>
i mean, you don't exactly clue us in to what's in status and old_status
<jhass>
yeah, that's the only possibilities, either the next hits or the key is not "song"
<pontiki>
what do you tests show?
<twistedpixels>
the next doesn't hit because it gets output
davasaurous has joined #ruby
<twistedpixels>
and the "puts key" outputs "song"
<pontiki>
great, so show us input, desired output, and actual output
<twistedpixels>
ok, one sex
<jhass>
do a puts inside the if
<twistedpixels>
sec*
<twistedpixels>
haha
<jhass>
maybe val is just not what you think it is
davasaurous has quit [Remote host closed the connection]
Tab_ has quit [Read error: Connection reset by peer]
jidar has joined #ruby
kh019267 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fgo_ has joined #ruby
maletor has joined #ruby
gmas has quit [Ping timeout: 265 seconds]
timonv_ has quit [Remote host closed the connection]
<jidar>
having one hell of a time getting the windows gem to install on windows, get the following error: http://pastebin.com/r4jPZxs3 I've done the required DevKit stuff via `ruby dk.rb init` `ruby dk.rb install` any ideas?
mkyurchev has quit [Remote host closed the connection]
jonr22 has quit [Remote host closed the connection]
timonv_ has joined #ruby
Joufflu has joined #ruby
jonr22 has joined #ruby
Takle_ has joined #ruby
NoNMaDDeN has joined #ruby
jimbach has joined #ruby
Takle has quit [Ping timeout: 265 seconds]
segfalt has joined #ruby
quimrstorres has quit [Remote host closed the connection]
Kricir has joined #ruby
rrva has quit [Quit: leaving]
timonv_ has quit [Ping timeout: 240 seconds]
Takle_ has quit [Read error: Connection reset by peer]
davasaurous has joined #ruby
mleung has quit [Quit: mleung]
Takle has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
ramfjord_ has quit [Read error: Connection reset by peer]
moritzs has joined #ruby
mary5030 has joined #ruby
fandi has quit [Ping timeout: 258 seconds]
jimbach has quit [Ping timeout: 256 seconds]
byprdct has joined #ruby
NoNMaDDeN has quit [Ping timeout: 244 seconds]
Kricir has quit [Ping timeout: 256 seconds]
Notte has joined #ruby
eind has joined #ruby
Notte has quit [Client Quit]
agjacome has quit [Quit: leaving]
mloveless has quit [Remote host closed the connection]
quimrstorres has joined #ruby
jonr22 has quit [Remote host closed the connection]
triple_b has joined #ruby
lidaaa has joined #ruby
dcunit3d has joined #ruby
dc has joined #ruby
ghr has joined #ruby
georgedr_ has joined #ruby
georgedr_ has quit [Remote host closed the connection]
reinaldob has quit [Ping timeout: 250 seconds]
renderful has quit [Remote host closed the connection]
Obfuscate has joined #ruby
Aswebb has quit []
lidaaa has quit [Client Quit]
georgedrummond has quit [Ping timeout: 272 seconds]
aspires has joined #ruby
dcunit3d has quit [Ping timeout: 255 seconds]
Obfuscate has left #ruby [#ruby]
nkumari has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
Obfuscate has joined #ruby
dc has quit [Ping timeout: 272 seconds]
ghr has quit [Ping timeout: 264 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eind has quit [Remote host closed the connection]
jimbach has joined #ruby
jimbach has quit [Remote host closed the connection]
livingstn has joined #ruby
jimbach has joined #ruby
<zenspider>
jidar: C:/Ruby200/lib/ruby/gems/2.0.0/gems/pkg-config-1.1.6/lib/pkg-config.rb:265:in `parse_pc': .pc for glib-2.0 doesn't exist. (RuntimeError)
<zenspider>
seems pretty clear what's up. have you addressed that?
drkyro has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<zenspider>
I'd also look at the mkmf.log like it recommends
quimrstorres has quit [Remote host closed the connection]
boombadaroomba has quit [Remote host closed the connection]
rylev has quit [Remote host closed the connection]