Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<mxweas> Harzilein .split(/suffix/, 2).first ?
Clooth joined #ruby
jimmy1980 joined #ruby
<Harzilein> mxweas: why the 2?
<mxweas> optimization. Once the array hits two elements it stops
<davidcelis> return :x for summing them?
<mxweas> so after the first split, since you're just calling .first anyway
<Harzilein> and i forgot about first, split(/foo$/)[0] would not look nicer than sub(/foo$/){}
randym joined #ruby
looopy joined #ruby
flip_digits joined #ruby
saschaheylik left #ruby
jimmy1980 joined #ruby
saschaheylik joined #ruby
conor_ireland joined #ruby
dbgster joined #ruby
igors joined #ruby
<igors> hello. anybody familiar with thor? I'd like to use namespaces like ./commands.rb foo:bar
mengu joined #ruby
banisterfiend joined #ruby
flip_digits joined #ruby
jbw joined #ruby
Mramaizng left #ruby
adeponte joined #ruby
ephemerian left #ruby
fantazo joined #ruby
<elijahc> i've been googling up a storm and i can't quite figure out when to define an instance method and when to define a class method. any ideas?
<andrewvos> elijahc: You mean as a good practice?
<elijahc> yup
<andrewvos> Well, when it makes sense use a class method :)
<andrewvos> elijahc: If you don't need any values to be passed into the constructor, then you might want to use a class method.
<elijahc> andrewvos: what if i need to pass in an array to my method?
<andrewvos> elijahc: What are you currently doing that has made you stop and think?
oneiros_Fade joined #ruby
<elijahc> well, i'm writing my first ruby program and I'm going to use Thread because i've got 8 cores on this box, and I need to have each core run a method, albeit with different inputs.
<andrewvos> elijahc: So what does it do, and where are you thinking of using an instance/class method?
looopy_ joined #ruby
<RubyPanther> elijahc: likely you should fork instead of using Thread
stephenjudkins joined #ruby
SolarisBoy joined #ruby
xhx joined #ruby
<elijahc> andrewvos RubyPanther this is what i'm doing: http://pastebin.com/EC9TjLjn
omry joined #ruby
<andrewvos> elijahc: You're aware that writing to the file system with multiple threads will slow this down?
<andrewvos> Hmm, and reading. Just noticed you're not writing.
<elijahc> andrewvos: actually, the s3cmd sync command does synchronize remote S3 buckets to the local FS, which in this case is actually a ramdisk.
comron joined #ruby
<andrewvos> elijahc: Fair enough
<elijahc> so....should i be using an instance method or a class method?
banisterfiend joined #ruby
<andrewvos> elijahc: Still don't know what part
<andrewvos> elijahc: I see lots of methods there
<elijahc> take a look at class SyncHashPush
<andrewvos> elijahc: I would use an instance of a class for every cpu action
xissburg joined #ruby
<elijahc> how do you define cpu action?
mikepack joined #ruby
<sie> What do you guys think: http://sprunge.us/CJaV
<oneiros_Fade> Could someone please point me to a way to do GUI (curses or Gtk, maybe Qt) in Ruby that's currently -functional- in ArchLinux?
omry_ joined #ruby
<RubyPanther> oneiros_Fade: if you use Tk from the stdlib there will be dev packages for it in any distro :)
<oneiros_Fade> Tk?
<RubyPanther> presumably Gtk would have packages, too
<oneiros_Fade> Well, Glade is broken in Arch
<oneiros_Fade> Otherwise I'd be Gtk'ing it up as we speak
norex joined #ruby
<RubyPanther> Can't you use Gtk without Glade?
<oneiros_Fade> Yes, but I'm not terribly familiar with Ruby or Gtk, and I'm just trying to slap a usable GUI onto something so I can get to using it
<oneiros_Fade> Since I can't find an app that does what I'm trying to do, I get to make one
<RubyPanther> Tk is ancient, but it is also everywhere. It's usually used for rapid prototypes, but it has advanced features too.
<oneiros_Fade> Is there perhaps a GUI builder that works well with Ruby?
<oneiros_Fade> That would make my evening
<RubyPanther> I remember seeing one, but I don't use them myself
<oneiros_Fade> LOL, fair enough. Want to make a GUI for me? ;)
<RubyPanther> oneiros_Fade: I can't imagine any reason not to be able to get Glade working on any linux
igotnolegs joined #ruby
<oneiros_Fade> RubyPanther: The Glade builder puts out XML that the libglade can't understand
<oneiros_Fade> As far as I can tell, libglade is deprecated
QaDeS_ joined #ruby
<oneiros_Fade> But I've seen nothing as to what replaces it
<oneiros_Fade> I'll check into Tk though
<RubyPanther> oneiros_Fade: you could always just build a new glade install in userspace, if there is something broken about the system packages
Seisatsu joined #ruby
<oneiros_Fade> Or create the GUI in Glade builder and manually write in the relevant bits to .rb
<oneiros_Fade> Which, looking a Tk, seems to be best bet at the moment
TandemAdam joined #ruby
<oneiros_Fade> Tk looks pretty much the same as Gtk
albemuth joined #ruby
rpowell joined #ruby
Martz joined #ruby
<oneiros_Fade> Thanks for the suggestions, anyhow
<oneiros_Fade> Take it easy
oneiros_Fade left #ruby
notbrent joined #ruby
trivol joined #ruby
nelsnelson joined #ruby
ryanf joined #ruby
nari_ joined #ruby
Draco_ joined #ruby
SegFaultAX|work joined #ruby
wmoxam joined #ruby
saschaheylik joined #ruby
nerdy joined #ruby
sdwrage joined #ruby
stepnem joined #ruby
skurt joined #ruby
albemuth joined #ruby
dv310p3r joined #ruby
PaciFisT joined #ruby
chrisja joined #ruby
skurt joined #ruby
cableray joined #ruby
fivetwentysix joined #ruby
bgupta joined #ruby
mdunn joined #ruby
crankycoder joined #ruby
yekta joined #ruby
jwmann joined #ruby
nerdy joined #ruby
chiznitz_ joined #ruby
sbanwart__ joined #ruby
Martz joined #ruby
Pip joined #ruby
atmosx joined #ruby
incluye joined #ruby
nonotza joined #ruby
andrewhl joined #ruby
blueadept joined #ruby
blueadept joined #ruby
<macmartine_> How do I get this string: "2011-12-05 17:00:00", where this is local time, to a time in utc?
<loocorez> macmartine_: Check out time.local
<macmartine_> i tried that
<macmartine_> Time.local("2011-12-05 17:00:00") => 2011-01-01 00:00:00 +0000
<loocorez> Time.local("2011-12-05 17:00:00").utc perhaps?
ckrailo joined #ruby
<loocorez> => 2011-01-01 08:00:00 UTC
<macmartine_> irb(main):020:0> Time.local("2011-12-05 17:00:00").utc => 2011-01-01 00:00:00 UTC
stepnem joined #ruby
skurt joined #ruby
mickn joined #ruby
albemuth joined #ruby
<loocorez> Try Time.local(2011,12,05,18,16,00).utc => 2011-12-06 02:16:00 UTC
<macmartine_> loocorez: yeah, i figure that has got to be an easier way
<macmartine_> but that's a good backup, thanks
<loocorez> Sorry. I need more coffee. I'm interested now, I'll keep looking
mrdodson joined #ruby
<macmartine_> OK, I have to head home so i'll be offline for 30 min or so.
tburns joined #ruby
mikepack joined #ruby
p0y joined #ruby
<loocorez> macmartine_: Sure thing. Looks like the time library has an rfc2822 method that can parse a string formatted differently...
igotnolegs joined #ruby
SolarisBoy left #ruby
banisterfiend joined #ruby
cdepue joined #ruby
_kinderman joined #ruby
Martz joined #ruby
roaminghorse joined #ruby
Pip joined #ruby
Pip joined #ruby
norex joined #ruby
chrisja left #ruby
sbanwart_ joined #ruby
norex joined #ruby
Martz joined #ruby
rramsden joined #ruby
tburns joined #ruby
CannedCorn joined #ruby
stephenjudkins joined #ruby
sbanwart__ joined #ruby
trivol joined #ruby
tburns joined #ruby
jinho joined #ruby
rpowell joined #ruby
frode15243 joined #ruby
omry_ joined #ruby
<jinho> I want to do a regex in ruby 1.9 where I want to find a string that ends with a period like: "Scintigraphic evaluation of acute lower gastrointestinal hemorrhage: current status and future directions." but some of these strings can also be preceeded and end with brackets like: "[Role of multi-detector row computed tomography for localization of acute lower GI bleeding]." and I'd like to get rid of the brackets
Skaag_ joined #ruby
<jinho> so far I have: \[?(.+)\]?\.
<jinho> but of course that keeps the end bracket - do I have to use assertions for this case?
<jinho> or am I being blockheaded?
jwmann joined #ruby
<jinho> help would be much appreciated!
stephenjudkins joined #ruby
wilmoore joined #ruby
dagnachewa joined #ruby
acts_as_david joined #ruby
tobyo joined #ruby
<atmosx> jinho: try #regexp
<atmosx> tell them you're programming in ruby it will help
tshauck joined #ruby
stephenjudkins joined #ruby
<jinho> atmosx: gotcha thanks
cdepue joined #ruby
Skaag joined #ruby
cjs226 joined #ruby
p0y joined #ruby
macmartine joined #ruby
Paladin joined #ruby
davidcelis joined #ruby
musee joined #ruby
esparkman joined #ruby
rickmasta joined #ruby
LittleBill902 joined #ruby
randym joined #ruby
banisterfiend joined #ruby
jimmy1980 joined #ruby
Samoi joined #ruby
Samoi joined #ruby
Samoi joined #ruby
<loocorez> macmartine: Still looking for a solution?
<macmartine> yep
BrokenCog joined #ruby
<BrokenCog> anyone around for trouble shooting wxRuby install??
<loocorez> macmartine: Have you looked into Date's strptime? It might be what you want, if the dates are formatted the same way..
musee joined #ruby
<macmartine> loocorez: i'll try it
dasfugufish joined #ruby
<mksm> macmartine, Date.parse(str).to_time.utc
<mksm> what version are they using?
<macmartine> 1.9.2
jay_zawrotny joined #ruby
<mksm> hmm
<mksm> dunno
looopy joined #ruby
jimmy1980 joined #ruby
GreaseMonkey joined #ruby
GreaseMonkey joined #ruby
x0F__ joined #ruby
Behi joined #ruby
nelsnelson joined #ruby
h4mz1d joined #ruby
arash joined #ruby
<arash> is there an up-to-date wrapper for the google docs api for ruby?
tyman joined #ruby
banisterfiend joined #ruby
excelsio1 joined #ruby
mxweas_ joined #ruby
<loocorez> macmartine: DateTime.strptime('2011/03/05 14:25:00', '%Y/%m/%d %H:%M:%S').to_time.utc
<loocorez> maybe?
banister_ joined #ruby
tianl joined #ruby
RomD` joined #ruby
mrdodson joined #ruby
kennethreitz joined #ruby
trivol joined #ruby
Ruthenium joined #ruby
banisterfiend joined #ruby
<macmartine> loocorez: nope. => 2011-03-05 14:25:00 UTC
stephenjudkins joined #ruby
<macmartine> so weird. thanks so much for trying
pen joined #ruby
jimmy1980 joined #ruby
cafesofie joined #ruby
bigkm joined #ruby
dubz joined #ruby
dubz left #ruby
trivol joined #ruby
flip_digits joined #ruby
banisterfiend joined #ruby
<loocorez> macmartine: DateTime.parse('2011/03/05 14:25:00 PST').utc
<loocorez> err .to_time.utc
<macmartine> loocorez: looks like that kinda does it -- though I'd have to programatically get the PST in there since
crankycoder joined #ruby
<loocorez> Yeah, like #{Time.zone} ?
<sgronblo> Does anyone know how ruby-prof counts methods called from a block passed to a method?
mikepack joined #ruby
banisterfiend joined #ruby
<macmartine> loocorez: Time.zone => (GMT-08:00) Pacific Time (US & Canada)
jonathan___ joined #ruby
<jonathan___> Hi all, I'm new in Rails and I wonder what does exactly "form_for([@post, @post.comments.build]) do |f|"
<loocorez> macmartine: Time.now.zone
ryanf joined #ruby
<jonathan___> I understand the "form_for(@post) do |f|" but I need more explanations with the call of form_for with 2 arguments
<jonathan___> and the meaning of the .build
<sgronblo> jonathan___: /j #rubyonrails
<jonathan___> yes ...
jarjar_prime joined #ruby
esparkma_ joined #ruby
iamjarvo joined #ruby
esparkman joined #ruby
maletor joined #ruby
radic joined #ruby
randym joined #ruby
Pip joined #ruby
Natch| joined #ruby
sdwrage left #ruby
skillachie joined #ruby
kevinbond joined #ruby
mxweas_ joined #ruby
esparkman joined #ruby
<shevy> jonathan___ many people here don't know enough about rails to help you. For instance, I have no idea what the method form_for() is doing. Don't be shy to have a look at the source though!
xpot joined #ruby
looopy joined #ruby
sdwrage joined #ruby
<skillachie> Hi , the meta method present in Ruby/gnome poppler is not in the poppler gem or I do not know how to call that method
jimmy1980 joined #ruby
<skillachie> How can I call only methods in the OS ruby poppler installed instead of the poppler gem ?
ryanf joined #ruby
robbyoconnor joined #ruby
trivol joined #ruby
roaminghorse joined #ruby
Locke23rus joined #ruby
looopy joined #ruby
robbyoconnor joined #ruby
<shevy> skillachie is that part of ruby-gnome? or is that poppler thing something independent
<shevy> though version 1.0.3 is rubygnome2 I think
<shevy> if it's part of rubygnome2, it has example files in examples/ directory
jarjar_prime joined #ruby
cylence joined #ruby
eldariof joined #ruby
Beoran__ joined #ruby
bwlang joined #ruby
flip_digits joined #ruby
fowl_mouth joined #ruby
Natch| joined #ruby
fowl_mouth joined #ruby
Nisstyre joined #ruby
mikepack joined #ruby
btanaka joined #ruby
hadees joined #ruby
dasfugufish joined #ruby
stephenjudkins joined #ruby
stephenjudkins joined #ruby
io_syl joined #ruby
dasfugufish joined #ruby
Cervajz joined #ruby
idoru joined #ruby
RichieEvans joined #ruby
<RichieEvans> testing
<sdwrage> hey all. Is there an easy way to split a chunk of text by character count but ensuring a word finishes?
<sdwrage> so basically the range extends to allow the word to finish
Kn|t3_ joined #ruby
<tyman> not sure i understand the question...group on words and split those right?
jarjar_prime joined #ruby
<mxweas_> is it possible to specify a bytes:0-x header with open() ?
<sdwrage> tyman, I guess I can use split with a space
<Ruthenium> sdwrage: string.scan(/.{#{length}}(?:\w+|[^w])/)
<Ruthenium> this kinda works
<sdwrage> hrm
<sdwrage> I am playing with something now. I will see how it turns out :P
<sdwrage> thank you all though :)
yxhuvud joined #ruby
jimmy1980 joined #ruby
badabim joined #ruby
kennethreitz joined #ruby
Seisatsu joined #ruby
Helius joined #ruby
rpowell joined #ruby
dch4pm4n joined #ruby
Davenjah joined #ruby
<Davenjah> how to use unpack statement more than one with irb
<Davenjah> .unpack.unpack , can someone give me an example?
<Ruthenium> "a".unpack("b*").join.unpack("h*")
RobotOlivaw joined #ruby
<Davenjah> it this the way to decode a string?
<Davenjah> "need-to-be-decoded".unpack("b*").join.unpack(h*")
<Davenjah> ?
<fowl_mouth> Davenjah: why dont u read the documentation bitch
<Davenjah> bitch, i read too much
ChampS_ joined #ruby
<Davenjah> didnt understand it
<fowl_mouth> Davenjah: then go ask the doctor for some drugs to make u smarter
<Davenjah> xanax would be perfect
<Davenjah> already got it
mxweas_ joined #ruby
<Davenjah> fowl_mouth: i suggest you calm and mind your own business with "stfu"
<Davenjah> Ruthenium can u explain more?
<shevy> Davenjah look at the documentation of pack and unpack, it follows a format convention
<Davenjah> ok
<Davenjah> i been googling around didnt find an easy website explaining how things work
<shevy> "aa".unpack("b8B8") # => ["10000110", "01100001"]
<Davenjah> can you promote something?
<shevy> I can promote free sex. But other than that, try the official ruby documentation?
<Davenjah> ok
<shevy> you can find it with google!
<Davenjah> why dont you guys close the channel and set an auto-kick message "use google" dont come to freenode.
<shevy> Davenjah this is not the official ruby channel
<Davenjah> what is the purpose of this channel?
<shevy> Davenjah it's to promote free love
<Davenjah> Austria what a nice country
<Davenjah> never heard of it
<shevy> fascinating
<Davenjah> shevy i was trying to decode some string.. been googling for hours
<Davenjah> someone suggested that ruby may work.
<Davenjah> shall i continue reading or ruby is the solution indeed?
samuel02 joined #ruby
<shevy> ?!
<shevy> so you don't even use ruby :(
<Davenjah> 5ZiLHBofF8qKNINew4NUa7TPDl8pDgYbPPLi9tf6oFE=
<Davenjah> this is the string that i love to decode
<Davenjah> and no, it is not base64
roaminghorse joined #ruby
<shevy> I didn't know you were not using ruby
<Davenjah> never heard of it before
<shevy> use PHP its better
<Davenjah> i thought when linux guys say ruby. they mentioning someone's girlfriend
<Davenjah> didnt know it is something can be used with linux
<shevy> pretty much
<shevy> you are a wise person
* fowl_mouth sets mode: +stfu_bitch Davenjah
<Davenjah> lol
<Davenjah> to the maximum
<Davenjah> .whois 118.82.185.158
<Davenjah> opsss im not in my server :/
<Davenjah> New Zealand
<Davenjah> where we get meat from
<fowl_mouth> Davenjah: stop babbling
<Davenjah> fowl_mouth, can you export 100 of sheeps to us?
<fowl_mouth> Davenjah: what country is that?
<Davenjah> Dubai
<Davenjah> i pay for anyone help me decode this --> 5ZiLHBofF8qKNINew4NUa7TPDl8pDgYbPPLi9tf6oFE=
<sdwrage> Ruthenium: you still there?
<Ruthenium> still here
<sdwrage> Ruthenium: do you do any web work?
<Ruthenium> no
luckyruby joined #ruby
<sdwrage> I am basically trying to write a script to allow dynamic content to cut off at a certain length in a fixed height div without js or css intervening...
<sdwrage> don't know if that even looks sound
<sdwrage> I think I just need to sleep lol
<Ruthenium> what is word_key?
<sdwrage> whoops… 38 should be character_limit
<sdwrage> it was left there from something I was trying
<sdwrage> I will remove that
<Ruthenium> "paragraph" and "word" are always == nil
<sdwrage> also need to add a fourth param called row_limit
<sdwrage> revised it
Seisatsu joined #ruby
<Ruthenium> paragraphs.each do |paragraph_key, paragraph|
<Ruthenium> why two parameters here?
<Ruthenium> paragraphs is an Array
<sdwrage> I didn't need two params really
<Ruthenium> Array#each only gives one parameter to the block
<sdwrage> I was testing something
<Ruthenium> so paragraph ends up empty
<sdwrage> revised
<sdwrage> the + 1's are to compensate for spaces that were removed
<sdwrage> because those act as a single space
stephenjudkins joined #ruby
<sdwrage> basically I needed something that acts like I can cut it at a specific row based on character limit but, in the browser, if a word is too long, it drops down to another row in the paragraph. so just doing a character count wouldn't work
<sdwrage> thats why I was creating this
<sdwrage> I don't know how flakey it looks code wise :\
nelsnelson_ joined #ruby
<Ruthenium> so if the word doesn't fit in the limit you want to move it to the next line?
asQuirreL joined #ruby
sarmiena_ joined #ruby
<sdwrage> exactly
<sdwrage> because that is what it does in the browser
<sdwrage> Ruthenium: ^^
mk03 joined #ruby
<sdwrage> needless to say, I need to use a monospaced font but that is fine
<sarmiena_> how would i match all alphanumeric sequences in a given string? doing my_string.match(/[a-zA-Z0-9]+/) only returns the first occurrence
<Ruthenium> sarmiena_: String#scan
<sdwrage> sarmiena_: scan?
<sarmiena_> ah i think i found it
<sarmiena_> scan
<sarmiena_> thanks
<sdwrage> lol
<sdwrage> :)
Nanuq joined #ruby
apok joined #ruby
JohnBat26 joined #ruby
_debo joined #ruby
arash joined #ruby
Azure_ joined #ruby
djdb joined #ruby
stephenjudkins joined #ruby
headius joined #ruby
smgt joined #ruby
flippingbits joined #ruby
xpot joined #ruby
stoffus joined #ruby
levity_island joined #ruby
hurikhan|Work joined #ruby
randym joined #ruby
mafolz joined #ruby
masterhumper joined #ruby
workmad3 joined #ruby
perryh joined #ruby
disappearedng joined #ruby
<disappearedng> do you guys normally write code like this? @entries = retrieve_entries(current_user ? current_user.tags : nil)
<disappearedng> is this "idiomatic" in ruby
<davidcelis> that would be rails
<davidcelis> p.s. that is a horrifically open-ended question
ph^ joined #ruby
<ryanf> I don't know what property(s) of it you are referring to
<ryanf> the ternary is pretty common
<ryanf> the rest of it seems straightforward
<ryanf> also there's nothing inherently railsy about that
<ryanf> "current_user" isn't built into rails or anything
<davidcelis> ryanf: it's rails
<davidcelis> because
<davidcelis> he's also in #rubyonrails asking about it :)
<ryanf> haha
<ryanf> that's cheating
Morkel joined #ruby
zommi joined #ruby
bosphorus joined #ruby
dekroning joined #ruby
adeponte joined #ruby
batlock666 joined #ruby
Seisatsu joined #ruby
Cerales joined #ruby
jamnew joined #ruby
ChampS_ joined #ruby
LittleBill902 joined #ruby
Paladin joined #ruby
workmad3 joined #ruby
pi3r joined #ruby
visof joined #ruby
adeponte joined #ruby
Mchl joined #ruby
burgestrand joined #ruby
ikaros joined #ruby
cableray joined #ruby
flippingbits joined #ruby
Helius joined #ruby
jbpros joined #ruby
pen joined #ruby
pencilcheck joined #ruby
cyri_ joined #ruby
masterhumper joined #ruby
rtdp joined #ruby
xec joined #ruby
visof joined #ruby
BiHi joined #ruby
ryanf joined #ruby
apok joined #ruby
Manhose joined #ruby
pen joined #ruby
Cerales joined #ruby
Ammar01 joined #ruby
Taos joined #ruby
<Taos> Whats the @ in classes? instance?
<fowl_mouth> Taos: it's indicating whether the class is private or public
<fowl_mouth> @ means private
pencilcheck joined #ruby
<Taos> Ewwwww public private :(
<Taos> Im only learning ruby for completeness because I learnt python first and i have to say nothing is really jumping off the page at me
timonv joined #ruby
pen joined #ruby
jds joined #ruby
<fowl_mouth> Taos: i was joking
<fowl_mouth> Taos: @ indicates instance variables
SaneWarning joined #ruby
<Taos> fowl_mouth: were you really joking >.>
ChampS_ joined #ruby
<Taos> You still have public private and that is evilllll
<fowl_mouth> Taos: Almost every single object oriented language has private/public
<Taos> Its an evil concept and ill be happy when everyone gives up being a stickler
roaminghorse joined #ruby
mutable joined #ruby
<mutable> Hi. I'm trying to figure out where are gems installed by 'gem install ...' kept in Fedora. How can I find it please?
<fowl_mouth> Taos: Why is it an evil *concept* ?
jbpros joined #ruby
elliot98 joined #ruby
<mutable> it's 'gem which'
mutable left #ruby
heftig joined #ruby
<shevy> Taos, @foo is an instance variable. You use it to store data that you want to fetch, use modify
<fowl_mouth> Taos: the idea of differentiating between public and private interface is sound and is one of the cornerstones of OO
james_cotterill joined #ruby
ephemerian joined #ruby
nicoulaj joined #ruby
pen joined #ruby
stephenjudkins joined #ruby
mxweas_ joined #ruby
Morkel joined #ruby
sarmiena_ joined #ruby
michael_mbp joined #ruby
pen joined #ruby
Manhose_ joined #ruby
ikaros joined #ruby
roaminghorse joined #ruby
fritzthecat_ joined #ruby
gregorg joined #ruby
gregorg joined #ruby
Quadlex joined #ruby
fowl_mouth joined #ruby
Locke23rus_ joined #ruby
adambeynon joined #ruby
_debo joined #ruby
Helius1 joined #ruby
EddieS joined #ruby
Locke23rus joined #ruby
ognevsky joined #ruby
Pip joined #ruby
Pip joined #ruby
trivol_ joined #ruby
JumpMast3r joined #ruby
sejo joined #ruby
tatsuya_o joined #ruby
Locke23rus joined #ruby
andreas__ joined #ruby
Locke23rus joined #ruby
ognevsky joined #ruby
Ch4rAzZz joined #ruby
mxweas_ joined #ruby
jimmy1980 joined #ruby
kalusn joined #ruby
mengu joined #ruby
pen joined #ruby
stephenjudkins joined #ruby
josephwilk joined #ruby
ramusara joined #ruby
looopy joined #ruby
vitoravelino joined #ruby
tk_ joined #ruby
stephenjudkins joined #ruby
fl0w joined #ruby
enikar joined #ruby
jensn joined #ruby
ChampS_ joined #ruby
Shamgar joined #ruby
iocor joined #ruby
<Axsuul> Is there a way to define a method for +=
<Ruthenium> += is just a + and assignment
<Axsuul> Yea but is there a way to define a method for a class that utilizes +=, for example I can define a method for +
<Ruthenium> += just calls + method
<Ruthenium> then assigns result
<fowl_mouth> Axsuul: self.x += 10 is the same as: self.x=(self.x + 10)
<Axsuul> ah thanks
<fowl_mouth> well, self.x=(self.x().+(10)
<Ruthenium> self.x=self.x.+ 10
rpowell joined #ruby
<fowl_mouth> Ruthenium: what's up
<Ruthenium> nothing to see here
<fowl_mouth> Ruthenium: u seem like a nice girl
jimmy1980 joined #ruby
<Ruthenium> am not
gmci joined #ruby
p1d joined #ruby
MAD joined #ruby
<MAD> Hello everybody…
_debo joined #ruby
fermo joined #ruby
bjhaid joined #ruby
dleedev joined #ruby
workmad3 joined #ruby
<shevy> Axsuul you can at least define + class Test; def +(i); puts "Adding #{i}."; end; end; test = Test.new; test + 'Hello World' # => "Adding Hello World."
dleedev left #ruby
Morkel joined #ruby
trivol joined #ruby
michael_mbp_ joined #ruby
naftilos76 joined #ruby
awesome_ joined #ruby
Muz joined #ruby
bjhaid joined #ruby
pencilcheck joined #ruby
Locke23rus joined #ruby
pen_ joined #ruby
siddick joined #ruby
jimmy1980 joined #ruby
cdepue joined #ruby
ikaros joined #ruby
clockwize joined #ruby
crimzon joined #ruby
ognevsky joined #ruby
nemski joined #ruby
<nemski> hi
randym joined #ruby
nari_ joined #ruby
crimzon left #ruby
<nemski> can someone explain to me why this http://pastie.org/2974333 returns an error on the second call to 'a.each'
<Ruthenium> what error?
<nemski> test.rb:5: undefined method `each' for :IP:Symbol (NoMethodError)
<nemski> so why does the to_s only work the first time
rohit joined #ruby
excelsio1 joined #ruby
fl0w joined #ruby
nlko joined #ruby
<nlko> what is the best pdf generator in ruby?
<nlko> im looking at prawn and sme princexml at the moment
<nlko> am i overlooking anything?
skillachie joined #ruby
Manhose joined #ruby
saschaheylik joined #ruby
<shevy> nemski for whatever reason, the object where .each is run, is a Symbol
<shevy> you'd prefer an array usually for .each
<nemski> yeah the last element
<nemski> it's an IP address
<shevy> isn't an IP Address a string?
<shevy> nemski what version of ruby do you run
<shevy> works for me without an error
<nemski> 1.8.7
<shevy> same here
<shevy> print "#{a} = #{v}\n" shorter would be puts "#{a} = #{v}" btw
<nemski> are you require ing any libs
gregorg joined #ruby
gregorg joined #ruby
<shevy> nope
<shevy> "a" is a hash
<shevy> works here
<nemski> yep
<shevy> :)
<nemski> weeeird
<nemski> OS?
<shevy> linux, knoppix
<shevy> but it doesnt matter, the code you have on the pastie works in ruby nemski
<heftig> nemski: this will work in 1.9, but not 1.8
<heftig> you reuse the variable "a" within the block
<heftig> don't do that if you want to be compatible with 1.8
<shevy> oh
<shevy> indeed he does
<nemski> stupid debian is always behind
<shevy> nemski, it's not good to use the same names
<nemski> i just came across it playing with irb
nari_ joined #ruby
<nemski> silly me
dazoakley joined #ruby
Pip joined #ruby
xissburg joined #ruby
xissburg joined #ruby
vmatiyko joined #ruby
adambeynon joined #ruby
Shrink joined #ruby
ChampS_ joined #ruby
xissburg joined #ruby
hinogi joined #ruby
hinogi joined #ruby
Indian joined #ruby
vmatiyko left #ruby
<xissburg> how to define ++ operator?
sepp2k joined #ruby
<nemski> def ++(var) var += var end ?
vmatiyko joined #ruby
vmatiyko left #ruby
xhx joined #ruby
<nemski> i would have no idea
vmatiyko joined #ruby
vmatiyko left #ruby
<Tasser> nemski, won't work, because you can't define macros
<Tasser> ehh xissburg ^
<xissburg> ?
<shevy> xissburg does not work in ruby
<xissburg> not possible
<xissburg> ?
<shevy> yes. not possible.
zmanfx joined #ruby
<rohit> Can't you define that method in the Kernel module?
clockwize joined #ruby
fridim_ joined #ruby
<rohit> oh you can't define a method named ++
<Tasser> xissburg, learn some lisp and the difference between macro and function :-P
<xissburg> yea
nlko left #ruby
fetimo joined #ruby
<sie> Does ruby have some XML parsing libraries by default?
<Tasser> sie, install the nokogiri gem
<Tasser> how do I get the current namespace in Rake?
randym joined #ruby
<shevy> sie you have a funny nick
araujo joined #ruby
<shevy> I find Makefiles easier to understand than Rakefiles :)
<Tasser> yeah, Rake is a PoS :-/
<Tasser> but well, it does get shit done
<Tasser> I'll probably use something else later on
<shevy> hmm what are you doing with rake?
<Tasser> creating indexes with lucene / generating relevancy scores from them
Morkel joined #ruby
<sie> Is nokogiri fast/fastest?
<Tasser> sie, kind of
<sie> shevy - Also, check the wave generator I made. It doesn't create WAVs(yet), but it's prettay! (check the .rb's ending)
<sie> And tell me how shitty it is.
<Tasser> shevy, I'll probably switch to thor if I need some metaprogramming
<shevy> wave generator where?
kalusn joined #ruby
<shevy> Tasser I think the only piece of metaprogramming I did so far which I liked was
RichieEvans joined #ruby
<shevy> CONFIG.some_option
vitoravelino joined #ruby
vitoravelino joined #ruby
<shevy> which is basically a sugared hash... CONFIG['name_of_key']
<shevy> my meta foo is very weak
<sie> derpp, didn't paste the link https://github.com/siers/oscgen
<sie> shevy - ^
SaneWarning joined #ruby
<Tasser> sie, see openstruct :-P
RichieEvans left #ruby
rohit left #ruby
<shevy> sie do you have an example? I mean how to use oscgen
<shevy> I mean an example.rb file something
grekko joined #ruby
<sie> __END__
<sie> It's got this there: ./oscgen.rb | aplay --rate=44000
<shevy> oh yes
<shevy> now I see it
<shevy> hurts my ears hehehe
kalusn joined #ruby
ph^ joined #ruby
<sie> Turn your volume down. ;-D With this you can generate all kinds of waves! \o/ (and most importantly mix them)
cjs226 joined #ruby
<Tasser> sie, why not use pack? Too fancy?
<sie> I didn't have much time yesterday and I was lazy.
<sie> Does it look somewhat good?
BiHi joined #ruby
<fowl_mouth> Tasser: can u stop eating for a few days
<fowl_mouth> just 2 or 3
yatiohi joined #ruby
<yatiohi> Hello, I am trying to fix some broken utf string with ruby 1.9 and I am having some problems
spike_ joined #ruby
<yatiohi> my test case is here: http://pastie.org/2974614
<yatiohi> any ideas?
<Tasser> fowl_mouth, already did that, but then I just start gaming
<Tasser> sie, http://pastie.org/2974618 <- fancy
<Tasser> sie, but not useful
<sie> Meant for inclusion, right?
fatpandas joined #ruby
imsplitbit joined #ruby
wmoxam joined #ruby
<Tasser> sie, it's too general. your #math is simple enough
robbyoconnor joined #ruby
ephemerian joined #ruby
<shevy> sie dunno, I did not try to understand it. It takes me too long to understand code written by others
king-of-spain joined #ruby
<sie> No, I mean is it just pretty code? Not the functionality that much.
<shevy> hmmm
<shevy> well
<shevy> I am not sure
<shevy> it's hard to say as everyone may use another style
<shevy> I myself don't like @@vars
kevinbond joined #ruby
wyhaines joined #ruby
<shevy> sie what would be nice to see would be a solution that tries to keep it as simple as possible
<shevy> and then compare
<sie> It's not about liking @@vars or not, it's just that IMO in this case they should be the same across all instances.
randym joined #ruby
tobyo joined #ruby
<shevy> yeah, I dunno. I can't stand them
rickmasta joined #ruby
crankycoder joined #ruby
AutoMan joined #ruby
<AutoMan> GM, I am getting this error any idea what to do with it?:Fetching source index for http://rubygems.org/
<AutoMan> C:/Ruby193/lib/ruby/1.9.1/rubygems/remote_fetcher.rb:239:in `rescue in fetch_path': SocketError: getaddrinfo: No such host is known. (http://rubygems.org/quick/Marshal.4.8/gherkin-2.6.9.gemspec.rz) (Gem::RemoteFetcher::FetchError)
<AutoMan> Has anyone ever access CIS (Composite Information Server) with Ruby before?
pen joined #ruby
Shamgar joined #ruby
ggtoo joined #ruby
xhx joined #ruby
derchiller joined #ruby
MissionCritical joined #ruby
yalue joined #ruby
<derchiller> i would like to do the following, but it won't work: http://pastebin.com/DhWiicS8 help will be appreciated
visof joined #ruby
koala_man joined #ruby
lucapette joined #ruby
<ggtoo> i want to do this. Pls help me. http://pastebin.com/MNf6MBbh
<Tasser> ggtoo, I hope you're aware that XML isn't a regular language.
bwlang joined #ruby
<Tasser> and what should the output be exactly?
_kinderman_ joined #ruby
<sie> Has anyone ever succeeded to compile-collect rb file into an exe? How big was it?
<ggtoo> in the xml, characters are like \u044F\u045F
<ggtoo> i want to convert them to actual readable character.
<AutoMan> Has anyone ever access CIS (Composite Information Server) with Ruby before?
<derchiller> ggtoo: this may works http://pastebin.com/fmij8n92
<derchiller> oh
<derchiller> http://pastebin.com/8UYd3E61 this is the paste
poppiez joined #ruby
<poppiez> when should you use a rakefile?
nonotza joined #ruby
<AutoMan> Also has anyone seen this error before? http://pastebin.com/RdvhR38T
<ggtoo> derchiller thank you. but it is not working. it is printing \u0430\u0430 only.
<poppiez> my colleague says you should ONLY use Rakefiles when you install something and I believe you can use it for whatever task you might have
bbttxu joined #ruby
<ggtoo> derchiller: i put a sample input here. http://pastebin.com/2SHDwcky
<derchiller> if i use put the following string, i got the right character of it: "\u{0434}"
<derchiller> so u may convert the "\u0434" string to "\u{0434}"
<ggtoo> derchiller: how would i do that?
_debo joined #ruby
ChampS_ joined #ruby
emmanuelux joined #ruby
tommyvyo joined #ruby
d3c joined #ruby
<derchiller> hard to find it out without the content of the file. i also was wrong and it isn't neccessary to make the characters looks like '\u{0430}' -> http://pastebin.com/7sw48DZV
<derchiller> @ ggtoo
nanderoo joined #ruby
Synthead joined #ruby
<ggtoo> derchiller: the file xml file contains onlye \u0456\u..., i wanted to replace those with the actual characters you just showed. If i read from file i read \u0344 string not the actual character.
tatsuya_o joined #ruby
randym joined #ruby
<ggtoo> derchiller: this is the content of the file http://pastebin.com/UhYnn7rZ
iocor joined #ruby
jimmy1980 joined #ruby
mkscrg joined #ruby
<koala_man> does rubyzip support reading a zipfile without modifying it? are there any libs that do?
RomD` joined #ruby
gearaholic joined #ruby
linoj joined #ruby
yekta joined #ruby
dyer joined #ruby
jimmy1980 joined #ruby
dv310p3r joined #ruby
fetimo_ joined #ruby
yfeldblum joined #ruby
notbrent joined #ruby
bwright joined #ruby
ChampS_ joined #ruby
Shrink joined #ruby
jtrudeau joined #ruby
<derchiller> ggtoo: thats the only solution i've found so far. i'm sure that there's a solution which is more elegant, but i can't find it: http://pastebin.com/FeVhiHMJ
amacgregor joined #ruby
jensn joined #ruby
<ggtoo> derchiller: Thank you very much. This is what i wanted. Wow.
jbrokc joined #ruby
cdepue_ joined #ruby
excelsior joined #ruby
gmci joined #ruby
jbrokc left #ruby
csavola joined #ruby
<derchiller> gladly
_debo joined #ruby
_kinderman joined #ruby
tatsuya_o joined #ruby
jimmy1980 joined #ruby
bwright joined #ruby
michael_mbp joined #ruby
Ammar01 joined #ruby
cyri_ joined #ruby
radic joined #ruby
Clooth joined #ruby
hechien joined #ruby
wookiehangover joined #ruby
bwright joined #ruby
heftig joined #ruby
theRoUS joined #ruby
mitchty joined #ruby
netzapper joined #ruby
mkulke joined #ruby
<netzapper> so I'm hacking on my DSL for graphics fx in a game. I'm trying to figure out how I can get a block to close both over the instance variables of the object of the method that's defining the block, and over the instance methods (though not necessarily variables) of the class that the block is instance_exec'd inside.
iamjarvo joined #ruby
<netzapper> if I use local variables instead of @variables, things work fine. Do I really need just just do "local_var = @instance_var" and refer to "local_var" inside my blocks?
dazoakley joined #ruby
moshef joined #ruby
evantravers joined #ruby
bbttxu joined #ruby
v0n joined #ruby
enroxorz joined #ruby
enroxorz joined #ruby
Davenjah left #ruby
moondiamond_ joined #ruby
ceej joined #ruby
evantravers joined #ruby
Indian joined #ruby
moondiamond_ joined #ruby
adambeynon joined #ruby
vtr joined #ruby
omry_ joined #ruby
wmoxam joined #ruby
jgarvey joined #ruby
xhx joined #ruby
PaciFisT joined #ruby
rippa joined #ruby
jimmy1980 joined #ruby
frem joined #ruby
<shevy> netzapper what
<shevy> show code on pastie pls
axl_ joined #ruby
sbanwart joined #ruby
bier|tp joined #ruby
nonotza joined #ruby
conor_ireland joined #ruby
ixti joined #ruby
sandstrom joined #ruby
<mkulke> hello, i have a string which is an xml string plus a custom string appended
nari_ joined #ruby
bier joined #ruby
<mkulke> i get rid of the appended string when doing 'awk "/<*>/"'
<mkulke> how would i do that w/ ruby regexps?
notbrent joined #ruby
dotnull joined #ruby
<derchiller> mkulke: if string =~ /(.*)<.*?>/ then result = $1.to_s end
pen joined #ruby
<derchiller> u may also want to use the string.match() or string.scan() method
Targen joined #ruby
<mkulke> derchiller: yeah, it kind of works (altho i need the xml, and the appended non-xml string to be thrown away)
macmartine joined #ruby
<mkulke> but i have the problem, that using this regexp i get: "<?xml version="1.0" encoding="UTF-8"?>"
<mkulke> which is kind of right
<mkulke> if content =~ /(<.*?>).*/ then content = $1.to_s end
<derchiller> if u want to use regular expressions, thats the options u may want to use. but if u want to parse the xml file u may want to use a class, not a regular expression
g0bl1n joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
<mkulke> i get an output from an app which is appended w/ a more or less random string (not easy to cut out).
<mkulke> like "<a.....z>\nblabla"
<mkulke> i do parse the xml
<mkulke> but i need to cut the frigging stuff at the end of the app
xhx joined #ruby
<mkulke> err the app result string
<derchiller> can't help u out there. building up the regexp is your job :) but, if your source is always valid xml, u may want to try out REXML or XmlSimple
<mkulke> i DO use rexml
<mkulke> i just wonder whether i can replace the ugly awk call
<derchiller> :)
<mkulke> right now my call is: %x{java -jar nagios_to_xml.jar #{filename} | awk "/<*>/"}
<mkulke> works great
<mkulke> but its ugly
theRoUS joined #ruby
<derchiller> yes, that looks like the sourcecode of a bash script, but not ruby ^^
<mkulke> *then* i can parse it w/ xml
<mkulke> rexml
<mkulke> i guess i could basically search for the last ">" and chop everything off from that on
<ccooke> hmm. Anyone know if puppet is stable on Rubinius? Can't seem to find online.
cdepue joined #ruby
<derchiller> should be possible
<Tasser> ccooke, run the test suite on rubinius and see what ahppens
looopy joined #ruby
<mkulke> (and pray that the app will never output a string containing >)
<mkulke> ah whatever
<derchiller> mkulke: u can use String.sub or String.sub! resp. String.gsub
_kinderman joined #ruby
<derchiller> with regular expressions to remove an unwanted string also
<mkulke> derchiller: exactly. but what would be a regexp for a non "< >" enclosed string?
<derchiller> replace /<.*?>/ with an empty string -> String.gsub(/<.*?>/, '')
<mkulke> that would throw away the xml
Ankhers joined #ruby
<mkulke> not the non-xml string
<derchiller> may gsub(/>.*?</, '') ?
<mkulke> neither :)
<derchiller> may gsub(/>(.*?)</, '') ?
<derchiller> should work IMHO
<mkulke> no, it doesn't. i am beginning to doubt it's possible at all
bjhaid left #ruby
<derchiller> everything is possible
<mkulke> not with regexp
<mkulke> its not a parser
<derchiller> it may be one
<derchiller> depends on the pattern
<mkulke> i thought there was a logical limitiation
tomzx joined #ruby
<derchiller> not every problem is solvable with the use of only regular expressions, thats right
<derchiller> but regexp helps. but u're free to try it another way also
<yekta> Somehow with some setting I've set in my environment I have lost the ability to (option + left) to jump left over words in IRB and rails consoles. Instead of going left it gives me [D for option + left and just 'D' for CTRL+left. Anyone have any ideas for what setting might be messing that up?
ckrailo joined #ruby
<macmartine> If I store a timezone in a variable - "Pacific Time (US & Canada)" how can I get the 3 abberviated name? ie. PST
pootpoot joined #ruby
mensch joined #ruby
perturbedpanda joined #ruby
csavola joined #ruby
jwmann joined #ruby
MAD joined #ruby
p0y joined #ruby
<derchiller> yekta: sounds like a terminal problem
vladyn joined #ruby
<derchiller> macmartine: use a table for comparison. but sadly i can't help u finding one
albemuth joined #ruby
jimmy1980 joined #ruby
jensn_ joined #ruby
zerofool2005 joined #ruby
envygeeks joined #ruby
axl__ joined #ruby
Narcissus joined #ruby
Narcissus joined #ruby
omry_ joined #ruby
<Narcissus> Can anyone explain why, when I am using rails 3.0.9 with ruby 1.8.7, I get the error on line 7? http://pastebin.com/rnSdiKWB
enikar joined #ruby
axl__ joined #ruby
<envygeeks> Narcissus: does your Gemfile declare and explicit version of rake?
<Narcissus> nope
axl_ joined #ruby
<envygeeks> or does it declare rake without a version
<dch4pm4n> Narcissus: Use bundle exec rake db:migrate
<dch4pm4n> or rvm get latest if you have rvm installed and you won't have to run bundle exec
pwelch joined #ruby
axl__ joined #ruby
<Narcissus> dch4pm4n: bundle exec rake db:migrate works, thanks :)
<dch4pm4n> NP :-)
<Narcissus> dch4pm4n: can you explain why it did that?
<Narcissus> envygeeks: it doesn't declare rake at all
<dch4pm4n> I am not 100% but my theory is that it's trying to use different gemsets
LiquidInsect joined #ruby
<Narcissus> ah okay, that seems to be quite a big annoyance with ruby (to me), there are so many different versions available it's difficult to know what I should be using where
<yekta> derchiller: well it does work when I ssh into production servers
<envygeeks> I'm a bit confused at how caller(n) is working: it just doesn't seem to be lining up with what the docs say https://gist.github.com/40ee771de1b307a30723
<Taos> Anyone here had experience with MySQL Workbench, I want opinion not help
<dch4pm4n> Narcissus: it is annoying. I use a different gemset with every new project and have no gems in my default gemset. This was there are no conflicts by putting everything in the default global gemset (i.e. the problem you've just experienced)
<dch4pm4n> s/was/way/
<envygeeks> same reason I had to finally cave in and modify rbenv to work without a custom shebang and use it to manage custom gemsets
<envygeeks> bundler gets annoying for development :(
<dch4pm4n> indeed
vtr joined #ruby
shevy joined #ruby
ckrailo joined #ruby
pwelch left #ruby
tobym joined #ruby
<yekta> Taos: works great for me
yfeldblum joined #ruby
JumpMast3r joined #ruby
frem joined #ruby
mikepack joined #ruby
xissburg joined #ruby
io_syl joined #ruby
io_syl joined #ruby
Manhose joined #ruby
nelsnelson joined #ruby
ChampS_ joined #ruby
_kinderman joined #ruby
ikaros joined #ruby
csavola joined #ruby
<Taos> yekta: can I have more than that
<Taos> yekta: do you ever do ERD diagrams in it?
<shevy> hmm
<shevy> what is an easy way to use Readline for multi-line input
<yekta> kz44umwty
yekta left #ruby
wyhaines_ joined #ruby
Zal joined #ruby
alex__c2022 joined #ruby
Norrin joined #ruby
wyhaines joined #ruby
fetimo__ joined #ruby
dasfugufish joined #ruby
dasfugufish1 joined #ruby
fetimo_ joined #ruby
wyhaines joined #ruby
RomD`` joined #ruby
wilmoore joined #ruby
Norrin joined #ruby
looopy joined #ruby
Rango joined #ruby
Natch| joined #ruby
ank joined #ruby
mickn joined #ruby
nonotza joined #ruby
omry_ joined #ruby
xec joined #ruby
axl_ joined #ruby
burgestrand joined #ruby
andrewhl joined #ruby
lkba joined #ruby
axl___ joined #ruby
perryh joined #ruby
axl___ joined #ruby
omry_ joined #ruby
axl__ joined #ruby
rclark joined #ruby
robbinn joined #ruby
PhilK joined #ruby
cylence joined #ruby
omry_ joined #ruby
jrgifford joined #ruby
crankycoder joined #ruby
kenperkins joined #ruby
cdepue joined #ruby
Silker joined #ruby
DrShoggoth joined #ruby
pcboy joined #ruby
bosphorus joined #ruby
kf8a joined #ruby
davidcelis joined #ruby
Telling joined #ruby
yekta joined #ruby
robyurkowski joined #ruby
eywu joined #ruby
h4mz1d joined #ruby
thone_ joined #ruby
defghanistan left #ruby
jay_zawrotny joined #ruby
beaknit_ joined #ruby
sandstrom_ joined #ruby
fridim_ joined #ruby
omry_ joined #ruby
slant joined #ruby
cbuxton joined #ruby
iocor joined #ruby
rushed joined #ruby
KitsuneD1ag0n joined #ruby
shevy joined #ruby
vtr joined #ruby
apok joined #ruby
mengu joined #ruby
BoreK joined #ruby
cdepue joined #ruby
Seventoes joined #ruby
maletor joined #ruby
<BoreK> sup
adeponte joined #ruby
mztriz joined #ruby
Tuxist64bit joined #ruby
james_cotterill joined #ruby
BoreK left #ruby
<mztriz> could someone help me with this script? http://pastie.org/private/ocpymh4gbn99rlvytxgdrg
ndch joined #ruby
bafilius joined #ruby
<ccooke> mztriz: what's the problem with it?
sodani1 joined #ruby
Azure joined #ruby
<envygeeks> mztriz: I think it would be better to do line =~ /regex/ then use $1 and $2 would probably save a couple of lines since you could do something like /^([0-9]+)\s(.*)/ => $1 $2
<envygeeks> well \s+ would probably work out better :P
<sodani1> hello, if I do [].inject, inject is defined by the enumberable module correct? How can I know that this is defined by enumberable and not class Array?
symb0l joined #ruby
<envygeeks> sodani1: type ri Array#inject and it will tell you where it's defined (for example for inject it says it's defined by enumerable)
<mztriz> envygeeks: thanks I'll give that a try :)
<RedGoesFasta> or
<ccooke> sodani1: well, you can call [].method(:inject): => #<Method: Array(Enumerable)#inject>
<RedGoesFasta> Array.instance_method(:inject)
<sodani1> hmm, ri Array works for me but ri Array#inject does not. I'm getting a return that Nothing is know about Array#inject
asuka_ joined #ruby
<sodani1> [].method(:inject) seems to do the trick though. thanks
<sodani1> I wonder why ri Array#inject isn't finding anything
SaneWarning joined #ruby
<ccooke> sodani1: works in ri on 1.9.x, doesn't work on 1.8.x
<envygeeks> I did my ri on 1.9.2p290 with built in ri if that helps
<RevDrSpectre7> I am having a really hard time getting libv8 and therubyracer installed on BSD
<RevDrSpectre7> Can anyone help?
alfism joined #ruby
daniel_hinojosa joined #ruby
csavola joined #ruby
SegFaultAX|work joined #ruby
quest88 joined #ruby
<mephux> mztriz: http://pastie.org/2975987
d3c joined #ruby
stephenjudkins joined #ruby
adamkittelson joined #ruby
sdwrage joined #ruby
Russell^^ joined #ruby
friskd joined #ruby
p0y joined #ruby
vladyn joined #ruby
<mztriz> exit
josh_ joined #ruby
DemonWitch joined #ruby
benlangfeld joined #ruby
mikeycgto joined #ruby
btanaka joined #ruby
<sodani1> when you say "an enumberable" that could be an array or hash or anything else with the enumberable module included?
veronatii joined #ruby
omry_ joined #ruby
friskd joined #ruby
ianbrandt joined #ruby
elijahc joined #ruby
yxhuvud joined #ruby
jbpros joined #ruby
cafesofie joined #ruby
ph^ joined #ruby
<RevDrSpectre7> I am having a really hard time getting libv8 and therubyracer installed on BSD
<RevDrSpectre7> Can anyone help?
ryanf joined #ruby
Dreamer3 joined #ruby
eignerchris joined #ruby
<envygeeks> I still don't understand why caller from repl root prompt is acting different then caller from inside a class method
<envygeeks> :(
omry_ joined #ruby
h4mz1d joined #ruby
tatsuya_o joined #ruby
sholden joined #ruby
<sholden> Does anyone use RubyMine? If so, do oyu know how to fix the syntax highligher to recognize methods ending in ?
<sholden> minor issue but its activating my ocd :P
stayarrr joined #ruby
AutoMan joined #ruby
<shevy> hmm
<shevy> ruby editors in general kinda suck
btanaka joined #ruby
sarmiena_ joined #ruby
_debo joined #ruby
axl_ joined #ruby
stephenjudkins joined #ruby
axl___ joined #ruby
kennethreitz joined #ruby
axl___ joined #ruby
kirun joined #ruby
axl__ joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
Jrz joined #ruby
Spockz joined #ruby
Jake232 joined #ruby
robyurkowski joined #ruby
jrz- joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
kennethreitz joined #ruby
_md joined #ruby
zmoazeni joined #ruby
omry_ joined #ruby
thoolihan joined #ruby
Utkarsh joined #ruby
Jrz joined #ruby
voodoofish430 joined #ruby
sepp2k joined #ruby
snitko joined #ruby
apok joined #ruby
Zal left #ruby
eignerchris joined #ruby
crankyco_ joined #ruby
Cervajz joined #ruby
badabim joined #ruby
devinus joined #ruby
<devinus> could anybody explain this: https://gist.github.com/cf9f78c2b080745afdf4 ?
<devinus> wrong channel
devinus left #ruby
pantsman joined #ruby
pantsman joined #ruby
billy_ran_away joined #ruby
daniel_hinojosa1 joined #ruby
ph^ joined #ruby
nelsnelson joined #ruby
shadoi joined #ruby
jrgifford joined #ruby
tshauck joined #ruby
<sie> Can I pass arguments to the proc, when I'm instance_evaling?
jensn joined #ruby
<fowl_mouth> sie: yes use instance_exec instead
dankest joined #ruby
fetimo joined #ruby
kenichi joined #ruby
fayimora joined #ruby
berserkr joined #ruby
axl_ joined #ruby
asQuirreL joined #ruby
mrsolo joined #ruby
workmad3 joined #ruby
enroxorz joined #ruby
josh_ joined #ruby
thepix joined #ruby
statarb3 joined #ruby
axl_ joined #ruby
DemonWitch joined #ruby
<billy_ran_away> Does anyone know how to use the Differ gem to print line by line differences?
sIbOk joined #ruby
<billy_ran_away> of a multi-line strings?
earcar joined #ruby
omry_ joined #ruby
<sIbOk> hi, i'm trying to install ruby-debug but it wants ruby > 1.8.7 when i'm running ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] http://pastie.org/2976478 Any tip? thx :)
h4mz1d joined #ruby
Helius joined #ruby
AutoMan joined #ruby
fetimo_ joined #ruby
akem joined #ruby
akem joined #ruby
bafilius joined #ruby
omry_ joined #ruby
cdepue joined #ruby
<sIbOk> envygeeks: Thx a lot, now ruby-debug works but chiliproject still complains about non installed version
GoldenPie joined #ruby
alfism joined #ruby
Algorith joined #ruby
workmad3 joined #ruby
rippa joined #ruby
tonini joined #ruby
<GoldenPie> Can anyone help me with this? https://github.com/pixelwolf/phonedb
wwzd joined #ruby
creativeprodigy joined #ruby
<deryldoucette> envygeeks: thank you on that ruby-debug19 link. I'll also pass it on to mpapis and see if we can't get better rvm specific support as well.
<deryldoucette> looked like someone was doing the same with rbenv (if i read that right)
wwzd left #ruby
<Algorith> hmm, I'm probably doing something horribly wrong here... does all computation in a recursive def in ruby not stop when 'return' gets called?
axl_ joined #ruby
axl__ joined #ruby
<sie> return just returns value from a function. All recursive functions must be stopped with some condition. if arg == 0 then return x else the_func arg * 3 end
crankycoder joined #ruby
omry_ joined #ruby
randym_ joined #ruby
<Harzilein> hmm
Squarepy joined #ruby
thepix joined #ruby
tatsuya_o joined #ruby
_debo joined #ruby
rickmasta joined #ruby
omry_ joined #ruby
badabim_ joined #ruby
flip_digits joined #ruby
AutoMan joined #ruby
<alex__c2022> anyone ever run into an issue like this? RegexpError in xxx unmatched (: /^(E\373\307\237$\227\016\t\204\^Ez\357(E\005)+/ ?
<alex__c2022> could it be I/O related?
Squarepy joined #ruby
sbanwart joined #ruby
p1d joined #ruby
gearaholic joined #ruby
<gearaholic> How can i get the mime-type of a file?
DemonWitch joined #ruby
grekko joined #ruby
rramsden joined #ruby
GreaseMonkey joined #ruby
philcrissman joined #ruby
_md joined #ruby
jay_zawrotny joined #ruby
apok_ joined #ruby
zastaph joined #ruby
iocor joined #ruby
<billy_ran_away> Anyone familiar with Differ? How can I get it to only show differences?
smgt joined #ruby
skammer joined #ruby
<billy_ran_away> Got it! Differ.format = :color; Differ.diff_by_line(string1, string2).to_s.lines.each { |line| puts line if line.include? "\e" }
cooper joined #ruby
<tightwork> ruby on windows is a mess wth?
nadirvardar joined #ruby
_debo joined #ruby
<Asher> windows is a mess
<yxhuvud> so is everything else
<yxhuvud> just a matter of degree
looopy joined #ruby
atmosx joined #ruby
luke-- joined #ruby
hadees joined #ruby
g0bl1n joined #ruby
manizzle joined #ruby
saschaheylik joined #ruby
renanoronfle joined #ruby
Axsuul joined #ruby
ephemerian joined #ruby
muraii joined #ruby
kevinbond joined #ruby
<muraii> This perhaps belongs in #cygwin, but it seems to fit #ruby better. I've installed Ruby 1.8.x via cygwin's installer, and RubyGems 1.8.x via "ruby setup.rb". I've since compiled Ruby 1.9.x and I *think* I need to remove the separate RubyGems installation.
axl_ joined #ruby
<muraii> Trying to set up Jekyll, but I think the error I'm getting is due to Ruby/RubyGems version. I'd like to remove the separate RubyGems install, but setup.rb doesn't seem to have an option for that.
<muraii> What's the best way to proceed?
axl_ joined #ruby
Bonkers joined #ruby
strife25 joined #ruby
conor_ireland joined #ruby
hadees joined #ruby
jensn joined #ruby
sdwrage joined #ruby
bosphorus joined #ruby
demian`_ joined #ruby
bafilius joined #ruby
g0bl1n joined #ruby
fayimora joined #ruby
Knodi joined #ruby
cableray joined #ruby
luckman212 joined #ruby
burgestrand joined #ruby
Morkel joined #ruby
adeponte_ joined #ruby
skinnymuch joined #ruby
<Morkel> What is the best gem to build a webscraper? mechanize, capybara or s.th else?
csavola joined #ruby
workmad3 joined #ruby
michael_mbp joined #ruby
<burgestrand> Morkel: no idea, sorry. I mean, I use capybara daily but it’s only to drive my tests.
p1d joined #ruby
kf8a joined #ruby
<Morkel> burgestrand: i use it too for this case. But i dont know how usefull it is as scraper :-)
CannedCorn joined #ruby
_debo joined #ruby
<SegFaultAX|work> Is there a hash method to merge/update one hash into another without generating any new keys.
<SegFaultAX|work> Only update existing keys.
iocor joined #ruby
ChampS_ joined #ruby
<shadoi> Morkel: scrubyt is built for it
<shadoi> not sure how up to date it is though
<Morkel> shadoi: thanks but scrubyt is only 'Hpricot and Mechanize on steroids'
ikaros_ joined #ruby
rpowell joined #ruby
rpowell joined #ruby
s0ber joined #ruby
y3llow joined #ruby
nelsnelson_ joined #ruby
quest88 joined #ruby
<muraii> Not bumping, per se, but curious: what's the best way to uninstall RubyGems 1.8.x in cygwin? I assume that's necessary upon installing Ruby 1.9.x.
_solomon joined #ruby
workmad3 joined #ruby
senj joined #ruby
jbpros joined #ruby
sandstrom joined #ruby
_debo joined #ruby
_debo_ joined #ruby
_debo__ joined #ruby
adeponte joined #ruby
jrist joined #ruby
trivol joined #ruby
pen joined #ruby
Ch4rAzZz joined #ruby
<shevy> rm -rf *
<shevy> rip it apart!
<shevy> out with the bad
_debo joined #ruby
_debo joined #ruby
developish joined #ruby
sbanwart_ joined #ruby
tburns_ joined #ruby
kaneda joined #ruby
jimmy1980 joined #ruby
nelsnelson joined #ruby
_debo_ joined #ruby
skrewler joined #ruby
bosphorus joined #ruby
sbanwart__ joined #ruby
luckyruby joined #ruby
apucacao joined #ruby
apok joined #ruby
skrewler_ joined #ruby
s0ber joined #ruby
y3llow joined #ruby
y3llow joined #ruby
_kinderman_ joined #ruby
root joined #ruby
roadze joined #ruby
iocor joined #ruby
iocor joined #ruby
Manhose joined #ruby
avandendorpe left #ruby
Rango joined #ruby
timonv joined #ruby
jimmy1980 joined #ruby
btanaka joined #ruby
kennethreitz joined #ruby
_kinderman joined #ruby
axl__ joined #ruby
AutoMan left #ruby
emmanuelux joined #ruby
timonv joined #ruby
minijupe joined #ruby
ion- joined #ruby
robyonrails joined #ruby
gmci joined #ruby
workmad3 joined #ruby
<ion-> how can i get a repl that stays alive in the same scope as a script?
<csavola> ion-: like starting irb and requiring the script file?
<ion-> csavola: yes. do i need to export objects somehow to access them?
<ion-> i suppose i can look it up. didnt think about making it as if it was a module
sbanwart__ joined #ruby
cableray joined #ruby
strife25 joined #ruby
<csavola> ion-: it depends on what you mean by "script" all a require does is load the file and make sure it's only done once
Cervajz joined #ruby
iocor joined #ruby
<ion-> csavola: i just want to poke around in this simple test script. it pops a json string from redis and at that point i want to use the interactive interpreter
<ion-> i was thinking there might be trick like python -i
<csavola> ion-: sounds like you want a debugger like ruby-debug
bigkm joined #ruby
veronatii joined #ruby
kwertii joined #ruby
sbanwart__ joined #ruby
dfamorato joined #ruby
trivol joined #ruby
dekroning joined #ruby
ph^ joined #ruby
alex__c2022 joined #ruby
<burgestrand> try pry
<burgestrand> ion-: http://rubygems.org/gems/pry
Behi joined #ruby
<burgestrand> ion-: http://pry.github.com/
libertyprime joined #ruby
stepitime joined #ruby
<davidcelis> Ruby 2.0.0-dev?
<davidcelis> jesus......
jimmy1980 joined #ruby
<ion-> burgestrand: pry does the trick, ty
_md joined #ruby
<ion-> ruby-debug required an older ruby... tried ruby-debug19, but i had some lib error
<shadoi> hey.. pry got a nice new logo.
<shadoi> cool
wedtm joined #ruby
<envygeeks> can anybody explain this shit: https://gist.github.com/2e65d65f30f73d837b1d
<envygeeks> why are the exceptions being suppressed by the original raise?
<Afal> burgestrand: wow whoever made that pry tool must be a really cool guy ;)
<burgestrand> Afal: not me, even though our names are similar, but yes he is :)
<shadoi> banisterfiend yeah?
<envygeeks> yes
<Afal> erk >_<[1~
<shadoi> envygeeks: that makes my eyes bleed
<shadoi> envygeeks: isn't raise a keyword?
<envygeeks> the keyword is an alias to Kernel#raise
looopy joined #ruby
<envygeeks> Sorry Kernel.raise
<shadoi> ah.. yeah it's not reserved
jimmy1980 joined #ruby
<shadoi> hmm… beyond me.
randym joined #ruby
<envygeeks> yeah i tripped me up at first when I saw that there were suppressed exceptions but there is nothing in the bundler source suppressing them :S
Jelco_ joined #ruby
nelsnelson joined #ruby
billy_ran_away joined #ruby
stephenjudkins joined #ruby
<fowl_mouth> envygeeks: you're only defining a singleton method on Kernel
<fowl_mouth> you need to redefine the instance method
<envygeeks> fowl_mouth: raise works on Kernel.raise
<envygeeks> that is not the problem
<fowl_mouth> are you sure? im pretty sure it's just a module_function
<fowl_mouth> let me check
<envygeeks> yes I'm sure because I've been using it :|
<envygeeks> if it didn't work it wouldn't have printed out the *args either when I ran rake pry ;)
looopy_ joined #ruby
<fowl_mouth> envygeeks:
<fowl_mouth> ah
<fowl_mouth> you're note defining 'raise' on the singleotn class
<fowl_mouth> not*
<fowl_mouth> nm
pootpoot left #ruby
<envygeeks> you're right
<envygeeks> lol
<envygeeks> I just noticed that too
<shadoi> fowl_mouth: aha! trying to hide from your hordes of fans now?
<epitron> shhhh
<shadoi> lol
root joined #ruby
<envygeeks> fowl_mouth: that's not the issue anyways the issue is the fact that there are random suppressions of raises in Kernel#raise
<fowl_mouth> hehe bbs
<envygeeks> but I have feeling this could be a rescue in a rescue without an explicit return
kevinbond joined #ruby
<shadoi> envygeeks: I was just thinking of a place where I did that, and it bit me.
<shadoi> I didn't realize it was suppressing the actual exception though
<shadoi> possible
<envygeeks> I might just file a ticket on bundler and call it a day since it's really his problem and this could be the source of quite a few slow downs I've been having with bundler
<shadoi> envygeeks: you tried bundler 1.1?
<shadoi> it's like…. 8,000 times faster for me.
<envygeeks> I can't use bundler 1.1 because of a critical issue with :git gems :( https://github.com/carlhuda/bundler/issues/1552
WanderingGlitch joined #ruby
<shadoi> fix it! :)
ckrailo joined #ruby
<envygeeks> I don't have time :P since this project I'm working on with bundler is for a much larger project and we can live with slow startup times
emptyflask joined #ruby
<macmartine> I'm getting this error when I go to my app locally with Passenger on Apache. You can see it's caused by pointing to a gem directly on :git and apache/passenger can't find it. I found some mentinos of some approaches but they aren't working. Here's what I have and the error https://gist.github.com/1440521 any ideas?
<macmartine> sorry, wrong room :/
namidark joined #ruby
samuel02 joined #ruby
michaelbarton joined #ruby
<michaelbarton> I'm struggling to compile 1.9.3 on OS X lion. I'm NOT using xcode but instead the recommended osx-gcc package that can be downloaded. There error I'm getting is outlined here: https://gist.github.com/1362382
dagnachewa joined #ruby
<michaelbarton> There is a similar issue for this on the RVM github repo: http://bit.ly/rYpRGS
Seisatsu joined #ruby
cooper joined #ruby
axl_ joined #ruby
tomzx joined #ruby
h4mz1d joined #ruby
davidcelis joined #ruby
p1d joined #ruby
<dekroning> how can I print the hex value of first character in a string, e.g. "abc"[0] because now it's returning the decimal value of the ascii table (ruby 1.8.7)
robyurkowski joined #ruby
fetimo joined #ruby
apok_ joined #ruby
nari_ joined #ruby
fetimo__ joined #ruby
raythecat joined #ruby
fetimo___ joined #ruby
<blueadept> is there a way to get rails to recompile css without restarting the app using the asset pipeline?
p1d joined #ruby
fetimo_ joined #ruby
statbot joined #ruby
skrewler joined #ruby
fixl joined #ruby
<epitron> dekroning: yeah, string[n] gives you the ascii value
<epitron> string[n..n] gives you a 1-character string
<epitron> you can also do: string.each_char { |str| str == a one char str }
<epitron> i hope you're not doing character-at-a-time parsing though
<epitron> that's bad!
<epitron> ruby has much better ways of parsing strings
_debo joined #ruby
benlangfeld joined #ruby
lkba joined #ruby