apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
<btully>
just spent $100 on the railstutorial, and can't even get ruby working
<offby1>
So ... classes are open, which means I could do "def Hash.get(key) ... interesting code ... end". But what if someone other code that I don't know about has already defined a method in Hash named 'get'?
<offby1>
s/someone/some/
<otters>
then you clobber their code
Nicke\ has quit [Read error: Connection reset by peer]
<offby1>
ugh
<offby1>
is this not a problem in practice?
<delinquentme>
umm when I create and store an instance of a class
<otters>
well, most people don't define methods on core classes
<delinquentme>
that object is an instance .. but is it more correct to refer to it as an element ... once its created?
<delinquentme>
created = saved *
<offby1>
otters: when is it reasonable to do that, though? Or isn't it ever?
<otters>
it isn't really
<offby1>
hmm
<otters>
except in personal code
nej has quit [Quit: Leaving...]
<digitalcakestudi>
whats a better alternative to redmine if I want a ruby build project management app?
vitoravelino`afk is now known as vitoravelino
btully has left #ruby [#ruby]
<digitalcakestudi>
built*
<jlogsdon>
offby1: yeah, steer clear of monkey-patching core classes unless you *have* to
carloshpf has quit [Ping timeout: 265 seconds]
chimkan has quit [Quit: chimkan]
<jlogsdon>
It's generally better to extend the base class and make your changes there
amalvagomes has quit [Quit: amalvagomes]
ephemerian has quit [Quit: Leaving.]
<offby1>
jlogsdon: I was wondering if I could get a literal like {:one=>1} to turn into a class with my extra methods. Is there a way to tell the reader that hash literals should create objects of type MyNiftyHash, instead of Hash?
<jlogsdon>
nope
<offby1>
pfui
<jlogsdon>
In that case it could be reasonable to monkey-patch in Hash#to_my_nifty_hash
<jlogsdon>
you require core_ext/hash/purple_hash.rb and it adds the method
<jlogsdon>
hehe
<jlogsdon>
i was strugling for a name, all the good ones are taken. I wanted autoconf :(
<offby1>
"autovivify" is what I'd call it, since that's the perl term for that behavior
<jlogsdon>
Oh?
<jlogsdon>
i might do that
<offby1>
yep
<jlogsdon>
hot
<offby1>
once you do you'll probably stumble on the five other similar classes :)
<jlogsdon>
probably, ha!
<jlogsdon>
i didn't know there was a name fot that
<jlogsdon>
even a wiki page!
<offby1>
(I don't _know_ that there are five, but I wouldn't be surprised; it's a handy perl feature and I bet you're not the first Rubyer to want it)
Plas has quit []
thecreators has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 244 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
<offby1>
so in other news ... is there something that "validates" a data structure against a "schema", roughly the way a DTD can validate XML? Specifically, I've written a frighteningly-complex "config file" for a human to create, in order to control a program, and I worry that it'll be easy for the user to make little errors in that file, which my code will only "notice" when it's too late to report the error conveniently.
dnyy has quit [Remote host closed the connection]
christianrojas has quit [Quit: Leaving...]
<jlogsdon>
Well, doing autovivify in ruby is dead simple (Hash.new { |h,k| self[k] = Hash.new(&h.default_proc) })
<offby1>
If the config file were XML, I could write a DTD and validate it that way (although I'm not certain that XML will let me do _all_ the validation I want), but ... I kinda hate XML, and I doubt my customer would be thrilled to have to write it by hand
<jlogsdon>
but purple_hash is more for configs, lets you lock and does key normalization
<jlogsdon>
mmm not that I'm aware of.
zeromodulus has quit [Remote host closed the connection]
<offby1>
bumm-air
dv310p3r has joined #ruby
<offby1>
(that's French for "bummer" btw)
<jlogsdon>
heh
<jlogsdon>
what'd I'd do ise just have a config class with defaults, if the default can't realistically be set (like a password or wahtever) make it a proc that raises a warning when called
ZachBeta has quit [Ping timeout: 265 seconds]
<jlogsdon>
so like with PurpleHash you'd do config = PurpleHash.new(password: lambda { warn "You must specifiy a password" }); config.merge({}); config[:password] # => warn is done
<jlogsdon>
or something along those lines
<jlogsdon>
but that could probably get unwieldy quickly for complex configs
toddw has quit [Remote host closed the connection]
<_blackbird>
I have a qick question about the Ruby Koans
jchauncey has joined #ruby
kojul has joined #ruby
jchauncey has quit [Client Quit]
<_blackbird>
In the AboutNil section there is a quick "Think About It" section looking at which is better. obj.nil? or obj == nil.
<offby1>
{'a' => 2, 'b' => 4, 'c' => 8}.values.reduce(:+) works too
ten00 has joined #ruby
<offby1>
_blackbird: lemme see if I wrote any notes on that one
<offby1>
I don't think so ...
kojul has quit [Client Quit]
ten00 has left #ruby [#ruby]
iocor has quit [Quit: Computer has gone to sleep.]
<offby1>
I don't know what the right answer is, or if there even is one. But I'd use obj.nil? for this reason: if I type ``obj == nil'', and accidentally omit one of the ``='', then I'm in a world of hurt
kenichi has quit [Remote host closed the connection]
kojul has joined #ruby
<offby1>
... which is located north of Ruisseau du Merde, and I hear there's a paddle shortage
kylemcgi_ has joined #ruby
<_blackbird>
I think its more than that… since obj == nil is doing a full comparison of the two objects [since nil is an object]. If obj is an object of something other than nil, it will return false. Where if the object is empty, obj.nil? would return true.
<_blackbird>
Or am I way off?
<offby1>
dunno -- I didn't understand you :)
maletor has quit [Quit: Computer has gone to sleep.]
<elliomax>
wait isnt === full compare?
<_blackbird>
that I don't know
<elliomax>
pretty sure it is
* offby1
thinks in terms of eq?, equal?, and eqv?. Guess which language he's most used to
L-----D has quit [Quit: Leaving]
kylemcgill has quit [Ping timeout: 252 seconds]
Solnse has joined #ruby
<offby1>
time's up
liluo has joined #ruby
Jamoka has quit [Read error: Connection reset by peer]
<_blackbird>
Ah I got it
<_blackbird>
==, equal? and sql? test if the objects are of the same object type
`damien has joined #ruby
<_blackbird>
only the object nil responds to nil?
sohocoke has quit [Quit: sohocoke]
fbernier has quit [Ping timeout: 272 seconds]
yugui_zzz is now known as yugui
adamkitt_ has joined #ruby
mikepack has quit [Remote host closed the connection]
adamkittelson has quit [Ping timeout: 260 seconds]
<offby1>
I would hope so.
dukio has joined #ruby
<dukio>
is there any reason basic things like .ord and .to_a don't work in the tryruby.org repl?
Hanmac has quit [Ping timeout: 240 seconds]
<offby1>
couldn't tell ya
berserkr has quit [Quit: Leaving.]
<heftig>
claims to be 1.9.2 but doesn't accept '{ foo: 3 }'
<banisterfiend>
dukio: what error do u get
<heftig>
JRUBY_VERSION is 1.6.3
<heftig>
NoMethodError for "a".ord
<dukio>
yes, that
<heftig>
i think they just need to update their JRuby
closedbook has joined #ruby
<elliomax>
is roo fully working in 1.9.3?
sepp2k1 has quit [Read error: Connection reset by peer]
<heftig>
undefined method `method' for main:Object
<heftig>
this is one crippled Ruby
<offby1>
I assume the intent is to get beginners to experiment with the basics.
CheeToS has joined #ruby
fbernier has joined #ruby
<closedbook>
I have a long string that I'd like to access later on in the program. normally I'd assign a variable to it and be done with it, but this string has some variables I need to interpolate in the middle. Is creating a method and passing the variables I want to interpolate the right approach?
<banisterfiend>
elliomax: wtf is roo
eka has quit [Remote host closed the connection]
delinquentme_ has joined #ruby
<offby1>
closedbook: interesting question. Dunno. I'll play with that
<banisterfiend>
closedbook: maybe a proc
<banisterfiend>
closedbook: proc { |x, y| "hello #{x} baby how are you, #{y} ?" }
niklasb has joined #ruby
<banisterfiend>
then just: my_proc.call("sandy", "pig")
bgupta has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
<closedbook>
for example: def my_string(foo, bar, baz) ; " a really #{foo, baz} long string #{ bar } " ; end
ConstantineXVI has quit [Remote host closed the connection]
<banisterfiend>
yeah, in second thoughts, a method is probably a better approch
cads has joined #ruby
<closedbook>
oh ok, I'll take a look at procs
<banisterfiend>
nah just use a metho
<banisterfiend>
method
* offby1
looks askance at banisterfiend
<offby1>
you're stalking me. I always knew you would
ymasory has joined #ruby
<banisterfiend>
offby1: hehe i've been a regular on #ruby for about 4 years ;)
<offby1>
I must confess I am a bit uneasy about this "everything is a method" deal
<banisterfiend>
offby1: long before ruby was even a winkle in your cynical asian eyes
<offby1>
If I do ``require 'pp' ; pp "Hi there"'', assuming that pp is indeed a method -- what object is it a method of?
<closedbook>
banisterfiend: thanks, it just felt weird using a method for each long string
<offby1>
.oO("asian"?)
<banisterfiend>
closedbook: well, you could use procs if u want, then you'd have to store each proc in an ivar
delinquentme has quit [Ping timeout: 272 seconds]
uris has joined #ruby
<offby1>
eww, he said "u"
kenperkins has joined #ruby
<closedbook>
banisterfiend: sorry, ivar?
voodoofish430 has quit [Quit: Leaving.]
<banisterfiend>
offby1: ima about to bet yo candy ass
bgupta has quit [Read error: Connection refused]
jayrulez has joined #ruby
Solnse has quit [Read error: No route to host]
Hanmac has joined #ruby
davidcelis has quit [Quit: K-Lined]
RegEchse has quit [Quit: <3 WeeChat (v0.3.8-dev)]
bgupta_ has joined #ruby
cjs226 has quit []
<banisterfiend>
closedbook: instance variable
<banisterfiend>
offby1: everything is not a method, where did u hear that? ;)
<closedbook>
banisterfiend: duh, thanks :-)
daed is now known as daedablo
<banisterfiend>
offby1: oh 'pp' is a method on Kernel
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
<bambanx>
dont work bnagy just jump my while i dunno why :/
<bambanx>
bnagy, is weird can be a bug?
<bnagy>
in what?
<bambanx>
in the loop
<bambanx>
dont work with while and until sum == dont work too
<bambanx>
:/
<bambanx>
and its just jump my loop
<bambanx>
sum = 0
<bambanx>
until sum == 642969993 dont work
<bnagy>
why do you think it 'jumps your loop'?
graspee has quit [Quit: no time like the present]
<bambanx>
becouse jump to the next line of code
<banisterfiend>
hehe
<bnagy>
wouldn't that also be consistent with entering the loop and hitting the termination condition?
ZachBeta has quit [Read error: Connection reset by peer]
<bambanx>
i dont understand u bnagy but thanks any way
<banisterfiend>
bambanx: you're a very polite boy
ZachBeta has joined #ruby
<bambanx>
banisterfiend, i am not a boy my dear friend, and my english is not very good too
<banisterfiend>
bambanx: you're a very polite girl, then :)
<bnagy>
bambanx: put 'p sum' before and after the AutoItX call inside the loop
IrishGringo has joined #ruby
<bambanx>
ok
philips has quit [Excess Flood]
Targen has quit [Ping timeout: 255 seconds]
mvangala has quit [Read error: Connection reset by peer]
philips has joined #ruby
mvangala has joined #ruby
<bnagy>
also, there should be an international tribunal where we could prosecute code that that for war crimes
<bnagy>
*like that
sgronblom has quit [Quit: leaving]
bluenemo_ has joined #ruby
toddw has quit [Remote host closed the connection]
Watcher7_ has joined #ruby
Watcher7 has quit [Ping timeout: 250 seconds]
macmartine has quit [Quit: macmartine]
bluenemo has quit [Ping timeout: 272 seconds]
Watcher7_ has quit [Client Quit]
ymasory has quit [Quit: Ex-Chat]
kylemcgi_ has joined #ruby
Solnse has quit []
kylemcgill has quit [Read error: Operation timed out]
savage- has quit [Remote host closed the connection]
savage- has joined #ruby
elliomax has joined #ruby
kevinbond has joined #ruby
<bnagy>
wow.. I just read those posts on array / string ends
<bnagy>
I feel tainted
jimeh2 has joined #ruby
<offby1>
it made sense to me.
<offby1>
Also: bacon ends.
* offby1
nods gravely
kil0byte has quit []
spowers has left #ruby [#ruby]
ipoval has joined #ruby
emmanuel__ has joined #ruby
dbgster has quit [Quit: dbgster]
jimeh has quit [Ping timeout: 250 seconds]
vertroa has quit [Quit: Leaving]
<bnagy>
"And a tip for you; never mention PoLS again to persuade me. It's no use. If you have real trouble besides misunderstanding, let me know." -- matz
<bnagy>
epic
vinian has joined #ruby
yugui is now known as yugui_zzz
tommyvyo has joined #ruby
fukushima has joined #ruby
eko has quit [Quit: This computer has gone to sleep]
eko has joined #ruby
eko has quit [Changing host]
eko has joined #ruby
eko has quit [Remote host closed the connection]
vitor-br has quit [Quit: Saindo]
eko has joined #ruby
eko has quit [Changing host]
eko has joined #ruby
eko has quit [Client Quit]
azm has joined #ruby
azm has quit [Read error: Connection reset by peer]
yugui_zzz is now known as yugui
eko has joined #ruby
eko has joined #ruby
eko has quit [Changing host]
locks_ has joined #ruby
vertroa has joined #ruby
locks_ has quit [Remote host closed the connection]
delinquentme_ has quit [Quit: Leaving]
gosshedd has joined #ruby
mikepack has quit [Remote host closed the connection]
mvangala has quit [Remote host closed the connection]
<bnagy>
midrange: usually we do better with questions that actually contain the question you want to ask instead of cryptic trivia though
<bnagy>
ahhh
<midrange>
that's the question i wanted to ask
<midrange>
i'm trying to get a handle on the reflectivity of ruby
yugui_zzz is now known as yugui
<bnagy>
ok, well someone else will check my work, but no I don't think there's any significant difference between those two (but again I dunno if putting them on Object is the best idea
<midrange>
yeah
banisterfiend has quit [Remote host closed the connection]
bananas has joined #ruby
Telg has quit [Ping timeout: 272 seconds]
baroquebobcat has joined #ruby
cyb3r3li0g has quit [Quit: Leaving]
<bnagy>
you should probably try it out in irb on a dummy class though
daniel_b has joined #ruby
yxhuvud has joined #ruby
digitalcakestudi has quit [Ping timeout: 256 seconds]
Telg has joined #ruby
nipra has joined #ruby
vertroa has quit [Read error: Connection reset by peer]
<bambanx>
bnagy,
vertroa has joined #ruby
rushed has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
bobdobbs has quit [Read error: Connection reset by peer]
<aces1up>
how can i escape a double quote in a string with gsub so : my "neat string" == my \"neat string\" ???
<Mon_Ouie>
gsub('"', '\\\\"')
HashNuke has quit [Quit: HashNuke]
<aces1up>
Mon_Ouie thanks
clockwize has joined #ruby
CheeToS has quit [Ping timeout: 248 seconds]
wargasm1 has quit [Read error: Connection reset by peer]
ben- has quit [Quit: Linkinus is updating...]
ben- has joined #ruby
gabrtv has quit [Ping timeout: 272 seconds]
<Veejay>
Mon_Ouie: I've always wondered, how come we have to say "\\\\"? How come there's not a constant ESCAPED_BACKSLASH or something to provide some abstraction?
ephemerian has joined #ruby
roolo has joined #ruby
d3vic3 has quit [Read error: Connection reset by peer]
<Veejay>
As in you don't even have to think, you can't be bothered with the details, you just want a \ in your string
rakm has quit [Quit: Computer has gone to sleep.]
mucker has joined #ruby
mucker has quit [Read error: Connection reset by peer]
Soul_Est has quit [Quit: WeeChat 0.3.7]
ds_shadof has left #ruby ["Leaving"]
<bnagy>
backslashes are fuuunny
<bnagy>
although I'd rather type \\ than #{ESCAPED_BACKSLASH}
cj3kim has quit [Quit: This computer has gone to sleep]
mucker has joined #ruby
mucker has quit [Read error: Connection reset by peer]
elliot98 has quit [Changing host]
elliot98 has joined #ruby
Helius has joined #ruby
<Mon_Ouie>
Veejay: I don't think that's a great idea
mneorr has joined #ruby
maesbn has joined #ruby
<Mon_Ouie>
I'd prefer having another method to replace substrings that wouldn't care about backslashes in the format string
skogis has joined #ruby
Helius has left #ruby [#ruby]
mucker has joined #ruby
mucker has quit [Read error: Connection reset by peer]
piotr_ has joined #ruby
d3vic3 has joined #ruby
gabrtv has joined #ruby
tatsuya_o has joined #ruby
Guest81769 has joined #ruby
Drakx_ has quit [Ping timeout: 260 seconds]
Drakx has joined #ruby
Drakx has quit [Changing host]
Drakx has joined #ruby
mucker has joined #ruby
mucker has quit [Read error: Connection reset by peer]
QKO has quit [Ping timeout: 260 seconds]
QKO has joined #ruby
crazed has quit [Ping timeout: 245 seconds]
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
etehtsea has joined #ruby
mucker has joined #ruby
cantonic has quit [Read error: Connection reset by peer]
mucker has quit [Read error: Connection reset by peer]
blacktulip has joined #ruby
mucker has joined #ruby
aces1up has quit []
liluo_ has joined #ruby
shruggar has joined #ruby
liluo has quit [Read error: Connection reset by peer]
probst has joined #ruby
gabrtv has quit [Ping timeout: 272 seconds]
probst has quit [Client Quit]
gabrtv has joined #ruby
Guest81769 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
Mon_Ouie: how do you feel about the socialist president of france?
stephenjudkins has quit [Quit: stephenjudkins]
jackiechan0 has joined #ruby
<shevy>
anyone here knows avisynth?
<bnagy>
I only know absinthe
EzeQL has quit [Ping timeout: 260 seconds]
<jackiechan0>
absinthe :) bnagy
<kalleth>
bnagy: wish i didnt know absinthe tbh ;(
<kalleth>
she's a harsh mistress
<shevy>
avisynth is a tiny "scripting" language for audio/media files. i.e. when you have an .avi file, you can apply several filters, all in text, then load this "script" in a program like virtualdub, to create the new .avi file
<shevy>
I wanna do this in ruby
<bnagy>
kalleth: Just like any woman, you need to treat her with respect. Then put sugar in her and set her on fire.
<kalleth>
:|
<shevy>
hmm
<kalleth>
brogrammer high5!
<shevy>
why the sugar
<bnagy>
absinthe is pretty bitter
<shevy>
oh
<kalleth>
that just makes it better
<kalleth>
vodka is fine too
tatsuya_o has quit [Remote host closed the connection]
<shevy>
vodka kills me
<bnagy>
normally you put a cube on a special spoon, soak the cube, then burn it, then stir
<bnagy>
except it's All Wrong according to purists
<bnagy>
alcohol nerds get really irate about this kind of stuff :)
tatsuya_o has joined #ruby
ipoval has joined #ruby
ctp has joined #ruby
sandGorgon has quit [Ping timeout: 260 seconds]
mucker has quit [Read error: Connection reset by peer]
mucker has joined #ruby
mucker has quit [Read error: Connection reset by peer]
netogallo has joined #ruby
[edu] has joined #ruby
<forestbird>
is the there a better way than the [0] there in the middle? open("/proc/#{pid}/io").grep(/^read_bytes/)[0][/(\d+)/].to_i
<shevy>
hmm
<shevy>
forestbird well, you could use .first
<shevy>
forestbird but you need to fetch the first element of that array, yes? so you kinda need to access it
<yxhuvud>
well, you could use a more suited method than grep.
<shevy>
:)
<forestbird>
yxhuvud: for example?
<kalleth>
bnagy: i'm no purist, someone puts booze infront of me in a pub, i drink it
[edu] has quit [Client Quit]
<kalleth>
bnagy: also, unlike (it seems) most programmers, I can't stand lager/bitter/ale :(
[edu] has joined #ruby
<yxhuvud>
forestbird: just a regular match.
Solnse has quit [Read error: No route to host]
<rippa>
I like pure absinthe
<rippa>
without water and shit
<shevy>
kalleth I like italian red wine, a very few beer sorts (but most beers are bad), tequila... and chocolate liqueor... damn I can't write liquor...
<bnagy>
grep seems pretty well suited to me?
<yxhuvud>
but anyhow, why are you using two regexen instead of one? /^read_bytes.*(\d+) should match just as well
<shevy>
oh and ice wine
<kalleth>
i'm a bit partial to wine, but only with a meal
<kalleth>
i can't really drink it on its own
<bnagy>
I mean finding array elements matching a regexp...isn't that kind of what it's meant for?
<kalleth>
whisky, vodka, and sugary womans drinks are my forte
mucker has joined #ruby
<yxhuvud>
bnagy: point is that he only use the first one.
<forestbird>
yxhuvud: i think i tried that but it didn't work... let me see
<banisterfiend>
yxhuvud: what does your nickname mean
dv310p3r has quit [Ping timeout: 272 seconds]
<yxhuvud>
banisterfiend: uh, it is a play of words on a sentence people use when someone is saying something that doesn't relate to the question at hand
<bnagy>
ohhh... yeah you can't get it out of grep but you can use $1
<banisterfiend>
yxhuvud: in swedish? cos in english (to me) it just looks like a random jumble of characteres
dv310p3r has joined #ruby
<bnagy>
yxhuvud: nice one
altious has quit [Read error: Operation timed out]
<yxhuvud>
banisterfiend: it is very convenient to have a nickname english people cannot pronounce, except when someone takes me for a spambot with autogenerated name
francisfish has joined #ruby
<bnagy>
(ie I don't think you're right)
<Mon_Ouie>
yxhuvud: .*? means non-greedy
<yxhuvud>
ah, good point. .* might be too greedy.
zastaph has joined #ruby
<bnagy>
but anyway, it's a nice solution - I don't usually approve of $1, but it's cool here
d3c has joined #ruby
<yxhuvud>
\D* works as well I suppose.
mucker has quit [Read error: Operation timed out]
dknight has joined #ruby
<dknight>
how do I specify realm in basic_auth?
<yxhuvud>
dknight: depends. what is your scenario?
<Veejay>
banisterfiend: I feel honored that you'd rather ask some Belgian dude rather than me
<Veejay>
It feels great
<Veejay>
THANKS
<banisterfiend>
Veejay: Mon_Ouie is primarily a french speaker
<Veejay>
Also, if the Belgian knew ANYTHING about government, they'd have one :D
<banisterfiend>
Veejay: so his heart is closer to france than belgium
<Veejay>
I was kidding obviously
<banisterfiend>
im sure he keeps a very close eye on french politics
<banisterfiend>
Mon_Ouie: right?
<banisterfiend>
:D
polysics has joined #ruby
<dknight>
yxhuvud: I have to make a POST call
<banisterfiend>
Veejay: hehe, you're french?
<Mon_Ouie>
Does knowing who's their current president is count as "a very close [ear]"?
<dknight>
yxhuvud: that requires me to use basic_auth to login
mucker has joined #ruby
<bnagy>
Veejay: and yet Belgium is in good shape and France is broke.. wonder who's laughing about governments now :D
<Veejay>
Good shape
<Veejay>
ha
<bnagy>
well compared to France everyone is on good shape
<bnagy>
cept Greece
<Veejay>
No one's in "good shape" man
<bnagy>
Australia is! Woooo!
<Veejay>
Belgium is like 12 people (13 including Mon_Ouie) give me a break
<bnagy>
ozzie ozzie ozzie! oi oi oi!
<banisterfiend>
Mon_Ouie: no
<banisterfiend>
bnagy: did u see possum
<banisterfiend>
bnagy: the hot australian chick
<bnagy>
banisterfiend: yeah there were loads last time I went camping
L-----D has quit [Quit: Leaving]
<kalleth>
wait, hot australian chick?
<kalleth>
i'm interested now
<yxhuvud>
dknight: then I don't know.
<banisterfiend>
kalleth: ok one sec, i'll find it 4 u
<Veejay>
banisterfiend: Yes I am, my family has been French since at least 1100
<dknight>
yxhuvud: tell me the way you know
<Veejay>
Rotten to the core :D
tvw has joined #ruby
<yxhuvud>
dknight: well, I know how to set it up on the server side, under certain preconditions.
<bnagy>
banisterfiend: it may surprise you to learn that I don't get much exposure to australian media here in kathmandu
<Veejay>
bnagy: What do you mean compared to France everyone is in good shape? What about Italy, Spain, Portugal, Ireland? The deficit in England is ridiculous as well. Everyone's hurting really :/
<dknight>
yxhuvud: nah, I need to set it on client side. actually when you set it on server side, how does your client communicate with it?
<yxhuvud>
well, certain parts of northern europe are doing fine.
<banisterfiend>
the 'deliverables' are nothing to speak of
mxweas_ has joined #ruby
piotr__ has joined #ruby
yugui is now known as yugui_zzz
piotr_ has quit [Ping timeout: 272 seconds]
<bnagy>
I would like an msvc build, and also a 64 bit build
<banisterfiend>
bnagy: why do u want an msvc build out of interest
<bnagy>
and I would also like a lot of the win32 gems ported to ffi
<bnagy>
mainly for compatability with new / 64 bit winders
<bnagy>
and because it's a pretty good compiler :(
<banisterfiend>
it would be a pain to maintain an msvc build, not $50K worth of pain, but a pain as MRI is now using c99 afaict
dv310p3r has quit [Max SendQ exceeded]
<Veejay>
banisterfiend: This type of project is exactly how I realize that deep down I'm a douche. I simply don't want Ruby to ever succeed on Windows. In fact, I would very much everyone to develop on UNIX systems, just lik me.
yonggu has quit [Ping timeout: 255 seconds]
<Veejay>
+like for
<bnagy>
Veejay: I don't think it's as deep down as you think
<ben->
Veejay: \o/
<bnagy>
:D
<Veejay>
:D
yonggu has joined #ruby
<bnagy>
I have to work with windows, ok? I don't do it because I like it, or because I like windows
<bnagy>
but to break windows software I need to write windows software
mxweas_ has quit [Quit: Leaving...]
<Veejay>
bnagy: So people force you to use Windows, right?
<Veejay>
At work or something?
<bnagy>
I don't USE it, eww
<bnagy>
I just have stuff that nees to run on windows bots
rorider has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<ben->
find a new job ;)
manizzle has joined #ruby
flype has joined #ruby
<bnagy>
no way, this is the best job ever
<Veejay>
But really of course I wish Ruby would run fine and consistently anywhere, there are tons of people developing on Winows after all
<bnagy>
breaking windows software is very satisfying
jbw has joined #ruby
schovi has joined #ruby
thecreators has quit [Remote host closed the connection]
kylemcgill has quit [Remote host closed the connection]
ixx is now known as ixx_
ixx_ is now known as _ixx
_ixx is now known as taylorcc
taylorcc is now known as ixx
ixx is now known as xxi
xxi is now known as ixx
dv310p3r has joined #ruby
sohocoke has joined #ruby
zii has joined #ruby
rorider has quit [Quit: Leaving]
<zii>
I see github ruby styleguide disallow using "and" and "or" boolean functions, but why? I think they're often much more readable than && ||.
<bnagy>
styleguides are self indulgent wank
<banisterfiend>
zii: because they have different precedence rules so they're note a direct replacement for && and ||
<bnagy>
but using && and || is a safer habit
<banisterfiend>
and as such could confuse some pigs
<banisterfiend>
not*
etehtsea has quit [Ping timeout: 252 seconds]
elliot98 has quit [Quit: Konversation terminated!]
<bnagy>
having said that, I like little snippets like do_a_thing and return true or whatever :P
dekroning has quit [Ping timeout: 244 seconds]
<banisterfiend>
bnagy: Yeah, that's the recommended use case for them
<banisterfiend>
as flow control thingies rather than boolean operators for an 'if'
<banisterfiend>
lose_virginity_before_25 or die
r4um has quit [Quit: leaving]
Foxandxss has joined #ruby
<bnagy>
well for most people I guess that would be and :)
<zii>
That's what I used them for. :] Cool. In what way are their precedence rules different from && ||.
<Veejay>
I really like and and or. In their written form
<zii>
?*
<banisterfiend>
zii: let me find u a blog post
<Veejay>
I probably abuse them because of that irrational passion
<bnagy>
zii: google will tell you. && will do the right thing almost always
<bnagy>
and can trick you sometimes with weak precedence
<Hanmac>
hm it seems that your mapnik gem and your mapnik version does not fit together
heisenmink has joined #ruby
<vectorshelve>
Hanmac: shevy bnagy hai :)
liluo_ has quit [Remote host closed the connection]
<ben->
Hanmac: looks like, yes, but the weird thing is they mention Mapnik 2.x as dependency and i use Mapnik 2.0.1 :(
<ben->
i already wrote in #mapnik but didnt get an answer yet
nari_ has joined #ruby
manizzle has quit [Read error: Operation timed out]
sohocoke has joined #ruby
<kalleth>
bored.
<kalleth>
5 tickets closed, 10 commits made, before lunch, 8 hours closed off in the bugtracker
<kalleth>
and i'm _bored_
joukokar has joined #ruby
<arturaz>
kalleth, learn scala
<kalleth>
yesh, like this company will let me spend time actually learning/improving my knowledge rather than "IMPLEMENT THIS AS FAST AS YOU CAN"
<kalleth>
*cries*
<kalleth>
but, if i do that, I MIGHT BECOME MARKETABLE
nari has quit [Ping timeout: 248 seconds]
ronniy has joined #ruby
<bnagy>
and people tell _me_ to get a new job ;)
randym is now known as randym_zzz
randym_zzz is now known as randym
<kalleth>
i live in bumfuck nowhereville where there's very few rails jobs
<kalleth>
i'm looking, dont get me wrong :p
d3vic3 has quit [Ping timeout: 260 seconds]
<kalleth>
(also known as the midlands)
<bnagy>
your bumfuck nowherevill is nothing compared to mine, dude :)
d3vic3 has joined #ruby
maesbn has quit [Remote host closed the connection]
fermion has quit [Quit: P]
fermion_ is now known as fermion
manizzle has joined #ruby
<bnagy>
I think parallel is my new favourite gem
<bnagy>
again
Criztian has joined #ruby
berserkr has joined #ruby
wvms has quit [Ping timeout: 272 seconds]
d3c has quit [Read error: Connection reset by peer]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
shruggar has quit [Quit: Leaving.]
manizzle has quit [Ping timeout: 248 seconds]
davidcelis has quit [Read error: Connection reset by peer]
krz has quit [Quit: krz]
matti has joined #ruby
<dagobah>
I'm looking to write an IRC bot that sits on a channel and I can send event-driven messages for it to forward onto the channel. All the gems I've used disconnect after sending a message, is there a way round this?
heisenmink has quit [Quit: Lämnar]
<bnagy>
I don't think anyone has ever written an IRC bot in Ruby before
shruggar has joined #ruby
gilead has joined #ruby
davidcelis has joined #ruby
ymasory has quit [Ping timeout: 245 seconds]
evangelion has joined #ruby
<evangelion>
hello
<evangelion>
is there a decent library that permit to create custom IP/ARP packets with ruby?
foofoobar has joined #ruby
piotr__ has quit [Ping timeout: 272 seconds]
<bnagy>
not afaik
<bnagy>
I use a binary struct parser / generator and a raw socket
<bnagy>
if you're on unix you might be able to get one of the libdnet bindings working though
<banisterfiend>
bnagy: what exactly is a binary struct parser generator
<bnagy>
but I tend to hate them
<bnagy>
banisterfiend: it's a thing that parses and / or generates binary structures
<shevy>
"One day there might even be some documentation here." yay!
d3vic3 has joined #ruby
ymasory has joined #ruby
<shevy>
well ok I must admit
<shevy>
without a README I dont even know what this is
<bnagy>
:)
<evangelion>
haha
<shevy>
I'd have to read the IRC backlog here but I am kinda lazy
<shevy>
so I just feed new lines to my client until everything scrolls away!
<kzar>
I'm trying to use Win32API with a c++ dll, the documentation for the dll talks about the objects avaliable and their methods but the documentation I've found for Win32Api just talks about specifying a dll, function and parameters. So how can I create a C++ object and call some of it's methods using Win32API?
<bnagy>
kzar: you mean a COM object, or what?
<kzar>
bnagy: Honestly I'm not sure
<bnagy>
if it's not just a plain old DLL where you can wrap exported functions it's probably COM
<kzar>
bnagy: OK, how would I tell?
<bnagy>
in which case, if it registers with the ole server, you might be able to use win32ole
<bnagy>
(like Word, Excel etc all do)
n1x has joined #ruby
<bnagy>
otherwise it gets tricky and horrible
<bnagy>
do you have a link to the dll doc? Or does it mention COM anywhere?
<kzar>
bnagy: No, unfortunately we're under NDA for this
<bnagy>
ok well if it's talking about 'objects' and 'methods' it makes me think COM, sadly
shruggar2 has quit [Read error: No route to host]
<kzar>
bnagy: ok balls
<kzar>
bnagy: So when you said it potentially gets ugly, is there a way?
<bnagy>
you need to wrap the object still, there is code in that gem for doing it for dbgeng.dll. You need the headers for your target to write the wrapper.
<kzar>
ok
<bnagy>
but find out if they register with the OLE sever first
<bnagy>
cause then it's trivial
<bnagy>
with win32ole
<kzar>
bnagy: How would I know?
<bnagy>
try and connect to it, I guess. :) Check out the win32ole gem examples
ikaros has joined #ruby
nanderoo has joined #ruby
<bnagy>
but if it's some hacked up COM DLL from dickheads incorporated it might be...tricky
<kzar>
bnagy: also, it's possible I can get my hands on a .so that's been compiled for Linux
<kzar>
bnagy: supposing it's not registered with OLE would that be easier to use?
<bnagy>
uh
<bnagy>
I have never tried to ffi a .so on windows :P
<bnagy>
but yeah, probably :)
MasterLambaster has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
shruggar has joined #ruby
<kzar>
bnagy: Just grabbing an ole viewer app that apparently lists what's registered so we'll soon find out
tomzx has joined #ruby
A124 has joined #ruby
A124 has left #ruby [#ruby]
amalvagomes has joined #ruby
StoSun has joined #ruby
ymasory has quit [Quit: Ex-Chat]
geers has joined #ruby
nari has joined #ruby
maesbn has quit [Remote host closed the connection]
lxsameer has joined #ruby
shruggar has quit [Max SendQ exceeded]
bigkevmcd has quit [Ping timeout: 272 seconds]
etehtsea has joined #ruby
dekroning has joined #ruby
d3c has quit [Quit: Quit]
geekbri has joined #ruby
bigkevmcd has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
<PapaSierra>
morning, i'm new to Ruby. I'm trying to install redmine 2.0. When I run bundle list it tells me: The following gems are missing * tilt (1.3.3) * mime-types (1.18) * mail (2.4.4) what do I do about this?
Zolrath has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
PapaSierra: what is redmine
<MasterLambaster>
make bundle install
jcromartie has joined #ruby
andantino has joined #ruby
<kzar>
bnagy: What do you make of FFI? Could that be better for what I want?
tomzx has quit [Ping timeout: 244 seconds]
<bnagy>
if win32api won't work then ffi won't work
<bnagy>
afaik
<kzar>
bnagy: So it doesn't let you use com objects or whatever?
<bnagy>
only if you do what I did (the thing I pasted before)
andantino has quit [Quit: Leaving]
chrismcg is now known as zz_chrismcg
<kzar>
ok thanks
<bnagy>
you can do the same thing with win32api, kind of, it's just not as clean
<Hanmac>
FFI is not allways better then an native gem
dbgster has joined #ruby
dv310p3r has quit [Ping timeout: 272 seconds]
<bnagy>
and there are issues with methods with very long prototypes
jayrulez has quit [Ping timeout: 245 seconds]
nari_ has joined #ruby
d3vic3 has quit [Ping timeout: 244 seconds]
savr has joined #ruby
<savr>
hi
<savr>
I got an idea for smart CDN
nari has quit [Ping timeout: 265 seconds]
d3vic3 has joined #ruby
<savr>
basically assets can be stored on multiple networks
<savr>
assets-n1, assets-n2, etc
dbgster has quit [Client Quit]
<savr>
the user is given an equal amount of data to load from each network
<savr>
it is time via javascript
<banisterfiend>
savr: keep the idea to yourself and sell it for scrill
<bnagy>
not that this isn't fascinating, but it sounds like they might like it more on #rubyonrails
amalvagomes has quit [Quit: amalvagomes]
<savr>
and that is use to optimise which networks are used
<banisterfiend>
bnagy: be naggy
<savr>
bnagy, thanks... I was in #rails and it looked dead.
<banisterfiend>
savr: it's more of a spiritual death
<banisterfiend>
rails programmers have no souls
<bnagy>
rails is the death of the soul, man
<bnagy>
ha! snap
krusty_ar has joined #ruby
<rking>
♡ Rails.
<rking>
Just sayin'.
<banisterfiend>
"haiii! i prgrm railz for last 4 years, but hvnt lrn ruby yet. Can u tell me how to do loop?"
nari__ has joined #ruby
<bnagy>
lol
d3vic3 has quit [Ping timeout: 240 seconds]
* rking
has no snappye comebakk. Only that Rails does a good job of some kinds of tasks.
<bnagy>
selling DIMMs?
bigkevmcd has quit [Ping timeout: 240 seconds]
scb has joined #ruby
<rking>
I see what you did, there.
d3vic3 has joined #ruby
MasterLambaster has quit [Read error: Connection reset by peer]
<bnagy>
do they still recommend that you restart the server every so often to clear memory leaks?
MasterLambaster has joined #ruby
<bnagy>
that be some might fine serftwarrr engyneerin, yes SIR
scb has quit [Read error: Connection reset by peer]
nari_ has quit [Ping timeout: 245 seconds]
mengu has joined #ruby
bobdobbs` has quit [Ping timeout: 256 seconds]
sepp2k has joined #ruby
fayimora_ has joined #ruby
d3c has joined #ruby
fayimora has quit [Ping timeout: 272 seconds]
fayimora_ is now known as fayimora
pjn_oz has quit [Remote host closed the connection]
IrishGringo has quit [Ping timeout: 272 seconds]
geers has joined #ruby
vitor-br has joined #ruby
vitor-br has quit [Read error: Connection reset by peer]
nipra has quit [Ping timeout: 256 seconds]
Kabaka has quit [Ping timeout: 276 seconds]
christianrojas has joined #ruby
IrishGringo has joined #ruby
yugui_zzz is now known as yugui
webguynow has joined #ruby
matti has quit [Quit: 8-X]
yugui is now known as yugui_zzz
schaerli has joined #ruby
yugui_zzz is now known as yugui
wangr has joined #ruby
fr0gprince_ma has joined #ruby
ratnikov has quit [Ping timeout: 272 seconds]
mneorr has quit [Remote host closed the connection]
fbernier has joined #ruby
jackiechan0 has quit [Read error: Connection reset by peer]
indian has quit [Ping timeout: 250 seconds]
tommyvyo has joined #ruby
Jackneill has joined #ruby
dnyy has quit [Ping timeout: 260 seconds]
indian has joined #ruby
dnyy has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
hynkle has joined #ruby
ghanima has quit [Ping timeout: 240 seconds]
n1x has quit [Ping timeout: 240 seconds]
<lxsameer>
hi, when i try to run thin to serv redmine i get this error http://dpaste.com/749310/ what should i do ?
gmci has quit [Read error: Connection reset by peer]
gmci has joined #ruby
elliot98 has quit [Remote host closed the connection]
ananthakumaran1 has quit [Quit: Leaving.]
pu22l3r has quit [Remote host closed the connection]
ConstantineXVI has joined #ruby
foofooba1 is now known as foofoobar
elliot98 has joined #ruby
kpshek has joined #ruby
jaystay has quit [Quit: jaystay]
dustybrains has quit [Quit: leaving]
maesbn has joined #ruby
IrishGringo has joined #ruby
DuoSRX has quit [Read error: Connection reset by peer]
DuoSRX_ has joined #ruby
jaystay has joined #ruby
<lxsameer>
how can i force bundle to don't install a gem ?
terra-and-luna has joined #ruby
wiwiwiwiwiwiwiwi has joined #ruby
<wiwiwiwiwiwiwiwi>
hi
yugui_zzz is now known as yugui
<carloslopes>
lxsameer: group it in a group and do bundle install --without group_name
<carloslopes>
lxsameer: or, comment it in your bundle file :)
<lxsameer>
carloslopes: let me try
zastaph has quit []
snearch has joined #ruby
<wiwiwiwiwiwiwiwi>
im a ruby noob
<lxsameer>
carloslopes: i'm new to ruby. what is the bundle file names ? or how can i create a group ?
<wiwiwiwiwiwiwiwi>
i am new in ruby
snearch has quit [Read error: Connection reset by peer]
snearch has joined #ruby
sahli has joined #ruby
jackiechan0 has joined #ruby
<carloslopes>
lxsameer: the file that you set up your dependencies is called Gemfile (without extension!) .. and to create a group in it, look here at the documentation, is very simple http://gembundler.com/
mrwalker has joined #ruby
dustybrains has joined #ruby
<lxsameer>
carloslopes: thanks man
<carloslopes>
lxsameer: yw
<fowl>
wiwiwiwiwiwiwiwi, cool keep checking your mailbox, your trucker hat with new airflow design should arrive soon
kpshek has quit []
d3c has quit [Ping timeout: 240 seconds]
jrist-afk is now known as jrist
PaciFisT has joined #ruby
jackiechan0 has quit [Read error: Connection reset by peer]
<shevy>
lol
maesbn has quit [Remote host closed the connection]
<shevy>
wiwiwiwiwiwiwiwi why do u say thar
<shevy>
that
stroem has quit [Read error: Connection reset by peer]
jackiechan0 has joined #ruby
d3c has joined #ruby
uris has joined #ruby
ddv has quit [Quit: *poof*]
<savr>
noob alert
<savr>
must leave channel
raul782 has quit [Read error: Operation timed out]
krusty_ar has quit [Read error: Connection reset by peer]
buhhhh has quit [Read error: Connection reset by peer]
savr has left #ruby ["Ex-Chat"]
yugui is now known as yugui_zzz
ananthakumaran has joined #ruby
tsd_usa has joined #ruby
Helius has joined #ruby
krusty_ar has joined #ruby
<tsd_usa>
Is it clear that when ruby will actually support "real" multi-threading?
Resure has joined #ruby
<banisterfiend>
tsd_usa: jruby
<tsd_usa>
besides that?
<tsd_usa>
Because I see that 1.9 only uses GIL, it seems that in the coming version, cruby will support multi-threading, is it true??
<carloslopes>
savant: maybe there are something wrong with your config.ru file
clockwize has joined #ruby
<savant>
looks like I did not need to specify "master"
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
d3c has quit [Read error: Connection reset by peer]
<carloslopes>
savant: yes.. i don't know what arguments are expected by unicorn but maybe it is considering that the master in the command is your rackup file
<savant>
ya
<savant>
bundle exec unicorn -c unicorn.cnf -E production -D
<savant>
werked
<savant>
idk anything about ruby
sahli has quit [Quit: Leaving...]
macer1 has quit [Ping timeout: 272 seconds]
<savant>
im happy its rubular now
Vert has joined #ruby
Morkel has joined #ruby
whowantstolivefo has left #ruby [#ruby]
Progster has joined #ruby
<carloslopes>
savant: sweet :)
Hanmac has joined #ruby
<savant>
i write in the best language evar
<savant>
php
<savant>
idk why they even made ruby
<Hanmac>
oh NO he said the P-Wort
<savant>
what?
<savant>
perl?
nipra has joined #ruby
<savant>
perl is cool too
jprovazn has quit [Quit: Leaving]
<savant>
have you guys never used phing to deploy
<savant>
its like magic
<savant>
i bet there are no good deploy tools for ruby
<savant>
do you all still ftp stuff to your dreamhost accounts?
<carloslopes>
savant: i never used phing.. but, did you see capistrano?
<savant>
you mean that place with the birds in california?
<Synthead>
is there a way I can define two hash elements with the same value without repeating the values? kind like hash = { :this, :that => 'in :this and :that' }
<shevy>
noone will believe you now
<savant>
at least some of you thought it was funny lol
<shevy>
Synthead, that wont work
<carloslopes>
shevy: +1
<Synthead>
shevy: I know, that's why I'm asking
HashNuke has quit [Client Quit]
tsou has quit [Quit: leaving]
<shevy>
I dont think you can do so on a hash directly
<Hanmac>
banister is an example that shows that trolls can create good things too
<rking>
savant: Yes, irb / python / php -a are all REPLs — Read, Eval, Print Loops.
wmoxam has joined #ruby
<shevy>
banister is not really a troll
wmoxam has quit [Changing host]
wmoxam has joined #ruby
<shevy>
he is a pervert that can code who sometimes trolls a little
<savant>
can't you do "hash = { :var => :foo}; hash[:bar] = hash[:var]" ?
ckrailo has joined #ruby
<savant>
rking: I was kidding, i'm well aware of ruby ;)
<shevy>
aha
<shevy>
we now know that savant knows ruby
<rking>
savant: Oh, my bad. =)
<savant>
lol
petercs has joined #ruby
<savant>
I wrote a package indexer for a php framework based on jekyll the other day
<savant>
it was pretty lulzy
<shevy>
ewww
<shevy>
how can you stand php's syntax?
<savant>
i actually like php
<Synthead>
shevy: suppose I could use a hash itself as a hash index
<savant>
it gets the job done. it was also my first lang
<shevy>
php can be useful, see mediawiki
<savant>
although ruby is pretty good for DSLs
zastaph has joined #ruby
<shevy>
but I find the syntax terrible
pu22l3r has joined #ruby
<savant>
I'm a great fan of Chef and capistrano
digitalcakestudi has quit [Ping timeout: 244 seconds]
<shevy>
Synthead hmmm
<Synthead>
shevy: or an array, rather: hash = { [ :this, :that ] => 'both' }
<savant>
one thing that annoys me is making a dsl similar to chef isn't well documented anywhere
<savant>
but thats not a language issue, more of a documentation issue
asdfqwer has joined #ruby
<shevy>
Synthead you kinda want an alias?
<shevy>
hash[main_key]
<shevy>
hash[alias1]
<shevy>
hash[alias2]
<shevy>
the latter pointing to main_key ?
<Synthead>
shevy: well, I'm defining how something in a view is going to look by stating an array. suppose I should just make a case clause and put it in a helper
<shevy>
anyway, Synthead you could channel it through a method and in that method keep track of aliases, in a new, smaller hash perhaps
ABK has quit [Ping timeout: 248 seconds]
jchauncey has joined #ruby
<shevy>
I really dont think you can use an alias in a hash, to point to another entry of that very hash directly
<td123>
anyone know what ruby libs try to provide what the python library 'requests' provides?
<savant>
i just wrote my own wrappers around Net::HTTP that mimic how php works
brianpWins has quit [Quit: brianpWins]
joe__K has quit [Quit: Page closed]
zebe42 has quit [Read error: Connection reset by peer]
<shevy>
hehe
yonggu has quit [Ping timeout: 272 seconds]
gmci has quit [Ping timeout: 245 seconds]
d3vic3 has quit [Ping timeout: 250 seconds]
<foofoobar>
I'm using garb to fetch some google analytics data in RoR. I don't know why, but it seems like some data is kept in memory so additional calling of garb functions produce an google api error (different, strange errors..)
dnyy has quit [Remote host closed the connection]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<foofoobar>
Because Garb is using some class vars I would like to "reset" or to clean everything which was done
d3vic3 has joined #ruby
<foofoobar>
so the next call to Garb::Session will always be the same
<foofoobar>
How can I reset the class vars or complete reload all?
kenperkins has quit [Quit: Computer has gone to sleep.]
gmci has joined #ruby
snip_it has joined #ruby
<Travis-42>
Is there a replacement for the deprecated URI.encode that solves the problems of the original function -- that escapes individual URI components?
Targen has joined #ruby
MasterLambaster has joined #ruby
jackbrownhf has joined #ruby
jackbrownhf is now known as msgserve
msgserve is now known as jackbrown0
<td123>
I'll go with rest-client, I really like it :)
jackbrown0 is now known as jackiechan01
bpgoldsb has quit [Ping timeout: 272 seconds]
jackiechan0 has quit [Ping timeout: 245 seconds]
jackiechan01 is now known as jackiechan0
gyre007 has joined #ruby
test34- has joined #ruby
lkba has joined #ruby
jackiechan0 has quit [Client Quit]
<foofoobar>
is there a way to define a "scope" so all stuff defined inside is forgotten after the scope closes?
jackiechan0 has joined #ruby
Asher1 has joined #ruby
d3vic3 has quit [Read error: Operation timed out]
digitalcakestudi has joined #ruby
schovi has quit [Remote host closed the connection]
jrist-demo is now known as jrist
sethetter has joined #ruby
<apeiros_>
fork do …stuff… end # non-portable and somewhat difficult to use
<apeiros_>
@ foofoobar
<Mon_Ouie>
Not in the language itself. There's a kind of hack that allows to do this in 1.9 though
Asher has quit [Ping timeout: 245 seconds]
bpgoldsb has joined #ruby
<sethetter>
Is there a way to specify a list separator for {{ post.categories }} in jekyll?
<Mon_Ouie>
apeiros_: I assumed he wanted a let-like construct
<lectrick>
https://gist.github.com/2719607 So these were some interesting benchmark results for some typical Ruby string operations...
jchauncey_ has joined #ruby
d3vic3 has joined #ruby
<apeiros_>
lectrick: missing one using the o-flag
wvms has quit [Quit: wvms]
jchauncey_ has quit [Read error: Connection reset by peer]
SilverMonkey has joined #ruby
jchauncey_ has joined #ruby
jchauncey has quit [Read error: Connection reset by peer]
jchauncey_ is now known as jchauncey
<apeiros_>
also I hate it when people write literal integers with >4 digits without using _ as thousands separator…
<savant>
sethetter: what do you mean by that
<savant>
<3 jekyll
<savant>
im a jekyll master
bpgoldsb has quit [Remote host closed the connection]
bpgoldsb has joined #ruby
eykosioux has joined #ruby
<lectrick>
apeiros_: the o flag? on a regex literal you mean?
SilverMonkey has quit [Client Quit]
<apeiros_>
lectrick: yessir
<lectrick>
apeiros_: pardon my ignorance, what does that do? :)
eykosioux has quit [Client Quit]
<apeiros_>
compile the regex only once. see ri Regexp ;-)
<lectrick>
OH.
eykosioux has joined #ruby
<lectrick>
interesting.
eykosioux has quit [Client Quit]
<sethetter>
savant: I'm using {{ post.categories }} to list categories on each of my blog posts, but it's rendering them with no space or anything in between the words. Is there a way to specify a separator like ", "?
<Mon_Ouie>
I'd like a 1eN integer literal for that kind of stuff (I usually use the 1e6.to_i)
<savant>
cant you iterate over them?
eykosioux has joined #ruby
<apeiros_>
Mon_Ouie: I use bench
<apeiros_>
and bench invokes to_i :-)
<sethetter>
savant: I could, wasn't sure if there was a shorter way similar to specifying date formats for post.date
<apeiros_>
iirc, it must be a literal regex, on the lhs of an =~ call, and it must not contain any interpolation sequences.
<zii>
Oh, I was doing it the other way around.
dekroning has joined #ruby
<rking>
zii: Also it's (?<>…), not simply ?<>…
<apeiros_>
true
<lectrick>
shevy/rking: It's almost like I didn't want to know about that implementation detail, because now it might affect my lovely interpreted code :O
cpruitt has joined #ruby
<rking>
lectrick: Meh. It's a good speed hack. Remember PO=ROE.
<shevy>
lectrick well the thing in ruby is, I care little about +0,00005% speed improvements
<lectrick>
rking: post optimization = ?
niklasb has joined #ruby
<lectrick>
shevy: Yeah, true. But if you have some code that is only dealing with strings it might be interesting to keep in mind.
BeLucid has quit [Read error: Connection reset by peer]
<shevy>
it would be really awkward to use a language like ruby, and then spend time going into speeding up things
<rking>
lectrick: Premature Optimization is the Root of all Evil.
<lectrick>
ahaha.
evangelion has quit [Quit: Leaving]
<lectrick>
rking: It's ok if it's covered by tests, right? Right? :)
BeLucid has joined #ruby
<rking>
As they say: 1. Make it work (passes all tests), 2. Make it right (is refactored), 3. Make it fast (using profiling + benchmarking)
mockillo has quit [Ping timeout: 252 seconds]
mockillo has joined #ruby
srnty has quit [Ping timeout: 260 seconds]
<shevy>
rking, but what if it still sucks after doing all that?
visof has quit [Ping timeout: 272 seconds]
dekroning has quit [Quit: leaving]
DrShoggoth has joined #ruby
MasterLambaster has quit [Quit: MasterLambaster]
<rking>
shevy: Then uhh... apply the uh... Law of Demeter.
<Mon_Ouie>
If it sucks after you did all that, you didn't do all that
bpgoldsb has quit [Remote host closed the connection]
robotmay has quit [Remote host closed the connection]
crescendo has quit [Read error: Connection reset by peer]
yosinof has quit [Remote host closed the connection]
sallyz has quit [Ping timeout: 245 seconds]
savage- has joined #ruby
bpgoldsb has joined #ruby
EzeQL has joined #ruby
fr0gprince_ has quit [Ping timeout: 244 seconds]
d3c has quit [Read error: Connection reset by peer]
nipra has quit [Ping timeout: 252 seconds]
afallows has quit [Ping timeout: 240 seconds]
yosinof has joined #ruby
kenichi has joined #ruby
tsou has joined #ruby
cha1tanya has quit [Ping timeout: 260 seconds]
MasterLambaster has joined #ruby
MasterLambaster has quit [Read error: Connection reset by peer]
MasterLambaster has joined #ruby
raul782_ has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
MasterLambaster has quit [Client Quit]
fr0gprince_ has joined #ruby
elliot98 has quit [Quit: Konversation terminated!]
bpgoldsb has quit [Ping timeout: 248 seconds]
huamm has joined #ruby
bpgoldsb_ has joined #ruby
a_a_g has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
a_a_g has quit [Client Quit]
davidcelis has quit [Ping timeout: 248 seconds]
manxingxing_ has joined #ruby
mpereira has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
scriptmonkey has joined #ruby
ybit2 has joined #ruby
raul782 has quit [Ping timeout: 260 seconds]
Eldariof-ru has quit [Ping timeout: 245 seconds]
Araxia_ has joined #ruby
a_a_g has joined #ruby
cbuxton has joined #ruby
rakm has joined #ruby
fayimora has quit [Quit: Busy…..zzzzz]
liluo has quit [Remote host closed the connection]
MasterIdler has joined #ruby
scriptmonkey has quit [Quit: Page closed]
huamm has quit [Ping timeout: 245 seconds]
foofoobar has quit [Quit: bb]
scriptmonkey_ has joined #ruby
etehtsea has quit []
bluOxigen has quit [Ping timeout: 255 seconds]
<scriptmonkey_>
I am new and have a couple dumb questions, so I will apologize in advance.
iocor has quit [Quit: Computer has gone to sleep.]
<savant>
you better be sorry
<savant>
;)
<scriptmonkey_>
I have my new cool object. lets call it Host. (for server information)
keithcelt has joined #ruby
<savant>
cool
<scriptmonkey_>
what is the best way to to have may Hosts ? do I new a new myhosts = Hash.new ?
<savant>
that seems legit
<savant>
if you need them named
<savant>
if you just have a collection, use an array
kenperkins has joined #ruby
<scriptmonkey_>
then for each hash entry do myhosts["kirk"] = Host.new
<becom33>
http://pastie.org/3926205 I have few question . first of all why am I getting a name error at line 4 ?
<savant>
yeah that works
<becom33>
sorry line 8
<becom33>
test.rb:8: uninitialized constant Ist (NameError)
<ccooke>
scriptmonkey_: how do you need to access them? By name? Use a hash. Sequentially? an array. By something more complex? Maybe some class methods on the Host class, with underlying storage as Array or Hash as needed.
<carloslopes>
scriptmonkey_: use symbols for keys (if you could), it's better :)
cha1tanya has joined #ruby
malkomalko has joined #ruby
<apeiros_>
becom33: because Ist isn't defined at that point
ubercore has quit [Ping timeout: 252 seconds]
<becom33>
aww it should be on top
manxingxing_ has left #ruby [#ruby]
<apeiros_>
also note that initializing a global in a class serves no purpose. it's the same as doing it outside the class.
<savant>
why are symbols better?
<apeiros_>
(line 5)
<savant>
I was always confused by that when writing chef config stuff
<apeiros_>
becom33: line 13 you probably have another name error (commands)
<scriptmonkey_>
so, then my follow up question. can I have a method on my Hosts object that can operate on the entire hash? or do I have to interate through the hash?
<carloslopes>
savant: every time you put 'string' in your program, it create a new object, if you write any times a symbol, it is only one object (the same)
<savant>
ah
<savant>
interesting
<carloslopes>
savant: so, for some cases it's better to use symbols
dr_bob has quit [Read error: Connection reset by peer]
<carloslopes>
hmm enconding stuffs always make me confused :(
<savant>
you can have an embedded attribute
looopy has quit [Remote host closed the connection]
iocor has joined #ruby
univers has joined #ruby
<Sou|cutter>
CannedCorn: side-note, seems like a wtf that String has a bunch of 'is' methods. isutf() etc
<Sou|cutter>
err isutf8()
LBRapid has joined #ruby
<becom33>
well this script is written normally to get commands out from another class , the methods are used as commands
timonv has quit [Remote host closed the connection]
afallows has joined #ruby
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt
looopy has joined #ruby
<Sou|cutter>
CannedCorn: another option is to use exception handling. begin str.encode('UTF-8') rescue...
maletor has joined #ruby
ackz has quit [Remote host closed the connection]
test34- has quit [Ping timeout: 260 seconds]
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt http://pastie.org/3926270 ..can anyone help ?
test34 has joined #ruby
ackz has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
nlc has joined #ruby
dr_bob has joined #ruby
<Hanmac>
Sou|cutter where did you see an isutf8() method?? it is not in ruby
<Mon_Ouie>
(just with dup to avoid changing the encoding of the initial string)
<Sou|cutter>
Mon_Ouie: if you read upwards, that was what I suggested before the rescue thing
schaerli_ has joined #ruby
<Sou|cutter>
I just wasn't sure if CannedCorn was using a strict definition of compatible, or a looser one
<CannedCorn>
i want to raise an error if the string is not valid utf8?
<CannedCorn>
hrm
schaerli has quit [Read error: Operation timed out]
abra has quit [Ping timeout: 276 seconds]
ghanima has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
Sou|cutter: I'm not sure what you mean… upwards is where I found the reference to that method.
cha1tanya has quit [Quit: Leaving]
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt http://pastie.org/3926270 ..can anyone help ?
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt
<Sou|cutter>
Mon_Ouie: ok... I'm confused, I think we're on the same page
abra has joined #ruby
<CannedCorn>
duping the string is expensive though
<Mon_Ouie>
No it's not
<Mon_Ouie>
Ruby uses copy-on-write
nowthatsamatt has joined #ruby
nowthatsamatt has left #ruby [#ruby]
carloslopes has quit [Ping timeout: 245 seconds]
<becom33>
oh come on no one ?
<robacarp>
becom33: I can't even understand what you're asking.
ixti has joined #ruby
<becom33>
robacarp, did you see my script ?
<becom33>
I'll explain one by one. please open the script and tell me
shruggar has joined #ruby
<CannedCorn>
why does this complain that str is frozen str.force_encoding('binary')
tsd_usa has quit [Quit: tsd_usa]
<CannedCorn>
when str.frozen? is false
<becom33>
robacarp, did you ?
Rickmasta has joined #ruby
davidcelis has joined #ruby
<Mon_Ouie>
Can you show an example? It is more likely for str to actually be frozen than for Ruby to be wrong
<becom33>
robacarp, ? :(
<robacarp>
becom33: chill man, I'm trying to read what your pastie says...
<becom33>
robacarp,
<becom33>
go wid me
<becom33>
robacarp, read from bottom to top . might easire that way
<becom33>
anyway robacarp the class Prompt is using commands on CmdLst class . the "methods" are used as "commands" . ok ?
<becom33>
robacarp, did u get that ?
cordoval has joined #ruby
philcrissman has quit [Remote host closed the connection]
cordoval has left #ruby [#ruby]
chrismcg is now known as zz_chrismcg
sameerynho has joined #ruby
<eam>
how do I figure out my architecture from within ruby? i386 vs x86_64
wvdschel has joined #ruby
burgestrand has joined #ruby
lxsameer has quit [Ping timeout: 250 seconds]
<a_a_g>
RUBY_PATFORM
francisfish has quit [Remote host closed the connection]
iocor has quit [Quit: Computer has gone to sleep.]
<eam>
a_a_g: oh great, thanks
<Hanmac>
eam RUBY_PLATFORM but is mostly not your architecture, its the architecture of ruby with is sometimes not the same
<eam>
Hanmac: yeah, that's what I'm looking for -- I need it because syscall() numbers change depending on whether ruby is build 32/64bit on linux
burgestrand has quit [Remote host closed the connection]
<CannedCorn>
Mon_Ouie str.dup.force_encoding(UTF8).valid_encoding? doesn't do anything
<eam>
I don't suppose there's a handy import module for those, btw, similar to syscall.ph in perl?
TheFuzzball has joined #ruby
<becom33>
umm robacarp
<becom33>
??
<CannedCorn>
force_encoding.valid_encoding doesn't actually check the bytes
<eam>
I'm hitting the compile-time 1024 fd limit in IO.select, and I can't find any notification modules for ruby that do libevent, poll, etc
christianrojas has quit [Quit: Leaving...]
<Hanmac>
eam about architecture, i have an 64 bit system, but i can run 32 bit programs and i have 32 bit libraries, so you may be fool'd with your platform check
yosinof has joined #ruby
<eam>
Hanmac: yeah, I think RUBY_PLATFORM should be giving me the architecture of the ruby interpreter, which is what I want
<eam>
an x86_64 kernel uses a separate syscall dispatch table depending on the architecture of the process
<eam>
eg poll = 168 for a 32bit ruby and 7 for a 64bit ruby
<Hanmac>
eam ... ruby has a syscall function :P
c0rn has joined #ruby
hasrb has joined #ruby
jaystay has quit [Quit: jaystay]
banjara has joined #ruby
banjara has quit [Changing host]
banjara has joined #ruby
srnty has joined #ruby
<becom33>
i guess robacarp is AFK :/
kpshek has quit []
<becom33>
can anyone else help me ?
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt http://pastie.org/3926270 ..can anyone help ?
shruggar has quit [Quit: Leaving.]
<Hanmac>
eam: ri has an interesting waring about syscall: "syscall is essentially unsafe and unportable. Feel free to shoot your foot." :P
<eam>
Hanmac: yeah, but it expects the raw syscall number, which varies depending on the architecture
<eam>
perl has a nice syscall.ph which handles this for you, mapping the syscall name to the particular dispatch number
<eam>
Hanmac: and it's way unsafe :)
alienvenom has quit [Ping timeout: 240 seconds]
sparrovv has quit [Ping timeout: 244 seconds]
<eam>
I don't know that I'd call poll unportable though, any reasonable unix supports it
<CannedCorn>
Mon_Ouie the problem is I've got a string "\xC3\xB6".force_encoding("ISO-8859-1")
<CannedCorn>
and when i try the check you suggest, id passes
<eam>
1.9 uses poll internally on linux, but I'm stuck with 1.8 for now
<becom33>
no one for me ?
<Hanmac>
"stuck with 1.8" ... i feel sorry for you ... or should i say: "HaHa"
<eam>
Hanmac: gotta support RHEL system interpreter -- I don't use it for apps though
<eam>
:(
stkowski has quit [Quit: stkowski]
ryannielson has joined #ruby
ryannielson has quit [Client Quit]
jaystay has joined #ruby
<eam>
looks like even in 1.9 though, ruby doesn't have access to any current-gen notification systems
ryannielson has joined #ruby
mcwise has joined #ruby
davidcelis has quit [Quit: K-Lined]
<eam>
there's eventmachine, but that's useless if you're after notification and not a all-or-nothing event driven processing model
stephenjudkins has joined #ruby
looopy has quit [Remote host closed the connection]
<Mon_Ouie>
CannedCorn: You mean you're checking if it's valid ISO-8859-1? If so, it works because it *is*
<Mon_Ouie>
And it's ö in UTF-8 so it's valid there too
wvdschel has quit [Read error: Connection reset by peer]
twixmix has quit [Ping timeout: 244 seconds]
<CannedCorn>
ISO-8859-1 isn't valid utf-8 though
adamkittelson has joined #ruby
jaystay has quit [Client Quit]
<Mon_Ouie>
No, but that particular sequence you have is — it just doesn't mean the same thing in both encodings
<becom33>
no one for me ?
<becom33>
now there is this new two modules comes alone and it also has methods as command . how can I use those commands in the prompt http://pastie.org/3926270 ..can anyone help ?
uris_ has joined #ruby
uris has quit [Read error: Connection reset by peer]
banseljaj is now known as imami|afk
uris_ has quit [Client Quit]
mneorr has quit [Remote host closed the connection]
uris has joined #ruby
looopy has joined #ruby
bluOxigen has joined #ruby
theRoUS has quit [Read error: Connection reset by peer]
b1rkh0ff has quit [Ping timeout: 272 seconds]
eykosioux has quit [Quit: eykosioux]
<becom33>
http://pastie.org/3926270 in this paste . i've made a class called "Prompt" which passes the commands to the class "CmdList" in CmdList class the methods are used as commands . now the problem is I have two modules "FirstModule","SecondModule" in that also we have methods . I want use those methos as commands . how can I do that ? the folder structure is mentioned in the script . please help
snearch has quit [Quit: Verlassend]
kpshek has joined #ruby
cordoval has joined #ruby
cordoval has left #ruby [#ruby]
wvdschel has joined #ruby
wvdschel has quit [Changing host]
wvdschel has joined #ruby
StevenR12 has left #ruby [#ruby]
a_a_g has quit [Ping timeout: 256 seconds]
alienvenom has joined #ruby
inteq has joined #ruby
jackiechan0 has joined #ruby
jackiechan0 has left #ruby [#ruby]
raul782_ has quit [Remote host closed the connection]
ubercore has joined #ruby
luxurymode has quit [Ping timeout: 244 seconds]
gokul has joined #ruby
brianpWins has joined #ruby
MasterLambaster has quit [Quit: MasterLambaster]
kenichi has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
carloslopes has joined #ruby
ubercore has quit [Client Quit]
jaystay has joined #ruby
a_a_g has joined #ruby
walbert has joined #ruby
novodinia has quit [Quit: leaving]
axl_ has joined #ruby
<Progster>
Ubuntu 12.04 - I just installed rvm, and now all of a sudden I'm not in the sudoers file anymore... Can't run su or su -, says authentication failure. WTF?
andev has joined #ruby
phantasm66 has joined #ruby
<lectrick>
I am trying to follow http://guides.rubyonrails.org/rails_on_rack.html and this line throws an exception on undefined "middleware" method: ActionController::Dispatcher.middleware = ActionController::MiddlewareStack.new do |m|
<lectrick>
crap wrong channel sorry
<Hanmac>
haha xD Progster what happendif you remove rvm?
youdonotexist_ has joined #ruby
youdonotexist_ has quit [Client Quit]
kpshek has quit []
b1rkh0ff has joined #ruby
gyre007 has quit [Quit: Ex-Chat]
ubercore has joined #ruby
kpshek has joined #ruby
voodoofish430 has joined #ruby
felipec has joined #ruby
khakimov has joined #ruby
andantino has joined #ruby
andantino has quit [Changing host]
andantino has joined #ruby
<felipec>
is there a way to do `command`.each_line that iterates on each one as they come instead of waiting for the whole output?
jlogsdon has joined #ruby
kenichi has joined #ruby
jayrulez has quit [Ping timeout: 245 seconds]
crankyco_ has quit [Remote host closed the connection]
<Progster>
I didn't try removing it yet
<Mon_Ouie>
felipec: Use IO.popen
<Mon_Ouie>
That way you can use IO#each_line which does what you want
crankycoder has joined #ruby
<felipec>
Mon_Ouie: all right, I thought something like that might be needed =/
youdonotexist_ has joined #ruby
<Mon_Ouie>
Why "=/"? It's not hard, just a few more lines
jayrulez has joined #ruby
nfluxx has joined #ruby
youdonotexist has quit [Ping timeout: 244 seconds]
youdonotexist_ is now known as youdonotexist
<Progster>
why I'm so confused right now
Ripp__ has joined #ruby
SphericalCow has joined #ruby
jchauncey has quit [Quit: jchauncey]
stkowski has joined #ruby
shruggar has joined #ruby
h4mz1d has quit [Ping timeout: 272 seconds]
jameshyde has joined #ruby
scb has joined #ruby
otters has joined #ruby
weasels has quit [Read error: Connection reset by peer]
schaerli_ has quit [Remote host closed the connection]
mong has left #ruby [#ruby]
jgarvey has joined #ruby
pdtpatrick has joined #ruby
adambeynon has quit [Quit: adambeynon]
timonv has quit [Remote host closed the connection]
niku4i has joined #ruby
moosya_ has quit [Quit: moosya_]
shruggar has quit [Ping timeout: 240 seconds]
<shevy>
becom33, looks quite complicated
<CannedCorn>
is there a C function to get a string encoding?
<CannedCorn>
i've got to do the same thing in c now
ddv has joined #ruby
k4mirox has joined #ruby
CannedCorn has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 272 seconds]
Targen has quit [Ping timeout: 255 seconds]
CannedCorn has joined #ruby
CannedCorn has quit [Client Quit]
imami|afk is now known as banseljaj
wilmoore has joined #ruby
<becom33>
yes plz help
lindenle has joined #ruby
<becom33>
shevy,
moosya has joined #ruby
gokul has quit [Quit: Leaving]
CannedCorn has joined #ruby
<lindenle>
I am using %x{diff -U 1000 <(echo #{ostring}) <(echo #{nstring})} and getting unexpected ")" do I need to escape something?
zeromodulus has joined #ruby
<becom33>
shevy, did u look at the sciript
<shevy>
becom33 yeah but it seems messy
mdw has quit [Remote host closed the connection]
<shevy>
in my opinion, complexity is the real root of all evil that is in software
theRoUS has joined #ruby
<becom33>
shevy, would it be fullfull if I explianed one by one . its not that complication . maby the way I explained its complicated
<apeiros_>
lindenle: the error might be in an earlier line
<becom33>
please I really need a help
<yxhuvud>
shevy: yes. The problem is that it is also the source of all functionality.
<apeiros_>
the part you pasted looks fine
<lindenle>
apeiros_: it goes away when I comment out this line
<shevy>
yxhuvud nah, that's like saying simple code would be useless
<shevy>
becom33 sure, explain, but start with this ... what is this code trying to solve?
<yxhuvud>
shevy: get enough simple code and it will be complex.
<lindenle>
apeiros_: when I print the line (puts) and then paste it back into terminal it works
<shevy>
btw are you sure you want to use modules becom33 ?
<becom33>
shevy, yes . thats the problem I'm having
d3c has quit [Read error: Connection reset by peer]
<shevy>
becom33 also, why do you subclass but dont call super ?
<shevy>
next thing - you use cmd
<becom33>
shevy, I dont underand
ukwiz has quit [Quit: Leaving]
<shevy>
becom33, man
felipec has quit [Remote host closed the connection]
<shevy>
do you know super
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 250 seconds]
<shevy>
btw, does the while loop work?
<shevy>
while cmd = Readline.readline($prompt+">", true)
<lindenle>
what is %x called anyway, I want to look it up
<shevy>
because without trying to understand it, it feels very strange
khakimov has quit [Quit: Computer has gone to sleep.]
<becom33>
shevy, yes the while loop works . the script works . only problem Im having getting modules inside of this
<becom33>
well yea the super class in CmdLst
<becom33>
is *
d3c has joined #ruby
headius has joined #ruby
<shevy>
ok
<shevy>
where do you use include NameOfModule?
<shevy>
in other words
Criztian has joined #ruby
<shevy>
where do you tell ruby what modules to use?
<shevy>
also I would change things like "def mod(ino=nil)" to "def mod(ino = nil)" I find that easier to read
<becom33>
shevy, at the moment I havnt coz I need to fix the logic 1st
* yxhuvud
prefer def mod ino=nil
<becom33>
shevy, the problem Im having do you see the my dir sturcture in the bottom ?
macer1 has joined #ruby
macer1 has quit [Changing host]
macer1 has joined #ruby
carloslopes has joined #ruby
cj3kim has joined #ruby
<becom33>
see in the module dir I have two more dir's with module names . like that there would be more modules . everytime I create a module I want it automaticlly to be used in the script
<Hanmac>
becom33 you did to tell ruby to require the files and include the modules ... ruby is not rails, it doesnt do anything on its own
flip_digits has joined #ruby
<becom33>
Manman in this script I havnt . coz its in the same script I havnt . the other thing I havnt thought how to use the modules so
tatsuya_o has quit [Remote host closed the connection]
<becom33>
i know rail is a framework
<becom33>
shevy, so what you think ?
headius has quit [Quit: headius]
<shevy>
becom33 I have no idea what I think
<shevy>
I want to know where you include your module
<becom33>
shevy, I havnt yet
sallyz has joined #ruby
<becom33>
I want to use the module but I dont know how can I do that . i know require 'module' and include Module . its not what Im asking
<shevy>
if you want to load all your modules into a class at runtime, load them all then do extend
blacktulip has joined #ruby
<shevy>
*use .extend
<becom33>
I want to load all my modules like in the bottom sturcture
<becom33>
shevy, whats extend is used for ?
<shevy>
and where is the problem, give the path to it to require
<becom33>
shevy, the problem is . think them as actuall modules of a framework ?
<becom33>
like when you write a module you don't go and do require module and in the core framework script right ?
schovi_ has quit [Remote host closed the connection]
mfridh has joined #ruby
krusty_ar has joined #ruby
Ammar01 has joined #ruby
Shamgar has joined #ruby
patronus has joined #ruby
xoebus has joined #ruby
lindenle_ has joined #ruby
brian- has joined #ruby
ged has joined #ruby
musl has joined #ruby
dv_ has joined #ruby
kvirani has joined #ruby
busybox42 has joined #ruby
<Mon_Ouie>
Net split has nothing to do with bots
tommyvyo has joined #ruby
krusty_ar has quit [Quit: I'm not here. This isn't happening]
musl has quit [Max SendQ exceeded]
skogis has joined #ruby
josefig has quit [Ping timeout: 272 seconds]
krusty_ar has joined #ruby
<shevy>
becom33 you could make a project too
sebastorama has joined #ruby
alanp has quit [Remote host closed the connection]
<becom33>
shevy, think I have to write a very basic framework .and I need a add plugins . and those modules are plugins
<becom33>
umm ?
gosshedd has joined #ruby
c0rn has joined #ruby
<shevy>
becom33 the code I showed you does not work for you?
Eldariof-ru has joined #ruby
<shevy>
collect all your fancy modules into an array, then do array.each {|a| bar.extend a}
<Hanmac>
a framework i knew it!! :P
<Mon_Ouie>
A framework is just a fancy name for a library that forces certain ways of structuring code on you
musl has joined #ruby
alanp has joined #ruby
<becom33>
shevy, just think of those Prompt, CmdLst, CmdLst are core classes . and the FirstModule , SecondModule as plugins . the methods in those modules/plugins . should be able to use commands in the core prompt
ryannielson has quit [Quit: ryannielson]
fukushima has quit [Quit: Leaving...]
clockwize has joined #ruby
<Icehawk78>
Hopefully a simple question - does anyone know how to add a filter using the sequel gem to select rows where a column is null?
niku4i has quit [Remote host closed the connection]
clockwize has quit [Client Quit]
Soul_Est has joined #ruby
<Icehawk78>
All of my attempts so far have either removed the expression from the sql's where clause, or appended (1 == 0)
nopper has joined #ruby
<becom33>
??
<becom33>
shevy,
jaystay has quit [Quit: jaystay]
<becom33>
please shevy can you do a example thing in the the script I gave you ? please will be a big help to undertand
clockwize has joined #ruby
<clockwize>
hey guys
c0rn_ has joined #ruby
keanehsiao has quit [Quit: Leaving...]
eywu has joined #ruby
<clockwize>
how can i start a process, getting back its PID, then kill it later?
<shevy>
becom33 the problem is, I have no idea what you want or need really. I take it that you want to (a) load some modules (b) extend one of your classes with all these modules
<shevy>
but unless I have missed something, I told you already and showed you already how to do that, via .extend
walbert has quit []
<becom33>
shevy, forget about my script for a second
jaystay has joined #ruby
ben- has quit [Ping timeout: 245 seconds]
<Synthead>
if I have string = 'this' and array = [ 'this', 'that' ], how can I check if string exists as an element in array?
scb_ has joined #ruby
ericalexander has joined #ruby
luxurymode has joined #ruby
scb has quit [Ping timeout: 252 seconds]
<Hanmac>
synthead: array.include?(string)
<becom33>
thing of a basic framework . where you can add plguins . and methods inside plugin script works as commands
<Synthead>
Hanmac: thanks :D
<savant>
becom33: like rake?
<shevy>
becom33 what do you mean with "commands"
<becom33>
savant, hmm I donno I havnt use rake
ben- has joined #ruby
mahmoudimus has joined #ruby
<becom33>
my commands are methods inside the class or the module
<savant>
what does your framework do
<savant>
is it a web framework?
jgrevich has joined #ruby
<becom33>
savage-, no scripting framework
stroem has joined #ruby
<shevy>
I feel this is all hopeless
<becom33>
I just need a very simple very basic framework be done . I have almost . im just stuck in this last part of modules
<becom33>
shevy, why
<savant>
a scripting framework for what
<savant>
what are you scripting
17SAA51V4 has joined #ruby
<becom33>
savant, umm a security framework
<savant>
a security framework?
<savant>
like what
<becom33>
like metasploit
TheIronWolf has joined #ruby
<savant>
so it is a webapp?
<savant>
or a command line tool
<Synthead>
Hanmac: can I do something like this? match = [ /\Athis/, /\Athat/ ]; a = 'this stuff'; a.match ... (not sure) ?
<becom33>
a command like tool
<savant>
okay so why not just use rake?
<becom33>
rake :/ I dnno about it
<savant>
rake is a tool for creating command line utilities in ruby
<shevy>
hmm how do I find out if my class has a method "foo" or not
<becom33>
savant, will you gime me permission to PM? I'll tell you exactly what I have in mind . you might be able to tell me if Im doing right or wrong
<savant>
k
a_a_g has quit [Quit: Leaving.]
<savant>
$65 USD an hour
<savant>
minimum 3 hours
<becom33>
O_O
<savant>
you can pay me via paypal
<becom33>
i dont have money :(
<savant>
or venmo
<savant>
oh thats sad
<savant>
then you can do it in public
<savant>
like a normal person
<becom33>
:( ok
<shevy>
:D
<savant>
i'll tell you if you're doing it wrong for free
<Synthead>
Hanmac: excellent, thank you!
<savant>
dont worry im the 9th best developer in NYC
<savant>
so i know what im talking about
<shevy>
when you get stuck, try to see if you can solve the problem differently
<shevy>
becom33, btw why do these have to be new modules?
<shevy>
cant you simply extend the class?
mneorr has joined #ruby
timonv has joined #ruby
<becom33>
shevy, umm extend what class ?
<savant>
becom33: wats your idea
<savant>
if you dont tell me, you're doing it wrong
<becom33>
savant,
<becom33>
jeez its very long explnation the whole idea :/
<savant>
and you want to pm it to me?
<becom33>
I dont have money
<savant>
so then public irc it is!
<shevy>
becom33 your parent class
<becom33>
shevy, you mean CmdList
<shevy>
becom33, why do you want to use modules actually?
<savant>
i think you're doing it wrong
<becom33>
shevy, actual meaning of the module
<savant>
you should base your tool on rake
<shevy>
ewww rake stinks
malkomalko has quit [Remote host closed the connection]
<savant>
your mother stinks
<savant>
something something nazis
<savant>
there, argument over
<shevy>
nothing worse than your mother savant
<savant>
my mother is a saint
<shevy>
in hell perhaps
<savant>
probs
MasterLambaster has joined #ruby
<becom33>
savant, ok I dont wanna explain . what If I PM you just a screen short of my work I've done so far ? you dont read . it will only take a minit look at
<savant>
what if you just post it publicly
<savant>
I PROMISE i wont steal your idea
<savant>
scouts honor
<becom33>
fine ..
<becom33>
Im not worried about anyone stealin my idea . its going to be a open source script
<shevy>
you showed this before but that is not you
<becom33>
come on guys . Im not a programmer . i'm working my ass off googling everything about ruby . chatting with you people so I can put something out where other people might get use of do somthing worth . jeez help . I just need a help
<makkura>
ahh.. executing the command externally like you've been trying is the best bet i know of.. Have you tried popen / popen3 (etc)?
<becom33>
look at image tell please if you still thinks fm is username my OS
<makkura>
that'll open the command as another thread
kpshek has quit []
<makerbreaker>
makkura, ill give it a try thanks
<becom33>
savant, did you ?
mneorr has quit [Ping timeout: 252 seconds]
<makkura>
makerbreaker: that's all i've got for advice for that.. hopefully it helps :) I used it in my minecraft wrapper and it worked out pretty well
<makerbreaker>
im just wondering how it handles memory
<makerbreaker>
the limitation is that I think it may be reading 16G inot memory, then writing it?
<makkura>
makerbreaker: mm well popen opens the given command in it's own thread, just like it would do so if you were running it on it's own
<makerbreaker>
ah k
deobald__ has quit [Ping timeout: 260 seconds]
<savant>
becom33: idk what fm is. doesn't matter though, its not pertinent to your issue. I just assumed you wanted an interactive cli tool
<makkura>
makerbreaker: it just gives you the process id and the stdin / out .. popen3 gives you stderr as well
pika_pika has joined #ruby
<savant>
if you want to build that tool that you have in the screenshot, i would just use rake
visof has quit [Ping timeout: 272 seconds]
<savant>
you should me some module code that is not related to your screenshot
<savant>
so i have no idea what you are trying to do
<savant>
please do not show unrelated stuff
<becom33>
fine savant wait
<savant>
or if you are trying to show "generic" code, don't. thats like showing Foo and Bar classes
francisfish has quit [Remote host closed the connection]
<savant>
i get that you're just checking the first word, trying to load some code, and then executing it
<becom33>
savant, so the name and age are methods in CmdList class
Bonkers has quit [Quit: Leaving]
theRoUS has quit [Ping timeout: 260 seconds]
jchauncey has joined #ruby
<becom33>
the first word is a method . second is the argvment passing to that methosd
<becom33>
method *
test34 has joined #ruby
<savant>
okay so whats the problem
albemuth has quit [Client Quit]
nlc has quit [Ping timeout: 272 seconds]
<becom33>
so my problem is do you see the "FirstModule" and "SecondModule" ? i want those modules methods to be used as commands like ive done before
berserkr has quit [Quit: Leaving.]
ben- has quit [Ping timeout: 244 seconds]
17SAA51V4 has quit [Quit: 17SAA51V4]
<becom33>
in the bottom of the script I have mentioned hows my folder stucture is going
kpshek has joined #ruby
<savant>
okay so whats the problem again
<pika_pika>
hi, it might be a noob question but i need to evaluate a bunch of expressions like: foo+(bar*baz/2) that are saved as strings in an array. Second array has objects that have attributes: name and value, where name is set to foo, bar, etc. and value is the value to be used in the expression. what would be the fastest way to acomplish that in ruby?
ben- has joined #ruby
<becom33>
savant, thats the problem . how can I do it ? and the thing is "FirstModule" and "SecondModule" are just examples . there could be more 10-20 modules
<savant>
first off
<savant>
module folders should be like
<savant>
first_module
<savant>
not
<savant>
firstmodule
<becom33>
ok
<savant>
then you can just Dir.glob() all your module folders
<savant>
and require the files in each dir
<savant>
once you name the folders properly
<savant>
you can infer what the names of the modules are
<savant>
and therefore you can use that to inspect the classes in the module
<becom33>
ok
<savant>
you also dont want to use modules
<savant>
you should have a top-level module
<savant>
CustomModule
<savant>
i dont care what you call it
<savant>
call it BananaHammock
<makkura>
becom33: If you're trying to dynamically call in only the modules you need (as you use them) you'll need to have the module identified in the command and require them. It looks like that's what you're going for with the 'mod' function to me.
<savant>
then you dont have "modules", you have "plugins"
<savant>
and you have
<savant>
plugins/first_plugin/something.rb
Heuristic has left #ruby [#ruby]
uris has joined #ruby
nlc has joined #ruby
<savant>
module BananaHammock; Class MyClass; end; end
<savant>
you would inspect the methods on that class
kpshek has quit []
rapind has joined #ruby
<savant>
the reason for the BananaHammock module is so you dont shit all over modules in the public namespace
etehtsea has joined #ruby
Solnse has joined #ruby
rapind has left #ruby [#ruby]
banjara has quit [Quit: Leaving.]
cordoval has joined #ruby
<becom33>
hmm
n1x has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
cbuxton has joined #ruby
theRoUS has joined #ruby
LBRapid has quit [Ping timeout: 244 seconds]
toddw has joined #ruby
cordoval has left #ruby [#ruby]
jayrulez has quit [Quit: Leaving]
univers has quit [Remote host closed the connection]
LBRapid has joined #ruby
univers has joined #ruby
looopy has quit [Remote host closed the connection]
artm has joined #ruby
nlc has quit [Quit: Leaving]
univers has quit [Ping timeout: 245 seconds]
mengu_ has quit [Quit: Konversation terminated!]
td123 has quit [Read error: Connection reset by peer]
eka has quit [Read error: Operation timed out]
scb has joined #ruby
vmatiyko has quit [Read error: Connection reset by peer]
scb_ has quit [Ping timeout: 272 seconds]
znake has joined #ruby
christianrojas has joined #ruby
d3c has quit [Read error: Connection reset by peer]
youdonotexist has quit [Quit: youdonotexist]
zeromodu_ has joined #ruby
andantino has quit [Quit: Leaving]
d3c has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
vmatiyko has joined #ruby
vmatiyko has quit [Read error: Connection reset by peer]
zeromodulus has quit [Ping timeout: 244 seconds]
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
hydrozen has joined #ruby
Eldariof59-ru has joined #ruby
francisfish has joined #ruby
cbuxton has quit [Ping timeout: 248 seconds]
vmatiyko has joined #ruby
josefig has joined #ruby
Eldariof-ru has quit [Read error: Operation timed out]
mneorr_ has quit [Remote host closed the connection]
cbuxton has joined #ruby
thecreators has joined #ruby
<shevy>
lol
<shevy>
BananaHammock?
mdw has joined #ruby
Solnse has quit []
<savant>
yes
<becom33>
shevy, still lost like a duck in a desert
eka has joined #ruby
chimkan_ has joined #ruby
<shevy>
becom33 that is because you are not thinking about the problem, you already decided that you have one solution and only one and that it must conform through a specific bottleneck
<becom33>
:/
maxok has joined #ruby
<becom33>
wait I thought of doing somthing . wait lemme show you the paste
<becom33>
yes from that how can include the ModuleName ?
<becom33>
thats issue Im having now
<shevy>
however I am not sure if you can reload modules, into your class, at runtime
<shevy>
via .extend
<shevy>
try self.extend
<shevy>
but actually
<becom33>
shevy, yes ?
<shevy>
why are these separate modules? cant they just be part of your parent class?
maxok has quit [Client Quit]
zeromodu_ is now known as zeromodulus
geers has quit [Remote host closed the connection]
jrist is now known as jrist-afk
<becom33>
well even a another use should have the capability of writing a module
<becom33>
for a example
Targen has quit [Ping timeout: 245 seconds]
<becom33>
apple is a exploit . knife is a module . so Im using knife module to to cut the apple . also if some one else want they can write a chopper module and use the chopper module to chop the apple
<becom33>
shevy, do you think i should have used rake ?
<becom33>
would it be more easy ?
<shevy>
I never recommended rake
cordoval has joined #ruby
<becom33>
ok what would you recommend then ? you've seen what is my requirement ?
cordoval has left #ruby [#ruby]
sparrovv has joined #ruby
<shevy>
I dont understand why the data must be stored within modules
<becom33>
shevy, have you heard about sql injection ?
<shevy>
yeah
<becom33>
I cant think of a exmaple to explain this so Im shooting with the real thing
<shevy>
but you can parse all incoming data in your class anyway
<becom33>
ok my module is sql_injector in portals like wordpress , joomla they have vulnerbilites like sql injection . so Im gonna use sql_injection module to sql inject the vulerbility
<becom33>
like sql injector . there are modules like file inclusion , cross site scripting
davidpk has quit [Ping timeout: 244 seconds]
yxhuvud has quit [Ping timeout: 245 seconds]
Targen has joined #ruby
nlc has joined #ruby
<rking>
becom33: Wait, you're trying to exploit stuff?
<becom33>
hay rking
Eldariof59-ru has quit []
<becom33>
yep
<rking>
Not cool. >=(
azm has joined #ruby
<becom33>
its pentest tool . not used for evil
Jackneill has quit [Ping timeout: 272 seconds]
<rking>
Ahh.
<becom33>
it's going to be a open source app
<benwoody>
like metasploit?
<becom33>
if you could help . I would really helpfull :/
<becom33>
benwoody, yep
Kartagis has quit [Ping timeout: 245 seconds]
<becom33>
benwoody, how'd you know about metasploit ?
<benwoody>
i use the internet
<becom33>
benwoody, aghh ok
vmatiyko has quit [Read error: Connection reset by peer]
davidpk has joined #ruby
deryldoucette has joined #ruby
<benwoody>
so i'm coming in on this in the middle it seems, but it looks like you're wanting to treat modules like these small, individual plugins
<becom33>
rking, could you help ? with your knowledge it will be easy to code somthing like this . just do the core . I'll code the rest :/
ryannielson has quit [Quit: ryannielson]
<becom33>
benwoody, yes
<rking>
becom33: Do you have a specific question?
vmatiyko has joined #ruby
<becom33>
rking, well yea
<shevy>
it's one problem to find out what he needs
<becom33>
not a easy one
<shevy>
rking, I think he wants to load modules into a class
<shevy>
and reload too at a later time
vmatiyko has quit [Read error: Connection reset by peer]
<benwoody>
becom33: what are you going to be 'pluging in' these modules to?
<becom33>
benwoody, since you know about metasploit , could you explian this fellas like I want to make somthing like a payload in metasploit
C0deMaver1ck is now known as showman94
<benwoody>
yeah, i'm getting there. you're heads in the right place i think, but you're going about it wrong
<shevy>
hehehe
showman94 is now known as Showman94
<benwoody>
first off, savant was right in the path he was taking you
vmatiyko has joined #ruby
<becom33>
maby Im explaining this wrong
<savant>
of course im right
Showman94 is now known as C0deMaver1ck
<savant>
its in my fucking name
<savant>
savant
<savant>
jeez
<benwoody>
;)
xaq has joined #ruby
<savant>
guys we've been over this
suppp has quit [Quit: suppp]
* rking
can't help but fill in the blank, _____-savant.
znake has quit [Read error: Connection reset by peer]
<savant>
smart-savant
<rking>
Oh.
znake has joined #ruby
vmatiyko has left #ruby [#ruby]
mickn has joined #ruby
<shevy>
savante?
<pradeepto>
If I want to run a command that needs sudo (ipfw) from a ruby script, would using `s work? Because right now, I see something like this -> sh: sudo ipfw pipe 1 config bw 1024kbps: command not found
<becom33>
ok im just gona ask you guys . would any of you would like to help me code this ? only thing I can do is give you a credit on the coding . Im not earning from this :/ i need the core coded
<shevy>
the martial arts? or was that savate
<becom33>
I have alomost everything coded
<pradeepto>
What is it that I am doing wrong?
<Hanmac>
arent savants people with nearly unhuman skills?
<becom33>
shevy, ? would you >
<becom33>
>
<becom33>
?
<rking>
pradeepto: Let me see your line.
Squarepy has joined #ruby
tatsuya_o has joined #ruby
<becom33>
umm ? sheve ?
<becom33>
shevy, *
<Hanmac>
pradeepto i think the best way is to run the ruby program with sudo .... "sudo ruby yourProgram.rb"
<pradeepto>
sh: sudo ipfw pipe 1 config bw 1024kbps: command not found
<pradeepto>
i get that ^
sei has joined #ruby
<rking>
pradeepto: I wonder where that "Running ... " is coming from.
<pradeepto>
btw, on a os x lion, if that is relevant
<rking>
Hrm, maybe.
<becom33>
shevy, ok how much would you want to code this ?
<pradeepto>
rking, that is a debug line that I didn't type here before.
<rking>
Ahh.
<rking>
pradeepto: Can you upload your whole script?
<becom33>
shevy, ?
<becom33>
rking, how much do you think it would cost to code this ?
<pradeepto>
rking, yes, pastebin-ing it right now.
<rking>
becom33: I don't know the spec of what you're trying to do, exactly.
<savant>
i can code it for you for 65 an hour
indeterminate has quit [Read error: Operation timed out]
Guedes is now known as Guedes_out
<becom33>
savant, how much ?
rdegraci has joined #ruby
<becom33>
please guys be reasonalble :/ its going to be a open source project and Im just 19 dont have much money
<savant>
i love open source
<savant>
didnt i already say that
<savant>
im being reasonable!
<savant>
i dont know any ruby, so I have to charge more
<savant>
just put your code on github
<savant>
open sores all the things
<savant>
then maybe i will follow and fix your code
<savant>
im actually a gitbot
<shevy>
becom33 you already write ruby code
<savant>
i fix code on github
<shevy>
your code works too
minijupe has joined #ruby
<becom33>
shevy, yes I know but some stuff doesn't work :/ and I want this to be working . don't have much money . thats why I asked you if you can join to code the core .
BeLucid has quit [Read error: Connection reset by peer]
zii has quit [Read error: Connection reset by peer]
<shevy>
rking, what does becom33 want, can you tell me?
cbuxton has quit [Ping timeout: 245 seconds]
zii has joined #ruby
francisfish has quit [Remote host closed the connection]
zii has quit [Changing host]
zii has joined #ruby
cbuxton has joined #ruby
<rking>
shevy: Some kind of wordpress/joomla/etc penetration testing framework.
<benwoody>
becom33: i think you should learn the inheritance hierarchy and how to pass blocks. you'll be creating classes (or modules) for each "exploit" that you'll want to pass to main
jrist-afk is now known as jrist
BeLucid has joined #ruby
youdonotexist has joined #ruby
<becom33>
shevy, PM ?
raul782 has joined #ruby
Ripp__ has quit [Remote host closed the connection]
banjara has joined #ruby
sallyz has quit [Ping timeout: 272 seconds]
<rking>
pradeepto: (Looking.)
d3c has quit [Read error: Connection reset by peer]
<pradeepto>
thanks
youdonotexist has quit [Remote host closed the connection]
<rking>
pradeepto: Try it with system `"#{CREATEPIPECMD}"`
<rking>
Urr
<rking>
system CREATEPIPECMD
<rking>
You're not capturing the output so ``s are needless.
<shevy>
becom33 no PM, I dont understand what you want, you tried to explain it so many times, I still dont understand it
<becom33>
shevy, there is nothing hard about it . only thing Im stuck with the logic
stephenjudkins has quit [Client Quit]
Nahra has quit [Quit: leaving]
<pradeepto>
rking: I had tried, that seems to block or some such, the app freezes, when I do a CTRL+C, some ruby process goes berserk and eats up all of cpu.
<rking>
Hehe
scb_ has joined #ruby
<rking>
pradeepto: FWIW I've replicated the problem.
<pradeepto>
rking: from the debug statements it seems that, sinatra's main thread doesn't start or some such, at least I don't see any webrick start up lines.
<pradeepto>
oh
<rking>
(Had to pare it down a bunch and also use dos2unix on it)
scb has quit [Ping timeout: 272 seconds]
<rking>
pradeepto: Oh.
cmarques has joined #ruby
<rking>
Hehe, I didn't notice. Your code you uploaded is different from: 15:58 <pradeepto> rking: `#{CREATEPIPECMD}`
<rking>
That one is right. `"#{…}"` is wrong.
<rking>
(No double quotes needed.)
<rking>
pradeepto: Do me a favor and change line 41 to: system CREATEPIPECMD
<shevy>
becom33 this for sure sounds like a lot of work
<AtoxHybrid>
Hello, I have a multithreaded app writing a Hash to a yaml file every so often, so obviously I wrapped Thread.exclusive around that
<AtoxHybrid>
magically though, it seems to break Thread.exclusive causing two thread to save to the same file twice
<becom33>
shevy, not really I've done almost everything only few stuff I missed like making a plugin , searching trought a array
<becom33>
thouse stuff
vmatiyko has left #ruby [#ruby]
<AtoxHybrid>
how is it possible that Thread.exclusive is broken?
fmcgeough has quit [Quit: fmcgeough]
<AtoxHybrid>
I'm on 1.9.1 ubuntu 12.04 btw
bluOxigen has quit [Ping timeout: 245 seconds]
<UNIXgod>
AtoxHybrid: can you upgrade ruby and see if the problem persists
wvdschel_ has joined #ruby
zx has joined #ruby
zx has quit [Read error: Connection reset by peer]
wvdschel has quit [Ping timeout: 272 seconds]
<deryldoucette>
1.9.1 is a known buggy version. current is 1.9.3-p194. (not saying that *is* the issue in your case, just that thats a known buggy ver)
<AtoxHybrid>
correction, i'm actually on 1.9.3.0-1ubuntu1
mvangala has quit [Remote host closed the connection]
<AtoxHybrid>
the package is wrongly named 1.9.1, blame ubuntu for that
<deryldoucette>
might want to gist.github.com the relevant code and the error message you get (and any trace) to give folks something to work with
sameerynho has quit [Quit: Leaving]
azm has quit [Ping timeout: 252 seconds]
cordoval has quit [Remote host closed the connection]
gosshedd has quit [Read error: Operation timed out]
maesbn has quit [Remote host closed the connection]
<AtoxHybrid>
error is /usr/lib/ruby/1.9.1/psych/visitors/emitter.rb:24:in `scalar': expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS (RuntimeError)
<AtoxHybrid>
does not occur if I disable threading
jernejz has quit [Read error: Connection reset by peer]
nej has joined #ruby
<becom33>
shevy, ?
pawdro has quit [Remote host closed the connection]
<AtoxHybrid>
also, if I insert a puts inside the exclusive and after it, the inside is outputted twice
mstratman has quit [Quit: mstratman]
<AtoxHybrid>
well actually, in my code []= and [] are also globally locked, problem still occurs
<AtoxHybrid>
but this is a simpler snippet
mnaser has quit [Ping timeout: 260 seconds]
jlogsdon has joined #ruby
mcwise has quit [Quit: I quit]
kil0byte has joined #ruby
iocor has joined #ruby
<AtoxHybrid>
apparrently psych causes it, is psych multithreaded?
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
<shevy>
becom33 you sound as if you have a deadline ;)
<shevy>
you need to relax and let the ruby philosophy enter your mind
<shevy>
and then, you make baby steps becom33
davidw has joined #ruby
<Hanmac>
put an ruby book under your pillow and let it flow into your brain
<benwoody>
becom33: is this your first ruby project?
SQLStud has joined #ruby
davidw is now known as Guest38008
<becom33>
shevy, not a deadline . but I do wanna finish this soon coz next month im starting my work . then I wont be havin free time to do this stuff
internet_user has quit [Remote host closed the connection]
<becom33>
benwoody, actually this is the reason I came to ruby :/
<savant>
im a ruby
<becom33>
savant, your expensive ruby
<savant>
no im cheap
yosinof has quit [Quit: Leaving]
jgrevich has quit [Quit: jgrevich]
jayrulez has joined #ruby
<becom33>
$65 for a 1 hr ? I make like $150 for a month
erratic has joined #ruby
<shevy>
savant but you are coding from hell :(
<benwoody>
holy shit
<benwoody>
do you live in a 3rd world country?
<savant>
yes
<savant>
the answer is yes
<becom33>
benwoody, actually yea
<savant>
say the USA
<erratic>
hey guys whats the @ do in ruby and how do I do a continue in a loop in erb
<benwoody>
oh, well there's that
<shevy>
erratic this is an instance variable
<shevy>
erratic, class Foo; @bla = "some value"; end
kuranai is now known as kuranai|off
<erratic>
oh so its like this-> operator
<shevy>
I dunno about erb, a loop in ruby can be done via loop {} erratic loop { puts 'hi'; break if rand(5) == 0}
macmartine has quit [Quit: macmartine]
carloshpf has joined #ruby
whye has quit [Ping timeout: 260 seconds]
<shevy>
erratic, not sure. @foo variables are always available in the class
<erratic>
I see
TandemAdam has joined #ruby
<erratic>
thank you!
<shevy>
dunno how you use this->
<shevy>
it's php right?
<erratic>
yeah the only thing left is how to do a continue in a loop
<erratic>
yeah
<shevy>
well, other things you could try ... an early "return". or a "next if x > y" in your loop
<shevy>
but it is a bit rare to see loops usually. you iterate over your array/hash directly like array.each
ubercore has joined #ruby
<shevy>
you could use while loops too
yosinof has joined #ruby
inteq has quit [Read error: Connection reset by peer]
<erratic>
next if sounds about right
inteq has joined #ruby
<erratic>
googling
mdw has joined #ruby
<shevy>
i = 0; while i < 5 do; puts i; i += 1; end
mdw_ has quit [Read error: Connection reset by peer]
geekbri has quit [Remote host closed the connection]
Vert has joined #ruby
SegFault1X|work has joined #ruby
francisfish has quit [Remote host closed the connection]
SegFault1X|work has quit [Client Quit]
znake has quit [Quit: znake]
<AtoxHybrid>
so why are mutexes not actually exclusive
<erratic>
just guessing here
<erratic>
next if ipaddr.empty?
scb has joined #ruby
<erratic>
thats another thing I learn this morning
<erratic>
but I forgot to read about
yoklov has joined #ruby
scb_ has quit [Ping timeout: 252 seconds]
<erratic>
the ? on the end... that also works as a ternary operator
SegFaultAX|work2 has joined #ruby
<erratic>
strange to me
<shevy>
erratic well
<shevy>
the ternary operator I find ugly
<shevy>
the "?" however at method names, ruby allows you to have such method names
<shevy>
def will_erratic_like_ruby?
MasterLambaster has quit [Quit: MasterLambaster]
<erratic>
thats cool :D
<shevy>
return 'Yes!!!'
<shevy>
end
<shevy>
will_erratic_like_ruby?
<erratic>
so far I like it alot
<erratic>
Ive been working with it on and off for about a month or two
<erratic>
chef cookbooks
<shevy>
btw that was a too long method name
<shevy>
ruby code usually tends to be rather terse and short
tds has joined #ruby
<shevy>
"foo".include? 'o' # => true
<apeiros_>
AtoxHybrid: errr, what? what makes you think they weren't?
<shevy>
and not ... "foo".does_it_include? 'o' # => true
<shevy>
hehe
<AtoxHybrid>
somehow Thread.exclusive breaks the exclusiveness for no reason
fr0gprince_mac has quit [Quit: Leaving...]
<AtoxHybrid>
and Thread.exclusive uses a global mutex
<apeiros_>
AtoxHybrid: you should *probably* read the docs of methods that you use
sepp2k1 has joined #ruby
<AtoxHybrid>
apeiros_: how so?
<apeiros_>
ri Thread::exclusive
<apeiros_>
in your command line. assuming your docs are installed.
<apeiros_>
else: rdoc.info and ruby-doc.org
<AtoxHybrid>
yes, what about it?
mdw has quit [Remote host closed the connection]
yosinof has quit [Quit: Leaving]
<apeiros_>
hm, did they change it? last time I read it, it clearly stated that this method is only supposed to be used by people who implement concurrency-primitives…
yosinof has joined #ruby
<apeiros_>
you should not use Thread.exclusive yourself
<burgestrand>
Isn’t Thread.exclusive a no-op in 1.9?
<burgestrand>
I have a vague memory of that
baroquebobcat has joined #ruby
ubercore has quit [Quit: Computer has gone to sleep.]
<AtoxHybrid>
Well, I can explain this, using the following code Thread.exclusive { print "Saving... "; save(); puts "Done..." }
krusty_ar has quit [Read error: Connection reset by peer]
<AtoxHybrid>
I get: Saving... Done....\nSaving... Saving... <ERROR>
<AtoxHybrid>
which looks impossible to me
hynkle has quit [Quit: hynkle]
rdegraci has quit [Quit: rdegraci]
<AtoxHybrid>
wait, what about errors inside the threads?
krusty_ar has joined #ruby
wvms has joined #ruby
artm has quit [Quit: artm]
<burgestrand>
AtoxHybrid: if an error is raised inside a thread, by default Ruby swallows the error and the thread dies
<AtoxHybrid>
but would that unlock the mutex?
<burgestrand>
AtoxHybrid: Thread.abort_on_exception = true to change default behaviour to a more sane variant
<burgestrand>
AtoxHybrid: yes
v0n has quit [Ping timeout: 248 seconds]
<AtoxHybrid>
I just remembered that weird behaviour, gheh, lets test again
heftig has joined #ruby
<burgestrand>
(to my earlier statement, turns out Thread.exclusive { block } is just using a global mutex, I was thinking of Thread.critical)
scb_ has joined #ruby
felipec has joined #ruby
scb has quit [Ping timeout: 272 seconds]
<AtoxHybrid>
now I found the error, there are some UTF8 characters messing up the yaml parser
<AtoxHybrid>
causing the thread to die, mutex to unlock, and over and over again, until the last thread dies
wmoxam has quit [Quit: leaving]
<burgestrand>
Thread.abort_on_exception = true should always be on. :(
ericalexander has quit [Quit: Ex-Chat]
tommyvyo has joined #ruby
raul782 has quit [Remote host closed the connection]
ph^_ has quit [Remote host closed the connection]
ph^ has joined #ruby
Soul_Est has quit [Quit: WeeChat 0.3.7]
kvirani has quit [Read error: Connection reset by peer]
kvirani has joined #ruby
SQLStud is now known as UrAznMaster
jgarvey has quit [Quit: Leaving]
carloslopes has quit [Quit: Leaving]
theRoUS has quit [Ping timeout: 260 seconds]
ph^ has quit [Ping timeout: 245 seconds]
ConstantineXVI has quit [Remote host closed the connection]
skogis has quit [Ping timeout: 255 seconds]
sebastorama has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
v0n has joined #ruby
kvirani has quit [Remote host closed the connection]
skogis has joined #ruby
<becom33>
shevy, you there ?
SegFault1X|work2 has joined #ruby
nobitanobi has joined #ruby
<nobitanobi>
Is there any difference between @object.method? and @object.method.nil?
<apeiros_>
yes
<apeiros_>
@object.method? calls the method named method? on @object, @object.method.nil? calls the method named method, then calls .nil? on its result
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
ConstantineXVI has joined #ruby
<nobitanobi>
apeiros_: thank you.
chson has quit [Remote host closed the connection]
heftig_ has joined #ruby
SegFaultAX|work2 has quit [Ping timeout: 265 seconds]
phantasm66 has quit [Quit: *sleeeeep*]
<nobitanobi>
apeiros_: I am working in Rails, and in order to check if a particular object has a particular attribute, I usually do @object.attribute.nil?
<becom33>
apeiros_, hay
<apeiros_>
nobitanobi: in that case, you should have been more specific
<apeiros_>
you mean you use ActiveRecord, yes?
<nobitanobi>
yes.
heftig has quit [Ping timeout: 255 seconds]
mengu has joined #ruby
luke3321 has joined #ruby
MasterIdler has quit [Ping timeout: 244 seconds]
A124 has joined #ruby
A124 has left #ruby [#ruby]
<apeiros_>
nobitanobi: then it depends on whether you overwrite methods or not
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
<apeiros_>
the default implementation of attr? is afaik indeed attr.nil?
davidcelis has quit [Quit: K-Lined]
<nobitanobi>
oh, I see
<apeiros_>
but check in #rubyonrails, as that's a rails question, not a ruby question.
blacktulip has quit [Remote host closed the connection]
davidcelis has joined #ruby
<nobitanobi>
ok, thanks.
ThatDudeGuy_ has quit [Quit: ThatDudeGuy_]
macer1 has quit [Ping timeout: 272 seconds]
elux has quit [Quit: Leaving...]
dbe has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
heftig_ has quit [Client Quit]
heftig has joined #ruby
CannedCorn has joined #ruby
<felipec>
why is pipe.each("\0") not working? the command is certainly generating \0
rasbonics has quit [Quit: rasbonics]
UrAznMaster has quit [Quit: Leaving]
Soul_Est has joined #ruby
<a_a_g>
what is 'pipe'?
bbttxu has quit [Quit: bbttxu]
beneggett has quit [Read error: Connection timed out]
<felipec>
a_a_g: IO.popen
sebastorama has joined #ruby
hormigas has joined #ruby
<apeiros_>
felipec: works fine here.
<apeiros_>
maybe you want to define "not working"
lambdan has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
dv310p3r has quit [Ping timeout: 245 seconds]
<apeiros_>
i,o=IO.pipe; o.write("hello\0world\0funny\0"); i.each("\0") do |x| p x end # --> prints "hello\u0000", "world\u0000", "funny\u0000" - as expected
murrdoc has joined #ruby
fayimora has quit [Ping timeout: 272 seconds]
<heftig>
IO.popen("find /tmp -print0").each("\0") { |x| p x } works fine here
<murrdoc>
is this an appropiate place to ask questions bout gitorious
<murrdoc>
if not its cool … point me where the river is :)
<lambdan>
can someone help me remove a specific line of a file?
<felipec>
apeiros_: heftig: yeah, it seems to work with simple examples... but not with git log -z =/
<apeiros_>
felipec: chances that each is working incorrectly vs. chances that you messed up - I estimate it to be around 99:1
sallyz has joined #ruby
murrdoc has left #ruby [#ruby]
<heftig>
works fine here
DuoSRX_ has quit [Remote host closed the connection]
<apeiros_>
based on that is how I'd search for why your code as a whole breaks.
beneggett has joined #ruby
jlogsdon has quit [Remote host closed the connection]
hormigas has left #ruby [#ruby]
scb has joined #ruby
scb_ has quit [Ping timeout: 244 seconds]
<felipec>
apeiros_: want to bet?
<apeiros_>
heftig: given that `heftig: works fine here`, sure…
<apeiros_>
gah
<apeiros_>
felipec: given that `heftig: works fine here`, sure…
carloshpf has quit [Quit: Saindo]
<apeiros_>
felipec: anyway "why X no work?" is a useless question.
cordoval has joined #ruby
<apeiros_>
"it doesn't work because you did something wrong" - an equally useless but appropriate answer to the question.
<lambdan>
so can someone help a newbie (me) remove a specific line from a .txt?
<apeiros_>
lambdan: sure. where do you have problems with that?
<lambdan>
lets say i have a text file with X lines
<lambdan>
and i wanan remove line 50
<lambdan>
how
<apeiros_>
lambdan: read it into an array, remove index 49 of the array, write the result back to the file
<lambdan>
sorry im really bad at this stuff
<lambdan>
i also have another question, which should be simpler
<apeiros_>
lambdan: look at File::readlines, Array#delete_at
cordoval has left #ruby [#ruby]
<lambdan>
thx ill take a look
<lambdan>
and now for the second qustion:
looopy has joined #ruby
altiouz has joined #ruby
<lambdan>
lets say i have an line on the variable "lol", i then wanna check through the entire text file to see if "lol" is already in it
<lambdan>
to prevent duplicates
<lambdan>
so like
altious has quit [Read error: Connection reset by peer]
<lambdan>
lol = "hey im a human"
<lambdan>
then its gonna check if that "hey im a human" is in the file already
<apeiros_>
felipec: you still have to state how it shows failure
<lambdan>
nah its for my irc bot
fayimora has joined #ruby
<felipec>
apeiros_: you should get two numbers, they should be equal, if they are not equal, the first command is doing something wrong
<apeiros_>
and you claim it is because of each("\0")?
bglusman has quit [Remote host closed the connection]
<becom33>
apeiros_, bro can you look my script for a second
SphericalCow has quit [Quit: Leaving]
<felipec>
apeiros_: you said I did something wrong, if you cannot find something wrong *I* did, then you loose the bet, and you have to admit you were wrong
<Squarepy>
becom33, is a CASE thing
<apeiros_>
felipec: maybe you should try and see what your first one actually does
<felipec>
apeiros_: I have
<becom33>
Squarepy, Im sorry I dont understand
iamjarvo has joined #ruby
Gavilan has quit []
<apeiros_>
you did? and did you see that your data isn't \0 delimited?
ikaros has quit [Read error: Connection reset by peer]
<Squarepy>
becom33, sorry nvm
<apeiros_>
felipec: so lets turn this around: admit that you did it wrong!!1!1!11!
<becom33>
Squarepy, please dude if you see where am i wrong help me
<apeiros_>
</kindergarten>
<benwoody>
becom33: what is it failing with? also, where is testmodule
<felipec>
apeiros_: show me how I did it wrong, and I'll admit that, if you cannot show me what I did wrong, then you loose
<becom33>
benwoody, well the testmodule is in another path . but I've got puts of the bath . so it should load in to the script
<apeiros_>
I don't care *what* you did wrong. but obviously your two commands don't generate the same output by git.
araujo has joined #ruby
<apeiros_>
also that stupid "admit it" is srsly childish and I'll probably just put you on ignore next time.
<becom33>
wow apeiros_ is pissed
<apeiros_>
yes
<savant>
who is apeiros_?
<felipec>
apeiros_: my question was specifically about .each("\0")
<savant>
is he any good?
<savant>
can I be his ruby apprentice?
Squarepy has quit [Quit: Leaving]
ghr has joined #ruby
<apeiros_>
felipec: yes, it was specifically on why it wasn't working
<becom33>
savant, can you look at my last script ?
<benwoody>
becom33: is TestModule class inside the Mod module?
<savant>
no
<apeiros_>
00:00 felipec: why is pipe.each("\0") not working? the command is certainly generating \0
<benwoody>
i think you're getting mixed up on what classes and modules are
<felipec>
apeiros_: this is what you said: <apeiros_> felipec: chances that each is working incorrectly vs. chances that you messed up - I estimate it to be around 99:1
<becom33>
benwoody, yes . actually load did the work I guess
<felipec>
apeiros_: *that* is childish
looopy has joined #ruby
araujo has quit [Read error: Connection reset by peer]
<apeiros_>
felipec: no. your assertion was that each("\0") was not working correctly
<felipec>
apeiros_: and you were wrong, you yourself cannot come up with code that splits the output in the appropriate chunks with .each("\0")
<apeiros_>
and all I said was that assertion did not have a high probability of being true
Criztian has quit [Remote host closed the connection]
<Mon_Ouie>
It is true though — when something is wrong, always assume your code is wrong before considering a bug in Ruby
<becom33>
wait lemme show somthin
<apeiros_>
and that you should probably - instead of figuring why each doesn't work, should go and check why your code doesn't work
liluo has joined #ruby
<felipec>
apeiros_: no, that's not what you said, you said *I* messed up... see? "chances that each is working incorrectly vs. chances that you messed up - I estimate it to be around 99:1"
<apeiros_>
felipec: and I was right
Karmaon has joined #ruby
<felipec>
apeiros_: it's not my code, you cannot come with with code that works either
digitalcakestudi has quit [Read error: Operation timed out]
<felipec>
apeiros_: and you cannot admit you were wrong, where obviously you weren't
<felipec>
you care more about being right than being helpful
<apeiros_>
felipec: omg, welcome on my ignore
a_a_g has joined #ruby
<jeebster>
man, there sure is a ton of arguing in this channel
<benwoody>
becom33: module Mods; class TestModule; end; end; ? or are you extending/delegating it somewhere?
<jeebster>
more programmer ego yum yum
h4mz1d has quit [Ping timeout: 250 seconds]
<becom33>
ben_alman, Im loading classes in a folder trought a each
<becom33>
trough *
<becom33>
using load function
<felipec>
I think git is acting differently depending if it's being run as a shell 'git foo', or directly ['git', 'foo']
kvirani has joined #ruby
<benwoody>
becom33: seriously, go study the inheritance chain
BrokenCog has quit [Quit: leaving]
<felipec>
but apeiros_'s assertion that *I* messed up was totally unwarranted and wrong
<apeiros_>
becom33: did you get an answer to your NameError question
<becom33>
i think I should
luke3321 has quit [Quit: leaving]
<becom33>
apeiros_, yes yes . thanks its fine bro . you seems busy
ghr has quit [Quit: ghr]
sparrovv has quit [Ping timeout: 272 seconds]
hasrb has quit [Remote host closed the connection]
amalvagomes has quit [Quit: amalvagomes]
heftig has quit [Ping timeout: 260 seconds]
looopy has quit [Remote host closed the connection]
looopy has quit [Remote host closed the connection]
<becom33>
it works when I do a = TestModule.new() . do that mean it should be inside Mods method right ?
looopy has joined #ruby
redgetan has joined #ruby
tomzx has joined #ruby
jeebster has left #ruby [#ruby]
<becom33>
apeiros_, can you look my last paste ?
<becom33>
only if your free
<Mon_Ouie>
No, because load doesn't care about where it is called frome
<Mon_Ouie>
from*
<benwoody>
becom33: mods method? Go look up the difference bt modules and methods
<Mon_Ouie>
It will store the constants at top-level anyway
<benwoody>
And classes
<becom33>
sorry Mods Module *
<becom33>
benwoody, dude its 4.16 am Im kinda loosing track
<Mon_Ouie>
You should just use require and explicitly namespace your classes in the files that define your modules/classes
<becom33>
but still if it works inside the Mod Method . why doesnt work when it inherit ?
etehtsea has quit []
trend has joined #ruby
<Mon_Ouie>
It uses the top-level TestModule constant
stephenjudkins has joined #ruby
<Mon_Ouie>
If you tried to do Mods::TestModule at that point, it would fail too
yosinof has quit [Quit: Leaving]
dross has quit [Read error: Connection reset by peer]
Chryson has joined #ruby
<Veejay>
apeiros_: Talking about the NaCal thing?
<apeiros_>
Veejay: yes
<Veejay>
Yeah I'm (in spirit at least) pretty psyched about it
<Veejay>
It gets us closer to a future without Javascript shoehorning
<Veejay>
Which is nice
<becom33>
Mon_Ouie, what can I do to fix it ?
shruggar has quit [Read error: Connection reset by peer]
shruggar1 has joined #ruby
* apeiros_
wonders whether he should tell felipec where he messed up
k4mirox has quit [Ping timeout: 260 seconds]
savant has quit [Ping timeout: 248 seconds]
<apeiros_>
hm, better not. for one, he didn't mess up, and for another, I'd be a total ass about it…
<becom33>
apeiros_, ..
<Veejay>
OR
altiouz has quit [Ping timeout: 248 seconds]
<Veejay>
You could be a gentleman and provide at least a general direction
<Mon_Ouie>
becom33: Well, what about what I already suggested?
<apeiros_>
oh I already did that. I showed him where to look. it's even in my pastie. that's how I noticed it - wanted to close the window and seen what went wrong…
<becom33>
Mon_Ouie, your explantion is kinda complicated .
luckyruby has quit [Remote host closed the connection]
<apeiros_>
I didn't see it the first time because I've only looked out for \0 the first time because he was so adamant about each("\0") being at fault and having that ridiculous demand up.
<becom33>
did asked to use require insted of load ? Mon_Ouie
<felipec>
ppft, what apeiros_ seems to be suggesting is that git is throwing a different output, which I already suggested
<Mon_Ouie>
becom33: That, and also explicitly namespacing
Kamijou_Touma is now known as nfk
<becom33>
I dont undertand whats explicitly namespacing is
<Mon_Ouie>
e.g. module Mods; module Bar; end; end instead of module Bar; end
trend has quit [Quit: trend]
shruggar1 has quit [Ping timeout: 252 seconds]
vitoravelino`afk is now known as vitoravelino
C0deMaver1ck has quit [Remote host closed the connection]
ennui has joined #ruby
<becom33>
Mon_Ouie, module inside of a module ?
<becom33>
Mon_Ouie, woah woah wait
<becom33>
TestModule is a class
<Mon_Ouie>
Doesn't make a difference
RudyValencia has joined #ruby
<becom33>
where does this Bar modules comes from ?
punkrawkR has quit [Read error: Connection reset by peer]
<Mon_Ouie>
Nowhere, it's just an example
b1rkh0ff has quit [Ping timeout: 250 seconds]
<becom33>
ok lemme see if this is what your tell me to do
<Mon_Ouie>
(and that example is the point where the Bar module gets defined)
<apeiros_>
becom33: you define a class `TestModule`, not `Mods::TestModule`. that you call load within your Mods module doesn't make `TestModule` become `Mods::TestModule`
<apeiros_>
in your test_module/index.rb, wrap your class within a `module Mods` and `end`
<apeiros_>
that way you define it as Mods::TestModule
greyEAX has quit [Ping timeout: 244 seconds]
snip_it has quit [Quit: snip_it]
<apeiros_>
btw., it's somewhat odd to name a class 'xxxModule'
grey_ has quit [Ping timeout: 252 seconds]
<lambdan>
okay i made some progress
uris has quit [Quit: leaving]
<lambdan>
but i dont know how to get
<lambdan>
hi = IO.readlines("test.txt")[2]
<lambdan>
the 2 there, to a variable, like #{test}
<apeiros_>
#{} is for string interpolation only.
<apeiros_>
just plain: test = 2; hi = IO.readlines("test.txt")[test]
scb has quit [Remote host closed the connection]
dross has joined #ruby
Foxandxss has joined #ruby
nfk has quit [Quit: yawn]
<lambdan>
hm i get "cant convert string into integeer"
<Veejay>
Maybe you should show some code
<apeiros_>
lambdan: that sounds like you did `test = "2"` instead of `test = 2`
<apeiros_>
"2" is not the same as 2. the former is a string, the latter an integer.
<lambdan>
hmm
<Veejay>
apeiros_'s psychic abilities have beem steadily declining for the past few years
greyEAX has joined #ruby
<apeiros_>
Veejay: only my will to use it
<apeiros_>
I could still kill you with a thought! or a tray! yes… death by tray it shall be! :)
<apeiros_>
lambdan: ah, sorry, missed your gist. yes, String#to_i will convert a String to an Integer.
<lambdan>
yeah
<lambdan>
thanks anyway
<lambdan>
:)
<apeiros_>
lambdan: also, you probably want to read your fact-files once, store it somewhere and access the stored data instead of reading it again upon every invocation
<lambdan>
well the thing is that the file is getting updated very often
brianpWins has quit [Quit: brianpWins]
<apeiros_>
ok
<lambdan>
since people do .addfact this is a fact
<apeiros_>
which is through the bot too?
<lambdan>
yes
<apeiros_>
so addfact could work on the stored data too and you could then write out from the stored data to update the file…
bluenemo has quit [Quit: leaving]
looopy has quit [Remote host closed the connection]
Solnse has quit []
virunga has quit [Quit: Sto andando via]
dbgster has joined #ruby
AtoxHybrid has quit [Remote host closed the connection]
TheFuzzball has quit [Quit: Leaving...]
looopy has joined #ruby
nari__ has quit [Ping timeout: 252 seconds]
Mohan has quit [Ping timeout: 272 seconds]
Mohan has joined #ruby
mrwalker has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
jayrulez has joined #ruby
weasels has joined #ruby
good_afternoon has joined #ruby
otters has quit [Read error: Connection reset by peer]
snip_it has joined #ruby
snip_it_ has joined #ruby
snip_it has quit [Read error: Connection reset by peer]
davidpk has quit [Quit: Computer has gone to sleep.]
redgetan has quit [Quit: This computer has gone to sleep]
tvw has quit [Read error: Connection reset by peer]
cj3kim has quit [Ping timeout: 276 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
ConstantineXVI has joined #ruby
ConstantineXVI has quit [Remote host closed the connection]