<erikh>
sent_hil: yes but it probably doesn't do what you want.
<Aria>
Heh, what I was about to say.
<erikh>
sent_hil: fwiw, the next time you have that question, just running it will answer it better than asking here.
<erikh>
I mean, feel free to ask, but plugging it into irb will serve you better.
<sent_hil>
erikh: erikh when I do `Post.class_variables`, I get an empty array
<erikh>
right
<fp->
Aria: sorry, my terminology may be wrong
<sent_hil>
so where is the @@one stored?
imajes has quit [Excess Flood]
<erikh>
on the module
<sent_hil>
damn dbrain left
<fp->
is there a gem or any code i can use during the loop to see what my slowdown is?
<sent_hil>
erikh: how do i get a hold of it from Post instance?
<erikh>
I'm pretty sure you can't
<erikh>
but I could be wrong there. I avoid class vars like the plague
<erikh>
anyhow, nap time
<erikh>
l8r
<Aria>
Yeah, those are so often wacky. You probably want a class singleton variable and an accessor
<erikh>
^
<sent_hil>
Aria: like class << self; attr_accessor :one; end ?
imajes has joined #ruby-lang
<sent_hil>
how would that work for @@ vars
<Aria>
Yeah. That doesn't use @@ vars, that's the point.
fp- has quit [Quit: fp-]
<Aria>
@@ variables are seriously weird, a total misfeature.
<sent_hil>
Aria: Yea def...been reading up on 'Ruby under a microscope' book and was just curious about it
<Aria>
Yeah.
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
mpan has quit [Ping timeout: 260 seconds]
flebel has quit [Excess Flood]
flebel has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
kurko_ has quit [Ping timeout: 252 seconds]
nazty has quit [Read error: No route to host]
kurko_ has joined #ruby-lang
nazty has joined #ruby-lang
Aria has quit [Remote host closed the connection]
albybisy has joined #ruby-lang
<totallymike>
Is there a way to create an rspec test double that doesn't care what it receives except the messages I tell it to watch for?
phaedrix has quit [Ping timeout: 240 seconds]
<totallymike>
I want to test a method that instantiates a socket connection, puts some stuff to it, and then closes it. I have a few different expectations about the method, but I don't want to put them all in the same example what with that being bad style and all
sepp2k1 has quit [Read error: Connection reset by peer]
krzbrg has quit [Remote host closed the connection]
Madis has quit [Remote host closed the connection]
<totallymike>
WhoNeedszzz: sorry, I realized that looks like a response to your question; it's a sample to a question I just asked.
kurko_ has quit [Ping timeout: 260 seconds]
<totallymike>
The problem with my gist is that the doubles flip out when they receive the other methods
<totallymike>
The double in the first example will flip out when the bar method sends the close, and the double in the second example flips out when the bar method sends puts
kurko_ has joined #ruby-lang
postmodern has joined #ruby-lang
albybisy has quit [Remote host closed the connection]
<zenspider>
ugh.
justinmcp has quit [Remote host closed the connection]
<totallymike>
I suppose I could just make sock an ivar like so '@sock', and stub both calls in a before hook, then when it actually counts override the stubs with expectations
<richardjortega>
how do you append one csv file to another csv file?
<zenspider>
man I hate that style of testing...
* zenspider
shudders
<richardjortega>
i've tried using File.open and a+ , but not sure how to pull the other csv file
<totallymike>
zenspider: elaborate? I'd love to improve
<richardjortega>
zenspider: can i use that in a ruby script?
savage- has joined #ruby-lang
<zenspider>
totallymike: what's the value of specifying ".once"?
<zenspider>
(or at_least(:once), etc)
<zenspider>
and that code SHOULD fail, regardless of the expectations failing for unrelated stuffs
<totallymike>
I'd be willing to bet that the 'once' method just passes the expectation right through
<totallymike>
but it makes it clear to me that the test's intent is to see that it's only called once
<totallymike>
And yes I wrote the bar method such that it will fail
<zenspider>
what do you care if it is only called once or not? (course ... in this case we're talking about a socket... but I'm complaining about BDD in general, not specifically about your tests)
<totallymike>
Opening and closing socket connections is comparatively expensive. I noticed by accident that I was doing it one level too deep in a method I'd written, so it would happen for each item in a list
alvaro_o has quit [Quit: Ex-Chat]
<totallymike>
oh derp, the critique's about BDD not about my wanting to make sure I'm not banging sockets around
mpan has joined #ruby-lang
WhoNeedszzz has quit [Ping timeout: 246 seconds]
thinkdevcode has joined #ruby-lang
chimkan has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
wyhaines has joined #ruby-lang
kurko_ has joined #ruby-lang
facest has quit [Read error: Connection reset by peer]
WhoNeedszzz has joined #ruby-lang
kurko_ has quit [Client Quit]
facest has joined #ruby-lang
snk has quit [Ping timeout: 248 seconds]
snk has joined #ruby-lang
facest has quit [Read error: Connection reset by peer]
facest has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
<WhoNeedszzz>
What is reflection useful for?
facest has quit [Ping timeout: 245 seconds]
<totallymike>
For the record, that's exactly what I did. I instantiated the stub in a before(:each) hook, and in the example I set the expectations the example needed
kurko_ has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
faces has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
xalei_ has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
swarley has quit [Ping timeout: 264 seconds]
xalei has quit [Ping timeout: 244 seconds]
tenderlove has joined #ruby-lang
mpan has quit [Read error: Connection reset by peer]
Aria has joined #ruby-lang
mpan has joined #ruby-lang
Aria has quit [Ping timeout: 260 seconds]
chimkan has quit [Remote host closed the connection]
chimkan_ has joined #ruby-lang
kurko_ has joined #ruby-lang
datanoise has joined #ruby-lang
seoaqua has joined #ruby-lang
areil has joined #ruby-lang
lenilson-dias has joined #ruby-lang
datanoise has quit [Ping timeout: 256 seconds]
achiu has joined #ruby-lang
woollyams has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
Serial_Killer_C has joined #ruby-lang
kurko_ has joined #ruby-lang
lenilson-dias has quit [Ping timeout: 248 seconds]
kurko_ has quit [Ping timeout: 260 seconds]
kurko_ has joined #ruby-lang
kurko_ has quit [Client Quit]
WNz has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
WhoNeedszzz has quit [Ping timeout: 246 seconds]
WNz is now known as WhoNeedszzz
mihar has quit [Ping timeout: 246 seconds]
<Paradox>
totallymike, BDD, like all other methodologies, isnt absolute
mihar has joined #ruby-lang
<Paradox>
its a good one
<Paradox>
but doesnt fit all the time
<Paradox>
for many projects you just overly complicate your projects
thone has joined #ruby-lang
<totallymike>
Nope. It's the One True Maxim
<richardjortega>
how do you use the Ruby CSV class to handle special characters in text?
matled has quit [Remote host closed the connection]
matled has joined #ruby-lang
thone_ has quit [Ping timeout: 240 seconds]
<totallymike>
In all honesty, I'm relatively new to 'driven development' methodologies of any kind. I do, however, appreciate the documentation and sanity having good test coverage provides
Serial_Killer_C has quit [Read error: Connection timed out]
Serial_Killer_C has joined #ruby-lang
savage- has quit [Quit: savage-]
justinmcp has joined #ruby-lang
headius has quit [Quit: headius]
seanstickle has quit [Quit: seanstickle]
spuk has quit [Ping timeout: 255 seconds]
Artheist has quit [Ping timeout: 260 seconds]
blazes816 has joined #ruby-lang
Xzyx987X has joined #ruby-lang
kingcrawler has quit [Quit: Computer has gone to sleep]
verbad has joined #ruby-lang
spuk has joined #ruby-lang
HikkiJP has joined #ruby-lang
verbad has quit [Client Quit]
k4k1_c0der has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
HikkiJP has quit [Quit: .•«UPP»•.]
anannie has joined #ruby-lang
WhoNeedszzz has left #ruby-lang ["P00f!"]
anannie has quit [Read error: Connection reset by peer]
Serial_Killer_C has quit [Remote host closed the connection]
anannie has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
stardiviner has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
aredridel has joined #ruby-lang
anannie has joined #ruby-lang
savage- has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
guest has joined #ruby-lang
guest has quit [Client Quit]
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
chimkan___ has joined #ruby-lang
senekis has joined #ruby-lang
svyatov has joined #ruby-lang
havenn has joined #ruby-lang
tallship has quit [Quit: Too Hip gotta go - Going..... Down..... Mr. Tyler?]
chimkan_ has quit [Ping timeout: 260 seconds]
hakunin has quit [Remote host closed the connection]
datanoise has joined #ruby-lang
CrazyHorse18 has joined #ruby-lang
<CrazyHorse18>
what's the general idea with rubininus
dhruvasagar has joined #ruby-lang
<CrazyHorse18>
most of it's writtain in ruby.. and it has a compiler
<CrazyHorse18>
what's the competative advantage of that and say standard ruby
shachaf has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<xuser>
supposely performance
<CrazyHorse18>
… eventually?
<xuser>
don't they have a website?
<CrazyHorse18>
they have
<CrazyHorse18>
i read it
<shachaf>
Is there some Ruby package with an equivalent to lenses/traversals/folds in Haskell? I'm wondering how it would work.
<shachaf>
They're a generalization of references that lets you do various neat things.
<rking>
shachaf: Elaborate?
<shachaf>
For example, world.monsters.all.position += 1 to move all the monsters in the world by 1 unit.
<shachaf>
Or world.monsters.all.appendages.all.position += 1 to move all the appendages of all monsters by 1 unit.
<rking>
That particular thing you could piece together with some metaprogramming.
<rking>
Don't know what other cases you'd need to cover.
<shachaf>
Or "toListOf (monsters.all.appendages.all) world" to get a list of all the appendages in the world.
datanoise has quit [Ping timeout: 255 seconds]
<rking>
shachaf: Between Iteratorꜱ and method_missing, I think you'd be able to make a fairly generic thing.
cirenyc has joined #ruby-lang
<rking>
Then you can have your very own thing as confusing as RSpec. ☺
aredridel has quit [Remote host closed the connection]
<shachaf>
rking: And it just works automatically with normal lenses!
<shachaf>
I knew the answer in here would involve method_missing, though.
phaedrix has joined #ruby-lang
<rking>
shachaf: I'd like to know more about this, but am about to have to perform the little death (logging out for the night).
<rking>
I'm not quite picturing how Haskell does the part I'm picturing method_missing for
<lianj>
certainly not at runtime
<shachaf>
Nope, it's all done statically.
<shachaf>
There's the idea of a Traversal which is composable.
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
<gnufied>
morning
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
ryanf has quit [Ping timeout: 256 seconds]
runeb has joined #ruby-lang
franckverrot has quit [Quit: Connection closed for inactivity]
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
nitti has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
nitti has quit [Ping timeout: 260 seconds]
anannie has joined #ruby-lang
robotmay has joined #ruby-lang
kitallis has joined #ruby-lang
workmad3 has joined #ruby-lang
workmad3_ has joined #ruby-lang
mylordangus has quit [Remote host closed the connection]
alex_k has quit [Quit: Lost terminal]
seoaqua has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
anannie has quit [Read error: Connection reset by peer]
nazty has quit [Ping timeout: 260 seconds]
anannie has joined #ruby-lang
seoaqua has joined #ruby-lang
ttilley has quit [Ping timeout: 240 seconds]
thisirs has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
lteo has quit [Read error: Operation timed out]
seoaqua has quit [Ping timeout: 244 seconds]
franckverrot has joined #ruby-lang
futurechimp has joined #ruby-lang
jaimef has quit [Ping timeout: 244 seconds]
jaimef has joined #ruby-lang
lteo has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
<jashank>
Evening
<jashank>
Is it possible to add a local patch to a gem?
anannie has quit [Read error: Connection reset by peer]
<jashank>
Or, perhaps, a way to stop gem clobbering an extracted gem build directory?
anannie has joined #ruby-lang
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
anannie has quit [Read error: Connection reset by peer]
anannie has joined #ruby-lang
<workmad3>
jashank: it is possible to patch a gem... it's called monkey-patching
nitti has joined #ruby-lang
<jashank>
In the native-C extension?
<workmad3>
jashank: ooh, no, that's probably a bit difficult
<jashank>
Yeeeah.
<workmad3>
jashank: any chance you're using bundler to install project dependencies?
<jashank>
Nope. I'm just installing rb-gsl with some patches to make it compile/run against GSL-1.15.
svyatov has quit [Quit: svyatov]
agarcia has joined #ruby-lang
<workmad3>
jashank: only way I know then is to either a) only ever install that gem from a locally built gemfile or b) set up a personal gem repo that has your customised version of that gem in it (or c) patch it and send a pull request for the gem)
roadt has quit [Ping timeout: 256 seconds]
GarethAdams has joined #ruby-lang
nitti has quit [Ping timeout: 260 seconds]
<jashank>
Well, this bug in rb-gsl has been around for a while 9
<jashank>
(ie. since GSL-1.15 was released)
<jashank>
so I doubt it'll be fixed upstream; I guess the stopgap I currently have will have to do.
* jashank
goes back to fiddling with Classifier::LSI.
<workmad3>
jashank: could be the maintainer just hasn't had a chance to sort it... so if you have a patch and submit it upstream, it could very well be pulled in and released ;)
<workmad3>
jashank: or you could fork the gem and release your own 'rb-gsl115' gem
vlad_starkov has quit [Remote host closed the connection]
nyuszika7h has quit [Read error: Connection reset by peer]
nyuszika7h has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
kurko_ has quit [Ping timeout: 260 seconds]
Ryhnn has joined #ruby-lang
kurko_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
x0F_ has joined #ruby-lang
x0F has quit [Disconnected by services]
x0F_ is now known as x0F
kurko_ has quit [Ping timeout: 252 seconds]
keymone has joined #ruby-lang
kurko_ has joined #ruby-lang
FiXato|VPS has joined #ruby-lang
FiXato has quit [Read error: Connection reset by peer]
afader has joined #ruby-lang
afader has joined #ruby-lang
kurko_ has quit [Ping timeout: 260 seconds]
d3vic3 has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
d3vic3 has joined #ruby-lang
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
nyuszika7h has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
Artheist has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
jarib has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
coryf has joined #ruby-lang
imperator has joined #ruby-lang
thisirs has quit [Ping timeout: 240 seconds]
thisirs has joined #ruby-lang
irleif has joined #ruby-lang
kurko_ has quit [Ping timeout: 260 seconds]
runeb has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
nertzy has joined #ruby-lang
thisirs has quit [Ping timeout: 244 seconds]
vlad_sta_ has joined #ruby-lang
gsav has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
<imperator>
good morning
<banisterfiend>
imperator: sup
Hakon has joined #ruby-lang
vlad_sta_ has quit [Ping timeout: 244 seconds]
gix has quit [Ping timeout: 244 seconds]
datanoise has joined #ruby-lang
thisirs has joined #ruby-lang
mistym has quit [Remote host closed the connection]
shtirlic has joined #ruby-lang
gix has joined #ruby-lang
gsav_ has joined #ruby-lang
gsav__ has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 244 seconds]
bmaland has quit [Ping timeout: 260 seconds]
runeb has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 256 seconds]
dr_bob has quit [Quit: Leaving.]
dhruvasagar has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
nitti has joined #ruby-lang
dr_bob has joined #ruby-lang
darix has quit [Ping timeout: 246 seconds]
darix has joined #ruby-lang
darix has quit [Changing host]
darix has joined #ruby-lang
svyatov has quit [Quit: svyatov]
dhruvasagar has quit [Read error: Connection reset by peer]
desmondmonster has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gsav__ has quit [Read error: Connection reset by peer]
gsav_ has quit [Read error: Connection reset by peer]
gsav has quit [Read error: Connection reset by peer]
desmondmonster has left #ruby-lang [#ruby-lang]
postmodern has quit [Quit: Leaving]
kurko_ has quit [Ping timeout: 252 seconds]
jbwiv has joined #ruby-lang
kurko_ has joined #ruby-lang
svyatov has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
seydar has joined #ruby-lang
<seydar>
_Mon_Ouie_: ping
dhruvasagar has quit [Ping timeout: 260 seconds]
JohnBat26 has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby-lang
carloslopes has quit [Ping timeout: 260 seconds]
methods has left #ruby-lang [#ruby-lang]
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
krohrbaugh has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
krohrbaugh has joined #ruby-lang
tocki_ has joined #ruby-lang
<tocki_>
class C; @a = 101; end # how to add read accessor for @a ??
dhruvasagar has quit [Ping timeout: 248 seconds]
<judofyr>
tocki_: class C; class << self; attr_accessor :a; end end
<judofyr>
C.a # => 101
nyuszika7h has joined #ruby-lang
anachronistic has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
<manveru>
def C.a; @a; end
<manveru>
;)
dhruvasagar has joined #ruby-lang
kurko_ has joined #ruby-lang
<tocki_>
correct!
<judofyr>
heh, manveru's one is probably simpler in this case :)
thisirs has quit [Remote host closed the connection]
<tocki_>
is there any reason to use "self.a" instead of "a" for method invocation within ?
<tocki_>
is there difference in semantics ?
seydar has quit [Quit: leaving]
<manveru>
yeah
<burgestrand>
tocki_: you cannot call private methods with self.a
<tocki_>
what it is :)
<tocki_>
anything else ?
<burgestrand>
tocki_: and you cannot call setters without it: "a = 5" is different from "self.a = 5"
<tocki_>
true!
<manveru>
burgestrand for president! :D
<jaska>
at first i read burgerstand
<burgestrand>
\o/
<burgestrand>
you are not alone
<manveru>
i trust my autocomplete not to betray my thoughts
desmondmonster_ has joined #ruby-lang
<tocki_>
what is rationale for "elsif" keyword ?
krohrbaugh has quit [Quit: Leaving.]
<burgestrand>
matz preferred it
* burgestrand
shrugs
desmondmonster_ has left #ruby-lang [#ruby-lang]
<judofyr>
and Perl has it
<burgestrand>
probably those two combined then
<judofyr>
yeah
<judofyr>
he was probably just used to it from Perl
<burgestrand>
at least it’s not elif
<judofyr>
elves
<burgestrand>
elvesif
<tocki_>
and Perls rationale for this is "you'll choose your own keywords when you get to design own language" :)
<judofyr>
:)
<tocki_>
anyway is there a way for module to expose its class variables to class (and instances) which include it ?
bmaland has joined #ruby-lang
enebo has joined #ruby-lang
fa1ur has joined #ruby-lang
mwjcomputing has joined #ruby-lang
g0bl1n has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
bmaland has quit [Ping timeout: 255 seconds]
<judofyr>
tocki_: def foo; ModuleName.foo end ?
outoftime has quit [Ping timeout: 264 seconds]
<manveru>
you mean class instance variables?
rippa has joined #ruby-lang
savage- has joined #ruby-lang
g0bl1n has quit [Quit: g0bl1n]
kain has quit [Ping timeout: 252 seconds]
kain_ has joined #ruby-lang
g0bl1n has joined #ruby-lang
outoftime has joined #ruby-lang
blacktulip has quit [Ping timeout: 260 seconds]
blacktulip has joined #ruby-lang
alexkira has joined #ruby-lang
headius has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
blazes816 has joined #ruby-lang
irleif has joined #ruby-lang
toertore has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
nitti_ has joined #ruby-lang
kurko_ has joined #ruby-lang
blacktulip has quit [Ping timeout: 244 seconds]
blacktulip has joined #ruby-lang
toretore has quit [Ping timeout: 276 seconds]
nitti has quit [Ping timeout: 265 seconds]
dr_bob has quit [Quit: Leaving.]
runeb has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
senekis has joined #ruby-lang
Nektye has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
irleif has joined #ruby-lang
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
gsav__ has joined #ruby-lang
senekis_ has joined #ruby-lang
senekis has quit [Ping timeout: 256 seconds]
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
kurko_ has quit [Ping timeout: 264 seconds]
kurko_ has joined #ruby-lang
g0bl1n has quit [Quit: g0bl1n]
kain_ is now known as kain
blacktulip has quit [Ping timeout: 246 seconds]
solars has quit [Ping timeout: 265 seconds]
thinkdevcode has joined #ruby-lang
blacktulip has joined #ruby-lang
melter_ has joined #ruby-lang
melter_ has quit [Client Quit]
melter_ has joined #ruby-lang
dpatel has joined #ruby-lang
melter_ has quit [Read error: Connection reset by peer]
melter has quit [Remote host closed the connection]
melter has joined #ruby-lang
sn0wb1rd has quit [Quit: sn0wb1rd]
g0bl1n has joined #ruby-lang
snafoo has quit [Ping timeout: 246 seconds]
mantono has quit [Ping timeout: 260 seconds]
savage- has quit [Quit: savage-]
burgestrand has quit [Quit: Leaving.]
heftig has quit [Quit: leaving]
Dreamer3__ has joined #ruby-lang
agarcia has quit [Quit: Konversation terminated!]
snafoo has joined #ruby-lang
snafoo has joined #ruby-lang
snafoo has quit [Changing host]
wallerdev has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
svyatov has quit [Quit: svyatov]
dc5ala has quit [Quit: Ex-Chat]
kurko_ has joined #ruby-lang
gaveen has joined #ruby-lang
gaveen has quit [Changing host]
gaveen has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
johntit0r has joined #ruby-lang
johntit0r has left #ruby-lang [#ruby-lang]
krohrbaugh has joined #ruby-lang
countdigi has joined #ruby-lang
Nektye has quit [Quit: Leaving]
<andrewvos>
erikh: Is it later?
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby-lang
nazty has joined #ruby-lang
futurechimp has quit [Quit: Leaving]
judofyr has quit [Ping timeout: 265 seconds]
runeb has joined #ruby-lang
enebo has quit [Quit: enebo]
corecode has joined #ruby-lang
<corecode>
hi there
<corecode>
is there a way to set the Binding that is used for a require?
<corecode>
i.e. if i have a file "settings.rb" with content "foo = 3", that i can require "settings" so that the assignment to foo winds up at a Binding of my choice?
<bougyman>
no
svyatov has joined #ruby-lang
<corecode>
that's sad
<corecode>
alternative suggestions?
carloslopes has joined #ruby-lang
dabradley has joined #ruby-lang
<bougyman>
depends on the use case.
<bougyman>
I can't see any sane use case for this.
<corecode>
reading settings
<bougyman>
i'd use json or yaml for that.
<corecode>
yea, i want to use ruby
wallerdev has quit [Quit: wallerdev]
<bougyman>
JSON.parse File.read("test.json")
<bougyman>
=> {"foo"=>"bar"}
<bougyman>
that is using ruby
<bougyman>
json is just the settings file format.
<darix>
corecode: why not something like Settings.foo ?
<bougyman>
that's the best way to do it in ruby, namespace it to a module or class or instance
shtirlic has quit [Read error: Connection reset by peer]
sn0wb1rd has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
d3vic3 has quit [Ping timeout: 260 seconds]
wallerdev has joined #ruby-lang
d3vic3 has joined #ruby-lang
ryanlecompte has joined #ruby-lang
irleif has quit [Quit: Computer has gone to sleep.]
darix has quit [Ping timeout: 246 seconds]
darix has joined #ruby-lang
darix has quit [Changing host]
darix has joined #ruby-lang
alvaro_o has joined #ruby-lang
nitti_ has quit [Remote host closed the connection]
Paradox has quit [Ping timeout: 246 seconds]
rwilcox has joined #ruby-lang
Paradox has joined #ruby-lang
pbjorklund has quit [Read error: Connection reset by peer]
pbjorklund has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
cschwartz has quit [Ping timeout: 252 seconds]
jarib has quit [Excess Flood]
dr_bob has joined #ruby-lang
jarib has joined #ruby-lang
nazty has quit [Ping timeout: 260 seconds]
mrsolo has joined #ruby-lang
nertzy has quit [Quit: This computer has gone to sleep]
Uranio has joined #ruby-lang
gix has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
nazty has joined #ruby-lang
apeiros_ has joined #ruby-lang
perryh has quit [Excess Flood]
perryh has joined #ruby-lang
perryh has quit [Changing host]
perryh has joined #ruby-lang
gix has joined #ruby-lang
AlHafoudh has joined #ruby-lang
irleif has joined #ruby-lang
kitallis has quit [Quit: Computer has gone to sleep.]
sandbags has quit [Remote host closed the connection]
yxhuvud has quit [Ping timeout: 252 seconds]
erichmenge has joined #ruby-lang
sepp2k1 has quit [Remote host closed the connection]
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
Mon_Ouie has quit [Read error: Connection reset by peer]
justinram has quit [Read error: Connection reset by peer]
justinram has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
rebelcan has quit [Quit: leaving]
rebelcan has joined #ruby-lang
kurko_ has quit [Read error: Connection reset by peer]
outoftime has quit [Ping timeout: 246 seconds]
shtirlic has joined #ruby-lang
outoftime has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<agib>
does anyone know if the fastthread gem is still relevant for Ruby 1.9.3?
solars has joined #ruby-lang
Kingy has joined #ruby-lang
chancancode has joined #ruby-lang
<apeiros_>
agib: fastthread was incorporated into ruby back in 1.8.5, you only need it if you need a newer version that is in ruby already
bmaland has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby-lang
<agib>
apeiros_: oh whoa, ok -- yeah it's in my Gemfile for some reason... can't remember why, but not sure if it really needs to be there
<agib>
thank you!
<apeiros_>
some ruby versions had broken fastthread
<apeiros_>
there it was meaningful to still use the gem
afader has quit [Ping timeout: 276 seconds]
<agib>
kk -- by any chance do you know about ruby 1.9.3-p0?
banisterfiend has joined #ruby-lang
<apeiros_>
I don't, sorry.
<chancancode>
Since class instance variables are basically global variables.. should I be locking a class method that does something like "def civar; @civar ||= sth_expensive; end"? (in a threaded environment)
<apeiros_>
if you use 1.9.3, you should use the newest patchlevel, though
<chancancode>
or are assignments guaranteed to be thread safe in ruby?
<agib>
apeiros_: but I guess since no other gems of in my Gemfile depend on it, it's probably not necessary...
<apeiros_>
chancancode: where do you have that misconception from that class ivars where almost like globals?
<apeiros_>
they're nothing like globals.
<agib>
apeiros_: good call
<apeiros_>
agib: to my knowledge, 1.8.5 was the only one with a broken fastthread. but I might be mistaken.
<apeiros_>
s/where almost/were almost/
<chancancode>
apeiros_: well i guess that part is irrelevant and i didn't explain it well
<chancancode>
but anyways
<chancancode>
just wondering what's the worst that could happen if i don't lock a ||= assignment
<apeiros_>
a resource is not responsible for making itself thread-safe
<agib>
apeiros_: cool, I will test out my app without it and see. Thank you again for the help, really appreciate it
<apeiros_>
the threading user is responsible to put correct locks around it
<apeiros_>
(thread-safe datastructures would be the exception)
<chancancode>
apeiros_: I guess I'll post the code somewhere to show you what I'm doing
<chancancode>
It's a bit simplified but that's more or less what I am trying to do
<apeiros_>
yeah, no point in making that thread-safe
<chancancode>
I'm not super concerned about the data being loaded more than once.. (it's just a bit wasteful but it won't cause any damage) but i'm just wondering if this is going cause problems (corrupted memory) in threaded env
<apeiros_>
you're messing up responsibility
<chancancode>
cause i'm not sure if assignment is atomic in ruby
<apeiros_>
that wouldn't matter, you do more than assignment there.
<apeiros_>
anyway, again: no, putting thread safety in that piece of code would put the responsibility in the wrong place.
<chancancode>
hm okay
anannie has joined #ruby-lang
rdavila has joined #ruby-lang
irleif has joined #ruby-lang
<chancancode>
thanks btw
headius has quit [Quit: headius]
Kingy has quit [Read error: Connection reset by peer]
Kingy has joined #ruby-lang
Ryhnn has quit [Ping timeout: 244 seconds]
outoftime has quit [Read error: No route to host]
justinmcp has joined #ruby-lang
kylemcgill has joined #ruby-lang
workmad3 has quit [Ping timeout: 248 seconds]
justinram has quit [Read error: Connection reset by peer]
justinram has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
nazty has quit [Read error: Connection reset by peer]
nazty has joined #ruby-lang
nignaztic has joined #ruby-lang
benanne has joined #ruby-lang
nazty has quit [Ping timeout: 260 seconds]
Xzyx987X has quit [Quit: Leaving]
nignaztic has quit [Read error: Connection reset by peer]
wyhaines has quit [Remote host closed the connection]
irleif has quit [Quit: Computer has gone to sleep.]
Kingy has quit [Read error: Connection reset by peer]
Kingy has joined #ruby-lang
nazty has joined #ruby-lang
workmad3 has joined #ruby-lang
Xzyx987X has quit [Quit: Leaving]
justinmcp has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
justinmcp has joined #ruby-lang
outoftime has joined #ruby-lang
irleif has joined #ruby-lang
Xzyx987X has joined #ruby-lang
justinmcp has quit [Ping timeout: 260 seconds]
coryf has quit [Remote host closed the connection]
nitti_ has quit [Remote host closed the connection]
benanne has quit [Read error: Connection reset by peer]
Axsuul has joined #ruby-lang
benanne has joined #ruby-lang
anachronistic has left #ruby-lang [#ruby-lang]
FiXato|VPS is now known as FiXato
thinkdevcode has quit [Remote host closed the connection]
robotmay has quit [Read error: No route to host]
robotmay has joined #ruby-lang
benanne has quit [Quit: kbai]
robotmay has quit [Remote host closed the connection]
irleif has quit [Quit: Computer has gone to sleep.]
Guest15771 has quit [Quit: Guest15771]
kylemcgi_ has joined #ruby-lang
bluepojo has quit [Read error: Connection reset by peer]
keymone has quit [Ping timeout: 264 seconds]
voker57 has quit [Remote host closed the connection]
bluepojo has joined #ruby-lang
kylemcgill has quit [Ping timeout: 268 seconds]
voker57 has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
flebel has quit [Excess Flood]
keymone has joined #ruby-lang
flebel has joined #ruby-lang
gregmoreno has quit [Read error: Connection reset by peer]
gregmoreno has joined #ruby-lang
workmad3 has quit [Ping timeout: 260 seconds]
Carnage\ has quit []
Xzyx987X has quit [Quit: Leaving]
justinmcp has joined #ruby-lang
miah has quit [Read error: Operation timed out]
kurko_ has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
ddd has quit [Quit: Leaving.]
miah has joined #ruby-lang
mistym has quit [Remote host closed the connection]
SkyEye has joined #ruby-lang
SkyEye has quit [Client Quit]
gaveen has quit [Quit: Leaving]
__butch__ has quit [Quit: Leaving.]
nertzy has quit [Quit: This computer has gone to sleep]
wyhaines has joined #ruby-lang
<sn0wb1rd>
@Paradox: That is awesome!
rhizmoe has quit [Quit: leaving]
rdavila has quit [Quit: rdavila]
mpan has quit [Read error: Connection reset by peer]
<tocki_>
what does module_eval method do ?
<apeiros_>
ri Module#module_eval
<apeiros_>
type that in your shell (bash, tcsh, zsh, whatever)
mpan has joined #ruby-lang
<tocki_>
apeiros_, what it does in class context ?
<apeiros_>
class_eval == module_eval
<apeiros_>
same thing
<tocki_>
Class#module_eval ?
<apeiros_>
Class inherits from Module, so still Module#module_eval
<tocki_>
or Object#module_eval ?
<tocki_>
ok.. that solves it :)
<tocki_>
though.. what happens on invoking this method ?
<apeiros_>
did you do `ri Module#module_eval` in your shell?
nitti has joined #ruby-lang
<tocki_>
If class is also Module, and string is evaluated pretending that class is Module ?
<tocki_>
> Nothing known about Module
bosie has quit [Read error: Operation timed out]
<apeiros_>
install the docs then
<apeiros_>
if you use rvm, then: rvm docs generate
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<tocki_>
Evaluates the string or block in the context of mod. This can be used to add methods to a class. module_eval returns the result of evaluating its argument. (from practical guide to ruby)
<tocki_>
generating.. there is notice about process taking *long* time
<apeiros_>
on a halfway decent machines, "long time" = ~3min
<tocki_>
done, same error msg
<apeiros_>
o0
nitti has quit [Ping timeout: 240 seconds]
<tocki_>
yep
<apeiros_>
you did generate the docs for the same version for which you run ri now, right?
<tocki_>
correct
<apeiros_>
no idea why you're not getting docs with ri then.
<tocki_>
i suppose so, but that wasn't my problem either
enebo has joined #ruby-lang
kurko_ has quit [Ping timeout: 244 seconds]
kurko_ has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
Xzyx987X has joined #ruby-lang
<freedrull>
would there be a point to spinning up threads to process a bunch of database records, or would the mysql driver block anyway
mistym has quit [Remote host closed the connection]
xalei has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
Xzyx987X has quit [Quit: Leaving]
rebelcan has quit [Quit: leaving]
methods has joined #ruby-lang
kurko_ has quit [Ping timeout: 255 seconds]
SoAwesomeMan has joined #ruby-lang
kurko_ has joined #ruby-lang
Xzyx987X has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
Xzyx987X has quit [Read error: Connection reset by peer]
Xzyx987X has joined #ruby-lang
cantonic_ has joined #ruby-lang
shtirlic_ has joined #ruby-lang
kurko_ has joined #ruby-lang
wnd^ has joined #ruby-lang
perryh has quit [Ping timeout: 264 seconds]
wnd has quit [Excess Flood]
shtirlic has quit [Ping timeout: 264 seconds]
darix has quit [Ping timeout: 264 seconds]
cantonic has quit [Ping timeout: 264 seconds]
grandy has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
grandy has joined #ruby-lang
ryanf has joined #ruby-lang
darix has joined #ruby-lang
darix has quit [Changing host]
darix has joined #ruby-lang
perryh has joined #ruby-lang
solars has quit [Ping timeout: 256 seconds]
methods has quit [Quit: Leaving.]
kurko_ has quit [Ping timeout: 260 seconds]
kurko_ has joined #ruby-lang
Dreamer3__ has quit [Quit: Computer has gone to sleep.]
ddd has joined #ruby-lang
<zzak>
freedrull: i thought mysql2 could do async stuff