casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
<bnagy>
welandB: to be completely honest, serialising custom objects freaks me out, but common practice is to have something like MyThing#to_json ( instance method ) and MyThing.from_json ( class method )
<bnagy>
and in your to_json you have code that takes your object properties and stores them in some nice, standard jsonable format
casheew has quit [Read error: Connection reset by peer]
moos3 has joined #ruby
nathanl has joined #ruby
casheew has joined #ruby
becom33 has joined #ruby
casheew has quit [Read error: Connection reset by peer]
BadQuanta has joined #ruby
sweet_kid has joined #ruby
casheew has joined #ruby
etcetera has quit []
lewix has joined #ruby
ahokaomaeha has joined #ruby
casheew has quit [Read error: Connection reset by peer]
HecAtic has joined #ruby
mikurubeam is now known as Guest83442
Guest83442 has quit [Read error: Connection reset by peer]
ahokaomaeha is now known as mikurubeam
tomsthumb has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
casheew has joined #ruby
pavilionXP has quit [Ping timeout: 248 seconds]
nathanl has quit [Ping timeout: 260 seconds]
jbueza has joined #ruby
pavilionXP has joined #ruby
yacks has joined #ruby
casheew has quit [Read error: Connection reset by peer]
bordicon has joined #ruby
casheew has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
ckrailo has joined #ruby
ner0x has quit [Quit: Leaving]
io_syl has joined #ruby
juarlex has joined #ruby
juarlex_ has quit [Read error: Connection reset by peer]
casheew has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
hogeo has quit [Remote host closed the connection]
casheew has joined #ruby
hogeo has joined #ruby
ryanf has quit [Quit: leaving]
nateberkopec has quit [Client Quit]
emocakes has joined #ruby
casheew has quit [Read error: Connection reset by peer]
s00pcan has quit [Quit: Lost terminal]
toekutr has joined #ruby
s00pcan has joined #ruby
pcarrier_ has quit [Quit: Computer has gone to sleep.]
brhelwig has quit [Remote host closed the connection]
brhelwig has joined #ruby
mikurubeam has quit [Quit: brb]
casheew has joined #ruby
mikurubeam has joined #ruby
sayan has joined #ruby
casheew has quit [Read error: Connection reset by peer]
huoxito has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
nfk has quit [Quit: yawn]
zeade has joined #ruby
feedbackloop_ has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
brhelwig has quit [Ping timeout: 260 seconds]
daed has quit [Ping timeout: 255 seconds]
casheew has joined #ruby
SCommette has joined #ruby
Inside has quit [Ping timeout: 255 seconds]
guilleiguaran_ has quit [Ping timeout: 256 seconds]
platzhirsch has quit [Ping timeout: 256 seconds]
platzhirsch has joined #ruby
prime has quit [Read error: Connection reset by peer]
prime has joined #ruby
guilleiguaran_ has joined #ruby
Boohbah has quit [Ping timeout: 256 seconds]
Boohbah has joined #ruby
Boohbah is now known as Guest91682
daed has joined #ruby
etcetera has joined #ruby
feedbackloop_ has joined #ruby
ffranz has quit [Quit: Leaving]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
danneu has joined #ruby
superninkendo has joined #ruby
superninkendo1 has joined #ruby
casheew has quit [Read error: Connection reset by peer]
sayan_ has joined #ruby
sambio has quit []
sambio has joined #ruby
sayan has quit [Read error: Connection reset by peer]
sayan_ is now known as sayan
daed has quit [Ping timeout: 260 seconds]
sayan has quit [Changing host]
sayan has joined #ruby
casheew has joined #ruby
superninkendo has quit [Ping timeout: 258 seconds]
daed has joined #ruby
browndawg has joined #ruby
ebobby has quit [Quit: Lost terminal]
lewix has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
FrostyAcres has joined #ruby
uris has quit [Quit: Leaving]
FrostyAcres has quit [Client Quit]
bruschill has joined #ruby
benlieb has quit [Quit: benlieb]
dhruvasagar has quit [Ping timeout: 264 seconds]
reset has quit [Ping timeout: 248 seconds]
casheew has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
ocnam has joined #ruby
casheew has quit [Read error: Connection reset by peer]
finishingmove has quit [Quit: Nettalk6 - www.ntalk.de]
daed has quit [Ping timeout: 264 seconds]
daed has joined #ruby
mattbl has joined #ruby
casheew has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
lewix has joined #ruby
brhelwig has joined #ruby
raycloud_ has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
banjara has joined #ruby
HecAtic has quit [Quit: HecAtic]
raycloud has quit [Ping timeout: 248 seconds]
Kirotan has quit [Ping timeout: 246 seconds]
Matip has quit [Read error: Connection reset by peer]
sandGorgon has joined #ruby
brhelwig has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
brhelwig has joined #ruby
casheew has joined #ruby
freerobby has quit [Quit: Leaving.]
jekotia has quit [Quit: sleeeeeeeeeeeeeeeeeep]
Will_Tampa has joined #ruby
dhruvasagar has joined #ruby
ryanf has joined #ruby
moos3 has joined #ruby
kofno has joined #ruby
jim_r0x has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
huoxito has quit [Ping timeout: 258 seconds]
akashj87_ has quit [Quit: leaving]
raycloud has joined #ruby
raycloud_ has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
kofno has quit [Ping timeout: 258 seconds]
lewix has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
pkrnj has joined #ruby
casheew has joined #ruby
momomomomo has left #ruby [#ruby]
casheew has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
browndawg has joined #ruby
marwinism has quit [Ping timeout: 240 seconds]
robustus has quit [Ping timeout: 248 seconds]
SCommette has quit [Quit: SCommette]
superninkendo1 has quit [Quit: Leaving.]
pavilionXP has quit [Remote host closed the connection]
divout has joined #ruby
security is now known as fire
raycloud has quit [Read error: Connection reset by peer]
<jsaak>
do you think it is possible to save the state of a running ruby program, then reload and continue it?
<apeiros_>
also, there's no point in using Regexp.new there over a regex literal
newUser1234 has quit [Remote host closed the connection]
<apeiros_>
jsaak: there's nothing to just store the whole state, you'll have to come up with a way yourself. serializers like e.g. marshal help you with getting it to a file and loading it again.
<lukeholder>
apeiros_ could you explain where the \3 would go ?
dhruvasagar has joined #ruby
<injekt>
where $3 is?
<injekt>
you didn't just try it?
<apeiros_>
lukeholder: obviously where you wrote "I WANT TO REFERENCE $3 here"
<apeiros_>
otherwise I wouldn't have answered your question, would I?
<Hanmac>
lukeholder: why is no one reading the docs?
eldariof has joined #ruby
<charliesome>
jsaak: fork, send SIGSTOP to the child
<charliesome>
jsaak: when you want to start it up against, send SIGCONT
<apeiros_>
charliesome: what's up with eval-in?
<lukeholder>
Hanmac: been reading the docs for 1 hour
<charliesome>
apeiros_: i've been working for the past 3 days to get my server online
<apeiros_>
lukeholder: and you haven't seen ` "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>" ` in the docs?
<apeiros_>
charliesome: oh
<jsaak>
charliesome: not bad, but i want to store the state to the hdd
<charliesome>
jsaak: if you want to do that, you'll have to use scary operating system specific hacks
<charliesome>
jsaak: look into process checkpointing
<lukeholder>
Hanmac thats gsub… not how to reference a match
<Quadlex>
charliesome: Did you just finish Tomb Raider by any chance?
<apeiros_>
lukeholder: um, you use gsub in your example, and you want to reference the match in gsub
<charliesome>
Quadlex: nope?
<jsaak>
basically i want to embed ruby into a c program, and save the ruby program state on savegames
<apeiros_>
lukeholder: so this *is* the answer to your question. if it doesn't solve your problem, then you need to amend your question.
<Quadlex>
charliesome: Ahh, K. Thought you were someone I know offline
<jsaak>
there must be a better way :)
<charliesome>
jsaak: dumping state manually :p
<apeiros_>
jsaak: as said, marshal and co are your friends
<lukeholder>
Hanmac ah ok i see it… "If replacement is a String it will be substituted for the matched text. It may contain back-references to the pattern’s capture groups of the form \\d"
<lukeholder>
Hanmac: so this: body = body.gsub(captionregex, \\3)
<Hanmac>
i know thats what i quoted to you
<jsaak>
not a bad idea, but if i do not know the program itself which is running, it is not trivial to marshal the state
<Hanmac>
you forgot the ''
<injekt>
'\3'
<lukeholder>
Hanmac injekt yep thanks
lewix has joined #ruby
<lukeholder>
thanks guys appreciate your patience… was looking for the match ref on the regex class
<Hanmac>
charliesome: do you also add some ruby-trunk to the possible rubies? :P
<jsaak>
for example how to jump inside a loop
<charliesome>
Hanmac: yeah i can
<charliesome>
Hanmac: i'll need to get a cronjob going to download and build latest versions of stuff
<apeiros_>
awesome how he gets the correct answer, doesn't bother to try it and in turn just keeps a channel occupied…
<charliesome>
Hanmac i already have two other head/trunk ones there but its a manual process to update them
thebastl has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
<Hanmac>
for sample the required key arguments seems to be only available in ruby-trunk
thebastl has quit [Remote host closed the connection]
lukeholder has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Remote host closed the connection]
<TTilus>
Quadlex: confusing at the least, been (roughly) there, feel for you
browndawg has joined #ruby
jurassic_ has quit [Quit: jurassic_]
xbob has quit [Quit: Leaving]
casheew has joined #ruby
<lessless>
I read about it, but always comes a time to rethink readed ;)
Sargun_ is now known as Sargun
<jsaak>
TTilus: since the running program state is a part of the "game" state i find it hard to restructure it
Sargun has quit [Changing host]
Sargun has joined #ruby
<TTilus>
jsaak: it is definitely more complicated and less portable to try to achieve "save game" feature by "suspending" os process
<apeiros_>
jsaak: isolate all state in single objects
<Quadlex>
TTilus: TY. I'm thinking about trying to pull the MP out and make the thing an Rspec formatter
<TTilus>
jsaak: thats what i mean
<apeiros_>
serializing those is in turn easy (again, marshal)
codecop has joined #ruby
<TTilus>
jsaak: you need to restructure and isolate "game world" from the "program in general"
<jsaak>
yup i do not want to save os processes
<TTilus>
jsaak: and listen to apeiros_, really :)
<jsaak>
yeah i try
marcdel has quit []
<jsaak>
it is the only doable way it seems, i just do not know how to do it
hashmal has joined #ruby
<TTilus>
jsaak: start from concepts, give them names
<TTilus>
jsaak: what "things" do you have in your "game world"
<TTilus>
jsaak: try not to think too much about the implementation you currently have
razibog has quit [Ping timeout: 264 seconds]
<apeiros_>
those objects don't need to be flat either btw., you can perfectly nest and even recurse objects. marshal has no problem with that.
<apeiros_>
just make sure that their boundaries are clear, i.e. that they don't reference non-game-state objects
<TTilus>
jsaak: from your description i gather your game world consists of simulated physical objects in 3d eucleidian space and program code
slainer68 has joined #ruby
<jsaak>
i give you an example: i have a robot in the game and the user wrote a program something like this: "do_something(); while true; do_something_else(); sleep(1); end
vlad_sta_ has joined #ruby
<jsaak>
and the robot is in the loop at the moment i want to save the state
<jsaak>
apeiros_: i hear you and i mostly agree with you, i am just dumb and can not solve this problem for example
casheew has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Read error: Connection reset by peer]
casheew has joined #ruby
timonv has quit [Remote host closed the connection]
razibog has joined #ruby
<TTilus>
jsaak: why would one want to save the state in the middle of loop?
timonv has joined #ruby
<jsaak>
for this example i need the object_space which can be dumped, the stack, and the position where the program is at
xbob has joined #ruby
<apeiros_>
jsaak: you mean your program is somewhere deep down in an arbitrary method and you want to stop it right there
daed has quit [Ping timeout: 264 seconds]
pi3r has joined #ruby
<jsaak>
TTilus: i do not see any other way
<apeiros_>
that'll be hard. you'll probably have to reorganize the flow of your program, so it has discreete exit points where you can reenter
angusiguess has joined #ruby
<apeiros_>
*discrete
<TTilus>
jsaak: lemme rephrase
daed has joined #ruby
<TTilus>
jsaak: whats the value of that feature to the player of the game?
<jsaak>
apeiros_: yes
<jsaak>
the robot is doing something useful at the moment of the save
<jsaak>
and by reloading i can not allow it to start its program again
<jsaak>
i need it to continue
pioz has joined #ruby
casheew has quit [Read error: Connection reset by peer]
<TTilus>
the program code and the state of the game space when the program starts determine the result fully
casheew has joined #ruby
<TTilus>
doesn't it?
<jsaak>
i do not think it is enough
casheew has quit [Read error: Connection reset by peer]
<TTilus>
why
angusiguess has quit [Ping timeout: 255 seconds]
<jsaak>
or
nomenkun_ has joined #ruby
<jsaak>
it is enough _when_ the program starts
* TTilus
is trying to understand
maxmanders has joined #ruby
<jsaak>
not at the moment when the program is in the middle of something
<TTilus>
whats the value to the player?
thebastl has joined #ruby
<TTilus>
..of that saving in the middle of run
Loaft has quit [Read error: Connection reset by peer]
kofno has joined #ruby
<jsaak>
well i can disable save-game functionality :)
techlife has quit [Ping timeout: 256 seconds]
<TTilus>
that feels to me like savegame in the middle of "run" in The Incredible Machine
<jsaak>
these programs run forver usually
casheew has joined #ruby
<TTilus>
why they run forever?
jurassic_ has joined #ruby
<TTilus>
jsaak: im not being an ass, i just want to understand the value of the savegame feature as you described you wanted it to be done
<jsaak>
for example there is an AI of an enemy: while true; go(random_place); shoot(random_direction); end
<TTilus>
is it like robot wars?
<jsaak>
i can not wait to finish these programs
<TTilus>
"i"
<jsaak>
something like that
<TTilus>
theres the game and the player
<TTilus>
who's "i"
<jsaak>
i == player
<TTilus>
ok
casheew has quit [Read error: Connection reset by peer]
<jsaak>
but since these programs run forever, it does not really matter i think
<TTilus>
:)
kofno has quit [Ping timeout: 240 seconds]
<TTilus>
does this game have goals?
<TTilus>
or achievements or anything that sort?
<jsaak>
yup
casheew has joined #ruby
dekroning has quit [Quit: leaving]
<TTilus>
so
<jsaak>
i think i just have to disable saving :(
<jsaak>
i can save between missions, no problem
techlife has joined #ruby
cobragoat has quit [Remote host closed the connection]
<TTilus>
if player plays the game by writing a program and then seeing if it achieves the goal or not, then it would seem to me like saving between runs would be the obvious way of going about
casheew has quit [Read error: Connection reset by peer]
<TTilus>
there's no point in savin g on times where there's no variation point
<TTilus>
think of it from the perspective of player
<TTilus>
if you load game and it deterministicly heads (pretty much) to the same result every time there's very little point in loading
MrZYX|off is now known as MrZYX
<TTilus>
natural point of variation is when user alters the code
<jsaak>
there are multiple programs running at the sam time, and human iteractions are possible too
<TTilus>
so taken the starting states are predetermined, actually saving the programs is enough
casheew has joined #ruby
<TTilus>
how do players interact with the run?
<TTilus>
is it "real time", repl-style
nathancahill has quit [Quit: nathancahill]
<TTilus>
$ shoot :missile
<TTilus>
$ turn -15.23
<TTilus>
$ accelerate
jgrevich has quit [Remote host closed the connection]
<jsaak>
-> going pm
casheew has quit [Read error: Connection reset by peer]
Sicp has joined #ruby
<jsaak>
think of a FirstPersonShooter, you have an avatar, you can shoot and move
fire has joined #ruby
casheew has joined #ruby
<jsaak>
and you have 5 robots which helps you, you program them and the let them loose
<jsaak>
and there are 15 enemies which are ruby programs too
akemrir has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
<jsaak>
and the aim is to kill all enemies
Astralum has quit [Ping timeout: 264 seconds]
jerius has joined #ruby
casheew has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 264 seconds]
<TTilus>
now i see the point
Sicp has quit [Ping timeout: 264 seconds]
<TTilus>
you might want to make the robots event driven
Bry8Star has quit [Ping timeout: 276 seconds]
miso1337 has joined #ruby
dhruvasagar has joined #ruby
casheew has joined #ruby
Astralum has joined #ruby
<jsaak>
thats not a bad idea
<TTilus>
organizing the robots that way gives you natural exit points (every cycle in event loop) where you can just serialize the state of "game world" and save program code and re-enter eventloop upon loading the state and code
casheew has quit [Read error: Connection reset by peer]
<TTilus>
exactly the exit/re-enter point strategy apeiros_ was describing earlier
RORgasm has joined #ruby
<TTilus>
programming event driven robots for real time environment builds proper mindset for node programming =D
vlad_starkov has joined #ruby
vlad_st__ has joined #ruby
<jsaak>
while true; do_something(); sleep 1; end is so 20th century, you are right :)
cobragoat has joined #ruby
casheew has joined #ruby
vlad_sta_ has quit [Ping timeout: 258 seconds]
RORgasm has quit [Ping timeout: 258 seconds]
casheew has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Ping timeout: 240 seconds]
a_a_g has quit [Quit: Leaving.]
mikurubeam has quit [Ping timeout: 260 seconds]
drale2k has quit [Quit: Leaving...]
casheew has joined #ruby
Nahra has quit [Remote host closed the connection]
Skofo has quit [Quit: Leaving]
Nahra has joined #ruby
cantonic has joined #ruby
vlad_st__ has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
nari has quit [Ping timeout: 264 seconds]
tsion has joined #ruby
zigomir has joined #ruby
sheerun has joined #ruby
casheew has quit [Read error: Connection reset by peer]
hmarr has joined #ruby
casheew has joined #ruby
casheew has quit [Read error: Connection reset by peer]
jerius has quit [Quit: Computer has gone to sleep.]
pskosinski has joined #ruby
chandankumar has quit [Ping timeout: 258 seconds]
casheew has joined #ruby
tsion has left #ruby ["Leaving"]
Bry8Star has joined #ruby
alexwh has quit [Ping timeout: 252 seconds]
casheew has quit [Read error: Connection reset by peer]
pi3r has quit [Quit: Leaving]
pi3r has joined #ruby
justsee_ has joined #ruby
justsee has quit [Ping timeout: 255 seconds]
<shevy>
jsaak loop { do_something; sleep 1 }
<shevy>
looks nicer
Zai00 has joined #ruby
vlad_sta_ has joined #ruby
casheew has joined #ruby
lkba has quit [Ping timeout: 248 seconds]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
vlad_starkov has quit [Ping timeout: 264 seconds]
whitedawg has joined #ruby
BizarreCake has joined #ruby
yashshah- has joined #ruby
colonolGron has joined #ruby
rickmasta has quit [Quit: Leaving...]
sweet_kid has quit [Ping timeout: 246 seconds]
angusiguess has joined #ruby
yannis has joined #ruby
emocakes has quit [Quit: emocakes]
hamed_r has quit [Remote host closed the connection]
mhn23 has joined #ruby
browndawg has quit [Ping timeout: 255 seconds]
sweet_kid has joined #ruby
sebastianb has quit [Ping timeout: 246 seconds]
eliasp has quit [Ping timeout: 246 seconds]
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
Sicp has joined #ruby
nomenkun has joined #ruby
casheew has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
nomenkun_ has quit [Ping timeout: 258 seconds]
mpfundstein_ has joined #ruby
freeayu has joined #ruby
br4ndon has joined #ruby
_veer has quit [Ping timeout: 248 seconds]
bordicon has quit [Ping timeout: 258 seconds]
angusiguess has quit [Ping timeout: 246 seconds]
browndawg has joined #ruby
mpfundstein has quit [Ping timeout: 246 seconds]
casheew has joined #ruby
sweet_kid has quit [Ping timeout: 246 seconds]
sebastianb has joined #ruby
cobragoat has quit [Remote host closed the connection]
casheew has quit [Read error: Connection reset by peer]
sweet_kid has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
casheew has joined #ruby
angusiguess has joined #ruby
browndawg has quit [Ping timeout: 258 seconds]
browndawg has joined #ruby
casheew has quit [Read error: Connection reset by peer]
sebastianb has quit [Ping timeout: 246 seconds]
nari has joined #ruby
sebastianb has joined #ruby
backjlack_ has joined #ruby
RottenMuffin has joined #ruby
casheew has joined #ruby
Gonzih has quit [Quit: IRC is just multiplayer vim.]
elaptics`away is now known as elaptics
cantonic has quit [Quit: cantonic]
Catbuntu has joined #ruby
emergion has joined #ruby
burgestrand has joined #ruby
cobragoat has joined #ruby
backjlack has quit [Ping timeout: 264 seconds]
rickmasta has joined #ruby
tenmilestereo has joined #ruby
browndawg has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 255 seconds]
yashshah- has quit [Ping timeout: 258 seconds]
browndawg has joined #ruby
angusiguess has quit [Ping timeout: 246 seconds]
jdunck has quit [Quit: Computer has gone to sleep.]
rickmasta has quit [Ping timeout: 240 seconds]
LennyLinux has joined #ruby
bakingbread has quit [Excess Flood]
<dawkirst>
hi, why can't I do 'foo'.downcase!.strip! ?
icedp has joined #ruby
<MrZYX>
because most bang methods return nil if they didn't change anything
icedp is now known as Guest88525
xardas has joined #ruby
cantonic has joined #ruby
<dawkirst>
MrZYX, that's it. Thanks.
danneu has quit [Ping timeout: 264 seconds]
Guest88525 is now known as bakingbread
bakingbread has quit [Changing host]
bakingbread has joined #ruby
freeayu has quit [Ping timeout: 256 seconds]
backjlack_ has quit [Remote host closed the connection]
backjlack has joined #ruby
sepp2k has joined #ruby
mhn23 has quit [Quit: Goodbye.]
webwarlock has joined #ruby
freeayu has joined #ruby
ananthakumaran1 has joined #ruby
nari has joined #ruby
timonv has quit [Remote host closed the connection]
maria has joined #ruby
<maria>
hi
<maria>
anybody here
<maria>
help
<maria>
plz
ananthakumaran2 has joined #ruby
<maria>
guyz
ananthakumaran has quit [Ping timeout: 264 seconds]
chandankumar has joined #ruby
backjlack has quit [Remote host closed the connection]
<maria>
i need help
<MrZYX>
maria: you can't get answers without asking questions
Heero has quit [Read error: Connection reset by peer]
slainer68 has quit [Read error: Connection reset by peer]
chichou has quit [Read error: Connection reset by peer]
Heero has joined #ruby
Heero has quit [Changing host]
Heero has joined #ruby
akhet has joined #ruby
icedp- is now known as bakingbread
bakingbread has quit [Changing host]
pac1 has quit [Ping timeout: 248 seconds]
bakingbread has joined #ruby
slainer68 has joined #ruby
miso1337 has quit [Quit: afk]
<maria>
i want help in vb
chichou has joined #ruby
ananthakumaran1 has quit [Ping timeout: 264 seconds]
pi3r has quit [Quit: Leaving]
justsee_ has quit [Ping timeout: 260 seconds]
pi3r has joined #ruby
hmarr has quit []
<maria>
guyz
m8 has joined #ruby
<akhet>
wut
<maria>
hi
<maria>
any body here
Heero has quit [Read error: Connection reset by peer]
<maria>
i need help in vb
<maria>
plz
Heero has joined #ruby
Heero has quit [Changing host]
Heero has joined #ruby
<maria>
any one can help me
<akhet>
this is #ruby
<maria>
give me a programming channel
<pduin>
#vb #vb.net
<akhet>
try #vb
br4ndon_ has joined #ruby
k610 has joined #ruby
maria has left #ruby [#ruby]
JohnBat26 has quit [Read error: Connection reset by peer]
<k610>
what's the proper way to start some ruby app like bluepill on boot from e.g. /etc/rc.local
<MrZYX>
I like daemontools
sonda has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
vlad_sta_ has quit [Ping timeout: 246 seconds]
whitedawg1 has joined #ruby
<k610>
MrZYX, with daemontools : will i have to prefix my commands with source #{rvmpath} || #{full_rvm bin path} do bluepill ... or can i simply call bluepill ...
br4ndon_ has quit [Client Quit]
br4ndon has joined #ruby
RottenMuffin has quit [Read error: Connection reset by peer]
rtnmfn has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
<MrZYX>
environment wise it's pretty much the same as putting it into rc.local or an init script
<MrZYX>
but daemontools keeps it running in case it dies
whitedawg has quit [Ping timeout: 240 seconds]
wargasm has joined #ruby
atno has quit [Read error: Connection reset by peer]
<MrZYX>
and provides tools for logging stdout, switching the user etc
cantonic has quit [Ping timeout: 260 seconds]
hashmal has quit [Ping timeout: 264 seconds]
danneu has joined #ruby
cobragoat has quit [Remote host closed the connection]
araujo has quit [Ping timeout: 264 seconds]
cantonic has joined #ruby
tcopp has joined #ruby
Nisstyre-laptop has quit [Ping timeout: 264 seconds]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
<k610>
MrZYX, seems great for more advandced usage but at the moment i fail to correctly setup the environment something to do with rvm global gem set & co. my command works fine on a shell but throws unexpected errors when run on reboot in /etc/rc.local
vlad_starkov has joined #ruby
Raboo has quit [Ping timeout: 245 seconds]
hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has joined #ruby
hemanth_ has quit [Read error: Connection reset by peer]
araujo has joined #ruby
jonathanwallace has joined #ruby
danneu has quit [Ping timeout: 264 seconds]
eldariof has quit [Read error: No route to host]
browndawg has quit [Ping timeout: 240 seconds]
slainer68 has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
m8 has quit [Quit: Sto andando via]
emergion has joined #ruby
dallasm has joined #ruby
vlad_starkov has quit [Ping timeout: 258 seconds]
vlad_starkov has joined #ruby
mhn23 has joined #ruby
cantonic has quit [Quit: cantonic]
Catbuntu has quit [Quit: Leaving]
<e-dard>
Hi, is the stub method part of RSpec or do I need rspec-mock ?
<quazimodo>
/j #lisp
<quazimodo>
grr
drale2k has joined #ruby
ArchBeOS has joined #ruby
hashmal has joined #ruby
mhn23_ has joined #ruby
tcopp has quit [Ping timeout: 255 seconds]
mhn23 has quit [Ping timeout: 264 seconds]
Raboo has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
postmodern has quit [Quit: Leaving]
dhruvasagar has joined #ruby
matayam has quit [Remote host closed the connection]
<e-dard>
If you were testing methods that read and process a file would it be better to create the file during the tests, or keep a file under the spec folder?
mhn23_ has quit [Read error: Connection reset by peer]
lukeholder has joined #ruby
dangerousdave has joined #ruby
sebastianb has quit [Ping timeout: 246 seconds]
thone has joined #ruby
rtnmfn has quit [Quit: Bye]
Layke has joined #ruby
thone_ has quit [Ping timeout: 258 seconds]
Domon has quit [Remote host closed the connection]
webwarlock has quit [Ping timeout: 246 seconds]
sweet_kid has quit [Ping timeout: 246 seconds]
<Layke>
Hey. Day off work.. PHP dev for 10+ years~ fed up. Want a change... figured I'd shoot towards Ruby for some upcoming side projects. I'm just looking for speed of development at the moment. Never touched a line of Ruby... thoughts on getting started?..
timonv has joined #ruby
<Layke>
Also, is it ill advised to learn/use rails simutaneously as jumping in to Ruby for the first time?
Domon has joined #ruby
<apeiros_>
Layke: rails is huge, personally I'd learn ruby before rails. but it's certainly possible to do both at once.
<apeiros_>
it'll just be a bit difficult to understand what's really going on with rails heads first. there's a couple of "magical" being done there
backjlack has joined #ruby
<Layke>
Yeah okay thanks. I'll just stick to Ruby to start with today.
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
baba has joined #ruby
<Layke>
apeiros_, Any useful links/resources?
<MrZYX>
Layke: tryruby.org if you really never saw a line before ;)
fire has quit [Ping timeout: 264 seconds]
<Layke>
Thanks. I'm also keen to know about how Ruby is actually ran on a web server. I'm used to running nginx, and passing off requests to a running fast-cgi process.. I can't actually follow how my "web server" works with Ruby
bakingbread has quit [Ping timeout: 246 seconds]
TMM has quit [Remote host closed the connection]
<pi3r>
Layke: what about using unicorn ?
<MrZYX>
typically you have a "appserver" which provides a unix socket and nginx or apache reverse proxying to that
sebastianb has joined #ruby
tomzx_mac has joined #ruby
<MrZYX>
there's also passenger which is sort off mod_php for ruby
yannis has quit [Ping timeout: 240 seconds]
Upasna has joined #ruby
BeLucid_ has quit [Remote host closed the connection]
sweet_kid has quit [Ping timeout: 246 seconds]
cantonic has joined #ruby
includex has joined #ruby
sebastianb has quit [Ping timeout: 246 seconds]
akashj87_ has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
Upasna has quit [Max SendQ exceeded]
icedp has joined #ruby
DonRichie has joined #ruby
RORgasm has joined #ruby
icedp is now known as Guest8673
freeayu__ has joined #ruby
includex has quit [Quit: Leaving...]
chandankumar has quit [Ping timeout: 255 seconds]
browndawg has joined #ruby
browndawg has left #ruby [#ruby]
akashj87 has quit [Ping timeout: 258 seconds]
yashshah- has joined #ruby
sayan has quit [Ping timeout: 258 seconds]
BeLucid has joined #ruby
Xeago has joined #ruby
browndawg has joined #ruby
Raboo has quit [Ping timeout: 264 seconds]
freeayu has quit [Ping timeout: 264 seconds]
Raboo has joined #ruby
jnoob22 has joined #ruby
RORgasm has quit [Ping timeout: 240 seconds]
sheerun has quit []
Guest8673 is now known as bakingbread
bakingbread has quit [Changing host]
bakingbread has joined #ruby
dhruvasagar has joined #ruby
browndawg has quit [Ping timeout: 258 seconds]
sheerun has joined #ruby
<quazimodo>
hey everybody
jurassic_ has quit [Quit: jurassic_]
TMM has joined #ruby
TMM has quit [Changing host]
TMM has joined #ruby
<sam113101>
hey quazimodo
emergion has quit [Quit: Computer has gone to sleep.]
yashshah- has quit [Ping timeout: 255 seconds]
rudisimo has joined #ruby
browndawg has joined #ruby
wallclockbuilder has quit [Remote host closed the connection]
wallclockbuilder has joined #ruby
yashshah- has joined #ruby
akashj87_ has quit [Quit: leaving]
akashj87 has joined #ruby
skattyadz has joined #ruby
<quazimodo>
sam113101: get a rock melon, scoop out flesh, add sugar and crushed ice anda tiny pinch of salt. Best programming break EVER
bluOxigen has joined #ruby
cobragoat has joined #ruby
<quazimodo>
Layke: i learnt ruby with rails. its easy... theres very little to learn about ruby
<quazimodo>
i found it to be a profoundly intuitive language
vlad_sta_ has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
blueOxigen has joined #ruby
Layke has quit [Ping timeout: 258 seconds]
lukeholder has quit [Quit: Computer has gone to sleep.]
wfht has joined #ruby
cobragoat has quit [Ping timeout: 258 seconds]
ttt has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 255 seconds]
subbyyy has joined #ruby
freerobby has joined #ruby
akashj87_ has joined #ruby
wallclockbuilder has quit [Remote host closed the connection]
_nitti has quit [Read error: Connection reset by peer]
_nitti has joined #ruby
nathanl has quit [Quit: Lost terminal]
mvangala_ has quit [Ping timeout: 264 seconds]
noop has quit [Quit: Leaving]
mvangala has joined #ruby
picca has joined #ruby
osvico has quit [Ping timeout: 260 seconds]
s__dana has quit [Quit: s__dana]
xardas has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]]
mikurubeam has joined #ruby
slainer6_ has joined #ruby
joofsh has quit [Remote host closed the connection]
atmosx has joined #ruby
<Layke>
Are thre any useful resources for learning ruby... ie.. Trying to work my way through but keep getting stumped on symbols.. When to use ? when to use @, Why do you have %i at the beginning of some blocks etc. I'm happy to work my way through bit by bit.
statarb3 has quit [Ping timeout: 255 seconds]
<atmosx>
Layke: google
slainer68 has quit [Ping timeout: 258 seconds]
<atmosx>
Layke: there are plenty, the best way as always is buying a book and reading it, guides you step by step.
<atmosx>
Symbols are class-wide variables
freeayu__ has quit [Remote host closed the connection]
Rhy0lite has left #ruby ["Leaving"]
sambao21 has quit [Quit: Quitter]
<atmosx>
for example @db = Sequel::Connect("sqlite://#{sqlite}") at the initialize class function, will allo me to use @db through my class.
<atmosx>
Layke: write a couple of classes you'll figure it out, it's not a hard grasp as a concept.
<Layke>
Got the day off work, so just trying to pick up some Ruby.. as I'm fed up of a decade of PHP. :)
<atmosx>
ah I know nothing about PHP :-) I'm just an amateur
SCommette has joined #ruby
<atmosx>
there are ex-PHPers here for sure that could help you
mercwithamouth has quit [Ping timeout: 255 seconds]
<Layke>
Nah, it's more just what's a good resource to dril through code.
<Layke>
A lot of the itme, it's hard to know what I need to know, without knowing what I don't know.
<Layke>
(Spoken like a true confucius)
brianherman has joined #ruby
<MrZYX>
Layke: %{} isn't a block, it's syntax like quotes are, %{this is a string}, %w{this is an array of strings} %i{this is an array of symbols}
<apeiros_>
the regex is valid, the rest - not sure
<royalty>
lol
<apeiros_>
match/ # <- might get misinterpreted
<apeiros_>
you want either a space between match and //, or have explicit parens
<royalty>
what are explicit parens
<apeiros_>
match(/…/)
RORgasm has joined #ruby
<becom33>
bnagy, http://pastebin.com/p3yJJdpe check if you could help me with this ? my head hurts . I have mentioned what I want to do in the end of the script since its to long
<becom33>
apeiros_, ^ please check
<royalty>
oh
hmarr has quit [Ping timeout: 264 seconds]
<royalty>
becom33: is this ROR?
<becom33>
royalty, no
<becom33>
CLI
<royalty>
oh ok
dallasm has quit [Remote host closed the connection]
<royalty>
in regex
girija_ has joined #ruby
<royalty>
don't you have to escape the periods
hmarr has joined #ruby
<royalty>
?
<becom33>
royalty, what do u mean ?
averiso has quit [Quit: Quit.]
<royalty>
becom33: is this part of your code a regex? if split_command[1] =~ /../
<royalty>
probably not
<royalty>
I haven't seen =~ before
Xeago has quit [Read error: Connection reset by peer]
sebastianb has joined #ruby
<becom33>
royalty, well yea . it works
<royalty>
oh weird
Xeago has joined #ruby
randomautomator has joined #ruby
<becom33>
problem is with the logic and my crappy coding
geekbri has joined #ruby
<Hanmac>
becom33: /../ does not work, you need /\.\./
<becom33>
:/ weired it works in my script . well I'll change anyway
<becom33>
btw Hanmac I want to detect if it has ".." not "/../"
<royalty>
yeah that looked weird
crimezone20xx has quit [Ping timeout: 258 seconds]
<royalty>
lol do you know what a period means in regex?
<breakingthings>
becom33: . is a special character in regex though.
slainer68 has joined #ruby
<Hanmac>
becom33: split_command[1][".."]
<breakingthings>
your regex will match literally everything besides single characters.
<royalty>
why don't you just do a string match
<royalty>
instead of a regex
<royalty>
I mean I assume ruby has those lol
mmitchell has joined #ruby
aganov has quit [Remote host closed the connection]
jerius has joined #ruby
<royalty>
if split_command[1] == ".."
<royalty>
i assume that would be it...
<Hanmac>
royalty: nope does not work
<royalty>
oh
<becom33>
Hanmac, ok now thats done .
newUser1234 has joined #ruby
<royalty>
well I will learn as I go along
Elhu has joined #ruby
<royalty>
but good to know
<becom33>
what about the ../ and join part ? its pretty confusing
<royalty>
lol you wrote it
slainer__ has joined #ruby
WilfredTheGreat has quit [Quit: leaving]
slainer6_ has quit [Ping timeout: 246 seconds]
johnmilton has joined #ruby
anonymuse has joined #ruby
sambio has joined #ruby
<royalty>
becom33: so shell_cd commands is function and path is a parameter? I wish I have had used ruby more lol
ChewieBeardy has joined #ruby
<becom33>
what ?
mikurubeam has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
<mpfundstein>
if i use active support outside of rails. how can i start testing? I subclassed from TestCase
sandGorgon has quit [Ping timeout: 260 seconds]
slainer68 has quit [Ping timeout: 258 seconds]
<royalty>
i dunno i just don't know what your code does bc i don't use ruby enough I was asking if shell_cd commands was a function
<royalty>
I actually just started learning
<royalty>
like yesterday
doodlehaus has joined #ruby
cantonic_ has joined #ruby
cantonic has quit [Ping timeout: 258 seconds]
cantonic_ is now known as cantonic
yashshah has quit [Ping timeout: 240 seconds]
Hanmac has quit [Ping timeout: 248 seconds]
browndawg has quit [Quit: Leaving.]
cyberarm has joined #ruby
Hanmac has joined #ruby
Nanuq has quit [Ping timeout: 252 seconds]
browndawg has joined #ruby
robbyoconnor has quit [Ping timeout: 264 seconds]
eval-in has joined #ruby
adam12_ has quit [Ping timeout: 240 seconds]
mikurubeam has joined #ruby
browndawg has quit [Client Quit]
colonolGron has quit [Ping timeout: 256 seconds]
tylersmith has joined #ruby
browndawg has joined #ruby
ndch has joined #ruby
mlue has quit [Quit: leaving]
etcetera has joined #ruby
yashshah has joined #ruby
akemrir has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
Sicp has quit [Ping timeout: 240 seconds]
<mpfundstein>
does anyone know what i have to pass to MiniTest::Unit::TestCase#run ? They doc says a runner object but doesnt mention what that shall be
puppeh has joined #ruby
havenwood has joined #ruby
anonymuse has quit [Quit: Leaving...]
nomenkun has quit [Remote host closed the connection]
<nezumi>
Gah! I just started writing Perl in a Ruby script!!
adam12 has joined #ruby
ananthakumaran2 has quit [Quit: Leaving.]
Nanuq has joined #ruby
royalty has quit [Quit: This computer has gone to sleep]
Ripp__ has joined #ruby
linoespinoza has joined #ruby
idkazuma has quit [Remote host closed the connection]
<puppeh>
how can I retrieve whatever key is pressed globally from ruby?/
finishingmove has quit [Quit: Nettalk6 - www.ntalk.de]
<puppeh>
hm so is the macruby the only way to use objC libraries?
<shock_one>
puppeh, no idea. Maybe there are some wrappers or something.
mva3212 has joined #ruby
devbox_ has joined #ruby
royalty has quit [Quit: This computer has gone to sleep]
devbox_ has quit [Client Quit]
internet_user has joined #ruby
becom33 has quit [Quit: Leaving]
<burgestrand>
You can write C extensions in ObjectiveC for Ruby.
<shock_one>
burgestrand, ☺
<burgestrand>
I also believe that since you could use the ObjC functions from a regular C program by setting up the ObjC runtime (it’s not too much code), you could probably do it with regular FFI as well.
zeade has joined #ruby
<shock_one>
burgestrand, you can't call Cocoa libraries from C.
maletor has joined #ruby
etcetera has quit []
<puppeh>
how would u go about logging all keystrokes from a ruby program?
zeade has quit [Client Quit]
<puppeh>
i'm not sure how many ways there are and which is the easiest
<shock_one>
puppeh, I would write it in Objective C.
nfisher has quit [Ping timeout: 256 seconds]
zeade has joined #ruby
royalty has joined #ruby
jgrevich has joined #ruby
ananthakumaran has joined #ruby
Spooner has joined #ruby
* Hanmac
prefers C++ gems :P
sweeper has joined #ruby
brianpWins has quit [Quit: brianpWins]
yashshah__ has quit [Ping timeout: 264 seconds]
chrisbolton has quit [Quit: chrisbolton]
<sweeper>
hey folks. anyone use gir_ffi?
yashshah__ has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
_emptymag00 has quit [Ping timeout: 260 seconds]
verysoftoiletppr has joined #ruby
sayan has quit [Read error: Connection reset by peer]
jamie_ca_ has joined #ruby
endzyme has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
chrishough has quit [Quit: chrishough]
arya has joined #ruby
jurassic_ has joined #ruby
browndawg has joined #ruby
ToApolytoXaos has joined #ruby
Xeago has joined #ruby
shock_one has quit [Ping timeout: 264 seconds]
buibex has quit [Remote host closed the connection]
teddyp1cker has joined #ruby
<Mon_Ouie>
shock_one: You can call every Obj-C method, etc. in pure C using the functions from the runtime.
jerius has joined #ruby
sayan has joined #ruby
_veer has quit [Ping timeout: 258 seconds]
mengu has quit [Ping timeout: 258 seconds]
fourq is now known as krylon
rubarLion has joined #ruby
arya has quit [Ping timeout: 248 seconds]
k610 has quit [Ping timeout: 240 seconds]
krylon is now known as fourq
hiyakashi has quit [Ping timeout: 246 seconds]
<lewix>
anybody played with rubymotion ?
_emptymag00 has joined #ruby
ryanjh has joined #ruby
finnomenon has joined #ruby
wmoxam has quit [Ping timeout: 264 seconds]
chrishough has joined #ruby
markalanevans has quit [Quit: markalanevans]
randomautomator has quit [Remote host closed the connection]
classix has quit [Ping timeout: 256 seconds]
randomautomator has joined #ruby
asm has joined #ruby
asm has left #ruby [#ruby]
pduin has quit [Remote host closed the connection]
akashj87 has quit [Ping timeout: 264 seconds]
motto has joined #ruby
arya has joined #ruby
rubarLion has quit [Ping timeout: 255 seconds]
timonv has quit [Remote host closed the connection]
tomzx_mac has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
cobragoat has joined #ruby
havenwood has joined #ruby
angusiguess has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
mpfundstein_ has quit [Remote host closed the connection]
<lewix>
why the extra step thing = '123'
nfisher has quit [Ping timeout: 256 seconds]
rubarLion has quit [Ping timeout: 256 seconds]
slash_nick has joined #ruby
<lewix>
09:53 peta_: is there a ruby'esque way for doing that
m8 has joined #ruby
devoper has quit [Ping timeout: 260 seconds]
beiter has joined #ruby
<lewix>
bean: one line was fine =)
apod has joined #ruby
royalty has quit [Quit: Leaving]
jerius has joined #ruby
browndawg has quit [Client Quit]
ndboost has quit [Remote host closed the connection]
motto has quit [Ping timeout: 255 seconds]
amh345 has joined #ruby
daed has quit [Ping timeout: 258 seconds]
mpfundstein has quit [Ping timeout: 258 seconds]
wallcloc_ has joined #ruby
doodlehaus has quit [Remote host closed the connection]
djwonk has quit []
browndawg has joined #ruby
<amh345>
hi everyone. i've upgraded my app recently to ruby 1.9.3 from 1.8.7. i've got pretty much everything done - except for one piece. i have a large csv i generate. im building it from an array.
<amh345>
in ruby 1.8.7 spacer = "\t" would give me a tab. but in ruby 1.9.3 "\t" renders as
<amh345>
\t
momomomomo has joined #ruby
wallclockbuilder has quit [Ping timeout: 260 seconds]
GrizBear has joined #ruby
nathancahill has joined #ruby
<lewix>
amh345: can you paste the code
<amh345>
it's 900 lines. is there anything specific you're looking for so i can pair it down?
<waxjar>
are you sure you're using double quotes amh345?
<momomomomo>
Afternoon all
momomomomo has quit [Killed (idoru (Spam is off topic on freenode.))]
<lewix>
amh345: "\t"
<amh345>
hi waxjar, im definitely using double quotes.
jdunck has joined #ruby
apok has quit [Quit: apok]
rippa has joined #ruby
<waxjar>
hmm, that's strange
<amh345>
\n also renders
<amh345>
as \n
<lewix>
amh345: what do you use to output
<amh345>
but i did just notice something in the csv file. the entire thing is wrapped in [ ]
zigomir has joined #ruby
<amh345>
lewix: im outting with Open3.popen3 and streaming to a gpg.
<lewix>
ok it's out of my league
zigomir has quit [Client Quit]
<lewix>
=)
ndboost has joined #ruby
rubarlio_ has joined #ruby
<amh345>
but. i did an unencrypted test with File.open("blah.csv","w") and same result.
sweeper has left #ruby [#ruby]
Will_Tampa has quit [Ping timeout: 260 seconds]
sam113101 has quit [Quit: WeeChat 0.4.0]
pigoz has quit [Quit: WeeChat 0.4.0-dev]
sam113101 has joined #ruby
<waxjar>
the \t's aren't in the csv file are they?
<amh345>
they are
<lewix>
amh345: do you use puts, p,pp ,print or write
<amh345>
the csv has no cols or rows. first field looks like ["a","\t","b","c","\t","\n"]
<waxjar>
ah, well there's your problem :P
browndawg has quit [Quit: Leaving.]
ndboost has quit [Read error: Connection reset by peer]
<waxjar>
my guess is that the CSV library you're using escapes \s.
<amh345>
im not using a csv library
browndawg has joined #ruby
skattyadz has quit [Quit: skattyadz]
girija_ has joined #ruby
EvanPurkhiser has joined #ruby
markalanevans has joined #ruby
Kirotan_ has joined #ruby
<amh345>
text_to_write = Array.new someresult.each do |val| text_to_write << val.something end
ndboost has joined #ruby
<amh345>
that's basically how it's contstructed.
<amh345>
only i have a few text_to_write << "\t"
twoism_ has joined #ruby
girija_ has quit [Read error: Connection reset by peer]
rubarlio_ has quit [Ping timeout: 264 seconds]
<EvanPurkhiser>
Can anyone tell me if this is dumb or if there's a better way to do this: https://gist.github.com/5272209 ? Im very new to ruby
banjara has joined #ruby
<amh345>
actuallyi stand corrected. it does put the values in the cols rows. it just doesnt pay attention to "\t" and
<amh345>
"\n"
rezzack has joined #ruby
mrsolo has joined #ruby
djwonk has joined #ruby
apod has quit []
icole has joined #ruby
GrizBear has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ruby
<waxjar>
amh345: what happens when you print the object with #inspect? if you get double \s, they're escaped somehow somewhere
mahmoudimus has joined #ruby
<lewix>
amh345: what method do you use to write the text_to_write
jonathanwallace has quit [Ping timeout: 240 seconds]
<amh345>
waxjar: inspect on the "/t" field outputs "\"\\t\""
frem has quit [Ping timeout: 255 seconds]
rubarlio_ has joined #ruby
Ripp__ has quit [Quit: Leaving]
<amh345>
first col value is also ["xyz, "\"\\t\"", "val","val1"]
doodlehaus has joined #ruby
<amh345>
that's what it looks like in an editor.
dmiller1 has joined #ruby
<amh345>
if i open the csv in office or something it looks like [xyz, \t, val,val1]
<apeiros_>
EvanPurkhiser: I would probably not subclass Array, I'd explicitly write out .add_error and .add_info and not use a construct like type.to_s.singularize.to_sym
<amh345>
brackets should not be there.
daed has joined #ruby
atno has quit [Remote host closed the connection]
<EvanPurkhiser>
apeiros_: Thanks, I suppose I was just trying to be clever ;)
<apeiros_>
EvanPurkhiser: I'd probably write add_error etc. as `def add_error(message); add(:error, message); end`
ndboost has quit [Remote host closed the connection]
<apeiros_>
i.e., have a generic #add which takes type & message
slainer__ has quit [Remote host closed the connection]
rubarlio_ has quit [Ping timeout: 264 seconds]
<waxjar>
i don't know amh345, that looks weird as hell. they're obviously being escaped somewhere but i can't tell you how and where without the relevant code
<amh345>
waxjar: for sure. im trying to scale the code way back to see if i can recreate the error. then ill post it to a gist.
newUser1234 has quit [Remote host closed the connection]
newUser1234 has joined #ruby
browndawg has quit [Quit: Leaving.]
arturaz has joined #ruby
browndawg has joined #ruby
dallasm_ has joined #ruby
ndboost has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
motto has joined #ruby
danman has joined #ruby
skattyadz has joined #ruby
newUser1234 has quit [Ping timeout: 240 seconds]
excalq has joined #ruby
rubarLion has joined #ruby
joofsh has joined #ruby
m8 has quit [Ping timeout: 264 seconds]
rubarLion has quit [Remote host closed the connection]
verysoftoiletppr has quit []
thebastl has quit [Remote host closed the connection]
Asher has quit [Read error: Connection reset by peer]
Tuxist has joined #ruby
Tuxist has quit [Read error: Connection reset by peer]
c0rn has joined #ruby
<excalq>
If I'm using File.read to read the next 100 bytes in a massive file, I hit a problem when that byte is in the middle of a UTF-8 character. Anyway to ensure that the read stops on a UTF-8 char boundary?
tspike has joined #ruby
Ontolog has joined #ruby
Ontolog has quit [Remote host closed the connection]
Ontolog has joined #ruby
choobie has quit [Ping timeout: 264 seconds]
browndawg has left #ruby [#ruby]
Mattix has joined #ruby
browndawg has joined #ruby
huismon is now known as nate_h
ericmathison has joined #ruby
breakingthings has quit []
kaerast has joined #ruby
marcdel has joined #ruby
chichou has quit [Remote host closed the connection]
<MrZYX>
amh345: drop line 13 and call file.write filecontents_arr.join("\n")
Mon_Ouie has quit [Ping timeout: 260 seconds]
motto has quit [Ping timeout: 260 seconds]
<havenwood>
excalq: Since a utf-8 char varies in size from 1 up to 6 bytes, hard to say! Can you read the next X chars instead of bytes?
ryanf has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<excalq>
@havenwood: That's what I'm wondering. That's exactly what I need
pskosinski has quit [Ping timeout: 258 seconds]
<excalq>
I think File.read and IO.read just do "bytes"
<rippa>
excalq: try gets
<amh345>
MrZYX: i get an error undefined method `write' for <Rake::FileTask => []>:Rake::FileTask (NoMethodError) because file hasnt been defined.
CamonZ has joined #ruby
<rippa>
gets(nil, 100)
<excalq>
@rippa, thanks, I'll try that
wallcloc_ has quit [Remote host closed the connection]
eldariof has joined #ruby
adambeynon has joined #ruby
sayan has quit [Ping timeout: 258 seconds]
mpfundstein has joined #ruby
<MrZYX>
amh345: then file is not a file object
ndboost has quit [Remote host closed the connection]
hmarr has joined #ruby
pioz_ has joined #ruby
<amh345>
maybe you meant line 15?
<amh345>
err 16
atno has quit [Remote host closed the connection]
<amh345>
oh.
<amh345>
hah
<MrZYX>
sure
choobie has joined #ruby
choobie has joined #ruby
choobie has quit [Changing host]
<amh345>
ok, MrZYX i see what you meant.
<amh345>
ok. i've done that. but the previous issues still appear.
<MrZYX>
you even still get the brackets?
elemongw has joined #ruby
mpfundstein_ has joined #ruby
<waxjar>
does People.csv_export(id) get you a regular Array?
pioz_ has quit [Client Quit]
djwonk has quit []
<waxjar>
because you're writing an Array to the file now. File#write will call #to_s on filecontents_arr, which will give you the brackets and all that
<amh345>
MrZYX: i did not. actually. it's a totally different layout now. everything appears in col a. and everything is in it's own line.
<amh345>
line = row
<MrZYX>
right
a_ has joined #ruby
<a_>
hi
pioz_ has joined #ruby
chandankumar has quit [Quit: Leaving]
pskosinski has joined #ruby
<amh345>
whats suppose to happen is each result in the array/hash should be in it's own row.
nano- has joined #ruby
<amh345>
waxjar: i will try what you mentioned.
<nano->
When writing C modules, is it possible to register a method with rb_define_method as deprecated?
<a_>
I have this expression len = d.each_byte.first.divmod(16) but sometime I get this error "NoMethodError undefined method `each_byte' for nil" I would like that in case of exception do a print
<waxjar>
amh345, why don't you use a CSV library though?
<a_>
can I add and rescue sentence there to do that? thank you
<waxjar>
seems a lot simpler
<amh345>
waxjar: i made this a long long time ago. and i really really dont want to have to rewrite the thing. it was a pain in the ass the first time getting it to format the way they wanted it.
angusiguess has quit [Ping timeout: 246 seconds]
<amh345>
the next time i make one- i will use a lib.
<nano->
or the conversion is just to emit a rb_warning ?
tvw has joined #ruby
atno has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
<amh345>
MrZYX: so your suggestion was close. but how to i keep each result iteration of the .each on it's own own row?
<waxjar>
amh345, try changing filecontents_arr to filecontents_arr.join, to turn it into a string.
joofsh has quit [Remote host closed the connection]
chrishough has joined #ruby
djwonk has joined #ruby
ndboost_ has joined #ruby
apok has joined #ruby
<waxjar>
you want to write a string to the file, not an array
dallasm_ has quit [Remote host closed the connection]
<amh345>
MrZYX: that worked. but i'd have to rewrite everything for that to function.
<amh345>
waxjar: trying your suggestion
<amh345>
btw, thanks for helping out guys. i really appreciate it.
<amh345>
waxjar: ok, that gave a positive result. but it omitted spacer = "\t"
<amh345>
aside from the missing space/tab. it formatted perfectly.
sambao21 has joined #ruby
apod has joined #ruby
nano- has left #ruby [#ruby]
jblack has quit [Read error: Connection reset by peer]
jim_r0x has joined #ruby
joofsh has joined #ruby
dmiller1 has quit [Ping timeout: 264 seconds]
benlieb has quit [Quit: benlieb]
lewix has quit [Remote host closed the connection]
browndawg has left #ruby [#ruby]
akemrir has quit [Quit: WeeChat 0.4.0]
joofsh has quit [Read error: Connection reset by peer]
brandon has joined #ruby
browndawg has joined #ruby
joofsh has joined #ruby
ndboost_ has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
Jonito has joined #ruby
<Jonito>
whois diegok
<Jonito>
help?
<Jonito>
?
<Jonito>
#whois
brianpWins has joined #ruby
gabito has joined #ruby
nfisher_ has joined #ruby
<havenwood>
Jonito: Diego Kuperman
ndboost_ has joined #ruby
lewix has joined #ruby
<lewix>
10:55 waxjar: because you're writing an Array to the file now. File#write will call #to_s on filecontents_arr, which will give you the brackets and all that. that's why i asked you that before amh345
JohnBat26 has joined #ruby
malkomalko has quit [Remote host closed the connection]
gabito has quit [Client Quit]
danman has quit [Quit: danman]
sambio has quit []
shock_one has joined #ruby
<lewix>
10:16 lewix: amh345: do you use puts, p,pp ,print or write
<amh345>
lewix: the brackets are no longer an issue. it's formatting correctly and "/n" is rendering fine. it's the "/t" that's being omitted now.
<amh345>
im using write
ndboost_ has quit [Remote host closed the connection]
slash_nick has quit [Quit: Lost terminal]
apod has quit []
davetherat has quit [Remote host closed the connection]
ndboost has joined #ruby
davetherat has joined #ruby
davetherat has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
davetherat has joined #ruby
ndboost has quit [Remote host closed the connection]
<tubbo>
shock_one: well, you really have to question *why* you need to reference a private method with `self.`, considering that the private method is always gonna be in the right scope for you to be able to drop the self.
<tubbo>
so if i'm in class Account and i have private;def some_method;end, i can just call some_method to call the method, i don't need self.some_method
<burgestrand>
shock_one: it’s not just about the self, you can’t call private methods with an explicit receiver at all (unless you use send).
<shock_one>
burgestrand, why?
<tubbo>
shock_one: C++ actually has private methods, iirc. ruby does not.
<burgestrand>
shock_one: it’s essentially the definition of private.
<Spooner>
shock_one: self is just an object reference, no different to any other, so it doesn't expose private methods. You can access protected methods this way, since any object of the same class can access those.
<tubbo>
ruby basically has a guideline and tries to make it a pain in the balls to call private methods
<shock_one>
Spooner, got it.
kristofers has joined #ruby
ndboost has quit [Ping timeout: 264 seconds]
geggam_wk has quit [Remote host closed the connection]
tspike has quit [Ping timeout: 260 seconds]
<tubbo>
but, since methods are just messages sent to the object, you can't really make a distinction between the two without violating one of the core constraints of ruby, imo
<shock_one>
Thank you. Minus one mystery in my life
<burgestrand>
shock_one: the one exception is when using setters.
<tubbo>
^^ this is all philosophy btw, it has no technical basis
<tubbo>
haha
chrishough has joined #ruby
mercwithamouth has quit [Ping timeout: 246 seconds]
<Spooner>
tubbo: ruby does have private, but it isn't exactly the same as C++ (neither is protected).
atno has joined #ruby
newUser1234 has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
newUser1234 has quit [Remote host closed the connection]
ritek has quit [Ping timeout: 260 seconds]
<tubbo>
Spooner: lies! ;)
<tubbo>
send(:my_private_method)
<banister`sleep>
ruby's private kinda sucks
<shock_one>
tubbo, you can call private method in c++ from the outside if you really want to.
<banister`sleep>
i want real private (read: uninherited) methods
newUser1234 has joined #ruby
<sepp2k>
banister`sleep: me too.
ndboost_ has quit [Ping timeout: 245 seconds]
<banister`sleep>
as a result we see people doing silly things like this __my_super_private_method__
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<waxjar>
Ruby's definition of private is a method that can't be called with an explicit receiver (including self)
<davesahil>
Spooner, when I do a bundle install, I get /usr/bin/env: ruby: No such file or directory
zyrex has quit [Quit: Leaving]
c0rn has quit [Quit: Computer has gone to sleep.]
<davesahil>
Spooner, I installed ruby 2.0.0 through rvm
sambao21 has quit [Quit: Computer has gone to sleep.]
<Spooner>
I can't help. I use rbenv and that was fine with 2.0.0
<havenwood>
davesahil: Are you using the latest RVM?: rvm get latest
<havenwood>
I use chruby. :P
jerius has quit [Quit: Computer has gone to sleep.]
<davesahil>
havenwood, I have rvm 1.19.0
maycon has quit [Quit: Saindo]
newUser1234 has quit [Ping timeout: 245 seconds]
<shock_one>
amh345, what if you try filecontents_arr << "val\t#{p.id}\n"
<havenwood>
Though I did see a tweet that RVM was considering a flag option to install Ruby with RVM but chruby for selecting.
newUser1234 has joined #ruby
<davesahil>
havenwood, Yes I installed ruby with rvm
tspike has joined #ruby
pitzips has joined #ruby
<havenwood>
davesahil: What do you get for?: rvm current
<havenwood>
Spooner: Why you no use chruby?! :P
swingha has joined #ruby
quietone has joined #ruby
<havenwood>
Shims... grumble, grumble.
doodlehaus has quit [Remote host closed the connection]
<Spooner>
havenwood: Because I had trouble with rvm and rvenv works fine. Why do I need chruby?
<davesahil>
havenwood, It returns ruby-2.0.0-p0
<havenwood>
Spooner: Ahh. Was just curious if you are pro-shim (versus pro-env) or if rbenv just worked so no need to switch.
<amh345>
shock_one: that didnt write the tab either. the other thing is im trying to change the way it appends these values because this is part of a much much larger compplicated file.
adamjleonard has quit [Quit: Leaving...]
<havenwood>
davesahil: gem -v
<davesahil>
havenwood, 2.0.3
<havenwood>
davesahil: welp, latest on all accounts
<Spooner>
havenwood: Couldn't care less if it works for me ;)
<havenwood>
Spooner: Yeah, seems people mostly switch if they run into shim problems.
<havenwood>
No problem, no problem.
Nisstyre-laptop has joined #ruby
<banister`sleep>
chruby went better with my new hairstyle
sambao21 has joined #ruby
<Spooner>
Fair enough.
<havenwood>
banister`sleep: Yeah, then I got a sunburn between my corn rows!
<shock_one>
amh345, I would check if you can just print tab correctly. Like puts "\t"
divout has quit [Quit: Leaving.]
ritek has joined #ruby
<havenwood>
davesahil: Might try #rvm.
<quietone>
HI, I get "in `binread': undefined method" using chef. I don't know ruby and my searches haven't helped. Is there a simple fix? debian wheezy
<havenwood>
banister`sleep: I actually like having corn rows, very effective hair management. I just afraid I look silly.
<amh345>
thanks shock_one. ill keep your example handy. and if all else fails and i have to write this 900 lines. ill use what you wrote. or just use a csv lib.
<Spooner>
amh345: The csv standard lib works fine with tabs.
<shock_one>
amh345, keep in mind, I didn't test it.
<amh345>
puts "/t" is throwing errors.
<amh345>
unless you meant test it in console.
<shock_one>
amh345, File.open with block is very useful — you don't have to close the file explicitly.
alex__c2022 has quit [Quit: alex__c2022]
<Spooner>
amh345: It is "\t"
<amh345>
Spooner: yeah. it does. i just had such a hard time writing this csv file in the first place. the format and structure of the data is a horrible mess. so rewriting it is a daunting task and will take me a couple of days. this is why im so deperate to figure out why i cant get it to work. i had this functioning fine in ruby 1.8
doodlehaus has joined #ruby
dmiller1 has quit [Ping timeout: 246 seconds]
sepp2k has quit [Quit: Leaving.]
<amh345>
soory, i meant that. filecontents_arr << puts ("\t") >> expecting keyword_do or '{' or '(' (SyntaxError) ..
doodlehaus has quit [Remote host closed the connection]
nothingism28 has quit [Ping timeout: 245 seconds]
slainer68 has joined #ruby
<Spooner>
Don't leave a space from method to (
Asher has joined #ruby
davesahil has left #ruby ["Leaving"]
ebobby has joined #ruby
<amh345>
oh. heh. ok. well in console it spit out a bunch of blank lines. but in the csv itself it's removed all colums. rows are intact though
doodlehaus has joined #ruby
dmiller1 has joined #ruby
alex__c2022 has joined #ruby
adamjleonard has joined #ruby
ndch has joined #ruby
webwarlock has quit [Ping timeout: 245 seconds]
razibog has quit [Ping timeout: 240 seconds]
tewlz has quit [Quit: Lost terminal]
mityaz has joined #ruby
colonolGron has joined #ruby
alex__c2022 has quit [Ping timeout: 240 seconds]
oracon75 has joined #ruby
anirudh24seven has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307122853]]
artm has joined #ruby
klaas has joined #ruby
artm_ has joined #ruby
artm_ has quit [Client Quit]
bubblehead has quit [Remote host closed the connection]
jribar has joined #ruby
shock_one has quit [Ping timeout: 260 seconds]
sheerun has joined #ruby
jribar has quit [Remote host closed the connection]
a_a_g has joined #ruby
<sam113101>
is there some kind of ruby lib that would act as a dictionary, telling me if a certain word is a verb or a noun?
nathancahill has quit [Quit: nathancahill]
<amh345>
ok. so this worked for creating a tab. spacer = "\t" filecontents_arr << spacer filecontents_arr << " " filecontents_arr << spacer
<jnoob22>
With 'logger' I have many different logger.* statements of differing severity. How do I universally set this within my app to say only show WARN and higher, regardless if I have a logger.info 'blah' or logger.debug 'blah' ?
kpshek has quit []
baba has quit [Ping timeout: 246 seconds]
sonda has quit [Remote host closed the connection]
<jnoob22>
<facepalm> crud i see it. the yellow highlighting of find-> "level" blocked it out :-\
toekutr has joined #ruby
artm has quit [Remote host closed the connection]
<waxjar>
pro tip: log with blocks (e.g. error { "your message" }), it'll speed up your app in production because the Strings for debug (and maybe info) messages won't have to be instantiated first :D
<apeiros_>
if it's a plain string, I doubt that creating a block will be faster
<waxjar>
read an article on it once, the author reported pretty big improvements
<apeiros_>
with constructed strings maybe
<apeiros_>
i.e. strings which required logic
<apeiros_>
but a plain string - I doubt that
<apeiros_>
but playing anno 2070 ATM, so won't write a benchmark :-p
Zai00 has quit [Ping timeout: 260 seconds]
etcetera has joined #ruby
<sam113101>
is there some kind of ruby lib that would act as a dictionary, telling me if a certain word is a verb or a noun?
doodlehaus has quit [Remote host closed the connection]
reactormonk has quit [Ping timeout: 264 seconds]
geekbri has joined #ruby
oracon75 has quit [Quit: oracon75]
<A124>
sam113101: I don't think so.. but I can make one. But you should be sure if it's the right thing to do
<A124>
Yeah creating a block creates bout 0.15% which .. nvm. that std
arietis has joined #ruby
<sam113101>
I'm trying to build some AI and I need that
geekbri has quit [Remote host closed the connection]
<A124>
sam113101: If you stop by in few days. or.. write me PM (as I don't sit actively on channels all time), I could manage that.
<A124>
Also some words could be both.. what then?
catalyst40 has joined #ruby
sepp2k has joined #ruby
<A124>
Also noun and verb, etc word type is lexical analysis, so you might find something under that term
hadees has quit [Quit: hadees]
<sam113101>
actually, for now, I just need to know if a word is a noun or verb, doesn't matter which one (for now)
peta_ has joined #ruby
baba has joined #ruby
heliumsocket has joined #ruby
timonv has quit [Remote host closed the connection]
<A124>
sam113101: Then maybe.. give a bogus random value for now?
jmeeuwen has quit [Ping timeout: 264 seconds]
yacks has quit [Quit: Leaving]
nomenkun has joined #ruby
thebastl has joined #ruby
sambio has quit []
<apeiros_>
waxjar: if you'd actually read what he writes, then you'd see that he says exactly the same as I do
<waxjar>
true
russfran1 is now known as russfrank
ananthakumaran has quit [Quit: Leaving.]
doodlehaus has joined #ruby
jmeeuwen has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
rads has joined #ruby
faen has quit [Remote host closed the connection]
swex has joined #ruby
ndch has quit [Remote host closed the connection]
Morkel has quit [Ping timeout: 257 seconds]
mattbl has joined #ruby
Morkel has joined #ruby
Xeago has quit [Remote host closed the connection]
mrsolo has quit [Quit: This computer has gone to sleep]
burgestrand has quit [Quit: Leaving.]
swex_ has quit [Ping timeout: 264 seconds]
kpshek has joined #ruby
mrsolo has joined #ruby
brianpWins has quit [Quit: brianpWins]
tjbiddle has joined #ruby
ebobby has left #ruby [#ruby]
zigomir has joined #ruby
lkba has joined #ruby
<tjbiddle>
hey guys - would this be considered bad practice on a CLI app? it's placed in the very top level class that calls anything else: http://pastie.org/7165765
jblack has joined #ruby
<jblack>
Hi. How do I figure out what gem I have to require in order to use another gem that requires 'AC# 110-001-4677645
<jblack>
Hi. How do I figure out what gem I have to require in order to use another gem that requires 'require_library_or_gem '
<jblack>
my hunch is that it's rails'ish
c0rn has joined #ruby
etcetera has quit [Read error: Connection reset by peer]
huttan has joined #ruby
dmiller1 has quit [Ping timeout: 264 seconds]
Hanmac1 has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
<tjbiddle>
jblack: Can you rephrase that?
Hanmac has quit [Ping timeout: 258 seconds]
<tjbiddle>
Don't quite understand your question
krawchyk has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
Hanmac has joined #ruby
<Spooner>
tjbiddle: use logger or log4r rather than doing that.
jpfuentes2 has joined #ruby
<bakingbread>
tjbiddle: I think you meant `raise e` there
<tjbiddle>
Spooner: Noted. Was more pointing out the pokemon exception though
quietone has left #ruby ["Leaving"]
jpfuentes2 has quit [Client Quit]
<tjbiddle>
bakingbread: raise should re-raise it afaik
<tjbiddle>
Without the e
<tjbiddle>
Will test though, sec.
<bakingbread>
tjbiddle: maybe didn't know it
Hanmac1 has quit [Ping timeout: 260 seconds]
<jblack>
Well, I'm trying to use ODBC with active record without rails. When activerecord implicitely includes the odbc gem, that gem complains "/var/lib/gems/1.9.1/gems/activerecord-odbc-adapter-2.0/lib/active_record/connection_adapters/odbc_adapter.rb:30:in `<top (required)>': undefined method `require_library_or_gem' for main:Object (NoMethodError)
<bakingbread>
tjbiddle: and why do you need both .downcase and ~= /true/ but that's just small things, of course
etcetera has joined #ruby
<Spooner>
bakingbread: It would only be redundant if it was /true/i
Yakko has joined #ruby
<Spooner>
Still, can't see a reason not to just do .downcase == "true"
buibex has joined #ruby
sambao21 has joined #ruby
<tjbiddle>
bakingbread: doesn't /somestring/ match it exactly? My regex-foo is terrible.
<bakingbread>
Spooner: that what I meant. either ..to_s.downcase == 'true' or ...to_s ~= /true/i
<tjbiddle>
Spooner: Lmao, good point.
<Spooner>
tjbiddle: /dfd/ is case-dependent, but also only matches anywhere in the string (so "pietruelephant" would matcfh too).
Mon_Ouie has quit [Quit: WeeChat 0.4.0]
Hanmac1 has joined #ruby
<Spooner>
~= /\Atrue\Z/i would be the equivalent (of downcase == "true")
<bakingbread>
Spooner: yes I got it
jblack has quit [Ping timeout: 260 seconds]
ibash has joined #ruby
sethetter has quit [Quit: leaving]
d2dchat has quit [Remote host closed the connection]
<Spooner>
bakingbread: Sorry, I'm bored at the moment, so I thought I;d labour the point ;)
stevechiagozie has joined #ruby
jblack has joined #ruby
<jblack>
sorry. apparently I lost my connection.
Hanmac has quit [Ping timeout: 252 seconds]
rippa has quit [Ping timeout: 240 seconds]
<bakingbread>
Spooner: no it's ok :-D
<bakingbread>
Spooner: also wee have .casecmp
<shevy>
what is .casecmp?
alainus has joined #ruby
<bakingbread>
it compares strings regardless of the case and returns 0 if equal
Gowie has joined #ruby
<Spooner>
bakingbread: Didn't know that one.
<alainus>
is there something like "with line_item.buyable as |item| do .. end" so i can later just do item.attribute ? or better just "attribute" ?
<Spooner>
And -1 on fail. How horribly unrubyish ;(
constant has joined #ruby
<bakingbread>
Spooner: perlish
<constant>
is there any way to teach "bundle" to use "su" and *not* "sudo" ?
daed has joined #ruby
etcetera has quit []
dangerousdave has quit [Read error: Connection reset by peer]
<Gowie>
Any suggestions for books on ruby for an intermediate ruby programmer?
<bakingbread>
Spooner: it also returns 1. and it's fast
<Spooner>
bakingbread: If you prefer fast over nice, you are in the wrong place with Ruby ;)
jamie_ca_ has quit []
freerobby has quit [Quit: Leaving.]
jamie_ca_ has joined #ruby
sethetter has joined #ruby
<bakingbread>
Spooner: wrong I can inject String with method which uses casecmp and I'll have both nice and fast :)
<apeiros_>
Spooner: cmp returns -1 when lhs is smaller
<Spooner>
WEll, yeah, you could wrap it...
<apeiros_>
it returns 1 when lhs is bigger
<apeiros_>
and nil on fail
<apeiros_>
and that's true for <=> too, so nothing "unrubyish" about it
<alainus>
how can i do: with class.subclass.method as |item| do ... do stuff with item.attributes ... end ? what's the correct syntax for that ?
<Spooner>
Well, that is something that needs 3 results. 0 and -1 isn't really the same.situation.
<Spooner>
0 and nil would make a lot more snese.
<apeiros_>
wth are you talking about?
<shevy>
about swiss chocolate!
<apeiros_>
a cmp has 4 possible results. if you want 2, it's not a cmp.
<Spooner>
OH, no, ignore me. Yeah, it is the same thing.
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ruby
<apeiros_>
alainus: huh?
freerobby has joined #ruby
<Spooner>
alainus: Yeah, tell us what you want to achieve, not give us the code that doesn't work.
<apeiros_>
alainus: it's `do |item| … end`
backjlack has quit [Ping timeout: 255 seconds]
dmiller1 has joined #ruby
<apeiros_>
your `|item| do … end` is invalid syntax
doodlehaus has quit [Remote host closed the connection]
<apeiros_>
also no idea what exactly your problem is. syntax? getting a class' subclass? understanding what Object#method does? how to use blocks?
kpshek has quit []
niklasb_ has joined #ruby
<alainus>
apeiros_, Spooner I know it's invalid. I'm looking for a way to do that, and I'm trying to explain what I want to achieve using what I wrote. Basically I want to name an object as "item" and then use it for a block
<alainus>
*on a block, sorry
dhruvasagar has joined #ruby
<bakingbread>
alainus: oh you mean like in Python?
silky__ has quit [Quit: Leaving]
<jblack>
I may have missed the answer. I'm trying to use activerecord with odbc, but the odbc gem is complaining " undefined method `require_library_or_gem'". It looks like that method is in active_support, but including it didn't fix the problem. I don't know what to try next
malcolmva has joined #ruby
<alainus>
bakingbread, I wouldn't know, but I have a long object, and I was wondering if I could shorten it for simplicity's sake
<jblack>
I'm trying to use activerecord outside of rails.
<bakingbread>
that would be exactly like Python. but usually one doesn't need it
<apeiros_>
bakingbread: I fail to see the point. just do x = very_long_name, and enjoy the show… though I think very_long_name would be better (hey, we've autocompleting editors nowadays, it's not hard, really…)
rippa has quit [Ping timeout: 240 seconds]
Yakko is now known as |ko
wargasm has left #ruby [#ruby]
forced_request has joined #ruby
<bakingbread>
apeiros_: the point is...
peta_ has quit [Quit: peta_]
<bakingbread>
>> original = {val: 42}; x = original; x[:val] -1; p original[:val]
casheew has quit [Read error: Connection reset by peer]
<MrZYX>
read the changelog
thebastl has quit [Remote host closed the connection]
digital-ghost has joined #ruby
indigenous has quit [Changing host]
indigenous has joined #ruby
Gowie has quit [Ping timeout: 245 seconds]
faen has joined #ruby
casheew has joined #ruby
Petru has joined #ruby
Petru has quit [Changing host]
Petru has joined #ruby
<pmros>
I got it! Thank you, MrZYX!
<digital-ghost>
Ruby noob here, looking to dynamically list Mon-Sun, in an html table row, but I need the days to shift by 1 each day to stay in sync with the current day.
<heftig>
digital-ghost: #ror
<digital-ghost>
Can anyone point me in the right direction? I keep searching on the topic but apparently failing my googlefoo.
<Petru>
Hi. Ruby beginner here. If the only thing I have in a file is 'require <some gem name>' and when I run it it complains about 'uninitialized constant bla bla bla', is it my fault or is the gem broken?
<digital-ghost>
heftig, even if I'm not using rails?
endzyme has quit [Ping timeout: 264 seconds]
jackjackdrpr has joined #ruby
<heftig>
you didn't specify what you're using
<heftig>
specifically, what's used for the output (the templating engine)
casheew has quit [Read error: Connection reset by peer]
danneu has quit [Ping timeout: 245 seconds]
<digital-ghost>
heftig, I'm just trying to learn Ruby at the moment. running a script through sinatra to display it in a browser
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
backjlack has joined #ruby
agarie has joined #ruby
shinobi_one has left #ruby [#ruby]
casheew has quit [Read error: Connection reset by peer]
Alc has quit [Quit: Alc]
xibalba has quit [Changing host]
xibalba has joined #ruby
etcetera has joined #ruby
bean has joined #ruby
_bart has joined #ruby
sethetter has quit [Quit: leaving]
mattbl has quit [Quit: This computer has gone to sleep]
<digital-ghost>
waxjar, I wish I knew what I was looking for :-P
casheew has joined #ruby
danneu has joined #ruby
ToApolytoXaos has quit [Quit: Leaving]
breakingthings has quit []
casheew has quit [Read error: Connection reset by peer]
speakingcode-wor has quit [Remote host closed the connection]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
casheew has joined #ruby
skattyadz has quit [Quit: skattyadz]
yfeldblum has joined #ruby
mikurubeam has quit [Quit: +1 (Yes). -1 (No). i (What I have been trying to tell you all along).]
_nitti has quit [Remote host closed the connection]
bzprod_ has quit [Read error: Connection reset by peer]
mikurubeam has joined #ruby
Guest91682 has quit [Changing host]
Guest91682 has joined #ruby
Guest91682 has joined #ruby
bzprod has joined #ruby
nfisher_ has quit [Ping timeout: 245 seconds]
Guest91682 is now known as Boohbah
<waxjar>
Date.today gets you the current day, you can just do date + x to get a date object for x days later. You can get it's weekday with #wday and turn it into a string with Date::DAYNAMES[the weekday number] :)
lewix has quit [Remote host closed the connection]
<waxjar>
happy puzzling :D
hmarr has quit []
casheew has quit [Read error: Connection reset by peer]