Cultofmetatron has quit [Remote host closed the connection]
LaPetiteFromage has quit [Read error: Connection reset by peer]
chessguy has quit [Remote host closed the connection]
LaPetiteFromage has joined #ruby
tjbiddle has joined #ruby
sambao21 has joined #ruby
nkts has quit [Quit: -]
Ontolog has quit [Remote host closed the connection]
mootpointer has joined #ruby
slyv has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
FDj has joined #ruby
<BinaryMaster>
Can anyone tell my why this isn't working like I think it should: source = (samovar.respond_to? :get_name ? samovar.get_name : samovar.to_s) Instead of getting either the return from get_name or the var as a string I get a boolean value
CalebMingle has joined #ruby
<slyv>
Hey - So I'm trying to match a string in the format of: ".something a b c d" Where the first match is "something" and the second match is "a b c d". I was trying /.(.*) (.*)/, but that was matching everything in the first match up to the final space, leaving the second match to d. Could anyone help me find the correct regex ?
<bricker>
for array = [1, 2, 3], how can I get array[20..30] to return an empty array? I know about Array(nil), wondering if there's an instance method way I can do it
<bricker>
slyv: you need to escape that first dot, like /\.(.*) (.*)/
<banisterfiend>
bricker: still a to_a on the end of it
Davey has joined #ruby
<bricker>
banisterfiend: ah, not bad, thanks!
<BinaryMaster>
slyv, ".something a b c d".sub!(/\.\w/, 'found1').sub!(/[a-Z] [a-Z] [a-Z] [a-Z]/, 'found2')
<slyv>
The a b c d was just random text with spaces in it, and thanks bricked.
<slyv>
*bricker
__alpaca has joined #ruby
<BinaryMaster>
Can anyone tell my why this isn't working like I think it should: source = (samovar.respond_to? :get_name ? samovar.get_name : samovar.to_s) Instead of getting either the return from get_name or the var as a string I get a boolean value
sepp2k has quit [Remote host closed the connection]
tundrax has joined #ruby
GOMADWarrior has joined #ruby
locriani has quit [Remote host closed the connection]
pagios_ has quit [Remote host closed the connection]
_64k has quit [Ping timeout: 248 seconds]
francisfish has quit [Remote host closed the connection]
shinobi_one1 has quit [Quit: Leaving.]
banisterfiend is now known as banister`sleep
etcetera has quit []
Nimsical has joined #ruby
gabrielrotbart has joined #ruby
guitsaru has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
xardas has quit [Ping timeout: 252 seconds]
rupee has quit [Quit: Leaving]
tds has quit [Quit: tds]
Cultofmetatron has joined #ruby
benwoody has joined #ruby
d_roge has quit [Ping timeout: 246 seconds]
nik_-_ has quit [Quit: nik_-_]
jamesaxl_ has quit [Ping timeout: 245 seconds]
LaPetiteFromage has quit [Quit: LaPetiteFromage]
d_roge has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
jamesaxl has joined #ruby
csaunders has joined #ruby
rakl has quit [Quit: sleeping]
choobie has quit [Quit: choobie]
Ontolog has joined #ruby
kristofers has quit []
ZachBeta has joined #ruby
callmeivan_ has joined #ruby
d11wtq has joined #ruby
Hobogrammer_ has joined #ruby
callmeivan has quit [Ping timeout: 252 seconds]
callmeivan_ is now known as callmeivan
Silent__ has joined #ruby
<ShapeShifter499>
hi
<ShapeShifter499>
I'm new to ruby so I'm still learning
Cultofmetatron has joined #ruby
slainer68 has joined #ruby
<ShapeShifter499>
I want something that would act as a api to starbucks, I found this and it happens to be written in ruby. Anyone here know how to run this ? https://github.com/jakebilbrey/emeraldsiren
Catharz has quit [Quit: Catharz]
Hobogrammer has quit [Ping timeout: 264 seconds]
Hobogrammer_ has quit [Ping timeout: 240 seconds]
danshultz has joined #ruby
<jamesaxl>
ShapeShifter499: you should install it 1st
agarie_ has quit [Remote host closed the connection]
<ShapeShifter499>
jamesaxl, gem install?
pkrnj has joined #ruby
agarie has joined #ruby
<jamesaxl>
ShapeShifter499: yeah
<ShapeShifter499>
ah ha
<ShapeShifter499>
lol
<ShapeShifter499>
thanks
etcetera has joined #ruby
Michael__ has joined #ruby
marcdel has quit [Quit: marcdel]
<waxjar>
they should've put that in the README. the project has a Gemfile, that means it uses Bundler to manage dependencies. You should install bundler, then run bundle install to install the app's dependency's
<waxjar>
*dependencies
<lectrick>
How do I give class_eval a block variable? I keep getting "wrong number of arguments (1 for 0)" when I try to do class_eval(&block)
<waxjar>
you can run it with rackup
danshult_ has joined #ruby
danshultz has quit [Read error: Operation timed out]
<waxjar>
lectrick, you can't with class_eval, but you can with class_exec :)
Davey has quit [Quit: Computer has gone to sleep.]
Mattix has joined #ruby
kobain has joined #ruby
yshh has joined #ruby
heliumsocket has quit [Quit: heliumsocket]
philcrissman has quit [Remote host closed the connection]
SCommette has joined #ruby
heliumsocket has joined #ruby
sambio has joined #ruby
dankest has quit [Quit: Leaving...]
LaPetiteFromage has joined #ruby
supergiantrobot_ has quit [Quit: supergiantrobot_]
sambio has left #ruby [#ruby]
twoism has quit [Remote host closed the connection]
dankest has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
swex has quit [Ping timeout: 258 seconds]
dankest has quit [Client Quit]
jhn has joined #ruby
wargasm has quit [Ping timeout: 258 seconds]
csaunders has quit [Quit: Computer has gone to sleep.]
adkron has quit [Ping timeout: 252 seconds]
kofno has quit [Remote host closed the connection]
jerius has quit []
cloke has joined #ruby
dustint has joined #ruby
LaPetiteFromage has quit [Quit: LaPetiteFromage]
cloke has quit [Client Quit]
tvw has quit [Ping timeout: 268 seconds]
<wormwood>
Hello all, anyone have Ruby 2.0 with DTrace support up on OSX? I compiled ruby 2.0 with dtrace support but its not triggering a probe. Aside from compiling with DTrace support is there anything else I'm supposed to do?
locriani has joined #ruby
mmitchell has quit [Remote host closed the connection]
tylersmith has joined #ruby
cha1tanya has joined #ruby
kofno has joined #ruby
hach has joined #ruby
cloke has joined #ruby
wargasm has joined #ruby
dmiller has joined #ruby
cloke has quit [Client Quit]
ryanclark_ has joined #ruby
hamakn has joined #ruby
Domon has joined #ruby
mmlac-bv has quit [Quit: mmlac-bv]
cha1tanya has quit [Excess Flood]
Tectonic has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
cha1tanya has joined #ruby
hamakn has joined #ruby
xlab has joined #ruby
Hanmac2 has joined #ruby
jamesaxl has quit [Ping timeout: 240 seconds]
gaahrdner has quit [Remote host closed the connection]
Cultofmetatron has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 264 seconds]
twoism has joined #ruby
xcv has quit [Remote host closed the connection]
robert_ has joined #ruby
Hanmac1 has quit [Ping timeout: 245 seconds]
Davey has joined #ruby
gabrielr_ has joined #ruby
gabrielrotbart has quit [Read error: Connection reset by peer]
davetherat has quit [Remote host closed the connection]
arya_ has joined #ruby
davetherat has joined #ruby
arya has quit [Ping timeout: 248 seconds]
terrorpup has quit [Ping timeout: 255 seconds]
jeebster has quit [Quit: Leaving.]
mootpointer has joined #ruby
twoism has quit [Remote host closed the connection]
twoism has joined #ruby
danshult_ has quit [Remote host closed the connection]
CalebMingle has joined #ruby
Chryson has joined #ruby
gabrielrotbart has joined #ruby
gabrielr_ has quit [Ping timeout: 245 seconds]
gaahrdner has joined #ruby
ttt has joined #ruby
_maes_ has quit [Ping timeout: 256 seconds]
icole has quit [Remote host closed the connection]
philcrissman has joined #ruby
chrishough has joined #ruby
gabrielr_ has joined #ruby
sleetdrop has joined #ruby
rburton- has joined #ruby
gabrielrotbart has quit [Read error: Connection reset by peer]
soulofpeace has joined #ruby
ehaliewicz has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
wedgex has joined #ruby
Cultofmetatron has joined #ruby
ARCADIVS has joined #ruby
robustus has quit [Ping timeout: 276 seconds]
cod3r has quit [Ping timeout: 252 seconds]
baba has joined #ruby
subbyyy has joined #ruby
robustus has joined #ruby
baba has quit [Excess Flood]
__alpaca_ has joined #ruby
radic has quit [Disconnected by services]
radic has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
seoaqua has joined #ruby
gabriel__ has joined #ruby
gabrielr_ has quit [Ping timeout: 245 seconds]
gaahrdner has quit [Remote host closed the connection]
greenarrow has quit [Quit: IRC is just multiplayer notepad]
__alpaca_ has quit [Ping timeout: 256 seconds]
greenarrow has joined #ruby
Michael__ has quit [Remote host closed the connection]
Michael__ has joined #ruby
Michael__ has quit [Remote host closed the connection]
shevy has quit [Read error: Operation timed out]
Michael__ has joined #ruby
chipotle_ has joined #ruby
Guedes has joined #ruby
gabriel__ is now known as gabrielrotbart
ryanclark_ has quit [Ping timeout: 248 seconds]
gabrielrotbart has left #ruby [#ruby]
peta_ has quit [Quit: peta_]
kf8a has joined #ruby
sambio has joined #ruby
brain_shim has quit [Ping timeout: 252 seconds]
sambio has quit [Excess Flood]
sambio has joined #ruby
sambio has quit [Client Quit]
ZachBeta has quit [Quit: Computer has gone to sleep.]
nga4 has joined #ruby
bean has joined #ruby
icole has joined #ruby
cod3r has joined #ruby
mercwithamouth has quit [Quit: Lost terminal]
gabrielrotbart has joined #ruby
pcarrier has quit [Ping timeout: 252 seconds]
dmiller has joined #ruby
dmiller has quit [Remote host closed the connection]
pcarrier has joined #ruby
Tricon has joined #ruby
shevy has joined #ruby
nezumi has quit [Ping timeout: 248 seconds]
banister`sleep has quit [Remote host closed the connection]
jdunck has quit [Quit: Computer has gone to sleep.]
haxrbyte_ has joined #ruby
haxrbyte has quit [Ping timeout: 252 seconds]
brain_shim has joined #ruby
adkron has joined #ruby
kofno has quit [Remote host closed the connection]
tommyvyo has joined #ruby
cha1tanya has quit [Read error: Connection reset by peer]
chipotle_ has quit [Quit: cya]
chandankumar has joined #ruby
Guedes has quit [Ping timeout: 240 seconds]
twoism has quit [Ping timeout: 252 seconds]
johnnyfuchs has quit [Remote host closed the connection]
Targen has joined #ruby
sethetter has joined #ruby
johnnyfuchs has joined #ruby
tundrax has quit [Remote host closed the connection]
tundrax has joined #ruby
tundrax has quit [Remote host closed the connection]
sethetter has quit [Client Quit]
brennanMKE has quit [Remote host closed the connection]
ariedler has quit [Remote host closed the connection]
Michael__ has quit [Remote host closed the connection]
timmow has quit [Remote host closed the connection]
Michael__ has joined #ruby
tundrax has joined #ruby
mootpointer has quit [Quit: Computer has gone to sleep.]
arya_ has quit [Read error: Connection reset by peer]
rakl has joined #ruby
ryanclark_ has joined #ruby
IrishGringo has quit [Remote host closed the connection]
arya has joined #ruby
adamjleonard has quit [Quit: Leaving...]
Vivekananda has joined #ruby
rakl has quit [Client Quit]
Vivekananda has quit [Read error: Connection reset by peer]
d2dchat has quit [Remote host closed the connection]
ariedler has joined #ruby
Vivekananda has joined #ruby
aapzak has quit [Read error: Operation timed out]
ner0x has joined #ruby
mootpointer has joined #ruby
ryanclark_ has quit [Quit: ryanclark_]
aapzak has joined #ruby
pbertain has quit [Quit: pbertain]
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
tylersmith has quit [Quit: tylersmith]
axxT has quit [Read error: Connection reset by peer]
pbertain has joined #ruby
axxT has joined #ruby
axxT has quit [Changing host]
axxT has joined #ruby
Spooner has quit [Quit: Leaving]
ZachBeta has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
aemeredith has joined #ruby
michaelmartinez has joined #ruby
rakl has joined #ruby
unixinit has joined #ruby
Domon has quit [Remote host closed the connection]
ehaliewicz has joined #ruby
Opettaja has quit [Quit: WeeChat 0.4.0]
arya has quit [Ping timeout: 248 seconds]
d11wtq_ios has joined #ruby
Matip has joined #ruby
__alpaca_ has joined #ruby
Domon has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
ckrailo has joined #ruby
cantonic has quit [Quit: cantonic]
Mattix has quit [Ping timeout: 248 seconds]
philcrissman_ has joined #ruby
adamjleonard has joined #ruby
philcrissman has quit [Read error: Connection reset by peer]
lewis has joined #ruby
__alpaca_ has quit [Ping timeout: 264 seconds]
zenergi has joined #ruby
zenergi has quit [Client Quit]
arya has joined #ruby
zenergi has joined #ruby
zenergi has quit [Changing host]
zenergi has joined #ruby
zenergi has quit [Client Quit]
SegFaultAX has quit [Ping timeout: 264 seconds]
shammancer has quit [Quit: Leaving.]
<lewis>
hi
d11wtq_ios has quit [Remote host closed the connection]
Drakevr has quit [Ping timeout: 264 seconds]
Drakevr has joined #ruby
Drakevr has quit [Changing host]
Drakevr has joined #ruby
akam-it has joined #ruby
kaiwren has quit [Quit: kaiwren]
havenn_ has quit [Remote host closed the connection]
benlieb has joined #ruby
SegFaultAX has joined #ruby
timmow has joined #ruby
bnewton has joined #ruby
bnewton has quit [Client Quit]
Chryson has quit [Ping timeout: 245 seconds]
bnewton has joined #ruby
angusiguess has quit [Ping timeout: 268 seconds]
shammancer has joined #ruby
shammancer has quit [Client Quit]
gaahrdner has joined #ruby
benlieb has quit [Client Quit]
shammancer has joined #ruby
tundrax has quit [Remote host closed the connection]
philcrissman has joined #ruby
philcrissman_ has quit [Read error: Connection reset by peer]
<Liru>
Also should be mentioned that a lot of buildings would have their own inventory lists
tonini has joined #ruby
<Liru>
I'm guessing that I should implement classes
angusiguess has quit [Ping timeout: 256 seconds]
ananthakumaran has joined #ruby
hamakn has quit [Remote host closed the connection]
havenwood has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
cod3r has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
nomenkun has joined #ruby
<Hanmac>
Liru what kind of game are you planing?
<Liru>
Hanmac: IRC-based multiplayer game
bradhe has quit [Ping timeout: 268 seconds]
codesoda has joined #ruby
soulofpeace has joined #ruby
droppedonmyhead has quit [Quit: droppedonmyhead]
hamakn has joined #ruby
ph^ has quit [Remote host closed the connection]
hach has quit [Ping timeout: 256 seconds]
<Liru>
I feel like I should just implement the hash method and refactor it later
Hanmac has quit [Quit: Leaving.]
brtdv has joined #ruby
<shevy>
IRC based?
<Liru>
Yeah
<shevy>
we can play that through IRC?
<Liru>
Well, I don't have much right now
<shevy>
Hanmac.reboot
<shevy>
Hanmac.do_something_silly
mockra has joined #ruby
<shevy>
hehe
<Liru>
Currently, you can only idle and get levels based on what you're "doing"
<Liru>
which doesn't actually produce anything
<shevy>
Liru, I am rewriting my largest project right now... it's now the third day ... I am at like 3% finished so far...
Mon_Ouie has joined #ruby
jdunck has joined #ruby
<Liru>
oh?
dmiller has joined #ruby
<shevy>
I often feel ruby is too complicated
icole has quit [Remote host closed the connection]
<shevy>
Liru, yeah I hate rewrites, so when you wrote you dont have much right now, I dont have much right now either, in this rewrite. but it feels better, I can throw away many past design decisions and just move on and continue
workmad3 has joined #ruby
<shevy>
Liru it's often best to just write and write and write and then rewrite when it all sucks and continue to write
<Liru>
Yeah, thought so
jovy88 has quit [Read error: Connection reset by peer]
<Liru>
I know a guy who contributes to a few gems
<Liru>
I'll show him when I'm done, then watch his reaction to the code
<shevy>
Fuzai it's just how to "think" in ruby, you can think in how you want to change data into something you can use, and for this you use methods usually
<shevy>
like .reject
<neku>
havenwood: lol, sorry. my bad.
<shevy>
or .grep, as Hanmac showed
<Fuzai>
well i don't think grep would work
<Fuzai>
because it's a complex data set coming in
<Fuzai>
but the .reject is something new to me
<Fuzai>
kinda sounds like a .map thing
<shevy>
yeah
callmeivan has quit [Ping timeout: 252 seconds]
<shevy>
.reject and .select
<shevy>
when you want specific objects or want to do away with specific ones
mmozuras has quit [Ping timeout: 256 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
<shevy>
slay 'em!
<shevy>
ruby is 90% perfect
mmozuras has joined #ruby
<Fuzai>
I like it alot, it's easier to sound out what is going on once you get the basics down
<shevy>
yeah
d11wtq has quit [Ping timeout: 256 seconds]
<Fuzai>
from there it just turns into a research project
<shevy>
it's a bit complex taken together though
beneggett has joined #ruby
<Fuzai>
I've been using it since the 1st week of January and i've wrote probably 2,000 lines of code with it
<shevy>
cool
<Fuzai>
I finally decided I needed to re-write everything into an OOP style
<shevy>
I rewrite all the time :(
tjbiddle has joined #ruby
<Fuzai>
and emplore all the tricks i've learned along the way
love_color_text has quit [Ping timeout: 252 seconds]
<shevy>
the thing to ask is always whether a rewrite is really worth it
<Fuzai>
Re-writing doesn't bother me, it just means i've evolved into something that fits better
<shevy>
yes but it's still time
<Fuzai>
in this case it will help me, because it will make it easier for me to debug, and give others a decent example
<shevy>
I only regard ruby as a nice hobby, I should never allow it to suck too much time away
<Fuzai>
right now i don't want to give my code to people learning because i used so many bad tricks
<Fuzai>
I wrote a Robot for a HTTP chat room in Ruby
aemeredith has joined #ruby
<Fuzai>
then i built an interface in jquery / php to basically act as a online console to dynamically generate the Ruby bots
<Fuzai>
so far everything works well and i've got about 30 bots online as we speak
<shevy>
ewwwwww
<Fuzai>
But I think the code is a mess
<shevy>
yeah
<shevy>
better don't show it to anyone else :D
hach has joined #ruby
tjbiddle has quit [Client Quit]
nic019 has joined #ruby
love_color_text has joined #ruby
<Fuzai>
Eventmachine, with globals and no comments :)
<shevy>
ouw
<shevy>
no comments
<shevy>
I think there should always be comments, but they most be minimal, and also useful at the same time
<Fuzai>
Yea like i said, not code i wanna be giving people to learn how to write these things
<shevy>
*must be
aemeredith has quit [Ping timeout: 245 seconds]
Deele has quit [Ping timeout: 268 seconds]
aaronmcadam has joined #ruby
hach has quit [Ping timeout: 252 seconds]
aaronmcadam has quit [Remote host closed the connection]
aaronmcadam has joined #ruby
enriclluelles has joined #ruby
Deele has joined #ruby
love_color_text has quit [Ping timeout: 276 seconds]
love_color_text has joined #ruby
fixl has joined #ruby
Elhu has joined #ruby
aemeredith has joined #ruby
aemeredith has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
aemeredith has joined #ruby
love_color_text has quit [Ping timeout: 276 seconds]
adambeynon has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
atyz has joined #ruby
hamakn has joined #ruby
xlab has quit [Remote host closed the connection]
xlab has joined #ruby
<neku>
hey guys, is it possibile to keep looping over an enumerator when it reaches his end?
<hoelzro>
neku: what would that mean?
<hoelzro>
can you provide an example scenario in which you would do that?
tundrax has joined #ruby
<neku>
hoelzro: i'm working to a radio player
<neku>
i have a playlist
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<neku>
an when it reaches is end
backjlack has joined #ruby
<neku>
i want to start again from the first song
<hoelzro>
oh
<hoelzro>
so you want a circular enumerator
<neku>
yep
<hoelzro>
that's easy enough
thone has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
<neku>
hoelzro: the problem is I am on an enviroment where exception have an high computational cost
<neku>
and I am wondering if there is a property of enumerator that let achive that
sayan has joined #ruby
love_color_text has joined #ruby
<CyberMaN>
if obj == enum.last set whatever incremental value you have to 0 again?
moeSeth has joined #ruby
daniel_- has joined #ruby
thone has quit [Read error: Operation timed out]
bradhe has joined #ruby
mmozuras has quit [Ping timeout: 256 seconds]
senayar has joined #ruby
mmozuras has joined #ruby
timmow_ has joined #ruby
vikhyat has joined #ruby
<Fuzai>
[1,2] << [3,4] yields [1,2,[3,4]]. How do I join two arrays so my return looks like [1, 2, 3, 4] ?
<neku>
ok, found it guys! #cycle return an enumerator like that
<hoelzro>
huh
<hoelzro>
I looked for cycle, but couldn't find it
<hoelzro>
what class is it on?
<neku>
Enumerable
bradhe has quit [Ping timeout: 268 seconds]
love_color_text has quit [Ping timeout: 268 seconds]
<hoelzro>
crazy
thone has quit [Read error: Operation timed out]
d3c has joined #ruby
mmozuras has quit [Ping timeout: 252 seconds]
Macaveli has quit [Quit: Leaving]
Macaveli has joined #ruby
<Hanmac>
on newer ruby Enumerators have size method where you can look how many iterations the enum will take ... for sample ary.cycle(2).size == ary.size * 2
codesoda has quit [Remote host closed the connection]
nari has quit [Ping timeout: 245 seconds]
gungor has quit [Remote host closed the connection]
jbpros has joined #ruby
vikhyat has quit [Ping timeout: 245 seconds]
sathish316 has joined #ruby
skattyadz has joined #ruby
arya has joined #ruby
miso1337 has quit [Quit: afk]
thone has joined #ruby
Nanuq has joined #ruby
timmow_ has quit [Quit: Leaving...]
blaxter_ is now known as blaxter
timmow_ has joined #ruby
timmow_ has quit [Client Quit]
__alpaca_ has joined #ruby
timmow_ has joined #ruby
love_color_text has joined #ruby
dawkirst has quit [Ping timeout: 264 seconds]
vikhyat has joined #ruby
ToApolytoXaos has joined #ruby
skattyadz has quit [Ping timeout: 245 seconds]
skattyadz_ has joined #ruby
timmow_ has quit [Client Quit]
mootpointer has joined #ruby
timmow_ has joined #ruby
tomo has quit [Ping timeout: 255 seconds]
turtlebits has joined #ruby
timmow is now known as Guest74649
skattyadz_ has quit [Client Quit]
__alpaca_ has quit [Ping timeout: 264 seconds]
love_color_text has quit [Ping timeout: 264 seconds]
timmow_ is now known as timmow
foofoobar has joined #ruby
workmad3 has joined #ruby
gungor has joined #ruby
thone has quit [Read error: Connection reset by peer]
LennyLinux has joined #ruby
nga4 has quit [Ping timeout: 252 seconds]
mootpointer has quit [Client Quit]
sayan has quit [Read error: Connection reset by peer]
akhet2 is now known as akhet
akhet has quit [Changing host]
akhet has joined #ruby
mklappst_ has quit [Remote host closed the connection]
Nanuq has quit [Read error: Operation timed out]
arya has quit [Ping timeout: 248 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
benlieb has quit [Quit: benlieb]
Axsuul has quit [Ping timeout: 252 seconds]
LongLiveBacon has joined #ruby
Xeago has joined #ruby
wargasm has quit [Ping timeout: 248 seconds]
jbpros has quit [Quit: jbpros]
Giorgio has quit [Read error: Operation timed out]
dawkirst has joined #ruby
alup has quit [Remote host closed the connection]
alup has joined #ruby
Nanuq has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
thone has joined #ruby
adambeynon has quit [Quit: Computer has gone to sleep.]
<Fuzai>
Shouldn't I be able to use .map with the same variable i would use .each with?
leonidlm has quit [Ping timeout: 260 seconds]
atyz has quit [Quit: Leaving...]
<Fuzai>
I was using db.query("select * from table").each do |row| and i tried to move it to a db.query("select * from table").map{|row|} and i get an error of an undefined method
adambeynon has joined #ruby
swex has joined #ruby
yacks has quit [Read error: Operation timed out]
<shevy>
Fuzai what do you mean "same variable?
<shevy>
.map means apply-on-each
<shevy>
.each just iterates through the collection/container
<Hanmac>
... Fuzai ithink it does not include the Enumerable module ... try db.query("select * from table").each.map do |row|
<Hanmac>
... and when this returns "no block given" then blame the autor if it
<Fuzai>
i'm trying to .map on a db.query() and it's failing, i used to use an each here, i'm confused because I thought if a variable supported each it would support map as well
<Fuzai>
ok i'll try that
araujo has quit [Quit: Leaving]
<atmosx>
anyone good with regexp?
<Fuzai>
still no luck :(
<Fuzai>
lots of people are good with regex atmosx
atyz has joined #ruby
TomJ has joined #ruby
<atmosx>
I'm using this string: list = dna.scan(/(atg).*?(tga)/) … but instead of matching from 'atg' to 'tga' it matches ['atg' 'tga']
<atmosx>
any idea why this happens?
ipalaus has joined #ruby
<Fuzai>
so your string looks like 'atgxxxtga'
<Hanmac>
atmosx: ? dna.scan(/atg(.*?)tga/)
<Fuzai>
ty :)
<atmosx>
Fuzai: yes
slainer6_ has joined #ruby
<atmosx>
Hanmac: thanks :D
kiri has quit [Ping timeout: 252 seconds]
<atmosx>
hmm but that doesn't match atg and tga
<atmosx>
lol
<Hanmac>
so you want that included or not?
enriclluelles has quit [Read error: Connection reset by peer]
enriclluelles has joined #ruby
<atmosx>
ah k found it
<Hanmac>
this maybe what you want: dna.scan(/atg.*?tga/)
<atmosx>
Hanmac: yeap :-) thanks
kiri has joined #ruby
slainer68 has quit [Ping timeout: 245 seconds]
d2dchat has quit [Remote host closed the connection]
tonini has quit [Remote host closed the connection]
xardas has joined #ruby
gungor has quit [Remote host closed the connection]
daniel_- has quit [Ping timeout: 268 seconds]
aemeredith has quit [Remote host closed the connection]
skattyadz has joined #ruby
cod3r has joined #ruby
gungor has joined #ruby
malte_ has joined #ruby
skattyadz has quit [Read error: Connection reset by peer]
Bry8Star has quit [Ping timeout: 276 seconds]
Skelz0r has quit [Ping timeout: 276 seconds]
Skelz0r has joined #ruby
d11wtq has joined #ruby
thebastl has joined #ruby
ExxKA has joined #ruby
jovy88 has quit [Read error: Connection reset by peer]
jovy88 has joined #ruby
love_color_text has joined #ruby
tagrudev has joined #ruby
browndawg1 has joined #ruby
thone has quit [Ping timeout: 252 seconds]
gyre007 has joined #ruby
foofoobar has quit [Quit: Computer has gone to sleep.]
browndawg has quit [Ping timeout: 256 seconds]
bradhe has joined #ruby
staafl has joined #ruby
camilasa_ has quit [Remote host closed the connection]
vikhyat has quit [Ping timeout: 245 seconds]
ephemerian has quit [Quit: Leaving.]
spider-mario has joined #ruby
Spooner has joined #ruby
Michael__ has quit [Read error: Connection reset by peer]
bradhe has quit [Ping timeout: 240 seconds]
Michael__ has joined #ruby
ksinkar has joined #ruby
love_color_text has quit [Ping timeout: 264 seconds]
tvw has quit [Read error: Connection reset by peer]
rippa has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
thebastl_ has joined #ruby
tvw has quit [Client Quit]
tvw has joined #ruby
dv__ is now known as dv_
rippa has joined #ruby
chipotle_ has joined #ruby
kaffepanna has joined #ruby
dhruvasagar has joined #ruby
yacks has joined #ruby
thebastl has quit [Ping timeout: 252 seconds]
nari has joined #ruby
__alpaca_ has joined #ruby
dmiller has joined #ruby
peta_ has joined #ruby
chipotle_ has quit [Client Quit]
Flexa has joined #ruby
chandankumar has joined #ruby
__alpaca_ has quit [Ping timeout: 260 seconds]
dmiller has quit [Ping timeout: 264 seconds]
rippa has quit [Ping timeout: 240 seconds]
<PaulePanter>
Hi. Is there an abbreviation for `a => verylongvariablename if verylongvariablename`?
<PaulePanter>
So I can somehow avoid typing the variablename again?
<PaulePanter>
(Workaround is using an editor with completion.)
cod3r is now known as baba
objectivemo has quit [Quit: objectivemo]
thebastl_ has quit [Read error: Connection reset by peer]
<PaulePanter>
Just to broading my horizon, what would be the abbreviation when this is no hash literal?
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
jamesaxl has joined #ruby
dhruvasagar has joined #ruby
<Hanmac>
PaulePanter: the {} is the hash literal
mikestok has joined #ruby
<PaulePanter>
Hanmac: Thanks.
<banister`sleep>
Hanmac: did you like BMO lost
<Hanmac>
banister`sleep: the bubble at the end was creepy
<banister`sleep>
Hanmac: BMO loved dat shiz though
addisaden has joined #ruby
<tommylommykins>
PaulePanter: If you want to add something to a hash only if it exists, you possibly want something like "data[a] = longname if longname"
<tommylommykins>
or maybe "... unless longname.empty?", depending on the type of longname
* tommylommykins
doesn't think there are any sexy shortcuts for it
forlin has joined #ruby
<PaulePanter>
tommylommykins: Thanks. Good to know.
Randomage has joined #ruby
<PaulePanter>
Thank you all for your help!
<Hanmac>
you can look at hash.merge
axxT has quit [Ping timeout: 256 seconds]
<tommylommykins>
I guess also, depending on what you're using the hash for, it might be better to add a into it anyway?
<tommylommykins>
and just leave it pointing at nil or "" or 0 or whateve it is
Giorgio has joined #ruby
hogeo_ has joined #ruby
loopee has joined #ruby
<banister`sleep>
Hanmac: i thought the most recent episode sucked
Domon has quit [Remote host closed the connection]
pcarrier has quit [Quit: Computer has gone to sleep.]
ananthakumaran1 has joined #ruby
atmosx has quit [Quit: And so the story goes…]
mootpointer has joined #ruby
gener1c has quit [Read error: Connection reset by peer]
LennyLinux has joined #ruby
loopee has quit [Ping timeout: 256 seconds]
ananthakumaran has quit [Ping timeout: 264 seconds]
schickung has joined #ruby
mootpointer has quit [Client Quit]
hogeo_ has quit [Remote host closed the connection]
Macaveli has left #ruby ["Leaving"]
hogeo_ has joined #ruby
sayan has joined #ruby
Macaveli has joined #ruby
mikestok has quit [Quit: Computer has gone to sleep.]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
evenix has joined #ruby
Randomage has quit [Read error: Connection reset by peer]
LennyLinux has quit [Ping timeout: 245 seconds]
bradhe has joined #ruby
<Fuzai>
Is there anything that would specifically block a list do |entry| vs. list { |entry| } ?
<Fuzai>
I'm reading this API that is all using do end blocks and i'd like to move to the other one
dr_bob has quit [Ping timeout: 245 seconds]
Trancer has left #ruby [#ruby]
hogeo_ has quit [Ping timeout: 252 seconds]
<Fuzai>
https://github.com/obrie/turntabler <-- That's the API i'm looking at, if you scroll down you can see the client.on :event do |data| end blocks i'm referring too
<Fuzai>
to
bradhe has quit [Ping timeout: 255 seconds]
<spider-mario>
Fuzai : the difference between do |x| … end and {|x| …} is purely stylistic
thone has joined #ruby
<Fuzai>
that's what I thought
<waxjar>
only thing you have to keep in mind is that arguments need parenthesis when using { … } to pass a block
<spider-mario>
do … end blocks are typically used when the block is passed for its side-effects
<spider-mario>
is that right?
gungor has quit [Remote host closed the connection]
<foofoobar>
so when installing a gem via "gem install rails"; the installation of the gem is fast. What is really slow is the creation of the "ri" and "rdoc" documentation. Why does that need so long?
<foofoobar>
s/creation/installation
pduin_ has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
<waxjar>
spider-mario: there are two conventions, one is the side effect thing, the other one is { } for single line blocks, do .. end for multiple line blocks
wolcanus has quit [Remote host closed the connection]
wolcanus has joined #ruby
girija has quit [Ping timeout: 260 seconds]
etank has quit [Quit: WeeChat 0.3.8]
etank has joined #ruby
nveselinov has quit [Read error: Connection reset by peer]
ttt has quit [Ping timeout: 256 seconds]
nveselinov has joined #ruby
gungor has quit [Remote host closed the connection]
splittingred has quit [Quit: splittingred]
mmozuras has joined #ruby
psyprus has joined #ruby
droppedonmyhead has joined #ruby
oneirophren has joined #ruby
malte_ has joined #ruby
Uranio has quit [Remote host closed the connection]
lewis has joined #ruby
wmoxam has quit [Quit: leaving]
wmoxam has joined #ruby
adamjleonard has joined #ruby
mmozuras has quit [Ping timeout: 255 seconds]
ksinkar has joined #ruby
splittingred has joined #ruby
GOMADWarrior has joined #ruby
chrishunt has joined #ruby
jovy88 has quit [Read error: Connection reset by peer]
Macaveli has quit [Quit: This computer has gone to sleep]
jovy88 has joined #ruby
lewis has quit [Ping timeout: 252 seconds]
Macaveli has joined #ruby
enriclluelles has joined #ruby
dmiller has joined #ruby
gungor has joined #ruby
mikecmpbll has joined #ruby
braoru has quit [Remote host closed the connection]
Macaveli has quit [Client Quit]
d3c has quit [Quit: Sleep]
failshell has joined #ruby
kpshek has joined #ruby
enebo has joined #ruby
good has quit [Read error: Connection reset by peer]
good has joined #ruby
momomomomo has joined #ruby
dmiller has quit [Ping timeout: 258 seconds]
_bart has joined #ruby
pskosinski has joined #ruby
d11wtq has quit [Ping timeout: 268 seconds]
kcantwel has joined #ruby
browndawg1 has quit [Quit: Leaving.]
<shevy>
why arent there more ruby-to-c bindings?
d11wtq has joined #ruby
wmoxam has quit [Quit: leaving]
wmoxam has joined #ruby
rtl_ is now known as rtl
wmoxam has quit [Client Quit]
<_bart>
shevy: there are quite many
cmarques has joined #ruby
geekbri_ has quit [Remote host closed the connection]
jlast has joined #ruby
wmoxam has joined #ruby
<waxjar>
i was wondering, would rack rewritten as a C extension boost performance much?
geekbri has joined #ruby
gungor has quit [Remote host closed the connection]
Rym has quit [Quit: Rym]
ner0x has joined #ruby
araujo has joined #ruby
neku has quit [Quit: Leaving...]
<injekt>
waxjar: it wouldn't improve rack in the parts that rack needs improving
atmosx has joined #ruby
wallerdev has joined #ruby
akashj87 has joined #ruby
bradhe has joined #ruby
interactionjaxsn has joined #ruby
ksinkar has quit [Ping timeout: 264 seconds]
<shevy>
I hate rack .ru files
<BinaryMaster>
Am I wrong in thinking that the following example should create a new link even if one is already there? FileUtils.ln_s src.full_path, destination_path, :force => true
sambao21 has joined #ruby
Jon30 has joined #ruby
sambao21 has quit [Client Quit]
<waxjar>
is that because of a design flaw injekt?
ananthakumaran has joined #ruby
<Jon30>
is there a way to make .each loop itterate through every second item?
<Melnorme>
psych-shield only works with the Psych parser
<Melnorme>
rake aborted!
<Melnorme>
...now how do I fix? Do I need to change yaml parser from something to Psych? If so, how? if not - I got no idea...
matchaw_ has joined #ruby
xlab has quit [Remote host closed the connection]
matchaw has quit [Ping timeout: 272 seconds]
wesside has quit [Quit: Ice cream truck!]
ephemerian has joined #ruby
<r0bgleeson>
Melnorme: what does YAML::Engine return?
<r0bgleeson>
Melnorme: what version of Ruby?
matchaw_ has quit [Read error: Connection reset by peer]
wedgex has quit [Ping timeout: 272 seconds]
<Melnorme>
how do I ask about yaml? ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
<r0bgleeson>
Ruby 1.8.7 uses syck.
<r0bgleeson>
1.9 uses Pysch.
sathish316 has quit [Quit: Leaving.]
gungor has quit [Remote host closed the connection]
<r0bgleeson>
well, you can choose on 1.9
robscomputer has quit [Remote host closed the connection]
<Melnorme>
ah. So I need to install newer ruby?
robscomputer has joined #ruby
<Sou|cutter>
you probably shouldn't be using 1.8.x at this point since it will be unsupported this summer
wwalker has joined #ruby
<Sou|cutter>
at least as far as MRI
filipe has joined #ruby
<wwalker>
I've got a strange problem. I'm using koala / omniauth the retrieve auth tokens. the token I get from token = request.env["omniauth.auth"]['credentials']['token'] looks like a token but varies in length from 215 to 221 characters. If I go to the token generator on facebook I get a 228 character token every time
tds has joined #ruby
<wwalker>
if I use the 228 I get manually it works, but when facebook hits my call bath the omniauth token is short and doesn't work.
<wwalker>
I was trying to find somewhere with a trustworthy set of ruby 1.9 rpms for centos, but no joy. (I need them too....)
rburton- has joined #ruby
forrest has joined #ruby
Astralum has joined #ruby
Tarential has quit [Excess Flood]
Tarential has joined #ruby
Gabri has joined #ruby
tomsthumb has quit [Client Quit]
__alpaca_ has joined #ruby
<r0bgleeson>
wwalker: can't use fedora's?
hogeo_ has quit [Remote host closed the connection]
Matip has quit [Read error: Connection reset by peer]
angusiguess has quit [Ping timeout: 256 seconds]
hogeo_ has joined #ruby
Matip has joined #ruby
Nahra has quit [Read error: Operation timed out]
k610 has quit [Ping timeout: 260 seconds]
jonathanwallace has joined #ruby
marr has quit [Ping timeout: 256 seconds]
Phibs has joined #ruby
<Phibs>
when using Net::HTTP on Ruby 1.9.3, can I force it to use a specific record type like 'A' or IPV4 only ?
mercwithamouth has joined #ruby
robscomputer has quit [Ping timeout: 256 seconds]
chrishough has joined #ruby
wudofyr has joined #ruby
__alpaca_ has quit [Ping timeout: 268 seconds]
hogeo_ has quit [Ping timeout: 260 seconds]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
d11wtq has quit [Ping timeout: 268 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
sayan has joined #ruby
miroatme has left #ruby ["PRIVMSG #okdrink :-timeleft"]
<wwalker>
r0bgleeson I can probably take the ruby packages from fedora and rebuild them after changing a couple of paths. It would need to be able to co-exist with the default ruby .
<r0bgleeson>
wwalker: im not sure if the exact option is --program-suffix, but there's definitely a switch for that
tk_ has quit [Quit: ばいばい]
jacobw has quit [Remote host closed the connection]
Davey has joined #ruby
brtdv has quit [Quit: brtdv]
Neomex has quit [Quit: Neomex]
Macaveli has joined #ruby
angusiguess has joined #ruby
danslo has joined #ruby
arturaz has quit [Ping timeout: 245 seconds]
oneirophren has joined #ruby
d2dchat has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
dmiller has quit [Ping timeout: 258 seconds]
mafolz has quit [Ping timeout: 256 seconds]
carloslopes has quit [Remote host closed the connection]
stoic_squirrel has joined #ruby
thebastl has joined #ruby
<Phibs>
nobody eh
<wwalker>
r0bgleeson: also needs a separate lib dir, but that may happen already. It's not hard, just time consuming. And I'm at 60/hrs a week a t the moment, so it'll keep getting pushed out... :-(
cantonic has quit [Quit: cantonic]
<r0bgleeson>
wwalker: yeah, i just use rbenv+ruby-build which keeps the effort to a minimum :)
mercwithamouth has quit [Ping timeout: 256 seconds]
girija has joined #ruby
browndawg has quit [Quit: Leaving.]
anachronistic has joined #ruby
devdazed has quit [Quit: Bye]
nezumi has joined #ruby
wolcanus has quit [Remote host closed the connection]
<Phibs>
880 people in here and nobody knows the internals of net::http and ruby dns :)
<momomomomo>
Phibs: Post your code to http://gist.github.com/ (all related code and errors), and then come back and explain: What you're trying to do, what the issue is, and what you think has gone wrong. This will help people be able to digest/understand your problem. Also check this out when you get a chance: http://www.catb.org/esr/faqs/smart-questions.html
<Phibs>
nod
<Phibs>
fair enough, but the code is proprietary unfortunately :(
johnnyfuchs has joined #ruby
<momomomomo>
hard for us to help you when we don't know what the issue is.
<wwalker>
r0bgleeson: does rbenv handle system wide now? or is it per-user?
tomsthumb has joined #ruby
mahmoudimus has joined #ruby
gungor_ has quit [Remote host closed the connection]
mikepack has joined #ruby
baphled_ has joined #ruby
slobad23 has joined #ruby
slainer6_ has joined #ruby
<slobad23>
Could someone please explain the difference between: def return_block yield end compared to def return_proc(&proc) yield end
rton has left #ruby [#ruby]
Davey has quit [Quit: Computer has gone to sleep.]
rton has joined #ruby
<slobad23>
They both take a block and execute... are they just different methods of doing the same thing?
rton has left #ruby [#ruby]
HAKEON has joined #ruby
<MrZYX>
the later one captures the block, converts it to a proc and assigns it to the proc variable
thone has joined #ruby
rton has joined #ruby
aganov has quit [Quit: aganov]
<slobad23>
Is that conversion an unnecessary overhead? The end result appears the same to me.
slainer68 has quit [Ping timeout: 245 seconds]
<MrZYX>
if you don't do anything with the proc variable, yes
<slobad23>
Ah okay. Following simple examples is... too simple :-) Thanks for the clarity on that one.
toddWork_ has joined #ruby
<slobad23>
This book just shows a yield on each one. Nothing too funky going on inside the method.
sambao21 has joined #ruby
<MrZYX>
the main usage is passing it to another method
_nitti has quit [Ping timeout: 264 seconds]
tjbiddle has joined #ruby
<slobad23>
I have spent the last... year I guess, getting as much Javascript knowledge as possible. Ruby is a new world with some familiar concepts and some rather odd (yet very cool) ways of doing things.
rton has left #ruby [#ruby]
a_a_g has quit [Quit: This computer has gone to sleep]
skroon has quit [Ping timeout: 240 seconds]
sayan has joined #ruby
Targen has quit [Ping timeout: 246 seconds]
rburton- has quit [Quit: Leaving...]
Arzaga has joined #ruby
banister`sleep has joined #ruby
brennanMKE has quit [Remote host closed the connection]
<slobad23>
MrZYX, will have to go through the Ruby online docs to check for differences between this book and 2.0. Any immediate gotchas I should be aware of?
<MrZYX>
no major ones really, 2.0 got keyword arguments, lazy enumerators and some methods return arrays instead of enumerators now (there are still enumerator alternatives)
sayan has quit [Read error: Connection reset by peer]
sambao21 has quit [Quit: Computer has gone to sleep.]
LaPetiteFromage has quit [Quit: LaPetiteFromage]
pi3r has quit [Quit: Leaving]
_nitti has joined #ruby
carloslopes has joined #ruby
<wuest>
Are there any documented changes to regexps in 2.0? I didn't see any at a glance when 2.0 was released, but code that works on 1.9.3 is breaking on 2.0 (specifically, String#scan looking for escaped hex code ranges breaks with invalid multibyte escape)
sambao21 has joined #ruby
_nitti has quit [Read error: Connection reset by peer]
arya has joined #ruby
_nitti has joined #ruby
andrew__ has quit [Remote host closed the connection]
Voodoofish430 has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<spider-mario>
but that shouldn’t be a problem anyway
bradhe has quit [Ping timeout: 256 seconds]
<spider-mario>
any valid ASCII string is valid UTF-8 as well and represents the same text
gungor has quit [Remote host closed the connection]
nic019 has quit [Remote host closed the connection]
<wuest>
Indeed. Interesting.
jamesaxl has quit [Ping timeout: 272 seconds]
fmcgeough has joined #ruby
LennyLinux has joined #ruby
__alpaca_ has joined #ruby
lewis has joined #ruby
xorro has joined #ruby
rburton- has quit [Quit: Leaving...]
workmad3 has quit [Ping timeout: 248 seconds]
mneorr has quit [Remote host closed the connection]
kobain has quit [Ping timeout: 260 seconds]
kobain has joined #ruby
mercwithamouth has joined #ruby
renanoronfle__ has quit [Quit: This computer has gone to sleep]
wolcanus has joined #ruby
_bart has quit [Read error: Operation timed out]
andrew__ has joined #ruby
jonathanwallace has quit [Ping timeout: 256 seconds]
Freijo is now known as Fraeon
kenneth has quit [Quit: kenneth]
<xorro>
anyone know how this is possible? -> [-43759].pack("n") I don't get how ruby is packaging a negative number as an unsigned short?
alup has quit [Quit: Leaving]
MisterPostIT has quit [Ping timeout: 264 seconds]
russfrank has quit [Read error: Operation timed out]
__alpaca_ has quit [Ping timeout: 276 seconds]
<xorro>
in python the equivilent would be struct.pack('!H', -43759) This would cause an exception though because it's a negative number
dangerousdave has joined #ruby
Flexa has quit [Remote host closed the connection]
mengu has joined #ruby
<xorro>
i don't get what ruby does to make it work
rakl has joined #ruby
motto has joined #ruby
vlad_starkov has quit []
jgarvey has joined #ruby
tylersmith has joined #ruby
vlad_starkov has joined #ruby
m8 has quit [Ping timeout: 256 seconds]
russfrank has joined #ruby
filipe has quit [Quit: Leaving]
gungor has joined #ruby
francisfish has quit [Remote host closed the connection]
sayan has joined #ruby
rton has joined #ruby
gungor has quit [Remote host closed the connection]
rburton- has joined #ruby
slainer6_ has quit [Remote host closed the connection]
robscomputer has joined #ruby
tommyvyo has joined #ruby
<wuest>
xorro: can you tell me the relationship between those two numbers? If you had, let's say, a 24 bit integer, what would the two numbers look like in binary?
bradhe has joined #ruby
<wuest>
Specifically, unpack that packed value. If you truncate the high order byte of the aforementioned 24 bit integers, you'll find the result to be the same. :)
jovy88 has quit [Read error: Connection reset by peer]
wgosling__ has joined #ruby
marcdel has joined #ruby
Rym has joined #ruby
jovy88 has joined #ruby
celinedior has quit [Quit: celinedior]
tomku has quit [Ping timeout: 256 seconds]
anachronistic has quit [Quit: anachronistic]
mark_locklear has joined #ruby
<aedornm>
Is the date format correct? "yyMMdd-T-hhmmss" = "130418-T-142510"? If not, what is T? What is the correct format? Answered: Yes, it is the correct format: T is on the ISO 8601 specs.
tomku has joined #ruby
mockra has joined #ruby
<aedornm>
Words ... they fail me.
sepp2k has joined #ruby
divout has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
<spike|spiegel>
aedornm: that doesn't look ISO to me
<aedornm>
Let's cite an ISO spec, and then proceed to confirm the wrong format for that spec. Obviously this is the cherry pick what you want from a spec and when questioned about the random changes refer to the original.
wgosling_ has quit [Ping timeout: 264 seconds]
sayan has joined #ruby
Cultofmetatron has joined #ruby
LnL has joined #ruby
icole has joined #ruby
jeebster has joined #ruby
wgosling has joined #ruby
wgosling__ has quit [Read error: Operation timed out]
<aedornm>
spike|spiegel: Indeed it does not. That's why I questioned it and the guy refers back to ISO 8601. I'm working with geniuses here!
bradhe has quit [Remote host closed the connection]
mengu has quit [Quit: This computer has gone to sleep]
tenmilestereo has joined #ruby
slyv has joined #ruby
m8 has joined #ruby
rakl has quit [Quit: sleeping]
brianpWins has joined #ruby
motto has quit [Ping timeout: 260 seconds]
r0bgleeson has joined #ruby
<cpruitt>
Can anyone offer some insight into an error? (Please point me to a different channel if this isn't appropriate here). I'm working with a colleague who's having an issue installing the mysql2 gem. He's done a complete removal / reinstall of MySQL (OS X 64 bit) and is using rbenv. Error indicates missing mysql.h but it's very clearly installed. This is the specific error. https://gist.github.com/cpruitt/402f2d111dee1193d4a7
<cpruitt>
Trying to install directly (gem install) as opposed to using bundler.
Rym has quit [Quit: Rym]
LaPetiteFromage has joined #ruby
jamescarr has quit [Quit: jamescarr]
<aedornm>
cpruitt: That realy means your compiler environment does not see mysql.h ... So if you say you have it installed, it's not looking for it in the directory you believe it to be.
Zai00 has quit [Quit: Zai00]
<CyberMaN>
I have a string, like this one: "test\r\n". The important thing to realize here, is that this is not a string literal, it is read from a file. Now, I want to manipulate each string byte by byte, but no matter what I do, \r and \n are treated as two bytes
bondar has joined #ruby
ariedler has joined #ruby
<CyberMaN>
How can I go past this behavior?
mityaz has joined #ruby
LaPetiteFromage has quit [Ping timeout: 258 seconds]
wolcanus has quit [Remote host closed the connection]
mrsolo has joined #ruby
cmyers has left #ruby [#ruby]
jdunck has quit [Quit: Computer has gone to sleep.]
angusiguess has joined #ruby
chrishough has quit [Ping timeout: 260 seconds]
LaPetiteFromage has joined #ruby
<spike|spiegel>
CyberMaN: you mean .each_char ?
chrishough has joined #ruby
<CyberMaN>
spike|spiegel; seeing the same behavior. tried both
<MrZYX>
CyberMaN: they are two bytes?!
brunoro has quit [Ping timeout: 256 seconds]
gungor has joined #ruby
<MrZYX>
do `man ascii`
<CyberMaN>
MrZYX; when I view the file normally, \r\n are interpreted by the text browser (notepad, notepad++, visual studio)
<CyberMaN>
I am not an idiot
<aedornm>
If you want to replace CRLF with just a LF then you can do "test\r\n".encode(universal_newline: true) #=> "test\n"
motto has joined #ruby
markalanevans has joined #ruby
<MrZYX>
so you want to threat two special bytes as a single one?
markalanevans has quit [Remote host closed the connection]
<CyberMaN>
when I read the line from the file, the string contains "test\r\n". Is it not logical that when I iterate with each_char, \n would be 1 character instead of two?
<CyberMaN>
it is an escape sequence, after all
<aedornm>
And then parse over the returned string ... otherwise you need to tell it to just ignore one or the other and continue on
<spider-mario>
no, not really logical
<aedornm>
CyberMaN: No, that's not logical at all.
<CyberMaN>
:|
<spider-mario>
the file does contain \ and n as separate characters
<MrZYX>
again, man ascii
<CyberMaN>
oh my god
rton has left #ruby [#ruby]
<MrZYX>
they are two bytes and two characters
vlad_sta_ has joined #ruby
<CyberMaN>
spider-mario; if so, how can all text browsers/editors filter it normally?
Cultofmetatron has quit [Remote host closed the connection]
<CyberMaN>
how can I view the text with \r\n INTERPRETED?
<CyberMaN>
if I opened it in notepad it would show \r\n
<aedornm>
CyberMaN: It's not going to assume, by itself, to do something. But you can replace it using the encode method as already stated.
<spider-mario>
by performing a manual substitution, for example
Liothen has quit [Ping timeout: 264 seconds]
gungor has quit [Remote host closed the connection]
<bean__>
*sigh* dev at work is insisting on using `curl ` calls instead of using curb or other net/http libraries
<bean__>
:(
<bean__>
makes me a sad panda
m8 has quit [Ping timeout: 258 seconds]
Ontolog has joined #ruby
<MrZYX>
bean__: just overwrite Kernel#` :P
<bean__>
haha
vikhyat has quit [Remote host closed the connection]
motto has quit [Max SendQ exceeded]
motto has joined #ruby
gungor_ has joined #ruby
qubit has joined #ruby
renanoronfle__ has quit [Quit: This computer has gone to sleep]
vlad_starkov has quit [Ping timeout: 268 seconds]
markalanevans has joined #ruby
<csmrfx>
whats wrong with using curl, then?
<qubit>
If a ruby script is running an external program via %x{} and the script receives a signal such as SIGTERM, is there a way to pass that signal on to the program being run through the %x{} before exiting?
<bean__>
I would just rather he use curb.
<csmrfx>
why?
rupee has joined #ruby
icole has quit [Remote host closed the connection]
<bean__>
because I don't like using backticks inside of scripts when I can programatically build the request
<MrZYX>
no need ot spawn a shell and a process?
<bean__>
^
<csmrfx>
bean__: backticks is your point?
<csmrfx>
lel
icole has joined #ruby
Ontolog_ has joined #ruby
<csmrfx>
eek, spawning processes *makes a lady-on-the-table-imitation*
<csmrfx>
man, I wish my problems were as insignificant and artificial as yours
hamakn has quit [Remote host closed the connection]
MrPoT4tO has joined #ruby
<bean__>
jesus, aren't you condescending.
<MrZYX>
qubit: nothing automagical that I'm aware of, maybe have a look at $? and check the return code
renanoronfle__ has joined #ruby
codecop has joined #ruby
deepy-osl has joined #ruby
<csmrfx>
qubit: how did you start the script?
rakl has joined #ruby
<csmrfx>
assuming it is in a normal process, you just send the signal
<csmrfx>
you can use kill
<csmrfx>
bean__: see qubits prob, forking processes and using systems infra for your things is perfectly valid thing to do, imo
<bean__>
sure, i never said it was invalid, i just prefer to use curb, etc, if available
Ontolog has quit [Ping timeout: 272 seconds]
chipotle_ has joined #ruby
<csmrfx>
qubit ps. the pid seen with $?.pid
rburton- has quit [Ping timeout: 246 seconds]
icole has quit [Ping timeout: 264 seconds]
MrPoT4tO has quit [Remote host closed the connection]
<csmrfx>
bean__: well, newsflash: curb uses curl
<bean__>
no, it uses libcurl
<bean__>
not backticks out to curl
<bean__>
you really don't need to be a dick csmrfx
<qubit>
csmrfx: $? will be updated even if the script receives a signal before %x has completed?
MrPoT4tO has joined #ruby
<csmrfx>
great q
netto has joined #ruby
<csmrfx>
I must be dyslexic, didn't realize you mentioned %x{}
deepy-osl has quit [Ping timeout: 245 seconds]
<cpruitt>
aedornm: Sorry, I had to step away. Thanks for the reply. Unfortunately we've also tried specifying the mysql config file and that doesn't seem to work either. It's like nothing we do will specify the correct location and the error isn't telling me the full path it's trying to read.
vlad_sta_ has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 268 seconds]
Arzaga has joined #ruby
<csmrfx>
qubit: to me it seems it will be updated
twoism has quit [Read error: Connection reset by peer]
<qubit>
csmrfx: sweet
<qubit>
ty, i'll give it a shot
<netto>
hello guys, for years I had a form with a wysiwyg (description field), so now I want to convert these html to plain text, because I'll use only a textarea in edit file. can you recommend something better than 'html_massage'?
carlyle has quit [Remote host closed the connection]
benlieb has joined #ruby
<qubit>
csmrfx: didnt work. $? only updates once %x completes. if it receives the signal while it's executing it fails
<csmrfx>
yeah
schickung has quit [Quit: schickung]
<netto>
yeah, I tried nokogiri, but it's almost like .gsub("\n","<br>") command, i dont see too difference. for example when I have unordered list
bnagy has quit [Ping timeout: 252 seconds]
<netto>
jrabbit:
icecandy has quit [Ping timeout: 276 seconds]
<csmrfx>
qubit: oh, fails? independent of the signal?
mercwithamouth has quit [Ping timeout: 264 seconds]
kimteq has joined #ruby
bnagy has joined #ruby
<qubit>
csmrfx: fails, $? isnt updated. For example `%x{sleep 60}` and then SIGTERM the script while the sleep is still running
cantonic has quit [Quit: cantonic]
<csmrfx>
qubit: ok, so "$?" fails, not the process?
<jrabbit>
netto: oh another option could be to convert to markdown
Uranio has joined #ruby
<qubit>
csmrfx: if I put in a Signal.trap, $? is not updated when the trap executes
chipotle_ has quit [Quit: cya]
<csmrfx>
lol surprise: I sent my process SIGTERM and my process died?
<netto>
yes, theres a gem called 'reverse_markdown'
<csmrfx>
wonder why?
unflores has quit [Quit: unflores]
MikeIn has joined #ruby
wsterling has quit [Read error: Connection reset by peer]
<qubit>
csmrfx: I'll just launch the pid in a fork or something and git the fork's pid, and then just wait for the fork to exit
<qubit>
s/pid/program/
wsterling has joined #ruby
<jrabbit>
netto: it'd probably take more of the stuff you want into account
thone has quit [Remote host closed the connection]
<jrabbit>
netto: I can't see it being perfect but probably good enough
<netto>
jrabbit: I'll try, but I still think html_massage convert to a better plain text, but the problem is: there a lot of gem dependencies
thone has joined #ruby
<csmrfx>
qubit: you do realize that SIGTERM tells processes to terminate
<csmrfx>
+?
<netto>
jrabbit: yeah, Im trying to get the best solution
<qubit>
csmrfx: yes, and it can be trapped via Signal.trap("TERM")
wsterling has quit [Read error: Connection reset by peer]
<jrabbit>
oh html_massage even does markdown out
<qubit>
csmrfx: all signals other than SIGKILL can be caught
wsterling has joined #ruby
<qubit>
err, and SIGSTOP
<jrabbit>
netto: they don't have that many deps
sailias has quit [Quit: Leaving.]
jbueza has joined #ruby
<aedornm>
cpruitt: You can pass the locations when doing the gem install: gem install mysql -- --with-mysql-dir=/usr/mysql --with-mysql-lib=/usr/mysql/lib --with-mysql-incklude=/usr/mysql/include .. or whatever they may be
<netto>
jrabbit: yeah, I looked at reverse_markdown but the markdown doesnt make a lot sense to nooby people (my audience)
<aedornm>
gem install mysql2 even
<netto>
jrabbit: what do u think?
noop has joined #ruby
indyrl has quit [Quit: Leaving.]
Xeago has joined #ruby
<csmrfx>
qubit: how about Process.pod
<jrabbit>
netto: use html_massager
<csmrfx>
*.pid
LaPetiteFromage has quit [Quit: LaPetiteFromage]
icecandy_ has quit [Remote host closed the connection]
<jrabbit>
netto: I don't see why dependencies is a bad thing. Just means they didn't reinvent the wheel
<cpruitt>
aedornm: Thanks. I'm pretty sure I've tried that but at this point I've tried so many things I might not have done it right. I'll give it another shot. Thanks very much for the reply.
<qubit>
csmrfx: that gives you the pid of the script, not the thing being run
m8 has joined #ruby
<netto>
jrabbit: cool! I said that because I'm new to rails, I thought many gems = bad practice
<csmrfx>
yes
bondar has quit []
<MrPoT4tO>
hey guys, who here can help me with netbeans and ruby gems? I wanna use the latest ruby version and all (Linux). How do I install it ?
krawchyk_ has joined #ruby
<MrPoT4tO>
(if there's a guide I can follow, also that can help)
<csmrfx>
qubit: maybe you wanted spawn instead
motto has quit [Ping timeout: 256 seconds]
krawchyk_ has quit [Remote host closed the connection]
<nezumi>
Depending on the distro, there should be packages available
jekotia has joined #ruby
<csmrfx>
qubit: or, IO.popen3 or whatever that is these days
<MrPoT4tO>
it's kubuntu nezumi
girija has quit [Ping timeout: 276 seconds]
mengu has joined #ruby
krawchyk has quit [Ping timeout: 256 seconds]
<MrPoT4tO>
I'm looking for them, but only shows an old version for some reason. What if I download it from the site? do I have to put it in my usr/lib folder?
<eval-in>
csmrfx => /tmp/execpad-8ad4bb9973f4/source-8ad4bb9973f4:2:in `<main>': undefined local variable or method `www' for main:Object (NameError) (http://eval.in/17490)
LaPetiteFromage has quit [Ping timeout: 256 seconds]
foofoobar has quit [Quit: Computer has gone to sleep.]
MrPoT4tO has quit [Remote host closed the connection]
sethetter has quit [Quit: leaving]
Ethan has quit [Client Quit]
momomomomo has quit [Quit: momomomomo]
grn_ is now known as grn
Giorgio has quit [Ping timeout: 252 seconds]
Ethan has joined #ruby
Ethan has quit [Client Quit]
chrishough has quit [Quit: chrishough]
Ethan has joined #ruby
Ethan has quit [Client Quit]
noop_ has joined #ruby
akam-it has quit [Remote host closed the connection]
symme7ry has joined #ruby
Ethan has joined #ruby
gaahrdne_ has joined #ruby
gaahrdner has quit [Ping timeout: 276 seconds]
Squarepy has quit [Quit: Leaving]
<symme7ry>
I'm unable to create an AES cipher of key length 128 .. cipher = OpenSSL::Cipher.new('AES-128-CBC') then cipher.key_len = 128 gives an error.. anyone know why? OpenSSL::Cipher.ciphers lists 'AES-128-CBC' as a valid option
noop has quit [Ping timeout: 256 seconds]
Proshot has joined #ruby
<csmrfx>
pastie?
Vainoharhainen has joined #ruby
<csmrfx>
also, ruby --version
wolcanus_ has quit [Read error: Connection reset by peer]
<csmrfx>
symme7ry: well, your arguments are wrong afaics
<atmosx>
Guys, in this situation I use the variable list which in outside the scope and cannot be used in printf. I usually get by this sort of situation by using $list instead of list… but what's the common way to deal with this? https://gist.github.com/5454649
pedrosnk has joined #ruby
<atmosx>
Should I use $list which is kinda hard-coded or maybe define list is a 'list' earlier? orf_list() returns an array or elements.
tspike has joined #ruby
MisterPostIT has joined #ruby
<MrZYX>
list = nil before the block should do
brennanMKE has joined #ruby
hamakn has joined #ruby
DrCode has quit [Ping timeout: 276 seconds]
<csmrfx>
symme7ry: docs even mention this for .key_len: Under normal circumstances you do not need to call this method (and probably shouldn’t).
tonini has quit [Remote host closed the connection]
beiter has quit [Read error: Operation timed out]
otters has quit [Disconnected by services]
g3org3s has joined #ruby
beiter has joined #ruby
otters_ has joined #ruby
hamakn has quit [Ping timeout: 248 seconds]
otters_ is now known as otters
<g3org3s>
hey there;, i am having a problem with ruby ... maybe u can help out plz :) http://pastebin.com/81xSvQDr
DrCode has joined #ruby
vlad_starkov has joined #ruby
toekutr has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
<atmosx>
g3org3s: why are you running this as root?
c0rn has quit [Quit: Computer has gone to sleep.]
noop_ has quit [Remote host closed the connection]
<csmrfx>
>> require 'benchmark'; def tst; list = []; t = Benchmark.realtime do; list = 1; end; p list; end
<atmosx>
secondly I know of no gem called memcacheex
vlad_starkov has quit [Remote host closed the connection]
<csmrfx>
tylersmith: thx
<tylersmith>
$500 plz ;p
rburton- has joined #ruby
<csmrfx>
atmosx: owes me 5k, ask him
vlad_starkov has joined #ruby
<tylersmith>
oh, then I meant $5000
g3org3s_ has joined #ruby
<g3org3s_>
sorry disc
* csmrfx
dodges the inginite loop
<atmosx>
I'm Greek so I'm broke by default.
<g3org3s_>
atmosx: is it the issue ? running as root ?
<atmosx>
g3org3s: no that's just stupid.
<slobad23>
^^
<atmosx>
g3org3s: the issue not finding the required gem.
g3org3s has quit [Ping timeout: 245 seconds]
sayan has quit [Quit: Leaving]
beiter has quit [Read error: Operation timed out]
<slobad23>
can you def tst without adding an end?
<atmosx>
g3org3s_: which that either is not installed or it's installed (most likely) in a path that root user can't find it when running ruby. that's why people use rbenv, rvm or install ruby system-wide in /usr/local/
Hanmac has quit [Read error: Operation timed out]
<csmrfx>
slobad23: wait what?
<atmosx>
slobad23: why you would wanna do that?
__alpaca_ has joined #ruby
vlad_starkov has quit [Client Quit]
pedrosnk has quit [Remote host closed the connection]
<slobad23>
Just glanced at the code line above and it contains "def tst;"
<csmrfx>
well, methods are defined by code between def and end
<csmrfx>
so, no end, no joy
<slobad23>
Sorry, my bad, it's the syntax on the IRC line to show the code. I couldn't read it properly :-)
Neomex has joined #ruby
Cultofmetatron has joined #ruby
mercwithamouth has joined #ruby
<slobad23>
They should make a tag for IRC to show your code indented with syntax highlighting.
<netto>
csmrfx: i dont know how to debug this error
<atmosx>
g3org3s_: then try "locate mkmf"
<netto>
i'm only access the url
forlin has quit [Remote host closed the connection]
keyvan has quit [Ping timeout: 248 seconds]
<csmrfx>
g3org3s_: remember, with debian you either 1) install rubygems -program manually and gem install -- or 2) apt-get install both ruby, rubygems and the gems.
AndChat| has quit [Ping timeout: 256 seconds]
thebastl has quit [Remote host closed the connection]
jtharris has quit [Quit: WeeChat 0.4.0]
Cultofmetatron has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
<TTilus>
csmrfx: actually as of wheezy apt-installed stuff satisfies gem dependencies
Arzaga has quit [Quit: Computer has gone to sleep.]
<TTilus>
so you can actually mix and match
chandankumar has quit [Quit: Leaving]
<csmrfx>
yeah?
<TTilus>
but im blissfully unaware of any details
<cpruitt>
Resolved an issue with msql2 gem not building extensions. Required downgrade from MySQL version 5.6.11 to 5.5.31. Can anyone recommend a good place to look to see if there is a known issue with using the latest version of MySQL?
jdunck has quit [Quit: Computer has gone to sleep.]
mljsimone has joined #ruby
<csmrfx>
I'm still on squeeze
kiri has quit [Ping timeout: 252 seconds]
<csmrfx>
cpruitt: can you even imagine all the factors from OS, OS version to ruby implementations?
<csmrfx>
Does mysql have public bug tracker?
kiri has joined #ruby
<TTilus>
cpruitt: already tried googling the error message + some keywords
<cpruitt>
csmrfx: I understand. I'm not so much asking about a cause, I'm asking about the best place to look for / ask about the details. A general Ruby IRC channel doesn't seem like the best place for a discussion of a specific gem (though I could be wrongs, you can correct me)
rubycode has joined #ruby
<csmrfx>
you ask your question and maybe get lucky
dayom has joined #ruby
<rubycode>
hi. how can I force minitest to continue running my unit tests after a single assertion failure?
balishag has joined #ruby
<TTilus>
rubycode: it doesnt?
foofoobar has joined #ruby
<cpruitt>
TTilus: Yes. The error is that the compiler can't find mysql.h, though it's clearly installed with the OS X binary. Specifying all the relevant paths does not resolve the error, while rolling back to an earlier version installs the gem without any issue or special config. I'd just like to do my homework & see if I can figure out why this is an issue.
<g3org3s_>
atmosx: csmrfx i couldnt find the package .... i added sources to my cache, now updating then i will try to find the package
<cpruitt>
That error occurrs with MySQL version 5.6.11 but not with 5.5.31
<rubycode>
TTilus: within the same test. i am driving some data thru a unit test case.
<cpruitt>
If there's a legitimate problem, I'd like to report it, but I don't quite know how to go about looking for any info.
jonathanwallace has quit [Ping timeout: 260 seconds]
<netto>
csmrfx: I tried: >> Sanitize
<netto>
=> Sanitize
nomenkun has quit [Remote host closed the connection]
<csmrfx>
cpruitt: well supposedly it's the mysql2 gem
<rubycode>
also is there a chat for total ruby newbs
malte_ has quit [Quit: malte_]
<rubycode>
cos i r.
<csmrfx>
this is it
<csmrfx>
welcome
havenwood has quit [Remote host closed the connection]
<rubycode>
awesome.
mahmoudimus has joined #ruby
<rubycode>
I have a hash, and some of the elements in it, but not all, are hashes of hashes, or arrays of hashes.
pikapp has joined #ruby
<cpruitt>
csmrfx: Yes. Well, more specifically it's the compiler trying to build and link against libmsqlclient. It can't find a header, but I've confirmed that the header is there. Something is different between the installs of those MySQL versions.
<rubycode>
how would i go about converting all integers in that structure into strings"
<rubycode>
?
jacobw has quit [Remote host closed the connection]
akashj87_ has joined #ruby
<cpruitt>
I'm sorry If I'm phrasing the question poorly.
mityaz has quit [Quit: See ya!]
<MrZYX>
rubycode: that sounds like a silly requirement, what do you actually want to achieve by doing that?
<cpruitt>
After I resolve an error (especially if it requires a downgrade) I always try to thorough ally understand why it happened and that's what I'm trying to do here. Find the cause, not just the fix.
jonathanwallace has joined #ruby
<rubycode>
MrZYX: crack xml and json parsers dont parse integers the same way. json parser spits out integers and xml - strings.
<rubycode>
i need to unify them.
tenmilestereo has quit [Quit: Leaving]
<Sou|cutter>
rubycode: use recursion
<rubycode>
Sou|cutter: i dont know when i will get a hash or an array :(
<MrZYX>
you can check with is_a?
<rubycode>
so recursion with a switch statement?
akashj87 has quit [Ping timeout: 272 seconds]
jerius_ has joined #ruby
<Sou|cutter>
rubycode: yeah
Hanmac has joined #ruby
<rubycode>
ew.
<g3org3s_>
atmosx: i installed it ... still same error ... the error basically says i need the gem memcacheex installed ? right ?
<rubycode>
i was hoping there was some kind of majik .inject I could use or something
<rubycode>
can i not inject this somehow?
<atmosx>
g3org3s_: hm no
<atmosx>
if required that gem will be installed aumatically
<MrZYX>
rubycode: nope, also .map on a hash doesn't return a hash
<csmrfx>
rubycode: start with each
<csmrfx>
or map
<atmosx>
some gems need header files. You probably need some -dev packages which I don't know where you will find since I never used debian for anything
<atmosx>
I use gentoo/freebsd and macosx
<g3org3s_>
atmosx: souldnt it tell me what packages i need ? "technically speaking"
jerius has quit [Ping timeout: 260 seconds]
jerius_ is now known as jerius
<banister`sleep>
rubycode: there's always room for cleverness, but you have to figure it out yourself :)
<banister`sleep>
i think it's more of a programmer virtuosity question than a language question
ryanclark has joined #ruby
<cpruitt>
rubycode: Would it make more sense to use a class of your own design that keeps the hash / array representation internally? You then define a method to get a value and it converts your integer when called?
chrishough has joined #ruby
<atmosx>
g3org3s_: yes, it does.
<rubycode>
cpruitt: it would make sense, yes.
<rubycode>
i just dont know how to implement this
<atmosx>
g3org3s_: but you need a debian-guru to tell which exact package you're going to need. Try to #debian ask for some ruby user… it's easy for someone who knows the system to solve this kind of thing
<cpruitt>
Hard to say without really knowing what you're doing. You have any existing code?
jtharris has joined #ruby
<cpruitt>
And what does your data structure represent?
jonathanwallace has quit [Ping timeout: 248 seconds]
foofoobar has quit [Quit: Computer has gone to sleep.]
<rubycode>
cpruitt: it represents an XML object i recieve from a rest call.
love_color_text has joined #ruby
<cpruitt>
rubycode: But how complex is that? Is it completely arbitrary or does it follow a predictable pattern? (e.g. invoice > line items > line item details)
ryannielson has quit [Quit: ryannielson]
<rubycode>
cpruitt: predictable.
<rubycode>
it's a documented call, and its very stable.
<rubycode>
idk why xml parsers are so messy.
<g3org3s_>
atmosx: allrigth will try in debian , tahnks :=)
jovy88 has quit [Read error: Connection reset by peer]
caleb_io has joined #ruby
<atmosx>
g3org3s_: good luck :-)
vlad_sta_ has joined #ruby
ner0x has left #ruby ["Leaving"]
<g3org3s_>
tanks
jovy88 has joined #ruby
caleb_io has quit [Client Quit]
<cpruitt>
OK, if it were me (on a better day) I'd use the hash only as a structure for retrieving the data. Then I'd create classes for each of my models. I'd create a class method for each to create an instance from an hash / array. So if the root of my XML is <invoice> I'd call Invoice.new_from_hash(some_hash)
codezombie has joined #ruby
<cpruitt>
or just require the hash be passed into my initialize method Invoice.new(some_hash)
mechcozmo has joined #ruby
slainer68 has joined #ruby
jonathanwallace has joined #ruby
<cpruitt>
that initialize method would reach the hash & when it gets to a child (e.g. line item) it'd loop through and repeatedly call it's own add_line_item(hash_item) which would instantiate a new line item instance & read the data
<cpruitt>
Then you have all the opportunity in the world to massage your data
vlad_starkov has quit [Ping timeout: 258 seconds]
<cpruitt>
Now, on a bad day, I'd just use a whole bunch of hash['some_attr'].to_i :-)
<mechcozmo>
Does anyone here use BBEdit for their programming? I'm having a hard time giving up BBEdit's great built-in PHP function autocomplete for the near-total lack of Ruby autocomplete, and hoping that someone here can point me towards a solution to augment BBEdit in this regard.
<lewis>
hi
g3org3s_ has quit [Ping timeout: 245 seconds]
love_color_text has quit [Ping timeout: 264 seconds]
motto has joined #ruby
hadees has joined #ruby
lewis is now known as lewix
m8 has quit [Ping timeout: 246 seconds]
<csmrfx>
mechcozmo: mac vim
kobain has quit [Remote host closed the connection]
<mechcozmo>
csmrfx: I'm not really looking to switch editors (nor start an argument about them)
kobain has joined #ruby
mneorr has joined #ruby
<csmrfx>
I dont even have a mac
workmad3 has joined #ruby
c0rn has joined #ruby
Burgestrand has joined #ruby
<mechcozmo>
Well… thanks anyway I guess.
yekta has joined #ruby
awkisopen has joined #ruby
<awkisopen>
gem install python
<Olipro>
is there a method to find the n'th occurrence of a char in a string?
<awkisopen>
doesn't work
<awkisopen>
suggestions?
<awkisopen>
(or a substring in a string, honestly, we're not picky)
<eval-in>
csmrfx => /tmp/execpad-0275c128fbdb/source-0275c128fbdb:2:in `<main>': undefined local variable or method `string' for main:Object (NameError) (http://eval.in/17501)
jtharris has quit [Quit: WeeChat 0.4.0]
<canton7>
you'll want the actual string ;)
bitcycle has joined #ruby
ner0x has joined #ruby
jtharris has joined #ruby
<canton7>
I'm an idiot
pcarrier has quit [Quit: Computer has gone to sleep.]
<canton7>
>> "foo/bar/baz/boo".split('/').inject(nil){ |s,k| {s => k } }
yalue has quit [Read error: Connection reset by peer]
__alpaca_ has quit [Ping timeout: 268 seconds]
<canton7>
and yeah, need that .reverse in there
shirokuro11 has quit [Remote host closed the connection]
<MrZYX>
Olipro: convinced? ;P
<canton7>
I think we win there :P
<awkisopen>
he said emoticonally
jonathanwallace has joined #ruby
<bitcycle>
Hey all. I am new to ruby. I'm trying to use rvm during development, and I'm wondering is it possible to install the gem from source or symlink the gem from my repository on the file system so that I don't have to keep re-installing the gem each time I make a change and want to test it?
alexyz has quit [Read error: Connection reset by peer]
<Olipro>
well, I'd ideally like something that codeclimate doesn't think is a complete disaster
elaptics`away is now known as elaptics
<netto>
Guys, I'm using html_massage gem but I got this error: Expected /Users/netto/my-app/lib/sanitize.rb to define Sanitize
<netto>
can someone help me with this issue?
<awkisopen>
is sanitize.rb defining a class called Sanitize?
<MrZYX>
Olipro: well, code analysis isn't there to be blindly trusted, it's there to give you some pointers at what you should stare another day or two ;)
bean__ has quit [Quit: Computer has gone to sleep.]
chandankumar has quit [Quit: Leaving]
<Olipro>
let me put it another way, some code that doesn't look like it's from an obfuscation competition
dummies_freelanc has quit [Read error: Connection reset by peer]
retry has joined #ruby
<MrZYX>
"foo/bar/baz/boo".split("/").reverse.inject(nil) { |hsh, key| {key => hsh} } that are only three chained method calls, once you read up on inject it'll be pretty obvious to you
alexyz has joined #ruby
Faris9 has joined #ruby
<canton7>
yeah, it's the obvious way to solve the problem - build the hash up from the inside. If I saw anyone using any other principle I'd think they were an idiot
<awkisopen>
it would be doable if that were the only path being acted on
<MrZYX>
you're issue is that you need the call a few times? make a method
<MrZYX>
ew, *your
<Olipro>
yeah, I'll extend this out further; it should scale so that the input could be as such: ['foo/bar/baz/boo', 'foo/bar/baz/bez', 'foo/bar/baz', 'foo/bar', 'foo']
<canton7>
using #inject's a matter of taste, but once you're familiar with it (and you should be - it's one of the core members of Enumerable), it's a pretty obvious choice
<canton7>
what would be the output for that input?
<awkisopen>
a single hash
<MrZYX>
Olipro: and then you want n hashes? or just one for all?
<canton7>
an array of hashes, or one bit hash?
io_syl has joined #ruby
<canton7>
[array of stuff].map{ |x| x.split('/') }.flatten
<Olipro>
MrZYX: it should nest such that the baz hash contains both bez, boo and baz
<canton7>
then as before
gaahrdne_ has quit [Remote host closed the connection]
<canton7>
ah, each sub-hash has more than one member in that case?
<canton7>
so a directory-structure parsing problem
<MrZYX>
hmm active_supports deep_merge would make that easy :P
<Olipro>
I'm okay with using a gem
<canton7>
a deep_merge implementation is only a few lines - no need for the whole gem
<MrZYX>
active_support is like a second stdlib, you don't really want to use it unless you're in rails already
<Olipro>
I'm not in Rails
<bitcycle>
Hey all. I am new to ruby. I'm trying to use rvm during development, and I'm wondering is it possible to install the gem from source or symlink the gem from my repository on the file system so that I don't have to keep re-installing the gem each time I make a change and want to test it?
angusiguess has quit [Ping timeout: 258 seconds]
wyhaines has joined #ruby
gaahrdne_ has joined #ruby
io_syl has quit [Client Quit]
rippa has quit [Ping timeout: 240 seconds]
<csmrfx>
yo dawg I heard you like gems so we put gems in your ruby so you can rubygems
<Olipro>
here's the way I have it right now: http://codepad.org/k56usbx4 - I dislike the way I get the substring on line 7
gaahrdner has quit [Read error: Connection reset by peer]
wedgex has quit [Remote host closed the connection]
retry has quit [Quit: Leaving...]
JohnBat26 has quit [Ping timeout: 240 seconds]
jdunck has joined #ruby
retry has joined #ruby
<bitcycle>
csmrfx, Hm.. maybe my question needs clarification: I'm developing gem foo. My functional tests require "foo". So, that gem needs to be installed to latest available on the filesystem where I'm developing and making changes to the foo project. How should I accomplish that with rvm?
bubbajones has joined #ruby
carlyle_ has joined #ruby
<netto>
awkisopen: yes
carlyle has quit [Read error: Connection reset by peer]
<csmrfx>
bitcycle: there is a link to that from the thread
<PaulePanter>
But due to the comma »,« it is hard to use control structures. So I want to “calculate/create” the values beforehand and as there are a lot, I thought just using the same variable names.
francisfish has quit [Remote host closed the connection]
ehaliewicz has joined #ruby
<PaulePanter>
Now only some Ruby magic is needed to connect both.
interactionjaxsn has quit [Remote host closed the connection]
workmad3 has quit [Read error: Operation timed out]
c0rn has joined #ruby
carlyle has joined #ruby
mikepack has quit [Remote host closed the connection]
emmanuelux has quit [Quit: emmanuelux]
mmitchell has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
<LennyLinux>
PaulePanter: to get all the variable names as sym, an idea would be have them define inside a scope and use local_variables and then using the zip method with argument the same variables
idkazuma has joined #ruby
<LennyLinux>
:P
<LennyLinux>
I dunno if i'm clear
huoxito has joined #ruby
<PaulePanter>
LennyLinux: Thanks. But I did not get what you mean.
zigomir has quit [Ping timeout: 256 seconds]
ryanclark has quit [Quit: ryanclark]
mikepack has joined #ruby
lewix has joined #ruby
<LennyLinux>
>> def m; t1, t2 = 1, 2; k = local_variables.zip [t1, t2]; p k; end
<huismon>
how do I interact with local users/groups in ruby?
<injekt>
A124: that's an infinite hash, if that's what you mean
<huismon>
like list users, groups, add users, etc
<ericwood>
what operating system?
<huismon>
ericwood, sorry, linux.
<A124>
injekt: Yeah. But this is the proc way.
<ericwood>
use the system() command, or backticks to run commands
<otters>
injekt: that's nicer than how I would do it
<LennyLinux>
PaulePanter: you can even avoid listing all variables using local_variables.map { |x| eval x.to_s } as zip's argument. Pretty ugly though
<ericwood>
just like you would from the command line
jlwestsr has quit [Remote host closed the connection]
<huismon>
ericwood, seriously? That's dumb, why isn't there a ruby api built?
bitcycle has quit [Quit: Leaving]
<injekt>
A124: huh?
<ericwood>
because that's extraordinarily platform-specific
<ericwood>
maybe there's a gem
<injekt>
otters: heh, I've done it many times, I did it much much worse many times before I got it right, too :D
<huismon>
ericwood, yeah perhaps
<ericwood>
huismon: but what you want shouldn't be core language functionality...
<otters>
damn you ruby for making hashes too easy
<otters>
I want to use them for everything
<huismon>
ericwood, oh, I agree. I just thought there was a gem or something everyone used.
<DaniG2k>
do you guys know why ruby had hashes right the first time round while python needed itertools before it got the whole key/val thing to work
<DaniG2k>
just curious
<otters>
luck
xcv has quit [Remote host closed the connection]
<A124>
injekt: You are referencing to proc. Which is not wrong, of course, but I think I was looking for.. sth like tree_block = lambda{|h,k| h[k] = Hash.new(&tree_block) }
bluOxigen has quit [Ping timeout: 264 seconds]
<otters>
yeah, but injekt's method doesn't require an extra assignment
brennanMKE has joined #ruby
<A124>
otters: You don't get it .. Do you even know lambda logic to judge?
<A124>
otters: Anyway, hash.to_json
<otters>
what about it?
retry has quit [Quit: Leaving...]
<A124>
That's OP, if you use gem like 'oj'
<otters>
"lambda logic"?
julian-delphiki has quit [Quit: Computer has gone to sleep.]
gyre007 has quit [Ping timeout: 245 seconds]
<MrZYX>
A124: in ruby, what's the difference between a lambda and a proc
philcrissman has joined #ruby
stoic_squirrel has quit [Quit: Computer has gone to sleep.]
<A124>
injekt: Thank you. It's nices notation I came with for .. I would use p.call which seemed not right.
<otters>
I'm still trying to figure out what just happened
<injekt>
:D
<A124>
MrZYX: Is what I mentioned identical to injekt's proc or not?
<A124>
otters: At least I'm not alone
<tylersmith>
and you know lambda logic :(
<otters>
lambda logic, huh?
<otters>
my mistake, I should've studied it
thetristan has joined #ruby
<MrZYX>
in ruby a lambda is a special type of proc enforcing its argument arity
pikapp has quit [Read error: Connection reset by peer]
jdunck has quit [Quit: Computer has gone to sleep.]
`p has joined #ruby
justsee has quit [Ping timeout: 256 seconds]
freerobby has quit [Ping timeout: 258 seconds]
momomomomo has quit [Quit: momomomomo]
mengu has quit [Quit: This computer has gone to sleep]
LennyLinux has quit [Remote host closed the connection]
jdunck has joined #ruby
MrZYX is now known as MrZYX|off
mikestok has joined #ruby
<Spooner>
jeebster1, You don't decrypt passwords. You encrypt what the user gives and see if that is the same as the encrypted password that you've stored.
ryanclark has joined #ruby
jarin has joined #ruby
arubin has joined #ruby
<jeebster1>
Spooner: you are correct. I'm reading up on this.
Xeago has quit [Remote host closed the connection]
rburton- has joined #ruby
vlad_starkov has joined #ruby
chrishough has quit [Quit: chrishough]
freerobby has quit [Quit: Leaving.]
ryanclark has quit [Quit: ryanclark]
mikepack has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 268 seconds]
vlad_starkov has quit [Ping timeout: 256 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
pyx has joined #ruby
mmitchell has joined #ruby
brunoro has quit [Ping timeout: 252 seconds]
benwoody has joined #ruby
wyhaines has quit [Remote host closed the connection]
kinginky has joined #ruby
nezumi has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
wedgex has joined #ruby
Deele has quit [Ping timeout: 255 seconds]
Michae___ has quit [Remote host closed the connection]
mmitchell has quit [Ping timeout: 248 seconds]
<kinginky>
i'm writing something for a client, storing UTC date/times in the DB. he wants these displayed in EST. i'm using Sequel. does anyone know of a simple way to do this?
mixel has joined #ruby
nik_-_ has quit [Quit: nik_-_]
timkohrumel has joined #ruby
chris___ has joined #ruby
aki1 has quit [Ping timeout: 276 seconds]
mixel has quit [Client Quit]
_nitti has joined #ruby
mixel has joined #ruby
tomsthumb has quit [Quit: Leaving.]
justsee has quit [Ping timeout: 260 seconds]
Yakko has quit [Remote host closed the connection]
brunoro has joined #ruby
huoxito has quit [Read error: Connection reset by peer]
adamjleonard has joined #ruby
pyx has quit [Quit: WeeChat 0.4.0]
Spooner has quit [Remote host closed the connection]
jduan1981 has joined #ruby
sepp2k1 has quit [Remote host closed the connection]
slainer68 has quit [Remote host closed the connection]
DaniG2k has quit [Quit: Leaving]
kofno has joined #ruby
Guedes has joined #ruby
hach has joined #ruby
_nitti has quit [Ping timeout: 258 seconds]
predator217 has joined #ruby
c0rn_ has joined #ruby
c0rn has quit [Read error: Connection reset by peer]
c0rn_ is now known as c0rn
saschagehlich has joined #ruby
aki1 has joined #ruby
mercwithamouth has joined #ruby
predator117 has quit [Ping timeout: 252 seconds]
Rym has joined #ruby
kofno has quit [Remote host closed the connection]
thetristan has quit [Quit: thetristan]
GOMADWarrior has quit [Ping timeout: 255 seconds]
brunoro has quit [Ping timeout: 240 seconds]
kofno has joined #ruby
chris___ has quit [Remote host closed the connection]