<rking>
seoaqua: If you're starting from scratch youll definitely want to use the latest stuff. E.g. RSPec, probably Guard, etc.
<erikh>
zzak: neat
postmodern has joined #ruby-lang
brunocoelho has joined #ruby-lang
<seoaqua>
rking, ok i'll look into them
<erikh>
seoaqua: yes, that'll take you right to the source code
<erikh>
you can read it.
<erikh>
mechanize probably uses hoe anyhow
<erikh>
given the author(s)
<seoaqua>
erikh, got it:)
woollyam_ has quit [Quit: Computer has gone to sleep.]
Z33K|Lux has joined #ruby-lang
woollyams has joined #ruby-lang
<seoaqua>
rking, is RSPec better than minitest?
<rking>
seoaqua: Hrm.
<erikh>
it's a preference thing.
<erikh>
minitest is quite a bit faster but if you like how rspec works that's no reason to choose one over the other.
<rking>
Yeah, I mean it depends on your values.
<rking>
I like for things to be specified once and only once while being maximally simple, and RSpec is the most direct way to do that AFAIK.
<seoaqua>
ok :)
<seoaqua>
and what does Guard do? i'm confused by the official description
<rking>
It watches your files for changes then automatically runs the tests.
postmodern has quit [Quit: Leaving]
<rking>
I uses inotify so it's instantaneous, plus it's smart. E.g. you set a mapping, "files of this name belong to that test", and then if either the code or the test changes, the corresponding test is run.
<rking>
Then if it passes it goes ahead and runs the whole test suite.
S2kx has joined #ruby-lang
<seoaqua>
rking, its an alternative to rspec?
<rking>
No, it works with RSPec or whatever other testing tools you have.
<rking>
It's basically a "when this file changes do that".
<seoaqua>
cool
<rking>
And you can define the "this file" and the "that" to be anything.
<rking>
Actually if you install the inotify tools you can do your own stuff with inotifywait and inotifywatch. Its very simple.
postmodern has joined #ruby-lang
S1kx has quit [Ping timeout: 252 seconds]
<seoaqua>
these stuff blow my mind
A124 has quit [Read error: No route to host]
<seoaqua>
maybe not the right word
A124 has joined #ruby-lang
<seoaqua>
so interesting
<rking>
seoaqua: Oh, actually - MiniTest now has minitest/spec, which looks to do most of what I liked from RSpec.
Hakon|mbp has joined #ruby-lang
ryanf has joined #ruby-lang
Hakon|mbp has quit [Client Quit]
knu has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
shtirlic has quit [Read error: Connection reset by peer]
kvirani has quit [Remote host closed the connection]
igotnolegs has joined #ruby-lang
fayimora has quit [Quit: Be back in a gifii]
<crankharder>
petercooper: ty
brushbox has quit [Quit: Leaving.]
zachs has quit []
zeba has quit [Remote host closed the connection]
brunocoelho has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
perryh_away is now known as perryh
shevy has quit [Ping timeout: 244 seconds]
replore has joined #ruby-lang
postmodern has quit [Quit: Leaving]
jperry2 has quit [Quit: Leaving.]
shevy has joined #ruby-lang
brushbox has joined #ruby-lang
dfr|mac has joined #ruby-lang
mistym has quit [Remote host closed the connection]
dfr|mac has quit [Ping timeout: 245 seconds]
andrewhl has joined #ruby-lang
naz has quit [Ping timeout: 248 seconds]
n01z has joined #ruby-lang
brushbox has quit [Read error: Connection reset by peer]
brushbox has joined #ruby-lang
n01z has left #ruby-lang ["ERC Version 5.3 (IRC client for Emacs)"]
shtirlic_ has joined #ruby-lang
tdmackey has quit [Ping timeout: 245 seconds]
shtirlic has quit [Ping timeout: 244 seconds]
yannis has joined #ruby-lang
naz has joined #ruby-lang
tonesfrommars has joined #ruby-lang
ryez has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
wasnotrice is now known as zz_wasnotrice
Okasu has left #ruby-lang [#ruby-lang]
mistym has joined #ruby-lang
Facefox has quit [Ping timeout: 240 seconds]
bglusman has quit [Ping timeout: 245 seconds]
chessguy has joined #ruby-lang
ryanf has quit [Quit: leaving]
bglusman has joined #ruby-lang
Facefox has joined #ruby-lang
ryanf has joined #ruby-lang
ryanf has quit [Remote host closed the connection]
srbartlett has quit [Remote host closed the connection]
major_majors has quit [Read error: Operation timed out]
srbartlett has joined #ruby-lang
<crankharder>
i gave POW a shot today, decided to uninstall it, and now i'm pretty sure it's still conflicting with localhost:80 somehow. anyone know what server, or thing it installs and binds 80? i dont see thin/nginx/apache running on the syste
nazty has joined #ruby-lang
WillMarshall has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
brushbox has joined #ruby-lang
WillMarshall has quit [Quit: Computer has gone to sleep.]
major_majors has joined #ruby-lang
brushbox has quit [Client Quit]
akira989 has joined #ruby-lang
dasibre has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
yannis has quit [Read error: Connection timed out]
yannis has joined #ruby-lang
TheHunter_1039 has quit [Quit: TheHunter_1039]
Karmaon has joined #ruby-lang
postmodern has quit [Quit: Leaving]
postmodern has joined #ruby-lang
savage- has joined #ruby-lang
brushbox has joined #ruby-lang
zeba has joined #ruby-lang
macmartine has quit [Quit: macmartine]
Karmaon has left #ruby-lang ["WeeChat 0.3.8-rc2"]
yannis has quit [Read error: Connection timed out]
yannis has joined #ruby-lang
Jade has quit [Read error: Connection reset by peer]
zz_wasnotrice is now known as wasnotrice
ryanf has joined #ruby-lang
countdigi has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
yannis has quit [Read error: Connection timed out]
jtoy has joined #ruby-lang
somethinYellow has quit [Quit: Computer has gone to sleep]
macmartine has joined #ruby-lang
jtoy has quit [Client Quit]
macmartine has quit [Client Quit]
<yfeldblum>
crankharder, pow is a nodejs app written in coffeescript, and has an internal http server that proxies to your rack apps and an internal dns server, and does not need apache/nginx/etc
jtoy has joined #ruby-lang
macmartine has joined #ruby-lang
jtoy has quit [Quit: jtoy]
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby-lang
bglusman has quit [Read error: Connection reset by peer]
bglusman has joined #ruby-lang
ramonmaruko has quit [Read error: Connection reset by peer]
deryl has quit [Quit: Time To Go, So Sad!]
ramonmaruko has joined #ruby-lang
deryldoucette has joined #ruby-lang
deryldoucette has quit [Client Quit]
deryldoucette has joined #ruby-lang
deryldoucette is now known as deryl
uc has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
rippa has joined #ruby-lang
ramonmaruko has quit [Remote host closed the connection]
gnufied has quit [Read error: Connection reset by peer]
<bnagy>
would it be possible to modify an xml doc with nokogiri, if it's large? I'm using the stream parser at the moment...
<bnagy>
And I'd like to delete nodes
charliesome has joined #ruby-lang
<rue>
Well, you need to write the doc back
Mchl has quit [Ping timeout: 252 seconds]
<bnagy>
does that mean I need to put all those stupid whitespace nodes back? :<
<rue>
Not if they’re not significant
woollyams has joined #ruby-lang
gsav has joined #ruby-lang
<bnagy>
they appear to be TYPE_SIGNIFICANT_WHITESPACE :/
DMKE has joined #ruby-lang
DMKE has quit [Changing host]
DMKE has joined #ruby-lang
jxie has joined #ruby-lang
<bnagy>
so I basically need to write an xml emitter?
Mchl has joined #ruby-lang
replore has quit [Remote host closed the connection]
<heftig>
bnagy: "If a DTD or Schema declares an element to contain only child element nodes and not text nodes, then a validating XML parser can safely throw away the white space between elements."
<heftig>
so if you use a dtd or schema, maybe your parser will be smart enough to ignore the whitespace
<bnagy>
heftig: ok, that's one bit of good news
<heftig>
(as it will make those nodes insignificant)
<shevy>
mhmmm
<shevy>
XML
<bnagy>
yeah, it's horrible
<bnagy>
parsing it was going to be super easy - then I found some text nodes that got split across two nodes, for no apparent reason
<bnagy>
so a <value> element would contain 2 text nodes then a </value>
<bnagy>
sorry <string> nodes, not text nodes
<bnagy>
xml jargon :S
postmodern has quit [Quit: Leaving]
toretore has joined #ruby-lang
Guest85656 has joined #ruby-lang
neoesque has quit [Quit: Bye!]
tRAS has quit [Ping timeout: 244 seconds]
kaiwren has quit [Ping timeout: 245 seconds]
srbartlett has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
kaiwren has joined #ruby-lang
cantonic_ has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
TheHunter_1039 has joined #ruby-lang
woollyams has quit [Ping timeout: 256 seconds]
tRAS has joined #ruby-lang
tjadc has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
woollyams has joined #ruby-lang
Defusal has quit [Read error: Connection reset by peer]
tomb_ has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has quit [Changing host]
Defusal has joined #ruby-lang
Facefox has quit [Ping timeout: 244 seconds]
ttilley has quit [Read error: Connection reset by peer]
ttilley has joined #ruby-lang
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
Facefox has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
dRbiG has quit [Ping timeout: 260 seconds]
uc has quit [Remote host closed the connection]
zmack has quit [Remote host closed the connection]
cantonic has quit [Remote host closed the connection]
tomzx has joined #ruby-lang
cantonic has joined #ruby-lang
ttilley has quit [Remote host closed the connection]
jxie has quit [Ping timeout: 240 seconds]
tomzx has quit [Ping timeout: 260 seconds]
dc5ala has quit [Quit: Ex-Chat]
geekfactor has quit [Remote host closed the connection]
Kellin has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
dv310p3r has joined #ruby-lang
M4g1c5t0rM has joined #ruby-lang
jxie has joined #ruby-lang
M4g1c5t0rM has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<zzak>
good morning!
mortice has quit [Quit: leaving]
mortice has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
dejongge has quit [Quit: Leaving.]
<erikh>
yo
ttilley has quit [Remote host closed the connection]
Fullmoon has quit [Ping timeout: 245 seconds]
dalekurt has joined #ruby-lang
<shevy>
hmm I am playing with threads
<shevy>
right now I store the threads in an array
<shevy>
then, via pp, the output is like so:
carloslopes has joined #ruby-lang
<shevy>
[#<Thread:0x7f8ef6f29b80 dead>]
<shevy>
or, if it seems to be inactive:
<shevy>
[#<Thread:0x7f8ef6f29b80 sleep>]
<shevy>
is there any other state that a thread could have? reason I ask is that I want to store the threads in some yaml file or somewhere else
<shevy>
and then restore them
<shevy>
(but only those that are sleeping, not the dead ones)
<matti>
Hi shevy
<shevy>
hi matti
<matti>
shevy: I am certain you cannot serialise threads.
<shevy>
hmm damn :(
M4g1c5t0rM has joined #ruby-lang
hynkle has joined #ruby-lang
imajes has quit [Excess Flood]
wallerdev has joined #ruby-lang
imajes has joined #ruby-lang
Zenigor has joined #ruby-lang
Axsuul has quit [Ping timeout: 244 seconds]
joshcheek has quit [Quit: joshcheek]
jbsan has quit [Quit: jbsan]
elux has joined #ruby-lang
gregf has joined #ruby-lang
Jake232 has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
any-key has joined #ruby-lang
gsav has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
<rue>
Correct
wasnotrice is now known as zz_wasnotrice
<shevy>
hmm hmm hmm
<shevy>
what if I have ... a code block
<shevy>
{ sleep 20; puts 'This is a test.' }
<shevy>
perhaps in a yaml file
<shevy>
I could capture that, and put it inside a Thread.new ?
<bnagy>
yeah, but you'll need to have your proc as a string and eval it
<bnagy>
procs don't serialize either
<shevy>
oh dear
<shevy>
eval gives me nightmares :(
setmeaway has quit [Read error: Connection reset by peer]
setmeaway has joined #ruby-lang
<zzak>
why do you want to store them?
<lianj>
just monday insanity
krohrbaugh has joined #ruby-lang
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
ttilley has joined #ruby-lang
ttilley has joined #ruby-lang
bglusman has joined #ruby-lang
<shevy>
zzak so that a reboot doesnt kill them for example
<zzak>
i would suggest a job queue then, like resque
Aphelion has joined #ruby-lang
ttilley has quit [Read error: Connection reset by peer]
Aphelion has joined #ruby-lang
Aphelion has quit [Changing host]
jumpei_i has joined #ruby-lang
mistym_ has joined #ruby-lang
bryancp has joined #ruby-lang
setmeaway has quit [Read error: Connection reset by peer]
<kalleth>
shevy: eval gives everyone nightmares
JohnBat26 has quit [Ping timeout: 252 seconds]
tubbo`wknd has quit [Remote host closed the connection]
andrewhl has joined #ruby-lang
Aphelion is now known as ttilley
jumpei_i has quit [Ping timeout: 252 seconds]
kaiwren_ has joined #ruby-lang
kaiwren has quit [Ping timeout: 248 seconds]
kaiwren_ is now known as kaiwren
mytrile has quit [Remote host closed the connection]
tRAS has quit [Ping timeout: 265 seconds]
akira989 has joined #ruby-lang
Zenigor has left #ruby-lang [#ruby-lang]
Raduwen has joined #ruby-lang
setmeaway has joined #ruby-lang
arooni-mobile has joined #ruby-lang
gregf has quit [Quit: WeeChat 0.3.8]
tubbo has joined #ruby-lang
mistym has quit [Remote host closed the connection]
savage- has joined #ruby-lang
Jake232 has quit [Quit: Computer has gone to sleep.]
krohrbaugh1 has quit [Read error: Connection reset by peer]
mistym_ has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
tRAS has joined #ruby-lang
joast has quit [Quit: Leaving.]
vaelen has joined #ruby-lang
krohrbaugh has joined #ruby-lang
jxie has quit [Ping timeout: 244 seconds]
M4g1c5t0rM has quit [Read error: Connection reset by peer]
imajes has quit [Excess Flood]
wallerdev has quit [Quit: wallerdev]
imajes has joined #ruby-lang
rippa has joined #ruby-lang
M4g1c5t0rM has joined #ruby-lang
beiter has joined #ruby-lang
<rue>
It’s probably better to have a queue with some type of a confirmation that a job’s been finished
kaiwren has quit [Quit: kaiwren]
quatauta has joined #ruby-lang
tcopp has joined #ruby-lang
M4g1c5t0rM has quit [Read error: Connection reset by peer]
outoftime has joined #ruby-lang
schroedinbug has quit [Read error: Operation timed out]
quatauta_ has joined #ruby-lang
quatauta has quit [Client Quit]
quatauta_ has quit [Read error: Connection reset by peer]
mikkelb has joined #ruby-lang
<mikkelb>
Hey!
M4g1c5t0rM has joined #ruby-lang
<mikkelb>
I just did gem install nokogiri and it seemed to install just fine. Yet I'm getting in `require': no such file to load -- nokogiri (LoadError), what's up with that?
krohrbaugh has quit [Read error: Connection reset by peer]
Codif has quit [Remote host closed the connection]
dr_bob has joined #ruby-lang
<Defusal>
shevy, that doesnt look very nice, maybe if you explain exactly what you'd like to do someone can give you a better solution
zmack has quit [Remote host closed the connection]
Lee_A has joined #ruby-lang
<shevy>
Defusal given a piece of ruby code inside {} like 'sleep 5;puts "hi"', stored in yaml, then loaded and given to Thread.new
<Defusal>
does anyone know of a better way of settings the arity of a proc other than using eval to dynamically create a proxy proc that has n arguments?
<Defusal>
setting*
<Defusal>
shevy, code should not be stored in yaml
<Defusal>
rather store configuration and have the code use it
<shevy>
ok so there is no way without eval in this situation
tRAS has joined #ruby-lang
bfreeman has joined #ruby-lang
<shevy>
hmm actually
kristofferrr has joined #ruby-lang
<Defusal>
shevy, there is... don't store code in config files
butchanton has quit [Quit: Leaving.]
<shevy>
yeah, you have no solution to the problem at hand, I already understood that
<Defusal>
using eval is the only way to evaluate text as code
<Defusal>
i already gave you a solution
<shevy>
well, I could wrap it into a method
<shevy>
you said "dont do that"
<Defusal>
store the configuration you need, not the code
<shevy>
that is not a solution, that is a workaround over a "it is not possible"
<Defusal>
ok, i give up.
<shevy>
yup. you made it clear - it is not possible to store code, and have it run again, without eval. We agree on that already.
joshcheek has joined #ruby-lang
<Defusal>
if someone feels up to talking some sense into this guy, feel free, but clearly whatever i say goes in one ear and out the other
<Defusal>
lunch time
butchanton has joined #ruby-lang
carloslopes has joined #ruby-lang
qwerxy has quit [Quit: Computer has gone to sleep.]
flak has joined #ruby-lang
flak is now known as Guest44443
<shevy>
Defusal since you think you have a solution - the problem case is to start a ruby program, load code that gets passed into several Thread.new.
joshcheek has quit [Client Quit]
rippa has quit [Ping timeout: 260 seconds]
<Defusal>
shevy, that is a terribly generic description. i have already given you the solution. if you need a detailed solution, you need to provide a detailed question
<shevy>
your solution was "dont do this"
<shevy>
the eval solution, as horrible as it is, works, rather than your "solution"
tomb_ has quit [Quit: Computer has gone to sleep.]
<Defusal>
my solution was use a configuration file for configuration, and a rb file for code, not the other way around
<shevy>
ok so I use a .rb file now
<shevy>
happy? ;)
<Defusal>
no, because clearly you are still missing the point
<shevy>
ok so you never wanted to help
naz has joined #ruby-lang
cirwin has joined #ruby-lang
<Defusal>
wow, now i regret ever trying. it is clear you dont want to be helped
<shevy>
Indeed. I don't want to be helped by "Don't do that." No alternative was given either.
<manveru>
i have no idea what the topic is, but a good answer to shevy is always "don't do that"
<yxhuvud>
*giggle*
<Defusal>
manveru, is shevy mentally handicapped or something? :(
<Defusal>
now i feel bad
<shevy>
Now I am being ganged up.
<manveru>
Defusal: he's probably using ruby longer than me...
* cirwin
tells shevy to do it like that
<manveru>
yet every time it ends like this
<Defusal>
ouch...
nazty has joined #ruby-lang
<zzak>
get it over with and use resque already
<singpolyma>
shevy: if you want to eval a string of ruby code, you must use eval
<singpolyma>
obviously
* Defusal
fetches the popcorn
VGoff is now known as VGoff_afk
<shevy>
singpolyma yeah but eval is too terrible to use
<singpolyma>
shevy: anything else you use will be exactly the same
<singpolyma>
if you want to eval a string, then you use eval
<yxhuvud>
shevy: it is not if used in the right context. Storing code in yaml is not that.
naz has quit [Ping timeout: 250 seconds]
<Defusal>
yxhuvud, seriously don't bother, i already told him that
<manveru>
shevy: you're the only one using those yaml files anyway
scampbell has joined #ruby-lang
<Defusal>
shevy: try #ror
<shevy>
manveru: why do you talk to me? 10.09.2007: <manveru> shevy: lerns selber, ich bring dir nix mehr bei
solars has joined #ruby-lang
<manveru>
damn
<Defusal>
2007, wow
<manveru>
i almost forgot about that
banisterfiend has joined #ruby-lang
<shevy>
Defusal, why do you recommend #ror ?
<Defusal>
because its full of people asking stupid questions and refusing to accept valid answers
<shevy>
Defusal but so is #php :(
<Defusal>
so why arnt you asking there?
<shevy>
because it won't solve the problem at hand?
<singpolyma>
shevy: use eval
<shevy>
singpolyma there must be a better way
<Defusal>
neither will refusing to accept the solutions provided
<singpolyma>
I mean, I agree you should not want eval, but clearly you do
<shevy>
I'll look at resque
<singpolyma>
shevy: how would there be a better way to eval code, than using eval?
<Defusal>
^
<cirwin>
as long as you set __FILE__ and __LINE__ correctly, using eval is just fine
dankest has joined #ruby-lang
jtoy has quit [Quit: jtoy]
<Defusal>
of all the lost causes i've ever come across, this guy has me absolutely flabbergasted
tRAS has quit [Quit: Mother, did it need to be so high?]
<lopac1029>
I've got a ruby question/problem that I'll gladly take any and all advice to figure out, because I'm really new to ruby.
ttilley has quit [Read error: Connection reset by peer]
Aphelion has joined #ruby-lang
Aphelion has quit [Changing host]
Aphelion has joined #ruby-lang
Aphelion is now known as ttilley
<lopac1029>
I can't figure out why a method I created will not output what I expect it to.
<shevy>
lopac1029 the simplest way is to paste the code that does not work on a site like http://pastie.org/ and then paste the URL you get from there, on this channel here
<shevy>
lopac1029 how do you invoke your .rb script? "ruby foo.rb the_email_here" ?
<Mon_Ouie>
You shouldn't be using a string in the first place
<mistym>
lopac1029: Almost. String interpolation in ruby works via #{var}, so aside from using a regexp literal, you'll need to change the interpolation to add in your variable.
M4g1c5t0rM1 has joined #ruby-lang
<mistym>
E.g. var = "variable"; "This is a #{var}" => "This is a variable"
tRAS has joined #ruby-lang
tomb_ has joined #ruby-lang
M4g1c5t0rM has quit [Ping timeout: 256 seconds]
brianpWins has joined #ruby-lang
<Defusal>
ok shevy, i am going to take pity on you and give you an example of how to not put code in your config files and not use eval
<shevy>
Defusal \o/
<lopac1029>
Ok, so I shouldn't use a string in .scan, and I should use interpolation
<shevy>
well you can use interpolations in a regex too ... x = 'world'; your_regex = /hi #{x}/ ... should match to "hi world"
<mistym>
Yeah. .scan accepts strings, but that's when you're searching for a string literal instead of a pattern. 'foobarfoo'.scan('foo') => ['foo', 'foo']
kristofferrr has quit [Quit: ❤]
<mistym>
Yeah, what shevy said!
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
macmartine has joined #ruby-lang
d3vic3 has quit [Ping timeout: 260 seconds]
<lopac1029>
Awesome. I haven't figured out HOW to make it work, but you all definately helped me figure out what I wasn't seeing that was broken. Thanks!
zz_wasnotrice is now known as wasnotrice
<shevy>
it works now?
<shevy>
oh
<mistym>
lopac1029: Knowing what's broken is the first step to success!
<Defusal>
that is a very generic example, mapping config directly to methods
<shevy>
Defusal thanks
d3vic3 has joined #ruby-lang
zmack has joined #ruby-lang
<lopac1029>
oh lordy! shevy, mistym, Mon_Ouie: Thanks for your help. Got it
<mistym>
lopac1029: Nice!
sepp2k has joined #ruby-lang
<Defusal>
shevy, don't waste it. learn from it, and mold it into something that suites your specific use case well
<shevy>
Defusal, I'll credit it to you once I have solved it completely :)
<Defusal>
no need, just solve it *properly*
joshcheek has joined #ruby-lang
Carnage\ has quit []
gregmoreno has joined #ruby-lang
jtoy has joined #ruby-lang
Defusal has quit [Ping timeout: 248 seconds]
gearaholic has joined #ruby-lang
dabradley has joined #ruby-lang
joshcheek has quit [Quit: joshcheek]
M4g1c5t0rM1 has quit [Read error: Connection reset by peer]
M4g1c5t0rM has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
slaytanic has quit [Ping timeout: 272 seconds]
slyphon is now known as slyphon_away
wmoxam has joined #ruby-lang
jtoy has quit [Quit: jtoy]
benanne has joined #ruby-lang
akira989 has joined #ruby-lang
qpingu has joined #ruby-lang
qpingu has quit [Client Quit]
JohnBat26 has joined #ruby-lang
qpingu has joined #ruby-lang
krohrbaugh has joined #ruby-lang
slyphon_away is now known as slyphon
somethin1ellow has joined #ruby-lang
sonicpond has joined #ruby-lang
whatasunnyday has joined #ruby-lang
somethinYellow has quit [Ping timeout: 252 seconds]
Gabriel_Moreira has quit [Read error: No route to host]
zmack has quit [Remote host closed the connection]
ttilley has quit [Remote host closed the connection]
tesseract has joined #ruby-lang
qpingu has left #ruby-lang [#ruby-lang]
andrewhl has quit [Remote host closed the connection]
Defusal has joined #ruby-lang
ridders24 has joined #ruby-lang
<ridders24>
hey guys
<sonicpond>
hay pal
tesseract has quit [Quit: tesseract]
<ridders24>
how do I read bytes from a file? but a cetain vaule for example FFD8 to the next FFD9
soahccc` is now known as soahccc
<pbjorklund>
Sigh, I give up. How can I use grep to find either 3..5 or /[35]/ in the same statement? Ie I want to do like [1,"2",3].grep((3..5 || /[35]/)
qwerxy has joined #ruby-lang
<Defusal>
pbjorklund, [35] is only 35
<manveru>
pbjorklund: by not using grep?
<Defusal>
[35] doesnt even make sense
<manveru>
[35] is 3 or 5
dr_bob has quit [Ping timeout: 248 seconds]
gouthamvel has joined #ruby-lang
<Defusal>
yes, but then why is he trying 3..5 seperately
dr_bob has joined #ruby-lang
<Defusal>
[3-5] would cover both
<Defusal>
so would [345]
<manveru>
>> [1,"2",3].select{|e| (3..5) === e || /[35]/ === e }
<pbjorklund>
Hmm, perhaps it's cheating asking for such blatant help btw
<Defusal>
[1,"2",3].select {|e| e === case e; when Integer then 3..5; when String then /[3-5]/ end }
<manveru>
pretty much, yeah
<Defusal>
that would be efficient
<manveru>
Defusal: no need for e ===
<Defusal>
manveru, err
<pbjorklund>
Sorry, just so depressing seeing 4 pages of purple links when googling :)
<Defusal>
how do you rate that?
<manveru>
case e; when 3..5; true; when /[3-5]/; true; end
<Defusal>
oh right, i guess that could work
jmcphers has quit [Ping timeout: 245 seconds]
<manveru>
maybe regex first, so it doesn't iterate the range first
<Defusal>
just a little less efficient
<Defusal>
but hardly i guess
rhodee has joined #ruby-lang
<manveru>
Integer#=~ just returns false
<Defusal>
right, in that case its perfect
<manveru>
anw, back to work
<Defusal>
:)
<manveru>
haven't written ruby in weeks...
<manveru>
everything is Go these days
scampbell has quit [Remote host closed the connection]
<Defusal>
ouch, Go isnt quite as fun
wasnotrice is now known as zz_wasnotrice
<pbjorklund>
Bah, you can pass a proc to grep. That solves it. Thanks for the help
<manveru>
lol
<manveru>
that would do it, yeah
<manveru>
Defusal: it's alright
<manveru>
mongodb not so much :(
<Defusal>
i like mongo
jmcphers has joined #ruby-lang
<Defusal>
if only there was a decent and efficient ruby wrapper for it
Lee_A has joined #ruby-lang
fserb has quit [Quit: ttyl]
hynkle has quit [Read error: No route to host]
hynkle has joined #ruby-lang
eschwartz has joined #ruby-lang
Axsuul has joined #ruby-lang
Skif has quit [Ping timeout: 240 seconds]
qwerxy has quit [Quit: Computer has gone to sleep.]
<Defusal>
does anyone know of a better way of settings the arity of a proc other than using eval to dynamically create a proxy proc that has n arguments?
Guest44443 has quit [Ping timeout: 265 seconds]
<Defusal>
setting the arity*
virunga has joined #ruby-lang
<pbjorklund>
Ok next stupid question. Why is Proc.new { |n| n.odd? } === 3 => false and Proc.new { |n|.odd? }.call 3 => true ?
_darkside_ has joined #ruby-lang
<pbjorklund>
Am I reading "Invokes the block with obj as the proc's parameter like #call." the wrong way?
vaelen has quit [Remote host closed the connection]
dalekurt has quit [Ping timeout: 256 seconds]
virunga has quit [Client Quit]
<pbjorklund>
Oh, was running rubinius.
krohrbaugh has quit [Read error: Connection reset by peer]
scampbell has joined #ruby-lang
qwerxy has joined #ruby-lang
ttilley has joined #ruby-lang
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
dalekurt has joined #ruby-lang
fserb has joined #ruby-lang
gouthamvel has quit [Ping timeout: 248 seconds]
jtoy has joined #ruby-lang
M4g1c5t0rM has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby-lang
hynkle_ has joined #ruby-lang
hynkle has quit [Read error: No route to host]
hynkle_ is now known as hynkle
M4g1c5t0rM has joined #ruby-lang
dax has joined #ruby-lang
<ridders24>
how can I read out hex from a .dd file?
cldwalker has joined #ruby-lang
lsegal has joined #ruby-lang
zmack has joined #ruby-lang
jtoy has quit [Ping timeout: 244 seconds]
tyman_ has quit [Quit: tyman_]
mortice has quit [Ping timeout: 248 seconds]
jtoy has joined #ruby-lang
tjadc has quit [Read error: Connection reset by peer]
s0ber has quit [Read error: Connection reset by peer]
s0ber has joined #ruby-lang
fserb has quit [Quit: ttyl]
Tref has quit [Quit: Tref]
jtoy has quit [Ping timeout: 248 seconds]
ttilley is now known as Aphelion
tbuehlmann has quit []
brianpWins has quit [Quit: brianpWins]
<TTilus>
ridders24: #read and #unpack
<TTilus>
ridders24: i think
M4g1c5t0rM has quit [Read error: Connection reset by peer]
asahi has joined #ruby-lang
<asahi>
I have a Nokogiri::HTML doc and I'm wondering if there's a way to see if the text 'foobar' appears anywhere
<asahi>
*anywhere in the source
M4g1c5t0rM has joined #ruby-lang
jtoy has joined #ruby-lang
brianpWins has joined #ruby-lang
sepp2k1 has joined #ruby-lang
<ridders24>
TTilis, I have made a .dd file containing a disk image. I have found some code on the internet but not sure if i can use it, here it is: http://pastebin.com/ywabtwiF
fserb has joined #ruby-lang
sepp2k has quit [Ping timeout: 245 seconds]
<asahi>
actually, nevermind. figured it out
fserb has quit [Client Quit]
fserb has joined #ruby-lang
<lianj>
ridders24: what do you want todo?
krohrbaugh has joined #ruby-lang
<drbrain>
asahi: doc.to_s =~ /foobar/ ?
joshcheek has joined #ruby-lang
<lianj>
ridders24: "foo".unpack("H*")[0] # "666f6f" or ["666f6f"].pack("H*") # "foo"
joshcheek has quit [Client Quit]
Lee_A has quit [Remote host closed the connection]
<ridders24>
lianj: what is the ("H*")[0] # "666f6f" in that example?
<lianj>
ridders24: your dd file is in hex and you want the binary from it or the reverse?
<ridders24>
lianj: the dd file is an image of a hdd. I want to scan the dd file and file the file signatures for images starting with FFD8 and ending with FFD9, then export each found image out
yxhuvud has quit [Ping timeout: 245 seconds]
<drbrain>
lianj: I'm wondering if asahi is looking for text anywhere in the source (element names, attributes, namespaces), or anywhere in the text
<drbrain>
… nodes
<lianj>
drbrain: true
tonesfrommars has joined #ruby-lang
hynkle has quit [Read error: No route to host]
DRCALKIN has joined #ruby-lang
hynkle has joined #ruby-lang
mts7 has joined #ruby-lang
Raduwen has quit [Quit: Leaving...]
<erikh>
ridders24: how big is the image?
bryancp has quit [Remote host closed the connection]
tRAS has quit [Quit: Mother, did it need to be so high?]
mts7 has quit [Remote host closed the connection]
qwerxy has quit [Quit: Computer has gone to sleep.]
elux has quit [Quit: Bye!]
<asahi>
drbrain: thanks. yeah I realized that doc.text.include?("foobar") did the trick
vaelen has joined #ruby-lang
<ridders24>
erikh: in this example its only 4GB, but i intend to scan large drives like 500GB
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
hynkle has quit [Read error: No route to host]
hynkle has joined #ruby-lang
<erikh>
you'll probably want to use a read buffer and a mini-tokenizer then
hynkle has quit [Read error: No route to host]
<erikh>
probably not the best application for ruby if I may be so honest. you're going to hit the garbage collector a lot.
<erikh>
C would scream at something like this though.
gregf has joined #ruby-lang
hynkle has joined #ruby-lang
<erikh>
(and be a fairly trivial program)
qwerxy has joined #ruby-lang
jperry2 has quit [Ping timeout: 244 seconds]
stamina has quit [Quit: Lost terminal]
M4g1c5t0rM has quit [Read error: Connection reset by peer]
<zzak>
id go with pascal on this one
<manveru>
grep :)
scampbell has quit [Remote host closed the connection]
qwerxy has quit [Quit: Computer has gone to sleep.]
M4g1c5t0rM has joined #ruby-lang
hynkle has quit [Quit: hynkle]
somethin1ellow has quit [Quit: Computer has gone to sleep]
chessguy has quit [Remote host closed the connection]
Aphelion has quit []
ridders24 has quit [Ping timeout: 244 seconds]
nisstyre has quit [Changing host]
nisstyre has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
akira989_ has joined #ruby-lang
akira989 has quit [Ping timeout: 252 seconds]
<lopac1029>
I'd like to share my finished product, for those that helped me earlier. It came out better than expected (at least for me). Thanks again to those that lent me a hand with my silly questions. https://github.com/lopac1029/ruby_parser
Tref has joined #ruby-lang
acyed has quit [Remote host closed the connection]
tomb_ has quit [Quit: Computer has gone to sleep.]
scampbell has joined #ruby-lang
fserb has joined #ruby-lang
solars has joined #ruby-lang
fserb has quit [Client Quit]
krohrbaugh has joined #ruby-lang
cesario has quit [Quit: Connection closed for inactivity]
Lee_A has left #ruby-lang [#ruby-lang]
mistym has joined #ruby-lang
bryancp has joined #ruby-lang
tcopp has quit [Quit: Lost terminal]
Hakon|mbp has quit [Quit: Leaving...]
joshcheek has joined #ruby-lang
joshcheek has quit [Client Quit]
chimkan___ has joined #ruby-lang
solars has quit [Ping timeout: 265 seconds]
Criztian has quit [Remote host closed the connection]
benanne has quit [Quit: kbai]
chimkan has quit [Ping timeout: 244 seconds]
chimkan___ is now known as chimkan
heftig has quit [Quit: leaving]
bryancp has quit [Remote host closed the connection]
zmack has quit [Remote host closed the connection]
heftig has joined #ruby-lang
fserb has joined #ruby-lang
outoftime has quit [Quit: Leaving]
bryancp has joined #ruby-lang
macmartine has quit [Quit: macmartine]
andrewhl has quit [Remote host closed the connection]
brushbox has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
chimkan_ has joined #ruby-lang
chimkan has quit [Read error: Connection reset by peer]
chimkan_ is now known as chimkan
ryez has joined #ruby-lang
imajes has quit [Excess Flood]
akira989 has quit [Remote host closed the connection]
imajes has joined #ruby-lang
eschwartz has quit [Remote host closed the connection]
Skif has joined #ruby-lang
lsegal has joined #ruby-lang
akira989 has joined #ruby-lang
srbartlett has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
ttilley is now known as ttilley_off
drollwit has quit [Remote host closed the connection]
digman543 has joined #ruby-lang
Carnage\ has quit []
Okasu has joined #ruby-lang
<Okasu>
hello
fserb has quit [Quit: ttyl]
<Okasu>
can you recommend me some practice to convert such string("bla bla #{cmd}") to yaml and substitute code piece in strig when yaml loading into progamm
bryancp has quit [Remote host closed the connection]
<Okasu>
interpolation
<Okasu>
thing
<samuelkadolph>
Okasu: That's not going to be possible. It's going to interpolate it before it gets passed into any method