fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
<RubyPanther> A124: Not a very well-formed question
<A124> RubyPanther: RubyPanther: How could I rewrite C code in ruby extension binding to pass data as strings instead as file descriptors?
<RubyPanther> depends on the code
sent-hil has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
<RubyPanther> One of the great things about Ruby is that C extensions are just plain C, there is no special glue language needed, just a ruby.h
<sent-hil> if I've Monday, Oct 8 8:00p"
<RubyPanther> The chapter on C extensions is the chapter of the "Pickaxe" book they give away free as a sample, too, so you can get the current version
<sent-hil> if I do Time.parse("Monday, Oct 8 8:00p"), I get 0000 time zone, how do I make it parse in -0700 time zone
<sent-hil> I tried adding -0700 to string, but that didn't work
<RubyPanther> That walks you through everything you need to do basics of creating strings and passing to/from an extension
lggr has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
irleif has joined #ruby
kstephens has quit [Read error: Connection reset by peer]
irleif has quit [Client Quit]
ohdae has joined #ruby
samphippen has joined #ruby
sent-hil has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
samphippen has quit [Client Quit]
karneisada has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
sent-hil has joined #ruby
<A124> RubyPanther: Thanks.
yoklov has joined #ruby
kstephens has joined #ruby
AndChat| has joined #ruby
AndChat- has joined #ruby
lggr has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
no_worries has quit [Remote host closed the connection]
awarner has joined #ruby
ledao has quit [Quit: Leaving.]
Banistergalaxy has quit [Ping timeout: 256 seconds]
ledao has joined #ruby
AndChat| has quit [Ping timeout: 256 seconds]
mwilson` has quit [Excess Flood]
mwilson` has joined #ruby
jimeh2 has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
lggr has joined #ruby
murz has quit [Quit: Leaving...]
mengu has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<A124> sent-hil: Time.parse("Monday, Oct 8 8:00p CEST")
<A124> sent-hil: For example
AndChat- has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 255 seconds]
AndChat- has joined #ruby
<A124> sent-hil: Um.. my bad, sorry.
<sent-hil> A124: what's CEST?
awarner has quit [Remote host closed the connection]
<sent-hil> I get -0400, what's the pacific zone equivalent
Banistergalaxy has quit [Ping timeout: 255 seconds]
<A124> PDT is -7
<A124> PDT – Pacific Daylight Time
<sent-hil> I get 2012-10-08 11:00:00 +0000 for PDT
<sent-hil> A124: for Time.parse("Monday, Oct 8 8:00p PDT")
<sent-hil> I don't think that's right, is it?
<A124> sent-hil: Yes, Ruby does not seem to take it which is strange for me.
lggr has joined #ruby
Banistergalaxy has joined #ruby
<sent-hil> maybe if I set the server default time zone to -0700
mhodgson has joined #ruby
<A124> sent-hil: I think -0700 values worked with ruby. So I now see myself as stupid,
AndChat- has quit [Ping timeout: 255 seconds]
AndChat- has joined #ruby
Banistergalaxy has quit [Ping timeout: 255 seconds]
<_bart> how do I test for a partial match? so let's say I have 'abc def', and I want see wether that's partially in 'some long string def yeah'
<_bart> I thought 'abc def'.split(' ').reduce { |p| string.include?℗ }
<_bart> 'abc def'.split(' ').reduce { |p| string.include?( p ) }
werdnativ has joined #ruby
<_bart> but that's not the way
frogprince has quit [Ping timeout: 246 seconds]
dmiller has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<werdnativ> (1...15).last # => 15
<werdnativ> (1...15).to_a.last # => 14
<werdnativ> why, ruby?
JonnieCache has joined #ruby
zodiak has joined #ruby
Guest86326 has left #ruby [#ruby]
<werdnativ> one would expect Range#last to follow from Enumerable?
<_bart> werdnativ: because the array is zero index, so 1 goes to 0, 2 to 1
<_bart> werdnativ: think that's just the behaviour of .to_a
jellosea has joined #ruby
icole has quit [Remote host closed the connection]
<jellosea> how do i split into n-word chunks?
<jellosea> how do i split a string into n-word chunks?
<werdnativ> _bart: it's not about zero-indexing, you can do the same with ("a"…"k")
lggr has joined #ruby
Boohbah has joined #ruby
<werdnativ> FYI, that's a three-dot range, which excludes the last element if that's not clear.
charliesome has joined #ruby
<A124> sent-hil: ENV["TZ"] = "US/Pacific"
<A124> Although I don't agree with that solution, it's a workaround.
<werdnativ> jellosea: str.split.in_groups_of(3).map { |s| s.join(' ') }
<_bart> werdnativ: hmm I tried in rib and it seems the .to_a removes the number 15, because of the three-dot range.
<werdnativ> jellosea: in_groups_of is ActiveSupport mind you
ledao has left #ruby [#ruby]
<_bart> werdnativ: and when you just use last you get the 'last' of the range, not of the values.
<A124> jellosea: each_slice
<sent-hil> A124: awesome, thx@!
<jellosea> A124: how do i use each_slice?
perryh is now known as perry
<A124> jellosea: "1 2 3 4 5 6 7 8 9".split.each_slice(3).map { |s| s.join(' ') }
karneisada has quit [Quit: Leaving]
kitofr has quit [Read error: Connection reset by peer]
<A124> Same as wednativ's in_groups_of, just using ruby method
<werdnativ> _bart: yeah… that's what I mean. I think it's odd that Range's concept of last (an Enumerable method) is different from when you run .each on the range.
awarner has joined #ruby
Bosma has quit [Quit: leaving]
lggr has quit [Ping timeout: 264 seconds]
<werdnativ> it's just one of those heads-up things I guess. :)
kitofr has joined #ruby
lggr has joined #ruby
sent-hil has quit [Remote host closed the connection]
sent-hil has joined #ruby
<A124> Is there a neat way to split without sacrificing the delimiter? (havein delimiter at the end or start of string?)
CaptainJet has quit []
<A124> s/havein/having
<bperry> cut at the index of the delimiter +1 instead of splitting on the delim
<bperry> not sure how the ruby code would look
lggr has quit [Ping timeout: 260 seconds]
<A124> bperry: The desired is this: "<tag><tag>" => ["<tag>", "<tag>"]
<bperry> what is your delim?
<bperry> >?
<A124> Yes, in this example
<bperry> get the index of each > and cut the string at the index
xyzodiac has joined #ruby
<bperry> I don't know what the code in ruby will look like but that is your logic
<A124> bperry: Hm. Any other way than to compare characters?
<bperry> you don't compare characters
<bperry> you just get the first index of the next instance of >
<A124> How do I find the index then?
<bperry> cut, then go again
<bperry> until index is 0
lggr has joined #ruby
<A124> .index hm I thought only array has it
<A124> Thanks
<bperry> a string is an array :)
<bperry> of characters
sent-hil_ has joined #ruby
<A124> Yeah, I know that's why I tried ^^
<A124> bperry: Thank you a lot.
sent-hil has quit [Ping timeout: 245 seconds]
joeycarmello has joined #ruby
sent-hil_ has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 244 seconds]
joeycarmello has quit [Ping timeout: 264 seconds]
vitoravelino is now known as vitoravelino`afk
lggr has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
aharris_ has quit [Quit: aharris_]
lggr has quit [Ping timeout: 256 seconds]
foo-bar- has joined #ruby
foo-bar- has quit [Remote host closed the connection]
foo-bar- has joined #ruby
<foo-bar-> has anyone else had crashes on OSX due to ns_findfonts?
deadalus has quit [Quit: Leaving]
lggr has joined #ruby
g-ram has joined #ruby
jenrzzz has joined #ruby
chrisja has quit [Quit: leaving]
lggr has quit [Ping timeout: 246 seconds]
joeycarmello has joined #ruby
grizlo42 has quit [Read error: Operation timed out]
nari has quit [Ping timeout: 252 seconds]
CodeFriar has joined #ruby
grizlo42 has joined #ruby
nazty has joined #ruby
lggr has joined #ruby
Monie has joined #ruby
grizlo42 has left #ruby [#ruby]
dpk has quit [Quit: Asleep at the keyboard.]
tommyvyo has quit [Quit: Computer has gone to sleep.]
ryanlecompte has joined #ruby
tommyvyo has joined #ruby
CodeFriar has quit [Quit: Linkinus - http://linkinus.com]
lggr has quit [Ping timeout: 245 seconds]
CodeFriar has joined #ruby
lggr has joined #ruby
LouisGB has quit [Ping timeout: 260 seconds]
slacker_ has joined #ruby
ForevernadeAFK is now known as Forevernade
linoj has joined #ruby
elevenarms has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
glyytchy has joined #ruby
ryanlecompte has joined #ruby
yoklov has quit [Quit: bye!]
shammancer has quit [Quit: Leaving]
lggr has quit [Ping timeout: 246 seconds]
sent-hil has joined #ruby
shammancer has joined #ruby
<A124> How could one check if an object is an instance of class and not class? (any)
ryanlecompte has quit [Remote host closed the connection]
williamherry has joined #ruby
lggr has joined #ruby
<williamherry> ubuntu 12.04 gem install ruby-debug fail https://gist.github.com/3850315, ruby is 1.9.3 installed by rvm
slacker_ has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<williamherry> any one can help?
shammancer has left #ruby [#ruby]
<sent-hil> williamherry: use pry-debugger
shammancer has joined #ruby
icole has joined #ruby
<blazes816> A124: what do you mean an instance of class and not class?
<sent-hil> also i don't think ruby-debug works on 1.9.3
<A124> blazes816: If it's initialized instance of any class.
<blazes816> my_var.class != Class
<blazes816> ?
<blazes816> "test".class == String; String.class == Class
<sent-hil> A124: is_a?
<williamherry> rails c --debugger prompt me to install ruby-debug, is pry-debugger work too?
<blazes816> !my_var.is_a? Class
<sent-hil> williamherry: yes, see pry-rails
xuser has left #ruby [#ruby]
<A124> blazes816: Not any of those. But. If it's not an instance it does not respond to other than self methods. So I check by that. But thank you.
<A124> But I was really interested of a more general test.
emmanuelux has quit [Ping timeout: 246 seconds]
advorak has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
icole has quit [Ping timeout: 260 seconds]
colinbm has joined #ruby
lggr has joined #ruby
<sent-hil> A124: https://gist.github.com/5a1fcc56fda11632e982 is this what you want?
<A124> sent-hil: LoL. Yes.
pipopopo has quit [Ping timeout: 244 seconds]
<A124> sent-hil: Thank you.
g-ram has quit [Quit: Computer has gone to sleep.]
<blazes816> lol
Ruler_Of_Heaven_ has joined #ruby
<blazes816> you should use !my_var.is_a? Class instead
cburyta has quit [Remote host closed the connection]
<blazes816> because unless you're soley wanting to know if it's an A
<blazes816> - because
aharris_ has joined #ruby
<A124> Ok. so it's not. Damn. Sorry, I'm a little out of my head.
notVert has quit [Remote host closed the connection]
<A124> Damn. Somehow I manages to mangle the output, so I did not managed to figure out right return values. Yes blazes816, you're right. Also, sent-hil's idea will get useful too.
<bperry> I prefer .responds_to(:method_name)
<A124> Now I have a boolean question: If I define private method open, and use open in initialize, would get the public or private method called?
<bperry> usually I don't care about the type, only that I can call a specific method
<A124> I use responds_to for another purpose as well.
<bperry> it could go either way
<bperry> your preference
<A124> I'm making a modular class and I'm not yet familiar with theese.
lggr has quit [Ping timeout: 260 seconds]
<bperry> just giving you another option
Ruler_Of_Heaven_ has quit [Ping timeout: 246 seconds]
<A124> Yes, thanks. But it's not adequate as an asnwer.
ryanf has joined #ruby
<A124> To answer self: the private method get's called even in initialize.
lggr has joined #ruby
pipopopo has joined #ruby
<AndChat-> A124 of course, if private method can't be called there, then it can't be called anywhere:)
<A124> AndChat-: I meant if the private overloads the public even in initialize :)
<AndChat-> A124 I dont know what you mean by that:)
g-ram has joined #ruby
<williamherry> sent-hil: it still prompt me to install ruby-debug
lagzilla has joined #ruby
daniel_hinojosa has joined #ruby
<A124> AndChat-: I'm coming from procedural programming, so I have some things newcomers would not ask. Just discard that question.
<AndChat-> Ok:)
SegFaultAX|work has joined #ruby
<williamherry> sent-hil: thanks
Bosox20051 has quit [Remote host closed the connection]
elevenarms has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
iamjarvo has joined #ruby
lggr has joined #ruby
ryanlecompte has joined #ruby
linoj has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 246 seconds]
t0rc has quit [Quit: WeeChat 0.3.9]
whackatre has quit [Read error: Connection reset by peer]
Meon_ has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
Meon has quit [Read error: Connection reset by peer]
dfmoser has quit [Quit: dfmoser]
whackatre has joined #ruby
whackatre has quit [Changing host]
whackatre has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
lggr has joined #ruby
tsd_usa has joined #ruby
radic has joined #ruby
krz has joined #ruby
irleif has joined #ruby
SegFaultAX|work has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 248 seconds]
radic_ has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
aharris_ has quit [Quit: aharris_]
c0rn_ has quit []
hadees has quit [Quit: hadees]
kain has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 246 seconds]
Synthead has quit [Quit: p33 ba115]
Banistergalaxy has joined #ruby
c0rn_ has joined #ruby
AndChat- has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
hadees has joined #ruby
duracrisis has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
wpaulson has joined #ruby
lggr has joined #ruby
freeayu has joined #ruby
vitoravelino`afk is now known as vitoravelino
sent-hil has quit [Remote host closed the connection]
FifthWall has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
zastern has joined #ruby
<zastern> Any idea why in this code/function - https://gist.github.com/3850497 - the first invocation of my function works fine, but the second returns a blank for the number of meters on the third line of the function?
colinbm has quit [Quit: colinbm]
awojo has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
a_a_g has joined #ruby
justinmcp has quit [Remote host closed the connection]
vitoravelino is now known as vitoravelino`afk
tsd_usa has quit [Remote host closed the connection]
g-ram has quit [Quit: Computer has gone to sleep.]
<zastern> ah because its a string not an integer or float. i get it
kain has joined #ruby
grizlo42 has joined #ruby
CodeFriar has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 260 seconds]
jellosea has quit [Quit: jellosea]
xorgnak has joined #ruby
lggr has joined #ruby
a_a_g has quit [Quit: Leaving.]
awarner has quit [Remote host closed the connection]
cj3kim has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<Boohbah> zastern: convert_feet_to_meters(feet_haved.to_i)
<Boohbah> or to_f
xyzodiac has quit [Quit: Computer has gone to sleep.]
<zastern> Boohbah: thanks, but as I said above, I've already figured it out :)
jenrzzz has quit [Ping timeout: 248 seconds]
kain has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 246 seconds]
iamjarvo has quit [Ping timeout: 245 seconds]
BadLarry has quit [Ping timeout: 245 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
BadLarry has joined #ruby
lggr has joined #ruby
FifthWall has quit [Quit: Zzzzzzzzzzzzz]
shammancer has left #ruby ["Leaving"]
AndChat- has joined #ruby
bapa has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
Banistergalaxy has joined #ruby
AndChat- has quit [Ping timeout: 244 seconds]
FifthWall has joined #ruby
lggr has joined #ruby
c0rn_ has quit []
justinmcp has joined #ruby
TheFuzzball has quit [Ping timeout: 245 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
TheFuzzball has joined #ruby
ryanlecompte has joined #ruby
redbaritone has joined #ruby
AndChat- has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
redbaritone has quit [Client Quit]
CodeFriar has joined #ruby
redbaritone has joined #ruby
redbaritone has quit [Client Quit]
redbaritone has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
vitoravelino`afk is now known as vitoravelino
tommyvyo has quit [Ping timeout: 246 seconds]
zastern has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
g-ram has joined #ruby
lagzilla has quit [Quit: Leaving]
redbaritone has quit [Client Quit]
lggr has joined #ruby
AndChat- has quit [Ping timeout: 246 seconds]
irleif has joined #ruby
kain has joined #ruby
AndChat- has joined #ruby
mohit has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
ryanlecompte has quit [Remote host closed the connection]
CodeFriar has quit [Ping timeout: 264 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has quit [Ping timeout: 246 seconds]
foo-bar- has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
AndChat- has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
nm7 has quit [Quit: ZNC - http://znc.sourceforge.net]
kain has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 260 seconds]
advorak has quit [Quit: Leaving]
Forevernade has quit [Remote host closed the connection]
murz has joined #ruby
lggr has joined #ruby
bapa has joined #ruby
ryanlecompte has joined #ruby
tommyvyo has joined #ruby
jrist has joined #ruby
bapa has quit [Remote host closed the connection]
grizlo42 has quit [Ping timeout: 256 seconds]
kiyoura has quit [Quit: Leaving]
bapa has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
quest88 has quit [Quit: quest88]
mikepack has joined #ruby
cxz has joined #ruby
<cxz> hello
lggr has joined #ruby
<cxz> how would i find a backtrace to where this warning is occuring in my rails app?
<cxz> 'warning: already initialized constant BITS_PER_ENTRY'
katherinem13_afk is now known as katherinem13
grizlo42 has joined #ruby
bapa has quit [Read error: Connection reset by peer]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
mohit has quit [Quit: Leaving]
mohits has quit [Client Quit]
lggr has quit [Ping timeout: 255 seconds]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
AndChat- has joined #ruby
zodiak has quit [Read error: Connection reset by peer]
Cool_Fire has joined #ruby
<Cool_Fire> Hello
artm has joined #ruby
bapa has joined #ruby
zodiak has joined #ruby
<Cool_Fire> I've got a problem with using a text block (var = <<EOS text text text EOS)
<Cool_Fire> It seems some of the code in the text block gets evaluated and starts giving me errors
AndChat- has quit [Read error: Connection reset by peer]
<Cool_Fire> For example, I have a line:
AndChat- has joined #ruby
<Cool_Fire> c="##{a[3]}"
lggr has joined #ruby
<Cool_Fire> I get: undefined local variable or method `a' for main:Object (NameError)
<Cool_Fire> Even though it's in that block
Banistergalaxy has quit [Ping timeout: 245 seconds]
skryking has quit [Read error: Connection reset by peer]
<burgestrand> Cool_Fire: <<'EOS' to avoid string interpolation
mohits has quit [Read error: Connection reset by peer]
<burgestrand> Cool_Fire: http://pastie.org/4931186
artm has quit [Client Quit]
kain has joined #ruby
<Cool_Fire> burgestrand: That fixed it yeah. Thanks a lot
burgestrand has quit [Quit: Leaving.]
<drowningchild> noob here, was suggested ruby to learn, anyone have any suggestions for books/media for someone who knows -nothing- about any language?
lggr has quit [Ping timeout: 260 seconds]
<waxjar> drowningchild, an interactive tutorial might be handy: http://tryruby.org/levels/1/challenges/0
wedtm|away is now known as wedtm
<RubyPanther> drowningchild: http://mislav.uniqpath.com/poignant-guide/
lggr has joined #ruby
<drowningchild> tyvm waxjar RubyPanther :D
<RubyPanther> My own recent user action shot for chapter 7 "When You Wish Upon a Beard" http://stuff.rubypanther.com/images/when_you_wish_upon_a_beard.jpg
<reactormonk> how can I convert "+"/"-" in a csv to true/false ?
AlecTaylor has joined #ruby
<AlecTaylor> hi
murz has quit [Quit: Leaving...]
kain has quit [Ping timeout: 248 seconds]
TheFuzzball has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 240 seconds]
justsee has joined #ruby
TheFuzzball has joined #ruby
TheFuzzball has quit [Excess Flood]
lggr has joined #ruby
TheFuzzball has joined #ruby
CodeFriar has joined #ruby
Meon has joined #ruby
skryking has joined #ruby
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Meon_ has quit [Ping timeout: 260 seconds]
CodeFriar has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
AndChat- has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
vjt has joined #ruby
lggr has joined #ruby
shinnya has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
ryanlecompte has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
josh^ has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 260 seconds]
fridim_ has quit [Ping timeout: 244 seconds]
wallerdev has joined #ruby
<reactormonk> how do I convert a CSV::Table to an array of hashes?
<Paradox> uh…
<Paradox> depends on what you do
<Paradox> easiest way is just to have an each or map block
josh^ has joined #ruby
<Paradox> because doesn't CSV return an enumerable
Cool_Fire has quit [Quit: Off to bed. Thanks again.]
SegFaultAX|work has joined #ruby
a_a_g has joined #ruby
lggr has joined #ruby
<AlecTaylor> I have a Gemfile and a Gemfile.lock. How do I install the gem's dependencies?
kain has joined #ruby
<Paradox> bundle install
murz has joined #ruby
Takehiro has quit [Remote host closed the connection]
_Mon_Ouie_ has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
_Mon_Ouie_ has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
whackatre is now known as Mew
Mew is now known as Mew_
ananthakumaran has joined #ruby
lggr has joined #ruby
Mew_ is now known as Mew`
Mew` has left #ruby ["Cya."]
wedtm is now known as wedtm|away
<AlecTaylor> Ahh, figured out the problem… wrong version of Ruby
awestroke has joined #ruby
shammancer has joined #ruby
<shammancer> Is there a way to compare individual members of an array. Example
<shammancer> if "Hello" == ["Hello", "George"]
kain has quit [Ping timeout: 245 seconds]
<shammancer> And have it return true
<shammancer> Or do I need to itterate through the array
burgestrand has joined #ruby
skryking_ has joined #ruby
skryking_ has quit [Client Quit]
JonnieCache has quit [Ping timeout: 260 seconds]
ryanlecompte has joined #ruby
mohits has quit [Ping timeout: 256 seconds]
AlbireoX has quit [Remote host closed the connection]
w2f2 has joined #ruby
<rking> shammancer: ["Hello", "George"].include? "Hello"
lggr has quit [Ping timeout: 260 seconds]
AlbireoX has joined #ruby
c0rn_ has joined #ruby
<shammancer> so "if ["Hello", "George"].include? "Hello" \n ...
<shammancer> "
<blazes816> yes
<shammancer> ok
joeycarmello has quit [Remote host closed the connection]
lggr has joined #ruby
AlbireoX has quit [Ping timeout: 240 seconds]
Playb3yond has joined #ruby
murz has quit [Quit: Leaving...]
Takehiro has joined #ruby
tonini has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<shammancer> /home/dannick/Desktop/bot.rb:48:in `block (2 levels) in <main>': undefined method `include?' for nil:NilClass (NoMethodError)
ananthakumaran has quit [Quit: Leaving.]
<rking> shammancer: Then you don't have an Array, instead you have a nil
<rking> shammancer: gem install jist && jist bot.rb
<rking> (That is, I want to see more of the file, so run that from the shell so it will upload bot.rb to a public place. When it's done copy the URL and paste it here.)
<shammancer> Oh ok
<rking> (Also note that the jist command accepts the "-c" flag so you can skip the copy step)
lggr has joined #ruby
Takehiro has quit [Remote host closed the connection]
Playb3yond has quit [Quit: Colloquy for iPhone]
irleif has quit [Quit: Computer has gone to sleep.]
Forevernade has joined #ruby
<shammancer> Never mind forgot to make it global
duracrisis has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 248 seconds]
<shammancer> Is it appropriate to have global variables in ruby?
<burgestrand> Yes no
<rking> But mostly no.
<shammancer> When then?
<burgestrand> When appropriate but never otherwise.
<burgestrand> Frowned upon, no less.
<rking> Not til your 2nd month of programming.
answer_42 has joined #ruby
<_Mon_Ouie_> I'd actually say you shouldn't even define new ones, because even when you need global state, you can use a class instance variable equivalently, minus the name collisions
lggr has joined #ruby
<rking> There are many mechanisms to get code over ʜᴇʀᴇ to be able to see the data from over ᴛʜᴇʀᴇ. Start by simple args passing, then look at instance variables, then learn about closures, etc.
irleif has joined #ruby
tagrudev has joined #ruby
kain has joined #ruby
rippa has joined #ruby
<shammancer> Admin in this case...
daniel_hinojosa has quit [Ping timeout: 256 seconds]
<shammancer> I guess I could put it in a class and pass the class around...
CodeFriar has joined #ruby
ohdae has quit [Quit: leaving]
lggr has quit [Ping timeout: 246 seconds]
<blazes816> should be a constant anyways
<shammancer> How do you define a constant?
<blazes816> Admins = %w(shammancer blazes816)
<blazes816> a constant is an identifier beginning with a capital letter
lggr has joined #ruby
<shammancer> Ok
<rking> shammancer: In this case it's not too terrible that it's a global thing.
<shammancer> Ok
<rking> shammancer: Though I'd rather see it be an instance variable, and its data read from an external file.
daniel_hinojosa has joined #ruby
<shammancer> Yah I am not there yet...
ananthakumaran has joined #ruby
murz has joined #ruby
kain has quit [Ping timeout: 240 seconds]
<blazes816> is there any reason to use threads for cpu-bound code or does GIL defeat the purpose?
<rking> shammancer: Actually, I bet you could add a field to the config
mikepack has quit [Remote host closed the connection]
<shammancer> Hum?
jenrzzz has joined #ruby
bradyl0ve has quit [Quit: Leaving...]
FifthWall has quit [Quit: Goodbye everyone]
bradleyprice has joined #ruby
<rking> shammancer: Welll, I was thinking this would be nicer if you could do c.admins = %w(shammancer dannick) in that "configure do |c| … end" block
quazimodo has quit [Ping timeout: 240 seconds]
<shammancer> Ooh I like that
<shammancer> Would I then access it with @admins?
<rking> But now that I look at the Cinch code, it looks like you'll have to explicitly add "admin" as a legal config field.
<shammancer> ...
lggr has quit [Ping timeout: 260 seconds]
<blazes816> I smell a pull request
<shammancer> lol
<rking> Cinch::Configuration::KnownOptions << :admin
<rking> (Maybe)
<rking> Oops, there should be a "::Bot" before KnownOptions
<rking> Anyway it's getting messy so I'm not sure if it's worth a hoot.
<shammancer> Ok
<rking> (After that you'd access it like config.admin, I think. But yeah, a pain and no clear win.)
lggr has joined #ruby
<shammancer> Bah oh well
mikepack has joined #ruby
<shammancer> Ok is there a way to load seperate files into a ruby program while it is running... I know there is require but lets say I want to reload a module after an admin says reload or something how would I go about the reloading?
samuel02 has joined #ruby
<rking> shammancer: Use `load` not `require`.
<shammancer> At the top?
<rking> Wherever you want.
<rking> Like the handler for when the admin says "reload"
<shammancer> yah
<shammancer> Ok
mildfate has joined #ruby
mildfate has left #ruby [#ruby]
cj3kim has quit [Quit: This computer has gone to sleep]
awestroke has quit [Remote host closed the connection]
<shammancer> What extension (.rb?) and what directory (Can it be in the same one as bot.rb or does it need to be in the ruby one like require?)
lggr has quit [Ping timeout: 260 seconds]
lolmaus has joined #ruby
lggr has joined #ruby
senny has joined #ruby
_marvin_ is now known as _marvin
_Mon_Ouie_ has quit [Ping timeout: 246 seconds]
arturaz has joined #ruby
mikepack has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
<shammancer> Would that be safe?
lggr has joined #ruby
_mak has joined #ruby
<shammancer> What directory does it need to be in?
kain has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
AlbireoX has joined #ruby
<burgestrand> shammancer: load takes the path to a file to load, and it will be loaded regardless if it has been loaded already or not
<burgestrand> shammancer: require does the same, but will append the file extension if not present (e.g. ".rb"), and will not load files that have been required previously
<shammancer> Ok. But what directory does it need to be in?
<burgestrand> shammancer: if they receive a relative path to a file, both will search for the file in the directories listed in the $LOAD_PATH array
<burgestrand> shammancer: if they receive an absolute path, they will look only in that path
<burgestrand> shammancer: apart from that, place the files wherever you want
<shammancer> Ok how do you specify an absolute path?
<shammancer> Do you start from root?
<burgestrand> shammancer: Yep!
<shammancer> k
<burgestrand> shammancer: /absolute/path/to/file.rb
irleif has quit [Quit: Computer has gone to sleep.]
maesbn has joined #ruby
c0rn_ has quit []
iori has joined #ruby
saschagehlich has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
sagax has joined #ruby
iori has quit [Read error: No route to host]
c0rn_ has joined #ruby
lggr has joined #ruby
c0rn_ has quit [Client Quit]
iori has joined #ruby
jellosea has joined #ruby
<shammancer> Does include work the same way?
khakimov has joined #ruby
fantazo has quit [Remote host closed the connection]
reset has joined #ruby
monkegjinni has joined #ruby
kain has quit [Ping timeout: 264 seconds]
futilegames has joined #ruby
joeycarmello has joined #ruby
yshh has quit [Read error: Connection reset by peer]
aganov has joined #ruby
yshh has joined #ruby
timonv has joined #ruby
jellosea__ has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
jellosea has quit [Read error: Connection reset by peer]
jellosea__ is now known as jellosea
joeycarmello has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
Takehiro has joined #ruby
arturaz has quit [Remote host closed the connection]
bigkevmcd has joined #ruby
<burgestrand> shammancer: no, include is an entirely different thing.
<shammancer> Ok thanks
<burgestrand> shammancer: include is related to inheritance (but not the same thing), and more specifically something called mixins. It is a way to extend the functionality of objects without inheritance.
<burgestrand> I say without inheritance but that is not *entirely* true.
Morkel has joined #ruby
dr_bob has joined #ruby
<shammancer> I was just wondering if the directory things worked the same way
a_a_g1 has joined #ruby
Takehiro has quit [Remote host closed the connection]
CodeFriar has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 252 seconds]
daniel_hinojosa has quit [Quit: Leaving.]
a_a_g has quit [Read error: Connection reset by peer]
reset has quit [Ping timeout: 248 seconds]
gry has joined #ruby
AlbireoX has quit [Remote host closed the connection]
lggr has joined #ruby
AlbireoX has joined #ruby
icooba has joined #ruby
theplanet has joined #ruby
eikko has quit [Read error: Connection reset by peer]
<theplanet> if 1.9.3 latest?
<theplanet> -p194
eikko has joined #ruby
<theplanet> i don't know what p194 is but i'll assume 1.9.3 is the latest
<bnagy> close enough
<bnagy> p == patchlevel
<theplanet> are they buggy?
<theplanet> does 194 imply 194 bad bugs were patched?
AlbireoX has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
<rking> E.g. rbfiles = '**' '/' '*.rb'
<bnagy> theplanet: no actually it was just one bug
<bnagy> we are so stupid it took us 194 tries to fix it
<rking> I guess it's like C's preprocessor and sticks the pieces of adjacent strings together.
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
<rking> Not sure what the use of the feature is, though. (in cpp it's necessary for some macros)
<rking> Oh, hehe, there's a comment: "# you don't have to do like this. just write in single string."
gregorg_taf has quit [Quit: Quitte]
jgrevich has quit [Quit: jgrevich]
<rking> Seems more like a FIXME comment for the docs, but hey.
arturaz has joined #ruby
kain has joined #ruby
lggr has joined #ruby
`Mew has joined #ruby
reset has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
alectaylor1 has joined #ruby
AlecTaylor has quit [Ping timeout: 240 seconds]
saschagehlich has quit [Quit: saschagehlich]
leehambley has joined #ruby
skogis has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
alectaylor1 has quit [Client Quit]
<RubyPanther> rking: it is a rarely used Ruby feature so you can break strings up into multiple lines but still have it parse as one string without needing to concatenate
rakunHo has joined #ruby
xpen has joined #ruby
nilg has joined #ruby
lggr has joined #ruby
<rking> RubyPanther: What's the advantage?
<rking> RubyPanther: Oh, right, so it doesn't go over 80 col and doesn't require a runtime concatenation.
kain has quit [Ping timeout: 244 seconds]
red_ has joined #ruby
glyytchy has quit [Quit: Leaving...]
hemanth has quit [Ping timeout: 245 seconds]
CodeFriar has joined #ruby
hemanth has joined #ruby
SegFaultAX|work has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Nanuq has quit [Quit: leaving]
red_ has quit []
CodeFriar has quit [Ping timeout: 256 seconds]
zommi has joined #ruby
lggr has joined #ruby
fixl has joined #ruby
justsee has quit [Quit: Leaving...]
justsee has joined #ruby
zigomir has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
TheFuzzball has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
tk___ has joined #ruby
JonnieCache has joined #ruby
TheFuzzball has joined #ruby
lggr has joined #ruby
d3vic3 has joined #ruby
SqREL has joined #ruby
sqrel_ has joined #ruby
sqrel_ has quit [Client Quit]
SqREL has quit [Client Quit]
Sou|cutter has quit [Remote host closed the connection]
soulisson has joined #ruby
Hamed-R has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
wallerdev has quit [Quit: wallerdev]
kain has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
wallerdev has joined #ruby
soulisson has quit [Ping timeout: 240 seconds]
haxrbyte has joined #ruby
jprovazn has joined #ruby
lolmaus has quit []
elsifaka has joined #ruby
Takehiro has quit [Remote host closed the connection]
und3f has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
piotr_ has joined #ruby
bluOxigen has joined #ruby
lggr has joined #ruby
timonv has quit [Remote host closed the connection]
kain has quit [Ping timeout: 240 seconds]
khakimov has quit [Ping timeout: 256 seconds]
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
cibs has quit [Remote host closed the connection]
leehambley has quit [Quit: leehambley]
eldariof has joined #ruby
flype has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Jork1 has joined #ruby
roadt has joined #ruby
<roadt> hi, my ruby is 1.9.3 from package manager, but include dir is /usr/include/ruby-1.9.1, is it right?
Eplemosen has joined #ruby
demian`_ has joined #ruby
demian`_ has quit [Client Quit]
<roadt> gems are put into ~/.gem/ruby/1.9.1 ,too
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
Elhu has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
emergion has joined #ruby
ananthakumaran has joined #ruby
lggr has joined #ruby
charliesome has joined #ruby
saschagehlich has joined #ruby
mahmoudimus has joined #ruby
saschagehlich_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
margle has joined #ruby
jamjam has joined #ruby
reuf has joined #ruby
saschagehlich has quit [Ping timeout: 255 seconds]
saschagehlich_ is now known as saschagehlich
cezar has joined #ruby
haxrbyte_ has joined #ruby
AndChat| has joined #ruby
cezar has quit [Client Quit]
lggr has joined #ruby
hemanth has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 260 seconds]
eikko has quit [Ping timeout: 256 seconds]
prtksxna has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
JonnieCache has quit [Read error: Operation timed out]
Iszak has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
bluenemo has quit [Remote host closed the connection]
timonv has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Nanuq has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
LouisGB has joined #ruby
jimeh2 has joined #ruby
CodeFriar has joined #ruby
kain has joined #ruby
lggr has joined #ruby
ryanf has quit [Quit: leaving]
quazimodo has joined #ruby
mwilson` has quit [Excess Flood]
mwilson` has joined #ruby
xpen has quit [Remote host closed the connection]
tvw has joined #ruby
tvw has quit [Read error: Connection reset by peer]
tvw has joined #ruby
Takehiro has joined #ruby
CodeFriar has quit [Ping timeout: 272 seconds]
cibs has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
bluenemo has joined #ruby
lggr has joined #ruby
bradleyprice has quit [Remote host closed the connection]
kain has quit [Ping timeout: 248 seconds]
Banistergalaxy has joined #ruby
elaptics`away is now known as elaptics
lggr has quit [Ping timeout: 248 seconds]
bluenemo has quit [Remote host closed the connection]
mfridh has joined #ruby
AndChat| has quit [Ping timeout: 260 seconds]
jamjam has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
lggr has joined #ruby
replore_ has joined #ruby
Nisstyre-laptop has quit [Read error: Connection reset by peer]
Meon_ has joined #ruby
margle has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
margle has joined #ruby
hemanth has joined #ruby
Meon has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 252 seconds]
hemanth has quit [Read error: Connection reset by peer]
lggr has joined #ruby
frogprince has joined #ruby
sunkencityryleh has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
jimeh2 has quit [Ping timeout: 244 seconds]
monkegjinni has joined #ruby
Criztian has joined #ruby
budha has joined #ruby
<budha> /msg NickServ identify 4517138
budha has left #ruby [#ruby]
lggr has quit [Ping timeout: 240 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
mensvaga has quit [Ping timeout: 240 seconds]
kain has joined #ruby
<kalleth> sick, budha
<kalleth> pretty good password too
lggr has joined #ruby
gregorg has joined #ruby
gregorg has joined #ruby
gregorg has quit [Changing host]
dfmoser has joined #ruby
rakunHo_ has joined #ruby
hemanth has joined #ruby
baphled has joined #ruby
vlad_starkov has joined #ruby
rakunHo has quit [Ping timeout: 246 seconds]
fantazo has joined #ruby
bluenemo has joined #ruby
wallerdev has quit [Quit: wallerdev]
lggr has quit [Ping timeout: 264 seconds]
kain has quit [Quit: exit]
bluenemo has quit [Remote host closed the connection]
slainer68 has joined #ruby
Hamed-R has quit [Quit: Leaving]
lggr has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
icambridge has left #ruby ["Leaving"]
jimeh2 has joined #ruby
F1skr has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
workmad3 has joined #ruby
sunkencityryleh has quit [Quit: sunkencityryleh]
Shrink has joined #ruby
Shrink has joined #ruby
Shrink has quit [Changing host]
zz_chrismcg is now known as chrismcg
lggr has quit [Ping timeout: 256 seconds]
karakedi has joined #ruby
bluenemo has quit [Remote host closed the connection]
lggr has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
samphippen has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
bluenemo has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rippa has quit [Ping timeout: 260 seconds]
bluenemo has quit [Remote host closed the connection]
beiter has joined #ruby
josh^ has quit [Ping timeout: 246 seconds]
CodeFriar has joined #ruby
thunderstrike has joined #ruby
JonnieCache has joined #ruby
ephemerian has joined #ruby
thunderstrike has quit [Remote host closed the connection]
ksinkar has joined #ruby
josh^ has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
CodeFriar has quit [Ping timeout: 260 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rakl has joined #ruby
lggr has joined #ruby
craigp has joined #ruby
dhruvasagar has joined #ruby
reset has quit [Quit: Leaving...]
dfmoser has quit [Quit: dfmoser]
<_bart> kalleth, haha
monkegjinni has quit [Read error: Connection reset by peer]
theplanet is now known as eilyx
pitty has joined #ruby
monkegjinni has joined #ruby
hemanth has quit [Ping timeout: 256 seconds]
flype has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 264 seconds]
replore_ has quit [Remote host closed the connection]
flype has joined #ruby
lggr has joined #ruby
sepp2k has joined #ruby
prox|a has quit [Ping timeout: 248 seconds]
Meon_ has quit [Read error: Connection reset by peer]
Meon_ has joined #ruby
jcoglan has joined #ruby
morozovm has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Eplemosen has quit [Quit: NOPE]
pskosinski has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
replore_ has joined #ruby
zeshan has joined #ruby
lggr has joined #ruby
jlebrech has joined #ruby
zeshan has left #ruby [#ruby]
zeshan has joined #ruby
Takehiro has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
_2easy has joined #ruby
_2easy has joined #ruby
_2easy has quit [Changing host]
zeshan has left #ruby [#ruby]
replore_ has quit [Remote host closed the connection]
_2easy has quit [Client Quit]
hemanth has joined #ruby
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<jlebrech> how do you guys go about "spiking" a ruby app, cucumber -> rspec -> code -> repeat?
dfmoser has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
<JonnieCache> dont use cucumber unless you have a need to
karakedi has quit [Ping timeout: 260 seconds]
<JonnieCache> ie. you have nontech people who need to see the specs
eikko has joined #ruby
<JonnieCache> you might use rspec if you want. its a spike, the whole point is you do whatever you want and it doesnt matter because youre throwing the code away after youre finished
bluenemo has quit [Remote host closed the connection]
bluenemo has joined #ruby
<JonnieCache> if youre keeping your spike project and making it into version 0.1 of your actual project, youre doing it wrong
timmow has joined #ruby
<jlebrech> so against cucumber?
slainer68 has quit [Read error: Connection reset by peer]
<JonnieCache> personally i think cucumber is far too much like hard work, but if you get real benefits from it then you should use it
slainer6_ has joined #ruby
freeayu__ has joined #ruby
_2easy has quit [Quit: leaving]
<jlebrech> i'd write test based initial plus lots more tests, then run again and refactor. is that correct?
freeayu has quit [Ping timeout: 260 seconds]
<jlebrech> based on the initial spike*
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
lggr has joined #ruby
Virunga has joined #ruby
<JonnieCache> yeah that sounds good
_2easy has quit [Client Quit]
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<JonnieCache> to me, a spike is just a test to validate your ideas and generally investigate
triptec has joined #ruby
<jlebrech> the initial spike should be a "can i do it?" hack, am i right?
<JonnieCache> like the many pencil sketches one might do and then throw away if one were in the early stages of designing a physical product
pitty has quit [Ping timeout: 260 seconds]
<jlebrech> i find it impossible to write a spec if i haven't figured out how all the libraries i'm gonna use work
_2easy has quit [Client Quit]
<JonnieCache> yeah exactly, so doing tests first for a spike doesnt really make sense
_2easy has joined #ruby
<jlebrech> i might aswell write a spec like this: should "be feature complete" do
<jlebrech> if you rigidly have to write a spec first
<workmad3> test-driven spiking is possible
<workmad3> you basically write tests to check assumptions
<workmad3> but they aren't tests you'd keep after the spike, so heavyweight acceptance tests like cucumber scenarios are of limited utility
<jlebrech> it would be nice to have "spec templates" for standard website features, like can i log in, register, etc..
<JonnieCache> if theyre standard enough that you could build a template for them then thats a clue that maybe you shouldnt be doing them
_2easy has quit [Client Quit]
<JonnieCache> ie. you could rely on devise's built in test helpers
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
<A124> How could one check if an object is block?
daniel_- has joined #ruby
_2easy has quit [Client Quit]
<jlebrech> I see
_2easy has joined #ruby
_2easy has quit [Changing host]
_2easy has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<A124> To answer self: .is_a? Proc
rakunHo_ has quit [Read error: Connection reset by peer]
beiter has quit [Quit: beiter]
rakunHo has joined #ruby
_2easy has quit [Client Quit]
_2easy has joined #ruby
_2easy has quit [Client Quit]
lggr has joined #ruby
c0rn_ has quit []
petrjanda has joined #ruby
petrjanda has quit [Client Quit]
<shevy> hey
<shevy> that is shakespeare A124
petrjanda has joined #ruby
<shevy> To be or: not to_be? true
vlad_starkov has quit [Remote host closed the connection]
<shevy> ruby is such a highly philosophical language :)
<A124> Heh.
haxrbyte has joined #ruby
petrjanda has quit [Client Quit]
petrjanda has joined #ruby
Jork1 has quit [Quit: Jork1]
lggr has quit [Ping timeout: 256 seconds]
haxrbyte_ has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
emergion has joined #ruby
josh^ has quit [Ping timeout: 246 seconds]
monkegjinni has quit [Read error: No route to host]
lggr has joined #ruby
emergion has quit [Client Quit]
josh^ has joined #ruby
Jork1 has joined #ruby
emergion has joined #ruby
bwwrd has joined #ruby
Hamed-R has joined #ruby
_mak has quit [Quit: Ex-Chat]
monkegjinni has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
CodeFriar has joined #ruby
lggr has joined #ruby
dfmoser has quit [Quit: dfmoser]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
CodeFriar has quit [Ping timeout: 252 seconds]
arietis has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
_mak has joined #ruby
beiter has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
lggr has quit [Ping timeout: 256 seconds]
rakunHo_ has joined #ruby
lggr has joined #ruby
rakunHo has quit [Ping timeout: 246 seconds]
timonv has quit [Remote host closed the connection]
margle has quit [Quit: Computer has gone to sleep.]
Attic has joined #ruby
Attic has left #ruby [#ruby]
jrajav has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
timonv has joined #ruby
lggr has joined #ruby
awojo has joined #ruby
Squarepy has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
rakl has quit [Quit: sleeping]
h4mz1d has joined #ruby
LLama has joined #ruby
justsee has quit [Quit: Linkinus - http://linkinus.com]
lggr has joined #ruby
greenarrow has quit [Ping timeout: 256 seconds]
h4mz1d has quit [Ping timeout: 248 seconds]
d3vic3 has quit [Quit: leaving]
awestroke has joined #ruby
mucker has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
monkegjinni has quit [Read error: No route to host]
monkegjinni has joined #ruby
Guedes has joined #ruby
Squarepy has quit [Remote host closed the connection]
S1kx has quit [Quit: Leaving]
murz has quit [Quit: Leaving...]
lggr has joined #ruby
_bart has quit [Quit: _bart]
heftig has quit [Quit: leaving]
glupo has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
gogiel has joined #ruby
lggr has joined #ruby
lukaszk has joined #ruby
larissa has joined #ruby
Guest56442 has joined #ruby
Hamed-R has quit [Quit: Leaving]
samphippen has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
Guest56442 is now known as dpk
thisirs has joined #ruby
* _mak is away: Away
<shevy> _mak good to know
<shevy> :P
<_mak> ops... ;P
* _mak is back (gone 00:00:42)
sspiff has quit [Remote host closed the connection]
krz has quit [Quit: krz]
lggr has joined #ruby
sspiff has joined #ruby
fram has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
<dominikh> rking: you shouldn't change the set of bot options.
Virunga has quit [Remote host closed the connection]
<jrajav> Speaking of bots
<jrajav> I will be putting the bot VM up as a torrent tonight
<jrajav> Unfortunately it's 8gb...
werdnativ has quit [Quit: werdnativ]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
margle has joined #ruby
wuiqed has joined #ruby
bwwrd has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
monkegjinni has quit [Ping timeout: 256 seconds]
ewag has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
wuiqed has quit [Client Quit]
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
lggr has joined #ruby
Squarepy has joined #ruby
<shevy> wow
<shevy> 8 gb man
<shevy> you don't have to put all your porn collection into that :(
answer_42 has joined #ruby
xyzodiac has joined #ruby
Neomex has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
replore_ has joined #ruby
xyzodiac has quit [Client Quit]
Elhu has quit [Ping timeout: 245 seconds]
<matti> shevy: ;]
verto|off is now known as verto
lggr has quit [Ping timeout: 264 seconds]
Elhu has joined #ruby
eldariof has quit []
verto is now known as verto|off
<shevy> matti you naughty boy
verto|off is now known as verto
lggr has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
<matti> shevy: Oh dear, what did I do? :)
<matti> shevy: I've added support for Bignum to my FizzBuzz :)
<shevy> what the hell is this fizz and who is this buzz
<shevy> I hate them both
<matti> shevy: You can now check arbitrary large numbers for either Fizz, Buzz or FizzBuzz :)
eldariof has joined #ruby
<shevy> matti!!!
<matti> shevy: Like, 8 quantilion or something.
CodeFriar has joined #ruby
<shevy> please abandon this path of zzizziness
moeSeth has quit [Quit: Connection closed for inactivity]
<shevy> become a productive part of society again
<matti> LOL
<matti> No!
<matti> I refuse
<matti> Its so much fun.
<jrajav> zzizziness is now the objective measure of programming skill
<jrajav> Didn't you hear?
<jrajav> matti's clearly a freaking hacker demigod
monkegjinni has joined #ruby
<shevy> too much zzzzzzzZZZzzzzz
jenrzzz has quit [Ping timeout: 255 seconds]
daniel_- has quit [Ping timeout: 245 seconds]
nwest has joined #ruby
<jrajav> w
<jrajav> Wow, not sure how I managed to accidentally press both "w" and "enter" at the same time
<jrajav> Monday mornings
postmodern has quit [Quit: Leaving]
<shevy> lol
lggr has quit [Ping timeout: 246 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
jellosea has quit [Read error: Connection reset by peer]
lggr has joined #ruby
heftig has joined #ruby
pskosinski has quit [Remote host closed the connection]
Hamed-R has joined #ruby
Iszak has quit [Quit: User has gone to sleep.]
roadt has quit [Ping timeout: 246 seconds]
beiter has quit [Quit: beiter]
<matti> jrajav: I wishI were a demiod.
<matti> ;-)
Iszak has joined #ruby
darthdeus has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
CJNE has joined #ruby
undersc0re97 has quit [Quit: i use linux l o l]
lggr has joined #ruby
hardcore_ is now known as hardcore
hardcore is now known as Guest18657
J2EE has joined #ruby
artm has joined #ruby
Guest18657 is now known as Hardcore
<JonnieCache> www.ruby-toolbox.com's ssl cert has expired
<JonnieCache> anyone know who runs it?
Hardcore is now known as hardcore
jrajav has quit []
pskosinski has joined #ruby
nanderoo has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
[Neurotic] has quit [Remote host closed the connection]
daniel_- has joined #ruby
ksinkar has quit [Ping timeout: 252 seconds]
skaczor has joined #ruby
multi_io has quit [Remote host closed the connection]
lggr has joined #ruby
hemanth has quit [Ping timeout: 246 seconds]
abstrusenick has joined #ruby
monkegjinni has quit [Ping timeout: 260 seconds]
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
CodeFriar has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 255 seconds]
burgestrand has quit [Quit: Leaving.]
monkegjinni has joined #ruby
klip has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
wuzzzzaah has joined #ruby
m_3 has quit [Remote host closed the connection]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
samphippen has joined #ruby
asshopo has left #ruby [#ruby]
Jork1 has quit [Quit: Jork1]
roadt has joined #ruby
Jork1 has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
prtksxna has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 260 seconds]
carloslopes has joined #ruby
craigp has quit [Quit: craigp]
Virunga has joined #ruby
burgestrand has joined #ruby
lggr has joined #ruby
awojo has quit [Ping timeout: 240 seconds]
mark_locklear has joined #ruby
_JamieD_ has joined #ruby
_JamieD__ has joined #ruby
m_3 has joined #ruby
etehtsea has joined #ruby
craigp has joined #ruby
mohits has joined #ruby
klip has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
cakehero has joined #ruby
Jork1 has quit [Quit: Jork1]
eikko is now known as akemEikko
_bart has joined #ruby
ZubKonst_ has joined #ruby
rakunHo_ has quit [Remote host closed the connection]
lggr has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
_JamieD_ has quit [Quit: _JamieD_]
_JamieD__ is now known as _JamieD_
timonv has quit [Remote host closed the connection]
MikeyV27 has joined #ruby
ZubKonst has quit [Ping timeout: 246 seconds]
RJ3000_ has joined #ruby
timonv has joined #ruby
josh^ has quit [Remote host closed the connection]
Meon__ has joined #ruby
haxrbyte has joined #ruby
cdzombak has joined #ruby
nwest has quit [Quit: Computer has gone to sleep.]
awojo has joined #ruby
iamjarvo has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
snearch has joined #ruby
<awestroke> is there any way to do this?: [@opcode, _, @id] = str.unpack("CCn")
xyzodiac has joined #ruby
Meon_ has quit [Ping timeout: 256 seconds]
jrajav has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
bwwrd has joined #ruby
<waxjar> awestroke, assuming that str.unpack returns a three part array: @opcode, _, @id = str.unpack("CCn")
<awestroke> waxjar: oooh. Thanks!
xorgnak has quit [Remote host closed the connection]
a_a_g1 has quit [Quit: Leaving.]
monkegjinni has quit [Read error: No route to host]
lavaca has joined #ruby
matthewrobbins has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
mrbrdo has joined #ruby
_bart has quit [Quit: _bart]
<mrbrdo> hey guys. I have a script where i'm using some parts of a Rails app (AR models more or less). I'm having a problem with comparing TimeWithZone with Time… I required 'active_support/core_ext' and 'active_support/all' too, but the comparison still doesn't take into account the time zone
zenformatics1 has quit [Quit: Leaving.]
monkegjinni has joined #ruby
aquaranto has joined #ruby
lggr has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
mrbrdo has quit [Quit: mrbrdo]
samphippen has quit [Quit: Computer has gone to sleep.]
clocKwize has quit [Read error: Connection reset by peer]
invisime has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<matti> Um.
<matti> shevy shevy shevy shevy
mucker has quit [Quit: leaving]
zenformatics1 has joined #ruby
mucker has joined #ruby
<invisime> matti: you have to do it in front of a mirror with the lights out.
mohits has quit [Ping timeout: 260 seconds]
<shevy> matti I work on my ruby build tools
chrisja has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
fir_ed has quit [Ping timeout: 240 seconds]
w2f2 has quit []
lggr has joined #ruby
RJ3000_ has joined #ruby
nowhere_man has joined #ruby
<nowhere_man> hi all
haxrbyte has quit [Remote host closed the connection]
bend66 has joined #ruby
<nowhere_man> I'm new to ruby and trying rails, and there's something I don't understand with gem
samphippen has joined #ruby
<bend66> ask
haxrbyte has joined #ruby
<nowhere_man> when I do `bundle install`, it ends with "Your bundle is complete!"
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
bend66 has left #ruby [#ruby]
<nowhere_man> but if I do `bundle show` with some dependencies, they are not found
<nowhere_man> "Could not find daemons-1.1.9 in any of the sources"
<nowhere_man> also, bundle install says "Installing eventmachine (1.0.0) with native extensions" when I run it as a user, but just "Using eventmachine (1.0.0)" when run as root
<nowhere_man> I apt-get installed ruby-daemons, ruby-eventmachine and thin, but bundle show still doesn't find them, even after bundle install
<nowhere_man> did I do something wrong?
nopper has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 240 seconds]
GoGoGarrett has joined #ruby
<shevy> sadly, bundler never worked for me
lggr has joined #ruby
<shevy> there can be one problem though
Axsuul has quit [Ping timeout: 240 seconds]
<shevy> remember that debian changes lots of things, including gem default paths
<shevy> "gem env" to show where your gems are
nopper has joined #ruby
<shevy> I myself would not use both apt-get and bundler, debian hates all sorts of non-debian solutions to manage dependencies
darthdeus has joined #ruby
Puck6633 has quit [Ping timeout: 246 seconds]
jeffreybaird has joined #ruby
<kalleth> hmmm
<kalleth> what's an accepted/good way of doing a weighted probability for true/false in ruby?
<kalleth> or any other language, actually
iamjarvo has quit [Ping timeout: 245 seconds]
freeayu__ has quit [Read error: Connection reset by peer]
<kalleth> so i have a 10% 'true' win potential
<kalleth> or 0.1 or however you want to deal with it
wuzzzzaah has quit [Ping timeout: 240 seconds]
<kalleth> and when i call 'is_winner?' i want to return true 10% of the time and false the other 90%
cakehero has joined #ruby
jgarvey has joined #ruby
ewag has quit [Ping timeout: 248 seconds]
<nowhere_man> kalleth: take a random number and see if it's in a certain range
FND has joined #ruby
joofsh has joined #ruby
<shevy> kalleth I usually try to put this into a percentage
<FND> hi - using Net::HTTP for PUT, is there a way to suppress the Content-Type header in the request?
Rydefalk_ has quit [Remote host closed the connection]
Rydefalk has joined #ruby
<kalleth> shevy: so i have a 'probability' attribute on my object which is set to '10' (as a percentage)
<kalleth> so i've got a 10% win rate
<shevy> puts 'Yup, is smaller than 10.' if rand(100) < 10
<kalleth> nowhere_man: I can do that, and that's actually the first thing i thought
<kalleth> yeah, ok
<kalleth> thats simple enough :)
<shevy> well a range is possible too
<kalleth> i guess i was wondering if there was a more rubyist
krawchyk has joined #ruby
<shevy> (1..100).shuffle[0]
<kalleth> if rand(100) in 0..10 or smth
<shevy> oops
wuzzzzaah has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<shevy> (1..100).to_a.shuffle[0]
<shevy> that should return a random element too
replore_ has quit [Remote host closed the connection]
<kalleth> haha
<shevy> but rand() seems easier
<kalleth> yaeh, rand is fine
<shevy> and probably faster
<shevy> and responds to seed
<kalleth> just FSR it seemed a bit hackier
<kalleth> is all
<shevy> hehe
tuxaddicted has joined #ruby
<kalleth> i was hoping there was a Random.weighted(10%, [true, false])
<kalleth> or 0.1, [true, false]
<shevy> hmm
<shevy> what would weighted do again?
<shevy> well you can always wirte a module Random
<shevy> *write
<kalleth> Random.weighted(win_probability, [win_result, loss_result])
<kalleth> produces false false true false false false false false false false
<kalleth> if called 10 times
FND has left #ruby [#ruby]
<kalleth> (statistically)
geekbri has joined #ruby
krawchyk_ has joined #ruby
the_jeebster has joined #ruby
carlyle has joined #ruby
monkegji_ has joined #ruby
lggr has joined #ruby
matthewrobbins_ has joined #ruby
matthewrobbins_ has quit [Client Quit]
<kalleth> but yeah i think rand(0.0..100.0) < win_probability (10.0) is the only real way of doing it
monkegjinni has quit [Read error: No route to host]
justinmcp has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 260 seconds]
gmurphey has quit [Ping timeout: 240 seconds]
<kalleth> (to give extra precision)
<shevy> hmm
<kalleth> (as 100 levels of probability isn't enough :))
<shevy> I think I need to read a book on statistics again
<shevy> then I could use fancy terms
<kalleth> well, i'm writing a test that will call this method 100,000 times and give me the output to show if a 10% win percentage wins 10% of the time
<shevy> "Here we will use the randomly weighted win probability of anyone of you folks going to Las Vegas."
<kalleth> lol
dhruvasagar has quit [Ping timeout: 260 seconds]
<heftig> kalleth: def rand_weighted(weight_hash); target = rand(weight_hash.values.inject(:+)); weight_hash.each { |x, weight| target -= weight; return x if weight < 0 }; end
<shevy> 100.000 times... 10 %percet... 10.000
<shevy> percent
<kalleth> heftig: duh
<kalleth> what
<heftig> takes a hash like { false => 90, true => 10 }
<heftig> integer weights only
Jork1 has joined #ruby
yalue has joined #ruby
<kalleth> interesting
* kalleth expands into a gist to understand it better
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<kalleth> target = rand(total of true/false)
replore has joined #ruby
<kalleth> heftig: interesting
* kalleth simulates
<heftig> kalleth: ah whoops
<heftig> made an error, should be target < 0
krawchyk has quit [Ping timeout: 260 seconds]
matthewrobbins has quit [Ping timeout: 245 seconds]
freeayu has joined #ruby
<kaleido> numbers
<kaleido> makes me wish id paid attention in math years ago
ksinkar has joined #ruby
Takehiro has quit [Remote host closed the connection]
leehambley has joined #ruby
ffranz has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
robustus has joined #ruby
<workmad3> kaleido: if you need more than 1% granularity with heftig's solution, change the target to 'target = rand * weight_hash.values.inject(:+)' although I don't know that it will significantly alter the distribution of 'wins'
duracrisis has joined #ruby
duracrisis has quit [Changing host]
duracrisis has joined #ruby
<heftig> workmad3: why is this limited to 1% granularity?
Rydefalk has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
<kalleth> irb(main):045:0> results.select{|a| a == :true}.size
<kalleth> => 90056
<kalleth> => 9944
<kalleth> irb(main):046:0> results.select{|a| a == :false}.size
<kalleth> not bad, heftig
haxrbyte has joined #ruby
Takehiro has joined #ruby
<workmad3> heftig: ah, good point, can just use 9000 and 1000 as values
<heftig> or 9 and 1
<shevy> sometimes I'd wish everyone would speak english
Rochefort has joined #ruby
<shevy> half the time I seem to write in english, half the time in german
<heftig> nah, klingon
lggr has joined #ruby
MikeyV27 has quit [Quit: MikeyV27]
daniel_- has quit [Ping timeout: 246 seconds]
<workmad3> kaleido: one other thing to note - you should be careful with writing your test for this method as it's entirely possible (although unlikely) that some runs of your method will produce 0% wins, or 100% wins... that being the 'fun' of randomness after all ;)
<kalleth> workmad3: press tab more than once pls ;p
<kalleth> but yeah, that's as intended
<workmad3> kalleth: sorry :)
<kalleth> the client wants 'random' outcomes rather than 'every 10 times 1 person wins'
<kalleth> i.e. non-deterministic
xyzodiac has joined #ruby
<workmad3> kalleth: yeah, just makes testing it more difficult ;)
<kalleth> well, it's a computer generating randomness, so :)
<workmad3> kalleth: http://dilbert.com/strips/comic/2001-10-25/ <-- I love that :)
<workmad3> kalleth: yeah, which makes it deterministically random if you know the seed and the algorithm
<kalleth> workmad3: this is to determine if people 'win' when clicking 'give me a prize!'
<jcoglan> is anyone in here familiar with the openssl module?
<kalleth> (with flood protection)
<matti> invisime: You mean, the shevy incantation? ;]
<kalleth> asked the client if they wanted '1 in 10' and they said they wanted unpredictability, so *shrug*
<workmad3> kalleth: cool :)
xyzodiac has quit [Client Quit]
<kalleth> my test is going to be 'simulate someone clicking 100,000 times. show what prizes have been won'
RJ3000_ has quit [Remote host closed the connection]
<kalleth> and there's a max quantity on prize too
<workmad3> kalleth: out of curiosity... how 'expensive' would it be if someone figured out how to game the system?
rippa has joined #ruby
<kalleth> workmad3: there's a top limit
<workmad3> kalleth: and therefore, is SecureRandom warranted?
<kalleth> so you have a win_probability, then you have a prize_probability for each prize level
<kalleth> and each prize level has a quantity_remaining
<kalleth> and its not automated shipping of prizes, so the admins would just go 'DELETE YOU HACKER'
<kalleth> physical items mostly
_Mon_Ouie_ has joined #ruby
<workmad3> :)
MikeyV27 has joined #ruby
<kalleth> there's flood protection as its an FB app
fir_ed has joined #ruby
pen has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<kalleth> so we have an fb ID for each user, and we prevent each user clicking more than 10 times
RJ3000_ has joined #ruby
prtksxna has joined #ruby
<kalleth> its certainly going to be possible to game it but we have the human involvement at the last stage to stop that, so in longhand: no, i don't _think_ secure random is justified :)
<kalleth> though i will look it up now, workmad3 :)
<kalleth> interesting
<kalleth> so its a direct /dev/urandom / openssl feed
<kalleth> well, 'direct'
Rydefalk has joined #ruby
matthewrobbins has joined #ruby
lggr has joined #ruby
replore has quit [Remote host closed the connection]
CodeFriar has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
linoj has joined #ruby
Criztian_ has joined #ruby
kiyoura has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
Pochacco has joined #ruby
Criztian_ has quit [Read error: Connection reset by peer]
Criztian has joined #ruby
LouisGB has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Quit: Leaving.]
lggr has joined #ruby
triptec has quit [Quit: triptec]
faitswulff has joined #ruby
rodasc has joined #ruby
crodas has quit [Read error: Connection reset by peer]
Sou|cutter has joined #ruby
joshman_ has joined #ruby
<jcoglan> anyone know if the aes-256-gcm support in this patch is available as a library? http://bugs.ruby-lang.org/issues/6980
lggr has quit [Ping timeout: 246 seconds]
matthewrobbins has quit [Quit: matthewrobbins]
lggr has joined #ruby
mgates has joined #ruby
_JamieD_ has quit [Remote host closed the connection]
csmrfx has joined #ruby
_JamieD_ has joined #ruby
<csmrfx> Ideas on how to remove non-numerals from a string? I get weird things like "\"1" or "2\""
<_Mon_Ouie_> delete "^0-9"
AlecTaylor has joined #ruby
_Mon_Ouie_ is now known as Mon_Ouie
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
vderyagin has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
<csmrfx> hm, I need the numerals
<csmrfx> ah nm
uris has joined #ruby
<Mon_Ouie> It's like character clases in regexp, "^" means not, "-" means range
erichmenge has joined #ruby
<csmrfx> Yes
<csmrfx> There is something else wrong here
matthewrobbins has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
lggr has joined #ruby
AlecTaylor has quit [Client Quit]
Virunga_ has joined #ruby
Virunga has quit [Read error: Connection reset by peer]
nwest has joined #ruby
Takehiro has quit [Remote host closed the connection]
haxrbyte_ has joined #ruby
stopbit has joined #ruby
RJ3000_ has quit [Max SendQ exceeded]
haxrbyte has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
craigp has quit [Quit: craigp]
RJ3000_ has joined #ruby
krawchyk_ has quit [Remote host closed the connection]
krawchyk has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
chimay has joined #ruby
<csmrfx> does work, thanks matthewrobbins
<csmrfx> I mean
<csmrfx> thank you Mon_Ouie 8)
matthewrobbins has quit [Quit: matthewrobbins]
sagax has quit [Quit: Ухожу я от вас]
soulisson has joined #ruby
soulisson has quit [Client Quit]
kpshek has joined #ruby
_JamieD_ has quit [Quit: _JamieD_]
duracrisis has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
bwwrd has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
artm has quit [Quit: artm]
artm has joined #ruby
Squarepy has quit [Read error: Operation timed out]
monkegji_ has quit [Read error: No route to host]
kpshek has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 260 seconds]
monkegjinni has joined #ruby
nitti has joined #ruby
g-ram has joined #ruby
pen has quit [Remote host closed the connection]
lggr has joined #ruby
blazes816 has quit [Quit: blazes816]
haxrbyte_ has quit [Ping timeout: 260 seconds]
haxrbyte has joined #ruby
mrbrdo has joined #ruby
wuzzzzaah has quit [Ping timeout: 255 seconds]
<ddd> anyone know if there is a gem available that would graph or show what sections of each gem my code hits exactly. like what methods in what classes in which gems got hit, caused by this line of code I wrote. i have cover_me which just shows what code I wrote was executed by my tests (which gives me percentage of code coverage I have, per file and overall)
haxrbyte_ has joined #ruby
zommi has quit [Quit: Leaving.]
cburyta has joined #ruby
iamjarvo has joined #ruby
eikko has joined #ruby
TheFuzzball has quit [Ping timeout: 248 seconds]
tonini has quit [Remote host closed the connection]
rmillerx has joined #ruby
TheFuzzball has joined #ruby
TheFuzzball has quit [Excess Flood]
haxrbyte has quit [Ping timeout: 256 seconds]
jrajav has quit []
akemEikko has quit [Ping timeout: 256 seconds]
ltsstar has joined #ruby
TheFuzzball has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Vert has joined #ruby
cburyta has quit [Ping timeout: 248 seconds]
kpshek has joined #ruby
TheFuzzball has quit [Excess Flood]
tagrudev has quit [Remote host closed the connection]
TheFuzzball has joined #ruby
_bart has joined #ruby
lggr has joined #ruby
moeSeth has joined #ruby
Squarepy has joined #ruby
<TTilus> ddd: configure coverme to include the paths you want, see https://github.com/markbates/cover_me#configuration
blazes816 has joined #ruby
whackatre has joined #ruby
wuzzzzaah has joined #ruby
dr_bob has quit [Read error: Connection reset by peer]
kiddorails has joined #ruby
<_axx> hey guys, what unix OS do you prefer for your ruby/rails apps? Debian or Ubuntu?
mmitchell has joined #ruby
<ddd> ahh so rather than a output list of Class.method calls, just use the fact that it color codes what was hit provided i add the GEM_DIR, you mean
<matti> _axx: Ubuntu is a flavour of Debian.
<matti> _axx: Makes almost no difference.
haxrbyte_ has quit [Ping timeout: 246 seconds]
<matti> _axx: OS is Linux, Debian and Ubuntu are Linux distributions.
<matti> _axx: :)
<ddd> and Linux is just the kernel. (which debian shocases with their project name: Debian GNU/Linux)
<ddd> s/sho/show/
<kalleth> workmad3: fancy some late-lunchtime reading?
<kalleth> ^ wondering what you think of that :)
dr_bob has joined #ruby
mengu has joined #ruby
irleif has joined #ruby
<_axx> matti: i know about the debian/ubuntu specs, but i have the feeling many ruby people prefer ubuntu much more (i use debian for years and found this very strange)
samphippen has quit [Quit: Computer has gone to sleep.]
quest88 has joined #ruby
<_axx> the thing is, debian is much more restrictive about the packages etc. i don't know if this is a problem for some native extensions ruby gems include
<ddd> _axx: because Ubuntu uses more recent versions of the libraries and applications by default than debian stable does.
<ddd> that and their restrictive nature on pacakges
<ddd> (debian's)
<matti> _axx: I prefer Debian for lack of retardness.
<matti> _axx: And simplicity and minimalism.
<_axx> me too
<matti> ;]
<bigkevmcd> matti: I'm guessing you know you can install a minimal ubuntu install?
ryanlecompte has joined #ruby
<matti> With things like FPM, you package whatever you want.
<matti> bigkevmcd: Sure.
lggr has quit [Ping timeout: 264 seconds]
xorgnak has joined #ruby
<_axx> but i hear often that people on conferences talk about their stack and talk about ubuntu and my first tought is "ubuntu? that's for desktops!" :D
<bigkevmcd> matled: so, when you say "simplicity and minimalism." what are you referring to?
<bigkevmcd> ooops
<bigkevmcd> matti: ^^^
S1kx has joined #ruby
<csmrfx> I think that for production debian and ubuntu have some meaningful diffrences
pen has joined #ruby
lggr has joined #ruby
<_axx> what of the two OSes to you guys think would fit rubys needs better? (because of the newer packages etc.)
<csmrfx> I believe more on-topic channel would be #linux or #debian, though
<kalleth> _axx: ubuntu is pretty reasonable, honestly
<kalleth> just don't use package managers for ruby
<ddd> I prefer Ubuntu because I like their general layout, default package choices, configuration choices, etc. But I used Debian for years too. Its really a personal choice decision. I'll always use a debian based distribution. I think apt/dpkg is far superior to RPM, so will not use RPM based distributions. Again, its a personal choice thing.
<ddd> kalleth++
<ddd> rvm or rbfu for ruby over pkg managers
Hamed-R has quit [Quit: Leaving]
<kalleth> we use ubuntu for hosting ~200 client sites (1 per custom vps which they pay for and we bank a 'maintenance fee' for each one)
<kalleth> so we don't have to us rbenv or rbfu or rvm
fridim_ has joined #ruby
<kalleth> we juts have a system ruby install for each vps
jrajav has joined #ruby
<kalleth> i use rbenv for local dev though
no_worries has joined #ruby
<ddd> i'm obviously an rvm guy. however, any of the ruby managers does the trick. use the one most suited to you, is my thinking
cearls has joined #ruby
<matti> bigkevmcd: JeOS-ish.
asteve has joined #ruby
xyzodiac has joined #ruby
<matti> I am not willing to have advocacy flame here, so choose whatever works for you ;]
virtualentity has joined #ruby
<bigkevmcd> indeed
heftig has quit [Quit: leaving]
<bigkevmcd> not the appropriate place
<ddd> matti: no no, my comment was specifically about *not* having a flamewar :)
<matti> +1 ;]
<_axx> do you see any problems while sticking to the basic ruby that's included in debian/ubuntu? as far as i know does wheezy have 1.9.2 preinstalled
artm has quit [Ping timeout: 256 seconds]
ryanlecompte has quit [Remote host closed the connection]
mrbrdo has quit [Quit: mrbrdo]
<csmrfx> you wont be able to follow guides, necessarily, _axx
<csmrfx> debian may have it's own way so complex gems sometimes do now work off the rack (like rails traditionally)
<_axx> yeah, that's a problem i sometimes encounter with debian
<csmrfx> otoh in production you may want to customize anyway
<_axx> especially with eventmachine, debian can sometimes be a pain in the ass
* csmrfx has used the stock debian 1.9.2 all day actually
quest88 has quit [Quit: quest88]
<csmrfx> it's run on squeeze with "ruby1.9.1" 8P
<csmrfx> kinda silly
beneggett has joined #ruby
<csmrfx> but yes works fine
mohits has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 256 seconds]
<csmrfx> and in fact debian is moving forward...
jgwong has joined #ruby
erichmenge has quit [Quit: Be back later]
replore_ has joined #ruby
<kalleth> ddd: i'm not a fan of using version managers in production
<csmrfx> in Squeeze you actually have both ruby1.8 and ruby1.9.1 by default afaics
<kalleth> given how cheap cloud is its easier juts to provision a new VPS with systemwide ruby for each site, honestly
<kalleth> removes a layer of complexity
<kalleth> imo
lggr has joined #ruby
piotr__ has joined #ruby
blazes816 has quit [Quit: blazes816]
piotr_ has quit [Ping timeout: 260 seconds]
und3f has quit [Quit: Leaving.]
<ddd> kalleth: yep. i know many in both 'camps'. another personal administrative choice i guess
<kalleth> idd :)
<kalleth> we have a puppet config for our boxen, so we just go 'provision new, apt-get install puppet, modify hosts file', 'git push production'
<kalleth> and our rails/rack apps are running
<ddd> nice
wuzzzzaah has quit [Ping timeout: 246 seconds]
Takehiro has quit [Remote host closed the connection]
<csmrfx> you has git post-commit hooks or does puppet do all the footwork, kalleth ?
replore_ has quit [Ping timeout: 240 seconds]
jellosea has joined #ruby
<csmrfx> uh, i mean post-receive
<_axx> kalleth: that's also my concern. i don't like version managers on production systems
<_axx> i have the feeling, that they're not "robust" enough
samphippen has joined #ruby
<kalleth> csmrfx: puppet sets up the initial clone of the git repo then you push to production and the git repo as setup by puppet has a standard post-recieve hook that recompiles assets and restarts passenger
<kalleth> if required
<kalleth> _axx: i just want to be 100% sure i know what i'm using on production is all
<kalleth> though i am liking rbenv lately
<_axx> at the moment i'm looking for a nice tool to preinstall a full rails environment (mysql, mongodb, imagemagick etc.) but without something like puppet or chef.
<csmrfx> mmmkay
<kalleth> _axx: puppet or chef? :p
<_axx> nope
<_axx> without those guys. :)
<kalleth> honestly though, you could probably use a bash script
<kalleth> host it somewhere like github
<_axx> yeah, that would be the best way i guess
<kalleth> and then do curl github.com/script-url.sh | sh
<_axx> yep
<csmrfx> my plan exactly
<kalleth> its how brew installs itself, f.e.
<csmrfx> without github, tho
<kalleth> well, remote url
<kalleth> can be anything
kiyoura has quit [Quit: Leaving]
<kalleth> but then again
<csmrfx> yup, torious
<_axx> yeah, we maintaine an self-hosted gitlab install
<kalleth> why re-implement a package manager yourself in bash
lggr has quit [Ping timeout: 256 seconds]
<kalleth> if you know what env you're going to be using
<kalleth> just ... uh...
<kalleth> make a package?
mark_locklear has quit [Remote host closed the connection]
<kalleth> dpkg -i axx-rails-env.deb
<kalleth> 'depends on: postgres ruby-1.9.3 passenger apache2'
<kalleth> etc
RJ3000_ has quit [Ping timeout: 264 seconds]
<_axx> hm, i don't have any experience with creating packages :D
<kalleth> neither do i
<kalleth> but i'm told its relatively simple
<_axx> good!
<_axx> :D
<kalleth> (heh, 'simple')
<csmrfx> dpkg should be reliable
whackatre has quit [Remote host closed the connection]
<kalleth> anyway
<kalleth> deadline etc
bradleyprice has joined #ruby
* csmrfx has installed kernels as packages
<kalleth> must get back to work :)
<csmrfx> handy
<_axx> kalleth: ok, thanks so far! :)
S1kx has quit [Quit: Leaving]
nitti has quit [Remote host closed the connection]
Pochacco has quit [Quit: Pochacco]
<csmrfx> I must get out of work!
<csmrfx> 8)
whackatre has joined #ruby
<_axx> i'm just starting
<_axx> :D
<ddd> kalleth: debian/rules file for dpkg is rather easy. creating a debian package is dead simple. they also have a guide/book on it in the packages list
Takehiro has joined #ruby
<_axx> ddd: any links you could provide? :)
<csmrfx> #linux or #debian
<_axx> oh, yeah. better place for that
<_axx> :D
samuel02 has quit [Remote host closed the connection]
nitti has joined #ruby
lggr has joined #ruby
<ddd> _axx: see msg
bluenemo has quit [Remote host closed the connection]
wuzzzzaah has joined #ruby
tk___ has quit [Quit: ばいばい]
mark_locklear has joined #ruby
ryanlecompte has joined #ruby
Xeoncross has joined #ruby
bluenemo has joined #ruby
kpshek has quit []
prtksxna has quit [Ping timeout: 245 seconds]
murz has joined #ruby
gmurphey has joined #ruby
schronicles47 has joined #ruby
freeayu has quit [Remote host closed the connection]
maesbn has quit [Remote host closed the connection]
schronicles47 has quit [Remote host closed the connection]
J2EE has quit [Ping timeout: 246 seconds]
kiddorails has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 240 seconds]
mikepack has joined #ruby
eldariof has quit [Ping timeout: 264 seconds]
snearch has quit [Quit: Verlassend]
nitti has quit [Ping timeout: 255 seconds]
J2EE has joined #ruby
csmrfx has left #ruby ["latertater"]
elsifaka has quit [Quit: Veloma e!]
beneggett has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
schronicles47 has joined #ruby
schronicles4794 has joined #ruby
schronicles4794 has quit [Remote host closed the connection]
sent-hil has joined #ruby
replore has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
davidcelis has quit [Quit: K-Lined.]
blazes816 has joined #ruby
mvangala has joined #ruby
glupo has quit [Remote host closed the connection]
sspiff has quit [Remote host closed the connection]
anachronistic has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
bbttxu_ has joined #ruby
nitti has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
darthdeus has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
mahmoudimus has joined #ruby
larissa has quit [Quit: Leaving]
beneggett has joined #ruby
maletor has joined #ruby
jprovazn is now known as jprovazn_away
xyzodiac has quit [Quit: Computer has gone to sleep.]
Neomex has quit [Remote host closed the connection]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
nitti has quit [Remote host closed the connection]
Neomex has joined #ruby
lggr has joined #ruby
Xeoncross has quit [Quit: Ex-Chat]
wuzzzzaah has quit [Ping timeout: 246 seconds]
Neomex has quit [Client Quit]
linoj has quit [Quit: linoj]
Rydefalk_ has joined #ruby
maletor has quit [Ping timeout: 245 seconds]
Meon__ has quit [Quit: Leaving]
margle has quit [Quit: Computer has gone to sleep.]
Rydefalk has quit [Ping timeout: 244 seconds]
lampe2 has joined #ruby
naquad has quit [Excess Flood]
nitti has joined #ruby
iamjarvo has joined #ruby
PapaSierra has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
PapaSierra has left #ruby [#ruby]
naquad has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
lggr has joined #ruby
wuzzzzaah has joined #ruby
deadghost has quit [Ping timeout: 244 seconds]
aganov has quit [Quit: aganov]
no_worries has quit [Remote host closed the connection]
artm has joined #ruby
linoj has joined #ruby
xyzodiac has joined #ruby
kuzushi has quit [Ping timeout: 246 seconds]
darthdeus has quit [Read error: Connection reset by peer]
darthdeu has joined #ruby
artm has quit [Client Quit]
lggr has quit [Ping timeout: 264 seconds]
deadghost has joined #ruby
_bart has left #ruby [#ruby]
artm has joined #ruby
leehambley has left #ruby [#ruby]
xorgnak has quit [Remote host closed the connection]
arielpts- has joined #ruby
maesbn has joined #ruby
lggr has joined #ruby
IrishGringo has joined #ruby
murz has quit [Quit: Leaving...]
arielpts has quit [Ping timeout: 245 seconds]
Virunga_ is now known as Virugna
froy has joined #ruby
<rking> Hrm. There's gotta be something better than this: ['a'..'z', 'A'..'Z', %w(* $ @ !)].inject [] do |a,e| a += e.to_a end
<rking> (Has to be 1.8-compatible, BTW)
wallerdev has joined #ruby
ananthakumaran has joined #ruby
mahmoudimus has quit [Ping timeout: 246 seconds]
dominikh has quit [Remote host closed the connection]
<asteve> what's the easiest way to get the date 3 days ago?
cascalheira has joined #ruby
micha_ has joined #ruby
dominikh has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
kuzushi has joined #ruby
<rking> asteve: AFAIK the easiest thing is to use activesupport stuff.
wuzzzzaah has quit [Ping timeout: 246 seconds]
<oz> asteve: if you loaded activesupport it's Time.now - 3.days
RJ3000_ has joined #ruby
<rking> 3.days.ago
etehtsea has quit [Quit: Computer has gone to sleep.]
ckrailo has joined #ruby
lggr has joined #ruby
micha_ has quit [Client Quit]
lampe2 has quit [Ping timeout: 260 seconds]
wuzzzzaah has joined #ruby
lampe2 has joined #ruby
<asteve> rking: oz thanks
irleif has joined #ruby
insulator has joined #ruby
<oz> rking: indeed :)
burgestrand has quit [Quit: Leaving.]
monkegjinni has quit [Ping timeout: 255 seconds]
devtro has joined #ruby
Synthead has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
spinagon has joined #ruby
rippa has quit [Read error: Connection reset by peer]
nitti has quit [Ping timeout: 245 seconds]
baphled has quit [Ping timeout: 255 seconds]
nitti has joined #ruby
deadghost has quit [Ping timeout: 240 seconds]
wedtm|away is now known as wedtm
lggr has quit [Ping timeout: 245 seconds]
mahmoudimus has joined #ruby
khakimov has joined #ruby
hadees has quit [Quit: hadees]
<rking> Hrm. Re my previous thing, this works as well: (0..255).map(&:chr).grep /[a-z\d*$@!]/i
<rking> But that's worse.
monkegjinni has joined #ruby
lggr has joined #ruby
Jeena has joined #ruby
`brendan has joined #ruby
nitti has quit [Remote host closed the connection]
ryanlecompte has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
Criztian has quit [Remote host closed the connection]
darthdeu has quit [Quit: Leaving...]
tuxaddicted has quit [Quit: leaving]
voodoofish430 has joined #ruby
bbttxu_ has quit [Ping timeout: 245 seconds]
nitti has joined #ruby
RJ3000_ has joined #ruby
jgrevich has joined #ruby
artm has quit [Quit: artm]
evilsushi has left #ruby [#ruby]
lggr has quit [Ping timeout: 246 seconds]
<ddd> ok why can't i do @my_hash = { 1: "one", 2: "two" } but I can do @my_hash = { one: 1, two: 2 }. I get SyntaxError: unexpected ',', expecting $end when I do the first
lggr has joined #ruby
awarner has joined #ruby
wuzzzzaah has quit [Ping timeout: 246 seconds]
<lukaszk> ddd: :1 is not a valid symbol
<lukaszk> { 1: 'one' } is equivalent to { :1 => 'one' }
<ddd> lukaszk: fails even if I do "1":
AlbireoX has joined #ruby
maesbn has quit [Remote host closed the connection]
frogprince has quit [Ping timeout: 246 seconds]
<ddd> ahh inability to convert 1.to_s.to_sym? But "1": "one" is the same thing but it still fails
BigFatFatty has joined #ruby
<ddd> doing "1": is the same thing as 1.to_s.to_sym
<ddd> still fails
<lukaszk> I don't think it works like that in hash shorthand syntax
sagax has joined #ruby
daniel_- has joined #ruby
<ddd> gotcha. thanks
carloslopes has quit [Quit: Leaving.]
JonnieCache has quit [Ping timeout: 246 seconds]
wuzzzzaah has joined #ruby
DrShoggoth has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
daniel_hinojosa has joined #ruby
Rochefortes has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
Rochefort has quit [Read error: Connection reset by peer]
no_worries has joined #ruby
irleif has joined #ruby
Rochefort has joined #ruby
davidcelis has joined #ruby
petrjanda has quit [Quit: petrjanda]
williamherry has quit [Ping timeout: 256 seconds]
theRoUS has quit [Ping timeout: 255 seconds]
davidcelis has quit [Read error: Connection reset by peer]
davidcelis_ has joined #ruby
heftig has joined #ruby
RJ3000_ has quit [Remote host closed the connection]
wuzzzzaah has quit [Ping timeout: 276 seconds]
lggr has joined #ruby
fir_ed has quit [Read error: Connection reset by peer]
mvangala has quit [Read error: Connection reset by peer]
fir_ed has joined #ruby
mvangala has joined #ruby
Rochefortes has quit [Ping timeout: 246 seconds]
stephenjudkins has joined #ruby
wuzzzzaah has joined #ruby
thisirs has quit [Remote host closed the connection]
RJ3000_ has joined #ruby
davidcelis_ is now known as davidcelis
catphish_ has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
ahuman has quit [Quit: No Ping reply in 180 seconds.]
ahuman has joined #ruby
<catphish_> why would i likely see this: Cannot allocate memory - fork(2)
cearls has quit [Remote host closed the connection]
<catphish_> isn't fork pretty much memory-free?
samphippen has joined #ruby
<davidcelis> why would it be memory free
erichmenge has joined #ruby
cburyta has joined #ruby
<catphish_> linux uses COW for fork
<catphish_> and the new process has its own virtual space
vjt has quit [Ping timeout: 272 seconds]
wpaulson has joined #ruby
vjt has joined #ruby
<catphish_> so wouldn't the new fork be the same size as the old one virtually
<davidcelis> perhaps your script itself has a memory leak
<catphish_> and pretty much zero physically
<catphish_> i don't understand why that would cause fork to fail
<davidcelis> because it runs out of memory?
<catphish_> fork is a single operation
<Eiam> the operation it runs requires resources...?
<catphish_> fork is an operation on its own
<catphish_> it doesn't run anything else other than itself
<catphish_> " fork() failed to allocate the necessary kernel structures because memory is tight."
<catphish_> maybe i just had no memory at that moment
rehat has joined #ruby
<Eiam> uh
<Eiam> fork duplicates the calling process
<catphish_> correct
lggr has quit [Ping timeout: 245 seconds]
frogprince has joined #ruby
<Eiam> so its going to take as much memory as the calling process did at the time it was called
<rehat> is there a way to use the permutations method on two different arrays
<catphish_> incorrect
<rehat> ??
<catphish_> it allocates the same amount of memory, but the actual usage is very small
<catphish_> because they share pages
Rochefort has quit [Remote host closed the connection]
Jork1 has quit [Quit: Jork1]
stephenjudkins has quit [Quit: stephenjudkins]
nitti has quit [Remote host closed the connection]
cburyta has quit [Ping timeout: 245 seconds]
<davidcelis> you just said it allocates the same amount of memory
irleif has quit [Quit: Computer has gone to sleep.]
<davidcelis> and your error was "Cannot allocate memory"
<Eiam> ^
<rehat> like [1,2,3,4,5] and [6,7,8,9,0] and get a permutation of two element arrays with one item from array 1 and one item from array 2?
<davidcelis> even if the memory usage itself is small, it has to allocate it. your script couldn't
<catphish_> davidcelis: it's hard to explain unless you understand COW and virtual memory
<Eiam> im worried you may not understand memory? =0
futilegames has quit [Quit: futilegames]
bbttxu_ has joined #ruby
<catphish_> allocating memory doesn't actually consume it, and forking allocates a duplicate set of memory, but it shares the physical memory with the original process
lggr has joined #ruby
<Eiam> catphish_: note that even under page sharing, a "copy of all pages to the parent process are created and loaded into a seperate memory location"
skogis has quit [Ping timeout: 256 seconds]
<Eiam> no
<Eiam> only in certain cases does it not need to duplicate
<Eiam> not in all.
<catphish_> why would that happen
frogprince_mac has joined #ruby
<catphish_> "Under Linux, fork() is implemented using copy-on-write pages, so the only penalty that it incurs is the time and memory required to duplicate the parent's page tables, and to create a unique task structure for the child. "
nitti has joined #ruby
<catphish_> where are you reading from?
<Eiam> COW is only utilized in certain cases, not all
<Eiam> those cases look like when the child executes an exec or exits very soon after fork()
frogprince has quit [Ping timeout: 240 seconds]
<Eiam> otherwise, you pay the memory cost
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
snearch has joined #ruby
chrishunt has joined #ruby
faitswulff has quit [Ping timeout: 240 seconds]
<catphish_> Eiam: afaik linux always uses cow
yshh has quit [Remote host closed the connection]
Jork1 has joined #ruby
thmzlt has joined #ruby
senny has quit [Remote host closed the connection]
<oz> and goats
ncr100 has joined #ruby
Jeena has left #ruby [#ruby]
Virugna has quit [Remote host closed the connection]
<oz> (sorry)
snearch has quit [Client Quit]
timonv has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
frogprince has joined #ruby
hadees has joined #ruby
<catphish_> lol
cantonic_ has joined #ruby
dr_bob has quit [Quit: Leaving.]
sent-hil has quit [Remote host closed the connection]
skogis has joined #ruby
sent-hil has joined #ruby
lggr has joined #ruby
thmzlt has quit []
<rking> The deal is that Ruby ≤ 1.9 does writes everywhere, wasting copy-on-write benefits.
cantonic has quit [Ping timeout: 246 seconds]
cantonic_ is now known as cantonic
<rking> REE or Ruby 2.0 fixes that.
Morkel has quit [Quit: Morkel]
deadghost has joined #ruby
<catphish_> ah ruby 2.0
<catphish_> does that happen during the fork?
mgates has quit [Quit: mgates]
<rking> No it's just the GC writes to the locations all over memory
<rking> So even if you only read 100% of the time, you still get writes to the actual pages, causing the OS to do the on-write copy.
bricker has joined #ruby
<catphish_> that makes sense, but i'm still confused how fork() itself would fail
<catphish_> Errno::ENOMEM: Cannot allocate memory - fork(2)
iamjarvo has quit [Ping timeout: 245 seconds]
<rking> Ah, sorry, I didn't read teh scrollback.
<catphish_> something must be alloc'd during the fork
<catphish_> or the kernel itself ran out of memory at that moment
<rking> catphish_: Do you have this reduced down to a gist-sized thing?
<catphish_> rking: nope, in fact this was a one-off error in a production environment
<catphish_> so i don't have any background on the state of the system at the time
<rking> I wonder if maybe the ENOMEM is being reused for having overrun some other limit, like total # of procs or something.
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
<rking> No, that'd be EAGAIN
<catphish_> a quick google indicates that it can be caused by file descriptor limits etc, but that may be incorrect
<catphish_> fork() failed to allocate the necessary kernel structures because memory is tight.
<catphish_> acording to the linux man page
daniel_hinojosa has quit [Ping timeout: 246 seconds]
<rking> catphish_: If it happens too much, what I'd do is hunt the exception down stalker style.
<rking> Like use pry-rescue and wait for it to happen.
<rking> It's extremely hard to guess without replication.
lggr has quit [Ping timeout: 260 seconds]
<catphish_> i have a tool that dumps a stack trace if any of my processes use more than 4GB of RAM
<catphish_> will check those logs
a_a_g has joined #ruby
<rking> Yeah
<catphish_> something did get killed at that moment
darthdeus has joined #ruby
<catphish_> my guess: one process alloc'd all my RAM, and the fork in another process failed as a result
<catphish_> i really need to work out how to set up proper ulimits
<rking> Hrm.
shadoi has joined #ruby
lggr has joined #ruby
<catphish_> ah yes, i have a customer with a 1.2GB file upload to my web app
<catphish_> which is being buffered instead of streamed
<rking> Cool customer, bro.
jrajav has quit []
arturaz has quit [Ping timeout: 246 seconds]
<catphish_> lol
timmow has quit [Ping timeout: 252 seconds]
<rking> I think you're right re: setting limits being the answer.
<catphish_> every time they download it, massive memory spike, i guess one of those exhausted my server momentarily
djbender has joined #ruby
Rochefort has joined #ruby
stkowski has joined #ruby
bluenemo has quit [Remote host closed the connection]
evilsushi has quit [Quit: Lost terminal]
Rochefort has left #ruby [#ruby]
jcoglan has quit [Ping timeout: 248 seconds]
<catphish_> thanks :)
whaley has joined #ruby
chrismcg is now known as zz_chrismcg
lggr has quit [Ping timeout: 260 seconds]
SegFaultAX|work has joined #ruby
<rking> Urr, that *plus* streaming I mean.
Agis__ has joined #ruby
sent-hil has quit [Remote host closed the connection]
Uranio has joined #ruby
lggr has joined #ruby
<catphish_> indeed :)
<catphish_> don't want to break the functionality :)
daniel_hinojosa has joined #ruby
beneggett has quit [Read error: Operation timed out]
<catphish_> is there a simple way to make File.read an enum?
<catphish_> that reads blocks
mrsolo has joined #ruby
margle has joined #ruby
<catphish_> because return [File.read(bigfile)] is just dumb
<Uranio> there is something for "dialogue" with forms in webpages
lampe2 has quit [Ping timeout: 255 seconds]
<Uranio> for exmaple, filling form, aquth, get the cookie and go ahead
<RubyPanther> catphish_: generally you much better off if you can have your webserver accept the file uploads
<Uranio> exmaple = example
<catphish_> RubyPanther: lets assume i can't :)
<RubyPanther> catphish_: then it will most likely be slow for large files
<catphish_> RubyPanther: it's not
<catphish_> RubyPanther: ruby is more than capable of processing data at 100Mbps
zigomir has quit [Quit: Leaving]
<RubyPanther> by "slow" I mean, consume excess resources.
<catphish_> is is, hence my question
<catphish_> turning File.read into an enum will fix it
lggr has quit [Ping timeout: 246 seconds]
<RubyPanther> it is truly unavoidable with a higher level language, if you want it not to do that, write it as a C extension.
<catphish_> RubyPanther: no, turning File.read into an enum will fix it
<catphish_> it will simply read the file in suitable blocks
<RubyPanther> Or better, pass off to a webserver and have it notify a long-running process when it is finished, and have the web app communicate with the long-running-process.
jimeh2 has quit [Ping timeout: 252 seconds]
lampe2 has joined #ruby
gani has joined #ruby
replore has quit [Remote host closed the connection]
shevy2 has joined #ruby
alfism has joined #ruby
sagax has quit [Read error: Operation timed out]
carloslopes has joined #ruby
sneakyness_wk has joined #ruby
lggr has joined #ruby
<catphish_> isn't there a shortcut way to create an emun with a block?
<catphish_> Enumerator.new
stkowski_ has joined #ruby
A1241 has joined #ruby
wuzzzzaah has quit [Quit: wuzzzzaah]
shevy has quit [Ping timeout: 264 seconds]
A1241 has quit [Client Quit]
stkowski has quit [Read error: Connection reset by peer]
stkowski_ is now known as stkowski
lampe2 has quit [Ping timeout: 256 seconds]
lukaszk has quit [Ping timeout: 246 seconds]
A124 has quit [Ping timeout: 240 seconds]
<rking> catphish_: My biggest objection to that approach is the sheer waste of problem-solving. If you can beat nginx at file transfers, I'll give you $#{some_inordinate_number}.00.
sagax has joined #ruby
<rking> And I'll also pay the taxes.
werdnativ has joined #ruby
<catphish_> rking: i do agree in principle
<rking> Just let the frontend server do its job, then handle it within the backend as a solved problem
<catphish_> especially since i'm streaming from a file
ephemerian has quit [Quit: Leaving.]
atmosx has joined #ruby
apok has joined #ruby
jlebrech has quit [Read error: Operation timed out]
a_a_g has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 255 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
stephenjudkins has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
slainer6_ has quit [Remote host closed the connection]
abstrusenick has quit [Quit: abstrusenick]
Iszak has quit [Quit: User has gone to sleep.]
mucker has quit [Quit: leaving]
lggr has joined #ruby
iamjarvo has joined #ruby
apok has quit [Quit: apok]
apok has joined #ruby
<catphish_> does nginx have some kind of send_file support by default?
margle has quit [Quit: Computer has gone to sleep.]
<rking> Fo sho.
<catphish_> otherwise: Enumerator.new { |y| f=File.open(filename); while(data = f.read(1024*1024)) do; y << data; end; f.close }
Jork1 has quit [Quit: Jork1]
replore has joined #ruby
ken_barber has joined #ruby
saschagehlich has quit [Ping timeout: 246 seconds]
cburyta has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
harushimo has joined #ruby
mucker has joined #ruby
<catphish_> thanks
yakitori has quit [Read error: Operation timed out]
replore has quit [Remote host closed the connection]
jgwong has quit [Ping timeout: 240 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
c0rn_ has joined #ruby
<harushimo> i wrote a palindrome program but I'm having a problem returning True or False. Do I need to change my implementation?
workmad3 has quit [Ping timeout: 256 seconds]
<rking> harushimo: Hi. ☺
<harushimo> hello
<rking> harushimo: There are several things going on here.
<rking> For one, your commented-out code is returning quoted strings.
<harushimo> I know
<harushimo> I want to the code to be a little efficient
SegFaultAX|work has quit [Ping timeout: 246 seconds]
<catphish_> its returning the output of puts
<rking> Which could be useful if you only ever were going to show it to the user
lggr has joined #ruby
<catphish_> which is nothing afaik
<rking> Oh sorry
<harushimo> that is okay
<rking> Right, it's just puts()'ing it.
<harushimo> exactly
<catphish_> so what's the problem?
<rking> harushimo: But you want to tighten up your abstraction a bit
cburyta has quit [Ping timeout: 260 seconds]
<harushimo> how would I do that
<catphish_> firstly, you should return true and return false
<rking> Yep
<harushimo> using a return statement
<rking> And then secondly remember that you don't have to do that explicitly at all
lusory has quit [Ping timeout: 248 seconds]
<atmosx> hmm I use caps for true and false.. but they are not needed
<catphish_> also: string == string.reverse
<catphish_> will achieve all that
<rking> if some_thing; return true; else return false end # is almost identical to:
<rking> some_thing
<harushimo> in one line of code
bluOxigen has quit [Ping timeout: 256 seconds]
<rking> Yep, just put string == string.reverse as the last line
Criztian has joined #ruby
lusory has joined #ruby
<catphish_> al all the lines :)
<catphish_> *as
<harushimo> I don't need the regular expression at all
<rking> catphish_: Well, he's doing the gsub+downcase
<catphish_> that's true, sorry
<harushimo> no thats okay
<atmosx> then make it two lines of code.
<rking> Oh, and strings_2 doesn't exist
<catphish_> yeah
<catphish_> i just spotted that
timonv has joined #ruby
<harushimo> I was using gsub and the downcase and reverse the string in the second variable
<harushimo> then doing the comparison with the if statement
<catphish_> def palindrome(str); str.gsub!(/\W/, ""); str.downcase!; str == str.reverse; end
<catphish_> how about that?
<musl> catphish_: str.downcase.reverse!
<musl> ?
<catphish_> no
<harushimo> can you do that
<catphish_> you need to compare it unaltered to str
<bperry> string == /^#{string.reverse}$/
<rking> harushimo: I like it something like this: https://gist.github.com/e39bada2780584a6e330
<harushimo> oh okay
<bperry> er
<bperry> string == /^#{string.reverse}$/i
<bperry> doesn't deal with whitesapce though
<catphish_> indeed
<catphish_> and it's horribly insecure without Regexp.escape
<Mon_Ouie> Or with characters that have a special meaning
<harushimo> I want to know if i understand correctly
<bperry> catphish_: howso? i am curious
<harushimo> I may ask some dumb questions please bear with me
<atmosx> harushimo: another 5 minutes in here and I'm sure you wont
<bperry> oh I see
<catphish_> it would allow users to inject their own regex, which at best would allow them to crash the app
<bperry> yes
<harushimo> like you
<bperry> I just saw it :)
<harushimo> you are giving me some confidence
<atmosx> hahah j/k
<catphish_> rking: that implementation looks good :)
<catphish_> though \W is not very unicode friendly
lggr has quit [Ping timeout: 255 seconds]
<catphish_> extra homework credit for unicode support ;)
<rking> harushimo: Though the following is actually what I'd do: https://gist.github.com/6d72199fe81badadfa0c
Agis__ has quit [Quit: Agis__]
<catphish_> looks good
timonv has quit [Ping timeout: 244 seconds]
<rking> Because I don't have a a single qualm about monkeypatching String.
<catphish_> i do it all the time, some people get angry, i laugh at them
<rking> Yep.
<harushimo> I get it now
<rking> "Foolish consistency is the hobgoblin of little minds."
<harushimo> since you are doing == in the normalized variable it is going to return True or False from that
<harushimo> am I right?
<catphish_> true / false, yes
sarmiena_ has joined #ruby
ForevernadeAFK has joined #ruby
<catphish_> lower case in ruby
<harushimo> wow, I understand this
<harushimo> that is okay
<harushimo> I am altering the string usin downcase which similar to lowercase in python
nwertman has joined #ruby
<harushimo> cool
<harushimo> thanks
lggr has joined #ruby
<catphish_> you're actually not altering the string
<catphish_> you're making a new string
schaerli has joined #ruby
whaley has quit [Remote host closed the connection]
<catphish_> which is assigned to the variable 'normalized'
chimkan_ has joined #ruby
insulator has quit [Remote host closed the connection]
<harushimo> oh okay
<catphish_> you can alter a string with .downcase!
<catphish_> but it's a bad idea
sarmiena_ has quit [Client Quit]
<harushimo> the way I was thinking: We pass a string parameter, altered it with downcase and check it and send it back
<catphish_> because you will actually change the original string
cburyta has joined #ruby
Hanmac has joined #ruby
<harushimo> the original string you send to the function will change inside the function?
<harushimo> correct?
<catphish_> yes
<catphish_> and outside
<catphish_> if you use !
Forevernade has quit [Ping timeout: 246 seconds]
<harushimo> ok
<matti> a0
<catphish_> which is why normalized = gsub(/\W/, '').downcase is better
insulator has joined #ruby
<harushimo> That is why you are referring to as new string
<catphish_> because it makes a copy of the string and calls it normalized
<harushimo> thank you so much. This problem is so much clearer now
<catphish_> but leaves the original string you pass in alone
<catphish_> as you wouldn't expect that to suddenly change
<harushimo> right
tvw has quit [Remote host closed the connection]
<catphish_> i have to go home now
<catphish_> have fun
sepp2k1 has joined #ruby
SegFaultAX|work has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
koshii has quit [Ping timeout: 248 seconds]
catphish_ has quit [Quit: Leaving]
rehat has quit [Remote host closed the connection]
<harushimo> thank you
moted has joined #ruby
jenrzzz has joined #ruby
koshii has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
sent-hil has joined #ruby
eldariof has joined #ruby
alvaro_o has joined #ruby
lusory has quit [Ping timeout: 260 seconds]
lusory has joined #ruby
margle has joined #ruby
lggr has joined #ruby
djbender has quit [Quit: djbender]
jenrzzz has quit [Ping timeout: 260 seconds]
xyzodiac has quit [Quit: Computer has gone to sleep.]
jeeky has joined #ruby
icole has joined #ruby
fridim_ has quit [Ping timeout: 260 seconds]
nateberkopec has joined #ruby
roadt has quit [Ping timeout: 245 seconds]
insulator has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 252 seconds]
insulator has joined #ruby
Tombar has joined #ruby
icole has quit [Remote host closed the connection]
slainer68 has joined #ruby
Neomex has joined #ruby
icole has joined #ruby
lggr has joined #ruby
icole has quit [Remote host closed the connection]
baphled has joined #ruby
chimay has quit [Quit: WeeChat 0.4.0-dev]
erichmenge has quit [Quit: Be back later]
deadghost has quit [Ping timeout: 276 seconds]
sarmiena_ has joined #ruby
deadghost has joined #ruby
devtro has left #ruby [#ruby]
niklasb has joined #ruby
jgspratt has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
<jgspratt> How can I fix "NoMethodError: undefined method `iso8601' for Mon Oct 08 17:57:14 UTC 2012:Time" so that I can get a timestamp?
nitti has quit [Remote host closed the connection]
emmanuelux has joined #ruby
<jgspratt> I would like to get an ISO timestamp for my log file.
devtro has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
devtro has quit [Client Quit]
wallerdev has quit [Quit: wallerdev]
linoj has quit [Quit: linoj]
sarmiena_ has quit [Client Quit]
xyzodiac has joined #ruby
jrist is now known as jrist-afk
devtro has joined #ruby
sent-hil has quit [Remote host closed the connection]
<jgspratt> Is there a way to fix this issue?
eikko has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
<TTilus> jgspratt: have you googled it?
<jgspratt> Oh, yes, I did that.
<TTilus> jgspratt: solution is mentioned in the snippet of the very first hit :)
<jgspratt> I also tried the suggestion below: Time.now.utc.iso8601.gsub(/\W/, '')
eilyx has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
Amfy has joined #ruby
chimkan_ has quit [Quit: chimkan_]
<TTilus> jgspratt: googling "NoMethodError: undefined method `iso8601'" gave me https://github.com/nicksieger/ci_reporter/issues/65
eilyx has joined #ruby
<jgspratt> Is ruby case sensitive?
<TTilus> very much yes
<jgspratt> It seems that the "require" statement might be an exception to this?
<Mon_Ouie> No, it isn't
<Mon_Ouie> But some file systems aren't case sensitive though
sent-hil has joined #ruby
<jgspratt> I'm on CentOS
wedtm is now known as wedtm|away
<jgspratt> I can `require "time"` but I can't `require "Time"`
<Mon_Ouie> Well… that shows it *is* case sensitive
<jgspratt> But then I can use `Time.now` and not `time.now`
<TTilus> jgspratt: argument to require is file name
nitti has joined #ruby
<Mon_Ouie> Because the convention is to use lower-case character for source files
thinkclay has joined #ruby
<jgspratt> You're kidding, right?
<Mon_Ouie> While it is even a syntax requirement for the class name to be capitalized (because it has to be a constant name)
<TTilus> jgspratt: that may not have anything to do with the stuff the code inside that file goes around defining
Squarepy has quit [Read error: Connection reset by peer]
<jgspratt> Ok, I'll have to fix that later. Thanks for the help.
<TTilus> jgspratt: require 'foo' looks for foo.rb in load path
<TTilus> jgspratt: http://pastie.org/5020043
<TTilus> jgspratt: that may clarify a bit
<TTilus> jgspratt: just require "time"
<TTilus> jgspratt: and you are good
lggr has quit [Ping timeout: 252 seconds]
Virunga has joined #ruby
<jgspratt> Sure. I just expected the case of the module to be the same in all references to it.
<TTilus> jgspratt: require "time" does not refer to module
<TTilus> jgspratt: it refers to source file
jbw has quit [Read error: Operation timed out]
<jgspratt> Containing a module?
<TTilus> jgspratt: might or might not
sarmiena_ has joined #ruby
<jgspratt> I don't have time to fix that right now.
<TTilus> jgspratt: it is a convention to have class/module Foo in foo.rb
williamherry has joined #ruby
zefr has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
<jgspratt> Ok, I'll use that for now.
<jgspratt> Thanks!
<TTilus> jgspratt: time.rb is ruby stdlib stuff, and is known to provide Time#iso8601
linoj has joined #ruby
wedtm|away is now known as wedtm
<TTilus> jgspratt: np
nitti has quit [Remote host closed the connection]
glyytchy has joined #ruby
lggr has joined #ruby
rehat has joined #ruby
Gadgetoid__ is now known as Gadgetoid
Gadgetoid is now known as Gadgetoid_Air
Uranio has quit [Quit: WeeChat 0.3.8]
Gadgetoid_Air is now known as Gadgetoid_mbp
<thinkclay> is there a gem or standard that the community uses for ACL / auth? I'm using MongoId for my DB
xyzodiac has joined #ruby
jbw has joined #ruby
jrajav has joined #ruby
bradleyprice has quit [Remote host closed the connection]
Gadgetoid_mbp is now known as Gadgetoid
jeeky_ has joined #ruby
steffes has joined #ruby
<nwertman> Is there a way to simply print a backtrace in ruby without raising an exception? I'm doing some performance tuning on a tool and want to identify all the times a lengthy method is being called.
SegFaultAX|work has quit [Ping timeout: 245 seconds]
chimkan_ has joined #ruby
<Mon_Ouie> puts caller
devtro has quit [Quit: devtro]
arielpts has joined #ruby
lukaszk has joined #ruby
jeeky has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
arielpts- has quit [Ping timeout: 244 seconds]
devtro has joined #ruby
artm has joined #ruby
sent-hil has quit [Remote host closed the connection]
eikko has joined #ruby
CJNE has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
artnez has quit [Ping timeout: 245 seconds]
sent-hil has joined #ruby
eikko has quit [Max SendQ exceeded]
eikko has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
anachronistic has quit [Quit: anachronistic]
drowningchild has quit [Quit: Leaving]
sent-hil has quit [Remote host closed the connection]
<awestroke> getting "Segmentation fault: 11" with ruby 1.8.7-p302
anachronistic has joined #ruby
SegFaultAX|work has joined #ruby
<bperry> Solution: don't use 1.8.7
<davidcelis> ^
xyzodiac has quit [Quit: Computer has gone to sleep.]
sent-hil has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ananthakumaran has quit [Quit: Leaving.]
devtro has quit [Quit: devtro]
timonv has joined #ruby
wallerdev has joined #ruby
robertotauille has joined #ruby
the_jeebster1 has joined #ruby
lggr has joined #ruby
the_jeebster has quit [Ping timeout: 245 seconds]
replore has joined #ruby
zefr has quit [Quit: zefr]
jhunter has left #ruby [#ruby]
steffes has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
fram has quit [Remote host closed the connection]
vderyagin has quit [Remote host closed the connection]
xorigin has joined #ruby
replore has quit [Ping timeout: 260 seconds]
xorigin has left #ruby [#ruby]
lggr has quit [Ping timeout: 256 seconds]
colinbm has joined #ruby
jeeky_ has quit [Read error: Connection reset by peer]
lggr has joined #ruby
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
rmillerx has quit [Quit: rmillerx]
margle has quit [Quit: Computer has gone to sleep.]
jso has quit []
Tombar has quit [Ping timeout: 252 seconds]
margle has joined #ruby
arietis has joined #ruby
Hanmac has quit [Ping timeout: 264 seconds]
judd7 has joined #ruby
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
colinbm has quit [Quit: colinbm]
judd7 has quit [Client Quit]
daniel_-_ has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
JonnieCache has joined #ruby
Hanmac has joined #ruby
deadghost has quit [Ping timeout: 252 seconds]
daniel_- has quit [Ping timeout: 246 seconds]
Takehiro has quit [Remote host closed the connection]
lggr has joined #ruby
<Eiam> is there a shorter way to write .map {|a| a.name } ? like .map(&:name) (except i know that won't work)
dhackner has joined #ruby
<shadoi> why won't it work?
jeeky has joined #ruby
jeeky has quit [Remote host closed the connection]
elico has joined #ruby
<Eiam> huh, thats weird. it worked.. i've tried this before and it didn't work..
rakl has joined #ruby
<shadoi> That's the whole purpose for Symbol#to_proc
<Eiam> okay so i thought when you do &:thing the :thing had to be something that existed on all ruby objects
<Hanmac> Eiam maybe you forgot the &
<Eiam> or the base of your ruby object
dhackner has left #ruby [#ruby]
<shadoi> No it just has to respond to that method
<shadoi> the objects you're passing it
<Eiam> gosh, so muh code to go update..
dpk has joined #ruby
gani has quit [Quit: leaving..]
jso has joined #ruby
bradleyprice has joined #ruby
alfism has quit [Quit: alfism]
<Eiam> thanks.. really wish i could go find the case where I decided I couldn't use that short hand ;p
lggr has quit [Ping timeout: 246 seconds]
SegFaultAX|work has quit [Ping timeout: 252 seconds]
deadghost has joined #ruby
SegFaultAX|work has joined #ruby
lggr has joined #ruby
judd7 has joined #ruby
grizlo42 has left #ruby [#ruby]
eignerchris has joined #ruby
whaley has joined #ruby
whaley has quit [Read error: Connection reset by peer]
whaley has joined #ruby
_tca has joined #ruby
Orcris has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
Jork1 has joined #ruby
slainer6_ has joined #ruby
daniel_-_ has quit [Quit: WeeChat 0.3.9]
daniel_- has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
<matti> ;]
<matti> shevy shevy
reuf has quit [Quit: Leaving]
_tca is now known as theconartist
daniel_- has quit [Changing host]
daniel_- has joined #ruby
jgspratt has quit [Read error: Connection reset by peer]
timonv has quit [Remote host closed the connection]
Tombar has joined #ruby
MrH1 has joined #ruby
MrH has quit [Read error: Connection reset by peer]
jgspratt has joined #ruby
nitti has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
awarner has quit [Remote host closed the connection]
devtro has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
ken_barber has quit [Remote host closed the connection]
Takehiro has joined #ruby
jgspratt has left #ruby [#ruby]
Neomex has quit [Quit: Neomex]
jonathanwallace has quit [Remote host closed the connection]
Axsuul has joined #ruby
love_color_text has quit [Quit: Connection closed for inactivity]
lggr has joined #ruby
ltsstar has quit [Quit: ltsstar]
arielpts- has joined #ruby
Puck6633 has joined #ruby
artnez has joined #ruby
whaley has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
timonv has joined #ruby
arielpts has quit [Ping timeout: 240 seconds]
nitti has quit [Ping timeout: 260 seconds]
AlbireoX has quit [Remote host closed the connection]
AlbireoX has joined #ruby
zemanel has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
icooba has quit [Ping timeout: 240 seconds]
JonnieCache has quit [Ping timeout: 260 seconds]
pozic has joined #ruby
lggr has joined #ruby
jrist-afk is now known as jrist
mengu has quit [Quit: Konversation terminated!]
<pozic> Is there any API to find an ipv{4,6} address anywhere in a string?
rakl has quit [Quit: sleeping]
AlbireoX has quit [Ping timeout: 248 seconds]
mucker has quit [Quit: leaving]
<pozic> (A _simple_ regular expression is not going to solve this problem.)
dhackner has joined #ruby
<pozic> davidcelis: I fail to see how that takes a string as input, searches for anything which resembles an IP and returns it.
<davidcelis> ah
<davidcelis> then no
<matti> pozic: THen do complex regexp.
<matti> Problem solved, next.
nanderoo has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 260 seconds]
<davidcelis> use a regexp
<matti> ;d
gaspar|work has joined #ruby
dhackner has left #ruby [#ruby]
<davidcelis> the library i linked you to has regexes you can use; just strip them out and do something similar, but scan across a string for a match instead of including \A...\z in the regex.
Sajo444 has joined #ruby
kirun has joined #ruby
sebastianb has quit [Quit: Reconnecting]
sebastianb has joined #ruby
<davidcelis> really not that difficult to implement
Sajo444 has left #ruby [#ruby]
lggr has quit [Ping timeout: 264 seconds]
<matti> No! We have to use OCalm to do it.
djbender has joined #ruby
bradhe has joined #ruby
Jork1 has quit [Ping timeout: 246 seconds]
moshee has quit [Ping timeout: 244 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<pozic> matti: OCaml is fine too.
djbender has left #ruby [#ruby]
<harushimo> !pastebin
<matti> harushimo: pastie.org
<pozic> matti: I don't really care about the language it is implemented in, as long as it has been solved.
<harushimo> thank you
<davidcelis> harushimo: https://gist.github.com/
nitti has joined #ruby
<gaspar|work> Hello! I am using data mapper - how is it possible to select all the Posts that were created today by using automagic field created_at without active_record support?
<matti> pozic: Regexp + scan?
lggr has joined #ruby
rakl has joined #ruby
answer_42 has quit [Quit: WeeChat 0.3.9]
<Hanmac> pozic the problem about an regex is that "::" is an valid ipv6 adress ...
<matti> Hanmac: Make it a special case
jenrzzz has joined #ruby
<davidcelis> Hanmac: the library i linked to reports '::' as valid
<davidcelis> or at least it looks as though it would
philcrissman has joined #ruby
<harushimo> I wrote a count words program but when I look at my sample output, it seems I'm missing something
<Hanmac> 1::2 is valid too
<harushimo> do I need to implement a hash or iterator in this program?
<reactormonk> Hanmac: nomethoderror though?
<davidcelis> Hanmac: yep, reports that as valid as well.
<reactormonk> err, wait
<reactormonk> n/m
pen has quit [Remote host closed the connection]
burgestrand has joined #ruby
<reactormonk> davidcelis: that's valid. it's a lot of 0's :-)
<davidcelis> what?
<harushimo> I just want to make sure that I'm approaching this problem correctly
<reactormonk> davidcelis: the ipv6 '::'
<davidcelis> reactormonk: yeah... i know
csmrfx has joined #ruby
<csmrfx> 8)
<matti> csmrfx: ;]
<davidcelis> reactormonk: i was saying that the library i liked to earlier reports '::' as a valid IPV6 address
<reactormonk> davidcelis: oh, oke
<pozic> matti: I had already considered that. Because I don't like hacks, I wanted a library.
<reactormonk> harushimo: str.downcase.split(/\W+/).size
<matti> pozic: A hack?
bradhe has quit [Ping timeout: 248 seconds]
<matti> pozic: How is using a regexp with scan a hack?
<csmrfx> Seen any cool ruby video prezs?
<reactormonk> harushimo: oh, you want a counter
<matti> pozic: What if a library is doing exactly that?
<davidcelis> I fail to see how scanning a string for anything that matches a Regexp representing an IP address is a hack
<matti> pozic: Would you be more content? ;d
<pozic> matti: then it's a bad library.
<csmrfx> lol
<davidcelis> lol dude
lggr has quit [Ping timeout: 260 seconds]
<matti> pozic: -> OUT
<matti> ;d
<pozic> matti: but I would probably take it :)
<matti> pozic: Pff
<davidcelis> I'm curious to know how you'd implement that search.
<matti> ;p
<csmrfx> well then, make your own lib
<matti> davidcelis: He would write it in C
<matti> davidcelis: Using flex and bison.
<matti> davidcelis: And build a proper AST tree, of course.
<csmrfx> I do often, takes years to get anywhere tho but you learn a lot
<Hanmac> harushimo: str.downcase.scan(/\w+/).each_with_object(Hash.new(0)) {|s,h| h[s] +=1 }
<reactormonk> harushimo: counter = Hash.new {|h,k| h[k] = 0}; str.split(/\b/).each {|word| counter[word.downcase]}
vlad_starkov has quit [Remote host closed the connection]
<reactormonk> err, forgot a +=1 there
<matti> pozic: Just be pragmatic dude.
<reactormonk> Hanmac: nice n functional ;-)
<matti> pozic: Use IPAddr from Ruby, or the one by davidcelis
<harushimo> oh really
<matti> pozic: And if they fail, fall-back to regexp.
<davidcelis> matti: he can't really, he needs to scan a string that contains more than just the IP addresses
<Hanmac> reactormonk: this may be more cool: str.downcase.to_enum(:scan,/\w+/).with_object(Hash.new(0)) {|s,h| h[s] +=1 }
<davidcelis> but he can at least take the regexes out from the lib i linked to, remove the \A and \z, and just scan
<matti> davidcelis: Yeah.
<harushimo> nice
<matti> davidcelis: Maybe string tokenizer?
userbard has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<harushimo> how is it counting the words? I'm confused
jcoglan has joined #ruby
<reactormonk> Hanmac: nice
lggr has joined #ruby
<reactormonk> harushimo: you know of the counter pattern?
<Hanmac> harushimo with black magic and the power of mushrooms :D
<csmrfx> returns a hash with the count
<harushimo> hah
<harushimo> a
<csmrfx> +s
<harushimo> be right back
<harushimo> I need to step away
margle has joined #ruby
gmci has joined #ruby
chussenot has joined #ruby
chussenot has quit [Client Quit]
blazes816 has quit [Quit: blazes816]
irleif has joined #ruby
reset has joined #ruby
Battuu has joined #ruby
timonv has quit [Remote host closed the connection]
gmci has quit [Ping timeout: 246 seconds]
darule has joined #ruby
<harushimo> I'm back
nwertman has quit [Quit: nwertman]
gmci has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
sarmiena_ has quit [Quit: sarmiena_]
dmiller has quit [Ping timeout: 245 seconds]
elaptics is now known as elaptics`away
mrsolo has quit [Quit: This computer has gone to sleep]
rburton- has joined #ruby
moted has quit [Remote host closed the connection]
lggr has joined #ruby
mrsolo has joined #ruby
sent-hil has joined #ruby
<csmrfx> hm, where is .with_object?
Jork1 has joined #ruby
stephenjudkins has joined #ruby
<csmrfx> strange, didn't see it
<csmrfx> also strange, how ruby uses the same obj there
irleif has quit [Quit: Computer has gone to sleep.]
moted has joined #ruby
nitti has quit [Remote host closed the connection]
nitti has joined #ruby
timonv has joined #ruby
eojflowers has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<eojflowers> quick question about stringify_keys, why doesn't this work? {:role.Buyer.firstName => "James"}.stringify_keys
<eojflowers> I want it to produce 'role.Buyer.firstName', 'James' but instead it's: undefined method `Buyer' for :role:Symbol
BMF has joined #ruby
DrShoggoth has quit [Ping timeout: 240 seconds]
dmiller has joined #ruby
devtro has quit [Quit: devtro]
rburton- has quit [Read error: Connection reset by peer]
nwertman has joined #ruby
mrbrdo has joined #ruby
devtro has joined #ruby
<csmrfx> eojflowers well clearly role is
<csmrfx> Note that keys are NOT treated indifferently, meaning if you use strings for keys but assert symbols as keys, this will fail.
<Hanmac> :"role.Buyer.firstName"
<csmrfx> a symbol
lggr has joined #ruby
rakl has quit [Quit: sleeping]
Battuu has quit [Remote host closed the connection]
ddd1 has joined #ruby
Takehiro has quit [Remote host closed the connection]
ddd is now known as Guest27038
DrShoggoth has joined #ruby
ddd1 is now known as ddd
Tombar has quit [Read error: Connection reset by peer]
<eojflowers> Hanmac: Thanks I think that worked
<csmrfx> perhaps it is because one cannot enum symbols with each
Guest27038 has quit [Ping timeout: 245 seconds]
Orcris has quit [Ping timeout: 260 seconds]
robertotauille has quit [Read error: Connection reset by peer]
irleif has joined #ruby
mikepack has quit [Remote host closed the connection]
robertotauille has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
F1skr has joined #ruby
mikepack has joined #ruby
eojflowers has left #ruby [#ruby]
jlwestsr has joined #ruby
Tombar has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9]
lggr has joined #ruby
BSaboia__ has joined #ruby
spinagon has quit [Ping timeout: 256 seconds]
nwertman has quit [Quit: nwertman]
margle has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
rakl has joined #ruby
workmad3 has joined #ruby
nik_-_ has joined #ruby
rakl has quit [Client Quit]
CJNE has joined #ruby
<reactormonk> csmrfx: Buyer.firstName are method calls
devtro has quit [Quit: devtro]
<TTilus> :role.send(:Buyer).send(:firstName) is whats going on there
eldariof has quit []
bbttxu_ has quit [Quit: bbttxu_]
rakl has joined #ruby
pozic has quit [Quit: leaving]
<csmrfx> hm, so that is before the keys.each in stringify_keys -source
lggr has quit [Ping timeout: 252 seconds]
awarner has joined #ruby
elaptics`away is now known as elaptics
skaczor has quit [Quit: Leaving]
Hanmac has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 240 seconds]
CJNE has quit [Ping timeout: 248 seconds]
Vinz| has joined #ruby
sent-hil has quit [Remote host closed the connection]
lggr has joined #ruby
MikeyV27_ has joined #ruby
jrajav has quit []
nitti has quit [Remote host closed the connection]
sarmiena_ has joined #ruby
sent-hil has joined #ruby
skaczor has joined #ruby
drowningchild has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
MikeyV27 has quit [Ping timeout: 246 seconds]
nitti has joined #ruby
MikeyV27_ has quit [Ping timeout: 246 seconds]
nitti has quit [Remote host closed the connection]
artm has quit [Quit: artm]
eindoofus has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
eindoofus has left #ruby ["Leaving"]
F1skr has quit [Quit: WeeChat 0.3.9]
geekbri has quit [Remote host closed the connection]
nitti has joined #ruby
ken_barber has joined #ruby
elaptics is now known as elaptics`away
bwlang has joined #ruby
lggr has joined #ruby
Hanmac has joined #ruby
mrbrdo has quit [Quit: mrbrdo]
morozovm has quit [Quit: morozovm]
elico has quit [Quit: elico]
schaerli has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
daniel_- has joined #ruby
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
nitti_ has joined #ruby
Tombar has quit [Read error: Connection reset by peer]
SegFaultAX|work has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Ping timeout: 246 seconds]
krawchyk has quit [Remote host closed the connection]
F1skr has joined #ruby
LouisGB has joined #ruby
dmiller has quit [Remote host closed the connection]
futilegames has joined #ruby
futilegames has quit [Client Quit]
rmillerx has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
frogprince_mac has quit [Quit: Leaving...]
postmodern has joined #ruby
nitti has quit [Ping timeout: 276 seconds]
vjt has quit [Ping timeout: 272 seconds]
lggr has joined #ruby
CaptainJet has joined #ruby
ctevie has quit [Quit: Connection closed for inactivity]
Takehiro has quit [Ping timeout: 260 seconds]
yalue has quit [Remote host closed the connection]
zenformatics1 has quit [Quit: Leaving.]
carloslopes has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 248 seconds]
ProLoser|Work has joined #ruby
<ProLoser|Work> anyone around?
robertotauille has quit [Quit: Leaving...]
<ProLoser|Work> i'm trying to work with sass
theconartist has left #ruby [#ruby]
bbttxu_ has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
<csmrfx> clearly nobody
lggr has joined #ruby
deadghost has quit [Ping timeout: 246 seconds]
mark_locklear has quit [Remote host closed the connection]
dnstbr has joined #ruby
Criztian has quit [Remote host closed the connection]
SegFaultAX|work has joined #ruby
deadghost has joined #ruby
insulator has quit [Ping timeout: 276 seconds]
ndrei has joined #ruby
vlad_starkov has joined #ruby
devtro has joined #ruby
dagnachewa has joined #ruby
cody-- has joined #ruby
Asher has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 245 seconds]
zenformatics1 has joined #ruby
nowhereman has joined #ruby
haxrbyte has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
atmosx has quit [Quit: WeeChat 0.3.8]
<harushimo> I implemented the hash like you guys suggested
<harushimo> I'm stilling missing something
nowhere_man has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
<csmrfx> the counts
<csmrfx> just copy that
<csmrfx> also, " " and "," are not words
awarner has quit [Remote host closed the connection]
samphippen has joined #ruby
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<harushimo> how do you copy the counts?
<csmrfx> copy what was pasted
<csmrfx> the example that used regex scan for words to count the words
<harushimo> oh
<csmrfx> you're just splitting a string by word boundary != counting words
redbeard0x0a has joined #ruby
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
CodeFriar has quit [Quit: Leaving...]
<ProLoser|Work> when working with sass, is it possible to extend classes without rendering those classes?
<csmrfx> 22:47 < Hanmac> reactormonk: this may be more cool: str.downcase.to_enum(:scan,/\w+/).with_object(Hash.new(0)) {|s,h| h[s] +=1 }
<ProLoser|Work> like say i have a primary CSS file, and I want to extend classes in that but I wish to place the results in another file
<csmrfx> ^ harushimo
<harushimo> I got it
<harushimo> thank you
insulator has joined #ruby
<harushimo> would that go where I'm splitting the string
timonv has quit [Remote host closed the connection]
<csmrfx> see regexp scan for words dont need no splitting
<csmrfx> also, the counting is in that too
<harushimo> I got it
<harushimo> we split the string and then count it
[Neurotic] has joined #ruby
<harushimo> I even see regular expression in 3 different languages
<csmrfx> no
keymone has joined #ruby
smw_ has joined #ruby
<csmrfx> no splitting in Hanmac's example
lggr has quit [Ping timeout: 245 seconds]
<csmrfx> regexp matches
<csmrfx> it uses syntax sugar black magic
justinmcp has joined #ruby
<harushimo> haha
<harushimo> is that theme now black magic
BMF has quit [Remote host closed the connection]
<harushimo> hehe
swarley has joined #ruby
<harushimo> thank you
<csmrfx> well I thank Hanmac for that nice oneliner
<harushimo> it is nice one liner
* Hanmac 's code looks often very "funky"
<redbeard0x0a> When writing a gem that wraps an HTTP api, what works best for handling certain errors (i.e. Authentication)? I know some libraries throw an exception, some may return nil and provide a way to check last error?
vlad_starkov has joined #ruby
jgrevich_ has joined #ruby
<redbeard0x0a> I have no issues throwing an exception for a 500 type error, but I don't like using exceptions for something like 401 Authentication Required
<redbeard0x0a> Any good examples out there? Any advice?
vlad_starkov has quit [Remote host closed the connection]
Virunga has quit [Remote host closed the connection]
bwlang has left #ruby [#ruby]
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb (and no more global banning for saying that main dev is not very smart, what is truth anyway)]
lggr has joined #ruby
jgrevich has quit [Ping timeout: 246 seconds]
jgrevich_ is now known as jgrevich
fridim_ has joined #ruby
vlad_starkov has joined #ruby
<csmrfx> why not just str.downcase.scan(/\w+/), btw?
Tombar has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
c0rn_ has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Remote host closed the connection]
<davidcelis> STR.UPCASE.SCAN(/\W+/)
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
Tombar has quit [Remote host closed the connection]
vlad_sta_ has joined #ruby
<csmrfx> "423kl 234kl 23".downcase.scan(/\w+/).each(Hash.new(0) {|w,h| h[w] += 1 } ) give wrong number of args
vlad_sta_ has quit [Remote host closed the connection]
Hanmac has quit [Remote host closed the connection]
swarley has quit [Read error: Connection reset by peer]
<workmad3> csmrfx: yeah... that's not how you call .each ;)
swarley has joined #ruby
robustus has quit [Quit: ZNC - http://znc.in]
<workmad3> csmrfx: did you mean a .each_with_object?
<harushimo> interesting. thanks everyone. I'll be back on later. I need to step out for a few hours
haxrbyte has quit [Ping timeout: 264 seconds]
<harushimo> take care
lggr has joined #ruby
harushimo has quit [Quit: Leaving]
<csmrfx> workmad3: it gives the same error
steffes has joined #ruby
<workmad3> csmrfx: "423kl 234kl 23".downcase.scan(/\w+/).each_with_object(Hash.new(0)) {|w,h| h[w] += 1 }
crazed has joined #ruby
vlad_starkov has quit [Ping timeout: 248 seconds]
bwlang has joined #ruby
bwlang has quit [Excess Flood]
redbeard0x0a has quit []
the_jeebster1 has quit [Quit: Leaving.]
bwlang has joined #ruby
linoj has quit [Ping timeout: 260 seconds]
<csmrfx> oooåhh, misplaced closing paren
vlad_starkov has joined #ruby
ForevernadeAFK has quit [Ping timeout: 260 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
lggr has quit [Ping timeout: 256 seconds]
jgarvey has quit [Quit: Leaving]
schaerli has joined #ruby
justinmcp has quit [Remote host closed the connection]
schaerli has quit [Read error: Connection reset by peer]
r1ddl3r has joined #ruby
schaerli has joined #ruby
pwf has joined #ruby
xorgnak has joined #ruby
<pwf> what's the best way to make a set of options in an OptionParser required
<pwf> like if you specify foo, bar must be set, but you can specify bar without foo
sepp2k1 has quit [Remote host closed the connection]
lggr has joined #ruby
xorgnak has quit [Remote host closed the connection]
emergion has joined #ruby
sebastianb has quit [Ping timeout: 246 seconds]
<pwf> oh, it's the brackets that define if it's optional... that's kinda non-obvious
<pwf> that doesn't extend to sets of options though, right?
<csmrfx> huh?
cdzombak has quit []
bigoldrock has joined #ruby
<pwf> like --foo=whatever will work, and --foo=whatever --bar=whatever will work, but just --bar=whatever should throw an error
<csmrfx> see make_switch -method
<pwf> OK
JonnieCache has joined #ruby
Orcris has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9]
jenrzzz has quit [Ping timeout: 264 seconds]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
stephenjudkins has quit [Quit: stephenjudkins]
lggr has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
jeremyirony has joined #ruby
c0rn_ has joined #ruby
imami|afk is now known as banseljaj
jeremyirony is now known as sebastianb
Agis__ has joined #ruby
murrdoc1 has joined #ruby
murrdoc1 has left #ruby [#ruby]
lggr has joined #ruby
gaspar|work has quit [Ping timeout: 246 seconds]
Takehiro has quit [Ping timeout: 260 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
dmiller has joined #ruby
Forevernade has joined #ruby
blazes816 has joined #ruby
tommyvyo has quit [Client Quit]
lggr has quit [Ping timeout: 256 seconds]
thone has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
Jork1 has quit [Quit: Jork1]
jeffreybaird has quit [Quit: jeffreybaird]
schaerli has quit [Remote host closed the connection]
A124 has joined #ruby
thone_ has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
iamjarvo has joined #ruby
thinkclay has quit [Quit: Leaving.]
usmanity has joined #ruby
sent-hil has quit [Remote host closed the connection]
<usmanity> is there a ruby implementation of a dropbox-like program?
philcrissman has quit [Remote host closed the connection]
havenn has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
joofsh has quit [Ping timeout: 256 seconds]
bradleyprice has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
skogis has quit [Ping timeout: 252 seconds]
rakl has quit [Quit: sleeping]
profx_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
sent-hil has joined #ruby
stephenjudkins has joined #ruby
alanp_ has joined #ruby
<profx_> anyone else doing edX ? (@ Berkeley) ?
lggr has joined #ruby
elico has joined #ruby
anachronistic has quit [Quit: anachronistic]
irleif has quit [Quit: Computer has gone to sleep.]
vjt has joined #ruby
nitti_ has quit [Quit: Leaving...]
asteve has quit []
xyzodiac has joined #ruby
pwf has left #ruby [#ruby]
alanp has quit [Ping timeout: 260 seconds]
irleif has joined #ruby
bbttxu_ has quit [Quit: bbttxu_]
steffes has quit [Remote host closed the connection]
KillerFox has quit [*.net *.split]
steffes has joined #ruby
fantazo has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 244 seconds]
dmiller has joined #ruby
arkadio has joined #ruby
ken_barber has quit [Remote host closed the connection]
ForevernadeAFK has joined #ruby
Jork1 has joined #ruby
Jork1 has quit [Client Quit]
Forevernade has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
keymone has quit [Quit: keymone]
F1skr has quit [Quit: WeeChat 0.3.9]
salman has joined #ruby
elico has quit [Quit: elico]
<salman> i have this list player_list = [["salman", "P"], ["name", "k"]]
jrist is now known as jrist-afk
<salman> and want to raise an error if the second index of my 2 dimen array is any thing else than p
joshman_ has quit [Quit: Computer has gone to sleep.]
<profx_> salman, working on Berkley ?
<salman> so i wrote raise NoSuchStrategyError unless game[0][1] == "P" || game[1][1] == "P" || game[0][1] == "p" || game[1][1] == "p"
<profx_> yep :D
JonnieCache has quit [Ping timeout: 246 seconds]
<salman> yes, I am :D
<profx_> same
carlyle has quit [Remote host closed the connection]
<blazes816> player_list.any?{|player| player[1] != 'p' }
<salman> just started yesterday with ruby..how about you how have u done this..
<davidcelis> salman: are you salman rushdie
lggr has quit [Ping timeout: 260 seconds]
<heftig> raise "error" unless player_list.all? { |x| x[1] =~ /^p$/i }
<heftig> er, or better
<profx_> i used gsub(/[rps]/)
<heftig> raise "error" unless player_list.all? { |x| x[1].upcase == "P" }
Agis__ has quit [Quit: Agis__]
<blazes816> raise NoSuchStrategyError if player_list.any?{|player| player[1].downcase != 'p' }
<profx_> salman, my first ruby day was yesterday too
<davidcelis> /\Ap\z/i # FTFY
<blazes816> good call on the case sensitivity heft
KillerFox has joined #ruby
<blazes816> lol
bbttxu_ has joined #ruby
iamjarvo has quit [Ping timeout: 246 seconds]
<davidcelis> \A\z for life
rmillerx has quit [Quit: rmillerx]
<heftig> shouldn't it be \Z?
snorkdude has joined #ruby
Foxandxss has joined #ruby
<blazes816> heftig: nope, \z
<salman> thanks guys
<blazes816> they're ruby-specific classes
triptec has joined #ruby
<blazes816> you can check out a ref: http://rubular.com/
CJNE has joined #ruby
<profx_> its weird, someone pastebinned their answer to it and they checked a win by listing all the winning scenarios: 'rr','pp','ss','rs','pr','sp'
<heftig> ah, \Z ignores a trailing \n
lggr has joined #ruby
elico has joined #ruby
dmiller has quit [Ping timeout: 252 seconds]
baphled has quit [Ping timeout: 246 seconds]
CJNE has quit [Read error: Operation timed out]
Guedes0 has joined #ruby
Guedes has quit [Disconnected by services]
Guedes0 is now known as Guedes
Guedes has quit [Changing host]
Guedes has joined #ruby
Asher has joined #ruby
chussenot has joined #ruby
hadees has quit [Quit: hadees]
chussenot has quit [Client Quit]
ken_barber has joined #ruby
ForevernadeAFK has quit [Remote host closed the connection]
chimkan_ has quit [Quit: chimkan_]
kiyoura has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Forevernade has joined #ruby
elico has quit [Quit: elico]
stopbit has quit [Quit: Leaving]
no_worries has quit [Remote host closed the connection]
chimkan has joined #ruby
lggr has joined #ruby
hadees has joined #ruby
nik_-_ has quit [Quit: nik_-_]
Puck6633 has quit [Ping timeout: 240 seconds]
Forevernade has quit [Remote host closed the connection]
chimkan has quit [Client Quit]
CodeFriar has joined #ruby
CodeFriar has quit [Client Quit]
thinkclay has joined #ruby
sent-hil has quit [Remote host closed the connection]
Agis__ has joined #ruby
jamjam has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
fr0gprince_ has joined #ruby
insulator has quit [Remote host closed the connection]
CodeFriar has joined #ruby
frogprince has quit [Ping timeout: 240 seconds]
<arkadio> how can I write a word at the end of each line in a file?
Takehiro has joined #ruby
DrShoggoth has quit [Quit: Leaving]
CodeFriar has quit [Client Quit]
lggr has joined #ruby
jenrzzz has joined #ruby
arkadio has quit [Remote host closed the connection]
dnstbr has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
irleif has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Ping timeout: 260 seconds]
theRoUS has quit [Ping timeout: 260 seconds]
krion has quit [Ping timeout: 260 seconds]
steffes has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
<csmrfx> arkadio something like? File.foreach(filename_str){ |ln| ln = ln + getWord(); }
krion has joined #ruby
timonv has joined #ruby
<profx_> can I declare a string on multiple lines? (for readability)
<csmrfx> getWord() in that example is a pre-defined method that supposedly would return some string
lggr has joined #ruby
Nisstyre-laptop has joined #ruby
J2EE has quit [Quit: Kelebek Premium ¤ www.Kelebek.Org ¤]
<csmrfx> profx_: watch what that foreach would return or write btw
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<davidcelis> profx_: yeah use a HEREDOC
timonv has quit [Ping timeout: 248 seconds]
BSaboia__ has quit [Read error: Connection reset by peer]
<profx_> let me look that up, thanks
<davidcelis> profx_: ^
<davidcelis> but yeah definitely look it up too; you can do a lot with them
replore has joined #ruby
<profx_> yeah, interesting
<profx_> 2 days in, and i enjoy Ruby
<profx_> thats a given
usmanity has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 245 seconds]
AlbireoX has joined #ruby
nik_-_ has joined #ruby
piotr__ has quit [Ping timeout: 260 seconds]
kaawee has joined #ruby
AlbireoX has quit [Remote host closed the connection]
rubious has joined #ruby
<kaawee> Hello! Does anybody know how to obtain the parent module of a module? Like: "URI::HTTP.parent_module == URI"
AlbireoX has joined #ruby
kirun has quit [Quit: Client exiting]
lggr has joined #ruby
robertotauille has joined #ruby
uris has quit [Ping timeout: 246 seconds]
<csmrfx> kaawee wat you do
<kaawee> csmrfx: I do not understand
robertotauille has quit [Client Quit]
<csmrfx> module WAT; module DO; p DO.methods; end; end
fantazo has joined #ruby
<davidcelis> oh you have the actual constant not a string, nevermind
<davidcelis> i mean, you could to_s it i guess
bradleyprice has joined #ruby
Agis__ has quit [Quit: Agis__]
AlbireoX has quit [Ping timeout: 240 seconds]
Norrin has quit [Ping timeout: 245 seconds]
ffranz has quit [Quit: Leaving]
bier has quit [Ping timeout: 248 seconds]
ksinkar has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
<csmrfx> I guess you be too good for ancestors
<salman> how to always access second index of every array in 2 dimension array ...
<csmrfx> "super name" would be fun but dont work
<csmrfx> salman just iterate over first and point to second index
Norrin has joined #ruby
g-ram has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<profx_> [x][1]
<Paradox> anyone here familiar with mongomapper?
niklasb has quit [Ping timeout: 260 seconds]
<salman> argh, yes, right
lggr has joined #ruby
<davidcelis> csmrfx: i dont think ancestors works the way you think it does
<csmrfx> it does with modules
vlad_starkov has quit [Ping timeout: 246 seconds]
<davidcelis> i can make several nested modules in an irb prompt, and calling .ancestors on the furthest nested just returns itself
jrist-afk is now known as jrist
<csmrfx> read the doc for the method
bigoldrock has quit [Remote host closed the connection]
<davidcelis> modules _included in_
<davidcelis> i mean, maybe that's what he meant
LouisGB has quit [Ping timeout: 244 seconds]
josh^ has joined #ruby
AMfish has joined #ruby
<davidcelis> i assumed he just meant retrieve the previous nesting level
<csmrfx> did you try my example?
<csmrfx> no wait that only had methods
<csmrfx> module WAT; module DO; p self.ancestors; end; end
dagnachewa has quit [Quit: Leaving]
Norrin has quit [Ping timeout: 245 seconds]
justinmcp has joined #ruby
<csmrfx> self.name might work too
cburyta has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 260 seconds]
jord has quit [Ping timeout: 245 seconds]
kramutils has joined #ruby
Norrin has joined #ruby
bier has joined #ruby
jord has joined #ruby
lggr has joined #ruby
IrishGringo has quit [Read error: Operation timed out]
jimeh2 has joined #ruby
tommyvyo has joined #ruby
jrajav has joined #ruby
replore has quit [Remote host closed the connection]
davidcelis has quit [Quit: K-Lined.]
bluOxigen has joined #ruby
bradleyprice has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
BigFatFatty has left #ruby [#ruby]
<csmrfx> Is there a short-syntax way to define block inline for module_eval: module Wab; module Doh; module_eval(p self.ancestors); end; end
chrisja has quit [Quit: leaving]
<csmrfx> ah, double quotes
replore_ has joined #ruby
Synthead has quit [Quit: p33 ba115]
lggr has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
replore_ has quit [Remote host closed the connection]
carlyle has joined #ruby
sagax has quit [Quit: Ухожу я от вас]
sarmiena_ has quit [Quit: sarmiena_]
banseljaj is now known as imami|afk
cburyta has joined #ruby
hadees has quit [Quit: hadees]
sarmiena_ has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
bradleyprice has joined #ruby
rehat has quit [Remote host closed the connection]
lggr has joined #ruby
reset has quit [Ping timeout: 246 seconds]
Takehiro has joined #ruby
stkowski has quit [Quit: stkowski]
samphippen has quit [Quit: Computer has gone to sleep.]
slainer6_ has quit [Remote host closed the connection]
elico has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 248 seconds]
elico has quit [Client Quit]
iamjarvo has joined #ruby
lggr has joined #ruby
iamjarvo has quit [Read error: Operation timed out]
jamjam has quit [Ping timeout: 245 seconds]
AlbireoX has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
rakl has joined #ruby
rafy has joined #ruby
whaley has joined #ruby
rafy is now known as Coad
hsbt has joined #ruby
LouisGB has joined #ruby
lggr has joined #ruby
A124 has quit [Quit: Leaving.]
reset has joined #ruby
reset has quit [Remote host closed the connection]
Dawne has quit [Quit: Leaving.]
reset has joined #ruby