<Norrin>
gotcha. being the first google result, it looked official
wilmoore has quit [Remote host closed the connection]
wilmoore has joined #ruby
mrsolo has quit [Quit: Leaving]
ringotwo has quit [Ping timeout: 248 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
monkegjinni has quit [Remote host closed the connection]
linoj has joined #ruby
wilmoore has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
xaq has quit [Remote host closed the connection]
saschagehlich has joined #ruby
saschagehlich has quit [Client Quit]
stefanp_ has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Ping timeout: 240 seconds]
awarner has joined #ruby
blownapart has joined #ruby
ryan0x2 has joined #ruby
Purehk has joined #ruby
mxweas_ has joined #ruby
igotnolegs has joined #ruby
krusty_ar has joined #ruby
nari has joined #ruby
<Purehk>
is anyone around to help with a fairly easy problem
wmoxam has joined #ruby
<cirwin>
whether you get an answer depends a lot more on the question than whether or not people are here :)
advorak has quit [Quit: This computer has gone to sleep]
Hanmac1 has joined #ruby
<Purehk>
I have created a github sample here... https://gist.github.com/3126346 Currently I have to wait for the function hunter() to finish. I dont want to wait I want it run a seperate process,thread??? and continue
<cirwin>
Purehk: you could try putting everything into Thread.new{ }
<Purehk>
basicaly hunter() runs a popen3 system command that takes a while to finish... I want it to kick off that function in the background....and continue
savage- has quit [Ping timeout: 246 seconds]
<cirwin>
yeah — I suggest you read about using threads
<Purehk>
I dont know how many threads there will be either
<cirwin>
Purehk: what are you doing in the other threads?
advorak has joined #ruby
<cirwin>
if you never want to stop doing that; then you should probably not join the hunter thread
sobol has quit [Quit: Leaving]
<Purehk>
basicaly...what I want to do is this.... 1) read in a list of IPs.... 2) Check if they have port 445 open 3) if they do run a system command against it that takes a while..... Now currently it takes ages... because it has to wait for the hunter function to end.
<cirwin>
ok
hemanth has quit [Read error: Connection reset by peer]
<cirwin>
so just create lots of new threads
<cirwin>
and never join
danielpunt has quit [Remote host closed the connection]
<Purehk>
can you tell me where in my code I would do that?
<Purehk>
can you midify my code
itnomad has quit [Ping timeout: 248 seconds]
hemanth has joined #ruby
Ontolog has joined #ruby
wmoxam_ has left #ruby [#ruby]
IceDragon has quit [Quit: ~ヾ(^∇^)]
wmoxam has quit [Quit: leaving]
<Purehk>
would this work?
<Purehk>
if output2 =~ /open/
voodoofish430 has quit [Quit: Leaving.]
<Purehk>
<Purehk>
fork { hunter(ip, ADMIN, PASSWORD) }
<cirwin>
probably
itnomad has joined #ruby
td123 has joined #ruby
<Purehk>
............token.rb:48:in `fork': fork() function is unimplemented on this mach
<Purehk>
ine (NotImplementedError)
<Purehk>
from token.rb:48:in `block in <main>'
<Purehk>
from token.rb:39:in `each'
<Purehk>
from token.rb:39:in `<main>'
<Purehk>
I get that error
mikekelly has quit [Ping timeout: 251 seconds]
<cirwin>
uh... what ruby are you using?
<Purehk>
rubyfor win
<Purehk>
do I need to install a gem?
yoklov has joined #ruby
crankycoder has joined #ruby
<Purehk>
do I need to include a file?
<cirwin>
dunno — use Thread.new instead of fork
sebicas has joined #ruby
crankycoder has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
<Purehk>
so is the syntax Thread.new(hunter(ip,user.pass))
<cirwin>
Thread.new{ hunter(ip, user, pass) }
<cirwin>
it takes a block
mikekelly has joined #ruby
trend has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
<Purehk>
thank you that worked a treat
ibash has joined #ruby
wilmoore has joined #ruby
yankhates has left #ruby [#ruby]
Purehk has quit []
Araxia has quit [Quit: Araxia]
<ibash>
who here is in san francisco?
<ibash>
you get *high five*
<shadoi>
I'd rather have some thai, or a beer.
monkegjinni has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
ringotwo has joined #ruby
cirwin has quit [Ping timeout: 248 seconds]
hemanth has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
monkegjinni has quit [Ping timeout: 246 seconds]
duncancmt has joined #ruby
<duncancmt>
Hello! I'm trying to track down a NoMemoryError. I'm certain that my system has enough ram. Is there any reason that this error would get thrown without the system running out of ram?
chrxn[a] has quit [Quit: Leaving]
hemanth has joined #ruby
<ibash>
shadoi: I have one more brekle's brown in my fridge
<mdszy>
duncancmt: Do you have a full error message?
<ibash>
I'll give it to you if you find me
<duncancmt>
mdszy: ActionView::Template::Error (failed to allocate memory):
<ibash>
I also have rice and soy sauce, but idk if that qualify's as thai to you
<mdszy>
duncancmt: Ohh, specifically a rails error?
<duncancmt>
was that what you wanted?
<mdszy>
Sorry, but I don't know anything about rails.
<duncancmt>
Yeah. I asked over in #RubyOnRails, they sent me here
<mdszy>
ah XD
noganex has quit [Ping timeout: 265 seconds]
<ibash>
duncancmt: do you get this on each web request, or intermittently?
<duncancmt>
ibash: every one
<duncancmt>
but only on certain pages
<ibash>
what ruby version / server
<ibash>
only on certain pages?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
noganex has joined #ruby
<duncancmt>
yeah, but every time that page is rendered
<ibash>
do you have a way to monitor men usage? could be a memory leak in gems you use
<duncancmt>
memory usage stays below 3GB on a system with 32GB
<ibash>
you have 32gb of memory?
<duncancmt>
yep
<ibash>
:D
<ibash>
meant
<ibash>
:O
<Ionic`>
*neat
<duncancmt>
either works :P
<Ionic`>
32GB is pretty standard nowadays though
<ibash>
really?
<duncancmt>
it's a laptop, BTW
<duncancmt>
not a server
<Ionic`>
oh, laptops
<Ionic`>
well, that's a little bit off-standard
<ibash>
I only have 8 :(
<mdszy>
ibash: as do I XD
<mdszy>
Up from the 2GB this thing came with.
<Ionic`>
then again, my next machine will have at least 32GB
<mdszy>
And 8 is the most my laptop's firmware will support
<erichmenge>
mdszy: I sent him over here. Seems more of a general Ruby problem than a Rails specific problem...
<duncancmt>
ruby: 1.8, rails: 3.0.14, thin 1.3.1
<ibash>
duncancmt: what are you doing on those pages? any thing out of the ordinary?
<ibash>
maybe a .all db query?
<duncancmt>
not as far as I can tell, running the same server on the same server on the same rails on the same ruby against the same database on a different machine doesn't throw the error
kvirani has joined #ruby
<ibash>
okay
panpainter has quit [Quit: Lost terminal]
ryanf has quit [Quit: leaving]
<duncancmt>
My next move was to start tearing the machine down to just a shell on top of the completely stock kernel and seeing what happens then
<ibash>
duncancmt: can you run it on a newer version of ruby? what happens?
<ibash>
duncancmt: or incompatabile?
<duncancmt>
It crashes, it has to run on this particular ruby
<Ionic`>
duncancmt: btw, did you actually check your memory?
<jbrennan>
I've got a little weird problem with string.tr... I'm trying to replace all non alphanumeric characters in a string with _. I've tested out the regex online for it, "/[^a-zA-Z\d]/" and it works, but using string.tr(regex, '_') replaces everything BUT those matched by the regex.
<duncancmt>
check?
<jbrennan>
And if I remove the ^, ... the result is exactly the same
<Ionic`>
duncancmt: memtest86+, for instance
<duncancmt>
Oh, I did ~1 week ago (this is a brand new machine)
<Ionic`>
for x instances/runs where x should probably be > 10, the more x the better
<duncancmt>
I let memtest86+ do it's thing for ~5 hours
<duncancmt>
I suppose I could do that again
<Ionic`>
mh 5 hours is not much time
<Ionic`>
go for at least 24 to 48 hours
<Ionic`>
(I'm *not* saying this to get rid of you)
<duncancmt>
dang! okay
<duncancmt>
hahahaha!
<Ionic`>
seriously
* Norrin
reading in diff window, so need a mention if something is directed towards me
<duncancmt>
I'll do that. Actually... would filling /dev/shm with random garbage be a reasonable canary (for right now, memtest while I sleep)
<Ionic`>
duncancmt: mh
<Ionic`>
nope
<Ionic`>
use memtester for that
<Ionic`>
you're on linux, right?
iamjarvo has joined #ruby
<jbrennan>
Any ideas why it might be the same with or without the negation when using string.tr?
<duncancmt>
yep
<Ionic`>
yeah, go for memtester
<duncancmt>
okay
<Ionic`>
but memtest86+ is more "complete", if you know what I mean
<duncancmt>
gotcha
hemanth has quit [Read error: Connection reset by peer]
duncancmt has quit [Quit: memtesting]
jbrennan has left #ruby [#ruby]
patient has quit [Quit: leaving]
hemanth has joined #ruby
blownapart has quit [Remote host closed the connection]
radic has quit [Ping timeout: 240 seconds]
crates has quit [Remote host closed the connection]
crates has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
<arussel>
the line 34 of my script is: FileUtils.copy_stream source, f
trend has quit [Quit: trend]
<derrida>
Ionic`: logic to live by.
ryan0x2 has quit [Remote host closed the connection]
<arussel>
do I have the wrong fileutils lib ?
apok has joined #ruby
<arussel>
how can I check ?
<derrida>
Ionic`: ah, i missed the x > 10, 10 is my usual "the ram is fine" threshold
jhunter has quit [Ping timeout: 244 seconds]
<derrida>
that said, i've only found errors once in 20+ years and they cropped up pretty quickly & ram was brand new.
jhunter has joined #ruby
QaDeS has quit [Quit: Ex-Chat]
mikeric has joined #ruby
mikeric has quit [Client Quit]
krz has quit [Quit: krz]
<Ionic`>
derrida: yeah
sdwrage has joined #ruby
<Ionic`>
derrida: also, RAM seems to deterroirate over time
<Ionic`>
+spelung
<Ionic`>
*+speling
godfrey999 has joined #ruby
joma has quit [Remote host closed the connection]
<arussel>
I also don't understand what it points to line 488 that is, 'IO.copy_stream(src, dest)' but talks about a read method
<derrida>
Ionic`: yeah, I've read that too. i think it's an inverted bell curve.
<derrida>
failure rates highest at the beginning and near end-of-life (whenever that is..)
<Ionic`>
derrida: I *experienced* it. RAM started fine, no errors, months later a few errors in one location which I worked around by setting those addresses off-limits, then new errors around those locations popped up
jameshyde has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
ilyam has quit [Quit: ilyam]
<derrida>
interesting, i had corsair ram that was causing occasional kernel panics, similarly, they became more and more frequent, rma'd (thank you lifetime warranty)
<Ionic`>
heh
awarner has quit [Remote host closed the connection]
<Ionic`>
I just bought new one
<Ionic`>
didn't have any invoice anyway
blazes816 has quit [Quit: Leaving]
<derrida>
luckily, nowadays, ram is so cheap
kevinbond has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
htroyack has quit []
hemanth has quit [Read error: Connection reset by peer]
erichmenge has quit [Quit: erichmenge]
dsa has joined #ruby
hemanth has joined #ruby
mockra has joined #ruby
mdszy has quit [Quit: nini]
EzeQL has quit [Ping timeout: 265 seconds]
andrewhl has joined #ruby
cirwin has joined #ruby
<evilsushi>
what class would you guys use to list files recursively based on atime?
vitor-br has quit [Quit: Saindo]
Guest1056 has quit [Read error: Operation timed out]
<offby1>
I can't imagine what your result would look like.
<offby1>
"List files recursively", I understand.
<offby1>
"based on atime", I could sorta understand.
<offby1>
evilsushi: do you want a list of all files below a certain directory, ordered by atime?
ananthakumaran has joined #ruby
<evilsushi>
offby1: yep
abra has quit [Ping timeout: 276 seconds]
<offby1>
I assume there's a "find recursively" in either File or Dir
Cache_Money has quit [Read error: Connection reset by peer]
Cache_Money has joined #ruby
greasegum has joined #ruby
bradhe_ has joined #ruby
Draco_ has joined #ruby
jgrevich has joined #ruby
Ionic` has quit [Ping timeout: 246 seconds]
andoriyu has quit [Quit: This computer has gone to sleep]
bradhe has quit [Ping timeout: 248 seconds]
evilsushi has joined #ruby
mockra has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
evilsushi has quit [Remote host closed the connection]
busybox42 has quit [Read error: Operation timed out]
<shadoi>
zhando: it looks to me like you're trying to build a finite state machine without actually doing it.
cakehero has quit [Quit: Leaving...]
yoklov has quit [Quit: computer sleeping]
banisterfiend has quit [Ping timeout: 250 seconds]
hemanth has joined #ruby
<shadoi>
zhando: maybe some example of the usage would be enlightening.
Cache_Money has quit [Ping timeout: 248 seconds]
brg has joined #ruby
<brg>
hi
Progster has quit [Ping timeout: 248 seconds]
<zhando>
shadoi: usage examples are in the gist, e.g. Assr.exec(SomeObjClassModule, :settergetter, some_state) { do_something }
<zhando>
shadoi: nothing so grand as a state machine, just using blocks and Procs to dry up repetitive code.
<shadoi>
zhando: I guess I don't see the added value, your 4 lines where you toggle, do something, and then toggle again seem so much more clear. ;)
<zhando>
shadoi: yeah but you get tired of doing that time after time..
hemanth has quit [Read error: Connection reset by peer]
<zhando>
I turn a 4 liner into a one liner. That's fun!
hemanth has joined #ruby
<shadoi>
Assr.exec is a pretty obscure method name, it could mean all sorts of things. Maybe a more descriptive class method (and use Class.extend), then usage something like: accessor_toggle :blah
noyb has quit [Ping timeout: 244 seconds]
<zhando>
yeah.. there's a lot in names.. point taken.. extending is an approach I didn't think of..
ChampS666 has joined #ruby
mrdodo has joined #ruby
greasegum has quit [Quit: Leaving]
banisterfiend has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
mrdodo has quit [Read error: Connection reset by peer]
mrdodo has joined #ruby
hemanth has joined #ruby
Draco___ has joined #ruby
noyb has joined #ruby
Gavilan has left #ruby [#ruby]
Draco_ has quit [Ping timeout: 246 seconds]
zeromodulus has joined #ruby
guns has joined #ruby
<guns>
g
hemanth has quit [Read error: Connection reset by peer]
<guns>
If I am running as root, is setting Process.euid= other-uid and Process.gid= other.gid equivalent to bare sudo command?
Draco_ has joined #ruby
tomoyuki` has joined #ruby
blownapart has quit [Remote host closed the connection]
<guns>
I'm willing to dive into sudo's source, but I am checking here first
<tomoyuki`>
How can I dump Hashie::Mash?
joma has joined #ruby
Draco___ has quit [Ping timeout: 248 seconds]
hemanth has joined #ruby
justsee has quit [Quit: Leaving...]
<guns>
tomoyuki`: Marshal.dump ?
<tomoyuki`>
guns: Marshal.dump(hashie) return empty and p(Marshal.dump(hashie)) return wired string.
sepp2k has quit [Remote host closed the connection]
eph3meral has quit [Quit: Leaving]
<guns>
I don't know about Hashie, but Marshal.dump serializes objects, with the exception of Proc objects
<tomoyuki`>
guns: I guess it's already serialized.
<guns>
tomoyuki`: What are you trying to do? If you are persisting to a DB or File, something like YAML is a better choice
<tomoyuki`>
I use foursquare2 gem.
<dekz>
how can i force budler to reinstall 1 gem
<dekz>
bundler*
<dekz>
not every single other gem, but just one
maletor has quit [Quit: Computer has gone to sleep.]
savage- has quit [Remote host closed the connection]
noyb has quit [Ping timeout: 246 seconds]
<shadoi>
zhando: you're welcome
hunglin has quit [Quit: Leaving.]
ananthakumaran1 has quit [Ping timeout: 244 seconds]
nai has joined #ruby
nai has quit [Remote host closed the connection]
syamajala has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
Azure has quit [Excess Flood]
ananthakumaran has joined #ruby
hemanth has joined #ruby
Azure has joined #ruby
noyb_ has joined #ruby
noyb_ has quit [Client Quit]
<joma>
Hi guys, I am writing acceptance test using rspec/capybara. Is this correct way what I'm doing? can you give advise how to improve it, or do it in correct way? http://ideone.com/qqVIr
hemanth has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
hemanth has joined #ruby
tomoyuki` has quit [Remote host closed the connection]
quest88 has quit [Quit: quest88]
Fretta has quit [Quit: Fretta]
cantbecool has joined #ruby
busybox42 has joined #ruby
chriskk has quit [Quit: chriskk]
Stormbytes has joined #ruby
fantazo has quit [Remote host closed the connection]
Stormbytes has quit [Client Quit]
krz has joined #ruby
freeayu has joined #ruby
Draco_ has quit [Remote host closed the connection]
tagrudev has joined #ruby
Hanmac1 is now known as Hanmac
hemanth has quit [Read error: Connection reset by peer]
justsee has joined #ruby
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
Axsuul has quit [Remote host closed the connection]
vertroa has quit [Read error: Connection reset by peer]
Squee-D has joined #ruby
headius has joined #ruby
vertroa has joined #ruby
radic has joined #ruby
twinturbo has joined #ruby
yxhuvud has joined #ruby
AlbireoX has quit [Remote host closed the connection]
headius has quit [Ping timeout: 246 seconds]
davidroy has joined #ruby
Xethron has quit [Read error: Operation timed out]
blacktulip has joined #ruby
maesbn has joined #ruby
vectorshelve has joined #ruby
etehtsea has joined #ruby
twinturbo has quit [Quit: twinturbo]
Draco_ has joined #ruby
zastaph has joined #ruby
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
nopolitica has joined #ruby
workmad3 has joined #ruby
mneorr has joined #ruby
arturas has quit [Read error: Connection reset by peer]
hashar has quit [Quit: hashar]
tiripamwe has quit [Quit: Leaving]
tiripamwe has joined #ruby
arkiver has quit [Ping timeout: 255 seconds]
hoelzro has quit [Quit: leaving]
tvw has quit [Remote host closed the connection]
hashar has joined #ruby
JackHind has joined #ruby
JackHind has quit [Client Quit]
tiripamwe has quit [Ping timeout: 265 seconds]
hmans has joined #ruby
davidw has joined #ruby
ephemerian has joined #ruby
davidw is now known as Guest54822
maesbn_ has joined #ruby
mrdodo has quit [Remote host closed the connection]
maesbn has quit [Ping timeout: 248 seconds]
Occult has joined #ruby
tiripamwe has joined #ruby
godfrey999 has joined #ruby
Draco_ has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
\13k has quit [Quit: Leaving]
\13k has joined #ruby
umttumt has joined #ruby
king313 has joined #ruby
hoelzro has joined #ruby
arturas_ has joined #ruby
bluregard has joined #ruby
<bluregard>
hello
<bluregard>
I'm looking at someone's code and am a little confused as to why you would use "if string[0..0] == '%'" Why would you use [0..0] as a range instead of just [0]?
<Mon_Ouie>
Perhaps 1.8 and 1.9 compatibility
igotnolegs has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
In 1.8, String#[Integer] returns the nth's byte value
<Mon_Ouie>
You could also check for string[0].chr which works fine in both
thone_ has joined #ruby
<bluregard>
oh ok
nilg` has joined #ruby
thone has quit [Ping timeout: 248 seconds]
mxweas__ has quit [Quit: Computer has gone to sleep.]
ABK has joined #ruby
Criztian has joined #ruby
_bart has joined #ruby
<brg>
#javascript
<_bart>
Hi, how do I test a variable is an instance of Nokogiri HTML document?
<_bart>
.kind_of? Nokogiri?
<_bart>
ah nvm, figured it out: value.kind_of? Nokogiri::HTML::Document
Shrink has quit [Ping timeout: 255 seconds]
\13k has quit [Quit: Leaving]
i256 has joined #ruby
<i256>
hello
<i256>
what i can read n-th permutation of array?
<i256>
what i can reat n-th element of enumerator?
<_bart>
another question, I noticed I can easily raise an ArgumentError, but what if I want to raise a FormatError (the argument was set but with the wrong format)? I get FormatError is initialised constant
<hoelzro>
_bart: what's your raise invocation look like?
<Mon_Ouie>
Well, that's because there's no FormatError class defined
<Mon_Ouie>
Although, you usually shouldn't make that kind of checks
<Mon_Ouie>
Just let it fail with a NoMethodError when you try to call a method it doesn't support
<i256>
example: a = Array.new(3) {|i| i}
<i256>
a.permutation.to_a
<i256>
what i can read 4-th element of this array?
<i256>
[1, 2, 0]
<workmad3>
i256: there is no 4th element...
<Mon_Ouie>
There's one in a.permutation.to_a
<i256>
I need 4 -th permutation of my array
<i256>
help me
ctp has joined #ruby
<i256>
b=a.permutation[4]
<i256>
or similar b==[1, 2, 0]
<Mon_Ouie>
That's the 5th one, indices are 0-based
<i256>
#3
<i256>
Mon_Ouie, tell me what i can use it
<Mon_Ouie>
Oh, and there's no Enumerator#[]
<_bart>
I have two initialize methods, one with 1 argument and one with 2 arguments, is ruby now smart enough to use the one with the appropriate amount of arguments? (when calling .new "a", "b" or .new "a")
wilmoore has quit [Remote host closed the connection]
<Mon_Ouie>
_bart: No, the second definition overrides the first one.
<i256>
workmad3, Can You help me?
<Mon_Ouie>
You can def initialize(first, sec = nil)
d3vic3 has quit [Ping timeout: 240 seconds]
davidroy has left #ruby [#ruby]
<_bart>
Mon_Ouie: okay, thanks
Guest54822 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
pk1001100011 has joined #ruby
undert has quit [Ping timeout: 252 seconds]
d3vic3 has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
mathie has quit [Quit: Sleeping...]
undert has joined #ruby
Shrink has joined #ruby
cezar has joined #ruby
arussel has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
cezar has quit [Client Quit]
banseljaj is now known as imami|afk
jgrevich has quit [Quit: jgrevich]
mathie has joined #ruby
Criztian has quit [Remote host closed the connection]
red-panda has joined #ruby
tonini has quit [Remote host closed the connection]
Rochefort has quit [Remote host closed the connection]
\13k has joined #ruby
mikekelly has joined #ruby
mucker has joined #ruby
nixmaniack has joined #ruby
<bnagy>
_bart: imho, have a cleaner api
<bnagy>
don't try to handle a uri OR a nokogiri doc
<_bart>
bnagy: it's not even valid ruby with that switch statement heh
trivol has joined #ruby
<_bart>
bnagy: yes but what's better (how?)
<bnagy>
pick one of those
<_bart>
bnagy: the class should be able to handle both, it's just a matter of setting the source
<bnagy>
yeah, no, it shouldn't
<_bart>
either through mechanise or directly
<bnagy>
is what I am sayig
<bnagy>
that kind of thing leads to tight coupling and bad code
mathie has quit [Quit: Sleeping...]
<_bart>
bnagy: should I make a class for both version?
Helius has quit [Read error: Connection reset by peer]
Helius has joined #ruby
<bnagy>
there are options
<bnagy>
personally I tend to do that (two classes)
freeayu has quit [Read error: Connection reset by peer]
<bnagy>
and make the user be clearer about what they want me to do (ie get a url or use an existing doc)
<bnagy>
basically, design as if you might decide to swap out nokogiri or mechanize
Norrin has quit [Quit: Zzz]
elhu has quit [Ping timeout: 244 seconds]
tvw has joined #ruby
elhu has joined #ruby
i256 has left #ruby ["lece"]
twinturbo has joined #ruby
<_bart>
bnagy: yes thank
<_bart>
s
yugui is now known as yugui_zzz
syamajala has quit [Remote host closed the connection]
hashar has quit [Quit: I am a manual virus, please copy me to your quit message.]
Spooner has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
<banisterfiend>
bnagy: ahoy down there, naggy! :)
Squee-D has quit [Quit: The computer fell asleep]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
alaa_ has joined #ruby
ping-pong has quit [Ping timeout: 240 seconds]
ziro` has joined #ruby
ziro` has left #ruby [#ruby]
ping-pong has joined #ruby
TheRealPygo is now known as pygospa
<hemanth>
vectorshelve, hey! what's new?
* hemanth
paws at banisterfiend
moeSeth has quit [Remote host closed the connection]
dkannan has quit [Remote host closed the connection]
relix has quit [Remote host closed the connection]
dotemacs has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
MoMo has quit [Remote host closed the connection]
octarine has quit [Remote host closed the connection]
MetaCosm has quit [Remote host closed the connection]
Dr4g has quit [Remote host closed the connection]
Spaceghostc2c has quit [Remote host closed the connection]
lectrick has quit [Remote host closed the connection]
jhowarth has quit [Read error: Connection reset by peer]
patricksroberts has quit [Remote host closed the connection]
jeremy_carroll has quit [Read error: Connection reset by peer]
pvh has quit [Remote host closed the connection]
xrl has quit [Read error: Connection reset by peer]
mroth has quit [Remote host closed the connection]
aquaranto has quit [Remote host closed the connection]
[diecast] has quit [Remote host closed the connection]
dekz has quit [Remote host closed the connection]
denysonique has quit [Remote host closed the connection]
SeanTAllen has quit [Write error: Broken pipe]
pkondzior has quit [Remote host closed the connection]
kapowaz has quit [Remote host closed the connection]
randym has quit [Write error: Broken pipe]
fcoury has quit [Remote host closed the connection]
spanx has quit [Read error: Connection reset by peer]
notbrent has quit [Read error: Connection reset by peer]
franckverrot has quit [Write error: Broken pipe]
davidboy has quit [Read error: Connection reset by peer]
simao__ has quit [Write error: Connection reset by peer]
goraxe has quit [Write error: Connection reset by peer]
NimeshNeema has quit [Remote host closed the connection]
ctevie has quit [Write error: Broken pipe]
dnyy has quit [Write error: Broken pipe]
bluOxigen has joined #ruby
<fowl>
pwned
goraxe has joined #ruby
choffstein has joined #ruby
<bnagy>
banisterfiend: down where? You in .nl now?
<banisterfiend>
bnagy: oh no, i was just showing off my new @
<banisterfiend>
bnagy: going to .nl soon though
<hoelzro>
banisterfiend: what's the occasion?
<bnagy>
hahah they gave you ops?
<bnagy>
comedy +++
Shrink has quit [Ping timeout: 250 seconds]
Foxandxss has joined #ruby
relix has joined #ruby
[diecast] has joined #ruby
hmans has joined #ruby
Shrink has joined #ruby
d3vic3 has quit [Quit: leaving]
Shrink has quit [Remote host closed the connection]
tiripamwe has quit [Quit: Leaving]
Shrink has joined #ruby
Shrink has quit [Changing host]
Shrink has joined #ruby
MoMo has joined #ruby
aquaranto has joined #ruby
nilg has quit [Remote host closed the connection]
piotr_ has joined #ruby
dekz has joined #ruby
piotr has quit [Ping timeout: 246 seconds]
withnale has joined #ruby
Guest75326 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
patricksroberts has joined #ruby
xrl has joined #ruby
davidboy has joined #ruby
<vectorshelve>
hemanth: hi man
<withnale>
Has anyone else seen this trying to install rubygem-ruby-debug on fedora17 ? http://pastie.org/4270910
Spaceghostc2c has joined #ruby
piggybox has quit [Quit: piggybox]
mroth has joined #ruby
mroth has quit [Changing host]
mroth has joined #ruby
mroth has joined #ruby
mroth has quit [Changing host]
Nies has joined #ruby
hmans has quit [Quit: Leaving...]
sepp2k has quit [Remote host closed the connection]
randym has joined #ruby
Progster has joined #ruby
headius has joined #ruby
Rochefort has joined #ruby
kapowaz has joined #ruby
Dr4g has joined #ruby
dotemacs has joined #ruby
fearoffish has joined #ruby
janitor has joined #ruby
moeSeth has joined #ruby
SeanTAllen has joined #ruby
pkondzior has joined #ruby
ringotwo has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
red-panda has quit [Remote host closed the connection]
red-panda has joined #ruby
lectrick has joined #ruby
jjang_ has joined #ruby
jjang_ has quit [Remote host closed the connection]
MetaCosm has joined #ruby
dkannan has joined #ruby
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
jjang has quit [Ping timeout: 252 seconds]
nyuszika7h is now known as Guest63432
Guest63432 has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
snearch has joined #ruby
notbrent has joined #ruby
vjacob has joined #ruby
mathiaz_sk1 has joined #ruby
<mathiaz_sk1>
hello, anybody around that would be willing to help me with one sinatra question/problem?
<oddmunds>
mathiaz_sk1: better just to ask the question
JohnBat26 has joined #ruby
<mathiaz_sk1>
ok i'll try :) I am trying to make proxy method on Sinatra server which acts as API server. The proxy method would pass trough file from remote source [client] —> [sinatra] —> [file]. I was trying to use Stream helper included in sinatra but I have an issue when using it with Net/HTTP library. Here is the code, https://gist.github.com/b121a84738dd5fe2f9b8
heftig has joined #ruby
<mathiaz_sk1>
My problem is that read_body method of response is raising following error: Tue Jul 17 11:34:40 +0200 2012: Read error: #<IOError: Net::HTTPOK#read_body called twice>
janitor has quit [Quit: Page closed]
busybox42 has quit [Ping timeout: 248 seconds]
ramblex has joined #ruby
umttumt has quit [Remote host closed the connection]
<mathiaz_sk1>
thanks!
<ij>
Is there a good way of getting all Threads' init functions or descriptions of some sort(file initialized in or something)
abra has joined #ruby
nyuszika7h has joined #ruby
nyuszika7h has quit [Client Quit]
jhowarth has joined #ruby
uris has joined #ruby
Rochefort has quit [Read error: Connection reset by peer]
_bart has quit [Read error: Connection reset by peer]
Rochefort has joined #ruby
_bart_ has joined #ruby
fermion has joined #ruby
<_bart_>
what happened?
nyuszika7h has joined #ruby
<robert_>
shevy :D
mpereira has joined #ruby
tomb_ has joined #ruby
vitoravelino`afk is now known as vitoravelino
nixmaniack has left #ruby ["Ex-Chat"]
nixmaniack has joined #ruby
hunglin has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
dnyy has joined #ruby
Xethron has joined #ruby
ctevie has joined #ruby
ctevie has quit [Changing host]
ctevie has joined #ruby
galymzhan has joined #ruby
mathie has joined #ruby
user__ has quit [Quit: Forget progress by proxy. Land on your own moon.]
akem has joined #ruby
fcoury has joined #ruby
nateberkopec has joined #ruby
kingfishr has joined #ruby
busybox42 has joined #ruby
Stalkr_ has joined #ruby
denysonique has joined #ruby
godfrey999 has quit [Quit: godfrey999]
zodiac1111 has joined #ruby
<_bart_>
so I use a few of the same methods in 3 different classes that are unrelated to each other
<_bart_>
so adding those methods to a base class doesn't make sense
Shrink has quit [Ping timeout: 252 seconds]
<_bart_>
should I make a singleton "helper" kind of class?
<bnagy>
ethicalhack3r: start by not using @@class_vars
<bnagy>
also, your nick makes me giggle
<JonnieCache>
_bart_: youre not talking about modules as mixins though are you, youre talking about modules as namespaces
<JonnieCache>
_bart_: you dont need them in the same file, no, you just put (the same) module definition around each of them in their own files
<ethicalhack3r>
bnagy: I'm glad I amuse you although your answer is not very helpful
<JonnieCache>
_bart_: you should probably have a directory structure that mirrors the namespacing though
grekkos has joined #ruby
grekkos is now known as Guest70478
npras has joined #ruby
<bnagy>
ethicalhack3r: well it's a bit hard to help you when your code is a) horrible (and uses class vars) b) lacks context (I don't know what you're defining connect on, why you're making it a class method, or why you're using empty args and c) your nick makes me giggle :)
<shevy>
ethicalhack3r: class variables are in most cases not needed
<bnagy>
oh and d) why you're using a mysql gem from the Dawn Of Time
<shevy>
they are like pseudo-global variables
<bnagy>
I'd suggest switching to Sequel imho
<bnagy>
unless there's a new hotness, I don't like mysql much myself so I haven't used it for years
NimeshNeema has joined #ruby
Shrink has joined #ruby
red-panda has quit [Remote host closed the connection]
hmans has joined #ruby
<_bart_>
JonnieCache: do you know where I can find a good example of that? I'm googling but the examples all don't do what you describe!
awarner has joined #ruby
ChampS_ has joined #ruby
ChampS_ has quit [Client Quit]
<bnagy>
eh?
<bnagy>
"so I use a few of the same methods in 3 different classes that are unrelated to each other
<bnagy>
is pretty much the exact definition of a mixin
<JonnieCache>
hmm looks like i didnt read properly
<JonnieCache>
sorry
BiHi has joined #ruby
`brendan has joined #ruby
Rochefortes has joined #ruby
Morkel has joined #ruby
Shrink has quit [Ping timeout: 265 seconds]
vectorshelve has quit [Quit: Page closed]
fermion has quit [Ping timeout: 248 seconds]
<banisterfiend>
ayone else gettig a tonne of 502 errors on reddit?
<_bart_>
but let me update that :p
<_bart_>
there are not completely unrelated
<_bart_>
they are for the same global purpose, but they all for different parts of the problem
<bnagy>
if the methods make no sense as a method on an object, you can stuff them in a module and not mix them in
Shrink has joined #ruby
<bnagy>
eg Math.sqrt is a method on a module directly
<bnagy>
while things like Enumerable or Comparable only make sense when mixed in, really
Rochefort has quit [Ping timeout: 246 seconds]
<bnagy>
not sure if that's a very clear way to explain in :/
tommyvyo has joined #ruby
<_bart_>
I'll add a singleton class called DataHelper to the module
<bnagy>
singleton classes are really almost never the best solution
tommyvyo has quit [Client Quit]
zodiac1111 has quit [Ping timeout: 265 seconds]
<fowl>
sixty nine
hashar has joined #ruby
<_bart_>
bnagy: okay to make things more clear, I have a forceUTF8 method that ensures that .to_s and later .downcase doesn't fail, and it's used in 2 of the 3 classes.
<shevy>
banisterfiend: hmm dont get errors
Ryan__ has joined #ruby
alaa_ has quit [Remote host closed the connection]
<bnagy>
well there's already String#force_encoding
awarner has quit [Remote host closed the connection]
<_bart_>
also in ruby 1.9.3p194?
tommyvyo has joined #ruby
<Ryan__>
whats the "cleanest" way to take a string value formatted as "%H:%M:%S", e.g. "01:44:00"
<bnagy>
_bart_: yeah
<Ryan__>
sorry, unfinished sentence. and turn that into seconds
Stalkr_ has quit [Quit: Leaving...]
Guest70478 has quit [Quit: leaving]
d3vic3 has joined #ruby
<Mon_Ouie>
I'd just split and do it manually, h * 3600 + m * 60 + s
ChampS666 has quit [Ping timeout: 246 seconds]
DrForr has quit [Ping timeout: 265 seconds]
Icoin has joined #ruby
<Ryan__>
bleh, was hoping someone might have some modulo magic or something that might clean some stuff up
<bnagy>
how about reverse and then with_index int * 60**idx
<Mon_Ouie>
You'd use module to do the opposite, here you just need to multiply
krusty_ar has joined #ruby
<bnagy>
60**0 would be 1, right?
zeroXten has quit [Remote host closed the connection]
<Mon_Ouie>
Yeah
MatthewGA has joined #ruby
<bnagy>
it's probably a bit showoffy for no good reason though
<_bart_>
bnagy: but what if I use this method for that: http://pastie.org/4271317 it would be bad practise to copy/paste that across three classes?
<bnagy>
cause it's not like if you extend it to 4 elements it would work
<Ryan__>
well i meant like how you can do string interpolation like "%d hellos" % 5 == "5 hellos", except maybe with strftime
<Mon_Ouie>
Heh, funny, 60 ** -1 even returns a Rational (as opposed to a float)
zodiac1111 has joined #ruby
erichmenge has joined #ruby
cbetta has joined #ruby
zodiac1111 has quit [Read error: Connection reset by peer]
<bnagy>
_bart_: assuming there weren't built in ways to do that then the 'correct' way would be to put that in a Module and include it in the classes
<bnagy>
imho
<_bart_>
bnagy: so mixing it in using include and not going for the namespace approach
<Mon_Ouie>
Ryan__: There's strptime, but that's to parse a *time*, not a *duration*
<bnagy>
_bart_: like I said, if it's a method that makes 'sense' on an object then mix it in, if not stick the shared code in a module and invoke it directly
<ethicalhack3r>
figure it out, thanks for the help bnagy
ethicalhack3r has quit [Quit: Leaving]
ChampS666 has joined #ruby
galymzhan has left #ruby [#ruby]
justsee has joined #ruby
hunglin has quit [Quit: Leaving.]
hashar_ has joined #ruby
mneorr has joined #ruby
danielpunt has joined #ruby
fantazo has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
und3f has joined #ruby
peterhellberg has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
<Ryan__>
heres an interesting solution :). Time.parse("01:00:00").seconds_since_midnight. probably a rails only method, but solved my problem
hashar has quit [Ping timeout: 265 seconds]
hashar_ is now known as hashar
<und3f>
Good day. I need to autostart resque worker on Debian/Squeeze but I can't find any example rc.d script for rake.
awarner has joined #ruby
<Hanmac>
Ryan__ seconds_since_midnight is rails only
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
sspiff has quit [Ping timeout: 248 seconds]
<Ryan__>
none go over 2 hours or so, so fits perfectly. thanks for the help!
<Hanmac>
DateTime.strptime("01:44:00","%H:%M:%S") there you get datetime
<_bart_>
bnagy: and when testing strings, if will pass even for ""
<bnagy>
rawr
<_bart_>
bnagy: that's odd?
<Hanmac>
imo core or stdlib need some kind of TimeSpan classes ...
<bnagy>
_bart_: empty string is truthy
<_bart_>
bnagy: then I have to do: if somestring != ""
<_bart_>
bnagy: or is there a better way?
<Hanmac>
no! use .empty?
<bnagy>
_bart_: no :) unless somestr.empty?
<Mon_Ouie>
bnagy: As shown above, Integer(int) doesn't work for this. It treats a leading 0 as an indication for octal.
<Mon_Ouie>
Integer(int, 10) would work
<_bart_>
bnagy: .empty? is better! thanks
<bnagy>
Mon_Ouie: yeah you're right, should just be to_i I think
<Hanmac>
empty strings are true because there is nothing wrong inside them :P
fbernier has joined #ruby
<Mon_Ouie>
And each.with_index.map => map.with_index
<_bart_>
Hanmac: nil doesn't contain anything wrong but is considered false
uris has quit [Quit: leaving]
<Hanmac>
Mon_Ouie: map.with_index does not work as you except
<Mon_Ouie>
How so?
<Hanmac>
yeah you could try it
<Mon_Ouie>
I tried it and it does work
<bnagy>
you could probably do it with one pass of inject
<bnagy>
if it's golf
<bnagy>
but it would be crappy cause you'd need to keep the multiplier separate
tommyvyo has joined #ruby
mpereira has quit [Ping timeout: 240 seconds]
ken_barber has joined #ruby
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
strife25 has joined #ruby
ChampS666 has quit [Ping timeout: 255 seconds]
krylov has joined #ruby
crankycoder has joined #ruby
arami has joined #ruby
sspiff has quit [Ping timeout: 246 seconds]
wvdschel has joined #ruby
niklasb has quit [Ping timeout: 265 seconds]
<arami>
Hey folks. Good a question regarding grouping an Array of Data. I have an Array of ActiveRecords and want to create a Hash grouped by the date in created_at. Any ideas for a performant way of doing it?
<arami>
JonnieCache: I'm aware of the fact that it's never going to be that performant. But It's ok for now
<arami>
Will also take a look on the article
<arami>
Thx for that hint
ssspiff has joined #ruby
<JonnieCache>
yeah its fine to do that, everyone does it. but it will cost a lot of cpu cycles in the long run if you have a lot of posts or whatever
sebastorama has joined #ruby
cakehero has joined #ruby
subbyyy has joined #ruby
<arami>
It's for admin/statistics only. I need create it as a proof of concept in the first place in replace it with the better implementation afterwards
<arami>
And yes, it will cost A LOT of CPU cycles because I have a fast growing dataset to rely on
<JonnieCache>
hmm fast growing will make caching difficult
wvdschel has joined #ruby
<JonnieCache>
perhaps a different datastore would be good
sspiff has quit [Remote host closed the connection]
bglusman has joined #ruby
<JonnieCache>
redis can probably do that stuff natively
<bnagy>
If I had to guess I would be that a single regex would be too backtracky
<apeiros_>
that's the principle
bbttxu has joined #ruby
<_bart_>
nice
<apeiros_>
bnagy: that's what your atoms are there for
nateberkopec has quit [Quit: Leaving...]
<apeiros_>
_bart_: also worth a consideration - stringscanner
<apeiros_>
it's regex based too, but it can be useful in splitting up the problem domain into smaller, easier to grasp and process entities
<bnagy>
but \d+ #{month} or #{month} \d+ or ....
<hoelzro>
is there a command line tool for printing the location a module would be loaded from? ex. rbwhich 'rdoc/rdoc' # prints location of rdoc/rdoc.rb as found by Ruby
<JonnieCache>
yeah id write a state machine with a case statement and a shitload of separate regexen. with one big regex you will eventually go mad
<apeiros_>
hoelzro: gem which, if it's from a gem
hunglin1 has joined #ruby
<apeiros_>
hoelzro: if it's not from a gem, ruby -e '$LOAD_PATH.find { …
<hoelzro>
apeiros_: and if it's not?
<apeiros_>
I have some code lying around… wait
tvw has quit [Remote host closed the connection]
<hoelzro>
I was wondering if there were a suite of tools such as this
<hoelzro>
Perl has pmtools
<_bart_>
I already have some regexp in there, for detecting numerical dates: /(\d{4,4}(-|\.)\d{1,2}(-|\.)\d{1,2})/i
<hoelzro>
I'm happy to write them myself; gives me practice =)
<ramblex>
_bart_: you're missing a few question marks
<apeiros_>
_bart_: you omitted the ?'s
<_bart_>
ah thanks!
<_bart_>
now I see
<apeiros_>
_bart_: anyway, I think you're at the point where you should write a test-suite instead of using rubular
<apeiros_>
and then reference the github repo
dv310p3r has joined #ruby
<bnagy>
I tried rubular a couple of times, but if you're going to match with scan then you can often write much more simply
ryan0x2 has quit [Remote host closed the connection]
<apeiros_>
btw., just in case anybody wondered - oracles' regex engine is limited to expressions somewhere below 500 chars :)
<_bart_>
test-suite?
<Mon_Ouie>
Is there anything wrong about using requiring a gem from a Fiber? It produces a very weird bug, but I can't figure out what exactly is going on…
tatsuya_o has quit [Remote host closed the connection]
<JonnieCache>
if you dont know what a test suite is, drop everything youre doing and learn rspec
tatsuya_o has joined #ruby
<apeiros_>
Mon_Ouie: doesn't Qt come with its own thread management? might that interfere?
<JonnieCache>
or minitest or whatever
<Mon_Ouie>
(In my actual code I could fix it by just moving the code that called the require, but I'd like to know why it causes such a bug)
tatsuya__ has joined #ruby
<apeiros_>
_bart_: require 'test/unit'; class MyTest; def test_matches_simple_dates; assert "12. feb 2012" =~ YourRegex; end; end
Lachryma has quit [Ping timeout: 244 seconds]
<Mon_Ouie>
apeiros_: It does have its own threads, yes; I somehow doubt they can affect Ruby though
tatsuya_o has quit [Read error: Connection reset by peer]
arami has quit [Quit: Leaving]
<apeiros_>
Mon_Ouie: well, only guessing. no idea otherwise. but I'd probably try to reproduce in pure ruby. I don't think requiring in a fiber should be any problem.
<Mon_Ouie>
It seems to be more specifically activating a gem
passerine has quit [Quit: {YunxBoT}v17XPeFo½ºþרÓðæ-=¡îxp¡î=-]
<workmad3>
JonnieCache: I'd suggest people learn minitest nowadays (even though I'm a big rspec user :) )
<workmad3>
JonnieCache: simply because they can learn both spec and test::unit style with it without switching libraries :)
<workmad3>
JonnieCache: and in addition, it's in the stdlib for 1.9
<JonnieCache>
im still slightly amazed by rspec every time i use it
<workmad3>
heh
<banisterfiend>
because it takes 1 hour to run 5 tests?
<banisterfiend>
:)
<workmad3>
started using the new expect(whatever).to do_stuff syntax yet?
sameerynho has quit [Ping timeout: 265 seconds]
<JonnieCache>
ive used it with change
<JonnieCache>
and passed in a proc
<JonnieCache>
what else can it do?
<workmad3>
yeah, that's been in rspect since forever
<workmad3>
*rspec
<workmad3>
2.11 introduced it as a syntax for any matcher, rather than using .should
<workmad3>
so expect(subject).to be_awesome
<workmad3>
rather than subject.should be_awesome
<JonnieCache>
whats the gain there?
<workmad3>
no need for rspec to monkey-patch kernel
strife25 has joined #ruby
<workmad3>
(which is a common criticism of the .should method :) )
deobald_ has quit [Ping timeout: 244 seconds]
<JonnieCache>
so you can disable the should syntax then
nilg` has quit [Remote host closed the connection]
<JonnieCache>
i like should tbh
choffstein has quit [Remote host closed the connection]
<workmad3>
yeah, and there's a config switch to do so in 2.11... I've yet to switch myself :)
<workmad3>
just wondered if you'd used it yet
<JonnieCache>
i dont care about polluting kernel
obryan has joined #ruby
<JonnieCache>
its a test environment, weird shit is expected
<workmad3>
I can see that for some tests, expect can be a bit more readable
<workmad3>
heh
<workmad3>
it makes me think more of the java hamcrest matcher lib though, with a bit of jmock mixed in... and do I really want rspec to remind me of java? :)
<apeiros_>
it's a test environment. it's expected to be clean.
<JonnieCache>
that is true, but at the same time, if your codes behaviour depends on the methods that are or arent in Kernel then youve got other problems
vjacob has quit [Quit: Leaving]
<apeiros_>
yes, but not one that's part of a unit test
<apeiros_>
that'd be integration testing
<JonnieCache>
no i mean, in the general sense
billy_ran_away has joined #ruby
<JonnieCache>
if youve written your code like that then youre doing it wrong
<apeiros_>
I disagree
<apeiros_>
rspec violates encapsulation rules
<apeiros_>
you can't be reasonably held responsible for others break of encapsulation rules
<apeiros_>
that's why they exist in the first place.
<JonnieCache>
if you want strict following of OO rules then dont use ruby :)
<apeiros_>
again, I disagree
<JonnieCache>
ruby encourages method chaining which is fundamentally abhorrent to "proper" OO design
<apeiros_>
incorrect.
ryan0x2 has joined #ruby
Guest49818 has joined #ruby
<JonnieCache>
the law of demeter isnt part of general OO thought?
<xiphiasx_>
"encourages" does not mean "force you"
<xiphiasx_>
if you do not like the idea, then don't do it... doesn't mean you have to stop using ruby as a whole
<apeiros_>
JonnieCache: a) no, b) it's disputable how demeters law is to be applied there
cloud|windoze has quit [Ping timeout: 255 seconds]
<xiphiasx_>
that is like saying if 1 grape is bad on the vine, all of them are bad
PaciFisT has joined #ruby
<apeiros_>
string.gsub.strip.upcase - you never left the domain
<apeiros_>
yet you chained
<apeiros_>
just as one example
<apeiros_>
demeters law is about knowledge
sspiff has joined #ruby
<apeiros_>
the driver shouldn't have to know about how the gas is ignited in the engine just to drive
<apeiros_>
you can chain perfectly fine without ever leaving your domain of knowledge.
<JonnieCache>
people dont though. the ruby world loves to piss all over demeter
<JonnieCache>
see: rails
deobald_ has joined #ruby
<apeiros_>
sure
<apeiros_>
I didn't say people wouldn't write bad code, did I'
<apeiros_>
?
<xiphiasx_>
lots of people write bad ruby code
<xiphiasx_>
does that make ruby bad?
<xiphiasx_>
the same can be said for any other language
<JonnieCache>
jesus what am i defending here?
<apeiros_>
it's not the language's responsibility to hold the coder's hands
<apeiros_>
it's not your baby sitter
<JonnieCache>
i never said it was
<apeiros_>
that doesn't mean that anything that goes is a good idea
<apeiros_>
so just because you *can* add new public methods to Object, doesn't mean it's a good idea
<bnagy>
it's ridiculous to claim that languages can't be judged by the code that people produce with them
<apeiros_>
neither does that statement mean it was *never* a good idea.
wvdschel has quit [Ping timeout: 246 seconds]
<bnagy>
just as it's stupid to assert than because it's _possible_ to write crap code the language is thus crap
<apeiros_>
bnagy: hm? I said no such thing. What I say is that you can write bad code regardless of the language.
brg has left #ruby [#ruby]
<bnagy>
apeiros_: if I were responding to a point of yours I would have, y'know, used your name :)
<apeiros_>
ok
<apeiros_>
I agree with your statements btw. (hence the reaction)
godfrey999 has quit [Quit: godfrey999]
mockra has joined #ruby
<JonnieCache>
generally though i stand by the statement that ruby is not a language which is predisposed towards "principled" OO programming
sailias has joined #ruby
<JonnieCache>
obviously you can do that with it if you want, but youd be wasting the power of ruby
<apeiros_>
funny, I'd disagree again
<bnagy>
how about 'pragmatic' OO then?
<JonnieCache>
and youd be better off in a language with a big fancy modern type system
<xiphiasx_>
bzzt, wrong.
<apeiros_>
while you can do what you want, and while people do write bad code, it's comparatively much less due to bad OO principles - IMO.
<bnagy>
we do have a few things which make it temping / easy to write bad OO
<JonnieCache>
when i say "principled" i dont mean "good"
<bnagy>
also, things like 3.times wind me up
lledet has joined #ruby
choffstein has joined #ruby
<JonnieCache>
im not making a value judgement there. just describing super strict OO like they tech in school versus the looser style that generally exists in practice
andrewhl has joined #ruby
Helius has quit [Remote host closed the connection]
<apeiros_>
JonnieCache: anyway, we deviated
<xiphiasx_>
i'd argue OO can be subjective
<apeiros_>
you said if my code relied on people not screwing with core ruby, it was my fault
<apeiros_>
I disagree. very much so.
axl_ has joined #ruby
<apeiros_>
and that doesn't really have anything to do with anything we said. I gave you the technical explanation for it. you can explain it without too.
<JonnieCache>
i didnt say "messing with core ruby" i said "adding new methods to kernel"
<apeiros_>
that *is* messing with core ruby.
ePirat_ has joined #ruby
<apeiros_>
if not that, then what is? :)
<JonnieCache>
the only way that could be a problem surely is if youre iterating over the methods in kernel or something
<bnagy>
I'd argue that the word 'oriented' implicitly suggests that it's a guideline, not a command :)
<apeiros_>
wrong
ePirat_ has quit [Client Quit]
mockra has quit [Remote host closed the connection]
<JonnieCache>
how else is it going to come up?
binaryplease has joined #ruby
<apeiros_>
and that's exactly why you should NOT violate encapsulation. because *your* imagination will *always* be too limited to be able to see what you could potentially break.
<apeiros_>
JonnieCache: a simple thing like o = OpenStruct.new; o.should = "hello"
<apeiros_>
oh noes! it's breaksy!
cloud|windoze has joined #ruby
<apeiros_>
but again, *not* the point
<apeiros_>
the point is that you can't possibly know what you break if you change global things.
<bnagy>
I think that's what BasicObject was meant for, no?
<JonnieCache>
hmm well id argue that if youre planning to test your code with rspec and you put should methods in your api then that is your fault :)
<bnagy>
if you want to be method_missing clever
<apeiros_>
bnagy: sure, as of 1.9. but it's not a silverbullet. and again, it's an example, it is *not* the point.
<bnagy>
JonnieCache: no the point is it's not a method, it's an ostruct
lukea has left #ruby ["Leaving"]
<apeiros_>
JonnieCache: you're living in a singular world?
<apeiros_>
you never use foreign code?
<bnagy>
there are suddenly thing you can't assign as struct members
<apeiros_>
of course if everything is from you then you can do whatever, you don't have to follow any rules. those exist to enable coexistence.
mahmoudimus has joined #ruby
<bnagy>
anyway, I can count the number of times I have monkeypatched core (Kernel, Module, String...) on my dick
<apeiros_>
lol
<bnagy>
don't like it
<JonnieCache>
the problem in irc is people seem to interpret everything I say in the strongest possible terms for the sake of debate leverage
<bnagy>
(monkeypatching core, not...(
<JonnieCache>
oddly enough i am not in favor of monkey patching kernel
<JonnieCache>
im not a fucking idiot
ananthakumaran has joined #ruby
<bnagy>
*I'm
Hash_Rocket has joined #ruby
<JonnieCache>
i just dont think its the end of the world that rspec does it, thats all. obviously there are tradeoffs, like with everything
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
<workmad3>
bnagy: haha :D
<bnagy>
sorry, humour reflex :>
<apeiros_>
I'd prefer to be a fucking idiot, rather than just an idiot - at least I'd be having fun :o)
<apeiros_>
JonnieCache: I don't think it's the end of the world. what made me go off was the "it's test env, it's expected to be weird"
<banisterfiend>
xiphiasx_: no it's the first we've heard of it
<apeiros_>
which is 180° the wrong thing.
blazes816 has joined #ruby
<apeiros_>
xiphiasx_: yeah, about 2 months ago ;-)
<apeiros_>
I even saw matz speak about it
<JonnieCache>
yeah agreed. in practice though the test env is inevitably weirder than dev or production because of the testing tools
<JonnieCache>
its a constant battle to isolate everything
<workmad3>
end of the day, it's about knowing your tools... as long as you know that rspec adds two methods to kernel and can recognise when that's actually causing an issue, you're good
<apeiros_>
um, yes, and the battle to isolate is usually the reason why it should be inevitably less weird
<apeiros_>
i.e., it should be much more controlled
<heftig>
is mruby supposed to be like lua?
<bnagy>
this is why I don't believe in stupid tdd
<apeiros_>
I don't know what test units you write, but mine are pretty much "all under control".
<apeiros_>
heftig: yes
<workmad3>
bnagy: only smart tdd for you, eh? :P
<bnagy>
all the stuff I ever want to test is hard to test, so I look at how people do it IRL - oh, they mock it
<apeiros_>
heftig: funny, the very same question came up at euruko
binaryplease has quit [Quit: WeeChat 0.3.8]
<JonnieCache>
well timecop is a great example. weird behaviour, essential tool.
freeayu has quit [Quit: 离开]
<xiphiasx_>
there was some rad unit testing framework I was looking at
<apeiros_>
controlled behaviour
ABK has quit [Read error: Operation timed out]
<JonnieCache>
then theres VCR. really weird behaviour, super useful tool.
<bnagy>
I like chaos monkey, can't remember where I heard the term
<lledet>
i'm trying to install therubyracer gem, but i'm getting a ton of errors and can't figure out what's actually wrong. can someone point me in the right direction? http://pastebin.com/L02s4brY
<apeiros_>
I very much disagree with your notion of weird behavior
<bnagy>
you just build random failures into your systems and then run stuff
<workmad3>
JonnieCache: I don't class Timecop as essential
<apeiros_>
bnagy: netflix
<xiphiasx_>
riot
<xiphiasx_>
there we go
<bnagy>
apeiros_: ok :) Thanks
<JonnieCache>
workmad3: it is if you need to test stuff that works with time. its that or change the system clock
<Mon_Ouie>
That's the one I usually use
<workmad3>
JonnieCache: I'd prefer to use dependency injection for clocks when possible in order to isolate it
<apeiros_>
at least afaik they introduced the term
<workmad3>
JonnieCache: or you take the option of breaking your dependency on a hidden global variable :P
<apeiros_>
workmad3: we have a couple of test cases where it is essential
<apeiros_>
or at least makes things a lot easier
<workmad3>
yeah, sometimes thanks to the design, you have to make do...
ringotwo_ has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
<apeiros_>
workmad3: na, we have business rules which are time dependant
<workmad3>
apeiros_: right... so you inject into the objects a clock
<apeiros_>
of course we could tweak the test data to fit at all times. but it's much easier to follow if you just say "today is jan 1st 2010"
mohits has quit [Ping timeout: 248 seconds]
<workmad3>
apeiros_: which brings your time dependencies into something you control rather than hidden global state
<apeiros_>
workmad3: which would needlessly make the design more complex
<fowl>
which version of ruby works best on DOS
<apeiros_>
as other than in tests there is absolutely no use-case for that added complexity
Tomasso has joined #ruby
<apeiros_>
workmad3: anyway, without timecop I'd simply add a Time constant within the namespace of those classes and muck with that one.
<minijupe>
When writing a class, when is simply using an instance variable sufficient and when is attr_accessor necessary?
baroquebobcat has joined #ruby
<apeiros_>
minijupe: attr_accessor is needed if "outside" objects need access to the data
<fowl>
minijupe, attr_accessor :x just does def x() @x end
<fowl>
er it also creates a setter
<fowl>
def x=(value) @x = value end
<workmad3>
apeiros_: doesn't hide the fact that your business rules are dependent on implicit, global, volatile state
mockra has joined #ruby
<apeiros_>
only methods running in the scope of `self` have access to ivars. all others must go via a method
knightblader has joined #ruby
KindOne has quit [Read error: Operation timed out]
<fowl>
minijupe, so accessors are needed to access @ivars from outside the class
<apeiros_>
workmad3: that's their definition (that they are dependent on implicit, global, volatile state)
<Hash_Rocket>
if you build attr_accessor into the main class, all sub classes can also have same attr_accessors
<workmad3>
apeiros_: :)
internet_user has joined #ruby
oscardelben has joined #ruby
cek has joined #ruby
<cek>
how do I either require json or json_pure in gemspec?
<minijupe>
so if i want to do my_instance.my_ivar, it needs to have attr_accessor, but anything inside the class definition can use @var w/o going through the getter?
kevinbond has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<minijupe>
but /can/ go through the getter/setter?
mockra has quit [Remote host closed the connection]
bier has joined #ruby
Paradox has quit [Ping timeout: 252 seconds]
<apeiros_>
yes
<minijupe>
tnx
darkc0met has quit [Ping timeout: 265 seconds]
Ryan__ has quit [Quit: Ryan__]
<apeiros_>
pro getter: enables refactoring of the getter without changing code that accesses it, contra getter: it's slower
zommi has quit [Remote host closed the connection]
<JonnieCache>
much slower?
king313 has quit [Ping timeout: 255 seconds]
arkiver has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
nixmaniack has quit [Quit: Ex-Chat]
SeanLazer has joined #ruby
verto|off is now known as verto
bburhans has quit [Ping timeout: 600 seconds]
ananthakumaran has quit [Ping timeout: 265 seconds]
<SeanLazer>
hey guys, i'm trying to write a module that overrides some methods on an instance but also provides a pass-through method to get to the original method
ananthakumaran has joined #ruby
mathiaz_sk1 has left #ruby [#ruby]
<SeanLazer>
using something like alias_method :original_method, :method before writing the new method doesn't work because at the time that it's executed the module hasn't been mixed in anywhere
kvirani has quit [Remote host closed the connection]
EzeQL has joined #ruby
king313 has joined #ruby
tagrudev has quit [Remote host closed the connection]
ajsmith has joined #ruby
<SeanLazer>
is that even possible?
<ajsmith>
hi there. I'm compiling ruby from source. does anyone know how I can build ruby *without* rubygems?
<minijupe>
ok, here's another question: at what point in writing a class do you decide to use attr_accessor? Should I only use @ivars when writing the class and then use attr_accessor only when I'm sure I want that @ivar available to the outside?
whitequark has joined #ruby
<JonnieCache>
that sounds like a pretty good plan
<SeanLazer>
minijupe: i'd say that's correct, attr_accessor is a way to expose an interface to your class
<JonnieCache>
sometimes you may want to define your own getters and setters to transform the data though
<JonnieCache>
in which case you would do that up front
ringotwo_ has quit [Remote host closed the connection]
Athetiusdroid has quit [Ping timeout: 246 seconds]
greasegum has joined #ruby
Rochefortes has quit [Read error: No route to host]
lorandi has quit [Quit: Leaving]
bbttxu has quit [Quit: bbttxu]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
Rochefort has joined #ruby
elsifaka has joined #ruby
<minijupe>
tnx guys
octarine has joined #ruby
piggybox has joined #ruby
moos3 has joined #ruby
billiam has joined #ruby
mahmoudimus has joined #ruby
lledet has quit [Read error: Connection reset by peer]
lledet has joined #ruby
ryan0x2 has quit [Remote host closed the connection]
jsime has joined #ruby
aganov has joined #ruby
cloud|windoze has quit [Quit: Leaving.]
iamjarvo has joined #ruby
Lachryma has quit [Ping timeout: 244 seconds]
bbttxu has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
kevinbond_ has joined #ruby
tayy has joined #ruby
kevinbond has quit [Read error: Connection reset by peer]
kevinbond_ is now known as kevinbond
cantonic has joined #ruby
Stalkr_ has joined #ruby
ananthakumaran1 has joined #ruby
twinturbo has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
shevy has quit [Ping timeout: 248 seconds]
gabebug has joined #ruby
tk_ has quit [Quit: ばいばい]
SQLStud has joined #ruby
<gabebug>
I found a bug in the 1.9.2 stdlib csv.rb which has been fixed in 1.9.3. is there a better recommended way to get the 1.9.3 change into my project short or copying 1.9.3's csv.rb into my project's lib directory? Are these things mirrored in gems anywhere?
Guest49818 has quit [Quit: Leaving]
claudiu has joined #ruby
ttilley is now known as ttilley_off
mnzaki has joined #ruby
ryan0x2 has joined #ruby
mneorr has quit [Quit: Leaving.]
jsime has quit [Read error: Connection reset by peer]
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
aganov has quit [Quit: aganov]
shevy has joined #ruby
Tasser has quit [Ping timeout: 240 seconds]
<Hash_Rocket>
Total Ruby/programming n00b: how are ruby programs integrated into sites &/or invoked?
luckman212 has joined #ruby
kpshek has joined #ruby
jeremy_carroll has joined #ruby
<apeiros_>
the state of the art is to use rack
<hoelzro>
Hash_Rocket: usually, Ruby web applications sit on top of a framework called Rack
mdpatrick has joined #ruby
<apeiros_>
that is a layer between your webserver (apache) and your ruby code
kvirani has joined #ruby
<apeiros_>
*e.g. apache
<Hash_Rocket>
hmmm... and how are they called upon in the user interface?
<apeiros_>
with apache it'd be apache -> passenger -> rack -> your app
<apeiros_>
well, your app exposes a `call` method which takes a single argument
<gabebug>
passenger is the application server that implements the rack interface for your app (similar to how tomcat is the app server for the java servlet interface)
<apeiros_>
rack passes an object as that single arg, which contains all data about the request
<gabebug>
and you can load passenger into apache, nginx, etc as a module
<Mon_Ouie>
Notice Ruby is usually used as more than just a template engine (which is how PHP gets used most often)
<claudiu>
hi there! I have this method http://pastebin.com/LaB7WdFp which should captures the output of another method. After a second call of the method it gives me "(Errno::EBADF) Bad file descriptor " error at line 19. What can I do? I tried to close the file but it doesn't work
<hoelzro>
Hash_Rocket: when your browser navigates to a specific page, the Ruby application handles it and sends back a response
vertroa has quit [Read error: Connection reset by peer]
harcher has joined #ruby
dhruvasa1ar has quit [Ping timeout: 250 seconds]
blacktulip has quit [Remote host closed the connection]
vertroa has joined #ruby
<gabebug>
claudiu: any reason you're using eval instead of passing in a proc?
<Hash_Rocket>
I have much to learn Jedi Masters...Thnx for the help
<JonnieCache>
well assign some of those statements to variables and use them one by one rather than all at once
<shevy>
Hash_Rocket: not really, I think the links are more basic
<JonnieCache>
err no actually thats quite hard isnt it with that code
<i0n>
yea
SeanLazer has joined #ruby
<shevy>
the problem is the conditional inside a []
<JonnieCache>
yes
choffstein has quit [Remote host closed the connection]
<shevy>
it breaks with the default flow of other conditionals...
<shevy>
if foo
<shevy>
or
<JonnieCache>
just have a rethink tbh, because that code is crazy
<shevy>
bla unless ble
Ryan__ has joined #ruby
<shevy>
and not
<shevy>
x = y[z unless b > 5]
<shevy>
hmm could be useful for golfing
ananthakumaran has quit [Ping timeout: 244 seconds]
hashar has quit [Quit: I am a manual virus, please copy me to your quit message.]
cirwin has joined #ruby
ananthakumaran has joined #ruby
khakimov has joined #ruby
deobald_ has quit [Ping timeout: 246 seconds]
jlogsdon has joined #ruby
danielpunt has quit [Remote host closed the connection]
SeanLazer has quit [Ping timeout: 246 seconds]
SeanLazer has joined #ruby
benson has joined #ruby
apok has joined #ruby
ananthakumaran has quit [Ping timeout: 246 seconds]
csmrfx has left #ruby ["bbl"]
kyle__ has left #ruby [#ruby]
bluOxigen has quit [Ping timeout: 244 seconds]
ananthakumaran has joined #ruby
quest88 has joined #ruby
eywu has joined #ruby
mathie has quit [Quit: Sleeping...]
apok has quit [Quit: apok]
thone_ has quit [Remote host closed the connection]
brianpWins has quit [Remote host closed the connection]
thone has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
Vert has joined #ruby
ananthakumaran1 has joined #ruby
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
Vert has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
ananthakumaran has quit [Ping timeout: 255 seconds]
manizzle has quit [Ping timeout: 265 seconds]
peterhellberg has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
manizzle has joined #ruby
hynkle has joined #ruby
Fretta has joined #ruby
keymone has joined #ruby
ttilley_off is now known as ttilley
elsifaka has quit [Quit: Leaving]
chiel has quit [Quit: Changing server]
Hash_Rocket has quit []
htroyack has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
monideep has joined #ruby
Ontolog has quit [Quit: Ontolog]
kaspernj has joined #ruby
<monideep>
hi thre can any one plz help me to run a rails application
niklasb has joined #ruby
npn47 has joined #ruby
<monideep>
when ever i want to start server using rails s it shows kgio gem missing
hoelzro is now known as hoelzro|away
adeponte has joined #ruby
savage- has joined #ruby
gilead has quit [Quit: This computer has gone to sleep]
cirwin has quit [Ping timeout: 248 seconds]
<davidcelis>
monideep: #rubyonrails
macmartine has joined #ruby
Lachryma has joined #ruby
carloslopes has joined #ruby
htroyack has quit []
crankycoder has quit [Remote host closed the connection]
<claudiu>
Mon_Ouie I tried to keep a reference to the old object but after three method calls, when I try to evaluate the script it gives an exception. The script looks like this http://pastie.org/4272483 and I try to evaluate it with JRuby
crankycoder has joined #ruby
b26 has joined #ruby
gilead has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
`brendan has quit [Ping timeout: 246 seconds]
b26 is now known as `brendan
michael2572 has joined #ruby
monideep has left #ruby [#ruby]
advorak has quit [Quit: Leaving]
friskd has quit [Ping timeout: 244 seconds]
axl__ has joined #ruby
TPFC-SYSTEM has joined #ruby
chienpo has joined #ruby
Lachryma has quit [Ping timeout: 244 seconds]
beneggett has joined #ruby
headius has joined #ruby
axl_ has quit [Ping timeout: 250 seconds]
axl__ is now known as axl_
perryh_away has quit [Remote host closed the connection]
<_bart_>
how much times can I expect Ruby to run faster on a powerful server compared to my relatively old mac (2009)
<_bart_>
due to all the regexp'ing and calculating it's now taking 30 seconds to process one document
gokul has quit [Ping timeout: 252 seconds]
<yxhuvud>
how big is that document?
kenichi has joined #ruby
<workmad3>
_bart_: 1 billion times!
und3f has quit [Quit: Leaving.]
the_jeebster has joined #ruby
<_bart_>
yxhuvud: it's a html document, so not that big
<_bart_>
workmad3: really?
<workmad3>
_bart_: sure
<workmad3>
</sarcasm>
<_bart_>
...
<yxhuvud>
but regardless, what ruby are you planning to use? There is a shitton of ruby implementations nowadays with wildly different performance.
<_bart_>
but I noticed the script is taking 99 CPU when I run it so it's really power
<_bart_>
ruby 1.9.3p194
<yxhuvud>
even so, you'd probably be better off figuring out smarter ways of doing things. the compiler can't make a bad algorithm fast.
FireSt0rM has left #ruby [#ruby]
ThaDick has joined #ruby
stkowski has joined #ruby
DrForr has joined #ruby
alindeman has joined #ruby
nilg has joined #ruby
idoru has joined #ruby
`brendan has joined #ruby
carloslopes has joined #ruby
jlogsdon has joined #ruby
emptiness has joined #ruby
randomautomator has joined #ruby
billiam has joined #ruby
i0n has joined #ruby
eywu has joined #ruby
NimeshNeema has joined #ruby
pkondzior has joined #ruby
SeanTAllen has joined #ruby
MoMo has joined #ruby
hemanth has joined #ruby
\13k has joined #ruby
jmccune has joined #ruby
stewart_ has joined #ruby
thatRD has joined #ruby
mwilson_ has joined #ruby
ashp has joined #ruby
Weems has joined #ruby
sei has joined #ruby
Y_Ichiro has joined #ruby
jord has joined #ruby
mahlon has joined #ruby
zaiste has joined #ruby
RubyPanther has joined #ruby
UNIXgod has joined #ruby
rakm has joined #ruby
tightwork has joined #ruby
ahuman has joined #ruby
thorncp has joined #ruby
verto has joined #ruby
rudle has joined #ruby
faulkner has joined #ruby
tris has joined #ruby
offby1 has joined #ruby
bnagy has joined #ruby
c0rn has joined #ruby
tris has quit [Max SendQ exceeded]
apeiros_ has joined #ruby
alindeman is now known as Guest30282
mobilegamelabs has joined #ruby
otters has quit [Quit: WeeChat 0.3.8]
otters has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
banisterfiend has joined #ruby
ThaDick has quit [Quit: zzzZZZ ...]
<eam>
speed gains for a cpu bound single threaded process won't be significant
<eam>
less than an order of magnitude
nopolitica has quit [Quit: Leaving.]
mrsolo has quit [Quit: This computer has gone to sleep]
Draco_ has joined #ruby
mrsolo has joined #ruby
lobak has joined #ruby
cbuxton has joined #ruby
ianbrandt has joined #ruby
mohits has quit [Read error: Connection reset by peer]
jgrevich has joined #ruby
jlogsdon_ has joined #ruby
_bart_ has quit [Ping timeout: 265 seconds]
davidw has quit [Read error: Operation timed out]
elhu has quit [Ping timeout: 250 seconds]
c0rn_ has joined #ruby
blazes816 has quit [Quit: Leaving]
shadoi has joined #ruby
jlogsdon has quit [Ping timeout: 240 seconds]
saschagehlich has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
tris has joined #ruby
bradhe has joined #ruby
vertroa has quit []
kenichi has quit [Read error: Connection reset by peer]
mrsolo has quit [Quit: This computer has gone to sleep]
<withnale>
Has anyone else seen this trying to install rubygem-ruby-debug on fedora17 ? http://pastie.org/4270910
ThaDick has joined #ruby
tris has quit [Excess Flood]
mrsolo has joined #ruby
cbuxton1 has joined #ruby
schaerli has joined #ruby
cbuxton has quit [Ping timeout: 244 seconds]
nocturnal has joined #ruby
kaspernj has quit [Ping timeout: 265 seconds]
brngardner has joined #ruby
<nocturnal>
now I'm no ruby coder but I've deployed an open source rails app. problem is not all the edits I make to the haml views are showing up. even after deleting the tmp/cache dir and seeing it rebuilt. right now it's mysterious because I want to change 30 days to 10 days and I literally can only find one instance of 30 when I grep -Hnr the whole app/views dir tree.
Bosma has joined #ruby
Ontolog has joined #ruby
<nocturnal>
https://pwpush.cygatehosting.se/ the app is there. you see it displays 30 days and 10 views by default. but I don't know where this text is coming from.
<theAlexPoon>
@gogiel: hmm, don't see anything. did an inspect on it too
<gogiel>
maybe it's from method_missing
robert_ has quit [Read error: No route to host]
<gogiel>
debug it ;)
<fowl>
def like(*ces) StringExpression.like(self, *ces) end
<fowl>
i used show-source :hi.like
<nocturnal>
fowl: yeah but in the creation page next to the sliders it still says 30 and 10 when the page loads. but if you move the sliders it switches to the default values I set.
<theAlexPoon>
@gogiel yeah, it has to be..because it gives me an error when I use it out of context of the parameters
<gogiel>
sequel?
<theAlexPoon>
@gogiel yup
Draco_ has quit [Ping timeout: 248 seconds]
hmans has quit [Quit: Leaving...]
kanzeon has quit [Ping timeout: 246 seconds]
bricker88 has joined #ruby
MatthewGA has quit [Ping timeout: 252 seconds]
greasegum has quit [Ping timeout: 244 seconds]
Draco_ has joined #ruby
<fowl>
nocturnal, i checked the source of the page, the input #password_expire_after_days has a default value of 10 but it still says 30
lorandi has quit [Ping timeout: 252 seconds]
<nocturnal>
yeah
<nocturnal>
that's the one I changed
<nocturnal>
no idea why it still shows 30 and 10
<nocturnal>
the sliders are set to the new values though
quest88 has quit [Quit: quest88]
Nies has quit [Read error: Connection reset by peer]
Draco___ has quit [Ping timeout: 250 seconds]
jeff_sebring has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
mrdodo has joined #ruby
voodoofish430 has joined #ruby
<fowl>
nocturnal, you might get more help in #rubyonrails or #ror
<nocturnal>
thanks
<fowl>
or #rails or whatever it is
schaerli_ has joined #ruby
<nocturnal>
#ror redirects
nocturnal has left #ruby [#ruby]
lorandi has joined #ruby
luckman212 has joined #ruby
<saschagehlich>
hey, capistrano question: i defined two tasks, start_app and start_web with conditional roles. but if i do "cap deploy", both tasks are run on all servers (i have two roles with different servers): https://gist.github.com/20f7d0714c10fe5c982d
lorandi has quit [Client Quit]
lorandi has joined #ruby
Osum has quit [Quit: Lost terminal]
schaerli has quit [Ping timeout: 246 seconds]
jonathanwallace has joined #ruby
kevinbond has left #ruby [#ruby]
a_a_g has joined #ruby
blazes816 has joined #ruby
sdwrage has quit [Quit: geekli.st/programmer]
fayimora has joined #ruby
JohnBat26 has joined #ruby
ackz has joined #ruby
JohnBat26 has quit [Client Quit]
JohnBat26 has joined #ruby
luckman212 has quit [Remote host closed the connection]
mathie has joined #ruby
lobak has joined #ruby
tatsuya_o has joined #ruby
beakerman has joined #ruby
Nies has joined #ruby
htroyack has joined #ruby
baphled has joined #ruby
mikepack has joined #ruby
itnomad has quit [Quit: Leaving]
c0rn_ has quit [Quit: Computer has gone to sleep.]
btanaka has quit [Read error: Operation timed out]
internet_user has quit [Remote host closed the connection]
jlogsdon_ has quit [Remote host closed the connection]
tatsuya_o has quit [Ping timeout: 265 seconds]
mucker has quit [Quit: leaving]
jlogsdon has joined #ruby
dinkytoy has joined #ruby
choffstein has joined #ruby
Nies has quit [Ping timeout: 248 seconds]
strife25 has joined #ruby
ramblex_ has joined #ruby
CaptainKnots has joined #ruby
ramblex has quit [Ping timeout: 248 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<axl_>
i have a string and I want to check it it has one of the three possible values say, 'a' , 'b', 'c'
<axl_>
what is an elegant way to check it ?
kenichi has quit [Remote host closed the connection]
<axl_>
or is there a more elegant way to do it than ['a', 'b', 'c'].include? my_string
hd1 has joined #ruby
Eldariof-ru has joined #ruby
ryanf has joined #ruby
mikepack has quit [Remote host closed the connection]
ddv has quit [Read error: Connection reset by peer]
lobak has quit [Quit: No Ping reply in 180 seconds.]
lobak has joined #ruby
npn has joined #ruby
khakimov has joined #ruby
dhruvasagar has joined #ruby
monkegjinni has joined #ruby
dinkytoy has quit [Ping timeout: 245 seconds]
manizzle has joined #ruby
btanaka has joined #ruby
dinkytoy has joined #ruby
<matled>
axl_: I like the %w(a b c) construct for an array of words
kenichi has joined #ruby
<axl_>
k. thanks for the input
cek has quit [Quit: жопа диридай диридиридай]
<fowl>
class Object; def in(arr); arr.include? self; end; end
andoriyu has quit [Quit: This computer has gone to sleep]
king313 has quit [Quit: .]
kenichi has quit [Read error: Connection reset by peer]
kenichi has joined #ruby
<apeiros_>
matled: I prefer %w[a b c]
verto is now known as verto|off
<fowl>
i like %w%a b c%
verto|off is now known as verto
manizzle_ has joined #ruby
htroyack has quit [Excess Flood]
michael2572 has quit [Quit: This computer has gone to sleep]
baphled has quit [Quit: leaving]
baphled has joined #ruby
kenichi has quit [Read error: No route to host]
carlyle has joined #ruby
kenichi has joined #ruby
<fowl>
best way to create a empty string: %%%%%%%
<apeiros_>
% <-- better
schaerli_ has quit [Remote host closed the connection]
baphled has quit [Client Quit]
rbc has joined #ruby
rbc has left #ruby [#ruby]
baphled has joined #ruby
baphled has quit [Client Quit]
fantazo has quit [Remote host closed the connection]
luckyruby has joined #ruby
baphled has joined #ruby
lorandi has quit [Read error: Operation timed out]
baphled has quit [Client Quit]
hd1 has left #ruby [#ruby]
c0rn_ has joined #ruby
lobak has quit [Read error: Operation timed out]
<rakm>
fowl what is going on there? I played with it in irb and not sure what's going on.
<rakm>
a = % => a
<rakm>
a = %% => incomplete statement
lobak has joined #ruby
<rakm>
a = %%% => ""
carlyle has quit [Remote host closed the connection]
<rakm>
..what?
carlyle has joined #ruby
<fowl>
rakm, try %^hi^
friskd has quit [Remote host closed the connection]
<fowl>
cirwin, i didnt realize it was calling % it makes sense now
nopolitica has joined #ruby
EzeQL has joined #ruby
<cirwin>
yeah — kind of cool
lorandi has joined #ruby
dsa has quit [Ping timeout: 272 seconds]
Aaton_off is now known as Aaton
jeff_sebring has quit [Quit: Leaving]
ddv has quit [Changing host]
ddv has joined #ruby
nopolitica1 has joined #ruby
nopolitica has quit [Ping timeout: 248 seconds]
nopolitica1 has quit [Client Quit]
kenichi has joined #ruby
ThaDick has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
baphled has joined #ruby
baphled has quit [Client Quit]
bti has joined #ruby
baphled has joined #ruby
MatthewGA_ has quit [Quit: Leaving]
geoffr has joined #ruby
fayimora has joined #ruby
mdszy has quit [Quit: bye for now]
avandenhoven has joined #ruby
baphled has quit [Client Quit]
<geoffr>
hi all, I'm busy learning ruby and I'd like to add a new method to the Time class, so my question is once I've created an instance of Time (called today) how to I reference the value of today from my new Time method?
kenichi_ has joined #ruby
kenichi has quit [Read error: Connection reset by peer]
bti has left #ruby [#ruby]
<cirwin>
geoffr: if you're calling today.new_method then today is available as "self"
cbuxton1 has quit [Remote host closed the connection]
verto is now known as verto|off
<geoffr>
cirwin: thanks I'll try that
chriskk has joined #ruby
cbuxton has joined #ruby
<geoffr>
sorted :)
verto|off is now known as verto
<fowl>
its like how in python you would call the method new_method(self, args): except you dont have to repeat self for every damn method
internet_user has joined #ruby
fayimora has quit [Client Quit]
<blazes816>
fowl: but explicit is better than implicit. that means Always Repeat Yourself
mxweas_ has quit [Remote host closed the connection]
mxweas_ has joined #ruby
leoncamel has quit [Ping timeout: 246 seconds]
dkr has joined #ruby
sailias has quit [Ping timeout: 248 seconds]
avandenhoven has quit [Quit: avandenhoven]
_bart has joined #ruby
ramblex has joined #ruby
<_bart>
thanks for the info sam and yxhuvud
<_bart>
I'm able to refactor/improve part of the algorithm
<_bart>
but the very core of it is just regexp, regexp and more regexp
<fowl>
best heredoc: <<☃
hmmmm has joined #ruby
<_bart>
also, "puts" is maybe also slowing it down?
<hmmmm>
Hi, can anyone here teach me how to dougie?
<_bart>
haha
<fowl>
lol
<_bart>
please don't play that song
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<hmmmm>
teach me how to dougie teach me teach me how to dougie
hmmmm has left #ruby ["Leaving"]
<_bart>
aahhhhhh
internet_user has quit [Remote host closed the connection]
<dkr>
I'm sorry for this type of dumb question. but does this change look correct? http://pastebin.com/FPGguvCv I just wanted to add to the records array an additional bunch of items. both of the get calls return a var also declared with foo = []
Chaazd has joined #ruby
SeanLazer has quit [Quit: SeanLazer]
blacktulip has joined #ruby
<Chaazd>
Will system("") execute the command in the current directory?
_bart has quit [Client Quit]
<dkr>
I saw some signs on the street yesterday for "dougie the dogwalker"
<Mon_Ouie>
Chaazd: Yes it will
<fowl>
Chaazd, do system("pwd") and find out
mikepack has joined #ruby
<Chaazd>
Thanks
<Mon_Ouie>
dkr: I think you want Array#concat
<Mon_Ouie>
or just Array#+
<fowl>
dkr, all_records is going to look like this [ records, get_otw_bid_wanteds ] so its going to be [ [ ... ], itm ]
Berglund has quit [Quit: Computer died.]
geoffr has quit [Quit: Leaving]
Guerrero has quit [Read error: Connection reset by peer]
Guerrero has joined #ruby
baphled has joined #ruby
<yxhuvud>
bart: well, there are usages of regex and usages of regex. #scan tends to be fast, manually iterating .. not so much
baphled has quit [Client Quit]
ThaDick has quit [Quit: zzzZZZ ...]
<dkr>
I remember looking up concat when I was making this change but can't remember why I didn't use it. I shall look up the docs again. thanks. I feared I was doing someting like that, adding the array rather than the items in the list
baphled has joined #ruby
ROOTloop has joined #ruby
baphled has quit [Client Quit]
<rakm>
dkr you can flatten the whole array at the end too
franckverrot has joined #ruby
Ionic` has joined #ruby
jimeh has quit [Read error: Connection reset by peer]
jimeh2 has joined #ruby
PaciFisT has left #ruby [#ruby]
ROOTloop has quit []
anekos has quit [Ping timeout: 260 seconds]
Bosma has quit [Read error: Connection reset by peer]
ABK has joined #ruby
anekos has joined #ruby
baphled has joined #ruby
hmmmm has joined #ruby
ABK has quit [Read error: Connection reset by peer]
baphled has quit [Client Quit]
<hmmmm>
are you guys ready to bro down and krunch some kode?
Lachryma has quit [Ping timeout: 246 seconds]
Ionic` has quit [Ping timeout: 248 seconds]
baphled has joined #ruby
<davidcelis>
ಠ_ಠ
baphled has quit [Client Quit]
baphled has joined #ruby
pk1001100011 has quit [Remote host closed the connection]
Bosma has joined #ruby
baphled has quit [Client Quit]
pk1001100011 has joined #ruby
mobilegamelabs has joined #ruby
<bricker88>
If I'm just running a script via ruby some_script.rb, how would I stop it from running in a certain case, similar to "return false" in a normal method?
baphled has joined #ruby
Ionic` has joined #ruby
<bricker88>
google turns up about 100 different ways to do it, I just want to know the best or "correct" one whatever that means
imami|afk is now known as banseljaj
sebastorama has joined #ruby
sebastorama has quit [Client Quit]
sebastorama has joined #ruby
ackz has quit [Quit: Leaving...]
baphled has quit [Client Quit]
GoGoGarrett has joined #ruby
baphled has joined #ruby
<eam>
bricker88: you want to stop running and return non-zero? exit 1
schaerli has joined #ruby
ackz has joined #ruby
davidcelis_ has joined #ruby
proby has joined #ruby
baphled has quit [Client Quit]
<Mon_Ouie>
There's also abort "…", so you can do $stderr.puts the_error; exit 1 in a single step
baphled has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
Ionic` has quit [Ping timeout: 240 seconds]
davidcelis has quit [Ping timeout: 248 seconds]
<bricker88>
thanks
ackz has quit [Client Quit]
Jonas__ has joined #ruby
uris has quit [Ping timeout: 252 seconds]
maxmmurphy has joined #ruby
Chaazd has left #ruby [#ruby]
<Jonas__>
I'm trying to evaluate the #'es inside a string later, after the string has been declared, but I can't google-fu out how. Something like: foo = 'Hello #{name}.' ...something happens here... print(foo) Suggestions?
uris has joined #ruby
ackz has joined #ruby
cynosure has quit [Ping timeout: 252 seconds]
<Mon_Ouie>
You can't do that. You could just create the string after that thing happened.
<Mon_Ouie>
Or alternatively, there's String#%
iamjarvo has joined #ruby
Ionic` has joined #ruby
cynosure has joined #ruby
ABK has joined #ruby
Aaton is now known as Aaton_off
<etrnl>
Any reason why I have to manually tell rvm where zlib is located? If I just do "rvm install 1.9.3" gem throw's zlib errors
baphled has quit [Quit: leaving]
<Jonas__>
Mon_Ouie, % looks like just the thing. Would it be possible to feed it the local scope as a hash, like foo = foo % local_scope or something along those lines?
baphled has joined #ruby
hmans has joined #ruby
jimeh2 has quit [Ping timeout: 250 seconds]
<etrnl>
and no wait, it's still not seeing zlib
proby has quit [Quit: Leaving]
Ionic` has quit [Ping timeout: 244 seconds]
choffstein has quit [Remote host closed the connection]
kirun has joined #ruby
<Mon_Ouie>
Jonas__: You can create such a method with some hacks, but I really wouldn't recommend it.
chienpo has left #ruby [#ruby]
\3TATUK has joined #ruby
\3TATUK has left #ruby [#ruby]
baphled has quit [Client Quit]
<Jonas__>
It seems like a problem that would crop up now and then, like when loading trusted strings from a file or something.
baphled has joined #ruby
pk1001100011 has quit [Remote host closed the connection]
mistergibson has joined #ruby
ThaDick has joined #ruby
sdwrage has joined #ruby
<mistergibson>
Question: I want to extend String in 1.9.3 a bit. I'm not sure if I should erect a façade method 'bytes_with_index' or what. I am starting out with a very basic custom Enumerator class, and wanted to get some insights. Any favorite URLs on the inner workings of Enumerators is welcome. thanks in advance :)
pk1001100011 has joined #ruby
andoriyu has joined #ruby
Ionic` has joined #ruby
Ionic` has quit [Read error: Connection reset by peer]
pk1001100011 has quit [Remote host closed the connection]
mpereira has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
<Hanmac>
mistergibson: use each_byte.with_index
tvw has quit [Remote host closed the connection]
<Jonas__>
Figured out, foo = eval("\"#{foo}\"") works, though it's not pretty :)
<Mon_Ouie>
I'd prefer to use gsub, passing only the needed vars in the replacement hash
ThaDick has joined #ruby
<Hanmac>
Jonas__ eval is evil ... try to avoid it
<mistergibson>
yeah eval is huge security problem
<Jonas__>
Yeah, there are obvious security issues, but in this case I can trust the string
internet_user has joined #ruby
<Jonas__>
Otherwise % would have been the way to go
andoriyu_ has joined #ruby
ben_alman has left #ruby ["Adios!"]
ben_alman has joined #ruby
<workmad3>
why choose eval over string formatting?
DrForr has quit [Ping timeout: 240 seconds]
<workmad3>
hell, why not just foo.to_s?
* workmad3
missed the start of the conversation
<Morkel>
does anyone know how i can use the gems from my Gemfile with pry?
<Jonas__>
I'm defining the string before I have access to the variables
<fowl>
workmad3, thankfully irc-time is linear so just scroll up
<workmad3>
fowl: hard to scroll up to a point before you joined the channel though
<fowl>
touche
andoriyu has quit [Ping timeout: 250 seconds]
ryan0x2 has quit [Remote host closed the connection]
lorandi has quit [Quit: Leaving]
<workmad3>
Morkel: add pry to your gemfile, or open up a pry console and then do 'require "bundler/setup" '
<Mon_Ouie>
It's not just about trust. It means those strings are tightly bound to the variables you use in that chunk of code. With the other solutions you can have a clear way of selecting what can be accessed from the string.
DrForr has joined #ruby
<mistergibson>
Hanmac: I think I need to use my custom enumerator (it provides me some non-blocking stuff w/ eventmachine)
<Morkel>
workmad3: Thanks
<mistergibson>
I think I can just get the base enumerator and hit each on the custom enumerator repeatedly
Norrin has joined #ruby
jimeh2 has joined #ruby
pk1001100011 has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
vertroa has joined #ruby
Eldariof-ru has quit []
greasegum has joined #ruby
explody has quit [Ping timeout: 252 seconds]
Norrin has quit [Quit: Deuces!]
CharlieSu has left #ruby [#ruby]
mpereira has joined #ruby
bluOxigen has joined #ruby
Bofu has joined #ruby
keymone_ has joined #ruby
SQLStud has quit [Quit: Leaving]
greasegum has left #ruby [#ruby]
matled- has joined #ruby
ThaDick has left #ruby [#ruby]
hoelzro|away is now known as hoelzro
xbayrockx1 has joined #ruby
chiel has joined #ruby
undersc0re has joined #ruby
Freijo has joined #ruby
klipeto has joined #ruby
Drakx_ has joined #ruby
Yugo has joined #ruby
piggybox_ has joined #ruby
Freddie has joined #ruby
jimeh2 has quit [*.net *.split]
c0rn_ has quit [*.net *.split]
strife25 has quit [*.net *.split]
stkowski has quit [*.net *.split]
pting has quit [*.net *.split]
keymone has quit [*.net *.split]
andrewhl has quit [*.net *.split]
fearoffish has quit [*.net *.split]
jsime has quit [*.net *.split]
franckverrot has quit [*.net *.split]
piggybox has quit [*.net *.split]
octarine has quit [*.net *.split]
minijupe has quit [*.net *.split]
dotemacs has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
Axsuul has quit [*.net *.split]
matled has quit [*.net *.split]
Ethan has quit [*.net *.split]
balki_ has quit [*.net *.split]
alanp has quit [*.net *.split]
punkrawkR has quit [*.net *.split]
nahhh has quit [*.net *.split]
mfridh has quit [*.net *.split]
Drakx has quit [*.net *.split]
Tearan has quit [*.net *.split]
banghouse has quit [*.net *.split]
Whoop has quit [*.net *.split]
Boffers has quit [*.net *.split]
Cork has quit [*.net *.split]
shikamaru has quit [*.net *.split]
Fraeon has quit [*.net *.split]
jhchabran has quit [*.net *.split]
xbayrockx has quit [*.net *.split]
dawtcawm has quit [*.net *.split]
kstephens has quit [*.net *.split]
Corey has quit [*.net *.split]
thedonvaughn has quit [*.net *.split]
klip has quit [*.net *.split]
ePirat has quit [*.net *.split]
musl has quit [*.net *.split]
akl has quit [*.net *.split]
novochar has quit [*.net *.split]
ged has quit [*.net *.split]
keymone_ is now known as keymone
matled- is now known as matled
jsime_ has joined #ruby
piggybox_ is now known as piggybox
caveat- has quit [Remote host closed the connection]
<fowl>
ugh flooders
Cork has joined #ruby
alanp has joined #ruby
Corey_ has joined #ruby
DrForr has quit [Ping timeout: 246 seconds]
Wh00p has joined #ruby
<Jonas__>
yeah, *.net *.split is such a rude bastard
banghouse has joined #ruby
dawtcawm has joined #ruby
sdwrage has quit [Quit: geekli.st/programmer]
Yugo is now known as ePirat
stkowski has joined #ruby
hashar is now known as hasharCall
jhchabran has joined #ruby
<etrnl>
having the hardest time with rvm on ubuntu 11.04
shikamaru has joined #ruby
strife25 has joined #ruby
dawtcawm is now known as Guest54658
ryannielson has quit [Quit: ryannielson]
<etrnl>
wtf
<etrnl>
now it works
Corey_ is now known as Corey
<etrnl>
had to implode rvm and refetch
c0rn_ has joined #ruby
balki has joined #ruby
nanderoo has quit [Quit: Leaving.]
thedonvaughn has joined #ruby
akl has joined #ruby
andrewhl has joined #ruby
<etrnl>
Only thing I can gather is that I may not have had zlib installed initially so rvm wouldn't recognize it regardless since it may have been installed before zlib
jimeh2 has joined #ruby
Axsuul has joined #ruby
pting has joined #ruby
Tearan has joined #ruby
minijupe has joined #ruby
novochar has joined #ruby
arturas has joined #ruby
octarine has joined #ruby
franckverrot has joined #ruby
Norrin has joined #ruby
ryan0x2 has joined #ruby
CaptainKnots has quit [Quit: bazinga!]
Spaceghostc2c has joined #ruby
crankycoder has quit [Remote host closed the connection]
mfridh has joined #ruby
yoklov has joined #ruby
dotemacs has joined #ruby
havenn has joined #ruby
musl has joined #ruby
ged has joined #ruby
kstephens has joined #ruby
mistofvongola has joined #ruby
<shevy>
yeah, by default the debian based distributions lack the zlib header files
mdickens has joined #ruby
rowanu has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
<Hanmac>
shevy because the zlib dev is normaly not needed
<etrnl>
I even installed a local zlib through rvm and pointed to that
<etrnl>
still wouldn't see it
<etrnl>
only thing I can gather I said above, I must have installed zlib after I installed rvm
Spooner has quit [Ping timeout: 248 seconds]
CaptainKnots has joined #ruby
khakimov has joined #ruby
TheShadowFog has quit [Read error: Connection reset by peer]
robert_ has joined #ruby
mdszy has joined #ruby
tvw has joined #ruby
Norrin has quit [Quit: Deuces!]
mistofvongola has quit [Quit: WeeChat 0.3.7]
Norrin has joined #ruby
davidw has joined #ruby
davidw is now known as Guest86402
dhruvasagar has quit [Ping timeout: 248 seconds]
Asher has quit [Ping timeout: 248 seconds]
TheShadowFog has joined #ruby
nkrinner_home has joined #ruby
hasharCall is now known as hashar
tatsuya_o has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
nahhh has joined #ruby
Aaton_off is now known as Aaton
kvirani has quit [Remote host closed the connection]
Poapfel has joined #ruby
robert_ has quit [Read error: No route to host]
jmccune has left #ruby [#ruby]
und3f has joined #ruby
schaerli_ has joined #ruby
dhruvasagar has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
schaerli_ has quit [Remote host closed the connection]
dankest has joined #ruby
Wh00p is now known as Whoop
Whoop has quit [Changing host]
Whoop has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
burgestrand has joined #ruby
mistergibson has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
choffstein has joined #ruby
claudiu has quit [Quit: Konversation terminated!]
<shevy>
Hanmac: but this gets decided by the developers of the distribution. what if I always want to have it installed? when I install from source, I get all header files too
<shadoi>
shevy: this is a very common practice, and comes from the days when every byte was important so packages were split into logical pieces to be able to conserve space on embedded systems, etc.
Helius has joined #ruby
hynkle has quit []
<shadoi>
Now.. it's not such a big deal, it's just a relic.
mxweas_ has joined #ruby
<shadoi>
Arguments could be made about reducing the information available for would-be malicious users also.
<shevy>
hmm how to best read in a file? File.read("/tmp/test.txt") ?
<shadoi>
I use open('filename').read usually
<shevy>
hmm ok
fbernier has quit [Ping timeout: 246 seconds]
<shevy>
that's shorter than File.readlines(i).join("\n") and probably faster too
lobak_ has joined #ruby
<shadoi>
block form is nice also, to ensure closing.
<shevy>
what about File.read(i) btw? is that different from the open().read variant?
<shadoi>
shevy: they're both equivalent, I just use open because I normally do something besides just read the file.
<shevy>
aha ok
<shevy>
work in the kitchen? :)))
<shadoi>
heh
<fowl>
open().read() leaves the file open you newb
<shadoi>
fowl: dude, read what I said.
<fowl>
why would you even suggest that
<shevy>
his IRC nick is program ;)
<shevy>
funniest thing was when he trolled zenspider on #ruby-lang
sepp2k has joined #ruby
Guest86402 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
strife25 has quit [Ping timeout: 248 seconds]
<Norrin>
i've installed using rvm and i'm trying to find out where it is getting the code for gems i request
<fowl>
gems default repos is rubygems.org
geekbri has quit [Remote host closed the connection]
hoelzro is now known as hoelzro|away
<Norrin>
i'm using a lib (or gem?) i found on github, which happens to be availble using rvm's gem script, but noticed the version the gem script is giving me is different from what i've found on github...
<Norrin>
fowl, how do i check / change that?
<fowl>
Norrin, i dont believe there are other repositories
<Norrin>
there's no configuration options available for the gem utility?
<Norrin>
seems weird of rubygems.org is hardcoded in the source....
kanzeon` has quit [Remote host closed the connection]
kanzeon` has joined #ruby
mdickens has quit [Ping timeout: 248 seconds]
jsime_ has quit [Quit: Leaving]
cjlicata has quit [Remote host closed the connection]
bglusman has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
kanzeon` has quit [Remote host closed the connection]
minijupe has quit [Quit: minijupe]
kanzeon` has joined #ruby
andrewhl has quit [Remote host closed the connection]
ringotwo has joined #ruby
kanzeon` has quit [Remote host closed the connection]
kanzeon` has joined #ruby
iamjarvo has joined #ruby
sailias has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
Asher has joined #ruby
the_jeebster has quit [Quit: Leaving.]
Gavilan has joined #ruby
Aaton is now known as Aaton_off
blacktulip has quit [Remote host closed the connection]
npn47 has joined #ruby
mdpatrick has quit [Quit: mdpatrick]
kanzeon` has quit [Remote host closed the connection]
kanzeon` has joined #ruby
andrewhl has joined #ruby
andrewhl has quit [Remote host closed the connection]
Aaton_off is now known as Aaton
npn has quit [Ping timeout: 246 seconds]
RedEyeZ88 has joined #ruby
IceDragon has joined #ruby
<RedEyeZ88>
Hello all, was wondering if someone would help a n00b with a simple string manipulation
Asher has quit [Ping timeout: 250 seconds]
<RedEyeZ88>
and also potential first ruby script
<davidcelis>
?
<RedEyeZ88>
So, to explain: I have a folder with a constant set of file names, and I want to rename those files but keep the extension. So far, I have done okay on the renaming part simply because its a simple .gsub. But, Im getting stuck with spacing.
kpshek has quit []
dizzdiamonds has joined #ruby
<RedEyeZ88>
So for an example, I have a string that says "My first name is Bob"
<RedEyeZ88>
What I want to do is change that "first" to "f", remove the space, and then repeat this for every file in the folder
banisterfiend has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
<RedEyeZ88>
so far in irb, I have "My first name is Bob".gsub('first', ' f ')
<RedEyeZ88>
so thats making it "My f name is Bob"
<RedEyeZ88>
but how would i remove the space between f and name?
<blazes816>
"My first name is Bob".gsub('first ', ' f ')
<RedEyeZ88>
Ive tried to look through the docs, but I'm finding .lstrip and .rstrip
<blazes816>
wait, what exactly are you trying to do?
<RedEyeZ88>
ok
<blazes816>
you put the space in there
kanzeon` has quit [Remote host closed the connection]
<RedEyeZ88>
I'm trying to remove a space
<RedEyeZ88>
between f and name
kanzeon` has joined #ruby
<blazes816>
"My first name is Bob".gsub('first', ' f')
<RedEyeZ88>
after change "first" to "f
<blazes816>
actually
<RedEyeZ88>
right, but doesn't that keep the spacing?
<blazes816>
you have change "first" to " f ".
<RedEyeZ88>
right
<blazes816>
so take out the space to make it " f"
<blazes816>
and then the space won't be there
<blazes816>
if you need to take out the space already there
Asher has joined #ruby
<blazes816>
then, add it to the matcher like the first like I had
<RedEyeZ88>
can you type that out? so you are saying: "My first name is Bob".gsub("first" , "f")
ajsmith has quit [Ping timeout: 248 seconds]
<RedEyeZ88>
that changes the first to f, but the spacing remains
<RedEyeZ88>
right
<blazes816>
yes
<RedEyeZ88>
okay, but to remove the space
<blazes816>
"My first name is Bob".gsub("first " , "f")
<RedEyeZ88>
ok
banisterfiend has joined #ruby
<blazes816>
so, "first " will be replaced, instead of "first"
<RedEyeZ88>
ooh
<RedEyeZ88>
sweet
<blazes816>
but I think you maybe wanting regular expressions
<RedEyeZ88>
yeah
<RedEyeZ88>
so
<RedEyeZ88>
I have a folder of a few pictures, i created it so i could sorta learn how to script
<RedEyeZ88>
I'm just learning ruby bc i want to continue to rails
jonathanwallace has joined #ruby
<RedEyeZ88>
anyway
<davidcelis>
good on you for learning ruby first
<RedEyeZ88>
If i have something that says Family Image Album1picture1
Araxia has quit [Read error: Connection reset by peer]
ramblex has quit [Quit: ramblex]
c0rn_ has quit [Quit: Computer has gone to sleep.]
Araxia has joined #ruby
thecreators has quit [Quit: thecreators]
kanzeon`` has quit [Ping timeout: 265 seconds]
saschagehlich has quit [Quit: saschagehlich]
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
c0rn_ has joined #ruby
dizzdiamonds has quit [Quit: dizzdiamonds]
Asher1 has quit [Ping timeout: 244 seconds]
GarethAdams has joined #ruby
GarethAdams has quit [Client Quit]
GarethAdams has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
ken_barber has quit [Remote host closed the connection]
ringotwo has joined #ruby
tvw has quit [Remote host closed the connection]
kirun has quit [Quit: Client exiting]
pk1001100011 has joined #ruby
zastaph has quit []
rakm has joined #ruby
KindOne has joined #ruby
justsee is now known as justsee|away
piotr_ has quit [Ping timeout: 265 seconds]
xaq has quit [Remote host closed the connection]
uris has quit [Quit: leaving]
mneorr has quit [Quit: Leaving.]
sdwrage has quit [Read error: Connection reset by peer]
justsee|away is now known as justsee
dinkytoy has quit [Read error: Connection reset by peer]
justsee has quit [Quit: Leaving...]
jamesaxl has joined #ruby
nopolitica has joined #ruby
bowlowni has quit [Remote host closed the connection]
dinkytoy has joined #ruby
Aaton is now known as Aaton_off
hadees has joined #ruby
justsee has joined #ruby
justsee has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 252 seconds]
seanstickle has joined #ruby
htroyack has left #ruby [#ruby]
jjang has joined #ruby
carloslopes has quit [Quit: Leaving.]
krusty_ar has quit [Quit: No Ping reply in 180 seconds.]