Criztian has quit [Remote host closed the connection]
ahs3- has joined #ruby-lang
seanstickle has joined #ruby-lang
<postmodern>
if a project is using RDoc::Task.new, should it add rdoc as a development_dependency?
kain has quit [Quit: Sto andando via]
codesturgeon has joined #ruby-lang
erpuds has joined #ruby-lang
tRAS_ has joined #ruby-lang
tRAS has quit [Ping timeout: 244 seconds]
<rue>
postmodern: Comes with Ruby
<postmodern>
rue, true, but RDoc::Task was added in 2.4.2
codesturgeon has quit [Remote host closed the connection]
codesturgeon has joined #ruby-lang
<rue>
Ah, I don’t remember what the stdlib version is. Maybe, then?
<postmodern>
rue, meant to replace Rake::RDocTask
<rue>
Oh, right
<postmodern>
1.9 seems to have it vendored in
<postmodern>
1.8.7 doesn't
<postmodern>
ha 1.8.7 has RDoc V1.0.1 - 20041108
<postmodern>
also what's the status of test.rubygems.org ?
<postmodern>
is it recommended new projects opt-in with a .gemtest file?
<postmodern>
or is it going away?
<banisterfiend>
ask erikh
replore has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
jd has joined #ruby-lang
Jade has quit [Disconnected by services]
jd is now known as Jade
ryanf has quit [Ping timeout: 240 seconds]
chessguy has joined #ruby-lang
ryanf has joined #ruby-lang
pcboy___ has joined #ruby-lang
M4g1c5t0rM has joined #ruby-lang
erpuds has quit [Quit: erpuds]
erpuds has joined #ruby-lang
M4g1c5t0rM has left #ruby-lang [#ruby-lang]
pcboy_ has quit [Ping timeout: 260 seconds]
M4g1c5t0rM has joined #ruby-lang
ryanf has quit [Ping timeout: 252 seconds]
brushbox has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
wmoxam has joined #ruby-lang
mrb_bk has joined #ruby-lang
seanstickle has joined #ruby-lang
stardiviner has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
deobald__ has quit [Ping timeout: 260 seconds]
gregf has joined #ruby-lang
tmi_ has quit [Ping timeout: 252 seconds]
Swimming_Bird has joined #ruby-lang
ttilley has quit [Read error: Connection reset by peer]
ttilley has joined #ruby-lang
fukushima has quit [Ping timeout: 265 seconds]
fukushima has joined #ruby-lang
tmi_ has joined #ruby-lang
ConstantineXVI has quit [Remote host closed the connection]
retro|cz has quit [Ping timeout: 265 seconds]
brushbox has quit [Ping timeout: 244 seconds]
brushbox has joined #ruby-lang
kain has joined #ruby-lang
arooni-mobile has joined #ruby-lang
seanstickle has quit [Quit: seanstickle]
jondot has quit [Ping timeout: 244 seconds]
S3kx has joined #ruby-lang
S2kx has quit [Ping timeout: 245 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
codesturgeon has quit [Quit: Leaving...]
x0F_ is now known as x0F
Karmaon is now known as Karmaon|away
neoesque has joined #ruby-lang
jxie_ has joined #ruby-lang
jxie has quit [Ping timeout: 256 seconds]
savage- has joined #ruby-lang
wmoxam has quit [Ping timeout: 240 seconds]
codesturgeon has joined #ruby-lang
konr` has joined #ruby-lang
konr has quit [Ping timeout: 240 seconds]
flowerpot has joined #ruby-lang
hahuang65_ has joined #ruby-lang
ttilley has quit [Remote host closed the connection]
seanstickle has joined #ruby-lang
tRAS_ has quit [Quit: Mother, did it need to be so high?]
codesturgeon has quit [Quit: Leaving...]
ryanf has joined #ruby-lang
tRAS has joined #ruby-lang
srbartle_ has joined #ruby-lang
srbartlett has quit [Read error: Connection reset by peer]
seanstickle has quit [Quit: Nihil sub sole novum]
A124 has joined #ruby-lang
Karmaon|away is now known as Karmaon
petercooper has quit [Remote host closed the connection]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
Dreamer3 has quit [Ping timeout: 245 seconds]
lele has quit [Ping timeout: 245 seconds]
lele has joined #ruby-lang
countdig1 has quit [Ping timeout: 245 seconds]
countdigi has quit [Ping timeout: 245 seconds]
mksm has quit [Ping timeout: 245 seconds]
Gekz_ has joined #ruby-lang
Gekz_ has quit [Changing host]
Gekz_ has joined #ruby-lang
countdigi has joined #ruby-lang
countdig1 has joined #ruby-lang
Asher1 has joined #ruby-lang
Asher has quit [Ping timeout: 245 seconds]
erikh has quit [Ping timeout: 245 seconds]
Gekz has quit [Ping timeout: 245 seconds]
Asher1 has quit [Remote host closed the connection]
Asher has joined #ruby-lang
vesan has quit [Ping timeout: 248 seconds]
mksm has joined #ruby-lang
Phrogz has joined #ruby-lang
mksm is now known as Guest74504
Dreamer3 has joined #ruby-lang
erikh has joined #ruby-lang
andrewhl has joined #ruby-lang
tylergillies has joined #ruby-lang
<tylergillies>
is there a function i can call that will do something like 5.self{|n| n + 1} #=> 6
vesan has joined #ruby-lang
<cirwim>
instance_exec
<cirwim>
hmm, well not quite
<cirwim>
why?
<cirwim>
5.andand{ |n| n + 1 } does that
<cirwim>
but only for truthy values
<tylergillies>
cirwim: for educational purposes
<cirwim>
hehe
<tylergillies>
like learning, for example, that theres a method on Object called instance_exec
<cirwim>
sure, education is good
<tylergillies>
im actually surprised i didn't know about that one, there's not a whole lot
s0ra_h is now known as sora_h
<tylergillies>
ah, 5.instance_exec{ self + 1 } works
<bnagy>
5.instance_eval 'send :+, 1' that too
jondot has joined #ruby-lang
<jorgenpt>
Also 5.send(:+, 1)
<cirwim>
how about "5 + 1"
<cirwim>
:p
<bnagy>
well yeah, but that's not the point of the exercise :)
<tylergillies>
heh
<cirwim>
any feature that you don't know about is a feature you don't need
<tylergillies>
FSVO need
<bnagy>
wow... that's... a retarded thing to say :)
slyphon is now known as slyphon_away
mistym has quit [Remote host closed the connection]
kain has quit [Quit: Sto andando via]
<tylergillies>
pretty sure im going to hell for this: p "omg lisp is invading my thought process".instance_exec{ self.split.first(self.split.count.instance_exec{ self/2.to_f }.floor).instance_exec{ "#{self.join ' '} awesome" } }
sora_h is now known as s0ra_h
tRAS has quit [Quit: Mother, did it need to be so high?]
<cirwim>
heh, neat trick
gokul has joined #ruby-lang
macmartine has quit [Quit: macmartine]
rippa has joined #ruby-lang
flip_digits has joined #ruby-lang
<jorgenpt>
tylergillies: Isn't the 'self' there implied?
<jorgenpt>
tylergillies: "omg lisp is invading my thought process".instance_exec{ split.first(split.count.instance_exec{self/2.to_f }.floor).instance_exec{ "#{join ' '} awesome" } }
<jorgenpt>
\o/
<tylergillies>
5.instance_exec{ +1} #=> 1 hrmm
<cirwim>
5.instance_exec{ -1 } => -1
<bnagy>
amazing - the number 1 is always the number 1 no matter what context you eval it in :)
<cirwim>
bnagy: I think the confusion is lack of knowledge of the unary + operator :)
<ryanf>
well I guess you implied that you're talking about the output of inspect? but in my irb/pry \u5BD3 never appears as that sequence, it just shows up as the character
<ryanf>
did you just pick that example at random and you actually mean sequences that aren't valid utf8 characters or something?
<bnagy>
andkerosine: what do you plan to use the string for
<andkerosine>
Yeah, sorry, picked it at random; should've used an actual example.
<andkerosine>
"\u05FB" doesn't display for me.
<ryanf>
ok, me neither. thanks
<ryanf>
so you can check .valid_encoding?
<ryanf>
no you can't
<ryanf>
never mind
<ryanf>
hmm
<andkerosine>
Also, shevy, not #size, rather bytes.to_a.size.
<andkerosine>
#size is always one for single-character strings in 1.9.3, I believe.
<andkerosine>
It's pretty tricky. : / One of those rare occasions where 1.8 might be a boon.
heftig has quit [Quit: leaving]
<ryanf>
andkerosine:
<ryanf>
>> "\u05fb" =~ /[[:print:]]/
<ryanf>
=> nil
<ryanf>
>> "\u5bd3" =~ /[[:print:]]/
<ryanf>
=> 0
<andkerosine>
Bless your beautiful soul.
<ryanf>
from skimming string.c, I think that's how ruby decides whether to display the \u stuff, more or less
<andkerosine>
Makes perfect sense.
<andkerosine>
bnagy: I've taken the plunge into the pool of parentheses and would like to implement a Brainfuck variant in Racket.
srbartle_ has quit [Remote host closed the connection]
<bnagy>
ryanf: on jruby head I get the same (displays, doesn't match :print
<andkerosine>
Yeah, never mind, just confirmed.
<bnagy>
and same on 1.9.3-head
<bnagy>
wacky
<andkerosine>
Mm-hmm. A bit unfortunate, but either way, filtering out any of the ones that return nil is enough for my purposes, even if they would've printed.
<yorickpeterse>
youngin: if you pay others to fix up your messy code you won't learn anything from it
<yorickpeterse>
Take those suggestions of #python seriously and start with that
<shevy>
nah
<shevy>
youngin switch to the dark side
<andkerosine>
Honestly, those who make such offers aren't usually cut out to learn.
<shevy>
youngin come to ruby
<shevy>
yeah but often enough they also dont have time
<andkerosine>
Having the time is part of being cut out for learning. : P
<youngin>
Well, truth is I got way too many balls up in the air at the moment. Juggling with 5 other Ruby scripts, 3 other Rails projects, an InDesign business plan, 10-15 OpenOffice.org Calc spreadsheets
<youngin>
Learning Python is not that high up on my agenda right now
<shevy>
see? no time ;)
<shevy>
wait what
<shevy>
why python
<youngin>
It's just that after meddling with Ruby, I've become obsessed with my code looking beautiful
<shevy>
you mentioned ruby and rails ...
<youngin>
As if it could be hung up in art galleries or something
<shevy>
oh but it has real value
<shevy>
art is subjective, but code has practical value
<youngin>
Unfortunately ESRI ArcGIS (the world's premier geographical mapping software) only supports Python
<shevy>
the best code is code never written
<andkerosine>
Art can take on practical value, mind you.
<youngin>
"the best code is never written" that's deep :-)
<shevy>
the second best code is code that solves a given problem with as little means as required, ideally by being short, concise, logical and conveying the idea in a good way
<shevy>
youngin well yeah, no bugs in code not written
<shevy>
not too useful either though :(
<shevy>
but I picture a language where one no longer has to write any code at all
<youngin>
hehe
<shevy>
and still things "work"
kitallis has quit [Quit: Computer has gone to sleep.]
<shevy>
like a computer assisted brain interface ... but we would need clever machines for that I suppose
<andkerosine>
In all seriousness, Ruby would be a shoe-in for objective best /overall/ language if it could /somehow/ manage to be whitespace-significant.
<andkerosine>
Can you even imagine how beautiful Ruby code would be?
<andkerosine>
It appears to be genuinely impossible to determine whether or not a character has been Unicode-escaped in Ruby 1.9. : /
<ryanf>
what do you mean "whether it has been unicode-escaped"?
<ryanf>
whether it shows up with "\uXXXX" in the inspect output doesn't imply anything about the string itself
<ryanf>
it's still one character
<andkerosine>
But that's precisely what I'm after.
<andkerosine>
Given a string of Unicode characters, I'd like to detect the ones that have been escaped.
<ryanf>
you mean the ones that would be escaped, were you to call .inspect on them, right?
<bnagy>
have been escaped by what?
<ryanf>
it doesn't really make sense to talk about the characters themselves as "having been escaped", unless you mean that the contents of the string are literally the bytes for '\', 'u', etc
<shevy>
by the boogie man!
<andkerosine>
I'm surprised at how difficult it's proved to be.
<ryanf>
anyway I take it you found a case where [[:print:]] doesn't match ruby's output behavior?
cirwim has quit [Quit: Leaving.]
<andkerosine>
Hm... that really seems like it ought to've worked. Maybe my test is buggy.
diegoviola has quit [Ping timeout: 244 seconds]
<andkerosine>
ryanf: "\u26e4" passes when it shouldn't.
<ryanf>
actually, it doesn't display escaped for me
<ryanf>
but it does display with the "wtf" characte
<ryanf>
r
<ryanf>
the same one as trying to do "puts" on an actual nonprintable char
jondot has quit [Read error: Connection reset by peer]
jondot has joined #ruby-lang
<rue>
JUDGMENT
<andkerosine>
SHAME
<shevy>
PROFIT
woollyams has joined #ruby-lang
gnufied has joined #ruby-lang
workmad3 has joined #ruby-lang
Asher has quit [Remote host closed the connection]
<andkerosine>
"When in doubt, play it safe and take the path of least resistance, which probably means just forgetting about it and closing your browser."
<shevy>
or use MS Internet Explorer!
<andkerosine>
It's from Esolang's guidelines. : )
<andkerosine>
I use IE because it seems to be the only browser that supports P3P.
dc5ala has quit [Quit: Ex-Chat]
<andkerosine>
Also, it's kind of exciting to see how atrocious my Internet experience will be.
Asher has joined #ruby-lang
Fullmoon has joined #ruby-lang
heftig has joined #ruby-lang
Criztian has joined #ruby-lang
<Harzilein>
hmm
<Harzilein>
shouldn assert_equal ignore or consider the order of keys/elements?
<shevy>
the two andies are back in the house again!
<shevy>
my two brothers, andkerosine and andrewvos
shevy is now known as andshevy
<andshevy>
hi
carloslopes has joined #ruby-lang
<andkerosine>
Brosef!
<andrewvos>
Brohan Sebastian Bach
<andrewvos>
Fun Fact about Lithium: It's the only element in the universe of which no more can be made ever (Also, awkward grammar, but I can't think of a better way of saying it, suggestions?)! All the Lithium in the universe was created in the big bang and since then, stars have been eating it up. So Lithium levels in the universe are the lowest they've ever been, and the highest they will ever be from now on. (Sorry, I'm a physicis
<andrewvos>
Found that on interwebs ^
codesturgeon has quit [Quit: Leaving...]
francisfish has joined #ruby-lang
<imperator>
quick, eat some lithium now while supplies last!
<Asher>
why can't more lithium be created?
<Silex>
why would that apply to lithium only?
francisfish has quit [Remote host closed the connection]
<Asher>
we can turn lead into gold… it's just a matter of reorganizing the energy relaxation states
ConstantineXVI has quit [Ping timeout: 245 seconds]
<andrewvos>
rue: That's the sound of banned people responding to you.
<deryl>
hah
<rue>
Or nonregistered users
futurechimp has joined #ruby-lang
nevynxxx has quit [Quit: Lost terminal]
Guest95478 has joined #ruby-lang
Guest95478 has left #ruby-lang [#ruby-lang]
LoveCat has joined #ruby-lang
LoveCat has left #ruby-lang [#ruby-lang]
<banisterfiend>
im banned!
<andrewvos>
banisterfiend: Ban is you middle name.
LoveCat has joined #ruby-lang
<andrewvos>
banisterfiend: And also the prefix to your name.
<andrewvos>
your*
<banisterfiend>
hehe
<banisterfiend>
yeah it guess it's fitting, really
<banisterfiend>
i*
<andrewvos>
put's the ban in banisterfiend
<LoveCat>
Hello.
<andrewvos>
Oh hi
<LoveCat>
I have some questions.
<banisterfiend>
that's what she said
<andrewvos>
heh
<rue>
Shoot, we move like cagey tigers
<andrewvos>
hahah
<LoveCat>
Ruby can make beautiful software ?
<LoveCat>
Like a Flex or Visual Studio can do.
<rue>
[It’s] so wonderfully, wonderfully, wonderfully, wonderfully pretty
<shevy>
LoveCat you mean GUIs? then probably not. you can use guis with ruby but they will look differently
<LoveCat>
yes.
<LoveCat>
nice interface,
peppyheppy has joined #ruby-lang
<rue>
It’s the grooviest thing, it’s the perfect dream
<LoveCat>
i don know why i will be use ruby.
deryl has quit [Read error: Connection reset by peer]
<andrewvos>
rue: OH MY GOD I JUST GET YOUR CAGEY TIGER REFERENCE NOW. You win the internet.
<shevy>
LoveCat if you wanna build awesome GUIs then you will need another language
<LoveCat>
i think if i want nice interface i will use with Rail,
deryl has joined #ruby-lang
<rue>
andrewvos: :D
<LoveCat>
Plain Ruby + Some Library is like command line program.
<LoveCat>
that is i think.
<LoveCat>
Some advices for me?
<LoveCat>
I think ruby can make great thing more than i know about it.
<rue>
LoveCat: You’re making a web app?
cirwim has joined #ruby-lang
<LoveCat>
without Rails(Web App) I don't know what is ruby can do,
<LoveCat>
For freelance,
<LoveCat>
Or it can make Game ?
<LoveCat>
same C++ ?
<zzak>
banisterfiend
tRAS has joined #ruby-lang
<shevy>
LoveCat what do you mean
<rue>
Ah, non-rails use of Ruby? It’s not as fast as compiled languages, but you can make a game with it. You can also use GTK, or Tk, or Qt for GUIs
<shevy>
LoveCat you can use C++ sure but I think you are on the wrong channel for that ;)
<banisterfiend>
zzak: i thought u disappeared back into RL after u got a gf
<rue>
banisterfiend: He did, we reassigned the nick
<shevy>
LoveCat, if you are happy with 70% perfect GUIs, then you can use ruby + ruby-gtk
<banisterfiend>
i hope this new zzak wont give in so easily to the allure of women
<LoveCat>
i am not good in grammar.
<rue>
banisterfiend: Nah, the new one is a woman
<LoveCat>
if i made you confuse , I'm sorry
<rue>
Although I suppose it might still apply
<LoveCat>
i just want to know.
<LoveCat>
some project with rail that can show another.
<banisterfiend>
rue: careful making genderist assumptions or you'll be the subject of a new steveklabnik blog post
<andrewvos>
Nobody wants to be the subject of a steveklabnik blog post :/
<rue>
I suppose she might be asexual too
<LoveCat>
Such as, i can made text editor with Ruby ? or Calculator
<LoveCat>
Or chatting software?
<rking>
LoveCat: You definitely can do that.
<workmad3>
LoveCat: sure
<rking>
LoveCat: And if speed is ever a concern, there's always RubyInline and friends. (enemies?)
<workmad3>
LoveCat: it's not the sort of thing you find handy 'how-to' guides for on the internet though :P
<workmad3>
rue: don't forget about shoes for GUIs too ;)
<LoveCat>
thank you for rking
kyrylo has quit [Ping timeout: 246 seconds]
<rue>
So women can be straight/gay/asexual and guys can be straight/gay/asexual…or shoes?
<LoveCat>
i know how to describe my question
* zzak
is still with her, 1.17 years later
<LoveCat>
I dont want to show Inline to non-programmer.
<andrewvos>
rue: ANYONE CAN BE SHOES
<LoveCat>
If i show inline program , my friends will not know what it intresting because it just a text.
<LoveCat>
SHOES = can use all of function in ruby right ?
<banisterfiend>
LoveCat: i only program to impress my friends, too
<LoveCat>
all library.
<workmad3>
LoveCat: if you want interesting, easy to understand GUI programs, shoes is probably your best bet
kyrylo has joined #ruby-lang
kyrylo has quit [Changing host]
kyrylo has joined #ruby-lang
<LoveCat>
Thank you for help me everyone , and sorry for bad language skill.
<workmad3>
LoveCat: and shoes is a GUI DSL for ruby... it comes in various colours now, green_shoes is probably a good start (unless you're doing windows programming) as it's a GTK-backed, gemified version (so you just need to require the library in a script)
<deryl>
english isn't native language mistakes happen :)
<rue>
erikh: “UNIX filesystems are object graphs but don’t have GC” *facepalm*
joast has quit [Quit: Leaving.]
peppyheppy has quit [Quit: peppyheppy]
<banisterfiend>
rue: he's one of those dudes who sits around all day thinking up pithy words of wisdom to post on twitter, doesnt' really matter if they're incoherent, so long as they're delivered solemnly and appear to be of great mystic importance
workmad3 has joined #ruby-lang
peppyheppy has joined #ruby-lang
<shevy>
"The whole purpose of using & with a symbol is to generate more readable code, compare:"
<banisterfiend>
rue: also seems like that guy has no real skill other than being pathologically sociable on twitter, and when he does write code it looks like this: https://github.com/garybernhardt/cls
<shevy>
in the second example he doesn't need an explicit block variable. so why does he not use a one letter char ...
joast has joined #ruby-lang
<shevy>
owners.map(&X['name'])
<shevy>
I think some syntax turns people crazy
<yxhuvud>
I don't get the parens around the &: variable. you don't use them for the block, why for them? why not differentiate them as much as possible from normal arguments?
savage- has quit [Read error: Connection reset by peer]
savage- has joined #ruby-lang
<banisterfiend>
yxhuvud: cos it woud look weird: def hello (x, y)&block
<shevy>
yeah
<banisterfiend>
yxhuvud: hello(1, 2)&block
<shevy>
ewww
<shevy>
but ["1", "2", "3"].map &:to_i
<any-key>
parens, dammit
<shevy>
hmm not a real improvement...
ottoinfo has joined #ruby-lang
savage- has quit [Read error: Connection reset by peer]
savage- has joined #ruby-lang
savage- has quit [Read error: Connection reset by peer]
savage- has joined #ruby-lang
sockmonk has quit [Ping timeout: 252 seconds]
corecode has joined #ruby-lang
<corecode>
hi
<any-key>
HELLO
<corecode>
is there a way to avoid the global interpreter lock with multithreaded programming?
<any-key>
JRuby, perhaps
<shevy>
yeah I think JRuby does not have a GIL
<yxhuvud>
banisterfiend: you may have got a point when there are arguments, but I would disagree without them.
<yxhuvud>
or rather, I'd let the normal rules for parens decide, disregarding &:
<corecode>
meh.
<any-key>
I like &:
<erikh>
rue: he should design automatic memory management that doesn't use a gc
<rue>
It’s not &:
<erikh>
you know, just garbage collect with the VMM
<erikh>
that'll work, right?
<rue>
Sure, probably #lolruby
<erikh>
hahah
snk has quit [Quit: I accidentally the whole program.]
<erikh>
strangely that quit message is apropos
<erikh>
"I accidentally the whole program"
<workmad3>
jruby indeed does not have a GIL
<erikh>
a GIL and garbage collection are two very different things.
<erikh>
oh, sorry
<erikh>
I need to read the scrollback.
ottoinfo has quit [Quit: ottoinfo]
soahccc` is now known as soahccc
snk has joined #ruby-lang
<erikh>
anyhow, rue, it sounds like he's just right of newbie with a little too much encouragement early on in his career
burgestrand has joined #ruby-lang
bryancp has joined #ruby-lang
apeiros_ has joined #ruby-lang
mistym has quit [Remote host closed the connection]
tubbo has quit [Quit: leaving]
tubbo has joined #ruby-lang
tubbo is now known as Guest56150
andrewhl has joined #ruby-lang
Guest56150 has quit [Client Quit]
tubbo has joined #ruby-lang
mikkelb has quit [Quit: Lost terminal]
gouthamvel has left #ruby-lang [#ruby-lang]
t has joined #ruby-lang
t is now known as Guest34664
tRAS has quit [Quit: Mother, did it need to be so high?]
mistym has joined #ruby-lang
kyrylo has quit [Ping timeout: 246 seconds]
xcyclist has joined #ruby-lang
mistym has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 260 seconds]
fayimora has quit [Ping timeout: 260 seconds]
<rue>
More or less
singpolyma has joined #ruby-lang
retro|cz has quit [Remote host closed the connection]
tonesfrommars has joined #ruby-lang
asahi has left #ruby-lang [#ruby-lang]
fayimora has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has quit [Changing host]
kyrylo has joined #ruby-lang
Mikoangelo has quit [Ping timeout: 260 seconds]
tomb_ has joined #ruby-lang
Mikoangelo has joined #ruby-lang
havenn has joined #ruby-lang
ttilley has quit [Remote host closed the connection]
<crankharder>
so, a rails form helper is somehow dropping output (markup) to STDOUT or Rails.logger, not sure which. It shows up in server logs and test output, only when the attribute has an error. How do I debug this? I'd like to get the full stack of this method to see where it goes, but that is proving difficult. I tried something like this: class << f ; def label(*args) ; super ; raise ; end ; end but that doesn't give me anything usefu
<any-key>
#rubyonrails
<crankharder>
not a rails question, thanks for reading
Jake232 has joined #ruby-lang
<any-key>
sorry, jumped to conclusions
<crankharder>
understandable
countdig1 has quit [Quit: Lost terminal]
countdigi has quit [Quit: Lost terminal]
mssola has joined #ruby-lang
<erikh>
#ubuntu: worse than #ror
<shevy>
haha
<shevy>
yeah
<shevy>
you can do something useful with rails at least
dax has quit [Quit: *poof*]
<any-key>
how can I go from a string to a class?
<any-key>
aka I have "Foo" and I'd like to get the Foo class
<crankharder>
constantize
<any-key>
crankharder: thanks!
<apeiros_>
that's rails
<apeiros_>
Module#const_get in ruby
<any-key>
I'm using this in rails :D
<any-key>
wootwoot
krz has quit [Quit: krz]
tomb_ has quit [Quit: Computer has gone to sleep.]
carloslopes has joined #ruby-lang
krz has joined #ruby-lang
rubots has joined #ruby-lang
<yxhuvud>
crankharder: I've seen that happen if there is faulty markup. do you cdata your script tags properly?
dax has joined #ruby-lang
<yxhuvud>
or perhaps the markup isn't strictly faulty, but not to the liking of the parser.
<crankharder>
yea, but why would that get logged?
konr` has quit [Remote host closed the connection]
<crankharder>
I'm not stranger to generating bad markup - and it's never done this before
<crankharder>
no
<yxhuvud>
well some xml parser will dump that to stderr.
<crankharder>
that is the test/server doesn't interpret markup, it has no notion of faulty markup
<apeiros_>
crankharder: does it show up in the server logs or in rails' logs?
<apeiros_>
if server-logs, then it'd print to stderr afaik
<crankharder>
haven't looked in prod, shows up in dev server logs and test output
<apeiros_>
so by server logs you do mean rails logs
<crankharder>
yea, hang on, let me verify directly
<yxhuvud>
if you want a fuller stack than what the scrubbed one rails give you, you could always call 'caller', but it is not certain that will give anything useful.
Criztian has joined #ruby-lang
<crankharder>
think that's what i wanted
Guest34664 has quit [Remote host closed the connection]
<apeiros_>
or whatever floats your boat. but proper classes help a lot with code readability.
<Mon_Ouie>
Complexity isn't micro-optimization, it makes a huge difference when you get many items — a good algorithm in Ruby can be faster than a poor one in ASM with a large data-set
dalekurt has quit [Quit: Zzz...]
<jaimef>
clearl
<jaimef>
y
hynkle has quit [Quit: hynkle]
fayimora has quit [Ping timeout: 246 seconds]
<Harzilein>
anyone?
<imperator2>
Harzilein, why are you passing a raw number? shouldn't you be using a pre-defined type?
<imperator2>
:char, or :void, or something?
<imperator2>
what kind of pointer are you trying to create?
havenn has joined #ruby-lang
<burgestrand>
Harzilein: the first parameter is the size of the memory you want to allocate
<Harzilein>
imperator2: i want to use an ip address i got from IPAddr.new("192.168.1.234").to_i with a c function that takes an in_addr_t (FFI::LibC::InAddr wraps that type)
<burgestrand>
That’s a lot of memory
krz has joined #ruby-lang
<Harzilein>
burgestrand: _oooh_, i thought the size gets determined in the c part
<burgestrand>
Harzilein: is FFI::LibC::InAddr a struct?
<Harzilein>
yes (well, a typedef, but the ruby type is FFI::Struct)
<burgestrand>
You can allocate a pointer that can contain such a struct by FFI::MemoryPointer.new(FFI::LibC::InAddr) then
<burgestrand>
Or possibly just FFI::LibC::InAddr.new :)
<Harzilein>
burgestrand: yeah, i'll try the latter now, i thought i could initialize it right away
<Harzilein>
burgestrand: i.e. FFI::LibC::InAddr.new(inaddr.to_i) did not work :(
<Harzilein>
uh
<Harzilein>
i mean ipaddr.to_i
<burgestrand>
Ah, yeah, any_struct.new apparently does allocate memory for such a struct, I’m not sure what happens when you pass something to the constructor though. How did it not work, Harzilein?
ridders24 has left #ruby-lang [#ruby-lang]
<burgestrand>
I don’t have the InAddr struct on my system so I can’t really experiment with it
<burgestrand>
(no idea why I don’t, odd)
<Harzilein>
Invalid Memory object (ArgumentError)
<Harzilein>
burgestrand: it's in ffi-libc
<burgestrand>
Ah, yes, you the parameter you pass to structs is a pointer to where the struct is
fayimora has joined #ruby-lang
<Harzilein>
burgestrand: an FFI pointer, yes?
<Harzilein>
burgestrand: so i cannot use ruby literals or something?
<burgestrand>
So, if you already had a pointer to a location that contained such a struct, you would pass that pointer to InAddr.new(pointer_to_struct)
<burgestrand>
Probably not to new, no. Can’t you set the members directly after creating the struct instead?
<Harzilein>
well, the struct is just a fancy name for a 32 bit int, so i would like to pass that in ;)
<Harzilein>
i will
<burgestrand>
I know I did something similar. Basically overwrote MyCustomStruct.new to take a hash of member -> values instead of a pointer to the struct.
ryland has joined #ruby-lang
s0ra_h is now known as sora_h
<burgestrand>
(since I had to initialize the struct and I wanted to make it less painful)
<Harzilein>
i'm just taking my first few steps at wrapping a rather massive lib (it's not all that big, but it is not your 'each object has constructor, accessor, free' fare either
<lianj>
FFI.typedef :uint32, :in_addr_t; class InAddr < ::FFI::Struct; layout :in_addr, :in_addr_t; end; a = InAddr.new; a[:in_addr] = 10; a[:in_addr]
<lianj>
a.to_ptr.read_uint32
srbartlett has joined #ruby-lang
sora_h is now known as s0ra_h
<Harzilein>
thanks
<Harzilein>
lianj: now you made me curious, if i had a real structure, how would i get pointers to the members?
RickHull has joined #ruby-lang
imperator has quit [Quit: This computer has gone to sleep]
tubbo is now known as tubbo`gone
RickHull has left #ruby-lang [#ruby-lang]
woollyams has joined #ruby-lang
woollyams has quit [Client Quit]
benanne has quit [Quit: kbai]
<lianj>
Harzilein: class A < FFI::Struct; layout :a, :uchar, :b, :uchar; end; a = A.new; a[:b] = 61; (a.pointer + a.offset_of(:b)).read_uchar
Jake232 has joined #ruby-lang
carloslopes has quit [Quit: Leaving]
gasbakid has joined #ruby-lang
<andrewvos>
banisterfiend, rue: just scrolled through the Bernhardt stuff above. haha
<krz>
is there a way to get beginning of time?
<andrewvos>
rue: You take this one ^
beiter has quit [Quit: beiter]
Criztian has quit [Read error: Connection reset by peer]
Criztian has joined #ruby-lang
rubots has quit [Quit: rubots]
jd has joined #ruby-lang
dabradley has quit [Ping timeout: 240 seconds]
liklok has joined #ruby-lang
Jade has quit [Ping timeout: 265 seconds]
seanstickle has joined #ruby-lang
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
solars has quit [Ping timeout: 276 seconds]
dejongge has quit [Quit: Leaving.]
asaaki has joined #ruby-lang
krohrbaugh1 has quit [Read error: Connection reset by peer]
singpolyma has quit [Quit: Lost terminal]
deryl has quit [Ping timeout: 252 seconds]
toretore has quit [Quit: Leaving]
apeiros_ has quit [Remote host closed the connection]
ttilley has quit [Remote host closed the connection]
ryanf has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
achiu has quit [Quit: WeeChat 0.3.7]
asaaki is now known as asaaki|away
bglusman has joined #ruby-lang
bglusman has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
postmodern has joined #ruby-lang
mattonrails has joined #ruby-lang
singpolyma has joined #ruby-lang
<rue>
krz: Yes, at the end of the universe
<rue>
That’s the next time, though, not this one.
dv310p3r has quit [Ping timeout: 246 seconds]
brushbox has joined #ruby-lang
Defusal has joined #ruby-lang
tbuehlmann has quit []
Karmaon has quit [Read error: Connection reset by peer]
srbartlett has quit [Remote host closed the connection]
Jake232 has quit [Quit: Computer has gone to sleep.]
publicvoid_ has joined #ruby-lang
asaaki23569 has joined #ruby-lang
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby-lang
publicvoid__ has quit [Ping timeout: 260 seconds]
asaaki|away has quit [Ping timeout: 260 seconds]
<Harzilein>
lianj: ah, thanks. i had hoped there is a nicer syntax ;)
workmad3 has quit [Ping timeout: 260 seconds]
matti has quit [Quit: 8-X]
tomb_ has joined #ruby-lang
andrewhl has quit [Quit: andrewhl]
<lianj>
Harzilein: class FFI::Struct; def member_pointer(key); pointer + offset_of(key); end; end a.member_pointer(:b).read_uchar
cored has joined #ruby-lang
asaaki23569 has quit [Quit: Verlassend]
asaaki23569 has joined #ruby-lang
bryancp has quit [Remote host closed the connection]