hahuang65 has quit [Quit: Computer has gone to sleep.]
<hakunin>
Spaceghostc2c: that was it, thank you
datanoise has quit [Ping timeout: 240 seconds]
havenn has quit [Ping timeout: 244 seconds]
__butch__ has quit [Quit: Leaving.]
justinseiter has joined #ruby-lang
bluepojo has joined #ruby-lang
<foucist>
HAHA
heftig has quit [Ping timeout: 245 seconds]
marr has quit [Ping timeout: 252 seconds]
buscapepe has quit [Ping timeout: 252 seconds]
cirenyc has joined #ruby-lang
heftig has joined #ruby-lang
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
rsl has quit [Quit: Computer has gone to sleep.]
<drbrain>
Spaceghostc2c: don't post such things
<Spaceghostc2c>
drbrain: :(
cirenyc has quit [Ping timeout: 244 seconds]
lcdhoffman has joined #ruby-lang
<drbrain>
I'd like to keep this channel welcoming to people. Implied naked women isn't welcoming
<Spaceghostc2c>
drbrain: The caption is: "The price of cheezberger is too damn high.
<Spaceghostc2c>
"
<hakunin>
Question is - when does ruby delete tempfiles? Would it ever delete a tempfile on a routine GC?
<Spaceghostc2c>
hakunin: So the picture didn't help as much as I'd hoped, eh?
<hakunin>
(Besides on exit of course)
brianpWins has quit [Quit: brianpWins]
<hakunin>
Spaceghostc2c: it helped avoid any more of them. my irc client shows pictures inline, had to explain to my wife why i'm looking at this.
<Spaceghostc2c>
hakunin: Oh dear!
<Spaceghostc2c>
It might've been better with the caption.
blazes816 has quit [Quit: blazes816]
<Spaceghostc2c>
You can blame it on me, I'm sure she'll understand.
<hakunin>
I'm just very interested whether ruby deletes tempfiles during garbage collect
<hakunin>
looks like it does
<hakunin>
but when no variables refer to them
<Spaceghostc2c>
temp files?
<hakunin>
yes
<Spaceghostc2c>
How are you writing them?
<hakunin>
Tempfile.new
<hakunin>
(Paperclip gem writes them, but i'm looking at source)
mjio has quit []
<Spaceghostc2c>
Oh!
<hakunin>
point is - it has a way to get a file from wherever it's stored to the local filesystem
<hakunin>
and i confirm that it does do that, file gets to the local filesystem with size > 0
<hakunin>
but subsequently trying to access file path where that happens
<hakunin>
randomly says "file or directory not found"
<hakunin>
(as in, every once in a while)
<hakunin>
often works
<hakunin>
sometimes doesn't
xyzodiac has quit [Ping timeout: 252 seconds]
<Spaceghostc2c>
Can you watch the filesystem on that file?
<hakunin>
i mean there's a paperclip issue on that
<hakunin>
but the source is very simple
<Spaceghostc2c>
Spin up another ruby process to watch the file and output when the file stops existing?
<hakunin>
it just writes Tempfile.new, nothing else going on
<hakunin>
i can confirm that file gets to the filesystem
<hakunin>
because i check immediately after the "download" that it exists and size > 0
<hakunin>
if not - i raise error
<hakunin>
that error never gets raised
xyzodiac has joined #ruby-lang
<hakunin>
instead it fails later, when i try to access that path later in code
<hakunin>
randomly
<postmodern>
where's the code that allows rdoc sites to be searchable, i found a bug
<postmodern>
appears to be different code than the normal darkfish rdoc template
<hakunin>
so while the later fail happens randomly, my check for file's existence right after download never fails
<hakunin>
leading me to think that perhaps ruby GCs it
<hakunin>
Another question that could lead me to solution....
<hakunin>
If I assign an object to a local variable
<hakunin>
and then method ends
<hakunin>
will that local variable be garbage collected if that object isn't referenced elsewhere?
<hakunin>
this might actually be it
<hakunin>
i'm gonna have to verify my theory
gregmoreno has quit [Read error: Operation timed out]
<hakunin>
I'm assigning a tempfile to a local variable, and then returning file.path string instead of tempfile object itself, so if GC occurred between returning path and accessing it - tempfile could very well be gone
<hakunin>
Spaceghostc2c: pick a channel : )
<Spaceghostc2c>
hakunin: only one? :D
<jsilver>
Spaceghostc2c: node version of GC2 made
<hakunin>
Spaceghostc2c: hm, if i GC.disable, then run it manually, it could confirm my suspicion
<Spaceghostc2c>
jsilver: Of what?
<jsilver>
GlobalChat2 Server
<Spaceghostc2c>
Also, why bother? write it in Go.
<jsilver>
don't know go
<jsilver>
i like node
<Spaceghostc2c>
Lol.
<jsilver>
its performant and low mem, low cpu
<Spaceghostc2c>
hakunin: Or if you just use a constant too!
<jsilver>
everything i was looking for
<jsilver>
what does Go do thats so cool
<Spaceghostc2c>
jsilver: Single core as well for the reactor.
<jsilver>
i hear a lot of "Go"
<jsilver>
ah
<Spaceghostc2c>
Goroutines, scales across cores and machines and the such pretty well.
<jsilver>
still, was just looking for smalls procs that didnt zombie
<jsilver>
hmm
<Spaceghostc2c>
erlang wouldn't be fast, but it's a great language.
<jsilver>
i need fast and small mem small cpu
<jsilver>
1 server = a room
<jsilver>
node is great for this, hasnt crashed all day, seems nicer on the b/e than ruby, which still works but can zombie unless 1.9
<Spaceghostc2c>
Lolk.
<jsilver>
does Go compile to ASM?
* Spaceghostc2c
looks at the floor
<Spaceghostc2c>
Looking at the floor is what I do at work when people need to rtfm.
<jsilver>
already am
<jsilver>
i rtfm religiously
<seanstickle>
Based on some religious folks I know, that means you read some of the words in red and ignore the rest of the manual.
<jsilver>
LOL
<jsilver>
Go looks go
<jsilver>
good
mjio has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
<rking>
Anyone in strong favor for or against rake tasks defaulting to running the tests?
<tpope>
in favor where there's not something better to do
<rking>
tpope: Do you have an example of the 'something better'?
<catepillar>
tpope: thanks
nvick has quit [Quit: nvick]
<tpope>
if you're building something
<charliesome>
catepillar: you could just call #inspect on the string
<Spaceghostc2c>
Take the thing you do most often in rake tasks, make that the default.
<tpope>
charliesome: so obvious :/
<Spaceghostc2c>
Make everything else similarly easy and quick to do.
<tpope>
I recently had to do this exact task in VimL, so I didn't even think of that
<tpope>
basically I was...reimplementing #inspect
<charliesome>
tpope: while it does more than what catepillar is asking, i'm *guessing* that he's trying to do something inspect-like
<tpope>
yeah exactly
<catepillar>
charliesome: i think that's exactly what i want
<tpope>
way to read intent rather than just answering like a literal jerk
<catepillar>
the problem is that im trying to santize something from a web page, where white space doesn't mean much, but puts is spilling new lines EVERYWHERE
<tpope>
maybe I spoke too soon
<Spaceghostc2c>
too soon bro
<catepillar>
uh-oh?
<tpope>
catepillar: maybe just gsub(/\s+/, ' ')?
<tpope>
I mean if you want to preserve the semantics of the html
<catepillar>
no, i want to preserve the fact that it is there
<tpope>
okay, then have fun
<catepillar>
but i dont want it printint thousands of lines
<catepillar>
im building an IRC bot, and the newlines mean stuff
<catepillar>
but its spamming my channel right now :s
<tpope>
okay then inspect sounds right
<rking>
I like how the bot on #perl6 uses Unicode chars to represent Newline and such.
kingcrawler has quit [Quit: Computer has gone to sleep]
stonerfish has joined #ruby-lang
<rking>
<rking> r: say 'hi'
<rking>
<p6eval> rakudo e2f2dc: OUTPUT«hi»
<rking>
(e2f2dc is the build's commit)
burgestrand has quit [Quit: Leaving.]
rohit has quit [Ping timeout: 244 seconds]
mrsolo has joined #ruby-lang
justinseiter has quit [Remote host closed the connection]
kitallis has quit [Read error: Connection reset by peer]
oxyn has quit [Ping timeout: 264 seconds]
marr has joined #ruby-lang
banisterfiend has joined #ruby-lang
mindbender1 has quit [Quit: Leaving.]
kitallis has joined #ruby-lang
faustman has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
LanceHaig has joined #ruby-lang
joaovrmaia has joined #ruby-lang
oxyn_ has quit [Ping timeout: 264 seconds]
judofyr has joined #ruby-lang
waffleau__ has joined #ruby-lang
waffleau_ has quit [Read error: Connection reset by peer]
tbuehlmann has joined #ruby-lang
jds has joined #ruby-lang
oxyn has joined #ruby-lang
krz has quit [Quit: krz]
sepp2k has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
GarethAdams has joined #ruby-lang
agnitio has joined #ruby-lang
mars777 has quit [Quit: mars777]
mossplix_ has joined #ruby-lang
kurko_ has joined #ruby-lang
cultureulterior_ has joined #ruby-lang
mossplix has quit [Ping timeout: 252 seconds]
mossplix_ is now known as mossplix
heftig has quit [Quit: leaving]
Assurbanipal has quit [Quit: Konversation terminated!]
Rbl has joined #ruby-lang
<Rbl>
Hello everyone
<judofyr>
hello Rbl
<Rbl>
I am quite new to Ruby and I would like to know the point of such a function : http://pastie.org/5483223 , while we can simply do a match(/\d/) which would, I guess, return the exact same thing ?
<judofyr>
Rbl: well, that handles more stuff: "1_000_000.123".numeric?
<judofyr>
so /[\d_](\.[\d_])?/ is probably better
<judofyr>
Rbl: but I'm not a fan of "rescue false"
<judofyr>
lzhz: well, I've never actually needed such a function…
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<judofyr>
method*
<lzhz>
there are plenty of methods in core I have never needed, but I still see the point of their existence.
<GarethAdams>
it all depends on your user requirements
s1n4 has joined #ruby-lang
<GarethAdams>
it is *right* for a user to be able to enter '0x12ab' as a parameter, when you're asking for a number?
<GarethAdams>
only the person writing the app can decide that. But if it *is* ok, then Float(str) is a good approach.
<Rbl>
GarethAdams: Depends what you mean
JohnBat26 has joined #ruby-lang
<Rbl>
GarethAdams: If I have a form where I *should* type a number, but letters are allowed, make your app ready to be stressed ;)
<wnd>
Float-rescue is imo the best by far. it works for different bases, scientific notation and basic decimal integers too.
Hakon has joined #ruby-lang
<GarethAdams>
Rbl: What I'm saying is, "0x7c0".numeric? # => true. But if you think that's an error when I type that into a "Year of birth" field (even though it means 1984) then you probably don't want to use .numeric?
<Rbl>
GarethAdams: Surely not, I would do a validBirthDate() method for sure.
anannie has quit [Remote host closed the connection]
oxyn_ has joined #ruby-lang
oxyn_ has quit [Client Quit]
oxyn has quit [Ping timeout: 244 seconds]
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
kennyvb has quit [Remote host closed the connection]
oxyn has joined #ruby-lang
Hakon has joined #ruby-lang
jds_ has quit [Ping timeout: 264 seconds]
jds has quit [Ping timeout: 260 seconds]
jds has joined #ruby-lang
heftig has joined #ruby-lang
jds_ has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
oxyn has quit [Ping timeout: 244 seconds]
wallerdev has quit [Quit: wallerdev]
zz_chrismcg is now known as chrismcg
jds_ has quit [Ping timeout: 244 seconds]
oxyn has joined #ruby-lang
madish has joined #ruby-lang
Nisstyre-laptop has quit [Ping timeout: 260 seconds]
oxyn has quit [Client Quit]
gnufied has quit [Quit: Leaving.]
robbyoconnor has quit [Ping timeout: 255 seconds]
<tockitj_>
often i need to do 'var = nil' before some block in ruby - just to have variable defined in 'upper' scope... is there a way around it - without using 'var = nil' idiom
<judofyr>
tockitj_: not really
<judofyr>
matz is not a fan of "var foo" or "my foo"
<judofyr>
"Since I am sick of 'var' and 'local' in other languages, I don't want to add explicit local variable declaration, that requires a new keyword. "
gnufied has joined #ruby-lang
spike|spiegel has quit [Quit: WeeChat 0.3.9.2]
willdrew has joined #ruby-lang
willdrew has quit [Remote host closed the connection]
willdrew has joined #ruby-lang
<tockitj_>
but 'var = nil' is somewhat misleading since i don't want to do assignment (just define var)
<tockitj_>
and thanks for pointer judofyr :)
<judofyr>
tockitj_: well, all variables are initialized to nil anyway
waffleau has quit [Quit: waffleau]
toretore has joined #ruby-lang
jbsan has joined #ruby-lang
jds_ has joined #ruby-lang
stardiviner has joined #ruby-lang
<charliesome>
judofyr: var = nil is ugly though
<judofyr>
charliesome: var = :local if false
<judofyr>
better?
<charliesome>
nope :|
<charliesome>
judofyr: almost as ugly as a variable by itself on the last line of a method
<judofyr>
charliesome: if you have `var = …; something; var`, it's often a sign that you could have used #inject
<lzhz>
or each_with_object
<whitequark>
judofyr: #each_with_object.
<whitequark>
NOT inject.
<charliesome>
^
<lzhz>
:-)
<whitequark>
(this is my pet peeve. sorry.)
<charliesome>
i actually told a guy about each_with_object once because he was using inject for that
<charliesome>
and he says "but inject is shorter"
Asher has quit [Quit: Leaving.]
<judofyr>
charliesome: `var = nil` doesn't make sense with each_with_object
<judofyr>
err
<judofyr>
whitequark: ^
<judofyr>
charliesome: seriously though, #each_with_object is a bit long
<whitequark>
judofyr: if you use #inject (which is better named #reduce, but that's another topic) on something when you don't need to accumulate result
<judofyr>
whitequark: but yes, in some cases each_with_object
<judofyr>
(most cases)
<whitequark>
i.e. you just need to eliminate a variable reference like here
Asher has joined #ruby-lang
<whitequark>
then you need #each_with_object
<whitequark>
otherwise yeah, #reduce
<charliesome>
there's other times when you might set a variable, do some things with it, then return it
<charliesome>
for those situations i like the tap trick
<whitequark>
in fact I personally consider the whole thing with #each_with_object/#inject somewhat like semicolonless javascript
<whitequark>
you could just expand that to var=nil;...;var and spend the time on something useful instead of arguing on irc
<charliesome>
in what way?
<judofyr>
whitequark: speaking of JavaScript, can you compile Rails to JS now?
<whitequark>
judofyr: never was going to
<judofyr>
whitequark: I know
kennyvb has joined #ruby-lang
<charliesome>
then you can compile your rails app to js
<charliesome>
and run it with node.js
<judofyr>
whitequark: but: status?
<charliesome>
for webscale
<whitequark>
judofyr: I'm considering adding optional (very ruby-ish) typing at this point
<judofyr>
whitequark: interesting
<whitequark>
one reason I could demonstrate right now is that Ruby is actually a statically typed language at its core.
<whitequark>
pass anything except Fixnum to Array#[]
<judofyr>
isn't "strongly" the word?
<whitequark>
or, more importantly, anything except Fixnum which implements #to_int and does _not_ return Fixnum
<whitequark>
judofyr: no. Ruby is strongly typed everywhere.
<whitequark>
weak typing would be like PHP or JS; 0 == false
pab|o has joined #ruby-lang
<judofyr>
whitequark: yes, that was my point
<lzhz>
maybe #each should work like #each_with_object when passed an argument (other than the block)?
<yorickpeterse>
"1" == 1 # lol
<whitequark>
judofyr: and I mean that there is a lot of places where Ruby only accepts one particular type, and for good reasons
<lzhz>
that would make each (with object) shorter than inject/reduce.
<whitequark>
look out for everything implemented in C and/or receiving Class, Module, Symbol, Fixnum and so on
<sepp2k>
whitequark: Why does that demonstrate that Ruby is statically typed at its core? Surely the resulting type error is dynamic (i.e. run-time).
<whitequark>
lzhz: #each is Ruby's enumerator protocol, it's implemented all over stdlib and gems, whereas #each_with_object is within Enumerable and so there's a single entry point
<lzhz>
true
<whitequark>
sepp2k: agreed. Could you suggest a better word? I'm aiming for something meaning "not duck-typed"
<whitequark>
"statically" probably doesn't fit that well enough
<charliesome>
it sort of is duck typed
<charliesome>
with the whole to_int thing
<whitequark>
charliesome: that just takes the problem one level further
<charliesome>
but there's only so far you can go with trying to duck type everywhere
pedromedeiros has joined #ruby-lang
<yorickpeterse>
geese-typed
<yorickpeterse>
it looks a bit like a duck but it isn;t
<yorickpeterse>
* isn't
<judofyr>
heh, reminds me of "duck-punching"
<judofyr>
(which is a great name for monkey-patching)
<sepp2k>
whitequark: Nominally typed.
banister_ has joined #ruby-lang
<whitequark>
sepp2k: that doesn't exactly fit either IMO, but is better than "statically" indeed
<sepp2k>
Why does that not fit?
<charliesome>
duck typed to the first degree
nertzy3 has joined #ruby-lang
<whitequark>
sepp2k: because it's an opposite of structural typing, and that doesn't have anything to do with duck typing?
rhizo has joined #ruby-lang
<sepp2k>
whitequark: It doesn't? I would have said the terms are synonymous.
<whitequark>
sepp2k: oh. yes, that makes sense if you consider the interface, rather the encapsulated data layout, as the structure
<whitequark>
thanks
adambeynon has joined #ruby-lang
srbaker has joined #ruby-lang
<tockitj_>
is it possible to mock only one method on existing object ?
nertzy2 has quit [Ping timeout: 260 seconds]
<whitequark>
judofyr, charliesome: ok. talking about implementations again, the point is that when programming for embedded devices, you need that kind of enforcement often
<judofyr>
tockitj_: sure, but it depends on the mocking framework you're using
<whitequark>
I've thought of some ways to achieve it without adding new syntax, and it's perfectly possible but quite ugly
<judofyr>
whitequark: hm… have you seen how Mirah solves it?
anannie has joined #ruby-lang
anannie has quit [Client Quit]
mytrile has joined #ruby-lang
<tockitj_>
how to do it on rspec ? (:
<whitequark>
judofyr: yeah
<whitequark>
judofyr: and it conflicts (syntactically) with 2.0 keyword arguments, which I will certainly include
rhizo has quit [Read error: Connection reset by peer]
<judofyr>
tockitj_: hm… dunno…
<charliesome>
whitequark: why not have something like: def add(Fixnum a, Fixnum b) -> Fixnum
<yorickpeterse>
What about `Fixnum number = 10`?
<whitequark>
charliesome: exactly what I came with
<yorickpeterse>
or `HerpDerpMyClass example = HerpDerpMyClass.new('...')`
<whitequark>
except with : instead of ->, but -> is better as it doesn't conflict with symbol in tokenizer
rhizo has joined #ruby-lang
<charliesome>
whitequark: i think that looks fine personally
<whitequark>
yorickpeterse: I've came to the conclusion that type annotations are not useful for local variables
<charliesome>
whitequark: will you have casts
<yorickpeterse>
well maybe not local ones but I'd certainly would like to have a slightly more solid type checking
<whitequark>
charliesome: as simple as Type.coerce(something)
<charliesome>
so if it fails to infer a type properly, you can say "listen compiler, i know better than you" and cast a value to what you want
<whitequark>
I'm aiming to write most of this in Ruby. Ruby is incredibly easy to extend
<judofyr>
whitequark: .coerce is already used though
<charliesome>
whitequark: not so much coercion or casts as they usually work, but a way to annotate an expression with a type
<judofyr>
isn't it?
<charliesome>
which would blow up at runtime if the type annotation is wrong
<judofyr>
ah, no, that's Object#coerce
<whitequark>
charliesome: it's better to check everything at compile time
<whitequark>
I'm implementing a language for embedded development after all. you don't reopen classes there even when you load code at runtime
<whitequark>
another thing is that you don't need to write any typing annotations for compile-time code, i.e. metaprogramming
<whitequark>
you just write plain old ruby
<whitequark>
even better, you don't actually lose duck typing. suppose you have a method which expects something to have #each, and it's called with arguments of three distinct types
jammanbo has joined #ruby-lang
<whitequark>
basically, three variants of that method will be generated (and possibly coalesced if the optimizer could do that)
<whitequark>
and you won't need any typing annotations.
<whitequark>
Ruby doesn't have explicit interfaces, and, I believe, there is no point in trying to add them. They just won't work.
<jammanbo>
Are there any RVM verterans here who can tell me why rvmsudo can't find my thin? http://pastie.org/5483607. #rvm channel is silent.
<judofyr>
jammanbo: does `rvmsudo /home/pant/.rvm/gems/ruby-1.9.3-p327/bin/thin` work?
<whitequark>
judofyr, charliesome: there will (I hope) be a big blog post in a few days about all these things
<whitequark>
I'm afk for a hour
<judofyr>
whitequark: \o/
<whitequark>
through I read the backlog
Guest37862 has quit [Ping timeout: 255 seconds]
banister_ has left #ruby-lang [#ruby-lang]
banisterfiend has joined #ruby-lang
<banisterfiend>
whitequark: do you write your posts in both cyrillic and english?
<jammanbo>
judofyr: Oh, it does! But why, when rvmsudp echo $PATH suggests to me that's not necessary.
<charliesome>
STДTIC TУPIИG IЙ THЗ ЯЦЬЧ
<yorickpeterse>
wat
<judofyr>
banisterfiend: don't you mean "russian"?
<judofyr>
jammanbo: $PATH is probably expanded before rvmsudo is called
mossplix has quit [Read error: Connection reset by peer]
mossplix_ has joined #ruby-lang
<jammanbo>
judofyr: Ah. Thanks.
<banisterfiend>
judofyr: Yeah, i just wanted to say cyrillic
<whitequark>
I used to write posts in russian, but there is not enough rubyists here for me to care, and the ones I do care about all know English anyway
m3nd3s has joined #ruby-lang
<banisterfiend>
whitequark: what about your good russian hacker friends homokov and funny falcon
sepp2k has quit [Quit: Leaving.]
<banisterfiend>
whitequark: i see plenty of russian/ukranian rubyists around anyway..
arya has joined #ruby-lang
sailias has joined #ruby-lang
waffleau has left #ruby-lang [#ruby-lang]
<masterkorp>
banisterfiend: as a portuguese minority, i gave up on writing in portuguese
<masterkorp>
english is simple and opens the text/code whatever to the whole world
waffleau has joined #ruby-lang
arya has left #ruby-lang [#ruby-lang]
<judofyr>
not much written in Norwegian either
<judofyr>
but pretty much everyone in Norway speaks English
xyzodiac has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby-lang
lcdhoffman has joined #ruby-lang
<injekt>
yeah guys me too
<injekt>
:/
Uranio has quit [Quit: WeeChat 0.3.8]
SubSpawn has joined #ruby-lang
Uranio has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
<imperator>
american here....me too
cirenyc has joined #ruby-lang
davidbalber|away is now known as davidbalbert
rue|w has quit [Ping timeout: 248 seconds]
Weems has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
sepp2k has joined #ruby-lang
bastilian has joined #ruby-lang
davidbalbert is now known as davidbalber|away
outoftime has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
lcdhoffman has joined #ruby-lang
mars777 has joined #ruby-lang
sailias has quit [Quit: Leaving.]
sailias has joined #ruby-lang
<andrewvos>
injekt: You pinged?
gnufied has quit [Quit: Leaving.]
cirenyc has quit [Quit: Leaving...]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
gsav has quit [Client Quit]
gsav_ has quit [Client Quit]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
methods has joined #ruby-lang
rippa has joined #ruby-lang
outoftime has quit [Ping timeout: 260 seconds]
gsav has quit [Client Quit]
gsav_ has quit [Client Quit]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
<injekt>
sent-hil: configuration options for rspec or for using in ARGV ?
<sent-hil>
injekt: former, i want to run some code in RSpec.configure blk based on the flags
bastilian has quit [Quit: Leaving...]
<injekt>
sent-hil: rspec allows you to pass configuration values to the runner exactly how you're done it, I'm not sure why it's not working for you. Can you paste a backtrace?
<injekt>
ah of course :) just how you'd do it with rake
<injekt>
no probs
agnitio has quit [Quit: Leaving]
guns has joined #ruby-lang
dankest has joined #ruby-lang
xyzodiac has joined #ruby-lang
xyzodiac has quit [Max SendQ exceeded]
ruskie has quit [Quit: ...]
davidbalbert is now known as davidbalber|away
xyzodiac has joined #ruby-lang
xyzodiac has quit [Max SendQ exceeded]
xyzodiac has joined #ruby-lang
GarethAdams has quit [Quit: Leaving...]
dr_bob has joined #ruby-lang
xyzodiac has quit [Max SendQ exceeded]
xyzodiac has joined #ruby-lang
havenn has joined #ruby-lang
chimkan has quit [Quit: chimkan]
chimkan has joined #ruby-lang
vlad_starkov has joined #ruby-lang
ryanlecompte has joined #ruby-lang
ryanlecompte has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
ryanlecompte has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 252 seconds]
mindbender1 has quit [Ping timeout: 265 seconds]
arya has joined #ruby-lang
arya has left #ruby-lang [#ruby-lang]
methods has left #ruby-lang [#ruby-lang]
Nisstyre-laptop has joined #ruby-lang
enebo has quit [Quit: enebo]
towski has quit [Remote host closed the connection]
andrewhl has joined #ruby-lang
workmad3 has quit [Ping timeout: 255 seconds]
ruskie has joined #ruby-lang
alvaro_o has joined #ruby-lang
datanoise has quit [Ping timeout: 264 seconds]
xyzodiac has quit [Ping timeout: 256 seconds]
sent-hil has quit [Remote host closed the connection]
chimkan has quit [Quit: chimkan]
__butch__ has joined #ruby-lang
runeb has joined #ruby-lang
jbsan has quit [Read error: No route to host]
seydar has joined #ruby-lang
gregmoreno has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
chimkan has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
runeb has quit [Ping timeout: 248 seconds]
Aiur has joined #ruby-lang
jbsan has joined #ruby-lang
xyzodiac has joined #ruby-lang
agile has joined #ruby-lang
mindbender1 has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
wallerdev has joined #ruby-lang
lcdhoffman has joined #ruby-lang
elcapo has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
enebo has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
<andrewvos>
injekt: You pinged yesterday?
wallerdev has quit [Ping timeout: 260 seconds]
intellitech is now known as aeberlin
Paradox has quit [Read error: Operation timed out]
luikore has joined #ruby-lang
davidbalber|away is now known as davidbalbert
seydar has quit [Quit: leaving]
datanoise has joined #ruby-lang
dankest has quit [Ping timeout: 246 seconds]
towski has joined #ruby-lang
Paradox has joined #ruby-lang
bastilian has joined #ruby-lang
sent-hil has joined #ruby-lang
mindbender1 has quit [Ping timeout: 265 seconds]
m3nd3s has joined #ruby-lang
enebo has quit [Quit: enebo]
datanoise has quit [Ping timeout: 240 seconds]
ruby-lang041 has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
gregmoreno has quit [Remote host closed the connection]
<tockitj_>
is anyone actively using 1.9 column syntax (:) for hashes instead of hash-rockets (=>)
<ddd>
i do
rhizo has quit [Quit: Ex-Chat]
wallerdev has joined #ruby-lang
gregmoreno has joined #ruby-lang
<tockitj_>
ddd, they've been around for a while, and i haven't seen anyone embracing them (:
<tockitj_>
though - its nice to be able to just eval(json)
davidbalbert is now known as davidbalber|away
zmack has quit [Remote host closed the connection]
luikore has quit [Remote host closed the connection]
<ddd>
:shrug: not everyone uses every option available to them, most are probably just used to doing it a specific way and just keep doing so.
<tockitj_>
<3 => <3
JohnBat26 has joined #ruby-lang
cardoni has quit [Quit: cardoni]
sailias has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
cirenyc has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
ruby-lang041 has quit [Ping timeout: 245 seconds]
enebo has joined #ruby-lang
<ddd>
i came in when 1.9.2 was just starting to get rolling, so i took to the : vs. => format. Plus I like the shorter syntax, but thats admittedly a personal choice.
<reactormonk>
tockitj_, eval(json) is evil anyway
leopard_me has quit [Quit: Computer has gone to sleep.]
luikore has joined #ruby-lang
davidbalber|away is now known as davidbalbert
Aiur has quit [Quit: Computer has gone to sleep.]
llakey_ is now known as llakey
davidbalbert is now known as davidbalber|away
kurko__ has quit [Ping timeout: 250 seconds]
dr_bob has left #ruby-lang [#ruby-lang]
areil has quit [Remote host closed the connection]
<ruby-lang950>
hi i have a quick question. new to ruby, from PHP. I'm not using rails yet. I'd like to make an AJAX request to my .rb file, but it just returns the contents of the file, not the product of running it. what's up?
<bougyman>
ruby-lang950: ruby is not php.
<bougyman>
the issue is your web server does not have a native ruby interpreter.
<bougyman>
you ran php in apache, i'm assuming.
<ruby-lang950>
yeah
rue|w has joined #ruby-lang
<bougyman>
if you ran it in another webserver that didn't have it built in it would be more like running a ruby app.
<ruby-lang950>
currently using xampp on my mac
<ruby-lang950>
right right
<bougyman>
there's one way out there to do so, it's called Passenger.
<bougyman>
it runs on nginx and apache.
<bougyman>
take a look.
<ruby-lang950>
great thank you. looking now
<bougyman>
but i think you're on about step 15 and skipped a few steps.
<bougyman>
what are you using for your cgi layer?
elcapo is now known as Elcapo
<bougyman>
CGI? fastcgi? Rack? (hopefully rack)
cultureulterior_ has quit [Quit: cultureulterior_]
<bougyman>
these are things you don't have to think about in php.
<bougyman>
ruby wasn't built solely for the web as php was.
<ruby-lang950>
right
<ruby-lang950>
i'm using the CGI gem
<ruby-lang950>
so...
<bougyman>
gotcha.
xyzodiac has quit [Quit: Computer has gone to sleep.]
<ruby-lang950>
ssomething like cgi.params to get my post variables
<bougyman>
yep ype.
<ruby-lang950>
cool
<ruby-lang950>
i'm slighty confused though
<ruby-lang950>
i am running xampp on my mac
<bougyman>
i've used it, i was using ruby before the web framework boom. web was one of the things ruby was pretty crappy at, before rack and the other frameworks focused on it.
<ruby-lang950>
and i have ruby on my mac
<ruby-lang950>
the missing link is that xampp doesn't know where the interpreter is?
anannie has joined #ruby-lang
Elcapo is now known as elcapo
<bougyman>
apache isn't treating it as a cgi
<bougyman>
you have it marked as executable by the user running apache, right?
<ruby-lang950>
ah
<ruby-lang950>
no
<bougyman>
by the way, it will be really slow.
<bougyman>
cause it has to spawn a ruby interpreter for every request.
<ruby-lang950>
hm
<bougyman>
fastcgi is your next level up, where one interpreter is spawned and handles many requests.
<ruby-lang950>
there is only one object i'm passing to ruby
<bougyman>
rack is kind of the standard. all the major webframeworks utilize rack for that layer.
<ruby-lang950>
speed is not important right now, somewhat in concept mode
<bougyman>
the ruby interpreter itself is not light. once it's up it can perform plenty well enough for web, but the startup time on each request would be painful. Fine for testing, just want your expectations set right.
<ruby-lang950>
but i will look up rack and passenger
judofyr has joined #ruby-lang
<ruby-lang950>
okay cool
<ruby-lang950>
so how would i mark .rb files as executables?
<ruby-lang950>
in my .htaccess?
<bougyman>
chmod u+x the.rb
<bougyman>
and chown <webuser> the.rb
<bougyman>
apache has to be configged to allow cgis in the location, as well.
tbuehlmann has quit [Remote host closed the connection]
<ruby-lang950>
okay
solars has joined #ruby-lang
dbussink has quit [Quit: Coyote finally caught me]
dbussink has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
chimkan__ has joined #ruby-lang
chimkan__ has quit [Remote host closed the connection]
<ruby-lang950>
bougyman, how do i find out what xampps <webuser> name is ?
vlad_starkov has quit [Remote host closed the connection]
<akahn>
is glob less efficient than Dir#each if I'm iterating over every file in a directory?
llaskin has left #ruby-lang [#ruby-lang]
<pabs>
the time for io and context switches is almost certainly going to dominate each, but technically glob is slightly less efficient
<pabs>
(io being, specifically, stat() calls on every entry)
bluepojo has joined #ruby-lang
<akahn>
pabs: i'm not seing stat() in strace on a big glob call http://pastie.org/5485503 . maybe this is because stat has already happened and the process is now expanding the ** part of the glob
xyzodiac has joined #ruby-lang
anannie has quit [Remote host closed the connection]
tenderlove has quit [Remote host closed the connection]
Croms has joined #ruby-lang
anannie has joined #ruby-lang
m3nd3s has quit [Remote host closed the connection]
z1 has joined #ruby-lang
z1 has quit [Client Quit]
cirwin has joined #ruby-lang
Uranio has quit [Quit: WeeChat 0.3.8]
cirenyc has joined #ruby-lang
havenn has quit [Read error: Connection reset by peer]
z_ has joined #ruby-lang
havenn has joined #ruby-lang
z_ is now known as Guest93397
Guest93397 has quit [Client Quit]
enebo has quit [Quit: enebo]
thatdutchguy has joined #ruby-lang
z__ has joined #ruby-lang
z__ has quit [Client Quit]
luikore has joined #ruby-lang
zz_chrismcg is now known as chrismcg
jds__ has joined #ruby-lang
jds__ has quit [Ping timeout: 252 seconds]
Paradox has quit [Ping timeout: 252 seconds]
pedromedeiros has quit [Quit: Saindo]
PhilCK has joined #ruby-lang
rue|w has joined #ruby-lang
crudson has quit [Remote host closed the connection]
PhilCK has left #ruby-lang [#ruby-lang]
t_ has quit [Ping timeout: 248 seconds]
<ged>
akahn, pabs: I shouldn't think glob would stat,() since it's just a front end for fnmatch(3) over the file names, right?
<ged>
And the worst case (where glob matches every file) should be equivalent to Dir#each, but better in every other case.
rue|w has quit [Ping timeout: 255 seconds]
steez has quit [Ping timeout: 250 seconds]
steez has joined #ruby-lang
steez is now known as Guest52470
cirwin has quit [Ping timeout: 264 seconds]
jbald has joined #ruby-lang
cored has quit [Read error: Connection reset by peer]
simi has quit [Ping timeout: 244 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
pdswan has quit [Quit: pdswan]
<zzak>
ged: hi
slyphon_ has joined #ruby-lang
<ged>
Hi.
pdswan has joined #ruby-lang
elcapo has quit [Ping timeout: 244 seconds]
<zzak>
ged: i saw rdoc 4 broke your fivefish generator :( and couldnt get to your site
<ged>
Ah, yeah. That's on my list of things to work on.
rolfb has joined #ruby-lang
<zzak>
:D
rolfb has quit [Client Quit]
slyphon has quit [Ping timeout: 245 seconds]
<zzak>
i was hoping to use it for my gem's docs, but i needed to parse markdown in the README, which only rdoc 4 can do
<ged>
And my CMS crashed, but it should be back up now.
<akahn>
hm, each contains '.' and '..' so I'll have to skip those manually... whereas glob only returns files
<ged>
Yeah. Hopefully this weekend, I'll have it sorted.
<zzak>
yay
srbaker has joined #ruby-lang
<zzak>
thank you!
jbald has quit [Ping timeout: 255 seconds]
<ged>
I'm excited about RDoc 4, and I have a couple of patches in it myself, so even more motivation to get it done. :P