govg has quit [Read error: Connection reset by peer]
<epitron>
maplatoj35: i dunno :)
<rubie>
.result?
parabolize has joined #ruby
Wolland_ has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
Wolland has joined #ruby
havenwood has joined #ruby
<maplatoj35>
epitron: can you try running on your side to see if you get the same result
<maplatoj35>
epitron: the test do not pass here
<epitron>
maplatoj35: i found the problem
<epitron>
your array is inside another array
<epitron>
because you used *args, and didn't do ".new *positions"
Wolland has quit [Read error: Connection reset by peer]
Wolland has joined #ruby
chipotle has quit [Quit: cya]
chrisja has quit [Quit: leaving]
stoddart has quit [Quit: leaving]
<maplatoj35>
epitron: thanks a lot. expect(leaves.all_integers?).to be_truthy undefined method `truthy?' yet its in the rspec doc
<epitron>
i just use .should == :)
<maplatoj35>
epitron: be_true seems to work yet its not in the doc
sevenseacat has joined #ruby
<epitron>
sounds about right
kyb3r_ has joined #ruby
klaut has joined #ruby
chrishough has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
jimms has joined #ruby
<rubie>
shevy: i fixed it by creating a nested loop. to me it seems that by asking if the dictionary word is included in the substring word, if its not an exact match it will still say that its included. so it gets around the punctuation, but if you had a word like jungleeee it would still count it, because jungle is included in the element jungleee
<havenwood>
rubie: you get that it's supposed to be how many times each item in the Array is repeated in the String?
willywos has joined #ruby
<havenwood>
rubie: And case insensitivity should presumably mean lower and uppercase is ignored in both the String and Array of sub-Strings.
Techguy305 has quit [Ping timeout: 260 seconds]
<rubie>
ya im not interested so much in getting the correct answer as i am understanding how each part of the program works and why
Scotteh_ has joined #ruby
<havenwood>
rubie: ahh, assumed you wanted the method to match its comments' behavior
<rubie>
ya i should have made that more clear
<havenwood>
rubie: documentation that lies is worse than no documentation
<rubie>
lol
<rubie>
very true
<havenwood>
sea of grey stuff
tkuchiki has quit [Read error: Connection reset by peer]
Scotteh has quit [Ping timeout: 244 seconds]
tkuchiki has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has quit [Read error: Connection reset by peer]
moritzs has joined #ruby
timonv_ has joined #ruby
jimmyhoughjr has joined #ruby
nateberkopec has joined #ruby
timonv_ has quit [Ping timeout: 256 seconds]
SpikeMaster has joined #ruby
klaut has quit [Remote host closed the connection]
hamakn has joined #ruby
<SpikeMaster>
what is most popular for ruby? Emacs since mattz uses it? Or Vim?
Synthbread has joined #ruby
Synthead has quit [Disconnected by services]
<shevy>
neither
Synthbread is now known as Synthead
<shevy>
sublime, gedit, geany and I guess textmate
<benzrf>
i use vim!!!!
<benzrf>
but i use haskell more than ruby
<shevy>
yeah but you are young and have much to learn
<sevenseacat>
people use different things. there's probably no 'most popular'
Synthbread has joined #ruby
<shevy>
are cats most popular?
<shevy>
my idol was Garfield
<rpag>
was?!
mercwithamouth has quit [Ping timeout: 250 seconds]
mengu has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<maplatoj35>
epitron: does testing with rspec bypasss private methods?
<maplatoj35>
how to test for those
jdj_dk has joined #ruby
<sevenseacat>
you dont test private methods
<sevenseacat>
they are private
<shevy>
rpag well he eats lasagne bolognese I guess; I eat vegetable lasagne :(
moritzs has quit [Remote host closed the connection]
<rpag>
i've tested them before, i usually do something like: subject { method(:name) } it { expect(subject.call).to eq(1) }
mercwithamouth has joined #ruby
<sevenseacat>
that defeats the purpose of them being private
<rpag>
why?
<sevenseacat>
if they're private, the outside world does not know about their presence
<sevenseacat>
they can be moved, changed, rearranged, deleted, have their interface change, and the outside world does not give a shit
<sevenseacat>
but now your tests do
<sevenseacat>
which is wrong
<shevy>
perhaps he wants to do secret private testing
mengu has quit [Ping timeout: 265 seconds]
<maplatoj35>
sevenseacat: then it defeats the purpose of testing..we don't test for the outside world
<havenwood>
but are you testing your tests?
<banisterfiend>
sevenseacat do u mock private methods though?
<sevenseacat>
banisterfiend: no.
<banisterfiend>
stub?
<SpikeMaster>
testing the internals should be OK. Like testing the car engines defribulator is OK even if that is not exposed throught the drivers interface.
<sevenseacat>
private methods do not exist outside the class.
<banisterfiend>
i meant stub, sorry
<sevenseacat>
no.
<banisterfiend>
you dont mock methods, you mock objects :)
Synthead has quit [Ping timeout: 256 seconds]
<havenwood>
i mock mocking
<rpag>
it can get pretty insane if you do too much of it
<havenwood>
mime style
<shevy>
I mock my tests and test my mocks
Synthead has joined #ruby
<shevy>
sometimes my tests mock me back :(
jimms has joined #ruby
<SpikeMaster>
hey you guys. What is the most modern hip hopping language now? ruby was cool back in 2013. IOt
<SpikeMaster>
It's almost 2015
<rpag>
swift, go
<havenwood>
SpikeMaster: Now it's Ruby.
<rpag>
probably go
<havenwood>
rpag: no, go is for old people now
<havenwood>
rpag: too late
<rpag>
havenwood, ruby is the new perl5, dont cha know
<SpikeMaster>
can't be go cuz go was made by a big company. I need something cooler and more grass roots.
r0bby_ has joined #ruby
<sevenseacat>
lol
<rkazak>
Scala....
<rpag>
swift? apple is as hip as it gets
<havenwood>
SpikeMaster: Nim.
<havenwood>
rkazak: ew
<havenwood>
rkazak: Clojure!
<rkazak>
:)
<SpikeMaster>
ok. i'm gonna go learn nim.
SpikeMaster has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<oniMaker>
What's the secret of nim?
<shevy>
that you must compile it
<rpag>
close interop with C
<banisterfiend>
hehe
<banisterfiend>
fowl would be happy
<havenwood>
banisterfiend: was thinking of fowl ;)
<banisterfiend>
fowl is the shizzlenit
<banisterfiend>
really awesome programmer, he just doesn't know it ;)
<havenwood>
bjhaid: i jest, Ruby just doesn't use commas like humans to delimit here it uses underscores
<benzrf>
bjhaid: some countries swap , and . in numbers
<havenwood>
bjhaid: some humans*
doug1 has joined #ruby
<bjhaid>
benzrf: out of curiosity can you give me an example country, I am not doubting you here
cocoabean has quit [Quit: WeeChat 0.4.2]
sinequanon has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<benzrf>
i think many european ones do
<banisterfiend>
benzrf problem with focussing entirely on haskell is that it can make you pretty unemployable
zorak8 has joined #ruby
<bjhaid>
benzrf: like which one
<banisterfiend>
though im sure you learan a bunch of prettiy interesting stuff
jimmyhoughjr has joined #ruby
<benzrf>
bjhaid: idk off the top of my head -.-
<banisterfiend>
bu it shoud be background language htat informs and deepen you rproramming in something moremainstreain
nowthatsamatt has quit [Quit: nowthatsamatt]
<banisterfiend>
rahter than your full focus om
Roa has quit [Ping timeout: 265 seconds]
mobiGeek5 has joined #ruby
<mobiGeek5>
morning folks!
nonks has quit [Ping timeout: 246 seconds]
<mobiGeek5>
I'm trying to use mechanize to scrape a rails website. But whenever I "login" I get back "400 Bad Request". Not sure where to look next?
mary5030 has joined #ruby
jdj_dk has quit [Ping timeout: 244 seconds]
r0bby_ is now known as robbyoconnor
<benzrf>
>morninng
siwica has quit [Ping timeout: 260 seconds]
echooo has quit [Ping timeout: 265 seconds]
echooo has joined #ruby
dannyanderson has joined #ruby
sinequanon has joined #ruby
<mobiGeek5>
it seems that the authenticity_token is being submitted correctly.
RyanV has joined #ruby
havenwood has left #ruby [#ruby]
<mobiGeek5>
When I check out the rails log and compare the mechanize output to the browser output, they seem identical (same SQL, etc) except for where mechanize all of a sudden returns 400 but the browser continues on to 200.
<RyanV>
the following regexp is invalid at the look-behind, specifically while trying to match 0 or more spaces. how can i make this work? /(?<=Tagged:\s*)(.+)(?=\n)/
Roa has joined #ruby
_ixti_ has quit [Ping timeout: 260 seconds]
twistedpixels is now known as zz_twistedpixels
mary5030 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
mchelen has quit [Ping timeout: 244 seconds]
tkuchiki has joined #ruby
bjhaid has quit [Quit: Page closed]
mchelen has joined #ruby
hmsimha has joined #ruby
robbyoconnor has quit [Ping timeout: 258 seconds]
mikepack has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 255 seconds]
krz has quit [Ping timeout: 250 seconds]
koderok has joined #ruby
pu22l3r has quit [Remote host closed the connection]
rshetty_ has quit [Remote host closed the connection]
j416_ has joined #ruby
nrsk has quit [Ping timeout: 256 seconds]
andrewlio has joined #ruby
dumdedum has joined #ruby
<wasamasa>
uh, yasnippet is a library
<wasamasa>
what exactly are you asking for?
j416 is now known as j416__
j416_ is now known as j416
j416__ has quit [Quit: o/]
jasooon has joined #ruby
ht__th has joined #ruby
fabrice31 has joined #ruby
Xeago has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
koderok has quit [Ping timeout: 255 seconds]
gauke has joined #ruby
fr1eza has joined #ruby
danijoo_ has joined #ruby
cmxu has joined #ruby
Macaveli has joined #ruby
Xeago_ has joined #ruby
jasooon has quit [Ping timeout: 255 seconds]
doev has joined #ruby
jdj_dk has joined #ruby
Deejay has joined #ruby
Deejay is now known as Guest91117
danijoo has quit [Ping timeout: 250 seconds]
Guest91117 has quit [Client Quit]
Xeago has quit [Ping timeout: 255 seconds]
arup_r has joined #ruby
tvw has joined #ruby
j416 has quit [Quit: o/]
j416 has joined #ruby
alem0lars is now known as alem0lars|away
bigkevmcd has joined #ruby
klaut has joined #ruby
SouL_ has quit [Ping timeout: 272 seconds]
timonv_ has joined #ruby
SouL_ has joined #ruby
harax_ has joined #ruby
koderok has joined #ruby
msmith has joined #ruby
koderok has quit [Client Quit]
timonv^ has joined #ruby
timonv_ has quit [Ping timeout: 240 seconds]
fr1eza has quit [Changing host]
fr1eza has joined #ruby
jdj_dk has quit [Read error: Connection reset by peer]
msmith has quit [Ping timeout: 256 seconds]
nrsk has joined #ruby
tesuji has joined #ruby
arya_ching has quit [Ping timeout: 260 seconds]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
valeriansaliou has joined #ruby
dawkirst has joined #ruby
theotherstupidgu has joined #ruby
dawkirst has quit [Remote host closed the connection]
dawkirst has joined #ruby
shredding has joined #ruby
pranny has joined #ruby
valeriansaliou has quit [Ping timeout: 260 seconds]
njames has quit [Remote host closed the connection]
njames has joined #ruby
mistermocha has joined #ruby
JohnBat26 has joined #ruby
mahyuddin has quit []
TomyWork has joined #ruby
njames has quit [Ping timeout: 244 seconds]
<shevy>
dumdedum
sinkensabe has quit [Remote host closed the connection]
amundj has joined #ruby
mistermocha has quit [Ping timeout: 258 seconds]
kaspergrubbe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
sinkensabe has quit [Remote host closed the connection]
Juanchito has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
timonv^ has quit [Ping timeout: 245 seconds]
timonv_ has joined #ruby
MrSamuel has quit [Quit: MrSamuel]
jgt has joined #ruby
SouL_ has quit [Ping timeout: 272 seconds]
michael_mbp has quit [Excess Flood]
fr1eza has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
SouL has joined #ruby
kaspergrubbe has joined #ruby
alex88 has joined #ruby
jdj_dk_ has joined #ruby
pranny has quit [Read error: Connection reset by peer]
pranny has joined #ruby
bayed has joined #ruby
michael_mbp has joined #ruby
spider-mario has joined #ruby
timonv_ has quit [Remote host closed the connection]
rshetty has joined #ruby
xcesariox has joined #ruby
xcesariox has quit [Max SendQ exceeded]
yokel has quit [Ping timeout: 245 seconds]
<shevy>
is sleep '2' also ok?
<shevy>
TypeError: can't convert String into time interval
<shevy>
:(
yokel has joined #ruby
xcesariox has joined #ruby
ta has quit [Ping timeout: 245 seconds]
xcesariox has quit [Client Quit]
schaerli has joined #ruby
rbrs has joined #ruby
thsig_ has joined #ruby
jasooon has joined #ruby
shredding_ has joined #ruby
shredding has quit [Ping timeout: 272 seconds]
shredding_ is now known as shredding
codecop has joined #ruby
thsig has quit [Ping timeout: 265 seconds]
Spami has joined #ruby
xcesariox has joined #ruby
MrSamuel has joined #ruby
crazydiamond has joined #ruby
ta has joined #ruby
tlarevo_ has joined #ruby
xcesariox has quit [Client Quit]
WormDrink has joined #ruby
jasooon has quit [Ping timeout: 265 seconds]
olivier_bK has joined #ruby
rbrs has quit [Quit: Leaving]
rbrs has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
tlarevo has quit [Ping timeout: 255 seconds]
Xeago_ has quit [Remote host closed the connection]
shredding has quit [Quit: shredding]
terlar has joined #ruby
<theotherstupidgu>
why we add the "&" in &block?
ringarin has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
CaptainHeavy has joined #ruby
<shevy>
theotherstupidgu I think the ruby parser requires syntactic information
<apeiros>
theotherstupidgu: to tell ruby to treat the argument as a block
<apeiros>
or in case of method definition, to tell ruby that this argument receives a passed block
Hobogrammer has quit [Ping timeout: 272 seconds]
jdj_dk_ has quit [Ping timeout: 245 seconds]
M3M0CooL has joined #ruby
hellangel7 has joined #ruby
abuzze has joined #ruby
ephemerian has joined #ruby
msmith has joined #ruby
Xeago has joined #ruby
asmodlol has joined #ruby
Xeago_ has joined #ruby
mercwithamouth has quit [Ping timeout: 272 seconds]
msmith has quit [Ping timeout: 244 seconds]
mercwithamouth has joined #ruby
sinkensabe has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
patrick99e99 has joined #ruby
kyb3r_ has quit [Ping timeout: 255 seconds]
AFKGeek has joined #ruby
marr has joined #ruby
timonv_ has joined #ruby
timonv_ has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 265 seconds]
patrick99e99 has quit [Ping timeout: 272 seconds]
chipotle has quit [Quit: cya]
njames has joined #ruby
kaspergrubbe has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
sigurding has quit [Quit: sigurding]
roolo has joined #ruby
pranny has quit [Quit: Leaving.]
njames has quit [Ping timeout: 265 seconds]
pranny has joined #ruby
poppingtonic has quit [Ping timeout: 265 seconds]
sevenseacat has quit [Remote host closed the connection]
MrSamuel has quit [Quit: MrSamuel]
jdj_dk_ has joined #ruby
sigurding has joined #ruby
boombadaroomba has joined #ruby
<theotherstupidgu>
shevy, apeiros thanks
pranny has quit [Client Quit]
pranny has joined #ruby
tokik has quit [Read error: Connection reset by peer]
j416 has quit [Quit: o/]
j416 has joined #ruby
jhass has quit [Ping timeout: 245 seconds]
boombadaroomba has quit [Ping timeout: 245 seconds]
Takle has joined #ruby
AlSquire has joined #ruby
AlSquire has quit [Client Quit]
Hanmac has quit [Ping timeout: 244 seconds]
tokik has joined #ruby
einarj has joined #ruby
jhass has joined #ruby
joonty has joined #ruby
elaptics`away is now known as elaptics
pranny has quit [Read error: Connection reset by peer]
pranny1 has joined #ruby
hanmac1 has joined #ruby
ringaring has joined #ruby
ringarin has quit [Ping timeout: 255 seconds]
Xeago_ has quit [Remote host closed the connection]
nfk has joined #ruby
existensil has joined #ruby
jdj_dk_ has quit [Ping timeout: 240 seconds]
Darryl_ has quit [Quit: Connection closed for inactivity]
wpp has joined #ruby
godd2 has quit [Ping timeout: 250 seconds]
maasha has joined #ruby
jasooon has joined #ruby
RyanV has joined #ruby
<maasha>
Anyone good with GNUplot? I find that the ruby_gnuplot gem is as difficult to use as using gnuplot. I was wondering if there was a better way of calling/modeling gnuplot using ruby?
Hanmac has joined #ruby
<maasha>
GNUplot docs are scary.
jusmyth1 has joined #ruby
<maasha>
The problem is clearly how to deal with plotting of multiple datasets.
jusmyth1 has quit [Read error: Connection reset by peer]
<arup_r>
?
razieliyo has joined #ruby
DrCode_ has joined #ruby
jusmyth has joined #ruby
AlSquire has joined #ruby
DrCode has quit [Ping timeout: 246 seconds]
<canton7>
in the same as any other block-based iteration?
<canton7>
*same way
ringarin has joined #ruby
ringaring has quit [Ping timeout: 256 seconds]
rylev has joined #ruby
<arup_r>
canton7: you meant *next* ?
<canton7>
yup
<arup_r>
Then why mine is not working ?
<canton7>
dunno
<arup_r>
Let me re check
<canton7>
why not pastie some code which replicates your issue
pu22l3r has joined #ruby
Takle has quit [Remote host closed the connection]
Xeago_ has quit [Remote host closed the connection]
jusmyth1 has joined #ruby
tokik has quit [Ping timeout: 255 seconds]
jdj_dk_ has quit [Ping timeout: 265 seconds]
jusmyth has quit [Ping timeout: 265 seconds]
unshadow has joined #ruby
pu22l3r has quit [Ping timeout: 255 seconds]
<unshadow>
What is the right way to close the current thread i'm running at ? doing Thread.current.join yeilds "Target thread must not be current thread"
<canton7>
define "close the current thread"
jusmyth has joined #ruby
jusmyth1 has quit [Ping timeout: 240 seconds]
rshetty has quit [Remote host closed the connection]
ldnunes has joined #ruby
<zenspider>
unshadow: spawner generally does the join
<unshadow>
lets say i have a loop that spawns a new thread for each event, in the new thread I have a different loop which checks for specific parameters, if the parameters are blabla i'll do something , else i'll do something else, lets say that in the "if" after i did my magic I want to close the current thread so it wont execute unneeded code, is there a thread.stop or thred.exit ?
<canton7>
just end whatever operation you're doing in the thread
lolmaus has quit [Quit: Konversation terminated!]
Takle has joined #ruby
lolmaus has joined #ruby
<canton7>
so if the thread contains a loop at its root, break out of the loop
bal has quit [Quit: bal]
<zenspider>
unshadow: thread's loop should break, thread will stop running at the end of its block
<unshadow>
will it be ok to write exit ? or this will stop the whole main loop ?
<zenspider>
spawning loop should be adding threads to some collection and ensuring they're all joined before the program exits
sigurding has quit [Quit: sigurding]
<canton7>
just break out of the loop
<zenspider>
while true do break end
Macaveli has joined #ruby
<unshadow>
ok
<unshadow>
ill just wrap it in while true
<zenspider>
in other words, have the thread "stop itself" by stopping doing stuff
<zenspider>
unshadow: wrap what up?
<soahccc>
What is wrong with Thread.current.kill ?
<zenspider>
let me back up...
<unshadow>
Thread.current.kill ? will that work ?
<zenspider>
unshadow: what are you actually trying to do?
jasooon has joined #ruby
joonty1 has joined #ruby
<zenspider>
don't use the word "thread"
timonv_ has joined #ruby
<canton7>
unshadow, why are you trying so hard to do things in a very different way to the norm?
thsig_ has quit [Remote host closed the connection]
TPBallbag has quit [Remote host closed the connection]
<zenspider>
canton7: how does that question help _anyone_?
joonty1 has quit [Client Quit]
thsig has joined #ruby
joonty1 has joined #ruby
<canton7>
you never know, he might 1) tell us why it doesn't want to simply stop doing things, or 2) think about what he's trying to do *shrug*
rbrs has joined #ruby
<soahccc>
I wrote a threaded application which manages threads in an array and regulary scrubs dead threads in case they died which will happen if you kill it or it just "exited"
M3M0CooL has quit []
sinkensabe has quit [Remote host closed the connection]
<unshadow>
zenspider: my issue is this, in the begging of the thread I have a small check, if the check fails I want to kill the execution of the remaining code, the thread is not in a loop so if i want to use break i'll need to redisgin my whole thread
joonty has quit [Ping timeout: 244 seconds]
<zenspider>
unshadow: I asked what you were actually trying to make your code do, and to not use the word thread.
<unshadow>
ok, that will stop all ohter executions ?
rylev has quit [Ping timeout: 265 seconds]
<canton7>
surely you know what return does ;)
<soahccc>
Does it make sense to #join !#alive? threads?
<unshadow>
;) never thought it will be that simple, thanks !
<zenspider>
soahccc: there's no problem with it, it's a standard idiom
patrick99e99 has joined #ruby
<soahccc>
Because I just did a threads.select!(&:alive?)
<zenspider>
threads.map(&:join)
<zenspider>
the ones you toss are done and they'll get GC'd
<zenspider>
assuming there's no other references to them
joonty1 is now known as joonty
weemsledeux has joined #ruby
sigurding has joined #ruby
jusmyth1 has joined #ruby
nonks has quit [Ping timeout: 246 seconds]
jusmyth1 has left #ruby [#ruby]
sinkensabe has joined #ruby
Brando753 has quit [Ping timeout: 265 seconds]
nateberkopec has joined #ruby
patrick99e99 has quit [Ping timeout: 255 seconds]
<cHarNe2>
hi, i get this on one machine and on anoter i get the "proper/regular" rack-exeption page, what might be wrong? http://i.imgur.com/TXGQr7L.png
<zenspider>
an image??
<zenspider>
did you look at the error message?
njames has joined #ruby
<cHarNe2>
zenspider: yes, thats an image
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fabrice31 has quit [Remote host closed the connection]
njames has quit [Ping timeout: 265 seconds]
thsig_ has joined #ruby
nonks has joined #ruby
robustus is now known as robustus|Off
jdj_dk_ has quit [Ping timeout: 265 seconds]
thsig has quit [Ping timeout: 255 seconds]
himsin has joined #ruby
mengu has joined #ruby
muhammadn has quit [Remote host closed the connection]
fsapo has joined #ruby
pranny1 has quit [Quit: Leaving.]
phutchins has joined #ruby
bal has joined #ruby
dANO_ has joined #ruby
sigurding has quit [Quit: sigurding]
fabrice31 has joined #ruby
nateberkopec has quit [Quit: Leaving...]
Takle has quit [Remote host closed the connection]
Guest8130 has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
craigp has quit [Remote host closed the connection]
Takle has joined #ruby
Lewix has quit [Remote host closed the connection]
roolo has quit [Remote host closed the connection]
<mandee>
routed irregardless antipersonnel scattering girlfriends specifics quizzed foreshorten if affronting Finn disses pushiness causation manhunts deepens medicinals Bellatrix Tomas maze helpfulness substantiating taciturnity marginals cacheting
mandee was kicked from #ruby by apeiros [mandee]
mandee has joined #ruby
thsig_ has quit [Remote host closed the connection]
mandee was banned on #ruby by apeiros [mandee!*@*]
mandee was kicked from #ruby by apeiros [mandee]
<txdv>
Colgate
<apeiros>
the fuck?
jimbach has joined #ruby
<txdv>
probably pasted by mistake
<txdv>
:D
rpag has joined #ruby
<apeiros>
na, seems more like some idiot kiddo's bot
<ddv>
lol
max96at|off is now known as max96at
<crome>
haha
livingstn has joined #ruby
Guest58065 has quit [Client Quit]
benzrf is now known as benzrf|offline
TPBallbag has joined #ruby
<mike32>
does sinatra use for big sites?
<pagios>
for some reason this works from ruby: cronCommand = "/usr/bin/vim -s <(echo '/wvdial'; echo ':s/^/#/'; echo :wq) /var/spool/cron/crontabs/root" but this does not work: cronCommand = "/usr/bin/vim -s <(echo '/wvdial'; echo ':s/^.\{1}//'; echo :wq) /var/spool/cron/crontabs/root"
cleopatra has quit [Ping timeout: 245 seconds]
GreatSUN has joined #ruby
jdj_dk_ has quit [Read error: Connection reset by peer]
<GreatSUN>
rehi
danjordan has quit [Quit: danjordan]
mengu has joined #ruby
thsig has joined #ruby
gaussblurinc1 has joined #ruby
<gaussblurinc1>
hi!
<GreatSUN>
I have a problem at the moment with some subthreading :-(
<gaussblurinc1>
does anybody use guard-rubocop or guard-reek?
<rpag>
mike32, yup, it can
danjordan has joined #ruby
nowthatsamatt has joined #ruby
<GreatSUN>
I am defining a function outside of the thread, creating the new subthread which is calling the function somewhere
mengu has quit [Remote host closed the connection]
<GreatSUN>
afterwards waiting for the thread to finish
<GreatSUN>
the funtions first line is creating output via puts
<mike32>
rpag, if i have alot controller method , how can i organaze in sinatra?
sk87 has joined #ruby
<GreatSUN>
but this output is never seen, as well as the subthread seams not to be ending
nowthatsamatt has quit [Client Quit]
<GreatSUN>
any ideas on that?
msmith has joined #ruby
<pagios>
tobiasvl: any idea?
jasooon has joined #ruby
<tobiasvl>
pagios: nope
<rpag>
mike32, by making smaller controllers? you can create "controllers" in sinatra by subclassing Sinatra::Base, it ends up as a rack map you can mount to a path
<rpag>
rack app*
banister has quit [Ping timeout: 258 seconds]
weemsledeux has joined #ruby
TPBallbag has quit [Ping timeout: 272 seconds]
bMalum has quit [Quit: bMalum]
msmith has quit [Ping timeout: 244 seconds]
<rpag>
mike32, it takes more effort though, you might want to check out padrino as well
patrick99e99 has joined #ruby
desktop has joined #ruby
renderful has joined #ruby
banister has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
<unshadow>
while using sslsocket.pending, sometimes I see that though the number is 0, there is more information waiting on the socket, why is that ?
himsin has joined #ruby
Squarepy has joined #ruby
[[vedic]] has joined #ruby
<GreatSUN>
lol
<GreatSUN>
just found the problem...
patrick99e99 has quit [Ping timeout: 255 seconds]
dblessing has joined #ruby
jasooon has quit [Ping timeout: 245 seconds]
<GreatSUN>
no error message, but using non existent variable :D
<apeiros>
otherwise, threads die silently on exception
<apeiros>
IMO that should be the default and should be possible to set it per thread :-/
<rpag>
yeah, it'd be useful if you could pass an option like that to Thread.new
pothibo has joined #ruby
danjordan has quit [Quit: danjordan]
himsin has quit [Ping timeout: 240 seconds]
taptapdan has quit [Quit: taptapdan]
<apeiros>
it'd also be nice to be able to spawn a stopped thread
Timgauthier has joined #ruby
<apeiros>
right now that's unnecessarily complex
njames has joined #ruby
<rpag>
not sure what you mean by 'spawn a stopped thread' ?
danjordan has joined #ruby
<apeiros>
essentially what `Thread.new do sleep; …code… end` does, but without the race condition this code introduces.
<rpag>
ahh
<apeiros>
right now my solution is (iirc) a mutex and a condition variable. quite expensive compared to what native ruby could do.
<GreatSUN>
apeiros: you are right :-)
<GreatSUN>
but finally I found the issue :-)
<apeiros>
GreatSUN: that's great. I'd recommend you still set that option. will help you with future problems.
ghr has joined #ruby
LekeFly has quit [Read error: Connection reset by peer]
Deejay_ has joined #ruby
Axy has quit [Read error: Connection reset by peer]
LekeFly has joined #ruby
joonty1 has joined #ruby
Zettam has joined #ruby
njames has quit [Ping timeout: 265 seconds]
Takle has quit [Read error: Connection reset by peer]
TPBallbag has joined #ruby
alex88_ has joined #ruby
doev has quit [Ping timeout: 244 seconds]
robustus is now known as robustus|Off
Takle has joined #ruby
TPBallbag has quit [Remote host closed the connection]
<unshadow>
How would you write while either a=1 or b=1 do something ?
toretore has joined #ruby
unclouded has quit [Ping timeout: 265 seconds]
<apeiros>
unshadow: you mean ==?
boombadaroomba has joined #ruby
<unshadow>
yeha sorry
<rpag>
almost like that, "while a==1 or b==2; something(); end"
<apeiros>
while a == 1 || b == 1; …do something…; end
alex88 has quit [Ping timeout: 265 seconds]
<unshadow>
|| isnt for while both ?
bmurt has joined #ruby
joonty has quit [Ping timeout: 265 seconds]
Deejay_ has quit [Client Quit]
<rpag>
thats &&/and
<apeiros>
|| is logical or
<apeiros>
&& is logical and
<apeiros>
`||` and `or` differ in precedence only. but precedence of `or` makes it usually unsuitable.
<apeiros>
(same for && vs. and)
<toretore>
only idiots use `or`
<toretore>
and `and`
Xeago has joined #ruby
<apeiros>
hm, I beg to differ. but I don't use it because I know it to be a cause of confusion.
<toretore>
"oh look, my expression looks like a sentence in english"
nowthatsamatt has joined #ruby
<unshadow>
ok thanks
<rpag>
it does read better
hanmac1 has quit [Read error: Connection reset by peer]
<apeiros>
I'd prefer if ruby didn't have both &&/|| and and/or
<toretore>
it reads like you're an idiot!!!!!11
_ixti_ has quit [Ping timeout: 265 seconds]
<canton7>
they had to copy *some* bits of perl :P
jxf has joined #ruby
<apeiros>
canton7: most bits they copied they'd better not have copied.
<canton7>
not disagreeing with that :)
boombadaroomba has quit [Ping timeout: 244 seconds]
practition3r has joined #ruby
<rpag>
luckily it didnt borrow too much syntax-wise :)
jdj_dk_ has joined #ruby
<canton7>
'or' makes sense when used with 'die' or 'exit' - which rubyists rarely do :P
Takle has quit [Remote host closed the connection]
Macaveli has joined #ruby
hanmac1 has joined #ruby
<GreatSUN>
apeiros: surely, but I forgot it this time
<toretore>
try or die
arya_ching has joined #ruby
<apeiros>
I found `do stuff or die` a bad idiom in perl already. but then again, perl was my second language and I wasn't a particularly good coder back then.
TPBallbag has joined #ruby
<rpag>
what does "die" in perl actually do?
danjordan has quit [Quit: danjordan]
<canton7>
exit with an error, I think
<canton7>
same as PHP
browndawg has joined #ruby
<txdv>
"die" is never good if you want to have a reentrant library
<txdv>
however if you have just a perl script, then it is ok
Takle has joined #ruby
govg has joined #ruby
<apeiros>
o0
SouL has quit [Ping timeout: 260 seconds]
valeriansaliou has joined #ruby
tlarevo_ has quit [Ping timeout: 245 seconds]
gtrak has quit [Ping timeout: 250 seconds]
<practition3r>
Hello! I need help in my mini project. So I'm trying to bring the internet using SMS to our not-so-advanced country. So We already have an NLP-interpreter so one can just sms "what's the weather?" I need your help in giving me which APIs are nice to use for more info...like traffic API or IMDB api or idk.
unclouded has joined #ruby
it0a has joined #ruby
wald0 has joined #ruby
Hijiri has quit [Ping timeout: 260 seconds]
gitesh has joined #ruby
valeriansaliou has quit [Ping timeout: 255 seconds]
shazaum_ has joined #ruby
<gitesh>
Hello ruby
Lewix has joined #ruby
jespada has joined #ruby
shazaum has quit [Ping timeout: 255 seconds]
anarang has quit [Ping timeout: 240 seconds]
Hijiri has joined #ruby
govg has quit [Quit: Fatal error]
Xeago has quit [Remote host closed the connection]
danjordan has joined #ruby
Digital-_ has joined #ruby
Digital-_ is now known as digital-ghost_
bMalum has joined #ruby
digital-ghost_ is now known as dg__
<dg__>
test.
beef-wellington has joined #ruby
bMalum has quit [Client Quit]
robustus|Off is now known as robustus
rbrs has joined #ruby
sevenseacat has quit [Quit: Leaving.]
Lewix has quit [Remote host closed the connection]
gitesh has left #ruby [#ruby]
jerius has joined #ruby
tlarevo has joined #ruby
zorak8 has joined #ruby
<apeiros>
shevy: your brother uses irc now too?
iamjarvo has joined #ruby
dbugger has joined #ruby
<shevy>
huh
<apeiros>
shevy: "14:36 dg__: test."
alex88_ is now known as alex88
<shevy>
oh
<shevy>
hey dg__
<shevy>
he has a crazy nick
<dbugger>
Hi guys. If I have installed ruby 2.1.3 with RVM, what parameter should I pass to "passenger_ruby" on the nginx file?
jdj_dk_ has quit [Read error: Connection reset by peer]
iamjarvo has quit [Client Quit]
paulfm has joined #ruby
anarang has joined #ruby
fred-inRio has joined #ruby
frozon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rshetty has quit [Remote host closed the connection]
lampd1 has joined #ruby
njames has joined #ruby
arya_ching_ has joined #ruby
xymbol has joined #ruby
arya_ching has quit [Ping timeout: 258 seconds]
joonty1 is now known as joonty
njames has quit [Ping timeout: 244 seconds]
sambao21 has joined #ruby
GPH|work has joined #ruby
arya_ching_ has quit []
desktop has left #ruby [#ruby]
lampd1 has quit [Remote host closed the connection]
mistermocha has joined #ruby
willywos has joined #ruby
gtrak has joined #ruby
shortCircuit__ has quit [Remote host closed the connection]
grepwood has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
<grepwood>
Hello everyone. Is there anyone here using rbenv?
leizzer has joined #ruby
moritzs has joined #ruby
<grepwood>
I am trying to install this gem https://github.com/crewmate/crewmate on Ruby 2.1.3 installed via rbenv and it keeps nagging me to install Ruby 1.9.3
<grepwood>
I grepped for "1.9.3" in the entire repo and can't find what triggers this requirement
ursooperduper has joined #ruby
<grepwood>
Does anyone know how to walk around such arbitrary requirement?
niklasb_ has joined #ruby
allcentury has joined #ruby
Channel6 has quit [Quit: Leaving]
oleo has joined #ruby
mercwithamouth has joined #ruby
<brushdemon>
I'd help but i'm not familiar with rbenv sadly
VanillaGoat has quit [Ping timeout: 245 seconds]
rbennacer has joined #ruby
Timgauthier is now known as timgauthier_away
<rbennacer>
hey guys, what is the best ruby library to make postgres query
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krisleech has joined #ruby
jasooon has quit [Ping timeout: 260 seconds]
<krisleech>
is there anywhere which shows the approx. userbase for different versions of Ruby?
<apeiros>
rbennacer: define "best"
<apeiros>
rbennacer: some options: pg gem, sequel, active record.
<rbennacer>
well, the easiest to use and the most readable
<apeiros>
krisleech: I don't think there's a reasonable way to collect such data in the first place
<havenwood>
grepwood: there isn't an rbenv channel like #rvm or #chruby
<havenwood>
grepwood: ah, yeah dotfile
rbennacer has left #ruby ["Leaving"]
<grepwood>
havenwood, I'm pretty damn sure you would encounter this error outside of rbenv given that your system has a different version of Ruby packaged
<havenwood>
grepwood: it's a simple tool and I understand what it's doing
Deejay has joined #ruby
IceDragon has joined #ruby
lxsameer has quit [Quit: Leaving]
Deejay is now known as Guest94833
<havenwood>
grepwood: Anyways, beside the point. I'd suggest a PR to crewmate adding that .ruby-version file to the .gitignore.
mengu has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 245 seconds]
<havenwood>
and delete it
<grepwood>
.ruby-version is optional?
<havenwood>
yes, if you'd like to auto-switch rubies when entering the directory
Guest94833 has quit [Client Quit]
<havenwood>
grepwood: it's a common format supported by the popular Ruby version switchers. RVM and chruby support it with fuzzy matching and rbenv kinda limps in. :P
<grepwood>
I wonder if .ruby-version supports logical operators
<rpag>
its just a dumb string afaik
<grepwood>
so that for instance the gem could only install on Ruby X.Y.Z or newer/older
tlarevo has quit [Remote host closed the connection]
<havenwood>
rpag: aye
<havenwood>
grepwood: nope
mengu has joined #ruby
<havenwood>
grepwood: none of the switchers happen to support that
camt has quit [Remote host closed the connection]
<rpag>
required_ruby_version on Gem::Specification is all i can think of thats close
rylev has quit [Read error: Connection reset by peer]
<Senjai>
If I want a straight up executable, I use apt
<Senjai>
or yum
anarang has quit [Ping timeout: 245 seconds]
<shevy>
except that debian-based distributions often eliminate mkmf
<havenwood>
Senjai: cracked me up a while back when i saw an iOS dev install their package manager, cocoapods, with gem
<havenwood>
turtles all the way down
<shevy>
I prefer cats over turtles
<Senjai>
haha
<rpag>
coffeescript was a gem once too wasnt it?
<shevy>
though a turtle is handy... if you ever need a shield against a fire breathing dragon in reallife, you just gotta find a big turtle, then pick it up
<havenwood>
rpag: seems a lot of things start life as a gem then mature onto package managers
pranny has joined #ruby
<Senjai>
havenwood: s/other package managers/other language implimentations
xymbol has quit [Quit: Be back later ...]
<Senjai>
:P
banister_ has joined #ruby
xymbol has joined #ruby
<havenwood>
shevy: turtles or apples?
<rpag>
havenwood, yeah i guess gem is easier
<rpag>
works everywhere
<brushdemon>
ports and pkg are possibly the best
<brushdemon>
however I still prefer portage over ports
<rpag>
compiling from source for everything = no time
unshadow has quit [Quit: leaving]
<BaNzounet>
Hey do you know why runing this : `docker ps --no-trunc -q` returns unexpected error error="No such file or directory - docker"
<rpag>
and then, a dreaded compile error :(
<brushdemon>
eh, I have a home server which I use to build everything on
<brushdemon>
I kind of maintain my own rsync mirror and binary repo
paulfm has quit []
banister has quit [Ping timeout: 244 seconds]
Hijiri has quit [Ping timeout: 265 seconds]
<brushdemon>
I wrote up an emerge frontend in bash... kind of tried to make it more user friendly I guess
<rpag>
nice
<brushdemon>
I was thinking of either re-writing it in either ruby or python
<havenwood>
BaNzounet: docker isn't installed? or your PATH is messed up?
chipotle has quit [Quit: cya]
<brushdemon>
more leaning towards python because that way I can interact more directly with the portage API
jasooon has joined #ruby
Takle has joined #ruby
rshetty has quit [Remote host closed the connection]
j_mcnally has joined #ruby
<rpag>
portage is python?
<BaNzounet>
havenwood: I can access docker CLI from a regular shell :(
mengu has quit [Remote host closed the connection]
<Senjai>
BaNzounet: You should ask in the docker related channels :P
jdrumheller has joined #ruby
<brushdemon>
yeah, most things built by gentoo are either python or bash
<brushdemon>
or perl
<rpag>
shudder@perl
<brushdemon>
perl is great
nrsk has joined #ruby
<BaNzounet>
I though It was related to my synthax or something :
<brushdemon>
if you're egyptian
<sweeper>
walk like an egyptian...
<rpag>
haha
agrinb has joined #ruby
hanmac1 has quit [Quit: Leaving.]
hanmac1 has joined #ruby
<rpag>
was looking through perl code the other day, and yeah, its syntax doesn't woo me
<brushdemon>
it's like reading hieroglyphics :')
<nrsk>
Hi all! I have exception and want to get only summary, not a full message. How can I get it?
<Senjai>
brushdemon: YOUR LIKE READING HEIROGLYPHICS! #owned
<Senjai>
nrsk: exception.message
lmickh has joined #ruby
iamjarvo has joined #ruby
<Senjai>
want it smaller? exception.message[0..250]
<rpag>
there's just Exception#message, its usually not big
<rpag>
like a single line
<brushdemon>
Senjai: that explains why my relationships always end up 'complicated' ;-;
avril14th has quit [Remote host closed the connection]
icarus has joined #ruby
cndiv has joined #ruby
sigurding has joined #ruby
ta has quit [Ping timeout: 250 seconds]
grepwood has quit [Quit: Leaving]
hamakn has joined #ruby
Deejay has joined #ruby
Deejay has quit [Client Quit]
starkhalo has joined #ruby
jdj_dk has quit [Ping timeout: 260 seconds]
allcentury has joined #ruby
skolman_ has joined #ruby
pauly_oc has joined #ruby
ghostmoth has joined #ruby
rkalfane has joined #ruby
harax_ has quit [Ping timeout: 244 seconds]
syntaxritual has joined #ruby
syntaxritual has quit [Client Quit]
IceDragon has quit [Ping timeout: 265 seconds]
IcyDragon has joined #ruby
Psy-Q has joined #ruby
moritzs has quit [Ping timeout: 250 seconds]
xiq has quit [Ping timeout: 250 seconds]
krz has quit [Quit: WeeChat 1.0.1]
IcyDragon is now known as IceDragon
<Psy-Q>
when testing a gem, what would i require in my rspec files? can i require 'cider_client' in this case? https://github.com/psy-q/cider_client
freezey has joined #ruby
<Psy-Q>
it's my first gem, sorry if that's basic
ta has joined #ruby
<rpag>
as long as 'lib/' is on $LOAD_PATH that should work
gauke has quit [Quit: gauke]
<Psy-Q>
rpag: that's why i was wondering: when i execute rspec (even with bundle), it should add the lib/ from this very gem to the load path, right?
<Psy-Q>
the spec seems to work at least, but i'm not sure if that's some magic happening
<rpag>
you dont seem to require the library or try to, but anyway, if you plan to use bundler you could require 'bundler/setup' followed by Bundler.require :default to require all the dependencies in your Gemfile
charliesome has quit [Quit: zzz]
<Psy-Q>
ah, damn, i haven't pushed the latest stuff. just a second
TPBallbag has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 246 seconds]
leon1 has joined #ruby
danijoo has joined #ruby
bricker`work has joined #ruby
TPBallbag has joined #ruby
wpp has quit [Quit: ZZZzzz…]
leon1 is now known as Hijiri
<Psy-Q>
i'll punch the first test until it's green, then i'll push. will be a few minutes :)
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rkalfane has joined #ruby
havenwood has joined #ruby
siwica has quit [Remote host closed the connection]
troyready has joined #ruby
danijoo_ has quit [Ping timeout: 250 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BadQuanta has joined #ruby
rshetty has joined #ruby
thagomizer has joined #ruby
siwica has joined #ruby
fabrice31 has quit [Remote host closed the connection]
doev has quit [Ping timeout: 245 seconds]
Takle has quit [Remote host closed the connection]
<IceDragon>
general programming question, whats the name of the ^ operator?
geggam has joined #ruby
fred-inRio has quit [Ping timeout: 255 seconds]
<eam>
IceDragon: xor
<eam>
specifically bitwise xor
<eam>
or actually, is it bitwise in ruby?
<chrisbolton>
I have a nested hash and I’m trying to remove a key/value pair at multiple levels without a lot of looping. Here is a sample hash (https://gist.github.com/cbolton-sge/69b5258b4398affc3d3f) and I’m trying to remove application_id and value at every level. Any ideas? I can do it looping just looking for something a little more elegant.
Photism has joined #ruby
<IceDragon>
eam: thanks much, I rarely used it and didn't know its name P:
<eam>
looks like there's no boolean version of xor in ruby
<eam>
that's weird
jimbach has quit [Remote host closed the connection]
siwica has quit [Remote host closed the connection]
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ilia_ has quit [Remote host closed the connection]
ilia_ has joined #ruby
chipotle has quit [Quit: cya]
ilia_ has left #ruby [#ruby]
nurey has joined #ruby
TPBallbag has joined #ruby
Senjai has quit [Quit: WeeChat 0.3.7]
bklane has joined #ruby
Senjai`work has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
Senjai`work has joined #ruby
Senjai`work has quit [Changing host]
<nurey>
i have a module with method “foobar” that is memoized using Memoist i need to refactor so that there is another module with the same method “foobar” that is not memoized
<nurey>
let me clarify. I want to be able to “extend Foobar” and also “extend Foobar::Memoized”. Foobar module has a foobar method that is not memoized. Foobar::Memoized module has the same foobar method that is memoized
AlSquire has joined #ruby
<havenwood>
apeiros: interesting
ramfjord has joined #ruby
lampd1 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 256 seconds]
WormDrink has quit [Ping timeout: 272 seconds]
jobewan has joined #ruby
valeriansaliou has quit [Quit: Be back later ...]
<havenwood>
nurey: so you're going to change the name of one of them?
Hijiri has quit [Ping timeout: 244 seconds]
jdj_dk has quit [Ping timeout: 265 seconds]
Takle has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
sinequanon has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
mityaz has quit [Quit: Leaving]
JustinAiken has joined #ruby
sinequanon has quit [Remote host closed the connection]
<JustinAiken>
If you accidently run a spec file that has binding.pry where you're going to have 50 times it goes into pry mode,
<JustinAiken>
is there a way to get out of it (run through guard) without breaking the terminal?
<JustinAiken>
if you ctrl-c, it breaks the guard process, leaving rspec high and dry
hamakn has quit [Remote host closed the connection]
<JustinAiken>
but typing 'exit' 50 times is no fun :p
<havenwood>
JustinAiken: try?: exit-program
Xeago has joined #ruby
<havenwood>
JustinAiken: or: !!!
jasooon has joined #ruby
CuriousMind has joined #ruby
gauke has joined #ruby
joonty has quit [Quit: Leaving]
<JustinAiken>
no luck - same effect as plain ol 'exit'
<CuriousMind>
Hello everyone.
lkba has joined #ruby
<havenwood>
JustinAiken: hrm, `exit-all` or its alias `!!@`?
<rpag>
disable-pry
<havenwood>
rpag: ah, nice
<JustinAiken>
aah, disable-pry does the trick :)
<havenwood>
JustinAiken: look under: help navigating
<JustinAiken>
thanks, that will save me hours of unpleasantness
<pabloh>
if you use 'xx', that atom, will never match
siwica has quit [Remote host closed the connection]
<pabloh>
but with 'aa', the first atomic group should match at least once
danjordan has joined #ruby
econerd4ever has joined #ruby
<havenwood>
pabloh: then + instead of *
siwica has joined #ruby
<pabloh>
havenwood, that would simply fail
freezey has quit [Remote host closed the connection]
<havenwood>
pabloh: as expected. am i just not getting the point?
<pabloh>
"aab" =~ /(?>(xx)*)(ab)/, I'm confused about why does this expression fails
jenrzzz has joined #ruby
wallerdev has quit [Quit: wallerdev]
bMalum has quit [Quit: bMalum]
<pabloh>
sorry this expression: "aab" =~ /(?>(aa)*)(ab)/
hamakn has quit [Ping timeout: 240 seconds]
sk87 has joined #ruby
moskovski has joined #ruby
roolo has quit [Remote host closed the connection]
reset has joined #ruby
<pabloh>
havenwood, since the first 'aa', should match, I thought the regexp engine should not backtrack for other possible matches, since the atomic group would tell it not to
<havenwood>
pabloh: by fails you mean returns `1` instead of `0`?
wpp has joined #ruby
<pabloh>
well, instead of nil
ramfjord has joined #ruby
<havenwood>
ah
<pabloh>
my idea was that after the first 'aa' matching, the whole expression will fail, but aparently it just keeps going, and match after the 1st letter
freezey_ has joined #ruby
<pabloh>
matches*
Spami has quit [Quit: This computer has gone to sleep]
Akagi201 has quit [Remote host closed the connection]
<pabloh>
eam, do you know why?
<eam>
I don't know, but perldoc perlre has some text on this subject
stunder has joined #ruby
agrinb has joined #ruby
jenrzzz_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
<pabloh>
eam, may be the non-backtracking behavior, activates only if there is some string previously matched?
jerius has quit []
<eam>
perldoc leads me to believe that (?>) depends on being anchored
timonv_ has joined #ruby
<pabloh>
eam, allright I will try reading that, thanks!
rh1n0 has joined #ruby
zorak8 has quit [Ping timeout: 272 seconds]
kil0byte has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 265 seconds]
<eam>
fwiw whenever regexes get this complicated I tend to switch to something more structured
wallerdev has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
rh1n0 has quit [Max SendQ exceeded]
garbanotas has quit [Quit: This computer has gone to sleep]
renderfu_ has quit [Remote host closed the connection]
rh1n0 has joined #ruby
<benzrf>
use parsec(tm)
jdj_dk has quit [Read error: Connection reset by peer]
rh1n0 has quit [Max SendQ exceeded]
zorak8 has joined #ruby
tonini has quit [Ping timeout: 250 seconds]
doodlehaus has quit [Ping timeout: 240 seconds]
carraroj has joined #ruby
zorak8 has quit [Max SendQ exceeded]
<eam>
"(?>pattern)" does not disable backtracking altogether once it has matched. It is still possible to backtrack past the construct, but not into it. So "((?>a*)|(?>b*))ar" will still match "bar".
zorak8 has joined #ruby
djbkd has joined #ruby
<eam>
I think this is the relevant part
Xeago has joined #ruby
philwantsfish has joined #ruby
zorak8 has quit [Max SendQ exceeded]
zorak8 has joined #ruby
reset has quit [Read error: Connection reset by peer]
sinkensabe has quit [Remote host closed the connection]
pauly_oc has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<philwantsfish>
i have a script that runs a windows bat file that ends in a pause command. It prints each line, for some reason the program hangs on the stdout.gets. But when i run the bat file from command line it does not hang. Is there anything unusual about my script? Can any output cause ruby to hang?
kp666 has quit [Read error: Connection reset by peer]
rh1n0 has quit [Remote host closed the connection]
nurey has quit [Quit: nurey]
wpp has quit [Quit: ZZZzzz…]
freerobby has quit [Quit: Leaving.]
siwica has quit [Remote host closed the connection]
pyon has quit [Ping timeout: 272 seconds]
Xeago has quit [Remote host closed the connection]
siwica has joined #ruby
Kricir has quit [Remote host closed the connection]
n3b has quit [Ping timeout: 265 seconds]
twohlix_ has joined #ruby
sinkensabe has quit [Ping timeout: 255 seconds]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nateberkope has joined #ruby
kasperti_ has joined #ruby
reset has joined #ruby
jerius has joined #ruby
nateberkope has quit [Client Quit]
francisfish has joined #ruby
nateberkopec has quit [Ping timeout: 260 seconds]
rylev has quit [Remote host closed the connection]
browndawg has left #ruby [#ruby]
gauke has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
bklane has quit [Remote host closed the connection]
bklane has joined #ruby
jimbach has joined #ruby
carraroj has quit [Ping timeout: 265 seconds]
n3b has joined #ruby
bklane has quit [Read error: Connection reset by peer]
bklane has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hobogrammer has quit [Ping timeout: 255 seconds]
<ismell>
hrmm, how do I get rvm to install ruby with the built in osx openssl?
shredding has quit [Quit: shredding]
<rpag>
i donno, someone here might, there's also #rvm
lampd1 has joined #ruby
shredding has joined #ruby
francisfish has quit [Client Quit]
<ismell>
oh i;ll ask in rvm
fr1eza has joined #ruby
rbrs has quit [Remote host closed the connection]
djbkd has joined #ruby
mityaz has joined #ruby
Hightower666 has joined #ruby
yfeldblum has joined #ruby
schaerli has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<workmad3>
ismell: you can't with new rubies
robbyoconnor has joined #ruby
<workmad3>
ismell: as the built in osx openssl is only 0.9.8
psyprus has quit [Ping timeout: 258 seconds]
<havenwood>
ismell: RVM can use brew or macports openssl packages or install its own with autolibs.
<havenwood>
ismell: Why do you ask?
francisfish has joined #ruby
psyprus has joined #ruby
freerobby has joined #ruby
jenrzzz_ has quit [Quit: leaving]
sinequanon has joined #ruby
jenrzzz has joined #ruby
pu22l3r has joined #ruby
jimbach has quit [Remote host closed the connection]
shredding has quit [Quit: shredding]
_ixti_ has joined #ruby
pushpak has quit [Ping timeout: 260 seconds]
pu22l3r_ has quit [Ping timeout: 265 seconds]
Kiwiheretic has joined #ruby
<workmad3>
havenwood: I think he wants ruby to use the openssl library that comes with OSX
<workmad3>
havenwood: despite it only being 0.9.8 and ruby needing 1.0.1 nowadays :)
<havenwood>
workmad3: i was just wondering what the reason for wanting to do that was
mikhailvs has joined #ruby
Takle has quit [Remote host closed the connection]
<workmad3>
havenwood: I'm assuming to avoid installing another library... so for crazy reasons :)
<havenwood>
workmad3: hard disk space or not having sudo or what, dunno
Photism has quit [Quit: Leaving]
<shevy>
you are way too curious havenwood
<havenwood>
shevy: the answer depends sometimes, and yeah i'm curious :P
<shevy>
on IRC I almost always try to not want to find out why people want something
gccostabr has quit [Quit: See you later!]
jenrzzz has quit [Client Quit]
Brando753 has joined #ruby
<eam>
shevy: I'm curious why you wouldn't want to find out
sinequanon has quit [Ping timeout: 265 seconds]
<shevy>
eam because I would not know why I'd want to know!
ursooperduper has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robertt_dex has joined #ruby
<shevy>
I'd have to dive into the wicked minds of people
<workmad3>
shevy: I'm jealous of your lack of curiosity... if I could achive that, I'd have had a lot less conversations that drove me to the brink of insanity due to wacky idiocy :(
[[vedic]] has quit [Ping timeout: 272 seconds]
<shevy>
hahaha
jusmyth has joined #ruby
<shevy>
I like the word wacky
jasooon has joined #ruby
jordsmi has joined #ruby
<fr1eza>
Hello
<rpag>
most likely reason is because it's another package to install
<rpag>
hey
AlHafoudh has joined #ruby
<fr1eza>
Just started looking at ruby, does anyone know why Matrix is immutable?
<rpag>
havent used the Matrix class at all, so nope, sorry
fmcgeough has joined #ruby
<fr1eza>
There is probably a reason, just seems strange at first glance to me
jobewan has quit [Ping timeout: 255 seconds]
<AlHafoudh>
is it possible to bundle vendor/cache inside .gem so when I install the .gem it does not need to download dependencies?
<eam>
system/exec have a very nonintuitive interface
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rpag>
dynamically? instance_variable_get
<certainty>
eval("@#{var_name}")
* certainty
hides
<fr1eza>
I mean like when you define a class
sinequan_ has quit [Ping timeout: 265 seconds]
<fr1eza>
you would have @variable = something in the constructor
<fr1eza>
and then when you want to be able to acess that at runtime
<jenrzzz>
eam: i'm still not sure about that. the docs for system/spawn say that any single string argument gets run in a subshell.
<eam>
jenrzzz: try it :)
Kiwiheretic has quit [Quit: Bye]
<certainty>
fr1eza: you mean a reader?
benzrf|offline is now known as benzrf
kil0byte has joined #ruby
pranny has quit [Quit: Leaving.]
TPBallbag has joined #ruby
<jenrzzz>
eam: i did, and it works as expected. system("ls *") expands the glob, system('ls', '*') does not
moskovski has joined #ruby
pu22l3r_ has joined #ruby
<eam>
jenrzzz: right, that one always runs a shell
<eam>
we're talking about case 1 & 2
<eam>
those do not
<jenrzzz>
what are case 1-2?
kasperti_ has quit []
TPBallbag has quit [Remote host closed the connection]
rajeshchawla has quit [Remote host closed the connection]
<eam>
11:54 < eam> eg: system "ls"; system "ls -l"; system "ls -l *" # which of these three runs /bin/sh?
<eam>
if a shell metacharacter like * isn't present, no shell is invoked
<eam>
given a single-arg form
<jenrzzz>
how do you know that?
<eam>
because I've read rb_exec_fillarg() in process.c
<apeiros>
eam is a ruby-jedi - he uses the source
<eam>
and am familiar with debuggers :)
<apeiros>
s/he/they/
<eam>
(and, bugs in it have bitten me before)
<apeiros>
I fail. again.
* certainty
used to be familiar with burgers
pu22l3r has quit [Ping timeout: 245 seconds]
<eam>
apeiros: I am a he
sambao21 has joined #ruby
rajeshchawla has joined #ruby
<apeiros>
I now ponder whether I'm too lazy to remember the gender of all people I interact with on IRC :D
Helious has joined #ruby
AlSquire has quit [Quit: This computer has gone to sleep]
pu22l3r_ has quit [Ping timeout: 265 seconds]
Hightower666 has quit [Ping timeout: 244 seconds]
jottr_ has quit [Ping timeout: 260 seconds]
pu22l3r has joined #ruby
<eam>
:)
St_Marx has quit [Quit: Ex-Chat]
<certainty>
doesn't matter, just pick one $gender and stick to it for the rest of the context
<eam>
use the gender-neutral "bro"
<certainty>
sis
<Nilium>
I remember gender if someone tells me it, otherwise I have no idea and they remain an it, like apeiros.
<j416>
lol gender-neutral "bro"
<certainty>
or in your case sith
<rpag>
the irc population seems to be predominately male
<apeiros>
Nilium: if I wouldn't IRC so much, I'd probably do that too. but there's sooo many people :-|
<Nilium>
There's a lot of people but I generally only speak with a few of them and am told the gender of even fewer
<apeiros>
rpag: yeah, and by reinforcing the stereotype, it will stay that way. hence I do the effort of being gender neutral.
<apeiros>
or trying to be.
pietr0 has joined #ruby
bjessbrown has joined #ruby
<rpag>
for some reason unknown to me males are attracted to programming more than anyone else
<certainty>
rpag: it's because they can't give birth
<apeiros>
rpag: there's a lot of reading material
<rpag>
at least on irc
<apeiros>
because it didn't use to be that way.
<rpag>
really? o_O
<apeiros>
really
momomomomo has quit [Ping timeout: 260 seconds]
<certainty>
when apeiros was younger, like when he was in school with metusalem, there were more female programmers
<certainty>
*scnr*
<apeiros>
and I think if men were less dickish, it might even change again.
momomomomo has joined #ruby
<jenrzzz>
eam: huh, that's a clever optimization :)
<apeiros>
certainty: you think I'm that young? why, thank you :D
sambao21 has quit [Quit: Computer has gone to sleep.]
<certainty>
nah, just wanted to be charming
<TeresaP>
eam thanks for the ENV[] reiteration. It works and looks a lot cleaner.
<rpag>
apeiros, tbh i always thought it was just because females preferred other trades
ursooperduper has joined #ruby
shazaum_ is now known as shazaum
<TeresaP>
Oh geez, are we doing this conversation again?
<certainty>
rpag: ever heard of lady ADA?
shazaum has quit [Changing host]
shazaum has joined #ruby
<rpag>
ceej, i have
<rpag>
woops
<rpag>
certainty, i have*
<certainty>
i'm quite sure she was female
<apeiros>
TeresaP: I think we'll have that conversation again and again for a couple of years to come. enjoy.
<TeresaP>
honestly I got a lot less crap from men for being female and interested in computers than other women growing up
<certainty>
of course that doesn't say anything about the distribution of female programmers accross the total population at that time
<certainty>
it's just an interesting point
<TeresaP>
lol apeiros
omosoj has quit [Ping timeout: 245 seconds]
<TeresaP>
I guess I should say 'girls' since we were kids
<TeresaP>
and 'boys'
<apeiros>
I think local culture can differ by large amounts with regards to that
<certainty>
the women i got to know where pretty good at programming.... they used to program the boys around them
<TeresaP>
Good point. I grew up in midwest USA
freezey has joined #ruby
<eam>
certainty: in the early days there were more female computer operators, but this isn't synonymous with "programmer" as we understand it
<TeresaP>
My mother used to discourage me, my father encouraged me. My teachers encouraged me. My female classmates made fun of me. My male classmates thought it was cool. Mixed messages, ftw.
<certainty>
eam: what days are we talking about here?
<eam>
it was perceived (and primarily was) data entry
<eam>
aka something a secretary would do
ptrrr has joined #ruby
rkalfane has joined #ruby
<TeresaP>
My dad made programming seem boring, but my physics teacher freshman year made it sound cool. 1997 for reference.
<certainty>
eam: alright... interestingly almost all "famous" computer engineers of those days i remember are male
<Nilium>
My dad gave me a Perl book and put me off programming for a few years as a result.
<eam>
the thing is, the women doing data entry also ended up implementing nontrivial logic and being compsci experts
<certainty>
Nilium: you have my sympathy
<TeresaP>
lol
<eam>
and when the personal computer took off the social expectations shifted
wald0 has quit [Ping timeout: 256 seconds]
jdj_dk has quit [Ping timeout: 258 seconds]
<Nilium>
He only knew how to do stuff in assembly, so I guess Perl was his idea of a starter language
pranny has joined #ruby
<certainty>
"how perl nearly killed my carreer as a programmer"
<certainty>
goot title for a book
<certainty>
erm, good
<rpag>
perl was my first language
timonv_ has joined #ruby
<rpag>
when i look at it now, i think ruby has spoiled me
<eam>
perl's an ok language, it's no better or worse than basic
<Nilium>
WDL was my first language after Perl.
Metics has joined #ruby
rajeshchawla has quit [Remote host closed the connection]
<eam>
(considerably better than say, gw-basic)
<Nilium>
After that, I used BlitzBasic, which is still a good Basic
jerius has quit []
<apeiros>
eam: I certainly prefer perl over basic
alaa00 has joined #ruby
<rpag>
visual basic 6 *memories*
<apeiros>
at least my memories for VB6 (without using the V part of it) are rather bad
<certainty>
i basically prefer certainty over perl
benzrf is now known as benzrf|offline
Eiam has quit [Quit: (╯°□°)╯︵ ǝpouǝǝɹɟ]
<rpag>
VB6 made it incredibly easy to build windows applications though
bjessbrown has quit []
<eam>
gw-basic -> qbasic -> pascal -> c -> perl
renderful has joined #ruby
<rpag>
i cant say the same for perl :
zai has joined #ruby
<rpag>
:)
<apeiros>
hence my emphasis on having it used for non-visual stuff
<apeiros>
i.e. the language/library part itself was horrible IMO
<rpag>
then there was vbscript
godd2 has joined #ruby
<eam>
some of us learned to program before the advent of the GUI environment
<certainty>
dim foo as variant
<certainty>
bah
<eam>
actually I picked up assembly when I was doing pascal in high school, so I could do graphics
pranny has quit [Ping timeout: 260 seconds]
Morkel has quit [Quit: Morkel]
<apeiros>
afair I had to use like 3 different interface implementations because non was complete, and each lacked in a different area.
<apeiros>
+database
<zai>
Hi! Say, you do something like "cat script | ruby". Is there any way to access the contents of the script in string form inside ruby?
<eam>
the graphics libraries that shipped with turbopascal weren't fast, I adapted stuff from mike abrah's black book and wrote pascal ffi bindings
<apeiros>
(insert randomly, I'm sure it'll still make sense)
<eam>
it wasn't ffi of course
<apeiros>
zai: $stdin.read
* certainty
learned enough vbscript to understand the loveletter worm
<zai>
apeiros: thanks! :)
<certainty>
back at that time
<eam>
the good old days where you just called int 10h to set the video mode and then wrote to memory
phutchins has quit [Ping timeout: 240 seconds]
<rpag>
certainty, i remember that, it was huge
<certainty>
my dad used to be a pascal programmer. that pretty much drove me away from programming
<eam>
pascal was great
cajone has joined #ruby
<certainty>
i don't think so. I had to use it again in university during the foundation
<eam>
what's not to like?
<certainty>
^dunno :)
<Nilium>
I never learned Pascal, though I like some of the stuff in it.
<eam>
certainty: I'll take it over .*
Deejay_ has joined #ruby
claymore has joined #ruby
<zai>
apeiros: hm... when I just enter "put $stdin.read" in my script and then pipe it into ruby, I don't get "puts $stdin.read" as output, but an empty line
<apeiros>
zai: you said `cat script | ruby`
<zai>
apeiros: yes
timonv_ has quit [Remote host closed the connection]
timonv_ has joined #ruby
Metics has quit []
paulfm_ has quit []
Cork has quit [Ping timeout: 250 seconds]
timonv^ has joined #ruby
kasperti_ has joined #ruby
Eiam has joined #ruby
shosti has quit [Ping timeout: 245 seconds]
<apeiros>
oh, I see. I thought you meant catting a file to a ruby script. but you cat your code to ruby to get it executed and want to access that code.
m8 has joined #ruby
<apeiros>
I'm not aware of a way to get at that code, no.
mikhailvs has left #ruby [#ruby]
zarubin has joined #ruby
jasooon has joined #ruby
paulfm has joined #ruby
<zai>
I say :( (and yes, that's what I'm trying to do)
<certainty>
eam: it's basically what many languages in that regard are bad. too much syntax, too much semantics (procedure/function separation as an example)... I like it the the "clinger-way", don't pile feature on feature but just eliminate the shortcomings that make those features appear to be neeeded
<apeiros>
now I'm confused again as to what you want, zai :-p
<certainty>
only running code is good code
<apeiros>
well, I got to attend different things anyway
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
genta has quit [Read error: Connection reset by peer]
jottr_ has joined #ruby
<apeiros>
certainty: my code is unafraid. it walks.
<certainty>
:)
<zai>
apeiros: me too, I think ^^ so yes, I want to run it but within that running code, I want to be able to access itself as string
gtrak has quit [Quit: No Ping reply in 180 seconds.]
wallerdev has quit [Quit: wallerdev]
<pontiki>
maybe 'my_code = File.read(__FILE__)' ?
<zai>
Like I would if I'd do File.open, but I wouldn't have a file
<certainty>
then fiddle with it and eval it again
jasooon has quit [Ping timeout: 255 seconds]
iamjarvo has joined #ruby
timonv^ has quit [Read error: Connection reset by peer]
freezey has joined #ruby
pranny has quit [Ping timeout: 245 seconds]
jerius has joined #ruby
<pontiki>
maybe you could tell us why you want to do so, and that might help someone figure out how to help, too
<zai>
Yust fiddle and output afterwards
pranny has joined #ruby
gtrak has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
pothibo has joined #ruby
<zai>
it might sound weird, as it's not something that makes a lot of sense. I want to have ruby code in an SVG, but in order to do that, I have to "tail -n +2 svgname.svg | ruby". but then I want to post process that whole svg file.
pranny has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
claymore has quit [Ping timeout: 255 seconds]
shosti has joined #ruby
olrrai has joined #ruby
<pontiki>
what does having ruby code embedded in an SVG file enable you to do?
<pontiki>
i.e, zai, what's the goal you're trying to accomplish with this?
shredding has quit [Quit: shredding]
timonv_ has joined #ruby
<pontiki>
maybe there's another approach that's not so weird, even tho i do like weird :)
olrrai has left #ruby [#ruby]
<certainty>
weird is the new hot
claymore has joined #ruby
<pontiki>
but weird is not the new orange!
jottr_ has quit [Ping timeout: 256 seconds]
<certainty>
nope orange is the new black though
<certainty>
clockwork orange is weired too
crazydiamond has quit [Ping timeout: 245 seconds]
neoxquick has joined #ruby
pyon has joined #ruby
<zai>
pontiki: nothing meaningful. there's a way to encrypt a PNG (with AES128) and turn it into another valid PNG. It involves some tricks, but it's possible. I want an SVG that encrypts to a PNG. But I don't want to add an extra script for the encryption. I want to have the script inside the SVG as well.
<pontiki>
that's the old orange, and one of my favourite weirds
chrishough has joined #ruby
doubleemms has joined #ruby
<pontiki>
interesting
pranny1 has quit [Ping timeout: 265 seconds]
jdj_dk has joined #ruby
<jenrzzz>
zai: can you do it the other way around and put the SVG into a ruby file's DATA?
<certainty>
zai: sounds like you want to read that file from within ruby then extract the code and run it inside a sandboxed environment
ceej has quit [Ping timeout: 244 seconds]
klaut has joined #ruby
Deejay_ has quit [Quit: Computer has gone to sleep.]
<zai>
jenrzzz: unfortunately not, as the SVG isn't valid anymore afterwards
tmoore has quit [Ping timeout: 244 seconds]
<jenrzzz>
zai: is the ruby code gonna be in CDATA or something?
ggherdov has quit [Ping timeout: 244 seconds]
ckrailo has quit [Ping timeout: 244 seconds]
PhilK has quit [Ping timeout: 272 seconds]
ramblinpeck has quit [Ping timeout: 272 seconds]
bove has quit [Ping timeout: 272 seconds]
andrewcarter has quit [Ping timeout: 272 seconds]
mjc_ has quit [Ping timeout: 272 seconds]
kyote has quit [Ping timeout: 272 seconds]
<zai>
jenrzzz: in a comment <!-- ruby code here -->
<pontiki>
this would be an SVG that you can pass around and it would always be a valid SVG, until you ran the embedded code, and it would turn into a valid (encrypted?) PNG ?
freerobby has quit [Quit: Leaving.]
<zai>
certainty: then I'd have to write another script again to extract the code. would love to have it all in one
joshingly has quit [Ping timeout: 272 seconds]
mroth has quit [Ping timeout: 272 seconds]
ckrailo has joined #ruby
<zai>
pontiki: exactly
tmoore has joined #ruby
mroth_ has joined #ruby
ramblinpeck has joined #ruby
bove has joined #ruby
joshingly has joined #ruby
kyote has joined #ruby
andrewcarter has joined #ruby
PhilK has joined #ruby
mjc_ has joined #ruby
<pontiki>
right off, i can't think of a way without an intervening filter of some kind to pass non-ruby code containing ruby code into ruby and have ruby directly understand that
p8952_ is now known as p8952
ceej has joined #ruby
apeiros has joined #ruby
<pontiki>
but there are things you put on a ruby command to do filtering and (a little) preprocessing, i think?
axl_ has joined #ruby
<zai>
I'd have <xml header><svg><!-- ruby code; __END__ --> more svg stuff, some extra bits as comment that become the PNG later on, some data that the ruby script reads and then </svg>
<terrellt>
Er, so you'd have to strip out the comments too, no?
<zai>
and i'd cut off the <xml header><svg><!-- with the tail -n and then pipe the rest to ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<zai>
terrellt: ruby will ignore everything after the __END__
<terrellt>
Right
<terrellt>
And you can't access the file content with DATA?
<zai>
though in the string, I'd like to have all of it. also the stuff after __END__
yfeldblum has quit [Ping timeout: 245 seconds]
TPBallbag has joined #ruby
n3b has quit [Ping timeout: 272 seconds]
<terrellt>
DATA will be a string with everything after __END__
<zai>
terrellt: it has to be the whole file. I don't want just the part after __END__
<terrellt>
You want the header you tail'd away?
<terrellt>
Or you want the ruby code you embedded?
ggherdov_ has joined #ruby
<zai>
well, no, I can't have that
<zai>
the ruby code + the __END__ and everything after
<terrellt>
Okay. Why not a shim? <!-- my_ruby_code = "rubycodeasstring"; eval my_ruby_code; __END__ stuff
p8952 has joined #ruby
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SouL_ has joined #ruby
<terrellt>
zai: By the way, this is neat.
<terrellt>
If you make it work I want the file, so I can try it out
<terrellt>
Assuming it's not some sorta trade secret.
kaspergrubbe has joined #ruby
Mars` has joined #ruby
n3b has joined #ruby
rajeshchawla has quit [Remote host closed the connection]
shredding has joined #ruby
<zai>
terrellt: lol, no trade secret ^^ I'll have it on my blog afterwards. /msg me your mail address or twitter handle or so and I'll ping you when it's live
ndrei has joined #ruby
ndrei_ has joined #ruby
alaa00 has quit [Ping timeout: 258 seconds]
<jenrzzz>
it'd be cool if ruby had something like __BEGIN__ that did the opposite of __END__
Imofftopic has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
fabrice31 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bklane has quit [Remote host closed the connection]
fsapo has quit [Remote host closed the connection]
<certainty>
zai: the entire code fits two lines? why not just ruby -e $(tail -n 2 file) < head -n -2 file ... the code would have to reald from stdin then
<zai>
jenrzzz: it has BEGIN{} but it's not really the same, as it doesn't just ignore the parts before. if the parts before have a parser error then it will break. unfortunately :/ (tried that)
<certainty>
anyway, gotta go
sssilver has left #ruby [#ruby]
jhwhite has quit [Quit: jhwhite]
bklane has joined #ruby
chrishough has quit [Ping timeout: 255 seconds]
zB0hs has joined #ruby
rodfersou has quit [Quit: leaving]
<zai>
certainty: hm... have to think about this. thanks for the suggestions! have a good day
kaspergrubbe has joined #ruby
boombadaroomba has quit [Remote host closed the connection]
IceDragon has quit [Ping timeout: 272 seconds]
<pontiki>
could you do something with BEGIN{} and END{} so that you suck up the entire content in the BEGIN{} block, extract the ruby code and evaluate it?
fabrice31 has quit [Ping timeout: 245 seconds]
pietr0 has quit [Quit: pietr0]
nonks has joined #ruby
skolman has joined #ruby
postmodern has joined #ruby
doug1 has joined #ruby
graydot has quit [Quit: graydot]
<zai>
pontiki: it wouldn't be a valid svg anymore if I had the svg part in BEGIN{}
claymore has quit [Ping timeout: 244 seconds]
chrishough has joined #ruby
<pontiki>
no, the BEGIN{} isn't part of the SVG, it's what you give the ruby command
KC9YDN has quit [Quit: "Let a hundred flowers bloom: let a hundred schools of thought contend." - Mao Zedong]
jdj_dk has quit [Remote host closed the connection]
User458764 has joined #ruby
psyprus has quit [Ping timeout: 258 seconds]
jdj_dk has joined #ruby
sambao21 has joined #ruby
<pontiki>
like: ruby -e 'BEGIN{#ruby code run before}' -e 'END{#ruby code run after}' SVGFILE
<pontiki>
i don't really know, i'm just tossing it out
benzrf|offline is now known as benzrf
n3b has quit [Ping timeout: 244 seconds]
claymore has joined #ruby
Deejay_ has joined #ruby
User4587_ has quit [Ping timeout: 256 seconds]
ndrei_ has quit [Ping timeout: 265 seconds]
<zai>
pontiki: hmm... I'm not sure. but maybe. I'll add it to my list of possibilities for further investigation
<pontiki>
yeah, this is an interesting problem, zai
pietr0 has joined #ruby
noop has quit [Ping timeout: 244 seconds]
elimin8r has joined #ruby
emmesswhy has joined #ruby
<pontiki>
i'd love to hear what you come up with
ghr has quit [Read error: Connection reset by peer]
ndrei has quit [Ping timeout: 265 seconds]
<certainty>
depending on the filesize you could also store the entire file in an environment variable
<certainty>
there are upper limits though
KC9YDN has joined #ruby
n3b has joined #ruby
<zai>
pontiki: I can ping you when I got something
timonv_ has quit [Ping timeout: 245 seconds]
<pontiki>
SVGs can certainly get complex, but at least they're just text
boombadaroomba has joined #ruby
<zai>
certainty: oh, like FOO="$(cat mysvg.svg)" and access that later within ruby?
<certainty>
zai: yeah
Hightower666 has joined #ruby
deadskinmask is now known as zombiejames
<pontiki>
zai: if i'm not on (unlikely :) ), use mesgserv :)
sea_local has joined #ruby
jottr_ has joined #ruby
chrishough has quit [Ping timeout: 272 seconds]
<zai>
certainty: hmm... could work. but yeah, filesize might be an issue...
<benzrf>
pontiki: nice tactic for parenthesized smiley o/
elimin8r has left #ruby [#ruby]
thagomizer has quit [Quit: Leaving.]
<zai>
pontiki: okido :)
<pontiki>
hehe
thagomizer has joined #ruby
klaut_ has joined #ruby
Wolland has joined #ruby
emmesswhy has quit [Quit: This computer has gone to sleep]
zombiejames is now known as totimkopf
jordsmi has quit [Quit: Connection closed for inactivity]
claymore has quit [Ping timeout: 255 seconds]
<certainty>
zai: also tempfiles are not an option?
klaut has quit [Ping timeout: 265 seconds]
claymore has joined #ruby
<zai>
certainty: everything is an option. also passing the original filename as argument somehow... so wouldn't have to be a tmp file
<zai>
certainty: everything that doesn't have too much shellcode, as I'd like to have that minimal and most/all done within that svg code
robbyoconnor has quit [Ping timeout: 265 seconds]
User4587_ has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Scub has quit [Quit: WeeChat 0.4.3]
<certainty>
zai: i'd go with ruby -e $(tail -n 2 file) < file ... that's pretty straight forward
ghr has joined #ruby
<zai>
certainty: my fav would be to have something like ruby -option svgfile.svg where the option tells it to just skip the first two lines. then I could just use __SCRIPT__ to get the file name and work with that
Parker0 has joined #ruby
Jonah11_ has joined #ruby
twohlix_ has quit [Quit: quiiiiit]
User458764 has quit [Ping timeout: 245 seconds]
<zai>
certainty: that'll give me the file available in $stdin.read, right?
ringaring has joined #ruby
<certainty>
zai: yes
<Jonah11_>
Why am I getting invalid date here: Date.strptime("11/16/2012 1:37:35 PM EST","%-m/%-d/%Y %-l:%M:%S %p %Z") -- https://eval.in/210672
zorak8 has joined #ruby
mityaz_ has quit [Quit: See ya!]
n3b has quit [Ping timeout: 245 seconds]
skolman has quit [Remote host closed the connection]
<eam>
zai: what are you trying to do?
<zai>
certainty: yeah, then it really seems to be the cleanest I can get...
<certainty>
zai: also you could add a shebang line at the end of your svg data then put the code there. Execute it with ruby -x ... it will ignore everything until shebang
skolman_ has joined #ruby
<certainty>
i hope that you can access the files content with __FILE__ then
kaspergrubbe has quit [Remote host closed the connection]
<jhass>
apeiros: new rubies ;)
schaerli has quit [Ping timeout: 255 seconds]
<zai>
certainty: no shit? really?? that's perfect! That'd be what I need!!
<certainty>
zai: yeah
<zai>
omg... let me try this. sec
IceDragon has joined #ruby
tonini has quit [Ping timeout: 250 seconds]
<TeresaP>
Anyone know a better way to state STEP_PAUSE = ((ENV['STEP_PAUSE'] or 0.5).to_f) unless defined?(STEP_PAUSE)
jaequery has joined #ruby
<TeresaP>
I keep getting warning: previous definition of STEP_PAUSE was here
<zai>
certainty: OMG, you're the best!! thank you so much for this! best solution. A+ :D
<Jonah11_>
Wolland: I see what your getting at, it works, but why? The "-" flag is supposed to subtract leading space padding....
NovapaX has quit [Client Quit]
harax_ has quit [Ping timeout: 272 seconds]
HashNuke has quit [Ping timeout: 244 seconds]
ghr has quit [Read error: Connection reset by peer]
oleo is now known as Guest11324
oleo__ has joined #ruby
HashNuke has joined #ruby
User458764 has joined #ruby
chrisseaton has joined #ruby
chrishough has joined #ruby
ec__ has quit [Ping timeout: 265 seconds]
Jackneill has quit [Ping timeout: 255 seconds]
Darryl_ has joined #ruby
ec__ has joined #ruby
mattmcclure has joined #ruby
shredding has joined #ruby
Parker0 has joined #ruby
Guest11324 has quit [Ping timeout: 244 seconds]
rajeshchawla has joined #ruby
User4587_ has quit [Ping timeout: 265 seconds]
skolman has joined #ruby
Akagi201 has joined #ruby
iamjarvo has joined #ruby
<cschneid>
I'm seeing some weird behavior where a newly created directory (from `mkdir_p`) is getting 655 permissions. So the owner can't get into it... I explicitly set mode: 0755, but that doesn't seem to change the behavior
jasooon has joined #ruby
<cschneid>
anybody seen this kind of weirdness? What should I look at
<cschneid>
umask looks right (0022)
TPBallbag has quit [Remote host closed the connection]
<eam>
cschneid: what's strace say
<TeresaP>
eam just to double-check, this is supposed to only output errors right? system("#{IDEVICEINSTALLER_BINARY_PATH} -U #{BUNDLE_ID} -u #{DEVICE_ID} > /dev/null")
vcoinminer______ has quit [Ping timeout: 272 seconds]
jrunning_ has quit [Ping timeout: 272 seconds]
yo61 has quit [Ping timeout: 272 seconds]
dnyy has quit [Ping timeout: 272 seconds]
<eam>
TeresaP: it should only output stderr
<eam>
cschneid: strace -emkdir
<TeresaP>
I don't see the output when I run it :-S
<eam>
TeresaP: your program may be printing "errors" to regular old stdout
jenrzzz has joined #ruby
<TeresaP>
That would be annoying
<cschneid>
oh weird. Turns out uname is weird in my delayed_job process, but not in my main rails process. What the heck!
banister_ has joined #ruby
banister_ has quit [Max SendQ exceeded]
<eam>
cschneid: was one started from a login shell and the other from bootup / rc.d?
jrunning_ has joined #ruby
dnyy has joined #ruby
ndrei has joined #ruby
<cschneid>
eam: one was started via a monit script, so I think it did lose its environment
banister_ has joined #ruby
vcoinminer______ has joined #ruby
<eam>
I suggest thinking the other way around - the non-login environment is correct
<cschneid>
well, its giving me a uname of `0122`, which is a very weird one
banister has quit [Ping timeout: 245 seconds]
n3b has quit [Ping timeout: 240 seconds]
<eam>
running from monit? check monit itself (walk up the process tree)
tercenya has joined #ruby
<certainty>
s/uname/umask/
<cschneid>
yeah, umask, sorry
<certainty>
compensated it :)
ghr has joined #ruby
shredding has quit [Quit: shredding]
psyprus has joined #ruby
<certainty>
i suspect monit is started from some rc script
wallerdev has joined #ruby
axl_ has joined #ruby
jgrevich has joined #ruby
n3b has joined #ruby
chipotle has quit [Quit: cya]
govg has quit [Quit: leaving]
User4587_ has joined #ruby
govg has joined #ruby
<cschneid>
certainty: checking the umask of monit - it is 0022, so its not monit itself doing it. It's downstream, so ruby/rails/one of the thousand gems
pranny has joined #ruby
<eam>
fun
<certainty>
aww man
pu22l3r has quit [Remote host closed the connection]
<benzrf>
it would be nice
<benzrf>
to have a thousand gems
<cschneid>
anyway, this is odd - I'll look into it more
<benzrf>
tthen i could sell em and have some funds
b3itz has joined #ruby
<eam>
benzrf: I will email you over this fortune file
<b3itz>
hey guys, so i need to create a fixed size array with random numbers in the array, for example, user enters array size 10, i need 10 random numbers in the array
pietr0 has quit [Quit: pietr0]
<eam>
b3itz: what have you tried so far?
shadeslayer has joined #ruby
reinaldob has quit [Remote host closed the connection]
User458764 has quit [Ping timeout: 250 seconds]
freezey has quit [Remote host closed the connection]
chrishough has joined #ruby
<shadeslayer>
hi there, I was wondering, where do I start if I want to process HTTP requests with ruby?
<b3itz>
eam: array = Array.new(1+rand(highRange)) and thats not right obviously lol
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shadeslayer>
benzrf: Star Wars didn't have Dragons :P
<shadeslayer>
benzrf: yep, looking at that
chrishough has quit [Ping timeout: 245 seconds]
nonks has quit [Ping timeout: 246 seconds]
<shadeslayer>
what I was specifically looking was for something like def foo() in my ruby code becomes a HTTP GET method that I can just query using magic.com/api/foo
<micahjam97>
how do you use rbenv to get the latest?
n3b has quit [Ping timeout: 244 seconds]
<eam>
0122 is the weirdest umask
<cschneid>
eam: yep. That wasted me and my pairs whole morning
<cschneid>
plus a few hours
<graft>
micahjam97: install rbenv, there is also a link to ruby-build on that github page. clone ruby-build, you'll get access to rbenv install, then just do rbenv install <version>
omosoj has joined #ruby
djbkd has quit [Remote host closed the connection]
<certainty>
eam: thanks for the heads up. weired bug
bmurt has joined #ruby
rkalfane has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
micahjam97: better yet, ruby-install and chruby :)
<micahjam97>
graft: thanks, you were very helpful
<certainty>
well 0111 would be even more weired, i reckon
sinkensabe has quit [Remote host closed the connection]
<micahjam97>
it was $350 so I'm not gonna complain
<j2p2>
haha, finish your food rpag
<rpag>
?
<havenwood>
micahjam97: then do a /usr/local install of Ruby: sudo ruby-install ruby 2.1.4 --system
sinkensabe has joined #ruby
User458764 has quit [Ping timeout: 256 seconds]
<j2p2>
oh, with the division and stuff
<havenwood>
micahjam97: unless you want to switch rubies, then chruby
atmosx has joined #ruby
bmurt has quit [Ping timeout: 258 seconds]
<atmosx>
hello
<rpag>
i just couldnt remember if &:+ was neccessary with inject or not :P
<j2p2>
:p
<havenwood>
atmosx: hey
emmesswhy has joined #ruby
W0rmDr1nk has quit [Quit: Leaving]
<atmosx>
anyone ever created a SaaS?
sambao21 has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
agrinb has quit [Remote host closed the connection]
<certainty>
rpag: it doesn't hurt but it's not needed
<atmosx>
If I have a project that I want to open source now, but hten I'd like to create a SaaS version of the same project (with additional features), what kind of license do I need to choose? Are there any limitations for me (since I'm the original dev) ? Anyone knows this kind of things?!
<atmosx>
havenwood: hey, how's life? :-)
Versality has joined #ruby
<eam>
atmosx: you can license code you write any way you wish
<rpag>
atmosx, seen people use a dual license for that in the past
<micahjam97>
so, I was trying to build ruby because I wanted to relearn it. I haven't touched it months, and I completely forgot pretty much everything about ruby. I'm looking for some really in-depth tutorials for Ruby that just don't say, like, this is how you print, but I want to go into types and stuff
<atmosx>
eam: and change it later on?
cndiv has quit [Ping timeout: 260 seconds]
<micahjam97>
any suggestions?
<havenwood>
atmosx: la bonne vie
<atmosx>
rpag: yes but GPLv3 can do it?!
<eam>
atmosx: you may not be able to revoke the terms, however you can always supply additional terms (dual license)
<eam>
and you can change the terms on new code
<rpag>
oh i have no idea, i don't understand licenses well enough - sorry
<atmosx>
havenwood: the sweet life?!
<rpag>
sidekiq is dual licensed
<atmosx>
rpag: yes me either, I need to study but a few leads could save me some time
bklane has quit [Ping timeout: 258 seconds]
<atmosx>
yeap I'm using the free version :-P
<havenwood>
atmosx: nice out, windy, new Ruby versions
<rpag>
well, 'insecure by default' isnt a good default :P
<havenwood>
why oh why doesn't OpenSSL have good defaults to begin with? >.>
<certainty>
depends
<atmosx>
havenwood: no idea, really.
<certainty>
havenwood: because legacy
lightbringer has joined #ruby
<eam>
good is a moving target
chrishough has joined #ruby
charliesome has joined #ruby
<certainty>
hart to hit
<eam>
at one point in time these defaults were good
<lightbringer>
anybody know any good resources or books for in-depth ruby
<certainty>
also it depends on the usecases.
<b3itz>
can i convert an int to a string AND round to 4 places? I tried average.to_s.round(4) with no luck
User458764 has joined #ruby
<certainty>
don't get me started on ciphersuites
<havenwood>
but they don't move so downstream has to scramble to find folk competent to make sane decisions
<lightbringer>
rubybot
<rpag>
i think the openbsd guys forked openssl?
<lampd1>
b3itz: what about rounding before converting to string?
<brushdemon>
a long time ago
<certainty>
rpag: yes libressl
<brushdemon>
libressl
chrishou_ has joined #ruby
<rpag>
i wonder if that'll take off or not
<lampd1>
average.round(4).to_s
<brushdemon>
just it got more popular with heartbleed
<lampd1>
or something
<brushdemon>
it's openbsd... they'll take off in their own OS
<rpag>
hey, openssh took off :P
<certainty>
it will not. openbsd folks like to say that at some point others may benifit from their patches but in reality that's not the case and probably never will be
<certainty>
it's just a fork and the upstream openSSL remains "bad"
<b3itz>
lampd1: i need the long decimal to calculate standard deviation
jerius has quit []
bklane has joined #ruby
<eam>
upstream has been incorporating fixes
<eam>
general code quality aside
<lampd1>
well, what about creating a variable that gets logged and then rounding and converting to string after logging?
djbkd has quit [Remote host closed the connection]
chrishou_ has quit [Ping timeout: 265 seconds]
pietr0 has quit [Quit: pietr0]
djbkd has joined #ruby
bklane has quit [Remote host closed the connection]
shosti has quit [Ping timeout: 265 seconds]
<b3itz>
awesome link thanks certainty
elaptics is now known as elaptics`away
<b3itz>
lampd1: i used deviation.round(4).to_s
<fr1eza>
Whats the best way to achieve something like overloading constructor in ruby
cina has joined #ruby
<certainty>
fr1eza: you mean overloading my arguments? i'm not aware of a method other than taking arbritary arguments and dispatch on your own
<rpag>
yeah, same
<fr1eza>
hmm ok
<fr1eza>
like just take initialize(args) and parse ?
carraroj has joined #ruby
<certainty>
fr1eza: yeah
<rpag>
def initialize(*args); end
<certainty>
fr1eza: more like initialize(*args)
<rpag>
then switch on args.size
<fr1eza>
ok ill do that
djbkd has quit [Remote host closed the connection]
axl_ has quit [Quit: axl_]
djbkd has joined #ruby
pothibo has joined #ruby
axl_ has joined #ruby
chrishough has joined #ruby
banister_ is now known as banisterfiend
User4587_ has joined #ruby
renderful has quit [Remote host closed the connection]
skolman has quit [Remote host closed the connection]
<fr1eza>
this sort of thing is alien to me as a java developer
skolman_ has joined #ruby
doodlehaus has quit [Remote host closed the connection]
User458764 has quit [Ping timeout: 256 seconds]
<certainty>
fr1eza: i hear you. on the other hand there are things that are alies as well but pretty neat
<fr1eza>
yeh I very much like the syntax of ruby compared with java, but I dont think its hard to beat
<certainty>
indeed
sinkensabe has quit [Remote host closed the connection]
iamjarvo has joined #ruby
<certainty>
also java's typesystem is pretty bad (at least it used to be), so that's a relief as well. I remember when i came from c++ i was looking for overloaded methods too but i rarely have cases for them today
<b3itz>
whats the rule when finding the median of an EVEN number array like [1, 3, 6, 9]
skolman_ has quit [Ping timeout: 244 seconds]
<certainty>
i usually don't dispatch, i simplify the constructor to have only one valid signature
<jenrzzz>
b3itz: take the average of the middle two
<eval-in__>
certainty => wrong number of arguments (2 for 1) (ArgumentError) ... (https://eval.in/210687)
<certainty>
bah
zorak8 has joined #ruby
<b3itz>
fr1eza: so i would do number = ARGV[0]?
<certainty>
anyway there are basically two ways. using optional keyword arguments or positional args
<fr1eza>
try puts ARGV[0] etc
tier has quit [Remote host closed the connection]
skolman_ has joined #ruby
pranny has quit [Ping timeout: 258 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
musl has quit [Quit: WeeChat 0.4.3]
TPBallbag has joined #ruby
ursooperduper has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kricir has joined #ruby
<b3itz>
ok so now im having issues making it think its an int... i tried highRange = ARGV[0] highRange.to_s
reinaldob has quit [Ping timeout: 260 seconds]
<fr1eza>
.to_i
hmsimha has joined #ruby
Nahra has joined #ruby
Hijiri has quit [Ping timeout: 265 seconds]
<b3itz>
thats what i mean
<b3itz>
t
fabrice31 has joined #ruby
Akagi201 has joined #ruby
MightyFrogMan22 has joined #ruby
chrishough has quit [Ping timeout: 255 seconds]
<fr1eza>
the to_i method doesnt change the existing varibale
Kricir has quit [Remote host closed the connection]
jimmyhoughjr has joined #ruby
<fr1eza>
high_range = ARGV[0].to_i
<b3itz>
./ArrayCalc.rb:17:in `initialize': can't convert String into Integer (TypeError) from ./ArrayCalc.rb:17:in `new' from ./ArrayCalc.rb:17:in `<main>'
<fr1eza>
try that
<b3itz>
ah
Kricir has joined #ruby
Hightower666 has quit [Ping timeout: 255 seconds]
<fr1eza>
im also told you should avoid camel case in ruby :P
<b3itz>
ohhh sorry. java tendencies lol
mistermocha has joined #ruby
<mg^>
getting out of camelCase habit was very hard.
WormDrink has quit [Ping timeout: 256 seconds]
musl has joined #ruby
<fr1eza>
yeh I had the same lol
<lampd1>
snake_case?
livingstn has quit []
<rpag>
yup
<mg^>
I like the underscores, though... it's rather more readable
jheg has quit [Quit: jheg]
mistermocha has quit [Remote host closed the connection]
<b3itz>
so instead i'd use high_range?
<lampd1>
snakes are just more badass than camels too
<b3itz>
or just highrange
alem0lars is now known as alem0lars|away
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
User4587_ has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
max96at is now known as max96at|off
altamic has quit [Quit: altamic]
Azure has joined #ruby
mistermocha has joined #ruby
<certainty>
what type of case is foo-bar?
Nahra has quit [Remote host closed the connection]
TPBallbag has quit [Ping timeout: 256 seconds]
pfg has quit []
User458764 has quit [Ping timeout: 244 seconds]
Nahra` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Akagi201 has quit [Ping timeout: 244 seconds]
fabrice31 has quit [Ping timeout: 256 seconds]
chrishough has joined #ruby
<lampd1>
nocase
<lampd1>
idk :P
<lampd1>
i like SCREAMING_SNAKE_CASE
<certainty>
an any case i like that one best. too bad it doesn't work with ruby
havenwood has quit [Remote host closed the connection]
mistermocha has quit [Remote host closed the connection]
<rpag>
its popular in lisp, i like it too
Nahra has joined #ruby
<fr1eza>
they use it in java for constants
<b3itz>
so the 'unless ARGV == 2' makes sure there are 2 command line arguments, how to i make sure ARGV[0] >= 1?
<certainty>
fr1eza: back to your question i would probably have the constructor like this: initialize(session_token, message_number, message_body, sha1 = generate_sha1)
kaspergrubbe has quit [Remote host closed the connection]
<b3itz>
the == 2 makes sure there are 2 argbs entered
<b3itz>
argvs
<rpag>
sounds like u want ARGV.size
<b3itz>
that will just get me the number of digits right?
<certainty>
fr1eza: that doesn't seem to be the same. in your case you dispatch on sha1_hash being the symbol :generate. In my case i use your method generate_sha1 to get the default value in the case where sha1 is not given
<b3itz>
i want to make sure argv[0] thats entered is larger than 1
<rpag>
it'll give you the number of args passed at the command line
<rpag>
ARGV[0].to_i > 1
jobewan has quit [Quit: Leaving]
weemsledeux has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<fr1eza>
hmm, what would you check in the method to check if it had been generated or set by the method
<b3itz>
ah ok thanks rpag ill try that
jdj_dk has quit [Quit: Leaving...]
sinequanon has joined #ruby
<certainty>
fr1eza: you don't need to check. the value will be generate only if you don't pass teh sha1_hash argument
<fr1eza>
then what if they pass a value
<fr1eza>
how do you assign it
<fr1eza>
oh
<fr1eza>
im retarded doh
<certainty>
my typing is totally off :/
kaspergrubbe has joined #ruby
<rpag>
fr1eza, arguably you couldn't pass the SHA1 _and_ generate it, interface is kinda confusing
momomomomo_ has quit [Quit: momomomomo_]
Cork has joined #ruby
chrishough has quit [Ping timeout: 256 seconds]
Cork is now known as Guest26662
User458764 has joined #ruby
lightbringer has quit [Ping timeout: 246 seconds]
shazaum has quit [Quit: Leaving]
valeriansaliou has joined #ruby
<fr1eza>
certainty will that work if the sha1 method depends on the other arguments being passed
<certainty>
rpag: i think that's ok. you either have the hash or let the method create it
chrishough has joined #ruby
Asher has quit [Quit: Leaving.]
sinequanon has quit [Ping timeout: 244 seconds]
WormDrink has joined #ruby
User4587_ has quit [Ping timeout: 245 seconds]
kaspergrubbe has quit [Ping timeout: 255 seconds]
renderful has quit [Remote host closed the connection]
<certainty>
fr1eza: yes
kil0byte has quit [Remote host closed the connection]
<rpag>
if it were me i'd make #initialize always accept the SHA, and have another utility method generate the SHA for you, so you could just pass that to #initialize
geggam has quit [Ping timeout: 255 seconds]
<certainty>
bar is basically identity to just make it clear
digital-ghost has quit []
kil0byte has joined #ruby
kil0byte has quit [Remote host closed the connection]
ramfjord has joined #ruby
<certainty>
rpag: i like that generally. The only counter argument i can currently think of is if you don't want to expose the actual hashing algorithm, in which case you wouldn't make it an argument either
omosoj has quit [Ping timeout: 240 seconds]
nonks has quit [Ping timeout: 246 seconds]
emmesswhy has quit [Quit: This computer has gone to sleep]
nateberkopec has joined #ruby
Versality has quit [Ping timeout: 244 seconds]
omosoj has joined #ruby
nonks has joined #ruby
ndrei has quit [Ping timeout: 244 seconds]
ndrei_ has quit [Ping timeout: 255 seconds]
BadQuanta has quit [Ping timeout: 272 seconds]
spyderman4g63 has quit [Remote host closed the connection]
xymbol has quit [Quit: Be back later ...]
spyderman4g63 has joined #ruby
graydot has joined #ruby
pietr0 has joined #ruby
User4587_ has joined #ruby
chrishough has quit [Ping timeout: 256 seconds]
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n3b has quit [Ping timeout: 244 seconds]
User458764 has quit [Ping timeout: 244 seconds]
spyderman4g63 has quit [Ping timeout: 260 seconds]
chrishough has joined #ruby
n3b has joined #ruby
Soda has quit [Remote host closed the connection]
b3itz has quit [Ping timeout: 246 seconds]
drawingthesun has quit [Ping timeout: 245 seconds]