mistym_away has quit [Remote host closed the connection]
<hahuang65>
Nuru: class method is something like BankAccount.open (since you don't have a bank account yet, you'd need to open one), and an instance method would be like bank_account.deposit(100), since you have a instance of the BankAccount class, and you're depositing money into it.
<hahuang65>
Nuru: make more sense?
gregmore_ has quit [Ping timeout: 252 seconds]
<Nuru>
drbrain: Thanks for the link. So I'm customizing just this object, not all objects of the same class as I would with
<Nuru>
'class Foo'
slyphon has quit [Quit: slyphon]
lsegal` has joined #ruby-lang
lsegal` has quit [Client Quit]
slyphon has joined #ruby-lang
lsegal has joined #ruby-lang
glebm has quit [Ping timeout: 252 seconds]
glebm has joined #ruby-lang
idkazuma has joined #ruby-lang
wmoxam has quit [Read error: Connection reset by peer]
wmoxam has joined #ruby-lang
r3nrut has joined #ruby-lang
hahuang65 has quit [Quit: Computer has gone to sleep.]
kain has quit [Quit: exit]
lcdhoffman has quit [Quit: lcdhoffman]
dhruvasagar has joined #ruby-lang
dingus_khan has quit [Ping timeout: 256 seconds]
r3nrut has quit [Ping timeout: 264 seconds]
jackhammer2022 has joined #ruby-lang
Domon has joined #ruby-lang
sabfer has joined #ruby-lang
justinmcp has quit [Ping timeout: 240 seconds]
justinmcp has joined #ruby-lang
emocakes has joined #ruby-lang
Nuru has quit [Changing host]
Nuru has joined #ruby-lang
crudson has left #ruby-lang [#ruby-lang]
Nuru is now known as jgro
jgro is now known as cgor
cgor is now known as Nuru
ritek has quit [Quit: Bye]
codewrangler has joined #ruby-lang
codewrangler has quit [Client Quit]
ddd has quit [Read error: Connection reset by peer]
<apeiros_>
quazimodo: could you please link again? I can't quite see it yet :-p
Kuukunen has quit [Ping timeout: 245 seconds]
techlife has joined #ruby-lang
Averna has quit [Quit: Leaving.]
<quazimodo>
lol
fraggle has quit [Client Quit]
Averna has joined #ruby-lang
francisfish has joined #ruby-lang
norplr has joined #ruby-lang
xxaM has quit [Quit: lol]
Averna has quit [Client Quit]
<quazimodo>
has it been merged, tho?
dEPy has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
dEPy has left #ruby-lang [#ruby-lang]
<yorickpeterse>
I believe so
<yorickpeterse>
At least, Ruby 2.0 did contain some patches for require() to speed it up
Kuukunen has joined #ruby-lang
xcombelle has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
fosky has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
swav has joined #ruby-lang
dhruvasagar has joined #ruby-lang
benlovell has quit [Quit: Computer has gone to sleep.]
jgoss has quit [Ping timeout: 240 seconds]
runeb has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
benlovell has joined #ruby-lang
dhruvasagar has joined #ruby-lang
torrieri has joined #ruby-lang
chris2 has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby-lang
<andrewvos>
GOod MOOOORNINGGGGG internet
torrieri has quit [Ping timeout: 252 seconds]
hnanon has quit [Ping timeout: 245 seconds]
toretore has joined #ruby-lang
chris2 has joined #ruby-lang
thufir_ has joined #ruby-lang
<apeiros_>
moin andrewvos
<apeiros_>
btw., I got your sc2 friend request last week-end…
<andrewvos>
apeiros_: wat?
<andrewvos>
me?
<apeiros_>
I got stranded on the US server, I'm normally on the EU ones
<apeiros_>
I think so
<apeiros_>
unless I misremember something :)
<andrewvos>
I don't own starcraft
<apeiros_>
hm
<apeiros_>
hm, gotta check back who it was then :-|
<yorickpeterse>
andrewvos: morning richard
r0bglees0n has joined #ruby-lang
zmack has quit [Remote host closed the connection]
sonne has quit [Read error: Operation timed out]
Demux_ has quit [Ping timeout: 240 seconds]
Demux has joined #ruby-lang
yfeldblum has joined #ruby-lang
<andrewvos>
yorickpeterse: Morning dickhead
<andrewvos>
:)
<yorickpeterse>
pfff
benlovell has quit [Quit: Computer has gone to sleep.]
sush24 has joined #ruby-lang
postmodern has quit [Quit: Leaving]
skade has joined #ruby-lang
<yorickpeterse>
clearly richard hammond didn't get enough attention last night
runeb has quit [Read error: Connection reset by peer]
realDAB has joined #ruby-lang
benlovell has joined #ruby-lang
sonne has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
baba has quit [Ping timeout: 252 seconds]
<injekt>
:D
<injekt>
hamster
dhruvasagar has joined #ruby-lang
jbsan has quit [Quit: jbsan]
torrieri has joined #ruby-lang
runeb has joined #ruby-lang
toretore has quit [Quit: Leaving]
lele|w has quit [Ping timeout: 246 seconds]
Domon has quit [Remote host closed the connection]
alessio_rocco has quit [Ping timeout: 256 seconds]
torrieri has quit [Ping timeout: 256 seconds]
alessio_rocco has joined #ruby-lang
<andrewvos>
:)
lele|w has joined #ruby-lang
lele has quit [Ping timeout: 246 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
dhruvasa1ar has joined #ruby-lang
knu has joined #ruby-lang
nibbo has joined #ruby-lang
lele has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
sabfer has joined #ruby-lang
lele has quit [Ping timeout: 246 seconds]
woollyams has joined #ruby-lang
sabfer has quit [Ping timeout: 240 seconds]
vmoravec__ has joined #ruby-lang
woollyams has quit [Client Quit]
vmoravec_ has quit [Ping timeout: 252 seconds]
lele has joined #ruby-lang
vmoravec__ has quit [Ping timeout: 245 seconds]
<whitequark>
yorickpeterse: 45
shirokuro11 has joined #ruby-lang
<whitequark>
of those: 6 are "line numbers are wrong" (actually there are much more, I've disabled some of the line number tests); 10 are related to comment/newline parsing
<whitequark>
the rest is cond/cmdarg-related
<chris2>
bougyman_: interested in a ipsvd-musl?
firefux has quit [Ping timeout: 264 seconds]
thone_ has joined #ruby-lang
thone has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Ping timeout: 256 seconds]
firefux has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
gnufied has joined #ruby-lang
kgrz has quit [Quit: Computer has gone to sleep.]
realDAB has quit [Quit: realDAB]
torrieri has joined #ruby-lang
judofyr has joined #ruby-lang
torrieri has quit [Ping timeout: 272 seconds]
valeri_ufo has joined #ruby-lang
sepp2k has joined #ruby-lang
<yorickpeterse>
whitequark: so do you plan on submitting this as a PR or by creating a spinoff?
realDAB has joined #ruby-lang
benlovel_ has joined #ruby-lang
cout_ has joined #ruby-lang
babinho_ has joined #ruby-lang
Squarepy has joined #ruby-lang
kgrz has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
valeri_uF0 has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 246 seconds]
babinho has quit [Ping timeout: 246 seconds]
cout has quit [Ping timeout: 246 seconds]
benlovel_ is now known as benlovell
dostoyevsky has joined #ruby-lang
<dostoyevsky>
When I use irb I can load a gem but when I use "ruby" it won't be found... any ideas?
wmoxam has quit [Ping timeout: 264 seconds]
<yorickpeterse>
Code/errors first
<yorickpeterse>
also, what Ruby version are you using?
<dostoyevsky>
Is there a ruby variable I can query to see the version?
<judofyr>
dostoyevsky: RUBY_VERSION
<yorickpeterse>
dostoyevsky: `ruby --version`
mitchty_ has quit [Quit: znc broke]
<dostoyevsky>
yorickpeterse: I suspect irb and ruby use a different version of ruby
<Wardrop>
I understand that catch/throw is used to terminate or short circuit the execution of some kind of code, but is there anyway to determine whether the code ended naturally, or whether it was ended because of a throw/catch?
<Wardrop>
I want to perform some action if a certain symbol is thrown
<judofyr>
Wardrop: res = catch(:foo) { …; :ok }; if res == :ok; … end
<Mon_Ouie>
catch will return what you threw otherwise
<yorickpeterse>
somebody shoot me in the foot for me
sush24 has joined #ruby-lang
mistym_away has joined #ruby-lang
wmoxam has joined #ruby-lang
La0fer has quit [Ping timeout: 260 seconds]
torrieri has joined #ruby-lang
torrieri has quit [Changing host]
torrieri has joined #ruby-lang
mistym_away has quit [Remote host closed the connection]
<andrewvos>
what the hell is that
<yorickpeterse>
Ruby
<yorickpeterse>
HURRDURR PRESENTATION LOGIC IN MODEL IS BAD. LETS MOVE IT INTO A PSEUDO MODEL THAT'S A LOT SLOWER
scampbell has joined #ruby-lang
carloslopes has joined #ruby-lang
<injekt>
ah decorators
idkazuma has joined #ruby-lang
torrieri has quit [Ping timeout: 256 seconds]
<andrewvos>
I'm going to leave this conversation because I'm at the point where I just hate programming so much that something might push me over the edge.
<injekt>
:D
<yorickpeterse>
andrewvos: calm down richard, go drive a car for a bit
<yorickpeterse>
Don't switch into...*puts on sunglasses*...fifth gear
<yorickpeterse>
YEEEAAAAAAHHHH
<andrewvos>
hahaah
sailias has joined #ruby-lang
kgrz has quit [Ping timeout: 264 seconds]
<yorickpeterse>
so don't get me wrong, the core idea of decorators isn't that bad
<yorickpeterse>
but why the fuck are draper, and the others, so god awful slow
* andrewvos
SNAPS
<yorickpeterse>
LOL PERFORMANCE? SURELY YOUR DATABASE IS THE BOTTLENECK RIGHT>?
benwoody_ has left #ruby-lang [#ruby-lang]
<gnufied>
WHY ARE WE SHOUTING?
kgrz has joined #ruby-lang
<andrewvos>
Because programmers make me hate programming.
<charliesome>
yorickpeterse: dude thats premature optimizations. stop prematurely optimizing you premature optimizer. small efficiencies. blah blah blah
<charliesome>
if its not the bottleneck why optimize it?
tonni has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
skade has joined #ruby-lang
jacktrick has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
jacky has quit [Ping timeout: 245 seconds]
runeb- has joined #ruby-lang
runeb has quit [Read error: Connection reset by peer]
runeb- is now known as runeb
jacktrick has quit [Quit: Leaving]
<cored>
hello
<cored>
I'm trying to match any word inside an array and generate a new array, this is teh code I have
<cored>
pattern = "hi"; %w{hello hi here}.select { |w| w =~ /pattern/ }
<cored>
but that doesn't work
<wnd>
try /#{pattern}/
sepp2k has joined #ruby-lang
<cored>
ok
<wnd>
or even Regexp.new(pattern).match(c)
<wnd>
match(w)
<cored>
wnd: what does the #{} do
<cored>
?
<wnd>
I really don't /know/, but precompiling the regexp might be faster if you have lots of data
<cored>
#{} so that's precompile the regex?
<wnd>
says "evaluate this here", like in x = "foo"; puts "xyzzy #{x}"
<wnd>
when I mentioned precompiling, I meant that if you have plenty of data, "re = Regexp.new(pattern); input.select{|w| re.match(w)}" might be fater
<cored>
got it
realDAB has quit [Quit: realDAB]
realDAB has joined #ruby-lang
kith_ has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
davejlong has joined #ruby-lang
kith has quit [Ping timeout: 260 seconds]
<davejlong>
Has anyone used SQL Server with Grape outside of ActiveRecord? I'm having a lot of trouble finding any resources on the topic.
<injekt>
cored: array.grep(/pattern/)
<injekt>
cored: #{} is for interpolation
<cored>
injekt: yes, I notice that hehe
<cored>
injekt: I was kinda confuse
<cored>
injekt: but the problem is not that, the other method will send a block so I have to use the format that they send in the block something like method { |match| "[#{match}]" } to format the output in the array
<injekt>
cored: uh what?
<cored>
so the array will end with ["[match]" "other item"]
Gaelan has quit [Remote host closed the connection]
<cored>
injekt: didn't you get it?
kurko_ has quit [Ping timeout: 240 seconds]
<injekt>
cored: no :)
tonni has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
kurko_ has joined #ruby-lang
<cored>
he
<cored>
well, I'm just playing around with arrays and regex's
gnufied has joined #ruby-lang
<cored>
%w{hello here} if I send "h" with a block { |match| "[#{match}]" } I want to get ["[h]ello" "[h]ere"]
<ykk>
having trouble googling the answer and the documentation doesn't specify
lolzie has quit [Quit: Page closed]
<injekt>
ykk: .gsub('/', '_')
<injekt>
tr is faster though
<ykk>
hey injekt thank you for mechanize
<injekt>
ykk: I didn't write it I just help out with it, but you're welcome for that!
<ykk>
had problems with nokogiri saving images with File.open rewrote it all with Mechanize and going to use .save_as
<cored>
injekt: which means you can do something like s.gsub($&, yield $&)
<injekt>
ykk: sweet
<injekt>
cored: right
<injekt>
cored: with parenthesis of course
<ykk>
been with computers since 12 years old, opening them up and stuff. been on irc the whole time too but no language has ever grabbed me like ruby =D
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
bantic has joined #ruby-lang
<yorickpeterse>
not even vulgar language?
<ykk>
after i finish these few projects i started I want to write something with Mechanize that will backup movies that you purchased with Amazon
<antbody>
everyother language just tastes like crap after ruby :p
<cored>
injekt: yes, I changed the code you have here
havenwood has quit [Remote host closed the connection]
alessio_rocco has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 248 seconds]
mytrile has quit [Remote host closed the connection]
soknee has joined #ruby-lang
mobile has joined #ruby-lang
mobile has quit [Client Quit]
skbierm has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
kgrz has quit [Quit: Computer has gone to sleep.]
<injekt>
the + is obv not needed
pablonvz has joined #ruby-lang
gnufied has joined #ruby-lang
skbierm has quit [Client Quit]
nXqd has quit [Ping timeout: 245 seconds]
skbierm has joined #ruby-lang
soknee has quit [Quit: Leaving.]
soknee has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
nXqd has joined #ruby-lang
pablonvz has quit [Quit: pablonvz]
gregmore_ has joined #ruby-lang
glebm has joined #ruby-lang
setmeaway2 has quit [Quit: Leaving]
setmeaway has joined #ruby-lang
mlpinit has quit [Quit: mlpinit]
Gaelan has joined #ruby-lang
bit65 has quit [Quit: leaving]
G________ has joined #ruby-lang
G________ has quit [Client Quit]
<yorickpeterse>
whitequark: I see you're having fun with ruby_parser
kbouwser has joined #ruby-lang
vlad_starkov has joined #ruby-lang
benlovell has quit [Quit: Computer has gone to sleep.]
nXqd has quit [Ping timeout: 248 seconds]
stef_204 has joined #ruby-lang
scottschecter has quit [Ping timeout: 256 seconds]
skbierm_ has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby-lang
skade has quit [Read error: Connection reset by peer]
scottschecter has joined #ruby-lang
skbierm has quit [Ping timeout: 256 seconds]
dhruvasagar has joined #ruby-lang
<cored>
injekt: hm
<cored>
injekt: I wrote a new example to my spec
<cored>
injekt: in that case that oyu pase it will also match %w(foo bar f)
<cored>
and the f will returned like [f]
<cored>
but the patterns says 'foo' entirely
<cored>
I think the problem is that even when I'm atching individual characters I want to just format individual chracters with the formatter in the block
<cored>
is like fuzzy finder for sublime
mixandgo has joined #ruby-lang
brianpWins has joined #ruby-lang
<chris2>
is evaluation order of ruby specified?
<chris2>
a[x] = y. does x or y come first?
vlad_sta_ has joined #ruby-lang
<sepp2k>
x comes first. Evaluation order of method arguments is left to right.
<chris2>
that matches my expectation
randallagordon has quit [Quit: Changing server]
vlad_starkov has quit [Ping timeout: 256 seconds]
gregmoreno has quit [Remote host closed the connection]
randallagordon has joined #ruby-lang
gregmore_ has quit []
gregmoreno has joined #ruby-lang
davejlong has quit [Read error: Connection reset by peer]
lcdhoffman has quit [Quit: lcdhoffman]
dhruvasagar has quit [Ping timeout: 256 seconds]
tylersmith has joined #ruby-lang
torrieri has joined #ruby-lang
flujan has joined #ruby-lang
flujan has left #ruby-lang [#ruby-lang]
flujan has joined #ruby-lang
flujan has quit [Quit: flujan]
flujan has joined #ruby-lang
<flujan>
Talking about performance, which is the difference between Thread.new and Proc.new?
<judofyr>
flujan: Thread.new is completely different and *way* slower
<judofyr>
they have nothing to do with each other
<havenwood>
flujan: Proc isn't concurrency related. It is a type of closure, along with blocks and lambdas.
<flujan>
judofyr: I am considering to use threads to put some code to run I'm parallel. It is possible with proc.new?
<eam>
thread is a parallel execution context. proc is a unit of code logic
Uranio has joined #ruby-lang
<judofyr>
flujan: Proc has nothing to with with concurrency
<judofyr>
flujan: it's just an anonymous method
torrieri has quit [Ping timeout: 248 seconds]
<havenwood>
flujan: Totally different concepts, but they can be used together.
guilleiguaran__ has left #ruby-lang [#ruby-lang]
<flujan>
judofyr: Hum… OK, some people are using it for this purpose…
<judofyr>
flujan: nope, don't think so…
<havenwood>
flujan: You may be thinking fork?
carloslopes has joined #ruby-lang
<flujan>
havenwood: Yeah. I have a script that require a lot of classes. It spawns another ruby script using system…
<flujan>
but I need to perform the some requires on the script system evokes…
<flujan>
So I am thinking about put everything on a scripts and run with threads when applicable
<havenwood>
flujan: Jesse Storimer wrote a great book on UNIX Processes in Ruby, and his book on Threads is coming out in a couple weeks. Worth reading!
<havenwood>
flujan: Rather than learning the intricacies of threads, it may be more practical to use a concurrency library like Celluloid or Agent.
<havenwood>
flujan: Unless you're threading for learning or fun, in which case Storimer's book would be a big win!
<flujan>
havenwood: I have read about erlang and the actor pattern. Isn't it the same thing that the YARV do with GIL? No GIL but still a single point to manage the threads?
shirokuro11 has quit [Remote host closed the connection]
<bougyman>
no, erlang wraps each facet in a process.
<bougyman>
similar to unix processes.
<havenwood>
injekt: Just the single aspect of channels extracted, but I've had a lot of fun playing with iChannel too: https://github.com/robgleeson/ichannel
robbyoconnor has quit [Ping timeout: 256 seconds]
glebm has quit [Quit: Computer has gone to sleep.]
<havenwood>
injekt: Matz tweeted about Agent a few months back, and Ilya being the library author piqued my curiosity!
<flujan>
havenwood: I read the basic_usage example… So I will create a new class that in my case, connects do the database( do a dump ) write on a text file. Can I all Class.async.new ?
photis has joined #ruby-lang
photis has quit [Client Quit]
photis has joined #ruby-lang
forrest has joined #ruby-lang
<havenwood>
flujan: Usually, you do: Class.new.async.method_that_runs_async
musl_ has quit [Quit: WeeChat 0.3.9.2]
TheNotary has quit [Quit: Leaving]
musl has joined #ruby-lang
<havenwood>
flujan: I suppose you could monkey patch class, then run a Class.async.new but that definitely isn't the normal use-case.
mlpinit has joined #ruby-lang
wobblini has quit [Ping timeout: 245 seconds]
benwoody_ has joined #ruby-lang
banister`sleep has joined #ruby-lang
runeb has quit [Remote host closed the connection]
<flujan>
havenwood: thanks for the tip of celluloid. it is really cool. It will fit my needs. I just found a example of file read/write using it. Will post here if someone search the history: http://rubysource.com/an-introduction-to-celluloid-part-i/
apeiros_ has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 245 seconds]
dhruvasagar has joined #ruby-lang
mlpinit has quit [Quit: mlpinit]
r0bby_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
nXqd has joined #ruby-lang
r0bby has quit [Ping timeout: 264 seconds]
gregmoreno has quit [Read error: Connection reset by peer]
gregmore_ has joined #ruby-lang
gregmore_ has quit [Remote host closed the connection]
nXqd has quit [Ping timeout: 256 seconds]
gregmoreno has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
skade has joined #ruby-lang
musl has quit [Quit: WeeChat 0.3.9.2]
musl has joined #ruby-lang
kennyvb has quit [Ping timeout: 252 seconds]
jxpx777 has joined #ruby-lang
mlpinit has joined #ruby-lang
musl has quit [Remote host closed the connection]
musl has joined #ruby-lang
kennyvb has joined #ruby-lang
musl has quit [Remote host closed the connection]
musl has joined #ruby-lang
breakingthings has joined #ruby-lang
maxmanders has joined #ruby-lang
swav has quit [Remote host closed the connection]
skade has quit [Read error: Connection reset by peer]
ruby-lang029 has quit [Ping timeout: 245 seconds]
alec_eiffel has quit [Ping timeout: 245 seconds]
musl has quit [Remote host closed the connection]
musl has joined #ruby-lang
torrieri has joined #ruby-lang
banister`sleep has quit [Read error: Connection reset by peer]
mistym is now known as mistym_coffee
skade has joined #ruby-lang
nXqd has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
torrieri has quit [Ping timeout: 252 seconds]
kristofferrr has quit [Quit: ❤]
gnufied has quit [Quit: Leaving.]
jperry2 has joined #ruby-lang
glebm has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
jacktrick has joined #ruby-lang
apeiros_ has joined #ruby-lang
havenwood has joined #ruby-lang
davidbalber|away is now known as davidbalbert
spuk has joined #ruby-lang
mrsolo has joined #ruby-lang
MaddinXx has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
pr0ton has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
glebm has joined #ruby-lang
photis has quit [Quit: photis]
glebm has quit [Client Quit]
idkazuma has quit [Remote host closed the connection]
jbsan has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
<emmdeeess>
ahh, it's called ruby-odbc, not just odbc
<emmdeeess>
it is not installing, i did get activerecord-sqlserver-adaptor to install, can i use that?
mistym is now known as mistym_meeting
r0bby_ is now known as robbyoconnor
Nisstyre-laptop has joined #ruby-lang
<injekt>
no that's ironically for activerecord..
happydude has quit [Quit: Leaving]
glebm has joined #ruby-lang
CoverSlide has joined #ruby-lang
sepp2k has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
stef_204 has quit [Quit: quitting]
glebm has quit [Ping timeout: 256 seconds]
agarie has joined #ruby-lang
glebm has joined #ruby-lang
Nisstyre-laptop has quit [Quit: Leaving]
ryanf has joined #ruby-lang
Uranio has quit [Quit: while you reading this, a kitty dies]
bantic has quit [Read error: Connection reset by peer]
ryanf has quit [Client Quit]
robbyoconnor has quit [Read error: Connection reset by peer]
mistym_meeting is now known as mistym
robbyoconnor has joined #ruby-lang
<injekt>
emmdeeess: you might want to join #sequel
dhruvasagar has quit [Ping timeout: 264 seconds]
robbyoconnor has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
pr0ton has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby-lang
<cored>
injekt: it's seems that apeiros_ got it right
<injekt>
cored: hm?
<cored>
injekt: the change is for the output not for the input, the match should be for the entire set of characters but the output should get presented separate
davidbalbert is now known as davidbalber|away
<cored>
injekt: like /good/ will match [[g][o][o][d]] but not [g]o
<yorickpeterse>
so apparently an article I wrote 2 years ago hit HN again, and it's not even that well written
<injekt>
cored: ok ..
<yorickpeterse>
yet my new stuff never gets uptokes on HN :<
wallerdev has joined #ruby-lang
<injekt>
yorickpeterse: haha!
<injekt>
:/
<injekt>
HN is shit anyway
fire has quit [Ping timeout: 246 seconds]
Gaelan has joined #ruby-lang
<yorickpeterse>
meh, the articles are ok
<yorickpeterse>
I find that the discussions are mostly a [go|lisp|haskell] circlejerk
<yorickpeterse>
basically the stuff nobody uses :>
<injekt>
hey man people use go and lisp
<injekt>
and nerds use haskell
<yorickpeterse>
implying people in this channel are not nerds
<yorickpeterse>
a fairly well known one I might say
<yorickpeterse>
I believe they were actually the first introduction to Ruby for our female dev co-worker
<injekt>
i love how the events are like everywhere within 2 months
<yorickpeterse>
(we only have 4 devs so go figure about the ratio)
<yorickpeterse>
interesting enough, men are slowly becoming a minority where I work
robbyoconnor has quit [Remote host closed the connection]
<yorickpeterse>
Hm wait, 13 co-workers of which only 5 are female
<yorickpeterse>
errr, 6 actually from next month
<yorickpeterse>
two of them are Swedish with the same name
<yorickpeterse>
which is confusing
<yorickpeterse>
injekt: why are you not counting co-workers? we need to settle the score of last night
robbyoconnor has joined #ruby-lang
<ykk>
hey are you guys in ny and wanna hire me as a junior programmer? =D
<injekt>
yorickpeterse: um
<injekt>
yorickpeterse: 1 developer
<injekt>
that'd be me
<injekt>
hiring soon
<ykk>
really? I learn real fast
<whitequark>
yorickpeterse: (same name) hehe
<whitequark>
name clashing
<yorickpeterse>
yeah, and they also speak the same barbaric language
<yorickpeterse>
ykk: nope, based in .nl
fire has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
<yorickpeterse>
ykk: out of curiosity, how junior junior are you?
<darix>
yorickpeterse: we should be careful ... that 17y old sold his company for 30m to yahoo
<darix>
(:
<ykk>
i don't know, i have been in the scene for 20 years, building pc's since I was a kid. Started ruby about 10 weeks ago and already writing functional programs with some guidance here and there and source code =P
<yorickpeterse>
meh, no fucks given
<yorickpeterse>
I'd rather be 20 and broke than 17, rich and not having experienced anything
<yorickpeterse>
ykk: Aah, so you're not completely new to brogramming
<injekt>
he's experienced being a millionaire
<yorickpeterse>
I should clarify that I don't really care for money beyond what I need to survive (that sounds so dramatic)
<injekt>
:)
<whitequark>
yorickpeterse: experienced as in what?
<yorickpeterse>
lyfe
<yorickpeterse>
About a year ago I decided to stop being a cunt with money and just spend some on travelling and such
<yorickpeterse>
much better than saving it up for now, especially with shit interest rates and such
<yorickpeterse>
plus more fun
<yorickpeterse>
though having a million or two would make that easier
flujan has quit [Quit: flujan]
<ykk>
yorick no i'm not, but completely new to loving a programming language. lol Dabbled writing scripts in ruby for MUD's when I was a kid
<whitequark>
ykk: ... but Ruby is just twenty years old
<breakingthings>
whitequark: are thou of the implication that one could not be using ruby whilst they are younger than ruby?
<apeiros_>
cored: the value for pattern would also be of interest
<cored>
as you can see at first I get all the strings that have the pattern and then I try to sustitute it with what the block sends for the formatting
<cored>
in the example I send you will be 'is'
runeb has quit [Remote host closed the connection]
<apeiros_>
cored: 'is' or /is/=
<apeiros_>
cored: 'is' or /is/?
<cored>
they are sending an string, but I transforms it into a regex in the code
<cored>
I'm guessing that I have to implement the thing that gsub is doing now
<bougyman>
transforms it properly
<cored>
bougyman: ?
MaddinXx has quit [Read error: Connection reset by peer]
_dabradley has left #ruby-lang [#ruby-lang]
<apeiros_>
cored: and why #{pattern}+?
chessguy has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
<apeiros_>
I mean, why the +?
<bougyman>
that's what I meant.
MaddinXx has joined #ruby-lang
<bougyman>
you're putting it in a character class.
<apeiros_>
that code seems somewhat odd for what you try to do
<bougyman>
i'm sure that's not what they expect.
<bougyman>
escape the [ as \[ if you're trying to match a left bracket.
<bougyman>
similarly \] for the right.
<apeiros_>
cored: so the pattern is supposed to be a full word, e.g. with ["Fission rocks"] and pattern='is', you don't want ["F[i][s]ssion rocks"], right?
<cored>
apeiros_: the first one if for getting all the strings that have the pattersn and then applying the transformation to each of them
<apeiros_>
cored: but + is *consecutive*. it'd only match is, isis, isisis etc.
<bougyman>
not without grouping
<cored>
I thought that was 1 or 0
<cored>
sorry 1 or more
<apeiros_>
yes, 1 or more *consecutively*
<cored>
apeiros_: yes
<apeiros_>
a regex does not jump around in your string. it starts at the left and works its way through to the right.
<cored>
apeiros_: yes
<cored>
apeiros_: and also yes to the format you gave me in the top
<apeiros_>
was the first yes the answer to my question?
<apeiros_>
this one: >> cored: so the pattern is supposed to be a full word, e.g. with ["Fission rocks"] and pattern='is', you don't want ["F[i][s]ssion rocks"], right?
<apeiros_>
cored: yours is broken in a couple of ways. #{pattern}+ does not work the way you think. and since pattern is a string and not a regex, it even doesn't work the way I said earlier (I stated that it being a regex was required, though)
<apeiros_>
with pattern == 'is', /#{pattern}+/i becomes /is+/, which matches "is", "iss", "isssssssss" etc.
<apeiros_>
it will also match *anywhere* in the string, so "Fission rocks" would match.
tonni has quit [Ping timeout: 245 seconds]
cored has quit [Ping timeout: 264 seconds]
<apeiros_>
word.gsub(/[#{pattern}+]/i # this works even more different from what you seem to think
<injekt>
Fission does rock
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<whitequark>
fission?
<whitequark>
like, dividing uranium?
<apeiros_>
first word I came up to which contains 'is'
<apeiros_>
*came up with
<cored>
apeiros_: I think I gave you the wrong expectation, because I love dogs also expects [I] love dog[s] just because I and S are is without all the things in between
<cored>
apeiros_: that won't match if I have just an I and just an 's' in the string
<apeiros_>
…
<apeiros_>
that was one thing I actually asked.
<apeiros_>
well then, I'm playing now.
Nisstyre-laptop has quit [Quit: Leaving]
<cored>
hehe
<cored>
oki
<cored>
thanks, I'll try to fix it
<cored>
it's just one example remaining
robbyoconnor has quit [Ping timeout: 245 seconds]
<yorickpeterse>
lol Ruby prescanning:
<yorickpeterse>
>> puts foo.foo
<yorickpeterse>
damn it, the bot is gone
<injekt>
now don't you look silly
<yorickpeterse>
whatever, yolo swag
* yorickpeterse
hangs himself
<yorickpeterse>
oh interesting, this seems to be an Rbx case
<yorickpeterse>
around 8 hours of hacking on Rbx and about an hour or two on my own code. Result? Saved myself about a month or two worth of work
<injekt>
:D
fraggle has joined #ruby-lang
chessguy has joined #ruby-lang
musl has quit [Remote host closed the connection]
musl has joined #ruby-lang
tonni_ has quit [Read error: Connection reset by peer]
musl has quit [Client Quit]
tonni has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
pr0ton has joined #ruby-lang
zenspider has joined #ruby-lang
pkrnj has joined #ruby-lang
scampbell has quit [Quit: Leaving]
symm- has joined #ruby-lang
musl has joined #ruby-lang
jamilbk has joined #ruby-lang
<jamilbk>
hello folks, anyone know how i can break from a Net::HTTP streaming block with getting the Zlib::BufError?
<cored>
it's seems that this problem can't be solve with regex
musl has quit [Client Quit]
<jamilbk>
^without getting
<cored>
the fuzzy finder also match something like pattern = "si"; "[S]now [i]s cold" but not "I eat" because the I needs the "s" in the front for that pattern
<yorickpeterse>
"Showing 115 changed files with 8,708 additions and 20 deletions."
forrest has quit [Quit: Leaving]
mjio has joined #ruby-lang
breakingthings has quit []
stevechiagozie has quit [Quit: Computer has gone to sleep.]
gregmore_ has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
<zenspider>
yorickpeterse: that's some seriously loquacious shit. why does define_instance_method take a block instead of *args ?
mistym has quit [Remote host closed the connection]
Wardrop has quit [Quit: Wardrop]
gregmoreno has quit [Ping timeout: 264 seconds]
Axsuul has joined #ruby-lang
dustint has quit [Ping timeout: 240 seconds]
robbyoconnor has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
robbyoconnor has quit [Read error: Connection reset by peer]
Gaelan has quit [Read error: Connection reset by peer]
Gaelan has joined #ruby-lang
ryanf_ has joined #ruby-lang
nXqd has quit [Ping timeout: 246 seconds]
ryanf has quit [Ping timeout: 245 seconds]
robbyoconnor has joined #ruby-lang
soknee has quit [Quit: Leaving.]
sailias has joined #ruby-lang
pkrnj has quit [Quit: Computer has gone to sleep.]
chessguy has joined #ruby-lang
mixandgo has quit [Quit: mixandgo]
g0bl1n has joined #ruby-lang
wmoxam has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
zmack has joined #ruby-lang
zmack has quit [Remote host closed the connection]
jamilbk has quit [Quit: jamilbk]
mistym_away has joined #ruby-lang
<cored>
it is possible to stub a require
<cored>
?
<drbrain>
cored: yes…
<cored>
how?
<cored>
I don't want to make my CLI to have a ton of dependencies so I was asking the user to give me the name of the lib to require and he will be in charge on doing so
<cored>
but in the specs I need to test another behavior which depends on that part so I need to stub the requre
<zenspider>
def require in your test class
<cored>
oh
<cored>
nice, thanks
brianpWins has quit [Quit: brianpWins]
<cored>
it's seems that rspec did not like that
dumfries has quit [Ping timeout: 256 seconds]
breakingthings has joined #ruby-lang
stevechiagozie has joined #ruby-lang
dumfries has joined #ruby-lang
chrismar035 has quit [Quit: chrismar035]
<TTilus>
already googled "rspec stub require"?
<cored>
yes
<cored>
did smething like Kernel.should_receive(:require).and_return(true)
<cored>
no luck
<ykk>
with Mechanize I have a table which has date, links to pic galleries (in another table), description
<ykk>
i got the dates becoming folders, descriptions saved in there but can't figure out an approach for opening the links and iterating through the table to save images
<outoftime>
cored: you could try Object.any_instance.should_receive(:require)#...
<ykk>
i had it with page = agent.get(gall_links) then it would return the page i was currently on and the new page i opened
MaddinXx has joined #ruby-lang
<ykk>
which was too much and i can't target the new table =\
MaddinXx has quit [Remote host closed the connection]
<cored>
outoftime: ok
<outoftime>
cored: seems vaguely icky but it might work. anywho, i'm out. hope you find success
outoftime has quit [Quit: Leaving]
mixandgo has joined #ruby-lang
skade has joined #ruby-lang
mixandgo has quit [Client Quit]
Gaelan has quit [Remote host closed the connection]
mwjcomputing has joined #ruby-lang
davidbalbert is now known as davidbalber|away
benanne has quit [Quit: kbai]
kurko_ has quit [Quit: Computer has gone to sleep.]
<ykk>
durp got it
mineiro has joined #ruby-lang
lcdhoffman has joined #ruby-lang
rue_XIV has joined #ruby-lang
anonymuse has quit [Quit: Leaving...]
g0bl1n has quit [Quit: g0bl1n]
sailias has quit [Quit: Leaving.]
rue has quit [Ping timeout: 252 seconds]
robbyoconnor has quit [Ping timeout: 252 seconds]
chessguy has quit [Remote host closed the connection]