<seanstickle>
Using "1" as the initial value, and the * method as the means of reduction
<seanstickle>
Your earlier example could be recast (5..10).reduce(0, :+)
<novochar>
is the .inject(initial) the step?
ianbishop has quit [Quit: Lost terminal]
<novochar>
the initial in .inject(initial)
<novochar>
that wouldn't make sense with (5..10).reduce(0, :+) though
<seanstickle>
It sets the default value of the accumulator, in your example named "sum"
<heftig>
the forms without "initial" use the first value as the starting value of the accumulator, and start iterating with the second value
richo has joined #ruby
cherrypeel has quit [Quit: Leaving]
itnomad has quit [Ping timeout: 245 seconds]
<dekz>
anyone know of a faster shortcut way of going from base64 -> urlsafe_base64 -> base64 without having to do full encodes and decodes?
vladiim has quit [Quit: vladiim]
ramblex has quit [Quit: ramblex]
jhunter has quit [Ping timeout: 252 seconds]
jxf has quit [Read error: Connection reset by peer]
ZachBeta has joined #ruby
l2trace99 has joined #ruby
jxf has joined #ruby
jhunter has joined #ruby
liluo has quit [Remote host closed the connection]
vladiim has joined #ruby
itnomad has joined #ruby
kah_ has joined #ruby
<kah_>
I have a string encapsulated in brackets and quotes.. if I just wanted the text in the middle how could I do that? ["A"]
l2trace99 has quit [Quit: Leaving]
l2trace99 has joined #ruby
<Spooner_>
kah_ : You mean ["A"].first or you mean via a regexp?
josefig has quit [Quit: Computer has gone to sleep.]
itnomad has quit [Quit: Leaving]
keymone_ has joined #ruby
itnomad has joined #ruby
<kah_>
anyone?
kah_ has quit [Quit: Leaving]
kah_ has joined #ruby
keymone has quit [Ping timeout: 260 seconds]
keymone_ is now known as keymone
peindt has joined #ruby
niku4i has quit [Remote host closed the connection]
jxf has quit [Read error: Operation timed out]
peindt has quit [Client Quit]
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby
tiripamwe has quit [Ping timeout: 245 seconds]
<dekz>
kah_: you need to specify a little more
<dekz>
kah_: does Spooners response answer your question?
jgrevich has quit [Read error: No route to host]
jarred has joined #ruby
<kah_>
dekz: I didn't see Spooners response
jgrevich has joined #ruby
Synthead has quit [Read error: Connection reset by peer]
<jarred>
Within a class that's inside a module, how do I call methosd from different gems? It assumes that the class is within the same namespace. For example, if the class calling the method is A, the module is B, and the gem is C, then It's running B::A::C, but I just want it to invoke the method on C
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<jarred>
(Wow, that grammar was horrible)
hakunin has quit [Read error: Connection reset by peer]
<Spooner_>
kah_: I suspect you mean regexp: '["A"]' =~ /\["(\w+)"\]/; $1
hakunin has joined #ruby
igaiga has joined #ruby
<Spooner_>
jarred : gems don't have namespaces in that way. They might have modules or classes in them, but there isn't a standard "gem" way to call them. Can you give a better example?
<jarred>
Spooner: I'm trying to run RestClient.post inside a class that's within a module. It thinks I'm trying to call ModuleName::ClassName::RestClient, when I just want RestClient
<kah_>
Spooner_: I do, I would like to pull all of the alphabet characters from a string
<Spooner_>
You just do RestClient.post in that case, jarred.
beilabs has quit [Disconnected by services]
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]
skinny_much has joined #ruby
<Spooner_>
RestClient is a module in the gem, which contains a method.
beilabs has joined #ruby
beilabs has quit [Disconnected by services]
<jarred>
Spooner_: The error is: "uninitialized constant ModuleName::ClassName::RestClient (NameError)"
Zol has quit [Ping timeout: 252 seconds]
beilabs__ has joined #ruby
<Spooner_>
kah_ : Well, that would do it, but if you just want alphabet specifically, you can do '["Abcd"]' =~ /\["([A-Za-z]+)"\]/; $1 #=> "Abcd"
<jarred>
Spooner_: and I'm calling RestClient like so: "RestClient.post url do ..."
Zol has joined #ruby
<Spooner_>
That is because it tries to look in the class for it and can't find it, but it will also have looked in the global namespace and not found it there. That means you probably haven't required the gem?
sepp2k has joined #ruby
<jarred>
oh I see. I required RestClient in a parent file
robotmay has quit [Remote host closed the connection]
<Spooner_>
That shouldn't be a problem, jarred, as long as it was required before you try to access RestClient module.
iocor has quit [Quit: Computer has gone to sleep.]
sam113101 has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
emmanuelux has quit [Read error: No route to host]
<Spooner_>
jarred : Try putting require 'rest_client' just before you use RestClient, just to make sure.
<Spooner_>
If that works, then you aren't requiring rest_client before you are trying to use it.
<Spooner_>
What, you did mean an array, not a string. Oops! Try: a = ["Abcd"]; a[0]
EzeQL has quit [Ping timeout: 255 seconds]
dr_Poggs has quit [Ping timeout: 240 seconds]
liluo has joined #ruby
alek_b has joined #ruby
drPoggs has joined #ruby
malias has joined #ruby
gtuckerkellogg has joined #ruby
TheFuzzball has quit [Quit: Leaving...]
ZachBeta has quit [Quit: Computer has gone to sleep.]
dsa has quit []
savage- has joined #ruby
apok has quit [Quit: apok]
<dekz>
Haha Spooner_!
<dekz>
kah_: you have an array there, Spooner thought you meant a string represented array like '["a"]' not an Array construct. You should be able to access the contents using any Array operations, a[0], a.first etc.
chaingun has joined #ruby
<dekz>
kah_: That will give you the string element inside the array (at the first position) obviously, but if you want "A" then "B" then "c" individually you can also access the string like an array, something like a[0][0]
<kah_>
yeah, I hear you.. I'm trying to fix this error
<offby1>
platzhirsch: interesting question; I can't think of a really simple way to do it.
<offby1>
"inject" won't help because its block doesn't get passed the index, and you probably can't count on the block being called on the array's elements in order.
<offby1>
deryl: or one who doubles as a doctor
<platzhirsch>
offby1: well max and index is just fine I think
TheHunter_1039 has quit [Ping timeout: 260 seconds]
<ryanf>
kah_: it is impossible to know from what you just pasted
<fowl>
call `read` on d
<kah_>
ryanf: sorry, d is a csv filed from a url
<kah_>
and ok thkx
<kah_>
one other quick question. I have rows = Nokogiri::HTML(open(URL)).css('table.sortable tr')[1..-1] .. URL is a URL... what does [1..-1] mean? ascending?
ZachBeta has joined #ruby
<ryanf>
it means leave out the first one
<ryanf>
[0..-1] would be all of them
<fowl>
rYaNf [[da F is for FReaK]]
havenn has quit [Remote host closed the connection]
<fgwaegeawgfwa>
Does anyone have a clear understanding of the practical difference between Separation of Concerns and Single responsibility principle? (I've already googled it, and read the 10 first pages about that topic, but still...)
<richo>
and yaeh, I upgraded but it hasn't annoyed me yet
Bosma has quit [Quit: leaving]
savage- has quit [Remote host closed the connection]
<banisterfiend>
y did u upgrade
<richo>
there was meant to be an update to it's search algorithm, I wanted to try it
ringotwo has joined #ruby
<banisterfiend>
cool
<richo>
plus tbh it's probably worth the $20
<banisterfiend>
speedier?
<richo>
much
<eph3meral>
richo, my question is not about how to document my own code, rather I want a nicely/sanely formatted set of ruby docs that I can download... is there something like that for ruby? or must I use the online references only?
<banisterfiend>
eph3meral: type rvm help it should tell u
<eph3meral>
ahh ok i'll go poke around thanks
<richo>
oh. Maybe I forgot doing that
<richo>
I'll add that to the default on RVM though
<richo>
not generating docs is a stupid default
perryh is now known as perryh_away
ananthakumaran has joined #ruby
<banisterfiend>
eph3meral: but, i of course just use pry instead of ri :) it gives u access to core/stdlib (with pry-doc) and can return docs for gems without requiring docs to be pregenerated :P
sailias has quit [Ping timeout: 248 seconds]
ringotwo has quit [Ping timeout: 244 seconds]
<richo>
wait what
<richo>
since when?
yankhates is now known as tankhates
<eph3meral>
banisterfiend, ahh, ok well that might be a good reason to finally try it
<richo>
I've only been using pry as an introspective debugger
<banisterfiend>
richo: since always, pretty muh
<richo>
D:
<eph3meral>
i hear it's nicer than irb, but I haven't bothered to mess with it yet
austinbv has joined #ruby
<austinbv>
can you give prereqs to a file task in rake
<banisterfiend>
richo: really? you dont even use it as an irb replacement?
<richo>
banisterfiend: I rarely if ever start irb. irb is pissed off with readline wchih makes line editing very awkward for me
<banisterfiend>
richo: pry can also show core source (C code), so u can go: show-source Array#sort_by
macmartine has joined #ruby
CalvinR has left #ruby [#ruby]
<richo>
if I have a proof of concepty type thing, I generally write it, stick a few binding.pry's in at key points and then commit the finished file to my ruby-hax repo
<richo>
so I have a bunch of proof of concepts for interesting things/edge cases
indian has joined #ruby
<richo>
I read about show-source at one point and promptly forgot. I'm still pretty annoyed with the whole gem ecosystem, so the "use a gem, find out it doesn't work, fork and fix" workflow is pretty much daily
<richo>
That's awesome. Note to self, use pry more
<banisterfiend>
richo: you need to gem install pry-doc to get access to core doc/source though
<richo>
I installed it before when you mentioned it :)
Aaton is now known as Aaton_off
<banisterfiend>
pry will automatically detect and use pry-doc if it finds it though, so u dont have to bother with it once it's installed
hemanth has joined #ruby
mayankkohaley has quit [Ping timeout: 264 seconds]
robotmay has quit [Remote host closed the connection]
<dekz>
anyone a master of relational db in datamapper?
Ethan has quit [Ping timeout: 272 seconds]
silentpost has quit [Ping timeout: 265 seconds]
<banisterfiend>
eph3meral: let me know if pry + pry-doc works for u, does what u want etc
<eph3meral>
banisterfiend, yeah that works
<eph3meral>
banisterfiend, I'm really looking for something a bit more navigable though, ideally HTML
<eph3meral>
but yeah, within pry
<eph3meral>
ri Array#map
<eph3meral>
and ri Array
<eph3meral>
both seem to work
<banisterfiend>
eph3meral: hmm ok, i think using show-doc Array#map inside pry is nicer
<banisterfiend>
eph3meral: or ? Array#map for shorthand
<banisterfiend>
it uses a different technique to extract docs, show-doc/? is more flexible IMO
<eph3meral>
ahh, indeed, purty colors :P
<banisterfiend>
well, hehe, not just that, it always extracts docs from the source on demand each time, so it doesnt require you to have installed the ri/rdocs separately
macmartine has quit [Read error: Connection reset by peer]
macmartine has joined #ruby
h4mz1d has quit [Ping timeout: 245 seconds]
frishi has quit [Quit: Leaving...]
freeayu has quit [Ping timeout: 255 seconds]
lolsuper_ has quit [Ping timeout: 260 seconds]
Jackneill has joined #ruby
<richo>
ok, this is properly shiny
h4mz1d has joined #ruby
blankverse has quit [Quit: Page closed]
freeayu has joined #ruby
jimmy1980 has quit [Ping timeout: 244 seconds]
alanp has quit [Read error: Connection reset by peer]
balki has quit [Write error: Broken pipe]
balki has joined #ruby
IrishGringo has joined #ruby
demet8 has left #ruby [#ruby]
k_89 has quit [Ping timeout: 240 seconds]
zalesz has quit [Ping timeout: 246 seconds]
macmartine has quit [Quit: macmartine]
hunglin has quit [Quit: Leaving.]
austinbv has quit [Ping timeout: 244 seconds]
krz has joined #ruby
emmanuelux has quit [Remote host closed the connection]
vladiim has quit [Quit: vladiim]
ananthakumaran has quit [Read error: Connection reset by peer]
<deryl>
banisterfiend: ? Kernel fails, but ri Kernel works
<richo>
deryldoucette?
<deryl>
? Kernel doesn't show the kernel docs, but ri Kernel in pry does. so its not dropping down to ri if ? fails to find any docs
seanfchan has joined #ruby
<banisterfiend>
deryl: can you paste the docs? cos 'ri Kernel' doesn't actually show me any docs, it just shows a list of methods. I don't think Kernel is documented
<deryl>
sec
<banisterfiend>
but it could just be my setup
<SirFunk>
is there a name for how you can do things like: "<<: *defaults" in yaml?
ceradon has quit [Read error: Connection reset by peer]
<deryl>
banisterfiend: i think you're right. I was reading additional but thats because ri was pulling anyhting with the word Kernel in it as well.
<deryl>
like activesupport etc
<banisterfiend>
deryl: oh ok
<deryl>
but the _Kernel_ related (specific doc) was all the methods
krusty_ar has quit [Remote host closed the connection]
<deryl>
but ? Kernel didn't even show taht
ceradon_ has joined #ruby
ceradon_ is now known as ceradon
<banisterfiend>
deryl: Yeah, show-doc only shows the docs, it doesn't bother to show a list of methods since you can get that with the 'ls' command
<deryl>
ok
<banisterfiend>
deryl: it seems 'ri' always shows both docs + methods
<deryl>
got ya
<banisterfiend>
deryl: which may be a useful option to show-doc
<banisterfiend>
to include a list of methods, coudl be handy i guess
L-----D has joined #ruby
<deryl>
yeah a fast dump
austinbv has joined #ruby
andreime has joined #ruby
adeponte has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
<banisterfiend>
deryl: i see you were quite active on the gist issue threads
<Paradox>
up till now
<Paradox>
i've used sublimetext2's gist plugin for my gistification
<deryl>
banisterfiend: i share TONS of stuff I do using gist
<Paradox>
i love gists
<Paradox>
single-file scripts and stuff?
<Paradox>
why waste a repo for "junk" when gists are essentially all you need
<Paradox>
also work as a pastebin
<deryl>
I use it for sharing code with others, doing things in pry and gisting them to show users trying to do stuff, get help with my own code, help RVM users etc
<deryl>
rather convenient core tool
td123 has quit [Quit: WeeChat 0.3.8]
<Paradox>
banisterfiend, so jist works with pry
<cirwin>
it will do for the next version
<cirwin>
at the moment we depend on gist, but it's not very working
hemanth has quit [Read error: Connection reset by peer]
<bnagy>
that makes no sense
RainbowDashh has joined #ruby
hemanth has joined #ruby
<bnagy>
you'll get whatever the last key in your keyarray gives me, assuming it doesn't raise before then
<SirFunk>
bnagy: makes perfect sense to me
h4mz1d has joined #ruby
<SirFunk>
i think
<SirFunk>
testing it now
<bnagy>
why would you use soe of the key array p front and then the last one at the end? It's retarded
Sgeo has joined #ruby
<SirFunk>
so that you can set it
<SirFunk>
otherwise it just returns the value
<bnagy>
then use a key vector that's one shorter
Sgeo has left #ruby [#ruby]
<bnagy>
or use *keys,to_set=%w(a b c d e); keys.inject(h,:[])[to_set]=new
<bnagy>
so at least it's halfway readable
indian has quit [Ping timeout: 260 seconds]
<SirFunk>
to_set can't be an array though?
perryh_away is now known as perryh
<Paradox>
i had someone claim that ruby sucked because it didnt have a dictionary splat like python did
<bnagy>
SirFunk: to_set will be the last element of your array
<Paradox>
i just told him to opts = {} and do what you want
<cirwin>
Paradox: real keyword arguments are kind of nice
<cirwin>
which I guess that's a symptom of
<Paradox>
cirwin, yeah i wouldn't mind a ** splat
<Paradox>
but i dont miss it
<bnagy>
'e' in this case
<cirwin>
opts = args.pop if args.last.is_a?(Hash) :)
<SirFunk>
bnagy: oh! nice. I didn't know what *keys did :-P
umttumt has joined #ruby
<bnagy>
magic splat
jianxioy has joined #ruby
<bnagy>
it's a bit of a cheap syntax trick
<Paradox>
aka syntax sugar
<Paradox>
depends on who you ask
macmartine has quit [Quit: macmartine]
<Paradox>
heh
<bnagy>
no I just meant in this csae
ananthakumaran has joined #ruby
<bnagy>
there are times when splt is perfect for the job
uc has quit [Ping timeout: 248 seconds]
<bnagy>
here to_set=ary.pop; ary.inject ...[to_set]='foo' would have been more readable probably
<bnagy>
but it's one more statement
jxf has quit [Ping timeout: 255 seconds]
uc has joined #ruby
manizzle has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<SirFunk>
can someone look at: https://gist.github.com/3b7d3d3b77b9c9ec685e quick and see if there's a way to make it simpler? i.e. not having the keys.inject stuff 3x? (should i just make a function of it?)
h4mz1d has quit [Ping timeout: 248 seconds]
<Paradox>
yes
vladiim has quit [Quit: vladiim]
<Paradox>
if you use something more than 2x you should make it into a method
ckrailo has quit [Quit: Computer has gone to sleep.]
<bnagy>
don't need to here though
<SirFunk>
is there some way to do like a = keys.inject(Settings.get('instance'),:[])[to_set] and then like hold a pointer to it instead of returning the value.. so i could do a.class or a.update or a = ?
<bnagy>
you're working on the same item three timers, just assign that item to a variable
monkegjinni has joined #ruby
<SirFunk>
bnagy: but then if i later do a='foo' it won't change it on the original hash
<Paradox>
cirwin, i presume your trick of `stty -echo` doesn't work on windows platforms?
<cirwin>
Paradox sadly not
<bnagy>
SirFunk: yeah it will
<Paradox>
damnit
<cirwin>
hence the rescues :)
<Hanmac>
a = keys.inject(Settings.get('instance'),:[])
<Hanmac>
a[to_set]=value
<Paradox>
was hoping i didnt have to use highline for my simpler scripts
<Paradox>
ah well
<bnagy>
if it's a hash anyway
<cirwin>
Paradox: in python I'd just use the standard library </trollin'>
<Paradox>
yeah ಠ_ಠ
<cirwin>
Paradox: yeah
<bnagy>
if it's a string you probably need to do replace
<SirFunk>
Hanmac: ahh, that would cut down on it some
<cirwin>
I figured that having a password echoed once was not too bad
<Paradox>
hopefully one day ruby will have a better stdlib
<cirwin>
though no doubt I'll get complaints
<Paradox>
its already pretty good
<cirwin>
I thought they were moving away from stdlibrary work
<Paradox>
what sets ruby apart is the third party shit is SOOOOO much better than the python crap
<Paradox>
probably are
<cirwin>
and encouraging the use of manygems
Gurpartap has joined #ruby
<cirwin>
yeah
<Paradox>
sad part is
<Paradox>
for things like image processing
<Paradox>
you have about 900 choices
atmosx has quit [Ping timeout: 276 seconds]
<Paradox>
and none of them are as good as python's Image
<Gurpartap>
Can blocks be called in context of when they are .call'd (later on)?
<cirwin>
Gurpartap: I think you can pass a block to eval
<cirwin>
probably possible to do something like binding.eval(&block)
<cirwin>
but I might have made that up
<bnagy>
no that's right
<bnagy>
not sure about the actual syntax, but that's what you have to do
atmosx has joined #ruby
banseljaj is now known as imami|afk
jarred has quit [Ping timeout: 260 seconds]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<Gurpartap>
i see
<Gurpartap>
thanks cirwin. i'll let you know how it gos
<Gurpartap>
and thanks bnagy, as usual :)
<bnagy>
in general, if you're doing that it's a bad design smell
<ParadoxQuine>
how do i pass params to my controller when using rspec?
Nies has quit [Quit: Saliendo]
<bnagy>
blocks are supposed to carry their binding, that's what they're for
<bnagy>
if you need a block to use some different variable, make it a block var
<Paradox>
ParadoxQuine, depends on the type of request
<SirFunk>
ok. must hit bed.. wakeup time is in 4 hrs
<SirFunk>
thanks for the help
<Paradox>
get or post or delete
<Paradox>
or other verbage
<ParadoxQuine>
Paradox: trying to test delete, so i assume it's doing a post
<Paradox>
delete ≠ post
<Paradox>
delete = delete
<Paradox>
im not sure and i dont have my copy of pragmatic rails lying around
<Paradox>
might be a better question for #rails
<Hanmac>
nope its #rubyonrails
TheHunter_1039 has joined #ruby
TheHunter_1039 has quit [Client Quit]
gibsonfs has quit [Ping timeout: 255 seconds]
<Paradox>
that
TheHunter_1039 has joined #ruby
<ParadoxQuine>
oh no wonder no one was responding in #rails
<ParadoxQuine>
thanks Hanmac
TheHunter_1039 has quit [Client Quit]
RainbowDashh has quit [Quit: SLEEP MODE. <REDACTED SUBORBITAL QUOTE HERE>]
gibsonfs has joined #ruby
ebanoid has joined #ruby
samuel02 has joined #ruby
brianpWins has joined #ruby
jarred has joined #ruby
vladiim has joined #ruby
banisterfiend has quit [Remote host closed the connection]
<Gurpartap>
bnagy: the block would be called later during runtime though, instead of during it's collection from args in my init method. i'll try it a bit to make my mind clear about whether passing variable would have desired result
yonggu_ has joined #ruby
adeponte has joined #ruby
banisterfiend has joined #ruby
<bnagy>
Gurpartap: everyone turns into a bit of an idiot when they first start metaprogramming
<bnagy>
there are so many ways to do stuff it's hard to see the 'right' way
<richo>
bnagy: Nope, there's exactly one "right" way to do it, and that way is the preferred method of whoever you ask
<richo>
and everything else is bloody heresy
<Gurpartap>
bnagy: haha :p
<Gurpartap>
my best way's that i know. :p
ciopte7 has joined #ruby
sleetdrop has joined #ruby
williamcotton has quit [Quit: williamcotton]
h4mz1d has joined #ruby
manizzle has quit [Read error: No route to host]
<Hanmac>
preferred method ? ... so if everyone use eval, because they dont know it better, is eval then the right way? oO
manizzle has joined #ruby
nowthatsamatt has left #ruby [#ruby]
<Gurpartap>
for the time being, since they would be aware that they need something better later
seitensei has joined #ruby
<Gurpartap>
that's why we'll have ruby 2.0 :p
<richo>
Hanmac: My point was that metaprogramming is so subjective that any argument culminating in the "best" way is pointless
<richo>
the only reasonable way to discuss it is with specific pros and cons to any given approach and a judgement call made at implementation time
jarred has quit [Read error: Connection reset by peer]
havenn has joined #ruby
wallerdev has quit [Quit: wallerdev]
hemanth has quit [Read error: Connection reset by peer]
brianpWins has quit [Quit: brianpWins]
hemanth has joined #ruby
Synthead has quit [Remote host closed the connection]
h4mz1d has quit [Ping timeout: 250 seconds]
imami|afk is now known as banseljaj
Bosma has joined #ruby
tvw has joined #ruby
maesbn has quit [Remote host closed the connection]
<austinbv>
anyone have anyexperience with mocha and zombie
maesbn has joined #ruby
RainbowDashh has joined #ruby
timonv has quit [Remote host closed the connection]
senny has joined #ruby
Niamkik has joined #ruby
freezey has joined #ruby
seitensei has quit [Remote host closed the connection]
fantazo has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
gtuckerkellogg has joined #ruby
h4mz1d has joined #ruby
<banisterfiend>
Paradox: what's a jimmi
<Paradox>
banisterfiend, a jimmy is the state
<Paradox>
of being trolled
<Paradox>
if a jimmy is rustling or has been rustled
<Paradox>
someone has been trolled
L-----D has quit [Quit: Leaving]
LowKey has joined #ruby
<Paradox>
so, p trolled if jimmies.rustled?
vladiim has joined #ruby
<otters>
postfix if is difficult to write
ceradon has joined #ruby
<Paradox>
but elegant to read
brianpWins has joined #ruby
<otters>
yeah
RainbowDashh has joined #ruby
<Paradox>
reads like english
andrewhl has quit [Remote host closed the connection]
<Paradox>
probably the reason why so many goddamn DSLs use it
<otters>
I usually put a modifier before the phrase if I'm going to use postfix if though
<otters>
"only do xyz if abc"
<fowl>
otters, try finding a good use for postfix while/until
andreime has joined #ruby
<otters>
otherwise prefix if really makes more sense
<Paradox>
my favorite is rescue ArgumentError unless (1..100).include? derp
<Paradox>
or something similar
<Paradox>
otters, i didnt know about the only trick
quest88 has quit [Quit: quest88]
<otters>
"only" doesn't exist in ruby
<Paradox>
aw shucks
<otters>
I mean, that was a phrase in english
wargasm has quit [Read error: Connection reset by peer]
<Paradox>
didnt think it did
<otters>
you could define it as id
<Hanmac>
but rescue false is evil
<otters>
my favorite construct is while with no body
<otters>
or for with no body
<Paradox>
Hanmac, yeah, but makes bulletproof methods
h4mz1d has quit [Ping timeout: 272 seconds]
<Hanmac>
the problem is that is even resuce fatal stuff
wargasm has joined #ruby
ph^ has joined #ruby
<Paradox>
well you can invert it
LowKey has quit [Quit: changing servers]
<fowl>
() until false
<Paradox>
if this do method shit else rescue
<Paradox>
but :/
jprovazn has joined #ruby
LowKey has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
Morkel has joined #ruby
<shevy>
lol
qwerxy has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
austinbv has quit [Ping timeout: 265 seconds]
hemanth has joined #ruby
kaisukaru has joined #ruby
brianpWins has quit [Ping timeout: 255 seconds]
austinbv has joined #ruby
<kaisukaru>
What would be faster than ObjectSpace.each_object(Class)?
Criztian has joined #ruby
<Hanmac>
i think its a bad way in general ...
<Hanmac>
kaisukaru: what do you want?
wvdschel has joined #ruby
<Tasser>
might anyone explain to me why nokogiri outputs ì in an xml document?
<kaisukaru>
Hanmac: I need to know what classes are defined, and I need this to be fast (I am asking it more than once)
HaikuUser has joined #ruby
<Tasser>
... and not é
TPFC-SYSTEM has joined #ruby
brianpWins has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
jimeh has joined #ruby
ciopte7 has quit [Quit: ciopte7]
prometheus has quit [Ping timeout: 272 seconds]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
Ethan has joined #ruby
h4mz1d has joined #ruby
<cirwin>
Tasser: serialize(:encoding => 'utf-8')
<Tasser>
cirwin, apparently nokogiri messes stuff up nontheless here :-/
<cirwin>
grumbledore
tonini has joined #ruby
<Hanmac>
Tasser, show me your code
<Tasser>
hmm, unicode fail I assume
bbuegler1 has quit [Quit: Leaving.]
<HaikuUser>
Hello. Where can I read how "require" exactly works? It is very weird to me that modules and classes in the required file do appear in the current ns and variables don't :\
banseljaj is now known as imami|afk
vectorshelve has joined #ruby
iocor has joined #ruby
jgrevich has quit [Quit: jgrevich]
<Tasser>
... apparently not
<Paradox>
HaikuUser, you can look at the source
<ryanf>
HaikuUser: top-level variables are basically "script local"
hoelzro|away is now known as hoelzro
<ryanf>
but ruby doesn't really have namespacing, so constants in files that you require will always be available
<HaikuUser>
"Script local"? Does it mean that these variables should be garbage-collected after file is loaded?
<vectorshelve>
hemanth: hai bhai
<Paradox>
take a look yourself
<HaikuUser>
Paradox, thanks
<Paradox>
its in lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb @ line 34:
h4mz1d has quit [Ping timeout: 245 seconds]
<cirwin>
Paradox: I'm not sure the scoping rules are there
<Paradox>
cirwin, i just did show-source require
<cirwin>
so I see :)
workmad3 has joined #ruby
<cirwin>
all the real juice is in gem_original_require
<Paradox>
yup
<Paradox>
but he wanted to see how require worked
<Paradox>
not gem_original_require
<cirwin>
ah
<Paradox>
lol
ickmund has quit [Quit: ickmund]
ickmund has joined #ruby
monkegjinni has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
manizzle has quit [Read error: No route to host]
yxhuvud has joined #ruby
<shevy>
HaikuUser what kind of variables? local variables like "foobar" can't be defined in other modules
<shevy>
you could have a constant
<shevy>
gaaaah it is raining and I have to leave here now... :(
adeponte has quit [Remote host closed the connection]
<HaikuUser>
shevy, I meant usual local variables. I know that I can use constants, but I'm just trying to understant rationale behind ruby behaviour :)
zommi has joined #ruby
manizzle has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
<Paradox>
HaikuUser, makes more sense than a lot of other ways
<Paradox>
esp @@
hakunin has quit [Read error: Connection reset by peer]
<Paradox>
@@ is so damn useful if you use it right
hakunin has joined #ruby
havenn has joined #ruby
schaerli has joined #ruby
<ryanf>
most people try to avoid @@ actually
<ryanf>
afaict
* cirwin
agrees with ryanf
<cirwin>
class-level @vars are supremely superiour
<ryanf>
the main reason being that it has annoying behavior in class hierarchies
<ryanf>
yep
<davidcelis>
and cmon
<davidcelis>
@@this_shit_is_ugly
<Paradox>
i know
schaerli has quit [Remote host closed the connection]
<davidcelis>
@@my_mother_never_loved_me
<Paradox>
but recently i wrote an irc relay that used 2 threads of the same class
<cirwin>
wubino: local variables inside files don't get into the pry console
<hoelzro>
wubino: I'm not a Ruby expert, but I'm pretty sure photos is local to that file
<cirwin>
you'd have to use a global $photos = []
<cirwin>
or define a method; def photos; []; end
Eldariof-ru has quit []
<wubino>
thank you both
bbuegler1 has quit [Quit: Leaving.]
<wubino>
$photos worked
roolo has joined #ruby
<cirwin>
woot
<wubino>
does it need to be explicit in the script $photos or can I just call it?
cantonic has joined #ruby
<wubino>
explicit int he script I jsut tried it
qwerxy has quit [Quit: offski]
wvdschel is now known as ssspiff
Eldariof-ru has joined #ruby
timonv has joined #ruby
vlad_starkov has joined #ruby
<wubino>
can I turn a hash into an instant object ( with reflection maybe??) ?
ryanf has quit [Quit: leaving]
ParadoxQuine has quit [Quit: ParadoxQuine]
<hoelzro>
wubino: you mean so you can say h.foo instead of h['foo']?
<banisterfiend>
wubino: Yeah, load it up through OpenStruct.new(hash)
wpaulson_ has joined #ruby
mockra has joined #ruby
<tramm>
i'm trying localisation of date/time on ruby with i18n. do i really need to hardcode link to lang.yml in order to enable I18n.l(Time.now, :format => "%a") or alike? my code: http://pastebin.com/yiPY19BL
<wubino>
hoelzro: yes
iocor has quit [Quit: Computer has gone to sleep.]
<hoelzro>
wubino: see what banisterfiend said
<hoelzro>
banisterfiend: that's a neat trick; I'll have to remember that =)
<banisterfiend>
its not so good really
<hoelzro>
oh? why not?
mockra has quit [Remote host closed the connection]
* tramm
doesn't know any ruby, but thought localization would be built in somehow
skinny_much has joined #ruby
gilead has joined #ruby
bbuegler has joined #ruby
heftig has joined #ruby
<banisterfiend>
hoelzro: cos you end up with an openstruct :)
<wubino>
banisterfiend: works great, thanks
wpaulson has quit [Ping timeout: 245 seconds]
wpaulson_ is now known as wpaulson
jamesaxl has joined #ruby
<wubino>
anyway to pull up a list of all the nonstandard methods on an object?
<banisterfiend>
wubino: inside pry you mean?
<banisterfiend>
and what on earth is nonstandard? :)
<wubino>
nonstandard meaning not inherited from the standard library
<banisterfiend>
wubino: ls -m obj, in pry
<wubino>
in pry I tab twice and I can get thousands of methods on some objects
wargasm has quit [Ping timeout: 244 seconds]
<wubino>
how can I get just the self.methods ?
ipoval has quit [Quit: ipoval]
<banisterfiend>
wubino: i just told u
<banisterfiend>
wubino: listen to what i say, or ill cut u
<banisterfiend>
wubino: ls -m obj
<wubino>
banisterfiend: I did but I got the OpenStruct#methods too
<wubino>
banisterfiend: I admit its better then the normal way
<banisterfiend>
wubino: well it tells u which is which :) i think we show both because it's generally more useful, and since showing openstruct's doesn't get in the way, why not ? :)
charliesome has joined #ruby
<icy`>
hi, is there an easier way to step through an array, two elements at a time? I was doing 0.step(ar.size-1, 2) {|ind| <do stuff with ar[ind] and ar[ind+1]> } but this feels ugly
<banisterfiend>
icy`: though maybe u want each_cons(2)
<Hanmac>
array.each_slice(2)
* icy`
nods
<icy`>
that's the one =)
BiHi has joined #ruby
perryh is now known as perryh_away
<icy`>
i keep forgetting to look at the enumerable module when browsing array methods ;P
<icy`>
thanks
Guest41099 has joined #ruby
freezey has left #ruby [#ruby]
igaiga has joined #ruby
CheeToS has quit [Ping timeout: 265 seconds]
|ivan| has quit []
|ivan| has joined #ruby
ciopte7 has joined #ruby
ssspiff has quit [Remote host closed the connection]
igaiga has quit [Remote host closed the connection]
BeLucid_ has quit [Remote host closed the connection]
neku has joined #ruby
smoochict has joined #ruby
ssspiff has joined #ruby
iori has quit [Remote host closed the connection]
rakunHo has joined #ruby
<smoochict>
Hello
dr0p has joined #ruby
mengu has joined #ruby
ephemerian has joined #ruby
BeLucid has joined #ruby
zz_chrismcg is now known as chrismcg
tvw has quit [Ping timeout: 272 seconds]
tatsuya_o has joined #ruby
Criztian has quit [Remote host closed the connection]
yonggu_ has quit [Remote host closed the connection]
yonggu has joined #ruby
nipra has quit [Read error: Operation timed out]
rakunHo_ has joined #ruby
rakunHo has quit [Ping timeout: 260 seconds]
nipra has joined #ruby
iocor has joined #ruby
monkegjinni has joined #ruby
cirwin has quit [Ping timeout: 255 seconds]
Floydzy has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<bbuegler>
hello
<smoochict>
hi bbuegler
<bbuegler>
hey there
<smoochict>
how come no one else is talking? lol
<bbuegler>
well i don't know
<bbuegler>
probably because there is no interesting question around
<smoochict>
it's a ghost town lol
<smoochict>
take a look at #python, so active compared to here
maletor has joined #ruby
francisfish has joined #ruby
dr0p has quit [Remote host closed the connection]
dekroning has joined #ruby
freeayu has quit [Ping timeout: 245 seconds]
apeiros_ has joined #ruby
<hemanth>
vectorshelve, yo
pk1001100011 has joined #ruby
Progster has joined #ruby
bbuegler has quit [Quit: Leaving.]
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
atmosx has quit [Ping timeout: 276 seconds]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
freeayu has joined #ruby
atmosx has joined #ruby
|ivan| has quit []
cousine has joined #ruby
bambanx has joined #ruby
<bambanx>
hi
<smoochict>
hi
<bambanx>
guys how i can compare time example, time.now compared if is < to other time ?
kaisukaru has quit [Ping timeout: 255 seconds]
<Hanmac>
time1 < time2 ?
<bnagy>
mark=Time.now #do stuff p TIme.now - mark
<bambanx>
yeah
<bambanx>
i mean
<bambanx>
my problem is how i can assign time to a variable , for example my Time.now is 2012-06-25 05:23:37 -0400 if i wanna assign 7pm to a variable a for example
<bambanx>
p Time.now
<bambanx>
a = "2012-06-25 05:23:37 -0400"
<bambanx>
p Time.now < a
<bambanx>
is not work
<bambanx>
i should parse it?
<bnagy>
a is a String there
<bnagy>
read the docs for Time and find out how you can make Times out of Strings
<bnagy>
from memory, new, strftime ...
<bnagy>
you might also want to look at DateTime - it has a really easy to get along with parse method
<bambanx>
ok
<bnagy>
DateTime.parse '19:00'
qwerxy has joined #ruby
bbuegler has joined #ruby
darthdeus has joined #ruby
umttumt has quit [Remote host closed the connection]
<banisterfiend>
what are ppls styles for git commit messages here? how many chars do you allow yourself on the first line?
gibsonfs has quit [Ping timeout: 255 seconds]
robotmay has joined #ruby
Guest41099 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
gibsonfs has joined #ruby
flype has joined #ruby
<wubino>
how do I return only the keys for a hash?
<apeiros_>
hash.keys
<apeiros_>
I know, this must be very surprising :-p
<wubino>
how do I find the type of an object?
<apeiros_>
wubino: `ri Hash` in your console (bash/shell, not irb) shows you all methods for the class Hash
<Hanmac>
object.class
<wubino>
Thats what I thought but i must not be working with a hash
schovi has joined #ruby
<wubino>
Hanmac: thanks that it
igaiga has joined #ruby
<bnagy>
banisterfiend: personally, 50
<apeiros_>
beware, some classes are evil and delegate .class (ActiveRecord/Rails is a notorious offender)
<bambanx>
this give me false all time , (DateTime.parse("6:30pm") .. DateTime.parse("6:40pm")).cover?(DateTime.parse("6:35pm")) Hanmac
<bambanx>
sorry this:
<bambanx>
range = DateTime.parse("6:00am") .. DateTime.parse("6:10am")
<bambanx>
p range.include?(Time.now)
umttumt has joined #ruby
bluenemo has quit [Ping timeout: 240 seconds]
<Hanmac>
bambanx ... depend on your time zone ... try range.cover?(Time.now)
<bambanx>
false Hanmac
<sepp2k>
Don't mix Time and DateTime.
<sepp2k>
They're not comparable to each other.
<Hanmac>
sepp2k in cover? they are
bhuey has joined #ruby
<bhuey>
if I'm using Kernel.system("ls", n) where n is a string how can I deal with paths that have whitespace in them and have it quoted correctly by that shell command
<bhuey>
?
robotmay has quit [Remote host closed the connection]
<hoelzro>
I thought system already did that...
* hoelzro
checks the docs
<hoelzro>
well, I mean that it properly handles quotes by passing the list of args directly to exec()
<bhuey>
I'm getting something bizzare
banisterfiend has quit [Read error: Connection reset by peer]
<hoelzro>
bhuey: oh?
bbuegler2 has joined #ruby
<bhuey>
I have a list of pathnames that are quoted with %Q btw
<sepp2k>
hoelzro: I don't think he wants to do one ls call on them all.
<hoelzro>
it's the splat operator
<bhuey>
sepp2k: correct, one at a time
* bhuey
goes wtf
umttumt has quit [Remote host closed the connection]
<hoelzro>
oh, that's fine too
<bhuey>
never heard of that
<hoelzro>
$lines.each_line do |line| system('ls', line) end
<hoelzro>
does each_line including the newline at the end?
* bhuey
googles for the splat op
<sepp2k>
hoelzro: That's what he's doing now, that doesn't work because of the newline at the end
<bhuey>
hoelzro: will that work as well ?
<hoelzro>
sepp2k: ah, thanks
liuchong has quit [Quit: Leaving]
<hoelzro>
bhuey: you'll probably need to chomp the line before passing it to ls
bluenemo has joined #ruby
<bhuey>
ok
<bhuey>
damn that blows
<sepp2k>
bhuey: Do what you're doing now, but call .chomp on the filename to remove the newline. And use each_line instead of each for 1.9 compatibility.
KDr2 has quit [Remote host closed the connection]
<sepp2k>
Or use .split("\n").each
<bhuey>
chomp just removes the very last character ?
KDr2 has joined #ruby
<hoelzro>
if it's a newline
<sepp2k>
Or use an array of strings to begin with. That would be ["file name 1", "file name 2"]
<bhuey>
ok
<bhuey>
sepp2k: it's printed out as a text file that I'm converting over to a scrtip
<bhuey>
script
<bhuey>
love you guys
<bhuey>
thanks :)
<sepp2k>
Note that the version with the splat would have called ls once with all the filenames as arguments.
<bambanx>
sleep 1 = one second ?
<bhuey>
would have spent hours trying to figure this out
<bhuey>
sepp2k and hoelzro thanks guys
<Hanmac>
bambanx ... i knew why my code is not working ... its becuse of the f**king offset :/
<sepp2k>
And what the splat does is to turn an array into a list of arguments, i.e. system("ls", *array) == system("ls", array[0], array[1], ..., array[-1])
<bambanx>
lol
<bhuey>
bad thing about unicode and and ruby on OS X is that it doesn't work right
<bambanx>
gn thanks Hanmac , bnagy
bambanx has quit [Quit: Saliendo]
<bhuey>
I wish I had a newer Ruby
<bhuey>
sepp2k: that's cool
<bhuey>
didn't know that it existed
<smoochict>
bhuey, get RVM and install 1.9.3
* Hanmac
has the newest ruby as system package
ramblex has quit [Quit: ramblex]
zii has joined #ruby
* bhuey
installs a newer version of 'git'
KDr2 has quit [Ping timeout: 272 seconds]
schaerli has joined #ruby
bosphorus has joined #ruby
mpereira_ has quit [Ping timeout: 255 seconds]
mohits has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
* bhuey
really loves Ruby as a scripting language
<bhuey>
I get so much dirty work done in it without much fuss
<Paradox>
its perl++
<Hanmac>
sepp2k but i get still offset Problems
<Paradox>
thats why its so awesome
<vectorshelve>
When will windows 8 be released ?
cousine has quit [Remote host closed the connection]
gyre007 has joined #ruby
<bhuey>
install 1.9.2 or 1.9.3 ?
neku has quit [Ping timeout: 272 seconds]
<bhuey>
which is the latest stable stuff ?
<apeiros_>
1.9.3-p194
<bhuey>
I just install it using a plain 1.9.3 on OS X
<Paradox>
and 194 is just a security patch on rubygems
<bhuey>
ok
<apeiros_>
Paradox: no
<Paradox>
well there are a few other things
<apeiros_>
p194 is the patchlevel of ruby. not rubygems.
workmad3 has joined #ruby
<Paradox>
i know
<Paradox>
but that particular patch didnt do much outside rubygems
<apeiros_>
it's also not only security related fixes. it contains bugfixes as well.
<apeiros_>
Paradox: compared to what?
<Paradox>
i dont know
<Paradox>
the booze is starting to wear off and im starting to get tired
<Paradox>
lol
<apeiros_>
he didn't ask for the differences between the latest and the second latest patch.
ankakusu has joined #ruby
b26 has quit [Remote host closed the connection]
Foxandxss has joined #ruby
apok has quit [Quit: apok]
<zii>
Has anyone here embedded mri into his C app?
heftig has quit [Ping timeout: 245 seconds]
umttumt has joined #ruby
cousine has joined #ruby
nari has quit [Ping timeout: 245 seconds]
BiHi has quit [Quit: Computer has gone to sleep]
cousine has quit [Remote host closed the connection]
<ankakusu>
Hi! I want to split the words in a string. I'm doing this by the following code:
<ankakusu>
splitStr = str.split(/\b/)
freeayu has quit [Ping timeout: 245 seconds]
liluo has quit [Remote host closed the connection]
<ankakusu>
is it a nice way to split the words? or do you suggest any other way?
iocor has quit [Ping timeout: 255 seconds]
dr_diamond has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<bnagy>
if you want just the words, scan /\w+/
<bnagy>
is traditional, anyway
Guedes has joined #ruby
<bhuey>
ok night
<bhuey>
and thanks again hoelzro and sepp2k
bhuey has left #ruby [#ruby]
ph^_ has joined #ruby
<banisterfiend>
sepp2k: do u like our organization logo: https://github.com/pry (the gravatar at top left)
<ankakusu>
ok. thanks bnagy.
iocor has joined #ruby
iocor has quit [Changing host]
iocor has joined #ruby
ben_m has joined #ruby
ph^ has quit [Ping timeout: 246 seconds]
wpaulson has quit [Ping timeout: 250 seconds]
kah_ has quit [Ping timeout: 260 seconds]
freeayu has joined #ruby
<sepp2k>
banisterfiend: Looks fine. Though it kinda looks as if the P-cube was just softly leaning against the crowbar - it doesn't look as if any prying is going on :p
ryanw has left #ruby ["God gave us Rock 'n' Roll, but Satan gave us Heavy Metal!"]
hyperboreean has quit [Ping timeout: 272 seconds]
hyperboreean has joined #ruby
iocor has quit [Ping timeout: 250 seconds]
<zii>
HA~!
<zii>
What's ruby_sysinit for?
<banisterfiend>
sepp2k: yeah ,there's more prying in the official logo i think: http://pry.github.com
jekhokie has joined #ruby
iocor has joined #ruby
Lachryma has joined #ruby
wpaulson has joined #ruby
Criztian has joined #ruby
Darkfang has joined #ruby
havenn has quit [Remote host closed the connection]
ramblex has joined #ruby
<Darkfang>
Hi. Has anyone noticed noticed the horrible performances issues of Rby doc > 1.9.2 (vs 1.8.x) ?
<banisterfiend>
Darkfang: wtf is Rby doc
<banisterfiend>
never heard of Rby doc
<Darkfang>
ruby doc / rdoc sorry
<banisterfiend>
Darkfang: u mean during gem installation? i think most ppl turn it off
apincombe has joined #ruby
<Darkfang>
I'm building my own Ruby module (from C) and building doc for users. It used to take ~30s and now takes over 10 minutes
<banisterfiend>
Darkfang: what's your ruby module called?
<Darkfang>
It's not available online. It's generated code for parsing/dumping databases
d3vic3 has joined #ruby
<Darkfang>
It's about 100 classes and 4k methods alltogether
eurek has quit [Quit: Computer has gone to sleep.]
<Paradox>
yardoc is better than rdoc anyway :p
Foxandxss has joined #ruby
freeayu has quit [Quit: 离开]
tk___ has joined #ruby
ZachBeta has joined #ruby
d3vic3 has quit [Ping timeout: 246 seconds]
fgwaegeawgfwa has left #ruby [#ruby]
apincombe has quit [Remote host closed the connection]
d3vic3 has joined #ruby
iocor has quit [Ping timeout: 245 seconds]
bier has quit [Ping timeout: 248 seconds]
atmosx has quit [Ping timeout: 276 seconds]
Progster has quit [Ping timeout: 260 seconds]
iocor has joined #ruby
mdaisuke_ has joined #ruby
flype has quit [Ping timeout: 252 seconds]
mayankkohaley has quit [Ping timeout: 250 seconds]
mdaisuke has quit [Ping timeout: 245 seconds]
flype has joined #ruby
mdaisuke_ has quit [Ping timeout: 248 seconds]
jekhokie has quit [Quit: Leaving]
frishi has joined #ruby
atmosx has joined #ruby
wpaulson has quit [Ping timeout: 245 seconds]
wpaulson has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
bier has joined #ruby
mwilson_ has quit [Excess Flood]
beilabs_ has quit [Ping timeout: 260 seconds]
mwilson_ has joined #ruby
beilabs__ has quit [Ping timeout: 265 seconds]
<zii>
Any idea how to trace where is method defined?
<zii>
Tired of resultless grepping.
<apeiros_>
obj.method(:name).source_location
<workmad3>
zii: you can do it with pry, or you can (in, 1.9) do 'some_obj.method(:method_name).source_location'
<apeiros_>
only works for methods defined in ruby
<workmad3>
apeiros_: :)
<zii>
Nice.
<apeiros_>
and yes, pry makes the whole thing easier: `$ obj.methodname` and `? obj.methodname`
ZachBeta has joined #ruby
chrislgibson has joined #ruby
nanderoo has joined #ruby
deryl has quit [Quit: deryl]
carloslopes has joined #ruby
<wubino>
any good reads on developing / running rails apps locally
<wubino>
locally => for local machine use in lieu of gui programming
<apeiros_>
wubino: #rubyonrails
BiHi has joined #ruby
indian has quit [Ping timeout: 240 seconds]
liluo has joined #ruby
beilabs__ has joined #ruby
_md has quit [Quit: Leaving...]
<Paradox>
i just threw out all my local documentation and got 6 gb back
eurek has joined #ruby
<Paradox>
jesus
hemanth has quit [Read error: Connection reset by peer]
beilabs_ has joined #ruby
hemanth has joined #ruby
<ankakusu>
Suppose I have a hash such as: game = [ [ "hede", "x" ], [ "hodo", "y" ] ] and I want to check whether the key value is equal to "x" or "y". Do you have any idea to do this?
chintanparikh has joined #ruby
<apeiros_>
that's not a hash
indian has joined #ruby
<apeiros_>
hashes are those things with the curly braces: {"hede" => "x", "hodo" => "y"}
<chintanparikh>
Hey everyone. Is it possible to create a ruby script (say hello.rb) that's accessible by typing `hello` in the command line?
<hoelzro>
chintanparikh: just call it hello
<apeiros_>
chintanparikh: sure. as with every other language
<hoelzro>
and set your shebang line appropriately
<apeiros_>
and chmod it correctly
<workmad3>
chintanparikh: call it 'hello' add a shebang, chmod +x it and add '.' to your PATH
<ankakusu>
apeiros_ ok. Lets say (key,value) pair. Thanks for correction.
<workmad3>
chintanparikh: or put it in a dir already in your PATH
RainbowDashh has quit [Read error: No route to host]
RainbowDashh has joined #ruby
mayankkohaley has joined #ruby
tommyvyo has joined #ruby
atmosx has joined #ruby
Cork has joined #ruby
bem has joined #ruby
cakehero has joined #ruby
bem has quit [Remote host closed the connection]
k_89 has quit [Ping timeout: 260 seconds]
bem has joined #ruby
tvw has joined #ruby
cuppsy has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
awarner has quit [Remote host closed the connection]
jxf has joined #ruby
crankycoder has joined #ruby
mwilson_ has quit [Excess Flood]
liluo has quit [Remote host closed the connection]
mwilson_ has joined #ruby
iocor has joined #ruby
jrist-afk is now known as jrist
dv310p3r has joined #ruby
b26 has joined #ruby
rorider has joined #ruby
KDr2 has joined #ruby
<rorider>
join #rubyonrails
<rorider>
oops
<rorider>
x)
tzvi has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
<bem>
Hello, I'm looking to implement an oauth2/xauth service provider. I've been looking around the web for an *active* project, but hvae been unable to find this (most proejcts haven't been updated for months or years). Am I missing something , or will I have to write my own OAuth 2 provider (seems somewhat crazy…)? Thank you...
the_jeebster has joined #ruby
iamjarvo has joined #ruby
igaiga has quit [Remote host closed the connection]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
Sgeo_ has left #ruby [#ruby]
mwilson_ has joined #ruby
bbuegler has joined #ruby
bbuegler has quit [Client Quit]
gianlucadv has quit [Ping timeout: 272 seconds]
y2h4ck has quit [Quit: Leaving]
shevy has quit [Ping timeout: 260 seconds]
kedare has joined #ruby
nari has quit [Ping timeout: 248 seconds]
eurek has quit [Quit: Computer has gone to sleep.]
chintanparikh has left #ruby [#ruby]
skinny_much has quit [Quit: Leaving...]
DanBoy_ has joined #ruby
atmosx has quit [Quit: Changing server]
jgrevich has joined #ruby
atmosx has joined #ruby
indstry has joined #ruby
atmosx has quit [Client Quit]
atmosx has joined #ruby
JStoker has joined #ruby
bbuegler has joined #ruby
selvakumaran has quit [Ping timeout: 264 seconds]
chson has joined #ruby
rook_flood has joined #ruby
dr_diamond has quit [Quit: Bye !]
bem has quit [Quit: bem]
shevy has joined #ruby
plastics has joined #ruby
delinquentme has joined #ruby
EzeQL has joined #ruby
<delinquentme>
when using RVM ... what shows up with "gem list" are those files which should be made available through using require 'rubygems'
<delinquentme>
right?
undeclaredx has quit [Disconnected by services]
kevinbond has joined #ruby
<Spooner>
delinquentme you only need to require 'rubygems' in 1.8.7, but yes, those are the available gems for that version of Ruby
eurek has joined #ruby
<delinquentme>
so ive got require 'rubygems'
<delinquentme>
and verified that a gem is installed
<delinquentme>
however its unavailable when i specifically attempt to include it with " require 'bio' "
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
alup has quit [Ping timeout: 246 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
<banisterfiend>
delinquentme: sounds like bundler retardation
vlad_starkov has joined #ruby
carlyle has joined #ruby
TheHunter_1039 has joined #ruby
<novochar>
i'm wanting to make something like a pointer to another variable
lorandi has quit [Ping timeout: 252 seconds]
<novochar>
that is, i have an array and i don't like it's name
flip_digits has joined #ruby
blast_hardcheese has quit [Ping timeout: 248 seconds]
<novochar>
i want to change it from i_of to iof
<novochar>
i was wanting to do i_of = iof
<novochar>
but i think it's complaining because iof hasn't been declared
<hoelzro>
novochar: do you mean iof = i_of?
niklasb has joined #ruby
<Hanmac>
pointer? ... ruby does not have some kind of pointer
uris has joined #ruby
`gregorg` has quit [Changing host]
`gregorg` has joined #ruby
rakunHo has joined #ruby
`gregorg` is now known as gregorg
wallerdev has joined #ruby
zii is now known as herro87
awarner has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
herro87 has quit [Quit: WeeChat 0.3.8]
z1 has joined #ruby
z1 is now known as herro87
vlad_starkov has joined #ruby
rakunHo_ has quit [Ping timeout: 260 seconds]
pu22l3r has joined #ruby
herro87 is now known as s8
<shevy>
delinquentme normally when this gem is installed, and shows up in the gem list, requiring it works. perhaps RVM is being silly
blast_hardcheese has joined #ruby
s8 has quit [Changing host]
s8 has joined #ruby
Caius has quit [Ping timeout: 252 seconds]
pradeepto has quit [Remote host closed the connection]
<shevy>
novochar you can "alias" a variable to another variable. x = y = [1,2,3]
<shevy>
and when you modify one, you modified the same object
<shevy>
so it is a "pointer"
ananthakumaran has quit [Quit: Leaving.]
<Spooner>
shevy everything in Ruby is a reference, not a pointer (although some immediates just "act" like references).
<sepp2k>
shevy: That's not a pointer to a variable though.
<hoelzro>
aren't Fixnums not references?
<Hanmac>
fixnums, bool, and symbol are differect
<sepp2k>
hoelzro: I imagine that's what he meant by "some immediates just act like references"
blast_hardcheese has quit [Read error: Operation timed out]
<hoelzro>
oh, I didn't see that bit
whitenoise has joined #ruby
<novochar>
if variable a is already declared, how do you instantiate another variable (var b) as a reference/pointer to variable a
monkegjinni has quit [Remote host closed the connection]
<hoelzro>
novochar: b = a
<sepp2k>
novochar: You can't have references to variables in ruby. Just references to objects.
<sepp2k>
hoelzro: Again: that's *not* a reference or pointer to a variable.
<hoelzro>
ah, sorry
<hoelzro>
I'm only reading half the sentence =/
abra has quit [Ping timeout: 276 seconds]
Caius has joined #ruby
<Spooner>
Yes, fixnums et al are stored as immediate values in the value which would be the pointer to the referenced object (not sure I'm explaining that as well as I could). However, they act, to all intents and purposes, like references to objects, so you don't need to worry about the implementation details.
krz has quit [Read error: Connection timed out]
<sepp2k>
novochar: I'm not quite clear what you want to accomplish. You said you don't like the name of your variable... why not just rename the variable?
alup has joined #ruby
senny has quit [Remote host closed the connection]
lorandi has joined #ruby
<shevy>
novochar use what hoelzro wrote
Caius has quit [Ping timeout: 252 seconds]
juo100 has quit [Quit: juo100]
monkegjinni has joined #ruby
beilabs__ has quit [Ping timeout: 245 seconds]
beilabs_ has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
blacktulip has quit [Read error: Connection reset by peer]
cakehero has quit [Quit: Computer has gone to sleep.]
senny has joined #ruby
Araxia_ has quit [Quit: Araxia_]
jxf has quit [Read error: Connection reset by peer]
jxf has joined #ruby
lorandi has quit [Ping timeout: 260 seconds]
deryl has joined #ruby
Ethan has quit [Quit: bestest breastests]
g0bl1n has joined #ruby
joshman_ has joined #ruby
beilabs__ has joined #ruby
beilabs_ has joined #ruby
tiripamwe has joined #ruby
robotmay has joined #ruby
randomautomator has joined #ruby
wallerdev has joined #ruby
wallerdev has quit [Client Quit]
dhruvasagar has quit [Ping timeout: 255 seconds]
kpshek has joined #ruby
andrewhl has joined #ruby
eurbach has joined #ruby
tonini has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
td123 has quit [Quit: WeeChat 0.3.8]
pdtpatrick has joined #ruby
markab has quit [Quit: Leaving.]
markab has joined #ruby
kedare|2 has joined #ruby
sbanwart has joined #ruby
cakehero has joined #ruby
mnaser has joined #ruby
kedare has quit [Ping timeout: 248 seconds]
ananthakumaran has joined #ruby
tiripamwe2 has joined #ruby
CheeToS has joined #ruby
ben_m has left #ruby ["Leaving"]
tiripamwe has left #ruby [#ruby]
prometheus has joined #ruby
dr0p has joined #ruby
wvms has quit [Read error: Connection reset by peer]
wvms has joined #ruby
deryl has quit [Quit: Time To Go, Too Bad, So Sad!]
abionic has quit [Ping timeout: 245 seconds]
niklasb has quit [Ping timeout: 244 seconds]
mnaser has quit [Ping timeout: 240 seconds]
prometheus has quit [Ping timeout: 240 seconds]
chomp has joined #ruby
nimred has quit [Ping timeout: 265 seconds]
bbuegler has quit [Quit: Leaving.]
Vendethiel has joined #ruby
mnaser has joined #ruby
plastics has quit [Ping timeout: 272 seconds]
jcromartie has joined #ruby
beilabs_ has quit [Ping timeout: 265 seconds]
oooPaul has joined #ruby
beilabs__ has quit [Ping timeout: 264 seconds]
Progster has quit [Ping timeout: 260 seconds]
deryl has joined #ruby
mdaisuke has quit [Remote host closed the connection]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
senny has quit [Remote host closed the connection]
ben_alman has quit [Excess Flood]
workmad3 is now known as workmad
workmad is now known as workmad4
workmad4 is now known as workmad5
workmad5 is now known as workmad3
theRoUS has joined #ruby
lorandi has joined #ruby
indstry has quit [Remote host closed the connection]
workmad3 is now known as workmad9000
zommi has quit [Remote host closed the connection]
itnomad has joined #ruby
workmad9000 is now known as workmad3
ychaouche has joined #ruby
ychaouche has left #ruby ["Leaving"]
krz has joined #ruby
workmad3 is now known as workmad2
workmad2 is now known as workmad3
andreime has quit [Quit: Lost terminal]
workmad3 is now known as workmad1
workmad1 is now known as workmad3
senny has joined #ruby
uris has quit [Read error: Connection reset by peer]
imami|afk is now known as banseljaj
tiripamwe2 has quit [Quit: Leaving]
mahmoudimus has joined #ruby
SQLStud has joined #ruby
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
ben_alman has joined #ruby
zemanel has joined #ruby
tk___ has quit [Quit: ばいばい]
jparishy has joined #ruby
beilabs__ has joined #ruby
beilabs_ has joined #ruby
senny has quit [Remote host closed the connection]
wangr has quit [Ping timeout: 240 seconds]
narshlob has quit [Quit: leaving]
senny has joined #ruby
hex`` has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
darthdeus has quit [Ping timeout: 265 seconds]
senny has quit [Remote host closed the connection]
sbanwart_ has joined #ruby
ghanima has joined #ruby
senny has joined #ruby
sbanwart has quit [Ping timeout: 252 seconds]
sbanwart_ has quit [Client Quit]
ceradon has quit [Ping timeout: 245 seconds]
bbuegler1 has joined #ruby
thone has joined #ruby
d3c has joined #ruby
tymat has joined #ruby
Kevin__ has joined #ruby
jprovazn is now known as jprovazn_away
KDr2 has quit [Remote host closed the connection]
fulmato has joined #ruby
thone_ has quit [Ping timeout: 248 seconds]
liluo has joined #ruby
rbanffy has quit [Quit: Ex-Chat]
ckrailo has joined #ruby
rbanffy has joined #ruby
monkegjinni has quit [Remote host closed the connection]
Sou|cutter has joined #ruby
rbanffy has quit [Remote host closed the connection]
d3c has quit [Read error: Connection reset by peer]
mucker has joined #ruby
cantonic has quit [Quit: cantonic]
schaerli has quit [Remote host closed the connection]
andrewhl has joined #ruby
schaerli has joined #ruby
larissa has quit [Quit: Saindo]
Spooner has quit [Ping timeout: 264 seconds]
josefig has joined #ruby
jianxioy has quit [Quit: leaving]
mikepack has joined #ruby
prometheus has joined #ruby
blast_hardcheese has joined #ruby
schaerli has quit [Ping timeout: 260 seconds]
<lectrick>
I want to String#split on space characters, NOT just whitespace (ex: I don't want to split on tabs). Unfortunately, both String#split(' ') and String.split(/\s/) will split tabs and spaces so when I later .join, I have no idea what to join on. Anyone?
quest88 has joined #ruby
<markab>
gsub out the tabs?
<apeiros_>
lectrick: um, that's not correct
<apeiros_>
str.split(' ') will not split on tabs.
atmosx has quit [Ping timeout: 276 seconds]
<lectrick>
apeiros_: Check the docs. String.split(' ') will split on tabs too.
<apeiros_>
wtf…
<apeiros_>
it does…
wvms has quit [Quit: wvms]
<apeiros_>
well, / / does not
yonggu_ has joined #ruby
<lectrick>
apeiros_: >> "word\ttab".split(' ')
<lectrick>
=> ["word", "tab"]
<apeiros_>
lectrick: use / / instead of ' '
baroquebobcat has joined #ruby
<lectrick>
apeiros_: let me try
<apeiros_>
must be one of those f*d up special cases…
rbanffy has joined #ruby
* apeiros_
is glad now he never uses strings as argument to String#split
<lectrick>
apeiros_: Yes, yes it was. I covered it with a test and boom :) But thanks for the / / answer!!
<lectrick>
apeiros_: Also just FYI, String#split(' ') will also treat all runs of spaces as one space (!)
<apeiros_>
this is a serious wtf…
<lectrick>
:)
hemanth has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
uris has joined #ruby
<apeiros_>
yeah, usually split(str) is split(Regexp.escape(str))
<apeiros_>
but seems split(' ') is split(/\s+/)
hemanth has joined #ruby
<lectrick>
I don't mind it... Like you I tend to use regexes there anyway, which are much more concise
<lectrick>
apeiros_: yeah i think it specifically special-cases that input
yonggu has quit [Ping timeout: 260 seconds]
kill-9_ has joined #ruby
ixti has joined #ruby
flype has joined #ruby
ixti has quit [Client Quit]
ixti has joined #ruby
davidcelis has quit [Ping timeout: 244 seconds]
tymat has quit [Quit: kthnxbye!]
jrist is now known as jrist-mtg
kenperkins has quit [Quit: Computer has gone to sleep.]
prometheus has quit [Ping timeout: 264 seconds]
Synthead has joined #ruby
maesbn_ has quit [Remote host closed the connection]
zacstewart has left #ruby [#ruby]
niklasb has joined #ruby
nowthatsamatt has joined #ruby
quest88 has quit [Quit: quest88]
eurek has quit [Quit: Computer has gone to sleep.]
williamcotton has joined #ruby
liluo has quit [Remote host closed the connection]
atmosx has joined #ruby
cantonic has joined #ruby
bbuegler1 has quit [Quit: Leaving.]
williamcotton has quit [Client Quit]
ryan0x2 has joined #ruby
apeiros_ has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 252 seconds]
bbuegler has joined #ruby
bbuegler has left #ruby [#ruby]
mikepack has quit [Read error: Connection reset by peer]
g0bl1n has quit [Ping timeout: 264 seconds]
mikepack has joined #ruby
nowthatsamatt has left #ruby [#ruby]
mikepack has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
lupine_85 has quit [Ping timeout: 248 seconds]
lorandi has quit [Quit: Leaving]
dekroning has quit [Ping timeout: 255 seconds]
abionic has joined #ruby
jrist-mtg is now known as jrist
abionic has quit [Read error: Connection reset by peer]
gilead has quit [Quit: Leaving]
abionic has joined #ruby
abionic has quit [Read error: Connection reset by peer]
abionic has quit [Read error: Connection reset by peer]
itnomad has quit [Quit: Leaving]
abionic has joined #ruby
abionic has quit [Read error: Connection reset by peer]
mfridh has joined #ruby
mdhopkins has joined #ruby
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
mdhopkins has left #ruby [#ruby]
tcopp has joined #ruby
Beoran_ has quit [Read error: Operation timed out]
freeayu has quit [Ping timeout: 272 seconds]
tatsuya_o has quit [Remote host closed the connection]
williamcotton has joined #ruby
sleetdrop has joined #ruby
mdaisuke has joined #ruby
headius has joined #ruby
Eldariof-ru has quit [Ping timeout: 265 seconds]
macmartine has joined #ruby
sleetdrop has quit [Client Quit]
headius has quit [Client Quit]
hoelzro is now known as hoelzro|away
freeayu has joined #ruby
kenichi has joined #ruby
tatsuya_o has joined #ruby
jonathancutrell has joined #ruby
mdaisuke has quit [Ping timeout: 255 seconds]
dhruvasagar has joined #ruby
mikepack has joined #ruby
prometheus has joined #ruby
ph^ has quit [Remote host closed the connection]
abra has quit [Ping timeout: 276 seconds]
ph^ has joined #ruby
abra has joined #ruby
kenperkins has joined #ruby
havenn has quit [Remote host closed the connection]
tiripamwe has joined #ruby
<tramm>
i still wonder about date/time localization in ruby... do i really always need to independently provide lang.yml with my code if i use I18n.localize(Time.now, :format => "%a")?
niku4i has quit [Remote host closed the connection]
ianbrandt has joined #ruby
pdtpatrick has joined #ruby
nai has joined #ruby
Lachryma has joined #ruby
<Spooner>
jesly : I think you want h1=track['name'] (I've only used HAML, but as you've written it, I assume, means that it is text, not code.
<jd__>
is there no ++ method in ruby?
<jd__>
count++?
<Spooner>
jd__ : Nope, we just use += 1
<jd__>
rather i use count+=1?
<jd__>
thanks Spooner
trend has joined #ruby
lkba has joined #ruby
<jesly>
Spooner: wow, that was cool, so var evaluation happens on an '='
<Spooner>
It gets away from all the pre/post increment confusion (well, I have no idea exactly why we don't have ++)
<jesly>
thanks
luckyruby has joined #ruby
sailias has joined #ruby
<Spooner>
jesly Or you could have used: h1 #{track['name']} ...since strings are still interpolated
mjb2k has quit [Quit: Leaving]
<Spooner>
= means evaluate and print, - means evaluate, otherwise it is just print (simplifying things)
<Hanmac>
normaly even count += 1 is not used, because ruby has buildin functions for counting
headius has quit [Quit: headius]
Lachryma has quit [Ping timeout: 252 seconds]
tacheshun has quit [Remote host closed the connection]
mrsolo has joined #ruby
<moos3>
any takers on my erb issue
<jesly>
#{track['name']} didn't work for me
<Spooner>
OK, sorry, jesly, as I said, I'm used to the way HAML does it, not slim.
ramblex_ has joined #ruby
<jesly>
okay, its fyn
<jesly>
ur help was life saver
<jesly>
:)
znowi has joined #ruby
<jesly>
Spooner: ++ in ruby stands for *2 i guess not sure
<jesly>
there was reason
<jesly>
mentioned in eloquent ruby
<jesly>
dnt remember it
tacheshun has joined #ruby
znowi has left #ruby [#ruby]
<Hanmac>
jesly: hm no ... ++ is not possible per syntax
<davidcelis>
No, ++ gives syntax errors
<Spooner>
I haven't read it. I don't miss it, since as Hanmac said, we don't use ++ in loops anyway.
ramblex has quit [Ping timeout: 260 seconds]
erichmenge has quit [Quit: Be back later]
<jesly>
b = 10
<jesly>
b++
<jesly>
b
<jesly>
give 20
<jesly>
:O
<davidcelis>
jesly: No
<Spooner>
No that is parsed as b = 10; b + +b
zxiest has joined #ruby
<davidcelis>
b+++++++++++++b
Axsuul has joined #ruby
<davidcelis>
^ this should not be okay
<davidcelis>
oh, ruby
ramblex_ has quit [Ping timeout: 260 seconds]
cakehero has joined #ruby
rook_flood has quit [Ping timeout: 244 seconds]
erichmenge has joined #ruby
<zxiest>
why does "33.92032,35.647".match(/^(?<lat>[1-9]+[0-9]*(.[0-9]+)),(?<lng>[1-9]+[0-9]*(.[0-9])+)$/) return a match but "33.92032,35.6471" doesn't?
<Spooner>
That makes sense to my mental parser, davidcelis. It is just horrid :D
<zxiest>
elektronaut thank you very much =)... working now
r0bby has joined #ruby
<Spooner>
Oh, I see. Still, I don't know how many results are returned. If it is printing out the first results correctly, then it is probably your database is only returning the first row, not all of them *shrugs*
snearch has joined #ruby
piotr_ has joined #ruby
<moos3>
Spooner whats the best way to take mysql results and convert them to a rray
pk1001100011 has quit [Ping timeout: 255 seconds]
Eldariof-ru has joined #ruby
robbyoconnor has quit [Ping timeout: 260 seconds]
<Spooner>
Not sure - while since I've used it. #to_a would probably work.
vlad_starkov has joined #ruby
nai has quit [Remote host closed the connection]
<moos3>
fixed it spooner thanks for the help
rbanffy_ has joined #ruby
<Spooner>
Goodo :)
ryanf has joined #ruby
rbanffy has quit [Write error: Connection reset by peer]
lorandi has joined #ruby
Enekoos has joined #ruby
nai has joined #ruby
iamjarvo has quit [Quit: Leaving.]
Ontolog has joined #ruby
SQLStud has quit [Quit: Leaving]
<Ontolog>
On OS X Lion, Ruby 1.9.3-p125 (via rvm), irb 0.9.6, I am having trouble in irb entering utf-8 characters. Inputting the character, I see the actual character code displayed in irb. This only happens in irb. UTF-8 works fine in the shell, terminal, in vim and Ruby files, etc.
SQLStud has joined #ruby
tramm has quit [Quit: Ex-Chat]
<jd__>
is it possible to run multiple blocks / loops at once?
<Spooner>
Not sure what you are trying to do, jd__ - you can nest them.
<jd__>
say i have a list of links that i'm downloading with ruby to get info from right now i have one loop getting all 500 files can i break it up and have 2 loops at once each getting 250 files?
<jd__>
to speed it up
rowanu has quit [Remote host closed the connection]
pk1001100011 has joined #ruby
fermion has quit [Quit: P]
<carloslopes>
jd__: you can use threads
<jd__>
ok any good links for using threads?
<carloslopes>
jd__: but, with MRI they won't run in parallel.. they will be concurrent
<jd__>
concurrent and parallel are different?
<carloslopes>
jd__: sure
<jd__>
thanks carloslopes
<jd__>
but it will still be faster right?
<Spooner>
No.
<Spooner>
Unless you are using a Ruby that supports parallelism (jruby, for example).
<davidcelis>
macmartine: Take Spooner's then; remove the ([]) from inject
mnaser has quit [Ping timeout: 244 seconds]
Helius has joined #ruby
chienpo has joined #ruby
wallerdev has joined #ruby
sekretskwerl is now known as whitenoise
whitenoise has quit [Changing host]
whitenoise has joined #ruby
mnaser has joined #ruby
tiripamwe has quit [Ping timeout: 240 seconds]
<apeiros_>
that won't work. the first element isn't a DIWeek, so memo isn't a DIWeek
<macmartine>
wait, doesn't this return the result of the expression DIWeek.new('Mon') | DIWeek.new('Tue')? I'm wanting the result to be the expression itself so I can combine it with other expressions, if that makes sense
<davidcelis>
unless DIWeek | nil returns DIWeek
<Jackneill>
can you help me data.each do |var|, i got undefined method `each' for #<String:0x84f0224> (NoMethodError), but i did data.inspect, so data is an array now :/
<davidcelis>
which is possible; i can't see the docs for that class
<davidcelis>
Jackneill: gist your code
ryan0x2 has quit [Remote host closed the connection]
<apeiros_>
Jackneill: seems ruby disagrees with your assessment of data being an array…
<lectrick>
atmosx: Doesn't that only deal with hiding messages in images?
<atmosx>
nope
<atmosx>
In digital steganography, electronic communications may include steganographic coding inside of a transport layer, such as a document file, image file, program or protocol. (from wikipedia)
erichmenge has quit [Quit: Be back later]
<lectrick>
interesting
<atmosx>
anyway if you takea look at the links you'll find plenty of open source software
rowanu has quit [Remote host closed the connection]
mockra has joined #ruby
<atmosx>
iirc ther eare some sort of email proxy servers that use steganography, you give them a message and they turn it into spam-email
<jd__>
how can i save a page to a string using wget?
<atmosx>
then the other party must find the email, and use the same portal to *decrypt* it, in order to make the spam-looking message readable
dekroning has quit [Ping timeout: 265 seconds]
<atmosx>
jd__: curl -O isn't good?
<jd__>
oh i could try that
<jd__>
and just use backticks?
<jd__>
data = `curl -0 url` like that?
havenn_ has quit [Remote host closed the connection]
itnomad has joined #ruby
CoverSlide has quit [Read error: No route to host]
jesly has quit [Ping timeout: 245 seconds]
skise-mou has joined #ruby
Eldariof-ru has joined #ruby
bosphorus has quit [Remote host closed the connection]
ceradon has quit [Ping timeout: 255 seconds]
enroxorz is now known as JohnRedcorn
<atmosx>
jd__: y
iamjarvo has quit [Quit: Leaving.]
mikepack has joined #ruby
Boohbah has joined #ruby
<jd__>
thanks atmosx
<skise-mou>
vote for the best muscle man (from powermen,muscle hunks and muscle gallery) please vote to all groups and pages thanks
ringotwo has quit [Remote host closed the connection]
rbanffy_ has quit [Ping timeout: 240 seconds]
Eldariof-ru has quit [Read error: No route to host]
deryldoucette has joined #ruby
deryl has quit [Ping timeout: 272 seconds]
deryldoucette is now known as deryl
mikepack 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]
Eldariof-ru has joined #ruby
pk1001100011 has joined #ruby
Toumar has joined #ruby
Eldariof-ru has quit [Client Quit]
mikepack has quit [Read error: Connection reset by peer]
randomautomator has joined #ruby
randoma__ has quit [Read error: Connection reset by peer]
<Paradox>
drizz, i change hosts all the fucking time
<Paradox>
so thats just my hostname
<Paradox>
heh
<drizz>
personally I'd ditch the brackets around the current time
<Paradox>
i like em
dross has joined #ruby
rbanffy_ has joined #ruby
the_jeebster has joined #ruby
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
zz_chrismcg is now known as chrismcg
headius has quit [Quit: headius]
Asher has quit [Quit: Leaving.]
atmosx has quit [Ping timeout: 276 seconds]
Asher has joined #ruby
bigkevmcd has quit [Ping timeout: 248 seconds]
Cpudan80 has joined #ruby
<Cpudan80>
Hello folks
<Cpudan80>
Im having some trouble with a ruby app on windows (ruby 1.8.6)
cirwin has joined #ruby
whitenoise has joined #ruby
erichmenge has left #ruby [#ruby]
<Cpudan80>
the app needs iconv -- and when the ruby thing runs it comes up telling me that the specified file is not found (iconv.so)
cbuxton has quit [Quit: Leaving.]
atmosx has joined #ruby
<Cpudan80>
then it gives a path to where iconv.so actually is.... so Im not sure what's going on
andrewpthorp has quit [Ping timeout: 256 seconds]
saschagehlich has joined #ruby
austinbv has quit [Ping timeout: 244 seconds]
Eldariof-ru has quit []
sailias has quit [Quit: Leaving.]
<shevy>
1.8.6 is really old
affix has joined #ruby
<shevy>
what is that path saying for you on windows
<shevy>
also where did you install ruby into at, on windows. the path it has
bosphorus has joined #ruby
schaerli has quit [Remote host closed the connection]
apok has quit [Quit: apok]
<Cpudan80>
Yeah 1.8.6 is really old, but im using rub with sketchup
<Cpudan80>
so that's what skp provides
pu22l3r has quit [Read error: Operation timed out]
<shevy>
ack
<Cpudan80>
I didnt really install ruby, it came with sketchup... it's installed as part of the app
banghouseAFK is now known as banghouse
<shevy>
google's old masterplan to show that they hate ruby
<cakehero>
when I install with gem (and I have ruby version manager if that matters) do I install gems globally for that version of ruby or per-project (if the folder I'm in has an .rvmrc file, for instance)
<shevy>
not really sure what can be done, I dont think there is more than one or two other people here who use 1.8.6, on windows
andreime has quit [Read error: Operation timed out]
kevinbond has joined #ruby
<shevy>
RVM installs somewhere into $HOME as far as I know
carloslopes has quit [Quit: Leaving.]
bigkevmcd has joined #ruby
<shevy>
otherwise, gems usually can be found in $SITE_PREFIX/lib/ruby/gems/1.9.1/ or hmm... $SITE_PREFIX/lib/ruby/gems/1.8/ for 1.8.x
TheFuzzball has joined #ruby
<Cpudan80>
shevy: the forums mention something about the $LOAD_PATH array
<Cpudan80>
is that something I can puts to the console?
<shevy>
Cpudan80 well you can append to this array
<shevy>
like $LOAD_PATH << "path/to/iconv/" or something like that.
<shevy>
you can do that in any .rb script. or perhaps globally too
<Cpudan80>
the funny thing is that it works on one machine, but fails on another
<Cpudan80>
and I did a diff of the relevant directories and saw nothing interesting...
zaychenok has joined #ruby
<shevy>
hmmmm
schovi has quit [Remote host closed the connection]
snearch has quit [Quit: Verlassend]
uris has quit [Quit: leaving]
<Cpudan80>
now, the computer it works on does have a full blown ruby dev env
<Cpudan80>
but I dont see how that really makes a difference
ghanima has quit [Quit: Leaving.]
<shevy>
no clue. I used to use 1.8.7 for many years on linux... moved to 1.9.3 about 4 or 5 weeks ago finally
mikepack has quit [Read error: Connection reset by peer]
medik has joined #ruby
<cakehero>
Cpudan80 you can output it to the console
<cakehero>
puts $:
booginga has joined #ruby
<Cpudan80>
right yeah I figured that out
<cakehero>
k
<Cpudan80>
But the path is the same...
<Cpudan80>
and the file it is asking for, is in the path!
<Cpudan80>
grr
<cakehero>
permissions….?
Aristata has quit [Quit: Leaving.]
jparishy has quit []
Aaton is now known as Aaton_off
yankhates has quit [Quit: leaving]
yankhates has joined #ruby
silentpost has joined #ruby
uris has joined #ruby
mikepack has joined #ruby
atmosx has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 265 seconds]
Jay_Levitt has joined #ruby
<Cpudan80>
cakehero: hmm
<Cpudan80>
don't think so
blacktulip has quit [Remote host closed the connection]
plastics has joined #ruby
altivec has quit [Quit: WeeChat 0.3.0]
medik has quit [Quit: ...]
deanh has joined #ruby
otherj has joined #ruby
headius has joined #ruby
<otherj>
guys, why would File.basename(photo.file.to_s, '.*').gsub!('_',' ') result in a blank return when photo.file = BSO?
ceradon has quit [Ping timeout: 260 seconds]
beneggett has joined #ruby
geekbri has quit [Remote host closed the connection]
atmosx has joined #ruby
kaneda has quit [Remote host closed the connection]
digitalcakestudi has joined #ruby
<regularfry>
BSO?
<otherj>
well, bso.pdf for example
<otherj>
the result is good for filenames that have _, but not for those that don't
<Ontolog>
On OS X Lion, Ruby 1.9.3-p125 (via rvm), irb 0.9.6, I am having trouble in irb entering utf-8 characters. Inputting the character, I see the actual character code displayed in irb. This only happens in irb. UTF-8 works fine in the shell, terminal, in vim and Ruby files, etc...
<otherj>
and i thought gsub should only mess with those that have -
<otherj>
_
kaneda has joined #ruby
minijupe has quit [Quit: minijupe]
<Tasser>
Ontolog, tried another terminal?
Morkel has joined #ruby
<Tasser>
Ontolog, Encoding.default_internal/external are what?
<shevy>
otherj via .gsub! you modify in place
<shevy>
otherj change .gsub! to .gsub and everything should be fine
ceradon has joined #ruby
<otherj>
oooh
<otherj>
yeah
<otherj>
thanks shevy
<shevy>
I usually dont like the ! methods
<shevy>
it makes code shorter sometimes though
<shevy>
x = x.gsub(/python is better than ruby/,'')
<shevy>
x.gsub!(/python is better than ruby/,'')
cantonic has quit [Quit: cantonic]
<otherj>
oddly ehough, i think it was a typo
<shevy>
hehehe
jxf has quit [Ping timeout: 260 seconds]
fantazo has quit [Remote host closed the connection]
atmosx has quit [Ping timeout: 276 seconds]
s0ber has quit [Read error: Connection reset by peer]
<Jay_Levitt>
My Gemfile depends on 'resque', it has some gems that depend on 'resque >= 1.8.0', nothing else - but 'bundle update' isn't moving past resque 1.8.2, even though 1.20.0 is the newest...?
binaryplease has quit [Ping timeout: 244 seconds]
gmci has quit [Read error: Connection reset by peer]
jcromartie has quit [Quit: jcromartie]
fulmato has quit [Ping timeout: 246 seconds]
minijupe has joined #ruby
<Jay_Levitt>
.. in fact, a fresh 'bundle install' also resolves to resque 1.8.2.
chomp has quit [Quit: Leaving]
wmoxam_ is now known as evilWolf
eurbach has quit [Quit: Leaving.]
IHateHavingToReg has joined #ruby
<IHateHavingToReg>
thomas: this is for you buddy
<IHateHavingToReg>
<ttuttle> yeah i have a bit of a cp collection <-- FUCKING CHILD FAGGOT RAPIST
<IHateHavingToReg>
<ttuttle> yeah i have a bit of a cp collection <-- FUCKING CHILD FAGGOT RAPIST
<IHateHavingToReg>
<ttuttle> yeah i have a bit of a cp collection <-- FUCKING CHILD FAGGOT RAPIST
IHateHavingToReg has quit [Killed (idoru (Spam is off topic on freenode.))]
plastics- has joined #ruby
gmci has joined #ruby
plastics has quit [Ping timeout: 246 seconds]
justinmcp has quit [Ping timeout: 252 seconds]
<davidcelis>
.....
theRoUS has quit [Ping timeout: 244 seconds]
chson has quit [Remote host closed the connection]
justinmcp has joined #ruby
<evilWolf>
someone gots MAD
<Jay_Levitt>
inorite?
zemanel has quit [Quit: Remote hottie closed the connection]
<davidcelis>
dafuq
bosphorus has quit [Remote host closed the connection]
bosphorus has joined #ruby
<shevy>
lol
<shevy>
best nick ever though
<evilWolf>
the evilWolf questions if that was a real word
<shevy>
"IHateHavingToRegister!
<shevy>
I should get a new nick and be on #ruby-lang "I Hate Having To Wait For Voice"
<Hanmac>
shevy: yeah lets go all to #ruby-lang, there is no tintin :P
balki_ has joined #ruby
Guedes is now known as Guedes_out
balki has quit [Read error: Operation timed out]
MrGando has joined #ruby
PaciFisT has quit [Quit: Leaving.]
savage-_ has joined #ruby
ixti has quit [Quit: So Long, and Thanks for All the Fish!]
cherrypeel has joined #ruby
jxpx777 has quit [Quit: Mac is sleeping…]
tomb_ has quit [Quit: Computer has gone to sleep.]
dr_diamond has joined #ruby
dr_diamond has quit [Changing host]
dr_diamond has joined #ruby
savage- has quit [Ping timeout: 245 seconds]
yankhates has quit [Ping timeout: 240 seconds]
alfism has quit [Quit: alfism]
ciopte7 has quit [Quit: ciopte7]
tommyvyo has joined #ruby
savage-_ has quit [Remote host closed the connection]
jimeh has joined #ruby
indeterminate has joined #ruby
binaryplease has joined #ruby
macmartine has quit [Quit: macmartine]
gibsonfs_ has joined #ruby
bosphorus has quit [Remote host closed the connection]
liluo has joined #ruby
gibsonfs has quit [Ping timeout: 245 seconds]
mattonrails has joined #ruby
andrewhl has quit [Remote host closed the connection]
saschagehlich has quit [Quit: saschagehlich]
tzvi has quit [Read error: Connection reset by peer]
cakehero has quit [Quit: Computer has gone to sleep.]
aces23up has joined #ruby
davidboy is now known as RonPaul
chaingun has joined #ruby
RonPaul is now known as davidboy
dnyy_ has joined #ruby
iamjarvo has joined #ruby
Ontolog_ has joined #ruby
jmeeuwen_ has joined #ruby
aces1up has quit [Read error: Connection reset by peer]
dnyy has quit [Read error: Connection reset by peer]
Ontolog has quit [Read error: Connection reset by peer]
qpt has joined #ruby
jmeeuwen has quit [Remote host closed the connection]
abra has quit [Ping timeout: 276 seconds]
jmeeuwen_ is now known as jmeeuwen
carlyle has quit [Remote host closed the connection]
Ontolog_ has quit [Read error: No route to host]
ciopte7 has joined #ruby
Ontolog has joined #ruby
rakm has quit [Ping timeout: 264 seconds]
jxf has joined #ruby
dv310p3r has quit [Ping timeout: 260 seconds]
kpshek has quit []
whitenoise has quit [Changing host]
whitenoise has joined #ruby
rakm has joined #ruby
Maniacal has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
wpaulson has joined #ruby
chaingun has quit [Changing host]
chaingun has joined #ruby
Nick____ has joined #ruby
robotmay has quit [Remote host closed the connection]
shikamaru has quit [Ping timeout: 248 seconds]
Tyr0 has quit [Quit: Tyr0]
becom33 has joined #ruby
<becom33>
can you guys recomend me a simple to install and easy crawler
minijupe has quit [Quit: minijupe]
<epochwolf>
Okay, I have a LibXml document and I need to add a bunch of xml to it. Is there an easy way to do this without creating thousands of little LibXML::XML::Node objects by hand?
Targen has joined #ruby
<Hanmac>
epochwolf: look at nokogiri
apeiros_ has quit [Remote host closed the connection]
<epochwolf>
and we have one server that vanishes from the internet for 20 minutes out of every 4 hours.
<jd__>
i use puts hash.sort_by {|k,v| v} to sort a hash by values and output it but it puts out a line after the key and after the values how would i get the key and value on one line?
<Sou|cutter>
epochwolf: I don't think I could take that
<Sou|cutter>
epochwolf: you have my sympathy
plastics- has quit [Ping timeout: 252 seconds]
<epochwolf>
in short, I am stuck using LibXML and I would not like to have to insert a node like <13917ECE-238B-4287-8717-0DE628DE3B4B/> and do a regex replace.
<epochwolf>
Sou|cutter: I don't have to deal with this application too much. My other project uses nokogiri.
<epochwolf>
and ruby 1.9.3
<epochwolf>
I was able to get a new project started with more modern technology so I didn't have to deal with this on a daily basis.
<epochwolf>
So, any good solutions?
dnyy_ has quit [Remote host closed the connection]
<epochwolf>
What does LibXML::XML::Node#content do?
jxf has quit [Ping timeout: 260 seconds]
graspee has quit [Quit: brb]
Jake232 has joined #ruby
awarner has quit [Remote host closed the connection]
luckyruby has quit [Remote host closed the connection]
jwmann has quit [Remote host closed the connection]
wpaulson has quit [Ping timeout: 265 seconds]
booginga has quit [Quit: This computer has gone to sleep]
liluo has quit [Remote host closed the connection]
chaingun has quit [Remote host closed the connection]
jxf has joined #ruby
<Spooner>
jd__ : Sorting converts the hash into an array of key-value pairs (arrays). You would use something like hash.sort_by {|k,v| v }.each {|k,v| puts "#{k}: #{v}" }
ciopte7 has quit [Quit: ciopte7]
wpaulson has joined #ruby
atmosx has joined #ruby
tcopp has quit [Quit: Lost terminal]
<jd__>
that's what i thought but when i try that i get this -:2:in `<main>': undefined method `sort_by' for -3174409964720891477:Fixnum (NoMethodError)
<jd__>
oh wait let me try again
jwmann has joined #ruby
uris has quit [Quit: leaving]
otherj has left #ruby [#ruby]
ph^ has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
ilyam has joined #ruby
ken_barber has quit [Remote host closed the connection]
ph^ has joined #ruby
wpaulson has quit [Ping timeout: 240 seconds]
<jd__>
Spooner: that worked, thanks could you explain the logic on that ? thanks
monkegjinni has quit [Remote host closed the connection]
rizzylt has joined #ruby
davidcelis has quit [Ping timeout: 272 seconds]
<Spooner>
And then you iterate through the (sorted) array, each of the sub-arrays being assigned into the second |k, v| - make sense?
trend has quit [Quit: trend]
<jd__>
yes i think that does make sense, thanks
trend has joined #ruby
ph^ has quit [Ping timeout: 272 seconds]
Targen has quit [Quit: No Ping reply in 180 seconds.]
eph3meral has quit [Quit: Leaving]
libertyprime has quit [Quit: Lost terminal]
<Spooner>
If you try to puts an array (or nested array) it just displays it very simply. If you just want to inspect it, you could try using p or pp (the latter requires you require 'pp')
Sheehan has quit [Quit: Sheehan]
libertyprime has joined #ruby
cherrypeel has quit [Read error: Connection reset by peer]
chaingun has joined #ruby
digitalcakestudi has quit [Ping timeout: 265 seconds]
macmartine has joined #ruby
crankycoder has quit [Remote host closed the connection]
sailias has joined #ruby
kirun has quit [Quit: Client exiting]
SQLStud has quit [Quit: Leaving]
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
ciopte7 has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.8]
wpaulson has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
davidw has quit [Ping timeout: 264 seconds]
mdaisuke has quit [Remote host closed the connection]
carlyle has joined #ruby
Siphonblast has joined #ruby
MrGando has quit [Quit: Computer has gone to sleep.]
wilersh has joined #ruby
ph^ has joined #ruby
eurek has joined #ruby
dnyy has joined #ruby
wpaulson has quit [Ping timeout: 264 seconds]
headius has quit [Quit: headius]
berserkr has quit [Quit: Leaving.]
sam113101 has joined #ruby
ph^ has quit [Ping timeout: 244 seconds]
Aaton_off is now known as Aaton
jrist is now known as jrist-afk
atmosx has quit [Quit: leaving]
atmosx has joined #ruby
mockra has quit [Remote host closed the connection]
<ggreer>
I know paretheses are optional when calling functions in ruby, but is one way preferred?