apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
ner0x has quit [Quit: Leaving]
horofox has quit [Read error: Connection reset by peer]
xclite has quit [Remote host closed the connection]
horofox has joined #ruby
Jessykinz has joined #ruby
SCommette has quit [Quit: SCommette]
dr_neek has left #ruby [#ruby]
tps_ has quit [Quit: tps_]
baroquebobcat has quit [Quit: baroquebobcat]
h4mz1d has joined #ruby
piotr__ has quit [Ping timeout: 264 seconds]
karasawa has joined #ruby
ilyam has joined #ruby
pcasaretto has joined #ruby
blaxter has quit [Quit: foo]
<pcasaretto> Hello. How can I sanitise what goes in a pipe? More specifically I need escape html.
horofox has quit [Quit: horofox]
jonathanwallace1 has quit [Ping timeout: 246 seconds]
<pcasaretto> should I add some guy before the pipe and sanitise what comes trough?
cakehero has quit [Quit: Computer has gone to sleep.]
karasawa has quit [Ping timeout: 276 seconds]
h4mz1d has quit [Ping timeout: 240 seconds]
<ged> pcasaretto: What do you mean by "pipe"? IO.pipe?
<pcasaretto> yeah, that kind of pipe :)
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<atmosx> pipe!
tps_ has joined #ruby
<atmosx> pipes in Greek are an alias for blowjobs
tommyvyo has joined #ruby
<atmosx> awsome kind of pipe, probably the best there is
<atmosx> when properly executed.
<pcasaretto> it means getting stoop up in portuguese
<pcasaretto> stood
<pcasaretto> let me try to explain this a little better
<jblack> Datamapper is returning "2013-01-10T19:12:36-05:00" for me as a datetime to a sqlite3 databse. What's a nice way to format that to something more readable?
staafl has quit [Ping timeout: 260 seconds]
freeayu has joined #ruby
atmosx has quit [Quit: leaving]
<pcasaretto> RSpec::Mate::Runner receives an IO object thats meant for writing
<pcasaretto> he passes it along to ::RSpec::Core::Runner
<pcasaretto> problem is ::RSpec::Core::Runner outputs html. And I need to sanitise that html before TextMate displays it
chussenot has quit [Quit: chussenot]
jduan1981 has quit [Remote host closed the connection]
<havenn>
jduan1981 has joined #ruby
<pcasaretto> Should I keep the received IO and instead give him the input IO of a sanitizer kinda guy?
h4mz1d has joined #ruby
tps_ has quit [Quit: tps_]
<havenn> jblack: What would it ideally read as?
<havenn> jblack: You can parse that string, and then return whatever you want: Time.parse '2013-01-10T19:12:36-05:00'
slainer68 has quit [Read error: Connection reset by peer]
<havenn> jblack: Oh, it is already a datetime?
fyolnish has quit [Remote host closed the connection]
slainer68 has joined #ruby
jds_ has quit [Remote host closed the connection]
xpen_ has quit [Ping timeout: 276 seconds]
<jblack> the DM property looks like: property :when, DateTime, :default => Time.now
<jblack> which spits out the aforementioned string
<jblack> it's of class type "DateTime"
<jblack> oh DURH
<jblack> u.when.asctime =)
<jblack> I didn't realize that DM was returning a DateTime. thought it was returning a string
Sedivy has joined #ruby
hackerdude has quit [Remote host closed the connection]
nemesit has quit [Quit: Leaving...]
h4mz1d has quit [Ping timeout: 255 seconds]
jochu has quit [Remote host closed the connection]
pcarrier has quit []
Sedivy has quit [Client Quit]
<ged> pcasaretto: That doesn't sound *too* crazy, IMO.
zeade has quit [Quit: Leaving.]
karupanerura has quit [Excess Flood]
thinkclay has joined #ruby
karupanerura has joined #ruby
<ged> It might be easier to use an alternate formatter, though.
mengu__ has quit [Ping timeout: 255 seconds]
<ged> Subclass the text_mate_formatter, for instance.
mengu__ has joined #ruby
<ged> That one already escapes HTML, IIRC.
RagingDave has quit [Quit: Ex-Chat]
<pcasaretto> hmm, strange
gridaphobe has quit [Ping timeout: 255 seconds]
<pcasaretto> if I run "".should == "<script> top.location.href='http://www.google.com' </script>" the window gets redirect to google
tommyvyo_ has joined #ruby
robins35 has joined #ruby
jds_ has joined #ruby
robins35 is now known as Scriptonaut
<Scriptonaut> Hey guys, if I read a file with IO.readlines, modify the array that it returned(deleted and added elements), is there a way to write those changes back to the file?
moos3 has quit [Ping timeout: 255 seconds]
<Scriptonaut> from the array?
kiyoura has joined #ruby
moos3 has joined #ruby
jlast has quit [Remote host closed the connection]
lkba has joined #ruby
zehrizzatti has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
<shevy> Scriptonaut you want to write a file?
<shevy> you can always write data into a file via File.open
<shevy> Scriptonaut, this is what I tend to use usually: http://pastie.org/5665294
berserkr has quit [Read error: Connection reset by peer]
<shevy> save_file(what, where)
<shevy> key is just this, however:
subbyyy has joined #ruby
<shevy> File.open(where, file_mode, permission_to_use) {|file| file.write(what) }
frogstarr78 has quit [Remote host closed the connection]
<shevy> File.open("test.txt",'a+',0755) {|file| file.write('hello world') }
mdw has quit [Read error: Operation timed out]
<shevy> Scriptonaut, this will create a file called test.txt, with content of 'hello world'
mdw has joined #ruby
Martz has quit [Ping timeout: 260 seconds]
<shevy> in your example, you would pass your array to file.write(your_array_variable_here)
<Scriptonaut> shevy: thanks :)
lolcathost has joined #ruby
nkr has quit [Quit: Linkinus - http://linkinus.com]
ner0x has joined #ruby
<pcasaretto> ged: I wrote a simple subclass of IO but I keep getting this TypeError: can't convert IO into Integer
<pcasaretto> in `initialize'
d2dchat has quit [Remote host closed the connection]
luckyruby has quit [Remote host closed the connection]
Martz has joined #ruby
rads has quit [Quit: Computer has gone to sleep.]
slainer68 has quit [Remote host closed the connection]
samphippen has quit [Quit: Computer has gone to sleep.]
jduan1981 has quit [Quit: jduan1981]
Guest9041 has quit [Read error: Connection reset by peer]
kzar has quit [Ping timeout: 252 seconds]
yxhuvud2 has joined #ruby
F1skr has joined #ruby
Russell^^ has quit [Quit: Russell^^]
pskosinski has joined #ruby
davidokner has joined #ruby
<davidokner> Does anyone have Rubymine? I have a question about it.
_nitti has joined #ruby
jds_ has quit [Remote host closed the connection]
tatsuya__ has quit [Remote host closed the connection]
Guest9041 has joined #ruby
<ged> pcasaretto: Why are you subclassing IO? You just need a filter that passes output from one IO through a function to another one right?
<pcasaretto> correct
ossareh has quit [Read error: Connection reset by peer]
<ged> What does your IO subclass do?
<pcasaretto> overrides write with super(CGI.escapeHTML(input))
yxhuvud has quit [Ping timeout: 276 seconds]
Spooner has quit [Quit: Leaving]
_nitti has quit [Read error: Operation timed out]
<davidokner> I noticed that in Rubymine it doesn't show a rubymine or Ruby logo at the top or at the run window, but in PyCharm it shows a Python logo at the top of the window and at the run window.. It is a silly thing, but I wonder why...
<ged> Ah, well I'm not sure how to help with that. I'd do it with an object that just was associated with IO objects, not a subclass.
Astralum has joined #ruby
<pcasaretto> Alright. Thanks anyway man!
hderms has quit [Quit: leaving screen for tmux]
codezombie has quit [Quit: Linkinus - http://linkinus.com]
ChampS666 has quit [Ping timeout: 244 seconds]
mmitchell has quit [Ping timeout: 248 seconds]
kil0byte has quit [Ping timeout: 255 seconds]
ngoldman has quit [Remote host closed the connection]
speakingcode has quit [Quit: leaving]
jimlek22` has joined #ruby
dmerrick has quit [Quit: dmerrick]
DatumDrop has joined #ruby
juarlex has quit [Remote host closed the connection]
woolite64 has quit [Ping timeout: 248 seconds]
<davidokner> can you do something like this in Ruby? for n in name do {|n| puts n.each_char}
jimlek22 has quit [Ping timeout: 255 seconds]
<davidokner> I know that doesn't work exactly, but I'm trying to figure out how to print out each char using a for loop instead of the typical .each do loop
Renich has joined #ruby
<davidokner> I'm trying to learn Python and Ruby and the same time and I'm doing everything twice.
<Gate> davidokner: name.each {|n| puts n.each_char }
<havenn> davidokner: name.each_char { |n| puts n }
<Gate> ugh, right, havenn's
<Renich> hey guys; I wanna choose a random row from a mysql object
<davidokner> But, how do I do that using a for loop?
<davidokner> Like "for n in name puts n end"
<Gate> davidokner: for loops are alsmost never used in ruby
<davidokner> Gate: What about while loops?
Edward_ has quit [Ping timeout: 256 seconds]
<Gate> davidokner: .each or .times eliminate the need for for loops
<davidokner> Gate: I had something that was math related and I couldn't figure out how to do it with .each or .times
<Gate> davidokner: while and until are used
<havenn> davidokner: loop do || while true
jlast has joined #ruby
`brendan has joined #ruby
<ged> davidokner: for n in name.each_char ; puts n; end
Guedes0 has quit [Remote host closed the connection]
rezzack has quit [Quit: Leaving.]
<havenn> davidokner: in Ruby, you're basically adding "for n in" for no reason
<havenn> davidokner: just omit it
ffranz has quit [Quit: Leaving]
dmerrick has joined #ruby
<davidokner> ged: Yes! That worked
taoru has joined #ruby
<ged> davidokner: But Gate is right. That's not a common Ruby idiom.
<ged> name.each_char {...} is much more common.
<havenn> davidokner: here is another uncommon one :P names.each_char(&method(:puts))
<davidokner> ged: I'm practicing with python like syntax and doing ruby and python at the same time.
<davidokner> ged: And doing the ruby only syntax too
jonathanwallace1 has joined #ruby
<julian-delphiki> python sucks
<ged> davidokner: Yeah, cool. Good luck to you, sir. Sounds like a daunting task. :P
<julian-delphiki> any languge that relies on my white space being correct...
<davidokner> If I can speak Python and Ruby that should allow me access to that much more API and libraries.
ossareh has joined #ruby
<pcasaretto> why can't I do this IO.new(STDOUT)?
joshman_ has quit [Read error: Operation timed out]
<pcasaretto> isn't STDOUT just an IO object?
<havenn> davidokner: It is fun translating the Perl6 book to Ruby. Can do a lot of that without backbending around Python syntax. :D
generalissimo has quit [Remote host closed the connection]
marr has quit [Ping timeout: 248 seconds]
<davidokner> I have another question coming up. I have something in Python I can't figure out how to do in Ruby.
<blazes816> gist it
setuid has joined #ruby
<davidokner> It involves a while loop
BoomCow has quit [Quit: Leaving]
<davidokner> It is from lecture 3 of MIT's intro to computer science.
<setuid> Can someone guide me in how to run a Ruby app (Tracks in this case) without having to interactively run "bundle exec script/server -e production" in a screen(1) session?
<ged> pcasaretto: Because IO.new doesn't take an IO, it takes an integer file descriptor. Try: IO.new( STDOUT.fileno )
yshh has joined #ruby
<pcasaretto> the docs say "numeric file descriptor or IO object" but ill try
artOfWar has quit [Remote host closed the connection]
fyolnish has joined #ruby
<pcasaretto> yeah, same freakin exception
jlast has quit [Ping timeout: 244 seconds]
rezzack has joined #ruby
<setuid> It's hard-coded to run on port 3000, and I have to use ProxyPass and ProxyPassReverse to get it to work on a "normal" port, and it's PAINFULLY slow when I do that.
<ged> [3] pry(main)> IO.new( STDOUT.fileno )
<ged> => #<IO:fd 1>
* ged shrugs.
slainer68 has joined #ruby
itsdavem has quit [Remote host closed the connection]
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<pcasaretto> hmm
<pcasaretto> you're right
jonathanwallace1 has quit [Quit: WeeChat 0.3.9.2]
karakedi has joined #ruby
jonathanwallace has joined #ruby
forced_request has joined #ruby
<shevy> $LOADED_FEATURES hmmm
itsdavem has joined #ruby
<shevy> is this always so huge?
<shevy> $LOADED_FEATURES.size # => 204
Scriptonaut has quit [Ping timeout: 260 seconds]
poli has quit [Ping timeout: 252 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
<havenn> pcasaretto: Docs are updated to be accurate in 2.0.0, I think: http://www.ruby-doc.org/core-2.0/IO.html#method-c-new
<blazes816> fresh rails console> $LOADED_FEATURES.size #=> 2220
<Gate> hehe, $LOADED_FEATURES.count # => 2091
<blazes816> what tiny $LOADED_FEATURES that's embarrassing
<pcasaretto> hmm, I was looking at 1.9.3. 1.9.2 says the same
<Gate> irb session, $LOADED_FEATURES.count # => 32
<pcasaretto> thanks havenn
<blazes816> shevy you need more features or your app will never take off
<pcasaretto> the same as 2.0 i mean
<shevy> blazes816 cool
<shevy> was worried that I had so much stuff in it
ilyam has quit [Quit: ilyam]
<shevy> I am looking at code written by someone else. one check is this:
<shevy> if $LOADED_FEATURES.include?('tpty.so')
jds_ has joined #ruby
<shevy> and I wondered who would check for a .so file directly in $LOADED_FEATURES
senj has joined #ruby
<shevy> a count of 2220 seems quite excessive hehe
tatsuya_o has joined #ruby
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<blazes816> it's the sweet spot. 2221 features and it starts feeling heavy
senj has quit [Client Quit]
itsdavem has quit [Ping timeout: 248 seconds]
<shevy> lol
<shevy> Gate yeah... 32... seems a lot more reasonable
slainer68 has quit [Ping timeout: 248 seconds]
<shevy> I have too much baggage from the old days, too many .rb files that I used to pull in for my own .rb scripts
Martz has quit [Ping timeout: 244 seconds]
<shevy> the moment when you want to distribute these, you realize that this isn't easy if they all depend on one another
pskosinski has quit [Quit: Learn Life's Little Lessons]
main has quit [Ping timeout: 255 seconds]
h4mz1d has joined #ruby
cardoni has quit [Quit: cardoni]
orion has joined #ruby
Martz has joined #ruby
<orion> !!!
ukd1 has quit [Ping timeout: 264 seconds]
<orion> "A serious security vulnerability has been found in the Ruby on Rails framework. This exploit affects nearly all applications running Rails and a patch has been made available."
tatsuya_o has quit [Ping timeout: 248 seconds]
<Quadlex> orion: Yup.
<davidokner> error: undefined method 'abs' ?
<Quadlex> Nasty stuff
<davidokner> absolute value method is not found?
<orion> Jumpin' Johnny!
<davidokner> Why doesn't .abs absolute value method work?
krisfremen has quit [Read error: Connection reset by peer]
setuid has quit [Quit: This computer has gone to sleep]
<blazes816> davidokner: what's the code look like?
hackerdude has joined #ruby
segv- has quit [Quit: segv-]
ukd1 has joined #ruby
Virunga has quit [Remote host closed the connection]
<davidokner> blaze816: http://pastebin.com/DGBbpRTK
jds_ has quit [Ping timeout: 264 seconds]
orion has left #ruby [#ruby]
cardoni has joined #ruby
<blazes816> davidokner: x.to_i returns x as an integer, but doesn't assign that value to x
<blazes816> line 3 does nothing
gyre008 has quit [Remote host closed the connection]
<blazes816> change it to: x = x.to_i
<blazes816> or change 2 to: x = gets.to_i
<blazes816> davidokner: or even better: x = Integer(gets)
<davidokner> blaze816: Oh, yeah I get it. no !
<blazes816> will raise an exception if they enter a non integer
<davidokner> If I put to_i!" it might have worked. I can just it on one line though
ukd1 has quit [Client Quit]
DrShoggoth has joined #ruby
Martz has quit [Read error: Operation timed out]
<blazes816> davidokner: objects can't change type.
<blazes816> so you can't have, say, "2".to_i!
<blazes816> because it'd have to change that object into an integer
TheFuzzball has quit [Quit: Computer has gone to sleep.]
<davidokner> x = x.to_i, it is.
hotovson has quit [Remote host closed the connection]
<davidokner> I was actually wondering if it would work by putting the .to_i on a gets
fred909 has quit [Ping timeout: 265 seconds]
<shevy> davidokner or Integer(x)
Martz has joined #ruby
<shevy> x = "5" # => "5"; Integer(x) # => 5
krisfremen has joined #ruby
krisfremen has quit [Changing host]
krisfremen has joined #ruby
<shevy> Integer("0xFF") # => 255
robbyoconnor has joined #ruby
tjbiddle_ has joined #ruby
<shevy> "0xFF".to_i # => 0
<julian-delphiki> >> p "0xFF".to_i
<eval-in> julian-delphiki: Output: "0\n" (http://eval.in/6406)
<julian-delphiki> >> p Integer("0xFF")
<eval-in> julian-delphiki: Output: "255\n" (http://eval.in/6407)
<julian-delphiki> weird
<shevy> yeah
<shevy> I dont like Integer() much, it feels different to the rest of the ruby style
<shevy> like you have ... array.foo.bar.bla ... then suddenly you have an upcased Integer(x) in the middle ...
MattRb has joined #ruby
DatumDrop has quit [Remote host closed the connection]
MattRb has quit [Client Quit]
tjbiddle has quit [Ping timeout: 256 seconds]
TomyLobo has quit [Quit: Standby mode...]
MattRb has joined #ruby
tjbiddle_ has quit [Ping timeout: 248 seconds]
frogstarr78 has joined #ruby
lolcathost has quit [Ping timeout: 255 seconds]
MattRb has quit [Client Quit]
nonmadden has joined #ruby
MattRb has joined #ruby
nonmadden has quit [Read error: Connection reset by peer]
dustint_ has quit [Ping timeout: 255 seconds]
ViPi has quit [Ping timeout: 255 seconds]
xAndy is now known as xandy
Virunga has joined #ruby
lolcathost has joined #ruby
nfk has quit [Quit: yawn]
guns has joined #ruby
echosystm has joined #ruby
<echosystm> if 0x00FF is 256, why isn't 0xFF00 -256?
<echosystm> are hex literals like this always unsigned in ruby?
rwjblue has joined #ruby
mmitchell has joined #ruby
mmitchell has quit [Remote host closed the connection]
<julian-delphiki> >> p "0x00FF".to_i
<eval-in> julian-delphiki: Output: "0\n" (http://eval.in/6408)
<julian-delphiki> >> p "0xFF00".to_i
<eval-in> julian-delphiki: Output: "0\n" (http://eval.in/6409)
dankest is now known as dankest|away
dankest|away has quit [Quit: Leaving...]
<julian-delphiki> >> p Integer("0x00FF")
<eval-in> julian-delphiki: Output: "255\n" (http://eval.in/6410)
<julian-delphiki> >> p Integer("0xFF00")
<eval-in> julian-delphiki: Output: "65280\n" (http://eval.in/6411)
<shevy> dunno. perhaps it overflows or whatever
tps_ has joined #ruby
dankest has joined #ruby
bradhe has quit [Remote host closed the connection]
yxhuvud has joined #ruby
zph has joined #ruby
ilyam has joined #ruby
arya_ has quit [Ping timeout: 264 seconds]
pcasaretto has quit [Quit: pcasaretto]
x82_nicole has quit [Quit: Computer has gone to sleep.]
yxhuvud2 has quit [Ping timeout: 264 seconds]
daslicious has quit [Ping timeout: 276 seconds]
dasmo is now known as daslicious
hadees has quit [Ping timeout: 248 seconds]
guns has quit [Quit: guns]
hadees has joined #ruby
c3vin has joined #ruby
arya_ has joined #ruby
cintrikz has joined #ruby
jds_ has joined #ruby
toekutr has quit [Remote host closed the connection]
laSquishy is now known as autumn
Guest84141 has quit [Ping timeout: 256 seconds]
havenn has quit [Remote host closed the connection]
dustint_ has joined #ruby
taec has joined #ruby
taec is now known as Guest12522
ttt has joined #ruby
spacemud has quit [Ping timeout: 245 seconds]
pen has quit [Remote host closed the connection]
setuid has joined #ruby
joeycarmello has quit [Remote host closed the connection]
AlbireoX has joined #ruby
rads has joined #ruby
arya_ has quit [Ping timeout: 240 seconds]
Hanmac1 has joined #ruby
itsdavem has joined #ruby
jds_ has quit [Ping timeout: 264 seconds]
mockra has quit [Remote host closed the connection]
dankest is now known as dankest|away
friskd has quit [Quit: friskd]
havenn has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
arya_ has joined #ruby
CLUSTERfoo has quit [Ping timeout: 246 seconds]
Bosma has quit [Quit: leaving]
nari has joined #ruby
philips_ has quit [Excess Flood]
jlast has joined #ruby
Shadow_S has joined #ruby
Banistergalaxy has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
crackfu has joined #ruby
twoism has quit [Remote host closed the connection]
dogweather has joined #ruby
nathancahill has quit [Ping timeout: 252 seconds]
spacemud has joined #ruby
Banistergalaxy has joined #ruby
cobragoa_ has quit [Remote host closed the connection]
rynkan has joined #ruby
benlieb has joined #ruby
slainer68 has joined #ruby
<rynkan> Hi, Im following this guide http://dlaxar.blogspot.se/2012/06/installing-gitlab-with-gitolite-on.html and I'm at the part on installing ruby, right after running make and make install, the guide says to start using gem, but this doesnt exist. is there a step missing?
crackfu has quit [Ping timeout: 264 seconds]
nathancahill has joined #ruby
Shadow_S has quit [Quit: Computer has gone to sleep.]
<havenn> rynkan: I'd suggest installing the Rubies included with chruby's setup.sh script! https://github.com/postmodern/chruby
<rynkan> ahh, thanks
<havenn> rynkan: Looks like he's presuming you have Ruby pre-installed on your distro, which you may not.
jaygen has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<havenn> he or she**
slainer68 has quit [Ping timeout: 248 seconds]
<rynkan> That cant be as he's asking me to curl it down (why isn't wget good enough I dont know...) in the steps before
<postmodern> ryanf, what distro are you using?
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
<rynkan> centos
codezombie has joined #ruby
benlieb has quit [Quit: benlieb]
<postmodern> ryanf, ah yes, then you'd want to follow the chruby MRI install instructions
itsdavem has quit [Remote host closed the connection]
<postmodern> ryanf, on ubuntu/fedora you can install 1.9.2 or 1.9.3 from the package manager
<banisterfiend> postmodern: rynkan*
<postmodern> erg
<postmodern> stupid tab-complete
<rynkan> I'll check it out, prob missing the repo
keanehsiao has joined #ruby
phantasm66 has quit [Client Quit]
sn0wb1rd has quit [Quit: sn0wb1rd]
Glassbeads has joined #ruby
<rynkan> havenn: thanks
pen has joined #ruby
<havenn> rynkan: CentOS is Redhat / Fedora (I'm sure you know, but just saying)
<rynkan> yup
aaronmacy has quit [Quit: Leaving.]
<rynkan> Feel stupid for not getting this to work myself
tatsuya_o has joined #ruby
<rynkan> And all I wanted to do is to try gitlab of for the lols :)
jenrzzz has quit [Ping timeout: 248 seconds]
<havenn> rynkan: Install ALL THE RUBIES!! Then benchmark all the things. Great fun to be had! :P
ossareh has quit [Ping timeout: 246 seconds]
F1skr has quit [Quit: WeeChat 0.3.9.2]
<rynkan> I was about to learn ruby but lisp said "me first" and then i was f#ck3d
stan has quit [Ping timeout: 244 seconds]
squidBits has quit [Quit: whoops]
<Renich> hey guys, I've got a bunch of id's from a DB table. I created an array. I need to append elements to that multi-level array... how?
<Renich> it starts as array[1] = 1
<Renich> then, it should grow to: array[1] = [1, 2, 3, 4] in a while loop
<Renich> ... or something...
philips_ has joined #ruby
tatsuya_o has quit [Ping timeout: 248 seconds]
io_syl has quit [Ping timeout: 256 seconds]
<havenn> rynkan: From the Ruby man page: "If you ... like the concept of LISP, but don't like too many parentheses, Ruby might be your language of choice."
<rwjblue> Renich: << ?
cableray has quit [Quit: cableray]
<Renich> rwjblue: ok... and that means what?
<rwjblue> Renich: array[1] << 5
skcin7 has joined #ruby
<Renich> ah, ok ;)
cableray has joined #ruby
end_guy has quit [Ping timeout: 276 seconds]
<rwjblue> would make array[1] equal to [1,2,3,4,5]
<Renich> rwjblue: let me try that
<rynkan> havenn: didn't know about that, might give it a try as i'm adding it to my playgroundserver
stan has joined #ruby
<rynkan> thansk all for the lightning fast help!
* rynkan adding #ruby to autojoin
<Renich> rwjblue: it's appending stuff
<Renich> rwjblue: test[1] << 'ble'
<Renich> => "blableble"
<rwjblue> OK, so array[1] isn't an array to start with?
Glassbeads has left #ruby [#ruby]
<rynkan> so rubygems are the package manager of ruby, cute
<havenn> rynkan: We have great named gems, like Rainbows! and Unicorn too.
<Renich> rwjblue: yeah, you're right... solved it by test[1] = ['bla']
<Renich> then << and + work
<rwjblue> Renich: if your input may or may not already be an array you could use Array(some_value)
a_a_g has joined #ruby
<havenn> rynkan: And some interestingly named gems, like lolita, hash_dealer, ball_gag, etc.
adkron has joined #ruby
a_a_g has quit [Client Quit]
<rwjblue> Renich: Array(1) #=> [1]; Array([1]) #=> [1]
<Renich> rwjblue: ok, thanks for that havenn
Virunga has quit [Remote host closed the connection]
niklasb has quit [Quit: WeeChat 0.3.9.2]
<rynkan> ahh.. the famous and ubernerdy "unzip, strip, touch, finger, grep ..."-approach
jbw has quit [Ping timeout: 256 seconds]
karasawa has joined #ruby
<Renich> rwjblue: now that's odd... what is the #=>
mneorr has quit [Remote host closed the connection]
philcrissman has joined #ruby
krz has joined #ruby
<RubyPanther> how did grep sneak in there?
<rwjblue> Renich: was just showing the output of those two commands (is my pry prompt)
<Renich> rwjblue: oh, ok
krzkrz has joined #ruby
<rwjblue> Renich: was saying that calling Array() on 1 or [1] returns the same value ([1])
sn0wb1rd has joined #ruby
itsdavem has joined #ruby
<davidokner> Can anyone tell me why the second version of this algorithm doesn't work, but the first one does? http://pastebin.com/avumXHgA
<Renich> rwjblue: cool. So I think I got it. The content of test[0] must be an array as well, so I can append to it with <<
<rwjblue> Renich: yes
wizzlepig has joined #ruby
<Renich> rwjblue: thanks a lot
<rwjblue> Renich: np
<davidokner> I just created the second algorithm using a for loop instead of a while loop trying to recreate the same behavior.
<rynkan> similar to grip i suppose or something
jjbohn has joined #ruby
DatumDrop has joined #ruby
doritostains has joined #ruby
<wizzlepig> hi - can someone help? I am a beginner, trying to figure out how to do something
<wizzlepig> in Ruby, that is
<davidokner> wizzlepig: I'm new too, but I could try.
<wizzlepig> thanks!
<wizzlepig> so, I am feeding in four variables- they're clues to a puzzle. The point is to make a program to solve the puzzle.
yxhuvud2 has joined #ruby
<rynkan> unicorn seems awesome
<rwjblue> rynkan: it is
<wizzlepig> so I am storing all the problem logic data in five arrays. I am quite certain this is not the best programming methodology, but
<havenn> rynkan: Yeah, Unicorn and Puma are my fav Ruby webservers!
<wizzlepig> actually, it's five arrays of five arrays. anyway- I can check any array value using eval("h#{hx}[x1][x2]")
c0rn has quit [Quit: Computer has gone to sleep.]
<havenn> rynkan: Jesse Storimer gave a great talk mostly on Unicorn at the last RubyConf: http://www.confreaks.com/videos/1289-rubyconf2012-grow-your-unix-beard-using-ruby
<wizzlepig> but I can't assign a value to one of the arrays this way
yxhuvud has quit [Ping timeout: 248 seconds]
<davidokner> wizzlepeg: I haven't tried anything more than basic arrays in ruby.
<rwjblue> wizzlepig: why use eval there?
DatumDrop has quit [Ping timeout: 264 seconds]
<setuid> Can someone guide me in how to run a Ruby app (Tracks in this case) without having to interactively run "bundle exec script/server -e production" in a screen(1) session?
<setuid> It's hard-coded to run on port 3000, and I have to use ProxyPass and ProxyPassReverse to get it to work on a "normal" port, and it's PAINFULLY slow when I do that.
<havenn> wizzlepig: Can you paste a Gist of what you have so far?
<wizzlepig> sure
<rynkan> and so went the last of my sparetime, can ruby handle steaming video/audio?
<rynkan> streaming*
philcrissman has quit [Remote host closed the connection]
<rynkan> havenn: thx for the link
<wizzlepig> # Beginning data set
<wizzlepig> a1 = [[0,0,0,0,0,0], [0, "sw", "br", "no", "ge", "da"], [0, "ye", "re", "bl", "wh", "gr"], [0, "be", "mi", "co", "wa", "te"], [0, "fi", "ho", "do", "ca", "bi"], [0, "bu", "pi", "bd", "du", "pa"]]
<wizzlepig> h4 = [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
<wizzlepig> h3 = [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
<wizzlepig> h5 = [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
<wizzlepig> h1 = [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
<wizzlepig> h2 = [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]]
<wizzlepig> ha = [[1,0,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0],[1,0,0,0,0,0]]
<wizzlepig> # Begin checking sequence for A is B -x
<wizzlepig> #
<wizzlepig> x1 = 1
<wizzlepig> x2 = 2
adeponte has quit [Remote host closed the connection]
cardoni has quit [Quit: Linkinus - http://linkinus.com]
PragCypher has quit [Quit: Leaving]
<wizzlepig> there's a lot more logic not showing here,
<rwjblue> wizzlepig: use https://gist.github.com
codezombie has quit [Quit: Linkinus - http://linkinus.com]
<havenn> wizzlepig: I meant: https://gist.github.com
<havenn> wizzlepig: Start a Github account! There is great code-reading to be had on Github.
<wizzlepig> ah, cool
<rwjblue> no need for an account to gist
<havenn> wizzlepig: (And Github itself runs on Ruby, hosts big projects like Linux and Rails, etc.)
<havenn> rwjblue: true, true
mengu__ has quit [Quit: Leaving]
jbw has joined #ruby
DatumDrop has joined #ruby
<havenn> rwjblue: do you like the new gist layout?
rads has quit [Quit: Computer has gone to sleep.]
<rwjblue> havenn: yes, but has taken a bit to get used to
<havenn> rwjblue: yeah, its growing on me too :)
<rwjblue> the layout is much better, but for whatever reason it has taken me a while to get used to the last 5 being on top instead the margins
<havenn> rwjblue: haha, yeah i find myself looking to the right of the window too
yfeldblum has joined #ruby
Stormpath has quit [Quit: Stormpath]
zeade has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
jimlek22` has quit [Ping timeout: 252 seconds]
zeade has quit [Client Quit]
Daman has joined #ruby
Daman has quit [Changing host]
Daman has joined #ruby
camidoo has quit [Quit: camidoo]
seich- has quit [Ping timeout: 276 seconds]
<havenn> wizzlepig: I can't tell what you're trying to do?
jpfuentes2 has joined #ruby
<rwjblue> wizzlepig: I have no idea what the point of the logic is, and it seems like a couple of methods would be helpful (possibly a hash to hold the arrays)
whitedawg has joined #ruby
<havenn> ^ A Hash of the Arrays to iterate over would make sense.
<havenn> If the a1-ha local variable names are important?
<rwjblue> wizzlepig: if you absolutely have to use eval then use it to grab your base array first into a variable then operate on it separately
pen has quit [Remote host closed the connection]
<RubyPanther> #send means never having to say eval :)
oktapodi has joined #ruby
<rwjblue> RubyPanther: indeed
seich- has joined #ruby
brianpWins has quit [Quit: brianpWins]
stan has quit [Ping timeout: 264 seconds]
griffindy has quit [Quit: Computer has gone to sleep.]
macmartine has joined #ruby
pen has joined #ruby
dustint_ has quit [Quit: Leaving]
xandy is now known as xAndy
jlast has joined #ruby
<wizzlepig> Hi, I put a comment on my post over at github
ninp0 has joined #ruby
dogweather has quit [Remote host closed the connection]
joeycarmello has joined #ruby
<wizzlepig> oh, darn, have to go. I will come back later, thanks for the github link!
<havenn> wizzlepig: cool problem, later!
jjbohn has quit [Quit: Leaving...]
<havenn> wizzlepig: Now I gotta solve it...!
flip_digits has joined #ruby
<rwjblue> wizzlepig: posted a comment
<havenn> wizzlepig: I've been having a lot of fun doing Project Euler with Ruby: http://projecteuler.net
frem has joined #ruby
jlast has quit [Ping timeout: 252 seconds]
jjbohn has joined #ruby
<wizzlepig> thanks all, gotta run, back later!
wizzlepig has quit []
<rwjblue> havenn: that looks cool
oktapodi has quit [Remote host closed the connection]
Guest9041 has quit [Ping timeout: 276 seconds]
philcrissman has joined #ruby
pencilcheck has joined #ruby
<havenn> rwjblue: I've only done a couple dozen, but its a blast and I'd like to keep going!
joeycarmello has quit [Ping timeout: 246 seconds]
Guest9041 has joined #ruby
<havenn> Solved 21 out of 409
<davidokner> I just realized the MIT introduction to programming is borrrring. All they are showing is how to solve math problems with python.
pen has quit [Read error: Connection reset by peer]
<davidokner> And the loops are kind of complicated for starting
<havenn> davidokner: Have you gone through TryRuby.org and RubyKoans?
<davidokner> I went through tryruby.org, but I found something better and I just found out about RubyKoans and found it strange how it was all "assert" this etc.
<davidokner> I'm going through the pragmatic publisher course on Ruby.
<havenn> davidokner: mmmmm, yeah a MiniTest::Spec port of RubyKoans would be pretty cool.
Drewch has quit [Ping timeout: 246 seconds]
<havenn> davidokner: I haven't done that one. Any good so far?
<davidokner> haven: Yes it is.
r3nrut has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
bigmac has joined #ruby
whitedawg has quit [Quit: Leaving.]
<davidokner> I'm also checking out the intro to programming by UC Berkely, Harvard, MIT and Stanford.
<davidokner> "Berkeley"
<davidokner> Although they are mostly in python.
<davidokner> Harvards is really different.
<davidokner> MIT is very dry.
taoru has quit [Remote host closed the connection]
<davidokner> UC Berkeley and harvard are not as boring so far.
philcrissman has quit [Remote host closed the connection]
Drewch has joined #ruby
forced_request has quit [Read error: Connection reset by peer]
busybox42 has joined #ruby
toekutr has joined #ruby
jgrevich has quit [Quit: jgrevich]
philcrissman has joined #ruby
otherj has joined #ruby
jgrevich has joined #ruby
breakingthings has joined #ruby
jgrevich has quit [Client Quit]
Guest9041 has quit [Ping timeout: 240 seconds]
lolcathost is now known as Automorphism
h4mz1d has quit [Ping timeout: 246 seconds]
`brendan has quit [Ping timeout: 248 seconds]
stan has joined #ruby
CLUSTERfoo has joined #ruby
zehrizzatti has quit [Quit: Linkinus - http://linkinus.com]
danneu has quit [Ping timeout: 252 seconds]
jduan1981 has joined #ruby
<breakingthings> Anyone know of an app/gem/example of Curses and resizing?
<r3nrut> ncurses-ruby
r3nrut has quit [Quit: leaving]
<breakingthings> That's not what I was asking :d
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
roadt_ has joined #ruby
ilyam has quit [Quit: ilyam]
beneggett has joined #ruby
mockra has joined #ruby
cintrikz has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
mockra_ has joined #ruby
pencilcheck has quit [Remote host closed the connection]
reset has quit [Ping timeout: 276 seconds]
serhart has quit [Quit: Leaving.]
yxhuvud has joined #ruby
mockra has quit [Ping timeout: 265 seconds]
jblack has quit [Ping timeout: 255 seconds]
guns has joined #ruby
<setuid> Any passenger experts about?
yxhuvud2 has quit [Ping timeout: 255 seconds]
<setuid> I'm trying to figure out how to get a rails app running under Apache/passenger, instead of having to launch it under a screen(1) session, but not having much luck
reppard has quit [Ping timeout: 252 seconds]
dmiller1 has quit [Ping timeout: 252 seconds]
n1x has quit [Ping timeout: 265 seconds]
<setuid> My config looks like this: http://pastebin.com/PdLktDxY
danneu has joined #ruby
frem has quit [Quit: Computer has gone to sleep.]
<otherj> any reason you're asking here rather than the rails chan?
templaedhel has quit [Quit: Leaving...]
Guest9041 has joined #ruby
<setuid> Didn't know there was one… I'll jump there. Sorry.
paul_k has joined #ruby
jblack has joined #ruby
kil0byte has joined #ruby
dankest|away has quit [Quit: Leaving...]
<otherj> no problem. you just might get more help over there
<otherj> #rubyonrails
banisterfiend has quit [Ping timeout: 252 seconds]
toekutr has quit [Remote host closed the connection]
mockra has joined #ruby
mockra_ has quit [Ping timeout: 264 seconds]
mockra_ has joined #ruby
dankest has joined #ruby
mockra__ has joined #ruby
reset has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
dmerrick has quit [Quit: dmerrick]
mockra has quit [Ping timeout: 252 seconds]
toekutr has joined #ruby
adeponte has joined #ruby
mockra_ has quit [Ping timeout: 260 seconds]
a_a_g has joined #ruby
io_syl has joined #ruby
mayhew has quit [Quit: leaving]
jlast has joined #ruby
Automorphism has quit [Ping timeout: 260 seconds]
echosystm has quit [Quit: leaving]
baroquebobcat has joined #ruby
jlast has quit [Ping timeout: 252 seconds]
tommyvyo_ has quit [Quit: http://twitter.com/tommyvyo]
lolcathost has joined #ruby
tommyvyo_ has joined #ruby
tommyvyo_ has quit [Client Quit]
v0n has joined #ruby
ddd has joined #ruby
baroquebobcat has quit [Client Quit]
dmiller1 has joined #ruby
serhart has joined #ruby
roadt_ has quit [Ping timeout: 248 seconds]
lewiseason has quit [Disconnected by services]
sayan has joined #ruby
c3vin has quit [Ping timeout: 240 seconds]
dmiller1 has quit [Ping timeout: 244 seconds]
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
baroquebobcat has joined #ruby
dmiller1 has joined #ruby
voodoofish has quit [Read error: Connection reset by peer]
dmiller1 has quit [Ping timeout: 244 seconds]
thinkclay has quit [Quit: Leaving.]
aaronmacy has joined #ruby
aaronmacy has quit [Client Quit]
<Renich> can anybody tell me why this doesn't work? http://paste.stg.fedoraproject.org/3062/
<Renich> I've been looking at it for hours...
Dreamer3 has quit [Quit: Leaving...]
<shevy> Renich why dont you print the data structure
<Renich> it says: block in <main>': undefined method `[]' for nil:NilClass (NoMethodError)
<shevy> require 'pp';pp users
<Renich> shevy: is p ok or you actually need pp?
<shevy> apparently you tried to use [] on an object that does not exist (hence the nil)
<shevy> I want pp
<shevy> I dont use p
seoaqua has joined #ruby
<shevy> when you see the data structure, you will know what there was illegal
macmartine has joined #ruby
<shevy> I dont know a method called .each_hash btw hmmm that is non standard ruby or?
<Renich> shevy: #<Mysql::Result:0x00000001afddd0>
<shevy> that is pp users?
<Renich> yes
<Renich> shevy: users is a mysql result object
<shevy> hmm ok... so users is a Mysql::Result object, which must have a method called each_hash do |u|
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
<shevy> what does pp u inside the block give you?
<Renich> if I eliminate line 9, everything works... with incomplete data of course
<shevy> is that actually a real hash
<shevy> ok so teams[ u[ 'teamId' ] ][ manager ] does not exist
<Renich> shevy: {"teamId"=>"1", "userId"=>"3", "role"=>"manager"}
<shevy> do pp teams before that line?
<Renich> ok
<shevy> aha
<shevy> Renich, you use manager
<shevy> which must be a variable
frogstarr78 has quit [Remote host closed the connection]
<shevy> you dont use 'manager'?
radic has joined #ruby
<Renich> shevy: {"1"=>{"3"=>[]}}
<shevy> sorry
<shevy> ewww
<shevy> what kind of data structure is that ;)
templaedhel has joined #ruby
<shevy> a 1 pointing to a 3 pointing to an empty array hehe
<Renich> ;=s sorry, a newbie here, shevy
<Renich> and I want the empty array filled with some id's in the else clause
<shevy> no, oldbies get confused too, that's why simple data structures are awesome
adkron has quit [Ping timeout: 256 seconds]
<shevy> what I would first do is, assign a variable to u[ 'teamId' ]
<Renich> shevy: I just wanted a data structure containing teams[ manager[ employee1, employee2, employee3 ] ] ]
<shevy> wait
<Renich> ok
<shevy> that is a strange key
<seoaqua> how to use active record on Mongodb,pls? is it officially supported?
busybox42 has quit [Ping timeout: 244 seconds]
<shevy> Renich your data structure confuses me... aren't hashes usually like this?
mibitzi has joined #ruby
<shevy> hash['colour'] = 'brown'
<shevy> in your example... you would try a...
<Renich> shevy: yeah, you're right... but I need a multi-level ... something... hash or array
<shevy> hash[ some_other_data_structure[ foo, bar, bla] ]
<shevy> ok
<Renich> shevy: first answer, 9 votes
radic_ has quit [Ping timeout: 244 seconds]
<shevy> well you should try to keep data structures simple
<Renich> shevy: what do you recommend? use arrays only?
voodoofish has joined #ruby
<shevy> I dont know, you do not have test data for me to test :(
<shevy> it is usually easiest to come up with ... input data ... result you want to achieve. then it is easier to help
havenn has joined #ruby
h4mz1d has joined #ruby
<shevy> right now I dont know what users.each_hash do |u| really gives you
itsdavem has quit [Remote host closed the connection]
<shevy> u[ 'role' ]
<shevy> apparently it must be a hash with this key
havenn has quit [Read error: Connection reset by peer]
keanehsiao has quit [Quit: keanehsiao]
<Renich> shevy: yes, let me try to work something out... I'll get you some data
<shevy> I also dont know what getManager does
<shevy> ok
<shevy> btw, I just realized ...
<shevy> you try to use manager as a key to your hash:
<shevy> manager = getManager( db, u[ 'teamId' ].to_i )
<shevy> perhaps this may be a nil object
yxhuvud2 has joined #ruby
itsdavem has joined #ruby
<shevy> then you would have:
<Renich> shevy: yep, it gets that team's manager's id
<shevy> teams[ u[ 'teamId' ] ][ nil ] ||= u[ 'userId']
<shevy> or
itsdavem has quit [Read error: Connection reset by peer]
<Renich> shevy: it's not, it returns [3] or[1]
<shevy> teams[ u[ 'teamId' ] ] could be nil
<Renich> ok
<shevy> hmm wait
<shevy> it returns 3 or [3] ?
<Renich> [#]
<Renich> [3] that is
<shevy> that is an array? hmmm
<shevy> teams[ u[ 'teamId' ] ][ [3] ] ||= u[ 'userId']
<shevy> that looks kinda odd
<Renich> ok, so turn that into an int
<shevy> you can always do: pp manager.class
<Renich> u[ 'teamId' ] should be 1 2 or 3
hackerdude has quit [Remote host closed the connection]
<Renich> ok
itsdavem has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
itsdavem has quit [Read error: Connection reset by peer]
<shevy> ok but then, teams[1] teams[2] teams[3] would all have to return a proper value and not be nil
<Renich> shevy: returns [3]
<shevy> Renich, you could try to dumb down your code, and split it up, until it all works
<Renich> shevy: ok, I'll try that
<shevy> pp manager.class returns [3] ?
<Renich> shevy: no, pp manager
<shevy> nono
<Renich> shevy: it returns Array
yxhuvud has quit [Ping timeout: 246 seconds]
<shevy> ok
karasawa has quit [Ping timeout: 276 seconds]
<Renich> shevy: let me make it an int
<shevy> so your code tries this: teams[ u[ 'teamId' ] ][ [3] ]
<shevy> that looks really weird
itsdavem has joined #ruby
<Renich> shevy: ok, it's Fixnum now
itsdavem has quit [Read error: Connection reset by peer]
<shevy> Renich assign a variable to this first: teams[ u[ 'teamId' ] ]
<shevy> like x = teams[ u[ 'teamId' ] ]
<Renich> shevy: ok
<shevy> then pp x
<shevy> and then, do the code you normally do, with that variable
<shevy> (of which you know will fail)
itsdavem has joined #ruby
luckyruby has joined #ruby
<Renich> shevy: ok, new version: http://paste.stg.fedoraproject.org/3063/
otherj has quit [Quit: otherj]
<shevy> nice, you broke things up into smaller components
<shevy> I usually do that, and then when it works, I sometimes put them back into longer components again
<Renich> shevy: ok, so pp role, user and manager:
<Renich> "3"
<Renich> "1"
<Renich> "manager"
<shevy> huh
<shevy> manager is a string?
<Renich> err
<shevy> hmmmm
<shevy> you wrote
<shevy> <Renich> shevy: it returns Array
<shevy> I thought it was a hash?
<Renich> shevy: yes, it is, it's the actual role
<shevy> what is pp teams[ team ] giving you?
skaczor has quit [Remote host closed the connection]
<shevy> you can replace pp manager.class with pp teams[ team ] and rerun
<Renich> shevy: {"3"=>[]}
<Renich> shevy: ok, role comes from the DB but manager = getManager used to return an array; now a Fixnum
<shevy> hmmmm
<shevy> {"3"=>[]}[3] # => nil
arkiver has joined #ruby
<shevy> {"3"=>[]}[43] # => nil
<shevy> you see?
<Renich> yep
<shevy> {"3"=>[]}['3'] # => []
<shevy> you could try via manager.to_s
<Renich> but, that's before the else
<shevy> teams[ team ][ manager.to_s ]
<shevy> why is that before the else?
<shevy> in the link you gave, you have this line:
<shevy> teams[ team ][ manager ] ||= user
rezzack has quit [Ping timeout: 264 seconds]
<shevy> so logically if teams[ team ] equals to {"3"=>[]}, and then you do this ...
<shevy> {"3"=>[]}[manager], where manager is 3, then you will get a nil
<shevy> because manager is 3, and not "3"
philcrissman has quit [Remote host closed the connection]
jlwestsr has joined #ruby
<Renich> shevy: oh, ok
<Renich> yeah
sn0wb1rd has quit [Quit: sn0wb1rd]
<Renich> shevy: then, just turn team into a string?
<shevy> dunno
DatumDrop has quit [Remote host closed the connection]
<shevy> it all seems very strange what you do there
<Renich> I mean, manager
<Renich> yeah, ok, let me try something
<shevy> yeah, you can try that
<shevy> but I think the whole design of that is kinda awful... is that really how the ruby bindings for mysql should be used?
hadees has quit [Ping timeout: 248 seconds]
<Renich> shevy: ok, the actual version: http://paste.stg.fedoraproject.org/3064/
gordon1775 has quit [Ping timeout: 252 seconds]
<Renich> shevy: and this is a run: http://paste.stg.fedoraproject.org/3065/
ryanf has quit [Ping timeout: 252 seconds]
<shevy> you should always check for nil
h4mz1d has quit [Ping timeout: 252 seconds]
<shevy> before calling the [] method
hadees has joined #ruby
<shevy> teams[ team ][ manager.to_s ] ||= user if teams[ team ][ manager.to_s ]
<arkiver> Can anyone suggest a good book/guide for learning OOP in ruby ?
<shevy> or even better, assign a new variable
seoaqua has quit [Quit: 离开]
<shevy> arkiver pickaxe for a beginner, http://pragprog.com/book/ruby/programming-ruby
<Renich> shevy: assign a var to what?
<shevy> Renich a variable, then use it
<shevy> x = teams[ team ]; x[ manager.to_s ] if x
jlwestsr has quit [Quit: Ex-Chat]
<shevy> but as said, I think you must be doing something wrong before, I can not believe that the mysql gem is so bad
<Renich> shevy: mysql is retrieveing everything, I know this...
zph has quit [Quit: Computer has gone to sleep.]
<Renich> shevy: ok, check this out: http://paste.stg.fedoraproject.org/3066/
<Renich> shevy: pp teams yields: http://paste.stg.fedoraproject.org/3066/
<Renich> shevy: err... {"1"=>{"3"=>[]}, "2"=>{"2"=>[]}, "3"=>{"4"=>[]}}
<Renich> shevy: that is almost everything I need... 1 is the team, 3 is the manager...
<shevy> aha
<Renich> shevy: I just need the therapists inside []
<shevy> just add them there
MattRb has quit [Quit: Leaving]
ninp0 has quit [Ping timeout: 248 seconds]
sn0wb1rd has joined #ruby
<Renich> shevy: how?! that's what I've been struggling with... hehe
MattRb has joined #ruby
<shevy> hash = {"1"=>{"3"=>[]}, "2"=>{"2"=>[]}, "3"=>{"4"=>[]}}
<shevy> hash['3']['4'] << 'here is therapist'
MattRb has quit [Client Quit]
<shevy> hash # => {"3"=>{"4"=>["here is therapist"]}, "2"=>{"2"=>[]}, "1"=>{"3"=>[]}}
MattRb has joined #ruby
<shevy> as you use variables, you must ensure that the variables return the right value
<Renich> shevy: ok
jlast has joined #ruby
<shevy> teams[ team ][ manager.to_s ]
sayan has quit [Read error: Connection reset by peer]
<shevy> teams[ '3' ][ '4' ] << 'therapist'
<shevy> teams[ team.to_s ][ manager.to_s ] << 'therapist'
<shevy> if those are 3 and 4, Fixnums
<Renich> shevy: ok, let me try that
woolite64 has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
subbyyy has quit [Quit: none 0.3.9.2]
bigmac has quit [Remote host closed the connection]
CLUSTERfoo has quit [Ping timeout: 240 seconds]
tommyvyo has quit [Quit: http://thomasvendetta.com]
jlast has quit [Ping timeout: 244 seconds]
jjbohn has quit [Quit: Leaving...]
h4mz1d has joined #ruby
chriskk has quit [Quit: chriskk]
dmiller1 has joined #ruby
tommyvyo has joined #ruby
rakl has quit [Quit: sleeping]
bigmac has joined #ruby
h4mz1d has quit [Ping timeout: 244 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
dmiller1 has quit [Ping timeout: 252 seconds]
lolcathost is now known as Automorphism
hdm has joined #ruby
otherj has joined #ruby
<hdm> fyi, if anyone is stuck loading unsafe YAML content, you might want to try this: https://github.com/rapid7/psych_shield
otherj has quit [Client Quit]
<hdm> its not pretty, but it works as band-aid for apps that still need to load evil YAML
karasawa has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
regedarek has quit [Ping timeout: 265 seconds]
cha1tanya has quit [Ping timeout: 240 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
tatsuya_o has joined #ruby
<shevy> Renich cant you put code + output into the same paste?
ryanf has joined #ruby
cha1tanya has joined #ruby
<shevy> also, check for nil man
<shevy> ./sales-generator.rb:128:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError)
<shevy> an error like that would not happen if you check whether the object you desire exists or not
Guest12522 has quit [Ping timeout: 264 seconds]
<shevy> apparently ManagerId: 4 does not exist
dankest is now known as dankest|away
tatsuya_o has quit [Ping timeout: 248 seconds]
regedarek has joined #ruby
<shevy> hash = {'cat' => 'tom'}; hash.has_key? 'cat' # => true
<shevy> that is another way to check whether your hash has a key or not
rippa has joined #ruby
dhruvasagar has joined #ruby
quest88 has joined #ruby
Renich has quit [Ping timeout: 276 seconds]
Renich has joined #ruby
<Renich> shevy: I am sure user with id 4 is on the DB. In fact, ran the query independently and I got it...
<shevy> then why does it fail
<shevy> and why do you use puts()
<shevy> :\
<Renich> shevy: I wish I knew...
breakingthings has quit []
<shevy> and print() :/
<shevy> and you are not even consistent about it!
<shevy> sometimes you use it sometimes not
<Renich> shevy: I dunno, just to print stuff on screen?
<shevy> sure, it works with or without ()
<Renich> shevy: print ommits |n
<shevy> I know why print is used, I know why puts is used
<shevy> what I do not know is why you switch between the two all the time
<Renich> shevy: yeah, well, I'm writing fast to provide output for ya, hehe... I usually like puts( )
<shevy> well
<shevy> then at least use it consistently!
<Renich> shevy: print doesn't add \n and puts does... that's all
v0n has quit [Ping timeout: 252 seconds]
<Renich> shevy: I will
<shevy> what I do is define e()
<shevy> which I use for output
seoaqua has joined #ruby
<shevy> e 'hello world'
beneggett has joined #ruby
dankest|away has quit [Quit: Leaving...]
<shevy> my e() uses ansi escape sequences for coloured output
generalissimo has joined #ruby
<shevy> anyway
<Renich> shevy: nice ;)
<shevy> ok
<shevy> I can not concentrate on the problem
<shevy> I see stuff like:
<shevy> puts ''
<shevy> and I dont know why you use that!
<Renich> shevy: lol, ok, let me fix that then
blazes816 has quit [Quit: blazes816]
<shevy> ManagerId: 4
<Renich> shevy: oh, puts '' is for new lines... just that...
<shevy> and why not puts alone? without the ''?
<Renich> shevy: yeah, ManagerId is what getManager() get's... but... no userId: 4 anywhere...
shtirlic has joined #ruby
<Renich> shevy: because it doesn't work without ''
<shevy> use .has_key? or .include? before using []
generalissimo has quit [Remote host closed the connection]
<shevy> what do you mean
<shevy> what is the difference between puts and puts ''
generalissimo has joined #ruby
<Renich> shevy: puts alone doesn't add a new line
JohnBat26 has joined #ruby
<shevy> huh
<shevy> >> puts
<eval-in> shevy: Output: "\n" (http://eval.in/6412)
<shevy> Renich why do you lie to the bot here :(
<shevy> >> print
<eval-in> shevy: Output: "" (http://eval.in/6413)
<shevy> >> puts ''
<eval-in> shevy: Output: "\n" (http://eval.in/6414)
<shevy> anyway, this is only stylistic
<Renich> shevy: ok, I thought it didn't ;=s
<shevy> use whatever works for you
<shevy> you must change your code so that a [] on a nil object can not happen
<shevy> nil[] will not work
<shevy> array = [1,2,3]; array[0] # => 1
<shevy> works
fumbe has quit [Ping timeout: 260 seconds]
<shevy> hash = { :cat => 'tom', :mouse => 'jerry' }; hash[:cat] # => "tom"
<shevy> both use []
<shevy> Renich, by the way, do you know how to define [] for your own classes?
<Renich> shevy: nope
<shevy> it is very simple
<shevy> class Foo; def [](i); end; end
<shevy> foo = Foo.new # => #<Foo:0x7f5af795f980>; foo[5]
<shevy> in this example, it does not do anything
<shevy> but you can see that foo responds to []
<Renich> shevy: yep
pen has joined #ruby
<shevy> class Bar; end; bar = Bar.new; bar[5] # NoMethodError: undefined method `[]' for #<Bar:0x7f5af7955c00>
<shevy> whereas this class would not know the [] method
<shevy> which is the same error you get with nil, by the way
<Renich> shevy: ok
vlad_starkov has joined #ruby
shtirlic has quit [Ping timeout: 255 seconds]
<shevy> on strings, [] also works. ruby kind of likes to do the similar things
<shevy> "abc"[2,1] # => "c"
<Renich> shevy: nice ;=)
<shevy> x = "abc"; x[2,1] = 'd'; x # => "abd"
kenneth has quit [Quit: kenneth]
<shevy> yeah, it is beautiful
<shevy> try the same in php
<shevy> or wait, let me find out... been years since I used php ...
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<Renich> shevy: lol
regedarek has quit [Ping timeout: 276 seconds]
yxhuvud has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
setuid has quit [Quit: Leaving]
<Renich> shevy: oh man... I know what's up...
yxhuvud2 has quit [Ping timeout: 252 seconds]
<Renich> forgot to order by id and role...
<shevy> php is a mess, I can not locate how to change a string
<Renich> shevy: and that last therapist was being assigned to a manager that wasn't on the structure...
<shevy> ah ... substr()
<shevy> $rest = substr("abcdef", -1); # returns "f"
<Renich> shevy: you can do $x[0:5]
<shevy> rest = "abcdef"[-1,1]
<Renich> shevy: in PHP that is
<shevy> aha
<shevy> ok
<shevy> that is shorter
<Renich> shevy: so, problem solved... woohoo
ananthakumaran has joined #ruby
<shevy> man, it's been so long that I used php ...
neurotech has joined #ruby
<Renich> shevy: I'm making a ZendFramework app righ tnow
<shevy> Renich good!
Rym has joined #ruby
<shevy> hehe
<shevy> comforts
<Renich> shevy: and I'm not even a programmer... heh...
<Renich> shevy: but I like ruby
<shevy> I am not a programmer either
<Renich> shevy: not rails... just ruby... maybe sinatra
<shevy> but ruby is too good to not use it
<shevy> it's the glue language I use for everything I do
<Renich> shevy: yeah... took some online MIT course on Python... the more I know it... the more I like ruby
<shevy> hehe
<shevy> hmm python seems better than php
<wildcard0> python is also a great language
<Renich> wildcard0: it is
<Renich> wildcard0: I just happen to like ruby
<shevy> I think if I would have started with python, I would not be in ruby today
<Renich> I like php as well... but I appreciate the difference
<shevy> there are some things in python that I dont like though
<wildcard0> personally <3 ruby. but that doesn't mean that python is bad :)
<shevy> one of the biggest hate I have is for explicit self
<Renich> shevy: let me guess: print()
<shevy> hmm, print() is annoying
regedarek has joined #ruby
<shevy> but explicit self I really absolutely hate
<Renich> shevy: yeah, hehe
<shevy> forced indent... hmm... I think it was a mistake... but I would not hate python because of it
<Renich> wildcard0: yeah, but ruby is more comfortable to me
<wildcard0> me too
<Renich> shevy: man, thanks a lot for the attention and help, I really appreciate it
<shevy> foo() vs foo ... I am not sure it was a good idea to force parens, but I'd not hate python for it
<shevy> eh Renich I am glad you managed to solve it
<Renich> shevy: I like foo()... it tells you that a funciton is that
<shevy> well, yeah
<shevy> it reduces ambiguity
<shevy> but consider this:
<shevy> foo.bar
<shevy> vs
<shevy> foo.bar()
<shevy> I dont think there is a lot of ambiguity there
<Renich> shevy: a class and a method... I like the later
mockra has joined #ruby
<shevy> but foo is the object and bar is the message that is being called
<Renich> foo.bar could be a property...
<Renich> shevy: ok, yeah, everything is an object, I get it
<shevy> well, you modify internal values via methods
<shevy> foo.bar = 5 # is also a method call
<shevy> hmm
<shevy> a moment ;)
camidoo has joined #ruby
<shevy> class Foo; def bar=(i) puts i * i; end; end; foo = Foo.new; foo.bar = 5 # 25
<Renich> shevy: tell me one thing... why pp and not p? one less require
<shevy> yeah, the require sucks
<shevy> if I would be matz, I would make pp a default
ner0x has quit [Ping timeout: 264 seconds]
<shevy> Renich, I feel that pp outputs a nicer data structure to you
mockra__ has quit [Ping timeout: 248 seconds]
<shevy> if you have a long array
<Renich> shevy: oh... ok
<shevy> compare this:
<shevy> pp %w( agjklsasgjkl asgjkl asgjklagsjkl asgagagjkl sjkl asgjkl agsjkl agsjkl asgagsjkl wegkljgwejklwegjklwegjk )
<shevy> with p too
<Renich> ok
<shevy> you will see that pp makes proper new lines + formatting
<shevy> if you want colours on top of that, try "awesome_print", ap... but it is not standard ruby, only a gem :(
<Renich> shevy: oh, I see
aaronmacy has joined #ruby
<Renich> shevy: new lines
<Renich> hehe
<shevy> oh btw Renich if you use irb, have a look at the wirble gem
<shevy> gem install wirble
<shevy> it will give you a few colours on return values
<shevy> irb is nice for simple tests
<Renich> shevy: yeah I use irb... so wirble
<Renich> I'll get that one
<shevy> I dont like awesome print though, it has too many colours
kil0byte has quit [Read error: Connection reset by peer]
<Renich> shevy: so, rainbow like, huh?
<shevy> haha
<shevy> hmm... not sure... I tested it for a while but it felt too distracting actually
kil0byte has joined #ruby
<Renich> shevy: going to have some dinner; c ya some other time and thanks a lot for the help
beneggett has quit [Quit: Computer has gone to sleep.]
<shevy> cya Renich
<Renich> shevy: bye
Renich has left #ruby [#ruby]
ner0x has joined #ruby
beneggett has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
aaronmacy has quit [Quit: Leaving.]
Gooder has joined #ruby
quest88 has quit [Quit: quest88]
dankest has joined #ruby
kenneth has joined #ruby
otters has quit [Ping timeout: 276 seconds]
jlast has joined #ruby
sayan has quit [Quit: Leaving]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
Sgeo has quit [Read error: Operation timed out]
uris has quit [Quit: Leaving]
_huoxito has quit [Quit: Leaving]
aaronmacy has joined #ruby
frogstarr78 has joined #ruby
huoxito has quit [Quit: Leaving]
jlast has quit [Ping timeout: 260 seconds]
cha1tanya has quit [Ping timeout: 264 seconds]
chriskk has joined #ruby
ebouchut has joined #ruby
DrShoggoth has quit [Quit: Leaving]
nathancahill has quit [Read error: Connection reset by peer]
dmiller1 has joined #ruby
nathancahill has joined #ruby
ner0x has quit [Quit: Leaving]
nathancahill has quit [Read error: Connection reset by peer]
slainer68 has joined #ruby
nathancahill has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
decal has joined #ruby
kil0byte has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
dmiller1 has quit [Ping timeout: 264 seconds]
mibitzi has quit [Ping timeout: 276 seconds]
slainer68 has quit [Ping timeout: 248 seconds]
jblack has quit [Ping timeout: 264 seconds]
itsdavem has quit [Remote host closed the connection]
h4mz1d has joined #ruby
cableray has quit [Quit: cableray]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
generalissimo has quit [Remote host closed the connection]
io_syl has joined #ruby
ebouchut has quit [Quit: This computer has gone to sleep]
beneggett has quit [Quit: Computer has gone to sleep.]
rippa has quit [Ping timeout: 260 seconds]
apeiros has quit [Remote host closed the connection]
CLUSTERfoo has joined #ruby
apeiros_ has joined #ruby
cableray has joined #ruby
cha1tanya has quit [Ping timeout: 248 seconds]
pen has quit [Read error: Connection reset by peer]
mrbtie has joined #ruby
pen has joined #ruby
h4mz1d has quit [Ping timeout: 240 seconds]
tonini has joined #ruby
bigmac has quit [Ping timeout: 276 seconds]
jean-louis has joined #ruby
chriskk has quit [Read error: Connection reset by peer]
h4mz1d has joined #ruby
yxhuvud2 has joined #ruby
Hanmac has joined #ruby
yxhuvud has quit [Ping timeout: 255 seconds]
mockra_ has joined #ruby
jean-louis has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
jean-louis has joined #ruby
arya_ has quit [Ping timeout: 276 seconds]
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
carlzulauf has quit [Ping timeout: 240 seconds]
mockra__ has joined #ruby
mockra has quit [Ping timeout: 252 seconds]
rippa has joined #ruby
templaedhel has quit [Quit: Leaving...]
arya_ has joined #ruby
mockra_ has quit [Ping timeout: 255 seconds]
kenneth has quit [Quit: kenneth]
vlad_starkov has joined #ruby
dmerrick has joined #ruby
Rym has quit [Quit: Rym]
DatumDrop has joined #ruby
Vert has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Ping timeout: 240 seconds]
mrbtie has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 264 seconds]
seoaqua has quit [Quit: 离开]
mahmoudimus has joined #ruby
pskosinski has joined #ruby
tommyvyo has joined #ruby
kenneth has joined #ruby
arya_ has joined #ruby
goganchic has joined #ruby
kiyoura has quit [Quit: Leaving]
maletor has joined #ruby
robustus has quit [Ping timeout: 248 seconds]
jlast has joined #ruby
DatumDrop has quit [Ping timeout: 240 seconds]
goganchic has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 260 seconds]
browndawg has joined #ruby
robustus has joined #ruby
topriddy has joined #ruby
jlast has quit [Ping timeout: 265 seconds]
h4mz1d has quit [Ping timeout: 255 seconds]
GoGoGarrett has joined #ruby
pnkbst has quit [Ping timeout: 276 seconds]
templaedhel has joined #ruby
nemesit has joined #ruby
dmiller1 has joined #ruby
ziprar has joined #ruby
ziprar has joined #ruby
slainer68 has joined #ruby
stan has quit [Ping timeout: 244 seconds]
horofox has joined #ruby
zipace has quit [Ping timeout: 260 seconds]
dmiller1 has quit [Ping timeout: 252 seconds]
Elhu has joined #ruby
browndawg1 has joined #ruby
slainer68 has quit [Ping timeout: 240 seconds]
osaut has joined #ruby
CLUSTERfoo has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
Bry8Star has quit [Remote host closed the connection]
browndawg has quit [Ping timeout: 260 seconds]
itsdavem has joined #ruby
Bry8Star has joined #ruby
Automorphism has quit [Ping timeout: 276 seconds]
TomyLobo has joined #ruby
dr_bob has joined #ruby
haxrbyte has joined #ruby
itsdavem has quit [Ping timeout: 265 seconds]
clocKwize has joined #ruby
fatninja has quit [Changing host]
fatninja has joined #ruby
lolcathost has joined #ruby
Morkel has joined #ruby
beneggett has joined #ruby
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
workmad3 has joined #ruby
mahr_123 has joined #ruby
browndawg1 has quit [Quit: Leaving.]
Mon_Ouie has joined #ruby
browndawg has joined #ruby
piotr_ has joined #ruby
solars has quit [Ping timeout: 248 seconds]
horofox has quit [Quit: horofox]
stan has joined #ruby
arturaz has joined #ruby
Morkel_ has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
Morkel has quit [Ping timeout: 264 seconds]
Morkel_ is now known as Morkel
jean-louis has quit [Ping timeout: 276 seconds]
yxhuvud has joined #ruby
arya_ has quit [Ping timeout: 264 seconds]
zigomir has joined #ruby
serhart has quit [Quit: Leaving.]
hadees has quit [Quit: hadees]
mockra__ has quit [Remote host closed the connection]
yxhuvud2 has quit [Ping timeout: 255 seconds]
hadees has joined #ruby
arya has joined #ruby
mockra has joined #ruby
clooth has joined #ruby
nomenkun has joined #ruby
nomenkun has quit [Remote host closed the connection]
nomenkun has joined #ruby
solars has joined #ruby
kil0byte_ has quit [Remote host closed the connection]
c3vin has joined #ruby
SCommette has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
TomyLobo has quit [Quit: Standby mode...]
SCommette has quit [Client Quit]
filipe has joined #ruby
ChampS666 has joined #ruby
cableray has quit [Quit: cableray]
maletor has quit [Quit: Computer has gone to sleep.]
c3vin has quit [Ping timeout: 240 seconds]
CLUSTERfoo has joined #ruby
clooth has quit [Quit: clooth]
eldariof has joined #ruby
blaxter has joined #ruby
cableray has joined #ruby
x82_nicole has joined #ruby
dawkirst has quit [Ping timeout: 244 seconds]
apeiros_ has joined #ruby
topriddy has quit [Quit: Leaving.]
mafolz has joined #ruby
CLUSTERfoo has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
CLUSTERfoo has joined #ruby
scruple has joined #ruby
tagrudev has joined #ruby
hbpoison has joined #ruby
mockra_ has joined #ruby
aganov has joined #ruby
templaedhel has quit [Quit: Leaving...]
workmad3 has quit [Ping timeout: 252 seconds]
mockra has quit [Ping timeout: 255 seconds]
mockra_ has quit [Remote host closed the connection]
jlast has joined #ruby
JohnBat26 has quit [Read error: No route to host]
topriddy has joined #ruby
advorak has joined #ruby
JohnBat26 has joined #ruby
dankest has quit [Quit: Leaving...]
arya has quit [Ping timeout: 265 seconds]
romaint has joined #ruby
<romaint> Hi
fyolnish has quit [Remote host closed the connection]
JohnBat26 has quit [Client Quit]
JohnBat26 has joined #ruby
<romaint> Do someone know a trick to call hash['foo']['bar']['9'] from an array like [ 'foo', 'bar', '9' ] ?
arya has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
baphled has joined #ruby
DatumDrop has joined #ruby
arya has quit [Client Quit]
<arturaz> romaint, do you want it to make your code look smart?
<apeiros_> keys.inject(hash) { |h,k| h[k] }
<apeiros_> @ romaint
<romaint> Nop, because the element to fetch is variable ;)
<arturaz> then what apeiros_ said :)
<arturaz> just make h & k into hash and key respectively ;)
<romaint> But if it's near to complicated, i'll not use nested hash but a simple key like 'foo:bar:9'
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<romaint> apeiros_: Thanks i try
jduan1981 has quit [Quit: jduan1981]
jds_ has joined #ruby
dmiller1 has joined #ruby
<romaint> But i may use a namespaced string since i'm not sure my coworkers will be able to see the intent :/
adeponte has quit [Remote host closed the connection]
dankest has joined #ruby
hdm has left #ruby [#ruby]
hbpoison has quit [Ping timeout: 255 seconds]
andrewhl has quit [Remote host closed the connection]
<arturaz> romaint, you can just .split(":") on it ;)
dmiller1 has quit [Ping timeout: 248 seconds]
<romaint> I meant : instead to use a nested hash, i could have use a unique string with many components (joined by : in the example)
xnm has joined #ruby
TheFuzzball has joined #ruby
<romaint> But apeiros_ snippet is good and with an example of usage, it's okay for everyone on the project to understand
nomenkun has quit [Remote host closed the connection]
<apeiros_> romaint: no, make a method
<romaint> I did ;)
DatumDrop has quit [Ping timeout: 265 seconds]
<apeiros_> passing around code snippets--, making proper classes & methods with docs++
<romaint> And I have tests for that
Spami has joined #ruby
<romaint> (as_hash only contains AssetConfigurationParamsDumper.new(self).dump, which is tested too)
cableray has quit [Quit: cableray]
x82_nicole has quit [Quit: Computer has gone to sleep.]
topriddy has quit [Ping timeout: 260 seconds]
topriddy1 has joined #ruby
nomenkun has joined #ruby
cha1tanya has quit [Ping timeout: 252 seconds]
rdark has joined #ruby
nfk has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Loaft has joined #ruby
clooth has joined #ruby
xnm has quit [Quit: WeeChat 0.3.8]
polymar has joined #ruby
mafolz has quit [Ping timeout: 260 seconds]
pen has quit [Remote host closed the connection]
gyre008 has joined #ruby
sayan has quit [Ping timeout: 248 seconds]
main has joined #ruby
mafolz has joined #ruby
Loaft has quit []
chussenot has joined #ruby
Weems has joined #ruby
horofox has joined #ruby
ChampS666 has quit []
Elhu has joined #ruby
horofox has quit [Client Quit]
guns has quit [Ping timeout: 256 seconds]
baphled has quit [Ping timeout: 244 seconds]
yxhuvud2 has joined #ruby
hbpoison has joined #ruby
clooth has quit [Quit: clooth]
LouisGB has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
yxhuvud has quit [Ping timeout: 260 seconds]
chriskk has joined #ruby
maxmanders has joined #ruby
cableray has joined #ruby
stan has quit [Read error: Connection reset by peer]
skcin7 has quit []
DatumDrop has joined #ruby
blacktulip has joined #ruby
gregoryigelmund has joined #ruby
LouisGB has quit [Read error: Connection reset by peer]
hbpoison has quit [Ping timeout: 255 seconds]
Vert has joined #ruby
LouisGB has joined #ruby
osaut has quit [Quit: osaut]
hoelzro|away is now known as hoelzro
ryanf has quit [Ping timeout: 264 seconds]
clooth has joined #ruby
timonv has joined #ruby
DatumDrop has quit [Ping timeout: 252 seconds]
RagingDave has joined #ruby
robotmay has joined #ruby
arkiver has quit [Quit: Leaving]
megha has quit [Ping timeout: 264 seconds]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
usultis has joined #ruby
staafl has joined #ruby
pen has joined #ruby
chriskk has quit [Quit: chriskk]
usultis_ has joined #ruby
usultis__ has joined #ruby
jlast has joined #ruby
CLUSTERfoo has left #ruby [#ruby]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
gregoryigelmun has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
gregoryigelmund has quit [Read error: Operation timed out]
shtirlic has joined #ruby
jimeh has joined #ruby
staafl_alt has joined #ruby
dmiller1 has joined #ruby
jds_ has quit [Remote host closed the connection]
dankest has quit [Quit: Leaving...]
shtirlic has quit [Ping timeout: 248 seconds]
Guest9041 has quit [Remote host closed the connection]
mockra has joined #ruby
timonv has quit [Remote host closed the connection]
megha has joined #ruby
tatsuya_o has joined #ruby
staafl has quit [Ping timeout: 276 seconds]
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
assurbanipal has joined #ruby
timonv has joined #ruby
hbpoison has joined #ruby
odyssey4me has joined #ruby
dmiller1 has quit [Ping timeout: 248 seconds]
pen has quit [Remote host closed the connection]
QKO_ has joined #ruby
elaptics`away is now known as elaptics
mockra has quit [Ping timeout: 256 seconds]
end_guy has joined #ruby
slainer68 has joined #ruby
QKO has quit [Ping timeout: 264 seconds]
noxoc has joined #ruby
arietis has joined #ruby
browndawg has quit [Ping timeout: 248 seconds]
x82_nicole has joined #ruby
yacks has quit [Ping timeout: 252 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby
DatumDrop has joined #ruby
browndawg has joined #ruby
haxrbyte has quit [Ping timeout: 248 seconds]
swex_ has quit [Ping timeout: 252 seconds]
reinaldob has joined #ruby
hoelzro is now known as hoelzro|away
pen has joined #ruby
itsdavem has joined #ruby
toekutr has quit [Read error: Connection reset by peer]
m3pow has joined #ruby
buscon has joined #ruby
fyolnish has joined #ruby
cableray has quit [Quit: cableray]
eldariof has quit [Ping timeout: 260 seconds]
itsdavem has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
hoelzro|away is now known as hoelzro
<Fuzai> Is it possible to make a self enclosed binary out of a piece of ruby code that has the right version level of the interpreter and modules?
DatumDrop has quit [Ping timeout: 255 seconds]
rdark has quit [Ping timeout: 246 seconds]
kevinfagan has joined #ruby
<reactormonk> fuzai, which target platform?
<Fuzai> linux
<Fuzai> The default version of ruby is a few levels back from the 1.9.x that I need by default
<reactormonk> Hmmm, linux people don't like to package manager being circumvented
ionte has quit [Read error: Connection reset by peer]
rdark has joined #ruby
<Fuzai> i was hoping i could make a very easy self contained "binary" for ubuntu and others that wouldn't require the ruby 1.9.x hackery to get running
<Fuzai> the problem is that the default in ubuntu for ruby is I think 1.8
ionte has joined #ruby
<reactormonk> depends which ubuntu
<reactormonk> I'm sure there are backports
<Fuzai> again thats not part of "apt-get install ruby"
<reactormonk> Well, do you really want to implemnt your own updating stuff?
<Fuzai> no not really, I just know what kind of people are trying to run these scripts i'm making
<reactormonk> fuzai, I'd go ask in #ubuntu how to solve it.
<Fuzai> they'll say install ruby1.9 and update-alternatives
<Fuzai> alternatives
yxhuvud has joined #ruby
<reactormonk> you don't need an update-alternatives if you use a shebang that looks for ruby1.9
<Fuzai> So the answer is no, you can't build a self enclosed binary to run your script with a specific version of ruby
<reactormonk> Yes, you can. But it's a bad idea imo.
<reactormonk> You have a package manager on linux. Use it, even if you have to hack a bit, as above.
<reactormonk> Or just go for #!/usr/bin/env ruby1.9 and set your dependencies correctly.
<Fuzai> the problem isn't so much changing to use /usr/bin/env
<Fuzai> I had a problem with adding packages to ruby without updating it's alternatives as well
yxhuvud2 has quit [Ping timeout: 265 seconds]
<Fuzai> and i don't know enough about ruby to say that's the only two places that really needed to be updated
<Fuzai> i would assume there is something else i'm missing, but everything is working fine for now
timmow has joined #ruby
wf2f has quit [Ping timeout: 264 seconds]
<Fuzai> i've been using something like 1.9.x but for as much headache i had trying to figure out how to install modules from a git repo, I can only assume the people that are going to be trying to use this are going to have that much harder
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
nomenkun has quit [Remote host closed the connection]
mafolz has quit [Ping timeout: 255 seconds]
<reactormonk> Well, if you want to develop for ubuntu, you'll have to support LTS.
dmerrick has quit [Quit: dmerrick]
yacks has joined #ruby
<Fuzai> I want to develop a Ruby script that isn't locked to a particular method or distrubution ( or their packages version )
Vainoharhainen has joined #ruby
<reactormonk> Welcome to the real world.
<Fuzai> i have no loyality to one distro or another I just happen to use ubuntu
<reactormonk> That's the curse of diversity :-/
m3pow has quit [Remote host closed the connection]
<Fuzai> :(
mafolz has joined #ruby
<reactormonk> Use the package manager at least for the interpreter, try to use ruby libs from LTS and/or newer ones (I think the lastest + LTS should be good enough) and vendor what you need to.
QKO has joined #ruby
<reactormonk> But in case of vendoring, you need to ship through any upstream updates...
swex has joined #ruby
workmad3 has joined #ruby
<Fuzai> oh i wasn't going to go that far if thats what you were thinking
<Fuzai> I was just going to host some code in a git repo
<reactormonk> fuzai, can't tell you much about how to create a debian package :-/
<Fuzai> Its ok
<reactormonk> fuzai, but I'm sure there's a bunch of stuff out there - it's not that simple though :-(
<Fuzai> i wasn't trying to create a package i was trying to avoid a bunch of people screwing up what could be a bunch of odd directions
<reactormonk> create a package and everything's in butter
QKO_ has quit [Ping timeout: 256 seconds]
<reactormonk> for archlinux, you can go with a PKGBUILD that creates your stuff directly from git
<Fuzai> hrm
<reactormonk> It's simpler than debian packages imo. But if you prefer ubuntu, go for it. It's higher in distrowatch anyway ;-)
<Hanmac> reactormonk: your shebang is wrong: its only "#!/usr/bin/env ruby"
<reactormonk> Hanmac, nope, it's right for the above problem where you want ruby 1.9 without screwing with update-alternatives
yacks has quit [Ping timeout: 244 seconds]
<Hanmac> fuzai you are halfright the default ruby on ubuntu since 12.10 is ruby1.9(.3)
chussenot has quit [Quit: chussenot]
<Hanmac> reactormonk then you got a problem because u dont have an ruby1.9 binary only "ruby" & "ruby1.9.1"
<_hemanth_> is there a easy way to raise expection to stdout, such that it's not rescued ?
<reactormonk> Hanmac, fuck.
<reactormonk> _hemanth_, nope, raises always go to stderr, as they should.
<_hemanth_> reactormonk, hmm
chussenot has joined #ruby
<reactormonk> _hemanth_, use 2>&1 if you want to redirect stderr to stdout
<_hemanth_> reactormonk, resuce everything expect on kina expection can be mentioned?
<reactormonk> _hemanth_, what's your usecase?
<_hemanth_> being...raise "My expection"...resuce => every_thing_expect_my_expection end
<Fuzai> well poot
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
<reactormonk> _hemanth_, sounds like flow control to me... what are the semantics?
<Xeago> damnit
<Xeago> feels like I am on dialup
Gooder has quit [Remote host closed the connection]
<Hanmac> fuzai and if you make an package that depends on ruby, depend on the virtual package "ruby-interpreter" its provided from ruby1.8 and ruby1.9
francisfish has joined #ruby
aaronmacy has quit [Quit: Leaving.]
<_hemanth_> reactormonk, well, it can be re-written. I'm just looking out for better ways
pcarrier has joined #ruby
eldariof has joined #ruby
<reactormonk> Hanmac, what if the stuff only runs on 1.9?
<Fuzai> i need to be at least at 1.9.3
<Fuzai> this stupid turntable module
DatumDrop has joined #ruby
nkr has joined #ruby
hbpoison has quit [Ping timeout: 255 seconds]
jlast has joined #ruby
<Hanmac> reactormonk then, and only then you could depend on ruby1.9.1
hbpoison has joined #ruby
aaronmacy has joined #ruby
csgui has joined #ruby
eldariof-office has joined #ruby
eldariof has quit [Ping timeout: 246 seconds]
jlast has quit [Ping timeout: 260 seconds]
staafl has joined #ruby
adambeynon has joined #ruby
ewnd9 has joined #ruby
samphippen has joined #ruby
segv- has joined #ruby
segv- has quit [Client Quit]
menace has joined #ruby
staafl_alt has quit [Ping timeout: 252 seconds]
csgui has quit [Quit: csgui]
dmiller1 has joined #ruby
ramen_ has joined #ruby
DatumDrop has quit [Ping timeout: 244 seconds]
ewnd9 has quit [Read error: Connection reset by peer]
hbpoison has quit [Ping timeout: 240 seconds]
hbpoison has joined #ruby
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
lkba has quit [Quit: Bye]
pavilionXP has joined #ruby
dmiller1 has quit [Ping timeout: 276 seconds]
arietis has quit [Quit: Computer has gone to sleep.]
nomenkun has joined #ruby
ramen_ has left #ruby ["Leaving"]
hbpoison has quit [Ping timeout: 240 seconds]
dwu1 has quit [Quit: Leaving.]
nomenkun has quit [Read error: Connection reset by peer]
pen has quit [Remote host closed the connection]
nomenkun has joined #ruby
clooth has quit [Quit: clooth]
Xeago has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
blacktulip has joined #ruby
xpen has joined #ruby
atmosx has joined #ruby
csgui has joined #ruby
jds__ has joined #ruby
chussenot has quit [Quit: chussenot]
chussenot_ has joined #ruby
hbpoison has joined #ruby
hotovson has joined #ruby
jds__ has quit [Ping timeout: 240 seconds]
nomenkun has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
<nathancahill> is this an ok way of creating an array, if i don't know if var is an array of strings or a string?
<nathancahill> array = ([] << var).flatten
baphled has joined #ruby
<nathancahill> array needs to be flat, even if var is an array
assurbanipal has quit [Remote host closed the connection]
nomenkun_ has joined #ruby
<hoelzro> nathancahill: I think Array(var).flatten would do it too
tonini has quit [Remote host closed the connection]
xpen has quit [Remote host closed the connection]
QKO has quit [Ping timeout: 246 seconds]
<hoelzro> actually, you don't even need flatten there
<hoelzro> >> puts Array('foo')
<eval-in> hoelzro: Output: "foo\n" (http://eval.in/6434)
<hoelzro> >> puts Array(%w{foo bar baz})
<eval-in> hoelzro: Output: "foo\nbar\nbaz\n" (http://eval.in/6435)
charliesome_ has joined #ruby
<hoelzro> \o/
cdt has joined #ruby
<nathancahill> awesome
<nathancahill> thank you!
<hoelzro> np
c3vin has joined #ruby
carloslopes has joined #ruby
<nathancahill> i know i'm overthinking it when a line looks like array = ([] << var).flatten
clooth has joined #ruby
QKO has joined #ruby
klaut has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
fermion has joined #ruby
fyolnish has quit [Ping timeout: 264 seconds]
DatumDrop has joined #ruby
yxhuvud2 has joined #ruby
yshh has quit [Remote host closed the connection]
browndawg has left #ruby [#ruby]
yxhuvud has quit [Ping timeout: 264 seconds]
ezkl has joined #ruby
Spooner has joined #ruby
QKO_ has joined #ruby
gregoryigelmun has quit [Quit: Leaving...]
matthewrobbins has joined #ruby
ezkl has joined #ruby
ezkl has quit [Changing host]
zz_chrismcg is now known as chrismcg
QKO has quit [Ping timeout: 255 seconds]
end_guy has quit [Remote host closed the connection]
Xeago has joined #ruby
end_guy has joined #ruby
ananthakumaran1 has joined #ruby
DatumDrop has quit [Ping timeout: 252 seconds]
afd__ has joined #ruby
ananthakumaran has quit [Ping timeout: 255 seconds]
haxrbyte has joined #ruby
nari has quit [Ping timeout: 245 seconds]
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
woolite64 has quit [Ping timeout: 260 seconds]
chussenot_ is now known as chussenot
Morkel has quit [Remote host closed the connection]
Morkel has joined #ruby
dreinull has joined #ruby
hbpoison has quit [Ping timeout: 255 seconds]
Morkel_ has joined #ruby
<dreinull> how do I use the rdoc 4 gem instead of the default version that comes with ruby? (cli)
<dreinull> oh, the cli is automatically the gem. weird.
tommyvyo has quit [Quit: http://thomasvendetta.com]
hbpoison has joined #ruby
jlast has joined #ruby
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
lkba has joined #ruby
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
larissa has joined #ruby
jlast has quit [Ping timeout: 265 seconds]
reset has quit [Ping timeout: 252 seconds]
sayan has quit [Ping timeout: 248 seconds]
aaronmacy has quit [Quit: Leaving.]
klaut has quit [Remote host closed the connection]
Beoran__ has joined #ruby
answer_42 has joined #ruby
dmiller1 has joined #ruby
ezkl has joined #ruby
Beoran_ has quit [Ping timeout: 256 seconds]
rgrau has joined #ruby
charliesome_ is now known as charliesome
mibitzi has joined #ruby
mikecmpbll has joined #ruby
atno has quit [Read error: Connection reset by peer]
DatumDrop has joined #ruby
dmiller1 has quit [Ping timeout: 244 seconds]
atno has joined #ruby
knirhs is now known as Shrink
Shrink has quit [Changing host]
Shrink has joined #ruby
atmosx has quit [Quit: And so the story goes…]
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
gyre008 has quit [Remote host closed the connection]
gordon1775 has joined #ruby
pencilcheck has joined #ruby
gyre008 has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
jlast has joined #ruby
Edward_ has joined #ruby
cha1tanya has quit [Quit: Leaving]
staafl_alt has joined #ruby
gyre008 has quit [Remote host closed the connection]
DatumDrop has quit [Ping timeout: 244 seconds]
QKO has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
_hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has quit [Read error: Connection reset by peer]
itsdavem has joined #ruby
jlast has quit [Ping timeout: 264 seconds]
hemanth_ has joined #ruby
_hemanth_ has joined #ruby
MattRb has joined #ruby
arturaz has quit [Remote host closed the connection]
staafl has quit [Ping timeout: 260 seconds]
QKO_ has quit [Ping timeout: 264 seconds]
MattRb has quit [Client Quit]
staafl_123 has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
staafl_123 has quit [Max SendQ exceeded]
staafl_123 has joined #ruby
pcarrier has quit []
itsdavem has quit [Ping timeout: 265 seconds]
staafl_alt has quit [Ping timeout: 260 seconds]
fgro has joined #ruby
staafl_alt has joined #ruby
WilfredTheGreat has joined #ruby
<fgro> a basic ruby array operator question. say a=[1,2], b=[3,4] ... whats the operator so the elements of "b" are inserted in "a" ? a << b => [1,2,[3,4]] ..
itsdavem has joined #ruby
<tobiasvl> a + b
banisterfiend has joined #ruby
<tobiasvl> >> p [1,2] + [3,4]
<eval-in> tobiasvl: Output: "[1, 2, 3, 4]\n" (http://eval.in/6453)
<fgro> tobiasvl: so i need a = a + b ... but there is no operator that directly works on a? like with hashes "merge!"
<tobiasvl> >> print [1,2].concat [3,4]
<eval-in> tobiasvl: Output: "[1, 2, 3, 4]" (http://eval.in/6454)
hbpoison has quit [Ping timeout: 248 seconds]
<fgro> cool would be a += b # a == [1,2,3,4]
<tobiasvl> >> print ([1,2] << [3,4]).flatten
<eval-in> tobiasvl: Output: "[1, 2, 3, 4]" (http://eval.in/6455)
yxhuvud has joined #ruby
staafl_123 has quit [Ping timeout: 276 seconds]
<tobiasvl> fgro: oh but that works fine
<tobiasvl> >> print a = [1,2]; a += [3,4]
<eval-in> tobiasvl: Output: "[1, 2]" (http://eval.in/6456)
<tobiasvl> oh.
<tobiasvl> >> a = [1,2]; print a += [3,4]
<eval-in> tobiasvl: Output: "[1, 2, 3, 4]" (http://eval.in/6457)
<fgro> thx!
<tobiasvl> np
tarsolya has joined #ruby
yxhuvud2 has quit [Ping timeout: 264 seconds]
bluenemo has joined #ruby
<Spooner> >> 12
<eval-in> Spooner: Output: "" (http://eval.in/6458)
<Spooner> Hmm, bit dumb that it ignores the return value, but whatever.
shtirlic has joined #ruby
<tobiasvl> yeah ...
<tobiasvl> should behave like irb IMHO
Niamkik has quit [Quit: Disconnecting from stoned server.]
pcarrier has joined #ruby
<Spooner> >> puts 12
<eval-in> Spooner: Output: "12\n" (http://eval.in/6459)
Niamkik has joined #ruby
odyssey4me has quit [Read error: Connection reset by peer]
polymar has quit [Read error: Operation timed out]
odyssey4me has joined #ruby
<Spooner> Do you know what happened to the old bot? Was up in the middle of last year. I like the auto-pastie on this one though.
timonv_ has joined #ruby
polymar has joined #ruby
timonv has quit [Read error: Connection reset by peer]
reppard has joined #ruby
<Mon_Ouie> The author just removed it. I don't think he's still here either.
<Spooner> Mon_Ouie, OK. Wasn't sure if someone (you) managed to break it in the end!
<Spooner> And impressive that eval.in supports 2.0 and other implementations. I expected nothing past 1.9.2 ;)
yacks has joined #ruby
* Spooner tries to install 2.0.0-preview2 again.
itsdavem has quit [Remote host closed the connection]
yacks has quit [Max SendQ exceeded]
Edward_ has quit [Ping timeout: 248 seconds]
yacks has joined #ruby
baphled has quit [Ping timeout: 256 seconds]
chussenot has quit [Quit: chussenot]
pencilcheck has quit [Remote host closed the connection]
krzkrz has quit [Quit: Leaving]
mahr_123 has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0/20130107224849]]
timonv_ has quit [Remote host closed the connection]
DatumDrop has joined #ruby
baphled has joined #ruby
ttt has quit [Remote host closed the connection]
timonv has joined #ruby
rwjblue has quit [Ping timeout: 264 seconds]
shtirlic has quit [Read error: Connection reset by peer]
itsdavem has joined #ruby
shtirlic has joined #ruby
reppard has quit [Ping timeout: 260 seconds]
elico has joined #ruby
<tobiasvl> wish people here would start using print instead of p or puts, i hate that trailing newline ;)
<apeiros_> o0
malte_ has joined #ruby
<apeiros_> ah, with eval-in
<apeiros_> it's funny that it mixes output with inspect
<apeiros_> I mean, either it's output (= no inspect) or it's a return value (= inspect)
v0n has joined #ruby
staafl_alt has quit [Read error: Connection reset by peer]
<tobiasvl> apeiros_: yeah with eval-in obviously
robbyoconnor has quit [Read error: Connection reset by peer]
<Xeago> apeiros_: you can compile my fork of LimeChat if you want, it is at github.com/Xeago/LimeChat
diegoviola has joined #ruby
<diegoviola> hi
pcarrier has quit []
jonahR has joined #ruby
<diegoviola> i have a script that pulls files over http to a current dir in my fs, i would like to "listen" from another script on a dir and whenever a file is created, react and call another function to tell me the length/size of the dir, number of files, etc
<diegoviola> my question is, do i need inotify for this?
DatumDrop has quit [Ping timeout: 255 seconds]
<diegoviola> in order to tell when a file arrives in the fs
<diegoviola> the files have different names, etc
<Spooner> You do if you want to do it efficiently.
hbpoison has joined #ruby
<diegoviola> ok ty
<diegoviola> guard looks nice
<Spooner> If you don't care you could do it in Ruby easily enough.
arturaz has joined #ruby
<diegoviola> Spooner: how?
<diegoviola> any example?
ewet has joined #ruby
<Spooner> files = Dir[PATH]; loop { sleep 1; f = Dir[PATH]; changed = f - files; files = f }
<Spooner> About as dumb as it could be though. inotify or similar are 100x better.
<diegoviola> ok thanks
jonahR has quit [Quit: jonahR]
hemanth_ has quit [Ping timeout: 248 seconds]
MattRb has joined #ruby
_hemanth_ has quit [Ping timeout: 248 seconds]
<ewet> hi, is there a pseudoword generator that uses a dictionary to build words from syllables (like forchive-tomgory). I know about forgery and I know that it would be possible to extend it - I just hope somebody already took the efford
pcarrier has joined #ruby
dmiller1 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
menace has left #ruby [#ruby]
Shrink has quit [Ping timeout: 264 seconds]
fyolnish has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
fgro has quit [Ping timeout: 248 seconds]
serhart has joined #ruby
<JonnieCache> oh you mean syllables. interesting
<JonnieCache> workmad3: you live in manchester dont you?
<workmad3> yeah
<workmad3> why?
<JonnieCache> you should go to this tommorrow http://deliaderbyshireday.wordpress.com/delia-derbyshire-day-2013/
pen has joined #ruby
<workmad3> *suspicion level raised*
<JonnieCache> if you enjoy interesting music
a_a_g1 has joined #ruby
pcarrier has quit [Client Quit]
<workmad3> heh
dmiller1 has quit [Ping timeout: 255 seconds]
<workmad3> I like all of my music to be dull, uninspired and autotuned
<JonnieCache> hah you will hate the work of delia derbyshire then
cjs226 has quit []
<workmad3> oh, and dictated to me by big record labels
a_a_g has quit [Ping timeout: 252 seconds]
<Spooner> I'd like it, but I'm 50 miles away ;)
Jackneill has joined #ruby
<JonnieCache> Spooner: didnt realise youre UK
<Spooner> Lancaster.
<Spooner> Thought mostly I seem to inhabit Cloud Cuckoo Land.
roadt has joined #ruby
Divinite has joined #ruby
<Divinite> Hello, does anyone know a platform to develop apps using ruby other than Ruboto?
<Spooner> Divinite, google can find plenty.
<Divinite> Spooner: I've found some, but I'm looking for open source.
Kuifje has joined #ruby
_bart has joined #ruby
<Divinite> I was also seeing who has had experience with developing using ruby on Android
reppard has joined #ruby
<Divinite> I should've been more specific
<JonnieCache> Spooner: i live in brighton, which acutally is cloud cuckoo land
<Divinite> Android, not iOD
<Spooner> Two things you didn't ask for. Sorry.
Shrink has joined #ruby
<Divinite> *iOS
topriddy1 has left #ruby [#ruby]
itsdavem has quit [Remote host closed the connection]
<Spooner> Brighton: Where I buy my shoes and where JonnieCache lives.
<JonnieCache> lol do you come down here especially for the vegetarian shoes place?
<JonnieCache> i cant think why else youd come here for shoes
<Spooner> Nah, mail-order, but I noticed where they were.
hybris has joined #ruby
jlast has joined #ruby
sepp2k has joined #ruby
<banisterfiend> anyone here bought "practical object oriented design with ruby" is it any good?
_hemanth_ has joined #ruby
<Spooner> Divinite, Ah, I thought ruboto was for iOS too, so you did specify Android. Sorry.
<Divinite> Spooner: No worries :)
mikecmpbll has quit [Quit: Computer has gone to sleep.]
itsdavem has joined #ruby
jlast has quit [Ping timeout: 260 seconds]
gordon1775 has quit [Ping timeout: 260 seconds]
csgui has quit [Quit: csgui]
ewet has quit [Remote host closed the connection]
jlast has joined #ruby
DatumDrop has joined #ruby
rakuN has joined #ruby
itsdavem_ has joined #ruby
itsdavem has quit [Read error: Connection reset by peer]
tvw has joined #ruby
pcarrier has joined #ruby
odyssey4me has quit []
WilfredTheGreat has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jlast has quit [Ping timeout: 252 seconds]
c3vin has quit [Ping timeout: 240 seconds]
adkron has joined #ruby
knirhs has joined #ruby
itsdavem_ has quit [Ping timeout: 276 seconds]
yxhuvud2 has joined #ruby
willob has joined #ruby
willob has quit [Max SendQ exceeded]
<apeiros_> Xeago: ok :)
willob has joined #ruby
Shrink has quit [Ping timeout: 264 seconds]
reppard has quit [Ping timeout: 265 seconds]
yxhuvud has quit [Ping timeout: 256 seconds]
hbpoison has joined #ruby
Udom0 has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
DatumDrop has quit [Ping timeout: 264 seconds]
fgro has joined #ruby
Virunga has joined #ruby
`brendan has joined #ruby
<Fuzai> Hey along time ago I thought I saw a website that would host ruby applications for free. Does anyone have a clue of what i'm talking about?
<Muz> Heroku?
<Fuzai> hmmmm
<Spooner> There are plenty of others too (e.g. appfog and engineyard)
<Spooner> Oh, engineyard trial is time-limited, unlike the other two. Forget that ;)
<workmad3> heroku is dyno-limited, appfog is memory-limited :)
hbpoison has quit [Remote host closed the connection]
hbpoison has joined #ruby
cha1tanya has joined #ruby
<Spooner> Indeed, but one that just stops in 3 weeks isn't as useful as one that is is crap, but indefinite.
akemrir has joined #ruby
mikecmpbll has joined #ruby
<Fuzai> dyno limited?
<Spooner> aka processes
<Fuzai> Ohhh ok
Goles has joined #ruby
<Spooner> aka workers
pskosinski has joined #ruby
<Fuzai> So my ruby app is actually a robot that connects to a web service, can that work with heroku ?
<Spooner> I think you can get up to 16 workers running at appfog, if you don't mind them having 256MB each ;)
<Spooner> (or something like that).
<Fuzai> Honestly this guy is tiny i doubt hes using anything more then 64 mb ram
<Fuzai> I mean were talking like 400 lines of code
<Fuzai> my internet connection is just so unstable its time to find somewhere else to put it
malkomalko has joined #ruby
fgro_ has joined #ruby
<Muz> Lines of code doesn't equate to much memory usage.
<Muz> *equate much
<Muz> Easy enough to write a one liner that essentially mallocs a large amount. ¬_¬
<Spooner> s = ""; loop { s += " " } :D
vlad_starkov has joined #ruby
<Fuzai> hmmmm
hbpoison has quit [Remote host closed the connection]
<Muz> It's a shame Amazon have discontinued the "free" micro instances
hbpoison has joined #ruby
<Fuzai> awww really?
<Fuzai> thats too bad
RagingDave has quit [Quit: Ex-Chat]
<Fuzai> so I think from what i'm reading my little application is using only 28mb ram
fgro has quit [Ping timeout: 256 seconds]
<Muz> That may be the case for this point in time, but how do you know it doesn't grow or leak over time?
<apeiros_> Spooner: slow. ' '*1e12.to_i
<Fuzai> I crossed my fingers :)
<Fuzai> :p
Nisstyre has quit [Ping timeout: 246 seconds]
c3vin has joined #ruby
<Spooner> Yeah, the ram doesn't matter unless it is leaking like a sieve. I said you can have 16 instances of 256MB, but you can have 1 of 4GB (or 16 of 128 and one of 2GB, I forget since I haven't tried it in a while).
<Fuzai> that was with the other one you listed right?
<Fuzai> not heroku?
itsdavem has joined #ruby
reppard has joined #ruby
<Spooner> appfog, yes. Heroku only allows single dynos, but you can have more than one if you are prepared to mess about.
Goles has quit [Quit: Out.]
Goles has joined #ruby
blaxter has quit [Quit: foo]
yalue has joined #ruby
<Fuzai> hmmm
<Spooner> But you only want one, so either would be fine, I think. I haven't used them properly though, so maybe someone else can give a definitive answer as to whether your app (rather than say a passive Sinatra server) would work in that situation.
<Fuzai> Basically this thing serves as a robot for a chat room. Not much more
banisterfiend has quit [Remote host closed the connection]
nathancahill has quit [Quit: nathancahill]
hbpoison has quit [Ping timeout: 276 seconds]
<_bart> but I don't understand the solution he is suggesting. Basically just putting require 'mechanize' at the top of the worker files or some sort of config/init file I'm missing?
hbpoison has joined #ruby
razibog has joined #ruby
griffindy has joined #ruby
lateau has joined #ruby
reppard has quit [Ping timeout: 244 seconds]
tk_ has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<workmad3> _bart: basically, his solution follows the general guideline of "If you're using threads in ruby, make sure you have *all* code loaded before spawning any threads"
ner0x has joined #ruby
csgui has joined #ruby
<workmad3> _bart: because loading code is not a threadsafe operation
<_bart> workmad3: I understand, but how do I apply that to sidekiq, where do I actually require the stuff?
<_bart> workmad3: because all I do is `sidekiq -C config/sidekiq.yml`
mark_locklear has joined #ruby
<_bart> and then SomeWorker.perform_async(id)
<workmad3> _bart: read the comments, specifically comment 2
hbpoison has quit [Ping timeout: 252 seconds]
greg5green has quit [Remote host closed the connection]
MattRb has quit [Quit: This computer has gone to sleep]
<_bart> workmad3: yes, but where or how do I make it require an init file
roadt has quit [Ping timeout: 248 seconds]
invisime has left #ruby [#ruby]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
krawchyk has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
x0F_ is now known as x0F
hbpoison has joined #ruby
<workmad3> _bart: I dunno... maybe by using the -r require option on the CLI? :P
Nisstyre has joined #ruby
<_bart> workmad3: Hmm, but maybe because I already require it in the workers (just first line of the files) I'm safe
<_bart> workmad3: because that's part of the rails app
<workmad3> _bart: do you know if the workers are required in threads or not?
<workmad3> _bart: and more specifically
<workmad3> _bart: are you actually having freeze problems?
<_bart> nope, not yet
hbpoison has quit [Ping timeout: 246 seconds]
<workmad3> _bart: or are you just worrying that you *might* get them because you've just read some random article about how to solve them in that situation?
<workmad3> _bart: right
<_bart> :p
<workmad3> _bart: you now know what to keep an eye out for
<_bart> alright you're right
<_bart> multithreading problems sound scary
<workmad3> _bart: so stop worrying :P you know the issue is solvable, stop trying to dig for specifics ;)
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
sailias has quit [Ping timeout: 248 seconds]
hbpoison has joined #ruby
dmiller1 has joined #ruby
elico has quit [Quit: elico]
adkron has quit [Ping timeout: 240 seconds]
<diegoviola> what kind of loop could i use to wait until a Dir#exists?("/foo/bar") to do something else?
nyuszika7h has quit [Quit: Reconnecting]
banisterfiend has joined #ruby
<romaint> loop do ...; sleep 0.1; end
<romaint> Unless you have an evented solution
gyre007 has joined #ruby
dmiller1 has quit [Ping timeout: 276 seconds]
nyuszika7h has joined #ruby
nyuszika7h has quit [Client Quit]
nyuszika7h has joined #ruby
<diegoviola> ty
a_a_g1 has quit [Quit: Leaving.]
cjs226 has joined #ruby
<Xeago> First thing I thought when reading about Apophis: aight, 32bit aint no problem no more!
hbpoison has quit [Remote host closed the connection]
hbpoison has joined #ruby
<banisterfiend> Xeago: it feels weird when non-native english speakers (even non-americans, actually) use ebonic slang like "aight"
baphled has quit [Ping timeout: 248 seconds]
<ericwood> fo sho
willob has quit [Quit: Leaving.]
jpfuentes2 has joined #ruby
hbpoison has quit [Ping timeout: 265 seconds]
RagingDave has joined #ruby
<Xeago> banisterfiend: weird in what sense?
tommyvyo has joined #ruby
hbpoison has joined #ruby
serhart has quit [Quit: Leaving.]
<banisterfiend> Xeago: well, i imagine you saying it in real life, with that swedish accent of yours :)
<banisterfiend> it doesn't really...work :P
<ericwood> bork bork bork!
<matti> LOL
<matti> ;]
<matti> ericwood: +1
<ericwood> I don't believe Xeago is Swedish. I haven't heard him say "bork" once
qb has quit [Read error: Connection reset by peer]
<banisterfiend> i think he's either swedish or dutch
<matti> ericwood: He is self-aware Swedish.
<matti> ericwood: Trying hard to blend in, etc.
<matti> ericwood: And he refuses his true self.
<Xeago> I am dutch, living in sweden at the moment
<matti> EVEN WORSE!
<matti> ;d
<banisterfiend> dutch is such a weird language
<banisterfiend> it sounds like theyr'e clearing their throat every time they speak
<Xeago> oh why thank you :)
<banisterfiend> all these harsh throaty noises they make
reppard has joined #ruby
<matti> :>
<ericwood> Xeago: do you speak Dutch while in Sweden, or are you trilingual?
sambio has joined #ruby
<ericwood> I hear that in that part of the world everyone speaks a bunch of languages
<Xeago> ericwood: I hardly speak dutch nowadays
<Xeago> I hardly speek swedish
<Xeago> don't know where that typo came from
<matti> Hehe
<matti> You hardly speek English ;p
* matti teases Xeago
<Xeago> I try to speak some swedish when talking to cashiers, on public transit etc
hbpoison has quit [Read error: Connection reset by peer]
<tobiasvl> kan någon säga huuuur felicia försvann
<Xeago> at christmas my parents came over to sweden and we regularly spoke Dutch
<tobiasvl> ericwood: swedes don't understand dutch :P
<Xeago> other than when calling my parents I don't speak dutch
<tobiasvl> ericwood: but norwegians, danes and swedes understand each other
<Xeago> tobiasvl: My girlfriend is actually rather good at understanding dutch.
<ericwood> interesting
jlast has joined #ruby
<Xeago> swedes think norwegians and danes puke while talking
kn330 has joined #ruby
hbpoison has joined #ruby
<matti> We should learn Mandarin.
<Xeago> nowai
ExxKA has joined #ruby
<Hanmac> for germans its even hard to understand eachother ... :/
<tobiasvl> Xeago: and swedes and norwegians think danes have potatoes in their throats
<matti> In case China desides to invate rest of the World.
larissa has quit [Quit: Leaving]
carlzulauf has joined #ruby
<matti> invade*
<tobiasvl> Xeago: i understand some written dutch (i'm norwegian)
<tobiasvl> but not spoken
<Xeago> what if Apophis hits Asia!?
<tobiasvl> too much hacking and coughing
<matti> Xeago: Then we need SG1.
<Xeago> does anyone know where hostname gets its stuff from if not from scutil --get HostName?
rippa has joined #ruby
skaczor has joined #ruby
reppard has quit [Ping timeout: 264 seconds]
jlast has quit [Ping timeout: 240 seconds]
<matti> Xeago: sudo dtruss -f hostname
rakuN has quit [Quit: rakuN]
GoGoGarrett has quit [Remote host closed the connection]
ffranz has joined #ruby
<Hanmac> Xeago: what if Apohis hits Yellowstone?
ChampS666 has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<Xeago> we worry about 32 bit systems?
<matti> Xeago: ?
<matti> Hanmac: That would be super bad luck, I guess.
yxhuvud has joined #ruby
chussenot has joined #ruby
<Xeago> the park?
joofsh has joined #ruby
Jackneill has quit [Remote host closed the connection]
<Hanmac> matti Xeago i mean the volcano bubble below the park
<matti> Hanmac: I know.
baphled has joined #ruby
<matti> Hanmac: I guess, even a smaller metor hitting Yellowstone volcano will be dissasterours.
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
akl_ has joined #ruby
Guest25886 has joined #ruby
yxhuvud2 has quit [Ping timeout: 265 seconds]
<Hanmac> its like picing an big pimples with a nail ..
<Xeago> matti: two interesting lines: __mac_syscall(0x7FFF979857FE, 0x2, 0x7FFF65254070)
<Xeago> __sysctl(0x7FFF652549E8, 0x2, 0x7FFF652549FF)
jlast has joined #ruby
<Xeago> no idea how I should read this tho
advorak has quit [Ping timeout: 256 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
viuo_ has joined #ruby
viuo has quit [Read error: Connection reset by peer]
brendan_ has quit [Remote host closed the connection]
<Xeago> and that haste seems incomplete somehow
vlad_starkov has joined #ruby
akl_ has quit [Ping timeout: 248 seconds]
kpshek has joined #ruby
<Xeago> here's another one http://hastebin.com/rayevaqudi
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
nathancahill has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
polymar_ has joined #ruby
willob has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
thatguycraig has joined #ruby
<nmeum> I use a external program with IO.popen, the problem I have is that this program does 'something' strange...to be more specific it is still running after I closed my IO.popen block. Is there anything to work around this?
jerius has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
ExxKA has quit [Read error: Connection reset by peer]
polymar has quit [Ping timeout: 276 seconds]
baphled has quit [Ping timeout: 276 seconds]
v0n has joined #ruby
breakingthings has joined #ruby
sailias has joined #ruby
judesamp has joined #ruby
lateau has quit [Ping timeout: 248 seconds]
beliveyourdream has joined #ruby
judesamp has quit [Client Quit]
serhart has joined #ruby
<beliveyourdream> can anyone please tell me how can i generate a random hex string in ruby ? i need it in chef but i don't know ruby at all
<JonnieCache> >> require 'secure_random'; SecureRandom.hex(16)
<eval-in> JonnieCache: Output: "" (http://eval.in/6478)
<JonnieCache> >> require 'secure_random'; puts SecureRandom.hex(16)
<eval-in> JonnieCache: Output: "" (http://eval.in/6479)
<JonnieCache> damn
<JonnieCache> >> require 'securerandom'; puts SecureRandom.hex(16)
<eval-in> JonnieCache: Output: "" (http://eval.in/6480)
<JonnieCache> oh well its something like that
akl_ has joined #ruby
<ericwood> >> a = [('A'..'F'), (0..9)].map(&:to_a).flatten; p (0..16).map { |i| a[rand(a.length)] }.join
<eval-in> ericwood: Output: "\"FEA0CC39423141EC1\"\n" (http://eval.in/6481)
moshee has quit [Ping timeout: 276 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<ericwood> I like my method :D
<Xeago> ericwood: rand is not cryptographically secure
GoGoGarrett has joined #ruby
<ericwood> he just wants a random hex string
* ericwood shrugs
<Xeago> well rand is biased
<Xeago> :)
<ericwood> just be sure to hide the seed and you're good :D
<Xeago> and therefore not random :)
<beliveyourdream> i don't need it to be really secure .. it's just for generating a secret string for symfony
<Xeago> ericwood: not even than is it secure
solidoodlesuppor has joined #ruby
<Xeago> if you can use something outside of ruby: tr -dc "[:print:]" < /dev/random | fold | head
<ericwood> I know :P
<Xeago> is what I use
<ericwood> be sure to give it lots of entropy
<banisterfiend> ericwood: that's insane
<ericwood> what is?
philcrissman has joined #ruby
<Xeago> not many systems accept my passwords :'(
<banisterfiend> ericwood: [*('0'..'9'), *('a'..'f')] replaces your map(&:to_a).flatten thing :)
<ericwood> oh sheeeiiiiit, I forgot about the splat :(
<banisterfiend> ericwood: and: sample(size).join replaces your second thing :)
doritostains has quit [Quit: Leaving...]
<ericwood> I based mine off a stackoverflow answer, I didn't want to investigate too much :P
<banisterfiend> ericwood: you can also use: shuffle.take(size).join
marcus6162 has joined #ruby
<banisterfiend> either is better than that weird map thing
<ericwood> heh, yeah
kgb_ has joined #ruby
<Xeago> tr -dc "[:xdigit:]" < /dev/random | fold | head for hex*
<JonnieCache> or you know just use SecureRandom
nignaztic has quit [Read error: Connection reset by peer]
postmodern has quit [Quit: Leaving]
<Xeago> and pack
<fbernier> I've got two numbers. How could I randomly select an operation (+ or -) to apply on these numbers?
dustint has joined #ruby
roadt has joined #ruby
ananthakumaran has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
hbpoison has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
nazty has joined #ruby
nateberkopec has joined #ruby
<banisterfiend> fbernier: num1.send([:-, :+, :*].sample, num2)
<Xeago> :- is not a symbol at my irb
<Xeago> is that because of lacking 1.9?
hbpoison has joined #ruby
<banisterfiend> no
<banisterfiend> i should have used "" :)
judofyr has joined #ruby
<judofyr> hey folks!
* judofyr greetings from #ruby-lanf
<fbernier> thanks banisterfiend
<judofyr> #ruby-lang even
rgrau has quit [Remote host closed the connection]
<banisterfiend> np
<ericwood> judofyr: see, #ruby-lang needs this:
<banisterfiend> judofyr: welcome to dead house
<ericwood> >> puts "welcome, #ruby-lang"
<eval-in> ericwood: Output: "welcome, #ruby-lang\n" (http://eval.in/6482)
F1skr has joined #ruby
<judofyr> >> p YAML.load("--- #yamlgate")
<eval-in> judofyr: Output: "/tmp/execpad-e0be6fd63ed4/source-e0be6fd63ed4:1:in `<main>': uninitialized constant YAML (NameError)\n" (http://eval.in/6483)
fgro_ has quit [Quit: Lost terminal]
nazty has joined #ruby
<ericwood> heh
<judofyr> ah, eval.in
<judofyr> that's charliesome, right?
moharram06 has quit [Quit: moharram06]
<judofyr> *charliesome's
<judofyr> banisterfiend: dead? :(
swinburnesque81 has joined #ruby
<banisterfiend> judofyr: actually no, it's a lot more active than #ruby-lang
<judofyr> banisterfiend: but is it better?
<JonnieCache> yamlgate is that official now
<banisterfiend> though def. a higher proliferation of noobs here
<banisterfiend> judofyr: it's less boring
<banisterfiend> judofyr: but maybe also a little more annoying sometimes too
imperator has joined #ruby
marcus6162 has quit []
<ericwood> that's why it's fun
<judofyr> maybe I'll hang around here too
<banisterfiend> #ruby-lang is boredom incarnaet
benlieb has joined #ruby
<JonnieCache> have there been any high profile rootings from yamlgate?
jtharris has joined #ruby
dmiller1 has joined #ruby
<judofyr> JonnieCache: not that we know about
<judofyr> s/we/I/
<judofyr> banisterfiend: even with me? :(
<JonnieCache> i guess all the fancy startup people knew about it before it went public
<banisterfiend> judofyr: hehe, it's more that #ruby-lang is too quiet
<judofyr> JonnieCache: I knew :D (but I'm not a fancy startup person though)
<Spooner> Anyone any idea what happens to a private repo on Github if you stop paying for it? => public, read only, completely locked?
uris has joined #ruby
<banisterfiend> Spooner: locked
<banisterfiend> Spooner: completely locked
<Spooner> Ah, OK. Fair enough.
<banisterfiend> it's happened to me when i had to deregister my credit card (as i lost it)
<JonnieCache> judofyr: well i mean everyone and their dog *knew* about it
<JonnieCache> few people knew what it was though
jlast has joined #ruby
<Spooner> Thanks. I'll look at github if I need free repos then (I really can't afford to pay for guthub privates for tiny projects).
<Spooner> *look at bitbucket
<judofyr> JonnieCache: hm? I discovered the SQL-injection and reported it to security-rails :)
peregrine81 has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
x82_nicole has joined #ruby
<JonnieCache> and ever since then people were muttering that there was another vuln in that part of the code
<JonnieCache> it was a pretty open secret, people were talking about it on hn
dmiller1 has quit [Ping timeout: 276 seconds]
peregrine81 has quit [Client Quit]
<JonnieCache> i was going to look for it myself then i realised i needed to sleep or i might die
<judofyr> JonnieCache: yeah, Homakov and postmodern talked about it quite publicly :/
jlast has quit [Ping timeout: 248 seconds]
<judofyr> none of them actually discovered the SQL/RCE though
<JonnieCache> but yeah respect for dicovering the original bug. shame theres no $$$ in it for you directly
<judofyr> but they got the YAML-in-XML
<JonnieCache> rails could use a bug bounty
<banisterfiend> Spooner: what's your super secret project
<judofyr> JonnieCache: meh. there were several people on it.
zph has joined #ruby
<Xeago> judofyr: if you are a student, or for other research and such related stuff you can get free repo's
asteve has joined #ruby
<judofyr> Xeago: I think you meant Spooner
asteve has quit [Max SendQ exceeded]
<Xeago> wops indeed
buscon has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
<JonnieCache> judofyr: yeah and if there was cash in it, all those people would have raced even harder :)
* judofyr shrugs
zph has quit [Client Quit]
asteve has joined #ruby
asteve has quit [Max SendQ exceeded]
jlast has joined #ruby
<Spooner> banisterfiend, Trying to break into some contracting. Trying ;)
marienz has quit [Quit: Reconnecting]
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
marienz has joined #ruby
vlad_starkov has joined #ruby
<banisterfiend> Spooner: k00
<JonnieCache> judofyr: i should really get more involved in the community and participate in things like that. i need better time management
<Spooner> Somehow I'm not sure that $20-100 micro-contracts can support $1/month per repo ;)
<Xeago> how to start zsh without executing a config?
deuterium has joined #ruby
jlast has joined #ruby
frogstarr78 has quit [Remote host closed the connection]
<JonnieCache> i cant see myself making time for the tweeting and the mailing lists and so on and so on
booginga has joined #ruby
ziprar has quit [Quit: Leaving]
lordnaz has joined #ruby
<judofyr> JonnieCache: I'm not that involved in the Rails community either. more involved in the general Ruby community though…
kn330 has quit [Ping timeout: 248 seconds]
chussenot has quit [Quit: chussenot]
frogstarr78 has joined #ruby
Coolhand has joined #ruby
jlast_ has quit [Ping timeout: 255 seconds]
chussenot has joined #ruby
frogstarr78 has quit [Remote host closed the connection]
browndawg has joined #ruby
arietis has joined #ruby
frogstarr78 has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
hemanth_ has joined #ruby
jrist-afk is now known as jrist
NihilistDandy has joined #ruby
NihilistDandy has quit [Client Quit]
Hanmac has quit [Ping timeout: 245 seconds]
zph has joined #ruby
kn330 has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
freeayu has quit [Remote host closed the connection]
_nitti has joined #ruby
yxhuvud2 has joined #ruby
polymar_ has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
db_auto_crap has joined #ruby
segv- has joined #ruby
polymar has joined #ruby
<db_auto_crap> hello guys
<db_auto_crap> am having issue with ruby
jlast has joined #ruby
<db_auto_crap> this output of commands
dr_neek has joined #ruby
neurotech has quit [Remote host closed the connection]
yxhuvud has quit [Ping timeout: 265 seconds]
<db_auto_crap> Gem::Package::FormatError: No metadata found!
<db_auto_crap> An error occurred while installing librex (0.0.68), and Bundler cannot continue.
<db_auto_crap> root@bt:/pentest/web/beef# rubdy -v
<db_auto_crap> ^C
<db_auto_crap> Make sure that `gem install librex -v '0.0.68'` succeeds before bundling.
statarb3 has quit [Quit: Leaving]
<db_auto_crap> sorry for the spam
<db_auto_crap> but i ened to run beef
jondot` has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
<Spooner> db_auto_crap, Install msfrpc-client manually?
Uranio has joined #ruby
jlast has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
stopbit has joined #ruby
nomenkun_ has quit [Remote host closed the connection]
xclite has joined #ruby
generalissimo has joined #ruby
jlast_ has quit [Ping timeout: 248 seconds]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
xerxas has joined #ruby
roadt has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
roadt has joined #ruby
cr3 has joined #ruby
haxrbyte_ has joined #ruby
baphled has joined #ruby
jlast has quit [Ping timeout: 244 seconds]
benlieb has quit [Quit: benlieb]
jlast has joined #ruby
beliveyourdream has quit [Read error: Connection reset by peer]
jlast has quit [Read error: Connection reset by peer]
<shevy> ohhh
<shevy> another sweet sweet bundler problem :)
jlast has joined #ruby
<Spooner> shevy, Bundler is like democracy. Rubbish, but the alternatives are worse!
<shevy> hehe
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
<shevy> hmm
<ericwood> bundler is alright
jlast has quit [Read error: Connection reset by peer]
atmosx has joined #ruby
<ericwood> it only annoys me sometimes
kn330 has quit [Remote host closed the connection]
<shevy> plain "gem install" alone would not suffice? it seems to work very well for me so far
haxrbyte has quit [Ping timeout: 246 seconds]
theRoUS has quit [Ping timeout: 248 seconds]
jlast has joined #ruby
<ericwood> it works great until you're managing several projects
cha1tanya has quit [Quit: Leaving]
<atmosx> hello
<ericwood> hi
<cr3> in a unit test, I have Foo::Bar.any_instance.expects(:connect).at_least_once that passes but Foo::Bar.any_instance.expects(:connect).with('foo') fails even though I'm sure the method is being called with 'foo'. what could be the reason?
<Spooner> I was editing the script last week that had about half a dozen gems with notes about which versions worked in the header. I felt that making a Gemfile was less effort than installing them all by hand.
<ericwood> no kidding
<Spooner> shevy, And yes, it is fine to live without Bundler until you have projects with dozens of gems too.
baphled has quit [Ping timeout: 255 seconds]
<ericwood> I've worked on several large Rails projects...bundler is essential
razibog has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
<ericwood> my first rails project a long time ago there was no such thing, we had dozens of gems which had to be installed manually
jlast_ has joined #ruby
<ericwood> it was a nightmare.
romaint has left #ruby [#ruby]
jlast_ has quit [Read error: Connection reset by peer]
<cr3> what's the difference between :foo and 'foo'?
asteve has joined #ruby
asteve has quit [Max SendQ exceeded]
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
<ericwood> one is a symbol the other is a string
<ericwood> how much do you know about symbols?
jlast_ has quit [Read error: Connection reset by peer]
<Spooner> Yeah, I remember the time before Bundler. Nothing as bad as that, but still, I couldn't believe that something like it could not exist for so long (especially since rubygems already did a lot of the dependency work within gems).
<cr3> ericwood: nothing, looks like I need to read about them
jlast has joined #ruby
lateau has joined #ruby
<ericwood> cr3: they're almost like enums in a way I guess
<cr3> ericwood: I thought the colon was just used as a shorthand for quoting, my mistake
asteve has joined #ruby
asteve has quit [Max SendQ exceeded]
<ericwood> cr3: think of them like this: a struct with an integer value and a string value
<Spooner> ericwood, I blame HashesWithIndifferentAccess for making people think they are the same thing.
jlast has quit [Read error: Connection reset by peer]
<ericwood> when you refer to the symbol you're passing around the integer rather than the string; it's more efficient
jlast has joined #ruby
jojosiao has joined #ruby
<Spooner> ericwood, And that analogy only works if they came from C/C++, which I'm sure a lot of people don't.
<cr3> ericwood: that would explain why I've seen :foo.to_s in some cases, in case a symbol was passed instead of a string
jlast has quit [Read error: Connection reset by peer]
<ericwood> cr3: yeah, symbols are great; you can access the string at any time
<ericwood> if you're familiar with C/C++, think of a symbol as a pointer
jlast has joined #ruby
sie has quit [Ping timeout: 256 seconds]
<Mon_Ouie> Literally typing :some_symbol_literal.to_s? Because, that's kind of silly :p
segv- has quit [Read error: Connection reset by peer]
<cr3> ericwood: thanks for the explanation, I'll use symbols more carefully
<ericwood> so when you're referring to a symbol you're just using a pointer rather than passing around a value :D
segv- has joined #ruby
jlast has quit [Read error: Connection reset by peer]
<cr3> Mon_Ouie: of course, that was just a shorthand for the sake of irc :)
ChampS666 has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
<ericwood> >> p :foo.to_s
<eval-in> ericwood: Output: "\"foo\"\n" (http://eval.in/6484)
<banisterfiend> ericwood: IME symbols are more often thought of as enums
<ericwood> >> p 'foo'.intern
<eval-in> ericwood: Output: ":foo\n" (http://eval.in/6485)
jlast has quit [Read error: Connection reset by peer]
<ericwood> banisterfiend: I don't really like that analogy for some reason
<Spooner> >> p foo.to_sym
<eval-in> Spooner: Output: "/tmp/execpad-61823d85c921/source-61823d85c921:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)\n" (http://eval.in/6486)
jlast has joined #ruby
<ericwood> enums you can't get the value from
<Spooner> >> p ['foo'.to_sym, "Bah!"]
<eval-in> Spooner: Output: "[:foo, \"Bah!\"]\n" (http://eval.in/6487)
jlast has quit [Read error: Connection reset by peer]
<ericwood> the intern method is better because it fetches you a cup of coffee as well
jlast has joined #ruby
asteve has joined #ruby
jlast has quit [Read error: Connection reset by peer]
<Spooner> I like the Ouroboros-like to_s.to_sym.to_s.to_sym myself ;)
jlast has joined #ruby
jekotia has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
jlast has quit [Read error: Connection reset by peer]
usultis has quit [Ping timeout: 248 seconds]
baphled has joined #ruby
usultis__ has quit [Ping timeout: 264 seconds]
usultis_ has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
yalue has quit [Quit: Leaving]
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
ChampS666 has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
<db_auto_crap> omg
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
<db_auto_crap> it was the version i guess root@bt:/pentest/web/beef# gem install librex -v '0.0.68'
<db_auto_crap> Successfully installed librex-0.0.68
<db_auto_crap> 1 gem installed
<db_auto_crap> Installing ri documentation for librex-0.0.68...
<ericwood> what a tiny version number
jlast_ has quit [Read error: Connection reset by peer]
peregrine81 has joined #ruby
<db_auto_crap> no i mean the ruby v
<db_auto_crap> i switched back to 1.8
<Spooner> Obviously the step to 0.1.0 was too much for them.
jlast has joined #ruby
<db_auto_crap> and it worked
<ericwood> oh goodness
<Spooner> You do know that 1.8 is deprecated badness?
bean has joined #ruby
<ericwood> hehehe
jlast has quit [Read error: Connection reset by peer]
<db_auto_crap> lol i just need my bundle install to run
jlast has joined #ruby
<db_auto_crap> then have fun with xss
_nitti has quit [Remote host closed the connection]
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
jlast_ has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast_ has quit [Read error: Connection reset by peer]
jlast has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
nooodl_ has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
<nooodl_> hi. style question: should i write some_string.split(?\n) or some_string.split("\n")?
jlast has quit [Read error: Connection reset by peer]
* db_auto_crap slaps beef dev's with larg fish
jlast has joined #ruby
jlast_ has joined #ruby
jlast has quit [Read error: Connection reset by peer]
<Spooner> nooodl_, Personally, I don't like the ?a syntax. ? is already used in ?: and method names, so it tends to be harder to read for me.
jlast_ has quit [Read error: Connection reset by peer]
<ericwood> nooodl_: "\n"
[[[---]]] has joined #ruby
<ericwood> >> "foo\nbar".split
<eval-in> ericwood: Output: "" (http://eval.in/6488)
<ericwood> >> p "foo\nbar".split
jlast has joined #ruby
<eval-in> ericwood: Output: "[\"foo\", \"bar\"]\n" (http://eval.in/6489)
<ericwood> you don't have to put "\n", split assumes it by default, btw
dmiller1 has joined #ruby
<nooodl_> >> p "foo bar\nbaz".split
<eval-in> nooodl_: Output: "[\"foo\", \"bar\", \"baz\"]\n" (http://eval.in/6490)
<nooodl_> >> p "foo bar\nbaz".split("\n")
<eval-in> nooodl_: Output: "[\"foo bar\", \"baz\"]\n" (http://eval.in/6491)
<nooodl_> no it doesn't
<hoelzro> I thought whitespace was the default?
<ericwood> ah whoops
<ericwood> I need more coffee >.>
<Spooner> So /\s/ is the default?
<ericwood> yes
<Spooner> Or rather /\s+/ I suppose.
<hoelzro> more likely /\s+/
<nooodl_> i think it's /\s+/ to be yeah
<hoelzro> damn!
chussenot has quit [Quit: chussenot]
<hoelzro> beaten at my own game!
<Spooner> p "foo bar".split
<Spooner> >> p "foo bar".split
<eval-in> Spooner: Output: "[\"foo\", \"bar\"]\n" (http://eval.in/6492)
<Spooner> Yep.
d2dchat has joined #ruby
<nooodl_> anyway, "\n" looks more clear to me... but ?\n is so cool and new and shiny
<nooodl_> guess i'll go for "\n" though
<ericwood> I don't like ? syntax
speakingcode has joined #ruby
<shevy> in where
<hoelzro> will ?\n even work on 1.8?
_nitti has joined #ruby
<shevy> ah
<shevy> ?\n
<speakingcode> is there a shorthand for adding all the elements of one array to another?
<shevy> yeah, the ? is odd
<hoelzro> how does split react when it gets an integer?
<hoelzro> speakingcode: do you mean a sum?
<tobiasvl> speakingcode: +
<ericwood> speakingcode: array1 + array2
<shevy> speakingcode (array1 + array2).uniq ?
<speakingcode> hoelzro: not a sum, a join
<hoelzro> oh, I see
chussenot has joined #ruby
jjbohn has joined #ruby
DrShoggoth has joined #ruby
frem has joined #ruby
<speakingcode> thanks guys
<shevy> (%w( abc def ghi ) + %w( ghi jkl mno ) ).uniq # => ["abc", "def", "ghi", "jkl", "mno"]
<shevy> try this with php!!!
* shevy stomps on php.
<ericwood> you can use Set as well
reppard has joined #ruby
* shevy stomps on ericwood - just because he can.
<speakingcode> >> puts [1,2,3] + [4,5,6]
<eval-in> speakingcode: Output: "1\n2\n3\n4\n5\n6\n" (http://eval.in/6493)
<nooodl_> using a Set there sounds good indeed
dmiller1 has quit [Ping timeout: 255 seconds]
<speakingcode> cool
<ericwood> you can always do Set::to_a
<ericwood> and initialize a Set with an array
<ericwood> conversion to a Set is probably a bit more costly than you might think
<speakingcode> i don't need uniques
<speakingcode> just a join
<Spooner> %w( abc def ghi ) | %w( ghi jkl mno ) does the same too.
<shevy> aha
<ericwood> oooohhhh yyeeeaaaahhhh
<shevy> hmm curious... (Set.new([1,2,3]) + Set.new([4,5,6])).to_a # => [5, 6, 1, 2, 3, 4]
<Spooner> | and & are union and intersection
_nitti has quit [Remote host closed the connection]
<shevy> cool
geekbri has joined #ruby
<shevy> | is much shorter
<cr3> is there a way to get elements in an array between index 2 and the index before last? for example, given [1, 2, 3, 4, 5], I'd like [3, 4] without referring to the size fo the array if possible, ie using negative index for the before last element
<speakingcode> >> puts (Set.new [1,2,3]) + (Sets.new [4,5,6])
<eval-in> speakingcode: Output: "/tmp/execpad-91007080e318/source-91007080e318:1:in `<main>': uninitialized constant Set (NameError)\n" (http://eval.in/6494)
<shevy> never used & before I think
<speakingcode> :(
<Spooner> cr3, arr[0..-2]
<Spooner> Oops, arr[2..-2] in that case
<shevy> [1, 2, 3, 4, 5][2..-2] # => [3, 4]
<nooodl_> >> require 'set'; puts Set.new [1,2,3]
<eval-in> nooodl_: Output: "#<Set:0x8da142c>\n" (http://eval.in/6495)
<speakingcode> haha
<speakingcode> dangit
<cr3> Spooner: ahh!, I missed the .. in the doc (http://www.ruby-doc.org/core-1.9.3/Array.html). thanks!
<Spooner> cr3 it is a Range, not a .. ;)
<shevy> (33..38).to_a # => [33, 34, 35, 36, 37, 38]
_hemanth_ has quit [Read error: Connection reset by peer]
hemanth_ has quit [Read error: Connection reset by peer]
<shevy> ("cat".."dog").to_a # <-- haha, I am not gonna paste that result
_hemanth_ has joined #ruby
hemanth_ has joined #ruby
<shevy> ("cat".."dog").to_a.size # => 1028
<ericwood> does it do every 3 letter word in between?
<ericwood> ah yes
<Spooner> ('a'..'d').to_a is a bit more sensible.
Banistergalaxy has quit [Ping timeout: 252 seconds]
[[[---]]] has left #ruby [#ruby]
<shevy> hehehe
<Spooner> Presumably just uses "cat".succ #=> "cau"
<shevy> ohhh
<shevy> "cat".succ # "kitten"
<Spooner> No, the thing after a cat is a box buried in the yard.
Banistergalaxy has joined #ruby
<apeiros_> String#succ is sick
<Spooner> Sucking on string. It is the Ruby way :D
llaskin has joined #ruby
jgrevich has joined #ruby
<llaskin> is any way to install ruby 1.9.3 latest revision, without using RVM on ubuntu?
<JonnieCache> yeah you can just build it like any other software
joshman_ has joined #ruby
imperator has quit [Quit: This computer has gone to sleep]
<zph> Source install… if you don't need exact latest… maybe a PPA has it.
<JonnieCache> you can also use the ruby-build script
booginga has left #ruby ["Leaving"]
ds29 has joined #ruby
<nooodl_> hmm, if i've defined a function, like "def foo(a, b); ...; end", can i pass that as an argument to another function that expects a block?
<nooodl_> (like some_array.sort {|a, b| ...})
<Spooner> nooodl_, array.sort &method(:foo)
roadt has quit [Ping timeout: 248 seconds]
lateau has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
<nooodl_> Spooner: perfect, thanks
lateau has joined #ruby
Uranio has quit [Quit: WeeChat 0.3.8]
megha is now known as firewall
willob has quit [Quit: Leaving.]
polymar has quit [Remote host closed the connection]
_nitti has joined #ruby
willob has joined #ruby
horrror has joined #ruby
baroquebobcat has joined #ruby
karl___ has joined #ruby
horrror is now known as hrr
<karl___> what is ruby's convention for doing multiple conditionals with different variables (ie, if str1 == "foo" AND str2[1] == 'o')?
<nooodl_> &&
tomask has joined #ruby
stevechiagozie has joined #ruby
yxhuvud has joined #ruby
Uranio has joined #ruby
<nooodl_> there's also "and" and "or" operators, but they should only be used for control flow
<karl___> nooodl_: much appreciated
<nooodl_> like "do_thing() or puts 'Thing failed!'"
baphled has quit [Ping timeout: 248 seconds]
yxhuvud2 has quit [Ping timeout: 240 seconds]
<ds29> Hi guys! I have an interesting problem that I would like input on. I'm doing a project to improve my skills by building a time tracker ala RescueTime except it runs locally. I've got all the details done, it detects Idle time logs everything accordingly.
leyyin__ has joined #ruby
a_a_g has joined #ruby
<ds29> However since I'm using the win32 API and getting the foreground window's window text
h4mz1d has joined #ruby
leyyin__ has left #ruby ["Leaving"]
RagingDave has quit [Quit: Ex-Chat]
<ds29> this is obviously doesn't determine the program that is running. since for e.g. Word Documents usually have the file name in them and so on. How would I determine the actual foreground process
rismoney has joined #ruby
<ericwood> if only there were something like AppleScript for Windows :\
<karl___> I'm using =~ to search a long string to see if it contains a smaller string (ie a = "foo"; if a =~ /oo/ )...is there a good way of simply doing a "Not" with the =~ operator? (ie, if oo is not a part of "foo")?
jpfuentes2 has joined #ruby
<JonnieCache> ericwood: there is. vbscript
RagingDave has joined #ruby
<ericwood> oh yeah
johnmilton has joined #ruby
jeffreybaird has joined #ruby
<ds29> One solution I thought of was have a predefined set of Program Names to look for in the solution, however this fails for e.g. if there is a word document named Mozilla Firefox - Microsoft Word 2010
baroquebobcat has quit [Quit: baroquebobcat]
<ericwood> I'm afraid I'm useless at answering this question, although I could totally help if he was on OS X :D
eka has quit [Quit: chant Hare Krishna and be Happy]
stetho has joined #ruby
eka has joined #ruby
timonv has quit [Read error: Connection reset by peer]
<ds29> ericwood: haha thanks unfortunately I don't have a Mac at all so I'm just limited to Windows and Linux
nemesit has quit [Quit: Leaving...]
judofyr has quit [Remote host closed the connection]
<Sigma00> karl___: !`
<Sigma00> er, !~
Spami has quit [Quit: This computer has gone to sleep]
<karl___> Sigma00: ahhh, that should have been more obvious to me... I was trying !=~
<karl___> thank you!
scruple has quit [Ping timeout: 246 seconds]
tomask has quit [Quit: Leaving]
<tobiasvl> nooodl_: why shoukd "and" and "or" only be used for control flow? i wasn't aware of that
<nooodl_> i believe it has something to do with operator precedence
<karl___> it has something to do with precedence
mibitzi has quit [Ping timeout: 276 seconds]
<tobiasvl> yeah but if you only use "and" and "or" that shouldn't matter?
zigomir_ has joined #ruby
<tobiasvl> isn't it && || and or
<tobiasvl> or something
chussenot has quit [Quit: chussenot]
<atmosx> hm
<atmosx> thin server doesn't support Rack::URLMap.new
<hoelzro> 'and' and 'or' have lower precedence than '&&' and '||'
<atmosx> unicorn_rails does
<ericwood> don't use "and" and "or", because they won't work like you expect them to :P
<hoelzro> that's another carry over from Perl
apeiros_ has quit [Remote host closed the connection]
baphled has joined #ruby
<tobiasvl> hoelzro: yeah. but if you don't use && and || at all, that's irrelevant
<hoelzro> the precedence?
zigomir has quit [Ping timeout: 248 seconds]
zigomir_ is now known as zigomir
<hoelzro> I should probably compare them to '='
<hoelzro> >> value = false || 17 puts(value)
<eval-in> hoelzro: Output: "/tmp/execpad-66fde4089ca9/source-66fde4089ca9:1: syntax error, unexpected tIDENTIFIER, expecting $end\nvalue = false || 17 puts(value)\n ^\n" (http://eval.in/6499)
<hoelzro> ugh.
<hoelzro> >> value = false || 17 ; puts(value)
<eval-in> hoelzro: Output: "17\n" (http://eval.in/6500)
<hoelzro> >> value = false or 17 ; puts(value)
<eval-in> hoelzro: Output: "false\n" (http://eval.in/6501)
speakingcode has quit [Remote host closed the connection]
<tobiasvl> aha. there you go
<ericwood> >> value = false; value ||= 17; puts value
<eval-in> ericwood: Output: "17\n" (http://eval.in/6502)
<hoelzro> 'and' and 'or', iirc, have a lower precedence than '='
<ericwood> yeah
<hoelzro> which is the truly important part
theRoUS has quit [Ping timeout: 240 seconds]
<tobiasvl> i see that
<tobiasvl> thanks
ecart has joined #ruby
<camidoo> tobiasvl: good article on that topic: http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/
h4mz1d has quit [Ping timeout: 256 seconds]
timonv has joined #ruby
<hoelzro> camidoo++ # explanatory links
<ecart> need someone to take some of my design bugs. Someone who accepts lr as payment.
jondot` has quit [Ping timeout: 276 seconds]
<banisterfiend> lr?
<ecart> yes
<banisterfiend> what is lr
<ecart> libert reserve
<banisterfiend> what'sthat
<ds29> ok I figured out how to be able to identify the current foreground Process. there is a win32 api called getWindowThreadProcessId which allows you to obtain the PID of the process to which you the pass handle to. The handle can be obtained by doing getForegroundWindow api call
<DrShoggoth> I made a wrapper gem for a java class ( jruby ). Should I include the jars or make the user download and install them somewhere?
omo01 has joined #ruby
nomenkun has joined #ruby
<ecart> i back
<ecart> wait
<omo01> emote: duh
asobrasil has joined #ruby
omo01 has left #ruby [#ruby]
clocKwize has quit [Quit: clocKwize]
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
SCommette has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
nomenkun has quit [Ping timeout: 248 seconds]
a_a_g has joined #ruby
_46bit has joined #ruby
_46bit has left #ruby [#ruby]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
hrr has quit [Quit: hrr]
baphled has quit [Ping timeout: 255 seconds]
a_a_g has quit [Read error: Connection reset by peer]
eldariof-office has quit [Ping timeout: 276 seconds]
fflush has joined #ruby
a_a_g has joined #ruby
GrahamThorsen has joined #ruby
f0ster has quit [Remote host closed the connection]
GrahamThorsen has left #ruby [#ruby]
jenrzzz has joined #ruby
_knitetemplar has joined #ruby
alanjf has quit [Remote host closed the connection]
mjolk has joined #ruby
reppard has quit [Ping timeout: 276 seconds]
<mjolk> what's a good ruby forum?
<mjolk> ruby-forum.com ?
browndawg has quit [Quit: Leaving.]
banisterfiend has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
hbpoison has quit [Ping timeout: 265 seconds]
_nitti has quit [Remote host closed the connection]
hbpoison has joined #ruby
timonv has quit [Remote host closed the connection]
<_knitetemplar> yes
<mjolk> thanks
<_knitetemplar> np ;)
lateau has quit [Remote host closed the connection]
Stormpath has joined #ruby
tagrudev has quit [Quit: kill yourself]
<cr3> is there a nice way to remove a prefix from a string instead of foo['prefix'.length..-1]
aganov has quit [Remote host closed the connection]
dmiller1 has joined #ruby
<tobiasvl> >> print "hello".gsub(/^he/, '')
<eval-in> tobiasvl: Output: "llo" (http://eval.in/6512)
arturaz has quit [Ping timeout: 248 seconds]
theRoUS has joined #ruby
Blue_Ice has joined #ruby
<tobiasvl> cr3: like so?
<tobiasvl> i don't know what you consider "nice" but i like to think in regexes
<hoelzro> tobiasvl: are you a Perl dev?
<tobiasvl> hehe. among other languages
<Blue_Ice> anyone using IDNA2008 (RFC 5895 and others) in ruby? I found 2 gem's doing IDNA2003, but no 2008. I would find it very strange if it really didn't exist
<hoelzro> =)
hoelzro is now known as hoelzro|away
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<cr3> tobiasvl: I programmed for a long time in Perl but I've switched to Python for a while before now adopting Ruby, so I've become more conservative about using regexes all the time
dmiller1 has quit [Ping timeout: 246 seconds]
friskd has joined #ruby
woolite64 has joined #ruby
timonv has joined #ruby
blaxter has joined #ruby
blaxter is now known as dumdedum
bluenemo has quit [Remote host closed the connection]
Goles has quit [Ping timeout: 248 seconds]
alvaro_o has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
benlieb has quit [Quit: benlieb]
asteve has quit [Quit: Computer has gone to sleep.]
danguita has joined #ruby
benlieb has joined #ruby
akemrir has quit [Ping timeout: 248 seconds]
lateau has joined #ruby
havenn has joined #ruby
nomenkun has joined #ruby
d2dchat has quit [Remote host closed the connection]
a_a_g has quit [Read error: Connection reset by peer]
danneu has joined #ruby
matthewrobbins has quit [Ping timeout: 240 seconds]
a_a_g has joined #ruby
osaut has joined #ruby
DrShoggoth has quit [Remote host closed the connection]
tarsolya has quit [Ping timeout: 276 seconds]
wket234 has joined #ruby
mrbtie has joined #ruby
banisterfiend has joined #ruby
DrShoggoth has joined #ruby
speakingcode has joined #ruby
<wket234> mruby is alive?
<ds29> e
<ds29> e
Umren has joined #ruby
ds29 has quit [Quit: irc2go]
itsdavem has quit [Remote host closed the connection]
rdark has quit [Quit: leaving]
<wket234> yes, but is alive?
<wket234> i send e-mail to autor
blazes816 has joined #ruby
<wket234> and nothing mruby org not working
<wket234> etc.
PragCypher has joined #ruby
<havenn> wket234: very alive, Matz last committed to it 3 hours ago - it is in development
reppard has joined #ruby
<wket234> ok. 1. is possible to sandbox in mruby?
<havenn> wket234: !!Notice!! This is a preliminary release for internal team review. The URLs and addresses described below are not available yet. The official release will be announced later.
friskd has quit [Quit: friskd]
hbpoison has quit [Ping timeout: 252 seconds]
<speakingcode> what is mruby?
<JonnieCache> ive just found out about the redo and retry keywords
<JonnieCache> wtf
<bean> matz's ruby
<wket234> embeded ruby
<wket234> small
<speakingcode> ah
<speakingcode> cool
hbpoison has joined #ruby
<speakingcode> register-based or somethin?
rakl has joined #ruby
<wket234> 1. is possible to sandbox in mruby?
<wket234> mruby without IO or other idea to close code in sandbox
<havenn> speakingcode: mruby is an ultralight Ruby that meets most but not all of Ruby's ISO specs. It is extremely fast (especially the HPC fork) and can generate compiled bytecode.
apeiros_ has joined #ruby
<speakingcode> havenn once it's released, is there a reason to not choose it over 'regular' ruby?
menace has joined #ruby
<wket234> havenn: can send Matz this link? https://bitbucket.org/jankowalski/te-cik
<JonnieCache> do we have iso specs now?
<wket234> some example. some working some no.
menace has left #ruby [#ruby]
<JonnieCache> i thought that was stalled
<havenn> JonnieCache: No, they are final and have been certified.
reppard has quit [Ping timeout: 240 seconds]
<havenn> JonnieCache: Sec, I'll post the link for the free final-draft download
blakerg has joined #ruby
yxhuvud2 has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
haxrbyte_ has quit [Read error: Connection reset by peer]
clop has joined #ruby
timonv_ has joined #ruby
<wket234> please send my repo to Matz
<havenn> speakingcode: mruby isn't a replacement for ruby-2.0, but it extends where all ruby can be used - in embedded devices, embedded in other languages, robots
timonv has quit [Read error: Connection reset by peer]
<clop> hi, is there some word that means "adding methods to existing classes", e.g., what do I call it if I add a .quadrouple method to Integer?
mrbtie has quit [Remote host closed the connection]
<havenn> wket234: I don't know about sandboxing with mruby. What is your repo about?
karasawa has quit [Ping timeout: 248 seconds]
<wket234> many people looking for better Lua. Safe, small and not quickly but object orientet and easy
<db_auto_crap> lol my vbox network crashed
_nitti_ has joined #ruby
yxhuvud has quit [Ping timeout: 246 seconds]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
wket234 has quit [Quit: leaving]
jojosiao has quit [Read error: Connection reset by peer]
sambio has quit [Read error: Connection reset by peer]
sambio has joined #ruby
diegoviola has quit [Ping timeout: 244 seconds]
<bean> clop: monkey patch
timonv_ has quit [Ping timeout: 248 seconds]
<bean> clop: and it'd be .quadruple
solars has quit [Ping timeout: 252 seconds]
gordon1775 has joined #ruby
<banisterfiend> clop: "reopening a class", too, but you're reopening to monkey patch, as bean says :)
nuzz has joined #ruby
arturaz has joined #ruby
<havenn> bean: s/monkey/freedom
Astralum has quit [Read error: Connection reset by peer]
<bean> lol
Astralum has joined #ruby
rakl has quit [Quit: sleeping]
wreckimnaked has joined #ruby
samuel02 has joined #ruby
<clop> thanks!
G________ has joined #ruby
G________ is now known as RubNoob
<RubNoob> Can someone recommend a good mechanism for a hidden destroy field?
<RubNoob> (for rails)
<RubNoob> I'm trying to add a drag/drop add/remove capability to my application and can't figure out how I could update nested attribute for a mdoel
_nitti_ has quit [Ping timeout: 248 seconds]
anders_ has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
<anders_> I've tried everything.. every guide for ubuntu.. rails not working.. probably because mod_rewrite refuse to work for php also
a_a_g has joined #ruby
ChampS666 has quit [Ping timeout: 240 seconds]
<anders_> is there any option todo the mod_rewrite on a virtual server with the rest of the rails?
<wreckimnaked> anders_: it's really an ubuntu issue?
<wreckimnaked> maybe you should try looking for apache tutorials
rakl has joined #ruby
<anders_> wreckimnaked, doesn't work for lubuntu either tried, same result
ilyam has joined #ruby
<anders_> but it works for others with ubuntu 12.10
slash_nick has joined #ruby
friskd has joined #ruby
friskd has quit [Remote host closed the connection]
<wreckimnaked> but you think it's a mismatched version issue?
friskd has joined #ruby
malte_ has quit [Ping timeout: 248 seconds]
<wreckimnaked> between apache and other packages?
baphled has joined #ruby
friskd has quit [Client Quit]
<wreckimnaked> because if you have a full updated system, and you're the only one having the problem, it's probably more of a configuration issue
<anders_> wreckimnaked, is there an option to use rails without mod_rewrite?
Uranio has quit [Quit: WeeChat 0.4.0-rc2]
skcin7 has joined #ruby
_nitti has joined #ruby
<havenn> anders_: #RubyOnRails
Umren|2 has joined #ruby
fourq has joined #ruby
tarsolya has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck has quit [Changing host]
C0deMaver1ck has joined #ruby
Umren has quit [Read error: Operation timed out]
C0deMaver1ck has left #ruby [#ruby]
ChampS666 has joined #ruby
hbpoison has quit [Ping timeout: 244 seconds]
<havenn> anders_: Maybe look at rack-rewrite: https://github.com/jtrupiano/rack-rewrite
<JonnieCache> havenn: thx for the link
hbpoison has joined #ruby
<workmad3> anders_: did you remember to turn on mod_proxy and mod_http_proxy when using a mod_rewrite approach to using an app server?
Uranio has joined #ruby
slash_nick has left #ruby [#ruby]
<anders_> workmad3, yes
_bart has quit [Ping timeout: 240 seconds]
<workmad3> anders_: other option is passenger btw ;)
tar_ has joined #ruby
brianpWins has joined #ruby
<anders_> passenger?
swex has quit [Remote host closed the connection]
chrismcg is now known as zz_chrismcg
sn0wb1rd has quit [Quit: sn0wb1rd]
<anders_> ah.. but I don't want to waste money on this trivial issue
<havenn> anders_: the open source version is free, enterprise is just if you want to pay
<havenn> anders_: Unicorn, Rainbows!, Thin, Reel, Puma, Passenger, and Webrick, oh my!!
mafolz has quit [Remote host closed the connection]
nuzz has quit [Ping timeout: 248 seconds]
jrist is now known as jrist-dgowalk
fourq has quit [Quit: Lost terminal]
retro|cz has quit [Ping timeout: 248 seconds]
TheFuzzball has joined #ruby
jgrevich_ has joined #ruby
<anders_> havenn, wow thanks! It feels good to ditch apache2!
apeiros_ has quit [Remote host closed the connection]
<wreckimnaked> anders_: yeah, give unicorn a try
<wreckimnaked> the setup is a breeze
<Gate> unicorn rocks, and it works well with nginx
<havenn> wreckimnaked: Unicorn is awesome! :D Jesse Storimer's talk at last RubyConf was great: http://www.confreaks.com/videos/1289-rubyconf2012-grow-your-unix-beard-using-ruby
jgrevich has quit [Ping timeout: 276 seconds]
jgrevich_ is now known as jgrevich
<JonnieCache> puma is excellent as well
a_a_g has quit [Read error: Connection reset by peer]
<JonnieCache> puma is basically an improved thin
a_a_g has joined #ruby
Hanmac1 is now known as Hanmac
andrewhl has joined #ruby
jjbohn is now known as jjbohn|afk
<JonnieCache> you dont want rainbows that for a specific use case youre unlikely to have
<JonnieCache> ignore webrick
itsdavem has joined #ruby
<Gate> webrick is for dev
<Xeago> I know a company, cough, that uses webrick in prod
piotr_ has quit [Ping timeout: 248 seconds]
a_a_g has quit [Read error: Connection reset by peer]
<JonnieCache> LOLOLOLOL
shtirlic has quit [Remote host closed the connection]
<JonnieCache> Gate: stop using it in dev for your own sanity. use puma. its 100x faster
a_a_g has joined #ruby
<JonnieCache> you will speed up your development a lot
<JonnieCache> (note: i made up the 100x number. but it is a lot faster)
<Gate> JonnieCache: I don't use webrick in dev :)
moos3 has quit [Quit: Computer has gone to sleep.]
<Gate> JonnieCache: you may cringe, but I use passenger in dev, simply because its what most of our prod apps are still on.
Bulgaria is now known as NullByte
<JonnieCache> nah man thats a good idea
<Gate> So far, except in rare cases, I haven't been able to convince people to switch to unicorn for production.
<JonnieCache> as long as its not webrick
<Gate> lol
tar_ has quit [Quit: tar_]
<JonnieCache> anyway have a nice weekend boys and girls
<Xeago> take care!
akl_ has quit [Ping timeout: 276 seconds]
JonnieCache has quit [Quit: Lost terminal]
<Gate> Xeago: I'm super curios who this, cough, company is....
dmerrick has joined #ruby
Mon_Ouie has quit [Ping timeout: 248 seconds]
h4mz1d has joined #ruby
moos3 has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
mockra has joined #ruby
otters has joined #ruby
cha1tanya has quit [Remote host closed the connection]
arturaz has quit [Remote host closed the connection]
matthias_ has joined #ruby
joeycarmello has joined #ruby
deuterium has quit [Quit: zZZz]
baphled has quit [Read error: Connection reset by peer]
stetho has quit [Quit: stetho]
ilyam has quit [Quit: ilyam]
malte_ has joined #ruby
tommyvyo has quit [Ping timeout: 246 seconds]
jonahR has joined #ruby
noxoc has quit [Quit: noxoc]
dr_bob has left #ruby [#ruby]
timonv has joined #ruby
tenmilestereo has joined #ruby
Dann1 has joined #ruby
tar_ has joined #ruby
breakingthings has quit []
hbpoison has quit [Ping timeout: 252 seconds]
hbpoison has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
bigkevmcd has quit [Quit: outta here]
jduan1981 has joined #ruby
maletor has joined #ruby
twoism has joined #ruby
wreckimnaked has quit [Ping timeout: 252 seconds]
dmiller1 has joined #ruby
<Fuzai> Anyone here familiar with sqlite? Does it support unsigned datatypes? no one seems to be awake in #sqlite and the documentation looks like it does but when i try to create a table with unsigned integers i'm getting a failure
vlad_starkov has quit [Remote host closed the connection]
kuzushi has quit [Ping timeout: 265 seconds]
timonv has quit [Remote host closed the connection]
jonahR has quit [Remote host closed the connection]
inokenty has joined #ruby
jrist-dgowalk is now known as jrist
jonahR has joined #ruby
dmiller1 has quit [Ping timeout: 264 seconds]
timmow has quit [Quit: has left the building]
yxhuvud has joined #ruby
eldariof has joined #ruby
[1]c3vin has joined #ruby
arietis has joined #ruby
nemesit has joined #ruby
rakl has quit [Quit: sleeping]
pcarrier has quit []
jjbohn|afk is now known as jjbohn
nazty has quit [Quit: plz die k thx]
filipe has quit [Remote host closed the connection]
lordnaz has quit [Remote host closed the connection]
h4mz1d has quit [Ping timeout: 255 seconds]
yxhuvud2 has quit [Ping timeout: 264 seconds]
tjbiddle has joined #ruby
c3vin has quit [Ping timeout: 240 seconds]
[1]c3vin is now known as c3vin
ElorTegle is now known as spo0n-
tjbiddle has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
willob has quit [Quit: Leaving.]
jenrzzz has quit [Ping timeout: 260 seconds]
atno has quit [Read error: Connection reset by peer]
atno has joined #ruby
jblack has joined #ruby
cdt has quit [Quit: Ex-Chat]
tjbiddle has joined #ruby
jondot` has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
jtharris has quit [Quit: WeeChat 0.3.9.2]
otherj has joined #ruby
fred909 has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
slainer68 has quit [Remote host closed the connection]
adeponte has joined #ruby
yfeldblum has quit [Ping timeout: 248 seconds]
twoism has quit [Read error: Connection reset by peer]
a_a_g has quit [Read error: Connection reset by peer]
twoism has joined #ruby
a_a_g has joined #ruby
<ecart> hello
<ecart> someone interested in a job?
end_guy has quit [Remote host closed the connection]
Elhu has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
osaut has quit [Read error: Connection reset by peer]
end_guy has joined #ruby
rakl has joined #ruby
osaut has joined #ruby
fermion has quit [Read error: Connection reset by peer]
tk_ has quit [Quit: ばいばい]
kevinfagan has quit [Ping timeout: 248 seconds]
otters has quit [Ping timeout: 252 seconds]
<Spooner> Possibly, but I expect running through ODesk or similar is a better option than taking or offering jobs on IRC. I've tried that before :D
<banisterfiend> Spooner: and what happened
<Spooner> Money was exactly the last thing I was every going to see ;)
<Spooner> banisterfiend, It was, however, a valuable lesson!
<banisterfiend> Spooner: is he still on irc?
<Spooner> banisterfiend, Nah, it was just some random guy that appeared one day.
horrror has joined #ruby
<fflush> salut bonjour
TomyLobo has joined #ruby
malte_ has quit [Quit: malte_]
mockra_ has joined #ruby
zastern has joined #ruby
<Spooner> ecart, I'm not suggesting you are bogus in this. Just that I hope you can understand my trepidation.
<banisterfiend> wow
workmad3 has quit [Ping timeout: 256 seconds]
zigomir has quit [Quit: zigomir]
ananthakumaran has quit [Quit: Leaving.]
cobragoa_ has joined #ruby
<ecart> well I'm willing to pay in advance if you show skills
sn0wb1rd has joined #ruby
daniel_- has quit [Read error: Operation timed out]
daniel_-_ has joined #ruby
<Spooner> banisterfiend, On the other hand, you paid me, so that is a 50% success rate on IRC!
templaedhel has joined #ruby
benlieb has quit [Quit: benlieb]
shevy2 has joined #ruby
mockra has quit [Ping timeout: 252 seconds]
sie has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
deuterium has joined #ruby
<ecart> I think you know,
<ecart> Spooner
<ecart> wait
hbpoison has joined #ruby
<ecart> bil.bagpuss@gmail.com
<ecart> is you?
<Spooner> ecart, I don't know whether you are going to get anywhere, but I'd suggest that you are more specific in what you want than "someone who is on #ruby".
<Spooner> That is me, yes.
<ecart> ok
atmosx has quit [Quit: And so the story goes…]
tar_ has quit [Quit: tar_]
<ecart> I think we're friends now
timonv has joined #ruby
<ecart> you just do not remember me
<ecart> private?
<Spooner> Certainly.
<Spooner> And no, I have no recollection.
c0rn has joined #ruby
daniel_-_ has quit [Client Quit]
atmosx has joined #ruby
shevy has quit [Ping timeout: 260 seconds]
kenneth has quit [Quit: kenneth]
mrsolo has joined #ruby
stevechiagozie has joined #ruby
wallerdev has joined #ruby
benlieb has joined #ruby
tar_ has joined #ruby
tar_ has quit [Client Quit]
ossareh has joined #ruby
tenmilestereo has quit [Ping timeout: 252 seconds]
elaptics is now known as elaptics`away
tommyvyo has joined #ruby
jean-louis has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
c0rn has quit [Ping timeout: 276 seconds]
a_a_g has quit [Read error: Connection reset by peer]
willob has joined #ruby
a_a_g has joined #ruby
squidBits has joined #ruby
sie has quit [Ping timeout: 264 seconds]
danieldocki has joined #ruby
c0rn has joined #ruby
adambeynon has quit [Quit: Computer has gone to sleep.]
a_a_g has quit [Read error: Connection reset by peer]
Udom01 has joined #ruby
swex has joined #ruby
berserkr has joined #ruby
ilyam has joined #ruby
a_a_g has joined #ruby
jonahR has quit [Remote host closed the connection]
Udom0 has quit [Ping timeout: 244 seconds]
tvw has quit [Remote host closed the connection]
jonahR has joined #ruby
gridaphobe has joined #ruby
s1n4 has joined #ruby
<cr3> when should I use mixins instead of inheritance?
_nitti has quit [Remote host closed the connection]
jblack has quit [Ping timeout: 255 seconds]
jonahR has quit [Remote host closed the connection]
<ecart> spooner
<ecart> please
<ecart> pm
<ecart> ;/
<s1n4> hey, how do I find and remove strings that begin with "x" and end with "y"?
frogstarr78 has quit [Remote host closed the connection]
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
* s1n4 doesnt like regex
<ecart> /dns 197.1.60.101
tenmilestereo has joined #ruby
<anders_> havenn, well so far passenger is playing along nicely! However, it failed(to route as usual) first and then I saw in the log that sqlite3 was required so I installed it through gem and restarted the server
timonv has quit [Remote host closed the connection]
jonahR has joined #ruby
<banisterfiend> Spooner: is ecart the same guy who didn't pay you?
apeiros_ has joined #ruby
<ecart> ;/
jtharris has joined #ruby
<ecart> i pay
moted has quit [Ping timeout: 248 seconds]
<ecart> I just did not have the money
ecart was kicked from #ruby by banisterfiend [ecart]
<_knitetemplar> *poof gone...
ben___ has joined #ruby
speakingcode has quit [Remote host closed the connection]
voodoofish430 has quit [Quit: Leaving.]
<otherj> anyone using jekyyl with github pages?
<otherj> jekyll
frogstarr78 has joined #ruby
jonnnn has joined #ruby
<s1n4> otherj: whats the matter?
gearaholic has joined #ruby
<otherj> not totally clear to me if I'm just supposed to toss up _pages in the repo or the whole local repo
imperator has joined #ruby
<otherj> mainly because i pushed the whole repo and github gives me a 404 page
<Spooner> Should put the whole repo up, not just the pages.
<Spooner> Since it _runs_ on github.
<otherj> maybe it just takes longer to build when i'm putting up the whole deal
<otherj> yeah
<Spooner> Other solutions, like nanoc, you need to push just the pages. This is what I do.
<otherj> you familiar with any decent gallery plugins for jekyll, spooner?
<otherj> ok
<Spooner> No, I have barely used Jekyll. Sorry.
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
<otherj> I might go that route if this turns out to be too much of a pain
<otherj> what do you like about nanoc?
<Spooner> Jekyll or Octopress are a lot simpler. nanoc gives you more freedom, but it comes at a price, as you would expect!
apeiros_ has quit [Ping timeout: 264 seconds]
<otherj> sure. what aspects of 'freedom' though?
<s1n4> hey, how do I find and remove strings that begin with "x" and end with "y" (using regex)?
speakingcode has joined #ruby
<Spooner> Well, for example, you can only use Liquid markup in Jekyll if you host it on Github. Nanoc you can use anything (markdown/haml/slim).
<Spooner> Well, strictly you can use anything in jekyll, but then you can only host the generated pages.
jonahR has quit [Remote host closed the connection]
<Spooner> s1n4, when you say strings, do you mean words?
<frem> something like this? /^[x]\w+[y]$/
<s1n4> Spooner: yeah
<s1n4> frem: lemme try
<frem> oh, never mind
<Spooner> frem you only need [] around sets of characters.
rwilcox has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<Spooner> sln4 str.gsub /^bx\w*y^b/, ''
<Spooner> Though that will leave double-spaces behind. Not sure of the context, so I won't suggest more.
mrsolo has quit [Quit: Leaving]
Xeago has quit [Ping timeout: 248 seconds]
otherj has quit [Quit: otherj]
<clooth> I AM SO WEENER
Pip has joined #ruby
nuzz has joined #ruby
jgarvey has joined #ruby
lkba has joined #ruby
<s1n4> Spooner: that doesnt work
Banistergalaxy has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
artOfWar has joined #ruby
<Sigma00> word boundary is \b, not ^b
Banistergalaxy has joined #ruby
<cr3> is there a good example on how to properly document a class? this page doesn't cover documentation much: https://github.com/styleguide/ruby
<Spooner> Sigma00, Thanks. I was really not concentrating.
<frem> If I have a module that does `class << self`, and I want to extend a method in that module from a class that includes the module, how do I do that?
kenneth has joined #ruby
<s1n4> Sigma00: so, should it be something like str.gsub /\bx\w*y\b/, '' ?
<Spooner> Yes.
<frem> I mostly want to use super, but I don't think it'll work since the module is injecting methods onto the class' self.
<banisterfiend> frem: "extend a method in that module froma class that include the module" <--- waht do u mean
<s1n4> it doesnt work, try it yourself: "x..ystuffx._.y".gsub /\bx\w*y\b/, ''
<s1n4> >>"x..ystuffx._.y".gsub /\bx\w*y\b/, ''
<eval-in> s1n4: Output: "" (http://eval.in/6513)
<Spooner> You need to print to see in the output.
MattRb has joined #ruby
twoism has quit [Read error: Connection reset by peer]
<s1n4> >>puts "x..ystuffx._.y".gsub /\bx\w*y\b/, ''
<eval-in> s1n4: Output: "x..ystuffx._.y\n" (http://eval.in/6516)
twoism has joined #ruby
reppard has joined #ruby
noxoc has joined #ruby
<s1n4> did you see Spooner?
<Sigma00> s1n4: a period is not a part of a word, so \b makes the regex match only ystuffx
mr_matt has joined #ruby
beiter has joined #ruby
<Spooner> You have ystuffx, not xstuffy
<Spooner> if you need to get rid of x..y, then that isn't a word, which was what you specified.
<s1n4> Spooner: so, I'm sorry, that was my mistake
<Sigma00> if you want it to match EVERYTHING in between ALL Xs and Ys, just remove the \b's.
<s1n4> Sigma00: thanks
nemesit has left #ruby ["Linkinus - http://linkinus.com"]
<Sigma00> that's gonna implode nicely if you have xblaxblayblay
<Sigma00> wait no it won't, forget I talked
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<s1n4> actually, I want get rid of x..y and x._.y
<Sigma00> >>"x..ystuffx._.y".gsub /x\w*y/, ''
<eval-in> Sigma00: Output: "" (http://eval.in/6518)
<Sigma00> oh right
<Sigma00> change \w for .*
<Sigma00> >>"x..ystuffx._.y".gsub /x.*y/, ''
<eval-in> Sigma00: Output: "" (http://eval.in/6520)
<s1n4> Sigma00: thanks, let me try
<Sigma00> <_<
<s1n4> >>puts "x..ystuffx._.y".gsub /x.*y/, ''
<eval-in> s1n4: Output: "\n" (http://eval.in/6521)
<s1n4> :/
tatsuya_o has quit [Remote host closed the connection]
<Spooner> I'm guessing you aren't really matching x and y and .. and stuff. I think it would be clearer if you gave a real example.
generalissimo has quit [Remote host closed the connection]
reppard has quit [Ping timeout: 252 seconds]
<Sigma00> hehe yeah... it's matching the first x and the last y
<Sigma00> so it deletes everything
<Spooner> Because making it work for your example is likely not to work in your real case.
gabebug has joined #ruby
BizarreCake has joined #ruby
<Sigma00> you need to make it nongreedy
<s1n4> hah
yxhuvud2 has joined #ruby
AtoxIO has joined #ruby
<Sigma00> >>"x..ystuffx._.y".gsub /x.*?y/, ''
<eval-in> Sigma00: Output: "" (http://eval.in/6522)
<gabebug> is there an ideal pattern for an variable optionally being a lambda? something better than `@foo = options[:foo].lambda? ? options[:foo].call : options[:foo]` ?
<Sigma00> ..
vlad_starkov has quit [Remote host closed the connection]
<s1n4> so, the real instance for me would be "picked the x3cemx3estuffx3c/emx3e up"
<gabebug> would .respond_to?(:call) be more appropriate than .lambda?
<s1n4> and I need to remove everything that starts with "x3" and ends with "3e"
reinaldob has quit [Remote host closed the connection]
<banisterfiend> gabebug: .lambda? wont work
<s1n4> so, I wanna remove "x3cemx3e" and "x3c/emx3e"
yxhuvud has quit [Ping timeout: 276 seconds]
<banisterfiend> gabebug: that only works if the object is a Proc, so you'll get an exception if you invoke that on a non Proc
<gabebug> oh, right, no String#lambda?
<banisterfiend> gabebug: haha, why would there be? :P
<gabebug> i assume .respond_to(:call) is better than is_a(Proc)?
<s1n4> was that clear? Sigma00 Spooner
hybris has quit [Quit: Leaving]
<frem> @banisterfiend: slightly better version of question with code. https://gist.github.com/1bfa159c490c8fa49e80
<banisterfiend> gabebug: it entirely depends, if you're using Proc-like features of the receiver then clearly it only makes sense to check for Procs
<banisterfiend> gabebug: for example, if you want ot instance_eval the object, then you *need* to check for Proc
d2dchat has joined #ruby
<banisterfiend> gabebug: however, if you're just #call-ing and passing in a parameter, then u could legitimately does check for #call
<gabebug> yeah, i'm just going to be running .call on it.
<Spooner> s1n4, /x3.*?3e/ is probably what you want then. As Sigma00 suggested, a non-greedy match inthe centre is best.
horrror has quit [Quit: horrror]
Uranio has quit [Quit: while you reading this, a kitty dies]
<Sigma00> ^ agreed
<gabebug> i figure the respond_to? is more duck-typey
kgb_ has quit [Quit: Page closed]
<s1n4> Spooner: great, thanks
jrist is now known as jrist-afk
cdt has joined #ruby
<s1n4> Sigma00: also, thank you
shtirlic has joined #ruby
<banisterfiend> frem: why don't you just use extend() if you're going to be writing to the the metaclass?
<Spooner> s1n4, since you can have any character in between (not just a-z as I originally thought).
cdt has quit [Client Quit]
RagingDave has quit [Quit: Ex-Chat]
<banisterfiend> frem: i hate your code more than i hate hell and all montagues, it just looks like cargo-cult code, like youer' copying something you've seen somewhere without udnersatnding it
<banisterfiend> srsly :P
<frem> @banisterfiend: I'm maintenance on an existing codebase trying to debug something and understand what the crap is going on.
csgui has quit [Quit: csgui]
<frem> I didn't actually write like 99% of this
<banisterfiend> frem: ah ok, can i rwrite it?
<banisterfiend> on esec
Mon_Ouie has joined #ruby
maxmanders has joined #ruby
Coolhand has quit [Remote host closed the connection]
<banisterfiend> frem: wait, so is 'stuff' meant to be a class method or an instance method? a class method?
kpshek has quit []
yshh has joined #ruby
llaskin has left #ruby [#ruby]
<banisterfiend> frem: wtf you get no method error cos u haven't even included the module
Bry8Star has quit [Remote host closed the connection]
<frem> Right.
kpshek has joined #ruby
BizarreCake has quit [Quit: Leaving]
Bry8Star has joined #ruby
<banisterfiend> frem: and that surprises you or what? sry im not follwing what you want/what you're trying to do here
Zolrath has quit []
Xeago has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
hackerdude has joined #ruby
primitive has joined #ruby
primitive has left #ruby [#ruby]
hbpoison has joined #ruby
frem_ has joined #ruby
a_a_g has quit [Quit: Leaving.]
frem has quit [Ping timeout: 252 seconds]
frem_ is now known as frem
slainer68 has joined #ruby
<Eiam> I have a bit of data that initially worked great doing marshal.dump & marshal.load. but now as i've expanded how often I'm writing out data that I should be streaming into a file, or appending something.. basically I'm looping through a data set getting data from another service, then I store the data, loop, load append store, loop load append store
<Eiam> should I just pull in activerecord at this point if I want to make this cleaner?
jonnnn has left #ruby ["Textual IRC Client: www.textualapp.com"]
<Eiam> i was hoping to stay light weight (marshal.load & dump is super basic) but I feel silly using it like this now
timonv has joined #ruby
gordon1775 has quit [Ping timeout: 248 seconds]
osaut has quit [Quit: osaut]
katherinem13 has quit [Ping timeout: 246 seconds]
<Eiam> activerecord or "something else". I could just as easily use sqlite or something too I suppose
Goopyo has joined #ruby
zodiak has quit [Ping timeout: 272 seconds]
<Goopyo> how do you call this line: def self.post(url, payload, headers={}, &block)
<Goopyo> if you have a header hash and want to pass a timeout kwarg
<Goopyo> keyword argument*
jpfuentes2 has joined #ruby
frogstarr78 has quit [Remote host closed the connection]
<blazes816> Eiam: how many records/sec are you pulling? right now you're just marshaling and dumping to a text file?
<Hanmac> Goopyo: post(url,payload, :timeout => nr)
blakerg has quit [Quit: blakerg]
<Eiam> blazes816: yes. Hmm right now its probably 2-3 records a second, but I did plan on parrallezing the pulling so that part would happen faster too
<Goopyo> so &block packs the extra argumets like **kwargs ?
<Eiam> blazes816: I marshal data out, then load it back in, append, marshal out.
slainer68 has quit [Ping timeout: 252 seconds]
<havenn> Eiam: You could Marshal to Redis instead of to disk. MessagePack would be faster than Marshal, if speed matters. http://msgpack.org
breakingthings has joined #ruby
<Eiam> I've been rewriting this code while trying to focus hard on "Confident coding"
<havenn> s/disk/file
DrShoggoth has quit [Quit: Leaving]
<Eiam> havenn: why wouldn't I just use json?
<Eiam> over msgpack
generalissimo has joined #ruby
<Eiam> nevermind
<havenn> Eiam: MessagePack is 3x faster than Marshal, which is itself faster than JSON.
<Eiam> i've seen this argumnt on hacker news too many times and don't want to go down it cause its distracting
<Hanmac> Goopyo the block is called with post(args) {..thisistheblock...}
<Eiam> havenn: thats still going to result in my packing & unpacking the data repeatedly
ben___ has quit [Quit: ben___]
<Eiam> its not changing what I'm doing with the data fundamentally, loading & unloading it
hbpoison has quit [Ping timeout: 255 seconds]
<Eiam> redis however
<Eiam> never heard of that, looks interesting
lightguard_jp has joined #ruby
<Eiam> i do basically want a kvs
<blazes816> what is the data? i.e. why do you need to have pieces 1, 2, and 3 to save piece 4?
<lightguard_jp> I'm looking to suppress stout in tests, is there a recommended way of doing this?
Neomex has joined #ruby
hbpoison has joined #ruby
Neomex has quit [Client Quit]
<Spooner> frem https://gist.github.com/db1b0c5ed0cc372a4022 - I really don't understand why youneed meta hoops to jump through to get BASIC functionality.
<Eiam> blazes816: ah, wel thats true, I don't really need the other peices when I write out. when I read in I have to check and see if the key already exists or not
<Eiam> blazes816: if the key already exists I use the local value, otherwise I go get get value from the server
<Eiam> which is way more expensive
marr has quit [Ping timeout: 276 seconds]
Udom01 has quit [Ping timeout: 264 seconds]
<banisterfiend> frem: ok, i think i got it for you
jds_ has joined #ruby
<Goopyo> Hanmac: why is req = RestClient.get(req_url, headers=@headers, :timeout => 1.5) giving me "wrong number of arguments" ?
<Spooner> because headers=@headers, not :headers => @headers
<Eiam> oh, hmm have to install redis
<Eiam> and start the server. hmm thats too much overhead for this
<banisterfiend> frem: https://gist.github.com/4513230
moted has joined #ruby
vlad_starkov has joined #ruby
<Xeago> banisterfiend: strange to see an op in here
jonahR has joined #ruby
_nitti has joined #ruby
<Spooner> Eiam, You are going to struggle to get a high-performance database without a high-performance database involved ;)
sayan has quit [Read error: Connection reset by peer]
<Eiam> Spooner: I'm not sure I need to bring in a monster truck tire when a ford fiesta tire will suffice
<Eiam> we are talking about a ./myscript.rb here
<Eiam> not a full blown service
<Goopyo> Spooner: can you please clarify? I have it as headers=@headers
reset has joined #ruby
<Spooner> Yes and that isn't what you usually put in a method call.
yacks has quit [Quit: Leaving]
<banisterfiend> frem: is what what you wanted?
frem has quit [Quit: Computer has gone to sleep.]
<Goopyo> Spooner: but then my headers get packed with timeout, and its no longer seen as an arg
<Spooner> Goopyo, Yes, but the expression doesn't make sense in that context. You are setting headers to the value of @headers then passing that value into the method. The variable "headers" serves no purpose whatsoever.
<Goopyo> oh alright gotcha
kudos has joined #ruby
kudos has quit [Changing host]
kudos has joined #ruby
<Goopyo> how would I prevent the two from getting packed?
<Spooner> "packed"?
Udom0 has joined #ruby
<Spooner> RestClient.get(req_url, :headers => @headers, :timeout => 1.5) makes sense and would be only two parameters being sent.
<Spooner> Your example sends 3 params.
_nitti has quit [Ping timeout: 265 seconds]
Udom0 has quit [Client Quit]
MattRb has quit [Quit: This computer has gone to sleep]
<Spooner> I'm not looking at the documentation though, so I'm just guessing that is what your problem is.
<Goopyo> Hmm
Udom0 has joined #ruby
zodiak has joined #ruby
answer_42 has quit [Ping timeout: 276 seconds]
<Goopyo> If you dont mind checking this out, I'm sending @headers is a hash of the headers, and its processed on line 59 here https://github.com/archiloque/rest-client/blob/master/lib/restclient/request.rb
nomenkun has quit [Remote host closed the connection]
mr_matt has quit [Quit: leaving]
end_guy has quit [Ping timeout: 276 seconds]
Onii-san has joined #ruby
<Goopyo> my timeout is going into the headers, and my headers are going into headers as a key, value pair
nomenkun has joined #ruby
katherinem13 has joined #ruby
<Spooner> Goopyo, It only expects url and headers and a block. timeout doesn't go in there.
_46bit has joined #ruby
<Spooner> You want RestClient.get(req_url, @headers)
clooth has quit [Quit: clooth]
nomenkun has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<Goopyo> so would I have to class the parent if I wanted to add timeouts?
vlad_starkov has quit [Ping timeout: 248 seconds]
<Goopyo> use the parent*
advorak has joined #ruby
ngoldman has joined #ruby
<Spooner> No, it is probably a config ratehr than per-get.
frogstarr78 has joined #ruby
nomenkun has joined #ruby
moted has quit [Ping timeout: 260 seconds]
_46bit has quit [Client Quit]
Udom0 has quit [Ping timeout: 264 seconds]
<Goopyo> crazy how a 1230 start, 253 fork project has this shitty documentation
<Goopyo> ah have to use it directly
itsdavem has quit [Remote host closed the connection]
<Goopyo> thanks!
<Spooner> Or use the Resource version. That does it easily too.
<Spooner> Look for ActiveResource-Style: https://github.com/archiloque/rest-client
yshh has quit [Remote host closed the connection]
<Spooner> You can pass timeout stuff when you use Resource.new
<Goopyo> got it thanks
Guedes is now known as Guedes_out
<Goopyo> Resource.new(:timeout => num).get(url, headers)
<Goopyo> right?
jerius has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
Udom0 has joined #ruby
MattRb has joined #ruby
sporkbomb has joined #ruby
<Spooner> You should create the resource and use it many times, but yeah, if you just want it once, then that looks right.
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
jerius has joined #ruby
<Goopyo> yeah. Thanks again!
timonv has quit [Remote host closed the connection]
gridaphobe has quit [Ping timeout: 256 seconds]
_46bit has quit [Client Quit]
eldariof has quit []
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Xeago has quit [Remote host closed the connection]
sayan has joined #ruby
gridaphobe has joined #ruby
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
JarJar has joined #ruby
<mjolk> is there any disadvantage to giving functions return values?
<mjolk> ruby isn't my primary language and the idea of just letting it flow through makes me uncomfortable
iaj has quit [Ping timeout: 256 seconds]
mrsolo has joined #ruby
_nitti has joined #ruby
_46bit has quit [Client Quit]
reppard has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
deuterium has quit [Quit: zZZz]
<banisterfiend> mjolk: up to u, it's just a result of "everything is an expression" in ruby
<banisterfiend> mjolk: you can use 'return' when u want to early exit
<mjolk> cool
<mjolk> thanks banisterfiend - i've been using it in all my defs because i want the loop to get off the compiler ASAP
_46bit has quit [Client Quit]
pskosinski has quit [Ping timeout: 248 seconds]
db_auto_crap has quit [Read error: Connection reset by peer]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
benlieb has quit [Quit: benlieb]
datalurkur has joined #ruby
gh5046 has joined #ruby
end_guy has joined #ruby
<datalurkur> Having some problems porting an my extension from 1.8.7 to 1.9.3
philcrissman has quit [Read error: Connection reset by peer]
zeade has joined #ruby
slainer68 has joined #ruby
libryder has joined #ruby
<datalurkur> Data_Get_Struct complains -> wrong argument type Noise (expected Struct)
philcrissman has joined #ruby
son_of_bitch has joined #ruby
<libryder> this is arbitrary, but why does this: [1,2,3,4,5].each_with_object(0) { |obj, count| count += 1 }
<libryder> always return 0?
_46bit has quit [Client Quit]
<gh5046> I need to install multple rubygems with specific versions. Installing them one at a time installs dependencies which I happen to need, but with the wrong versions.
f0ster has joined #ruby
tommyvyo_ has joined #ruby
<katherinem13> re.match(string) and string.match(re) seem to be equivalent. Is there a reason to prefer one to the other?
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<ericwood> use bundler
<swarley> katherinem13; they should be aliased to basically work the same
<libryder> i'm trying to avoid: count = 0; [1,2,3,4,5].each { count += 1 } — i am trying to find a solution that avoids setting a temporary variable
<swarley> String#match calls match on the regular expression, or the other way around
<ericwood> >> (1..5).inject(0) { |a,i| a+i }
<eval-in> ericwood: Output: "" (http://eval.in/6523)
<ericwood> >> p (1..5).inject(0) { |a,i| a+i }
<eval-in> ericwood: Output: "15\n" (http://eval.in/6524)
* swarley is fairly sure that Regexp#match is the real method
<katherinem13> swarley: Yeah, I'm just wondering if there's a general code style preference
<gh5046> ericwood: Were you speaking to me?
<swarley> Oh, I've always seen it matched with a string as the subject object
<swarley> Unless you have a mass used regular expression
<ericwood> gh5046: I was answering libryder's question
<swarley> In which case it's more efficient to use the regular expression
<ericwood> libryder: isn't what you're trying to do just the length of the array?
_46bit has quit [Client Quit]
templaedhel has quit [Quit: Leaving...]
osaut has joined #ruby
<Hanmac> ericwood:
<Hanmac> >> p (1..5).inject(0,:+)
<eval-in> Hanmac: Output: "15\n" (http://eval.in/6525)
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<libryder> ericwood, in the actual logic i have a conditional that increases the count if each object meets it
<ericwood> Hanmac: ah, that's better
yfeldblum has joined #ruby
<ericwood> libryder: use my thingamajig, then
<ericwood> and place whatever you want inside that block
interactionjaxsn has joined #ruby
noxoc has quit [Ping timeout: 248 seconds]
<ericwood> libryder: if you're going from an array to a single object, inject is your friend
<gh5046> How can I install multiple gems at once with specific versions?
<ericwood> gh5046: bundler
<swarley> >> [:foo, :bar, :foo, :foo, :bar, :monkey].count(foo)
<eval-in> swarley: Output: "/tmp/execpad-3a6e5f7d1195/source-3a6e5f7d1195:1:in `<main>': undefined local variable or method `foo' for main:Object (NameError)\n" (http://eval.in/6526)
<swarley> >> [:foo, :bar, :foo, :foo, :bar, :monkey].count(:foo)
<eval-in> swarley: Output: "" (http://eval.in/6527)
<swarley> .
<Eiam> is hash.fetch a common ruby paradigm? I have not seen it used in code often but I rather like it because it lets you encapsulate a default value if no value is found withut doing some testing on that data inline
<gh5046> gem install gemA -v 1 gemB -v 2 doesn't work
<ericwood> gh5046: I guess I was answering your question earlier :P
<gh5046> Oh
<gh5046> Haha
<Hanmac> swarley: you need to print it
son_of_bitch is now known as db_auto_crap
<gh5046> Thank you
<swarley> oh
db_auto_crap has quit [Changing host]
db_auto_crap has joined #ruby
<swarley> >> p [:foo, :bar, :foo, :foo, :bar, :monkey].count(:foo)
<eval-in> swarley: Output: "3\n" (http://eval.in/6528)
_46bit has quit [Client Quit]
<ericwood> Eiam: you can create a hash with a different default value
perlsyntax has joined #ruby
<swarley> Hash.new(default_object)
noxoc has joined #ruby
yxhuvud has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
tatsuya_o has joined #ruby
<Hanmac> ericwood: be very VERY careful when you use an Array or an String as default object ...
<Eiam> ericwood: well I mean i basically parse "hash.fetch(:key,2)" to say get me whatever is :key otherwise give me 2
<libryder> thanks ericwood that will work
<libryder> :)
<swarley> Since it's the same object
tatsuya_o has quit [Read error: Connection reset by peer]
<swarley> Eiam; hash[:key]||2
tatsuya_o has joined #ruby
<ericwood> Eiam: fetch will do what you want, then, and overriding the default return value of a hash isn't recommended
<Eiam> swarley: sure, or hash.fetch(:key) { |a| "looks like your data is corrupt, lets call a clean up method to generate the correct data" }
otters has joined #ruby
danieldocki has quit [Quit: Leaving...]
horofox has joined #ruby
_46bit has quit [Client Quit]
skcin7 has quit [Ping timeout: 248 seconds]
hbpoison has quit [Ping timeout: 244 seconds]
<Eiam> ericwood: isn't that exactly what fetch is exposing? that very behavior?
<Eiam> (why else would you use hash.fetch(:key) when you could just use hash[:key] ?)
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<swarley> If you're going to be doing checks like that you should really do it in a more natural control structured way
yxhuvud2 has quit [Ping timeout: 276 seconds]
<ericwood> Eiam: no, it's doing it on its own, not changing it for *all* lookups
gh5046 has left #ruby [#ruby]
hbpoison has joined #ruby
pskosinski has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
itsdavem has joined #ruby
haxrbyte has joined #ruby
<Eiam> I don't understand the purpose of fetch then sorry
_46bit has quit [Client Quit]
<Eiam> it basically contradicts what you two just said
haxrbyte has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<ericwood> Eiam: if you define a hash with a default value, ALL failed lookups from then on out will return it
<ericwood> fetch just allows you to set a default return value for a single lookup
<Eiam> ericwood: right, so you use fetch in your init method
deuterium has joined #ruby
freerobby has joined #ruby
<freerobby> Am I crazy or does it seem like the parsing tree is out of order here? https://gist.github.com/4513453
<ericwood> what init method?
<Eiam> then its going to populate your instance with the result of fetch
<Eiam> ericwood: well in my case I'm pushing data from a service I don't control into a class. the init method parses that input and tries to put it into attributes, but if they don't exist it puts something else in instead
_46bit has quit [Client Quit]
<Eiam> using fetch
jonahR has quit [Quit: jonahR]
<Eiam> (which seems like a perfect use of fetch)
<ericwood> it is
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
danneu has quit [Quit: WeeChat 0.3.8]
<ericwood> our point was, you can override the default return value on Hash so you don't have to use fetch
<ericwood> but that's an extreme pattern
<Eiam> right, just like blah ||= {:defaults}
<Eiam> same concept
frem has joined #ruby
<Eiam> doh late for meeting, brb. thanks for chat
doodlehaus has joined #ruby
_46bit has quit [Client Quit]
jonahR has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
imperator has left #ruby ["Leaving"]
jonahR has quit [Client Quit]
apeiros_ has joined #ruby
Udom0 has left #ruby [#ruby]
nazty has joined #ruby
reppard has quit [Ping timeout: 255 seconds]
horofox_ has joined #ruby
rippa has quit [Ping timeout: 260 seconds]
MattRb has quit [Quit: This computer has gone to sleep]
_46bit has quit [Client Quit]
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
blacktulip has quit [Remote host closed the connection]
Astral_ has joined #ruby
blacktulip has joined #ruby
horofox has quit [Ping timeout: 255 seconds]
horofox_ is now known as horofox
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
itsdavem has quit [Remote host closed the connection]
<cr3> is there any preference between declaring an empty hash as {} or Hash.new?
osaut has quit [Quit: osaut]
<Spooner> Use {} unless you need to pass anything (initial values or block) to the hash.
Astralum has quit [Ping timeout: 255 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Stormpath has quit [Quit: Stormpath]
gordon1775 has joined #ruby
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<ericwood> {}}{}{{}
<Spooner> And remember than {o} is what darth vader flies around in.
<ericwood> |o|
matled has joined #ruby
DrCode has quit [Remote host closed the connection]
_46bit has quit [Client Quit]
sixtenei1hty is now known as sixteneighty
cobragoa_ has quit [Remote host closed the connection]
<perlsyntax> Is there any ruby docs online that are good to read?
<Spooner> No, the mooks use |o| Darth's is special.
kevinfagan has joined #ruby
wallerdev has quit [Quit: wallerdev]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
wallerdev has joined #ruby
rads has joined #ruby
bluOxigen has joined #ruby
gordon1775 has quit [Read error: Connection reset by peer]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<ericwood> perlsyntax: ruby-doc.org
fred909 has quit [Ping timeout: 240 seconds]
<ericwood> those are the official ones
<perlsyntax> thanks
jonahR has joined #ruby
wargasm has joined #ruby
_46bit has quit [Client Quit]
templaedhel has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
timonv has joined #ruby
kpshek has quit []
templaedhel has quit [Client Quit]
jlast has quit [Ping timeout: 248 seconds]
_46bit has quit [Client Quit]
vlad_starkov has joined #ruby
templaedhel has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
alex__c2022 has quit [Quit: alex__c2022]
jlast has joined #ruby
jwang has quit [Ping timeout: 265 seconds]
<havenn> Benchmarked Ruby, JRuby, and RBX serialization with YAML, JSON, Marshal, and MessagePack: https://gist.github.com/4513627
kil0byte has joined #ruby
<Goopyo> is there a way to enter interactive mode in the middle of a script. I guess a deubger like pdb
<havenn> Goopyo: Pry
_46bit has quit [Client Quit]
<Goopyo> thanks
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<havenn> Goopyo: You can add `require 'pry'` to you file then `binding.pry` where you want to jump out.
<havenn> s/you/your
templaedhel has quit [Client Quit]
Neomex has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
apeiros_ has quit [Remote host closed the connection]
postmodern has joined #ruby
_46bit has quit [Client Quit]
<Goopyo> thanks exactly what I wanted
templaedhel has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
maxmanders has quit [Ping timeout: 248 seconds]
<havenn> JRuby won the serialization speed with Marshal. In the others, MessagePack is the fastest. Kinda curious about MessagePack's speed in JRuby but the whole C-extension thing...
haxrbyte has joined #ruby
Coolhand|laptop has joined #ruby
kirun has joined #ruby
aaronmacy has joined #ruby
<havenn> JRuby really Marshals fast...!
kaen has quit [Remote host closed the connection]
_46bit has quit [Client Quit]
templaedhel has quit [Client Quit]
ebouchut has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
bluOxigen has joined #ruby
templaedhel has joined #ruby
osaut has joined #ruby
kaen has joined #ruby
maxmanders has joined #ruby
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Morkel_ has joined #ruby
toekutr has joined #ruby
greg5green has joined #ruby
_46bit has quit [Client Quit]
cobragoa_ has joined #ruby
_cheney2 has joined #ruby
greg5green has quit [Changing host]
greg5green has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
ben__ has joined #ruby
_46bit has quit [Client Quit]
Neomex has quit [Quit: Neomex]
workmad3 has joined #ruby
mehwork has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
clocKwize has joined #ruby
_cheney has quit [Ping timeout: 256 seconds]
_46bit has quit [Client Quit]
kpshek has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
haxrbyte has quit [Ping timeout: 246 seconds]
ckrailo has joined #ruby
<shevy2> my cat really eats fast...!
<shevy2> hmmm is webrick used by anyone at all?
shevy2 is now known as shevy
<ericwood> in development
Zolrath has joined #ruby
_46bit has quit [Client Quit]
clocKwize has quit [Client Quit]
apeiros_ has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
albakry has quit [Quit: Leaving]
statarb3 has quit [Quit: Leaving]
jrist-afk is now known as jrist
tatsuya_o has quit [Remote host closed the connection]
<havenn> shevy: I wouldn't even use Webrick in dev. But I have caught myself using it on a Heroku app unwittingly. Betch a ton of Heroku apps are Webrick. >.>
_46bit has quit [Client Quit]
<shevy> omg...
mneorr has joined #ruby
<shevy> I just used webrick to serve my .cgi pages
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<shevy> and it works
MattRb has joined #ruby
hbpoison has quit [Ping timeout: 244 seconds]
<shevy> why didn't anyone tell me before! I dont have to depend on apache anymore :)
fred909 has joined #ruby
* shevy is a happy person
gearaholic has quit [Remote host closed the connection]
<shevy> havenn hmm what do you use?
hbpoison has joined #ruby
<shevy> I mean when you want to serve some locally for your own use
<havenn> Unicorn or Puma lately.
<shevy> aha ok
_46bit has quit [Client Quit]
<havenn> Unicorn's auto-reloading without restart seems nicer to me than Thin+Shotgun.
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
fermion has joined #ruby
<havenn> And I use Puma with JRuby. :)
aaronmacy has quit [Quit: Leaving.]
_46bit has quit [Client Quit]
carloslopes has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
asteve has joined #ruby
mneorr has quit [Remote host closed the connection]
DrCode has joined #ruby
mneorr has joined #ruby
kpshek has quit []
fred909_ has joined #ruby
berserkr has quit [Quit: Leaving.]
_46bit has quit [Client Quit]
jds_ has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
ngoldman has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
joshsmith has joined #ruby
Guest25886 has quit [Quit: Guest25886]
<datalurkur> Anyone familiar with Ruby C extensions?
<joshsmith> how does one print just the value of a key in an ordered hash
fred909 has quit [Ping timeout: 248 seconds]
yshh has joined #ruby
_46bit has quit [Client Quit]
<Mon_Ouie> An ordered hash being an instance of what class? Just the standard Hash class (which uses insertion order)?
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<joshsmith> actually I figured it out
<joshsmith> sorry about that
jds_ has joined #ruby
krawchyk has quit [Remote host closed the connection]
<Spooner> datalurkur, Somewhat, but just ask your question. I'm sure many people have made them.
<datalurkur> Spooner: I did earlier and didn't get an answer.
<datalurkur> Basically, I'm porting an extension from 1.8.7 -> 1.9.x
<shevy> datalurkur not many here know Ruby-C
<datalurkur> And I'm getting failures from Data_Get_Struct trying to cast a wrapped Ruby struct to a C object.
<Spooner> Ah right, so struggling with the string macro changes?
_46bit has quit [Client Quit]
<datalurkur> Spooner: This works fantastically in 1.8.7
<Mon_Ouie> What's the exact error you get?
<datalurkur> But for whatever reason, 1.9 claims that the objects it's being passed are not Structs.
<datalurkur> wrong argument type <x> (expected Struct)
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<datalurkur> There's the file.
gnarmis has joined #ruby
<Spooner> data Ah, I have a perlin C-ext too. Never noticed yours (mine is spooner/ruby-perlin).
macmartine has joined #ruby
<gnarmis> I was wondering if it's good practice to use a sqlite db inside a gem?
banisterfiend has joined #ruby
<datalurkur> Spooner: Yeah, it's handy for worldgen stuff. Plus, I think Perlin noise is supercool.
_46bit has quit [Client Quit]
<lupine> gnarmis, it's only bad practice if the dependency is unnecessary, or you fail to specify it correctly
<lupine> what's the use-case?
yshh has quit [Ping timeout: 248 seconds]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
fred909_ has quit [Ping timeout: 264 seconds]
marr has joined #ruby
yxhuvud2 has joined #ruby
<gnarmis> So, if I'm building a gem that needs to keep some data that's best represented in relations, can I put that db file inside the gem's dir itself?
marr has quit [Client Quit]
thatguycraig has left #ruby [#ruby]
aaronmacy has joined #ruby
<shevy> gnarmis you can distribute anything in a .gem
<shevy> in lib/projectname/lib/yaml I tend to keep yaml files
_46bit has quit [Client Quit]
n1x has joined #ruby
<shevy> "best practise" not so much :P
<gnarmis> shevy: that's pretty cool
<gnarmis> haha
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<lupine> eh, you certainly can in practice. whether the standards make space for it, and whether it's a good idea in this instance or not, is another question ^^
<lupine> I'd avoid lib/
yxhuvud has quit [Ping timeout: 248 seconds]
<gnarmis> so something like data/mystuff.db
<gnarmis> I was weighing this against creating a dot directory under $HOME
<Mon_Ouie> datalurkur: Any example of how you're using your wrapper? Stubbing the calls to the actual library, this appears to work: http://pastie.org/5670367
benlieb has joined #ruby
<gnarmis> but $HOME pollution should be avoided, I'm thinking
_46bit has quit [Client Quit]
<datalurkur> Mon_Ouie: Yeah, that's basically it, except through Ruby.
<datalurkur> Hmm.
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<datalurkur> I suppose it's possible it's my build of Ruby.
<datalurkur> rvm has been acting kinda funky lately, I'll implode it and reinstall.
cableray has joined #ruby
<lupine> well, you can't guarantee that anything but lib/ and bin/ will be copied, but lib/ should only have .rb files
<lupine> what's the nature of the data? is it precomputed for speed, or...?
<Mon_Ouie> One random guess I have would be something related to GC.
Stormpath has joined #ruby
<gnarmis> I'm collecting info about all the git repo's in a local system
timonv has quit [Read error: Connection reset by peer]
<datalurkur> Mon_Ouie: Thought of that, but this variable hasn't gone out of scope. I'm kind of at a loss.
<gnarmis> kind of a simple little project
timonv has joined #ruby
_46bit has quit [Client Quit]
<lupine> sounds like it shouldn't be in the gem at all then
Neomex has joined #ruby
benlieb has quit [Client Quit]
<gnarmis> yeah right now it's a yaml file that's not in the gem
<lupine> if what you're storing in there is some representation of those git repos
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Neomex has quit [Client Quit]
d2dchat has quit [Remote host closed the connection]
pcarrier has joined #ruby
_46bit has quit [Client Quit]
<gnarmis> I want to be able to support things like listing all the github repo's that are behind their remotes
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
f0ster has quit [Ping timeout: 276 seconds]
h4mz1d has joined #ruby
<gnarmis> so, storing stuff in a sqlite db makes sense, for arbitrary queries I can't imagine yet
_46bit has quit [Client Quit]
nomenkun has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
ilyam_ has joined #ruby
kuzushi has joined #ruby
jtharris has quit [Quit: WeeChat 0.3.9.2]
ckrailo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
haxrbyte has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9.2]
fxhp has joined #ruby
ckrailo has joined #ruby
_46bit has quit [Client Quit]
<Spooner> datalurkur, I'd recommend using something like gosu/texplay rather than DerpyPNG if you want to build images. I'd be interested in seeing your game if it worked at the mo.
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
fxhp has left #ruby ["WeeChat 0.3.7"]
<datalurkur> Spooner: Yeah, I wrote DerpyPNG myself. Just hacked it together to have maps in place. I plan on, at some point, replacing a bunch of this stuff with legitimate extensions.
Proshot has joined #ruby
<datalurkur> I just *haaaaate* imagemagick
<datalurkur> I'll take a look at gosu/texplay
<Spooner> YEah, but that is like saying you don't like SUVs and refusing to ride a push-bike ;)
<datalurkur> I also plan on ripping out a bunch of the client/server socket stuff and replacing it with eventmachine.
<datalurkur> Because my threads spend a lot of time idling in the name of asynchronicity.
<Spooner> Idling doesn't hurt anyone, but yeah, client-server isn't a great solution.
<joshsmith> how do you get the last value in an orderedhash?
<joshsmith> ?
<Spooner> I mean sockets.
<joshsmith> there is no .last, is there?
ilyam has quit [Ping timeout: 276 seconds]
ilyam_ is now known as ilyam
AtoxIO has quit [Remote host closed the connection]
<ericwood> if it was ordered I'd assume it did enumerable stuffs
h4mz1d has quit [Ping timeout: 276 seconds]
wallerdev has quit [Quit: wallerdev]
<Spooner> joshsmith, hash.values.last
dmiller1 has joined #ruby
_46bit has quit [Client Quit]
AlbireoX`Laptop has joined #ruby
<datalurkur> Spooner: Because there are a lot of threads, and the sockets use nonblocking operations, those threads can't sleep and incur a lot of overhead doing context switching.
<joshsmith> Spooner: ah, thanks!
<joshsmith> I was just doing to_a.last
haxrbyte_ has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
<datalurkur> If I implemented something that *could* use blocking operations but still be asynchronous, it would save a lot of time.
<Spooner> to_a.last.last would work ;)
setient has quit [Ping timeout: 260 seconds]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
haxrbyte has quit [Ping timeout: 252 seconds]
<datalurkur> Example: 2 threads, 1 sleeping until there's data to send and the other performing blocking read operations on separate sockets.
doritostains has joined #ruby
<Spooner> Yeah, but it is a text-based game. I wouldn't worry too much about it grinding your machine into the ground.
<Spooner> Don't optimise unless it isn't fast enough.
AlbireoX has quit [Ping timeout: 252 seconds]
<datalurkur> Well, because the threads gadfly instead of sleeping, it uses 100% of the CPU all the time :P
_46bit has quit [Client Quit]
jds_ has quit [Remote host closed the connection]
wallerdev has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
mikekelly has joined #ruby
firewall has quit [Ping timeout: 248 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
<Spooner> Yes, but unless that matters (e.g. updating the screen is slow or network updates lag a lot) it doesn't actually matter.
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
echosystm has joined #ruby
_46bit has quit [Client Quit]
sepp2k has quit [Ping timeout: 248 seconds]
sepp2k1 has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<datalurkur> Spooner: It does if there are other things happening on the server.
<datalurkur> Sure, the game runs fine, but I haven't even begun to test it under load with a high number of users or a high number of objects.
<datalurkur> And as the number of client threads increase, the server performance does dip noticeably from the logs.
<Spooner> Fair enough.
<datalurkur> The game is still immature enough that refactoring isn't too much of a pain.
gnarmis has quit [Quit: gnarmis]
gnarmis has joined #ruby
kuzushi has quit [Read error: Operation timed out]
Dann2 has joined #ruby
Dann1 has quit [Ping timeout: 276 seconds]
billy_ran_away has quit [Ping timeout: 244 seconds]
_46bit has quit [Client Quit]
gnarmis has quit [Remote host closed the connection]
gnarmis has joined #ruby
timonv has quit [Remote host closed the connection]
<Spooner> Aye. I am actually wondering if it would run faster with graphics than text ;) Gosu (OpenGL) is pretty fast and I'm sure consoles can't absorb text as fast as we'd like them to. Anyway, your issues are not mine ;)
ngoldman has joined #ruby
kpshek has joined #ruby
<datalurkur> Spooner: Text translation stuff all happens client-side. Got a couple frontends in the works.
rezzack has joined #ruby
<datalurkur> Client/server IO is all metadata.
gnarmis has quit [Client Quit]
<Spooner> No, I meant the act of pushing a full screen of text out to replace the old one with curses or whatever.
scriabin has joined #ruby
<datalurkur> Ah.
kpshek has quit [Client Quit]
gnarmis has joined #ruby
gnarmis has quit [Client Quit]
gnarmis has joined #ruby
qubit has quit [Ping timeout: 255 seconds]
billy_ran_away has joined #ruby
gnarmis has quit [Client Quit]
gnarmis has joined #ruby
maletor has joined #ruby
gnarmis has quit [Client Quit]
<scriabin> would anyone care to refresh my memory on truth tables? how would you go about simplifying A ^ ((B ^ C) V (!B ^ C) V (!B ^ !C))
<scriabin> that may be the simplest form actually
<banisterfiend> scriabin: look up de morgan's laws
gnarmis has joined #ruby
nimred has quit [Quit: Lost terminal]
<Pip> yeah, morgan law
geekbri has quit [Remote host closed the connection]
gnarmis has quit [Client Quit]
qubit has joined #ruby
gnarmis has joined #ruby
Guest29624 has joined #ruby
jean-louis has quit [Ping timeout: 265 seconds]
gnarmis has quit [Client Quit]
gnarmis has joined #ruby
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
brianpWins has quit [Quit: brianpWins]
<cr3> anyone ever encountered this with Net::SSH: zlib(finalizer): the stream was freed prematurely.
<ericwood> laws de morgan
banister_ has quit [Read error: Connection reset by peer]
<mjolk> cr3 no, but i'm working with net::SSH now as well
<mjolk> have you found a good way to do the NET::SSH::KnownHost keys_for ?
<nooodl_> A AND ((NOT B) OR C), scriabin
<Spooner> scriabin, A ^ !(B ^ !C)
* nooodl_ thinks ^ is xor.
<cr3> mjolk: no, but that's certainly something I'll have to look into too
<Spooner> Oops.
<mjolk> gd it
<nooodl_> well, he meant AND, but i read it as xor because of programming languages
<Spooner> I assumed it was and and V was or.
datalurkur has left #ruby [#ruby]
<mjolk> cr3 i spent the better part of today hacking in some functionality as well, so i'll let you know when i push it to my gh
RubNoob has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
dankest has joined #ruby
<cr3> mjolk: that'd be really great, thanks!
nathancahill has quit [Quit: nathancahill]
<mjolk> like, allowing for you to pre-fetch && populate ssh fingerprints
<mjolk> much more secure than just accepting public keys by default
cobragoa_ has quit [Read error: Connection reset by peer]
cobragoa_ has joined #ruby
nomenkun has joined #ruby
willob has quit [Quit: Leaving.]
xemu has joined #ruby
Dann2 has quit [Quit: Dann2]
workmad3 has quit [Ping timeout: 264 seconds]
marty_mcfly has quit [Ping timeout: 245 seconds]
kenneth has quit [Ping timeout: 248 seconds]
hotovson has quit [Remote host closed the connection]
generalissimo has quit [Remote host closed the connection]
<scriabin> Spooner - I found wolfram alpha and got the same result - I don't understand how you did it. 20 years ago I did :)
mengu has joined #ruby
Daman has quit [Quit: u]
mengu has quit [Remote host closed the connection]
mengu has joined #ruby
<cr3> by the way, the finalizer message I was getting is because I had "Compression yes" in ~/.ssh/config. I think it's safe to remove that since I believe ssh compresses by default anyways
<Spooner> scriabin, ((B ^ C) V (!B ^ C) V (!B ^ !C)) is 3 of the 4 possible values that B and C can have. Thus !(the other possibility) simplifies it.
kil0byte has quit [Remote host closed the connection]
asteve has quit [Quit: Computer has gone to sleep.]
Rym has joined #ruby
kil0byte has joined #ruby
kil0byte has quit [Remote host closed the connection]
<scriabin> Spooner, so had it been ((B ^ C) V (!B ^ C) V (!B ^ !C) V (B & !C)) then it would simplify to B^C?
<scriabin> (all of the possibilities B and C can have)
nomenkun has quit [Ping timeout: 264 seconds]
<Spooner> scriabin, No, then it would simplify to just A
timonv has joined #ruby
<cr3> for quotes, I thought I should use '' unless I need to interpolate variables but the style guide seems to say otherwise: https://github.com/styleguide/ruby
tyfighter has joined #ruby
<mjolk> well, they even break it
<mjolk> when song.name == 'Misty'
lolcathost is now known as lolcathots
raulp has joined #ruby
<Spooner> cr3, It seems to be inconsistent even in itself on that one. I generally always use "" - It isn't like it is measurably slower (unless you are in a REALLY intense bottleneck).
Appineer has joined #ruby
<cr3> Spooner: do you ever use single quotes then?
<mjolk> i use single quotes
<Spooner> I do, but I usually regret it when later ;)
<mjolk> it prevents accidental f ups
AlSquire has quit [Read error: Connection reset by peer]
<mjolk> if you know it's not going to interpolate, why allow it
AlSquire has joined #ruby
libryder has left #ruby [#ruby]
<Spooner> I have more of those with single quotes when I want to add interpolation later and forget to change the quotes.
<mjolk> %s/'/"/g
<mjolk> :)
benlieb has joined #ruby
<Spooner> Taht would break "I like 'wholesome' pies" too though.
<mjolk> well, then don't use it if you refactor and can't remember
mengu has quit [Read error: Connection reset by peer]
emergion has joined #ruby
<Spooner> Thankyou for permission, mjolk ;)
mengu has joined #ruby
<mjolk> haha
<mjolk> glad to help
haxrbyte_ has quit [Read error: Connection reset by peer]
Appineer has left #ruby [#ruby]
banisterfiend has joined #ruby
kenneth has joined #ruby
kpshek has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
Daman has joined #ruby
Daman has quit [Changing host]
Daman has joined #ruby
beiter has quit [Quit: beiter]
Doc_X has quit [Remote host closed the connection]
datalurkur has joined #ruby
stkowski has joined #ruby
<datalurkur> Solved my problem. Turns out I'm an idiot.
griffindy has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<datalurkur> <- uses rvm but still leaves #!/usr/bin/ruby lying around in executable scripts
<datalurkur> Different ruby versions == different headers == bad times
sn0wb1rd has quit [Quit: sn0wb1rd]
<Spooner> At least that clears it up. We are all idiots, most of the time.
Rym has quit [Quit: Rym]
apeiros_ has joined #ruby
yxhuvud has joined #ruby
diegoviola has joined #ruby
<shevy> I have an array, array = [ "09.01.2013","29.12.2012","11.01.2013"]
sn0wb1rd has joined #ruby
<shevy> these are dates, in dd.mm.yyyy format
<shevy> hmm how would I sort this by last/first?
<Spooner> You are lucky for owning such a lovely array, sheerun
<Spooner> Oops, shevy.
datalurkur has left #ruby [#ruby]
<shevy> well the real array is more like "backup_09.01.2013" etc.. but I figured I need a way to sort them
mark_locklear has quit [Remote host closed the connection]
<Spooner> array.sort_by {|d| d.split(".").reverse }
nuzz has quit [Read error: Connection reset by peer]
<shevy> oh
<shevy> somehow I thought I'd have to use something Time-related
<shevy> but I think this works very well too, thanks Spooner
dumdedum has quit [Quit: KTHXBYE]
yxhuvud2 has quit [Ping timeout: 264 seconds]
<Spooner> Yeah, Time/Date would be more proper, I suppose.
<Spooner> But if it works...
<shevy> yeah. and the formats are all like that, all the time, so that will work :)
alfism has joined #ruby
<Spooner> See, I used "" around a non-interpolated string.
alfism has quit [Client Quit]
nkr has quit [Quit: Linkinus - http://linkinus.com]
hbpoison has quit [Ping timeout: 265 seconds]
<atmosx> guys
timonv_ has joined #ruby
pmros has joined #ruby
<atmosx> what's the diff between mit and bsd license?
timonv has quit [Read error: Connection reset by peer]
<pmros> hi!
nuzz has joined #ruby
<Spooner> separator = '.'; array.sort_by {|d| d.split("#{separator}").reverse } - better ;)
blacktulip has quit [Remote host closed the connection]
<shevy> atmosx no real idea... perhaps clause 4?
hbpoison has joined #ruby
<Hanmac> shevy: arry.sort_by{|s|DateTime.strptime(s,"%d.%m.%y") }
<shevy> waaaah
<shevy> that's harder to read
<atmosx> which is?
lolcathots is now known as Automorphism
<atmosx> I can read Hanmac's code actually easily :-P
<pmros> type error with eigenclass#instance_methods, why?
<atmosx> oh wait no I can't :-P, it's hard to read true
<atmosx> strptimes hmm didn't knew that method
<pmros> type error: can't convert nil to String
<Hanmac> pmros: which object?
sayan has quit [Ping timeout: 252 seconds]
Chryson has joined #ruby
<pmros> String
<pmros> String, Mahmac
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<pmros> Hanmac
<Hanmac> atmosx: its when parse is not working
<Spooner> Just means you trying to do nil.to_s somewhere. Hate that nil...
<atmosx> shevy: you this: Neither the name of <Owner Organization> nor the names of its
<atmosx> contributors may be used to endorse or promote products derived
<Hanmac> pmros: when you do someting wong, show us your code
<atmosx> from this software without specific prior written permission.
banisterfiend has quit [Ping timeout: 264 seconds]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
kirun has quit [Quit: Client exiting]
<pmros> eigenclass("").instance_methods, Hanmac
Nisstyre has quit [Quit: Leaving]
dankest has quit [Quit: Leaving...]
timonv has joined #ruby
<shevy> atmosx well
<pmros> eigenclass, you know
jgarvey has quit [Quit: Leaving]
Pip has quit [Ping timeout: 248 seconds]
samuel02 has quit [Remote host closed the connection]
<shevy> atmosx, the code was Spooner -> array.sort_by {|d| d.split(".").reverse } vs. Hanmac -> array.sort_by {|s| DateTime.strptime(s,"%d.%m.%y") }
_46bit has quit [Client Quit]
timonv_ has quit [Read error: Connection reset by peer]
iaj has joined #ruby
<shevy> hmm
<atmosx> shevy: yea hI'll take the 1st one
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Rym has joined #ruby
<atmosx> okay, I want to publish a database
samuel02 has joined #ruby
<shevy> yeah, for simple formats I think the first variant is better
<atmosx> but make it available for commercial use also, what should I choise?
<atmosx> choose
<shevy> what is the database
<apeiros_> atmosx: (joining late) are your dates "1.1.2000" or "01.01.2000"?
<shevy> it is written in ruby?
fflush has quit [Ping timeout: 240 seconds]
dankest has joined #ruby
<apeiros_> if the former, then Spooner's solution is wrong
<atmosx> apeiros_: my dates? no I'm not interested in dates I have a licensing issue
<shevy> apeiros_ hehe it was me, the format was dd.mm.yyyy good old european format
<apeiros_> ah, it was shevy's issue, I see
<atmosx> shevy: words, with data that can be used for sentiment analysis, profiling etc. It's an SQLite3 but if it grows big, it's a pretty good thing.
<apeiros_> shevy: well, not all europeans use leading zeros
_46bit has quit [Client Quit]
<Spooner> apeiros_, Don't piss on my chips :) My code is epic (and correct for this case, even if not all the cases it will never be used for).
<atmosx> it's gonna be very useful for open source projects using the greek lang etc.
_knitetemplar has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
ffranz1 has joined #ruby
<apeiros_> Spooner: I piss on everybody's chips :-p
doodlehaus has quit [Remote host closed the connection]
pmros has quit [Quit: Konversation terminated!]
sailias has quit [Quit: Leaving.]
AFlyingMonkey has joined #ruby
gridaphobe has quit [Remote host closed the connection]
<shevy> apeiros_ yeah but the dates I use are generated by my ruby script, I love to use leading 0 in dates, I consistently use this dd.mm.yyyy format everywhere, even in handwriting
banisterfiend has joined #ruby
<shevy> I shall personally slay everyone omitting the zeroes
gridaphobe has joined #ruby
_46bit has quit [Client Quit]
fred909 has joined #ruby
<Spooner> You should use yyyy-mm-dd so that you don't confuse our contrary Merican brothers and sisters.
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<Spooner> And so everything sorts properly without widdling about.
samuel02 has quit [Remote host closed the connection]
<shevy> ack
<interactionjaxsn> merican here, prefer yyyymmdd
<shevy> you guys not only use the reversed way, but also '-' rather than '.' ?
<shevy> hmm
<shevy> dd-mm-yyyy
<shevy> dd/mm/yyyy
<shevy> dd.mm.yyyy
<Spooner> That is the usual way of displaying it, as far as I am aware. In Euro dates it is usually 30/01/1999 anyway, not dots.
<shevy> I cant decide :(
<scriabin> https://gist.github.com/4514369 - ok truth table vanquished, and yet this code causes my app to crash and I can't tell why. It's in the boolean logic line. Anyone feeling charitable?
_46bit has quit [Client Quit]
<Spooner> No, it is dd/mm/yyyy mm/dd/yyyy or yyyy-mm-dd as far as I'm aware.
ffranz has quit [Ping timeout: 260 seconds]
<apeiros_> shevy: prefer iso8601 over our notation
nimred has joined #ruby
<apeiros_> (yyyy-mm-dd which Spooner suggested)
maxmanders has quit [Ping timeout: 265 seconds]
jlast has quit [Remote host closed the connection]
<apeiros_> I use it everywhere except in letters
tps_ has quit [Quit: tps_]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<Spooner> It just wins in every way except the fact that regular people will be confused by it. No, it wins in EVERY way ;)
<apeiros_> maybe I should start using it there too and just piss on people who fail to grasp the meaning :=
<apeiros_> :-)
ryanf has joined #ruby
walbert has left #ruby [#ruby]
ffranz1 has quit [Quit: Leaving]
generalissimo has joined #ruby
dr_neek has quit [Quit: dr_neek]
dustint has quit [Remote host closed the connection]
_46bit has quit [Client Quit]
<Spooner> apeiros_, Actually, for the hardcore, you can't beat putting it in the Federation calendar. Stardates are cool!
bean has quit [Quit: Computer has gone to sleep.]
<apeiros_> meh, stardates don't account for all 7 time dimensions.
TomyLobo has quit [Quit: Standby mode...]
maxmanders has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
s1n4 has quit [Quit: leaving]
graft has quit [Ping timeout: 265 seconds]
<Spooner> Yeah, but you get to use: http://www.hillschmidt.de/gbr/sternenzeit.htm
noxoc has quit [Quit: noxoc]
bradhe has joined #ruby
<banisterfiend> apeiros_: sup, u checked out "POODR"
_46bit has quit [Client Quit]
<apeiros_> banisterfiend: ¿como?
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
bean has joined #ruby
<Hanmac> apeiros_ how to use the 7 time dimensions? :D i am very interested :D
<apeiros_> Hanmac: what? you don't know the 7 time dimensions?!?!
otherj has joined #ruby
CLUSTERfoo has joined #ruby
_46bit has quit [Client Quit]
danieldocki has joined #ruby
<Hanmac> not yet
<Spooner> In truth, I've struggled with anything over 3 or 4.
<apeiros_> ah, right, you're not a chrononaut
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
c3vin has quit [Ping timeout: 240 seconds]
<Hanmac> apeiros_ ... they are coordinates used by the Doctor right?
the_jeebster has joined #ruby
<apeiros_> pfff, puny timelords
nimred has quit [Quit: Lost terminal]
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
graft has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
cjs226 has quit []
dr_neek has joined #ruby
danieldocki has quit [Client Quit]
_46bit has quit [Client Quit]
jds_ has joined #ruby
heyitsdave has joined #ruby
jsaak has quit [Remote host closed the connection]
dustint has joined #ruby
iaj has quit [Ping timeout: 252 seconds]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<banisterfiend> apeiros_: "practical object oriented design with ruby"
Morkel has quit [Quit: Morkel]
<apeiros_> banisterfiend: I rarely read. I haven'r read poodr
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
moos3 has joined #ruby
Umren|2 has quit [Read error: Connection reset by peer]
<banisterfiend> apeiros_: it's pretty interesting
jds_ has quit [Ping timeout: 246 seconds]
_46bit has quit [Client Quit]
anders_ has quit [Remote host closed the connection]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
jeffreybaird has quit [Quit: jeffreybaird]
theRoUS has quit [Ping timeout: 260 seconds]
jeffreybaird has joined #ruby
jeffreybaird has quit [Client Quit]
jlast has joined #ruby
jlast has quit [Remote host closed the connection]
ebobby has joined #ruby
jlast has joined #ruby
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
iaj has joined #ruby
zellio has joined #ruby
brianpWins has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
_46bit has quit [Client Quit]
nuzz has quit [Quit: leaving]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
kpshek has quit []
serhart has quit [Quit: Leaving.]
_nitti has quit [Remote host closed the connection]
horofox has quit [Quit: horofox]
<zellio> hello #ruby, quick question on namespaces: why is it that code block 1 nameerrors but code block 2 works in http://pastie.org/private/nfo3n7ajxpqxjqsr68hmnq
gnarmis has quit [Remote host closed the connection]
philcrissman has quit [Read error: Connection reset by peer]
bean has quit [Quit: Computer has gone to sleep.]
philcrissman has joined #ruby
gnarmis has joined #ruby
<apeiros_> what other scalar value classes does ruby (core/stdlib) have? nil, false, true, symbol, fixnum, bignum, float, string, date, time, datetime
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
_46bit has quit [Client Quit]
<ckrailo> zellio: because X is a module, not a class
<Hanmac> ckrailo wrong
<Hanmac> zellio because the X scope is not opened
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
clop has quit [Quit: Leaving]
Spami has quit [Client Quit]
<zellio> Hanmac: it's not? but i'm access it
<ckrailo> derp… sorry Hanmac. fuzzy-brain friday.
<apeiros_> zastern: p Module.nesting in both
kpshek has joined #ruby
<zastern> apeiros_: ah, yes, module nesting.
<apeiros_> a is [X::Z], b is [X, X::Z]
<zellio> mmm
<apeiros_> I think ruby will lookup relative to those
<apeiros_> not entirely sure on that, though
<zellio> that seems to be it
<apeiros_> and I have absolutely no clue on the reasons for the difference
<apeiros_> as in, the rationale
_46bit has quit [Client Quit]
jerius has quit [Ping timeout: 260 seconds]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
generalissimo has quit [Remote host closed the connection]
Automorphism has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
gnarmis has quit [Ping timeout: 260 seconds]
_46bit has quit [Client Quit]
kpshek has quit [Client Quit]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
nomenkun has joined #ruby
<otherj> anyone familiar with jekyll?
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Playground has joined #ruby
dustint has quit [Remote host closed the connection]
f0ster has joined #ruby
_46bit has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
brianpWins has quit [Read error: Connection reset by peer]
doritostains has quit [Quit: Leaving...]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
Divinite has left #ruby ["Leaving"]
brianpWins has joined #ruby
gnarmis has joined #ruby
_46bit has quit [Client Quit]
jds_ has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
nomenkun has quit [Ping timeout: 248 seconds]
Scriptonaut has joined #ruby
nathancahill has joined #ruby
_46bit has quit [Client Quit]
jsaak has joined #ruby
Coolhand|laptop has quit [Remote host closed the connection]
c3vin has joined #ruby
<scriabin> otherj still need help with jekyll?
<scriabin> I use octopress I may be able to assist
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
moos3 has quit [Quit: Computer has gone to sleep.]
perlsyntax has quit [Quit: Leaving]
templaedhe has joined #ruby
_46bit has quit [Client Quit]
<otherj> indeed
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
mdel has joined #ruby
<otherj> two things: with the permalink directive, what should one put for the site's root page so avoid having to link to / or /index.html?
<mdel> hey all - mind pointing me to where I might find help with installing rbenv globally?
<otherj> also, is it possible to make it not add the trailing / for those?
<zellio> Hanmac: thank you
<otherj> also, do I need to set url in config in order to use like {{ site.url }} on the page?
zph has joined #ruby
osaut has quit [Quit: osaut]
h4mz1d has joined #ruby
<otherj> this may have more to do with the templating engine than jekyll itself, now that I think about it
_46bit has quit [Client Quit]
ngoldman has quit [Remote host closed the connection]
templaedhel has quit [Read error: Connection reset by peer]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
MrPunkin has joined #ruby
Stormpath has quit [Quit: Stormpath]
<MrPunkin> say I have an array of hashes and want to add a key/val to every hash in that array. What's the fastest way to handle this?
<MrPunkin> just iteration?
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
zellio has left #ruby [#ruby]
jds_ has quit [Ping timeout: 260 seconds]
sailias has joined #ruby
_46bit has quit [Client Quit]
Stormpath has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<banisterfiend> MrPunkin: hash_array.each { |h| h[key] = value }
cr3 has quit [Quit: leaving]
GoGoGarrett has quit [Remote host closed the connection]
arpegius has joined #ruby
<MrPunkin> banisterfiend: okay just didn't know if there was a faster way
breakingthings has quit []
nimred has joined #ruby
<banisterfiend> MrPunkin: nup
SeoxyS has joined #ruby
yxhuvud2 has joined #ruby
kenneth has quit [Disconnected by services]
SeoxyS is now known as kenneth
templaedhe has quit [Ping timeout: 240 seconds]
<arpegius> what's the rubyest way to say 'is one of these keys a key in this hash' ……… is 'a' or 'c' one of the keys in hash {'a' => true, 'b' => false, 'c' => 'lemon'}
_46bit has quit [Client Quit]
AsgardBSD has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
thone_ has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
theRoUS has joined #ruby
theRoUS_ has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
LouisGB has quit [Ping timeout: 264 seconds]
kpshek has joined #ruby
<banisterfiend> arpegius: hash.keys.any? { |v| ['a', 'b].include?(v) }
_46bit has quit [Client Quit]
yxhuvud has quit [Ping timeout: 255 seconds]
<apeiros_> banisterfiend: waaaah?
<apeiros_> other way round please
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<apeiros_> O(n^2) vs. O(n)
ngoldman has joined #ruby
<ebobby> [].any? do |x| {}.key? x end
* apeiros_ pissing on chips again (see Spooner - I do it to everybody!)
danneu has joined #ruby
<arpegius> apeiros_: banisterfiend no that works
<Spooner> apeiros_, I appreciate the lack of being singled out.
c3vin has quit [Ping timeout: 240 seconds]
<apeiros_> arpegius: I didn't say that it wouldn't work
<apeiros_> arpegius: I say it's inefficient
thone has quit [Ping timeout: 252 seconds]
d2dchat has joined #ruby
<arpegius> is ebobby's more efficient?
_46bit has quit [Client Quit]
<apeiros_> arpegius: yes. and since you obviously didn't understand my 3rd line, you should read up on this: http://en.wikipedia.org/wiki/Big_O_notation
<ebobby> well, it will stop as soon as it finds any of the keys
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
<ebobby> and using key? is O(1) (theoretically) as opposed to includes
<ebobby> which is O(N)
<apeiros_> (to be more precise, banisterfiend's is O(n*m), not O(n^2))
<ebobby> so the original one would be O(N * M) a opposed to O(N)
bradhe has quit [Remote host closed the connection]
<ebobby> in the worst case is O(N) (when none of the keys is on the hash)
<ebobby> because it stops as soon as it finds one
huoxito has joined #ruby
_46bit has quit [Client Quit]
<banisterfiend> ['a', 'b'].any? { |v| hash.key?(v) }
<ebobby> yes
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
alanp has quit [Read error: Connection reset by peer]
<ebobby> doing it the other way around is throwing away the advantage of having a hash in the first place.
alanp has joined #ruby
macmartine has joined #ruby
rads has quit []
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
mengu has quit [Read error: No route to host]
joshman_ has quit [Ping timeout: 240 seconds]
<Spooner> And if you want the O(1) version: def has_key?(array, hash); rand(2) == 0 end
mengu has joined #ruby
MattRb has joined #ruby
_46bit has quit [Client Quit]
c3vin has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
reppard has joined #ruby
tenmilestereo has quit [Quit: Leaving]
_46bit has quit [Client Quit]
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
segv-_ has joined #ruby
gridaphobe has quit [Ping timeout: 244 seconds]
nathancahill has quit [Quit: nathancahill]
hbpoison has quit [Ping timeout: 248 seconds]
cjs226 has joined #ruby
ebobby has quit [Ping timeout: 248 seconds]
segv- has quit [Ping timeout: 256 seconds]
segv-_ is now known as segv-
_46bit has quit [Client Quit]
hbpoison has joined #ruby
awaage has joined #ruby
arpegius has quit [Quit: arpegius]
gyre007 has quit [Remote host closed the connection]
<apeiros_> if only sprintf was unicode aware :(
FifthWall has joined #ruby
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
IceDragon has joined #ruby
<Spooner> To be fair, unicode never returns sprintf's calls. Very rude.
serhart has joined #ruby
_46bit has quit [Client Quit]
otherj has quit [Quit: otherj]
kpshek has quit []
scriabin has quit [Quit: Page closed]
nfk has quit [Quit: yawn]
robotmay_ has joined #ruby
robotmay has quit [Read error: Connection reset by peer]
bean has joined #ruby
MattRb has quit [Quit: This computer has gone to sleep]
nfk has joined #ruby
bean has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
aytch has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
dmiller1 has quit [Ping timeout: 265 seconds]
nateberkopec has quit [Quit: Leaving...]
lightguard_jp has quit [Ping timeout: 252 seconds]
zph has quit [Quit: Computer has gone to sleep.]
peregrine81 has quit [Quit: Goodbye.]
Divinite has joined #ruby
<Divinite> How would I integrate jruby into an android application?
<Scriptonaut> Hey guys, if I open a file with IO.readlines, is there a way to overwrite the file with a similar array
<Scriptonaut> like writelines?
jjbohn has quit [Quit: Leaving...]
fumduq has quit [Ping timeout: 260 seconds]
rburton- has joined #ruby
rburton- has quit [Client Quit]
<Hanmac> Scriptonaut: IO.write(path,array.join("\n"))
robotmay_ has quit [Remote host closed the connection]
horofox has joined #ruby
<Scriptonaut> Hanmac: Will this clear the file, and then make the contents identical to array?
<Scriptonaut> what's the .join("\n") for?
ner0x has quit [Quit: Leaving]
<nooodl_> well, you can't write arrays to a file directly
<nooodl_> only strings
db_auto_crap has quit [Quit: Leaving]
robotmay has joined #ruby
<nooodl_> so you want to change it from ["1", "-hi-", "foo"] to "1\n-hi-\nfoo"
timonv_ has joined #ruby
timonv has quit [Read error: Connection reset by peer]
<Scriptonaut> Ah, I see
<Scriptonaut> That makes sense now
dreinull has quit [Remote host closed the connection]
cousine has joined #ruby
<Scriptonaut> Hmm, when I do it, it erases the entire file
Proshot has quit [Quit: Leaving]
tux91 has joined #ruby
jrist is now known as jrist-afk
<tux91> Did anybody ever had problems of rvm stuck at installing a rubie? It just sits there after the install command with no output, the terminal title is 'grep', perhaps it's stuck?
bradhe has joined #ruby
zph has joined #ruby
Mon_Ouie has quit [Ping timeout: 264 seconds]
<echosystm> ok ruby peeps
<echosystm> whats the easiest way to debug some ruby?
<echosystm> rubymine done goofed, cant get the shit working
Rym has quit [Quit: Rym]
<Spooner> Rubymine has a debugger built in (or rather it can integrate a debugger gem).
cableray has quit [Quit: cableray]
<echosystm> Spooner: see above
mjolk has quit [Quit: This computer has gone to sleep]
<echosystm> ive got all the needed gems, set my sdk/gemset, no dice
fumduq has joined #ruby
<echosystm> so now i just want something basic
<chiel> hmm.. anyone here use Pow while developing?
frem has quit [Read error: Operation timed out]
<banisterfiend> echosystm: http://pryrepl.org
<Spooner> echosystm, I used to have problems with it (the debugger in RM) but it "just works" nowadays. There isn't any real complexity to it and it installs the gem for you when you start it up.
<echosystm> banisterfiend: will this let me set breakpoints etc. ?
<banisterfiend> echosystm: with pry-debugger, yeah
<echosystm> intelesting
<banisterfiend> echosystm: also check out 'debugger', but pry integrates with that and gives it a cute front end
mmokrysz has joined #ruby
mmokrysz is now known as _46bit
malkomalko has quit [Remote host closed the connection]
<waxjar> i still mostly debug with puts. heh.
nomenkun has joined #ruby
d2dchat has quit [Remote host closed the connection]
<waxjar> check out letters though, it's p awesome http://lettersrb.com/. which i could remind myself to use it more
<chiel> hmm.. how does one rescue *all* errors again?
<echosystm> thankyou banisterfiend and Spooner
<banisterfiend> waxjar: step up to pry, it'll change your life
<echosystm> and waxjar
<blazes816> chiel: rescue Exception => e
<blazes816> I <3 using puts to debug but even better is having pry open so I can puts whatever I want
dankest has quit [Quit: Leaving...]
<waxjar> you mean the pry.binding stuff?
<blazes816> binding.pry, but yeah
<waxjar> i'll have to try that some time
<blazes816> it will change you
_nitti has joined #ruby
_46bit has left #ruby [#ruby]
<chiel> blazes816: ah, cheers :)
<chiel> i never used pry :p
<blazes816> not yet ;)
<chiel> i probably should, but don't understand it from the brief time i spent looking at it
Edward_ has joined #ruby
notwhoopseric has joined #ruby
<blazes816> chiel: think of it like an irb session, but you don't have to type/execute anything before your binding.pry
philcrissman has quit [Remote host closed the connection]
<Scriptonaut> nooodl_: I got it to almost work, however I need to to remove the rest of the file after the last line is written
<chiel> hm, shit.. i forgot i am inside a module :D, can't use rescue Exception => e it seems
<Scriptonaut> it's leaving a few lines from the documents before I made changes
<chiel> weird
<blazes816> chiel: why? is Exception shadowed? rescue ::Exception => e
zph has quit [Quit: Computer has gone to sleep.]
<nooodl_> Scriptonaut: are those old lines above the new ones?
<chiel> shouldn't be, i think the error was caused somewhere else. :)
vlad_starkov has joined #ruby
nomenkun has quit [Ping timeout: 255 seconds]
<nooodl_> Scriptonaut: might be because you're opening the file in "append" mode, instead of "write"
<notwhoopseric> Hey all, I know you can do array.map(&:foo), is there a way to do something like array.map(&:foo.bar)? (call foo then bar for each element)
timonv_ has quit [Read error: Connection reset by peer]
timonv has joined #ruby
<nooodl_> .map(&:foo).map(&:bar) sounds like the easiest way
<Scriptonaut> I'm opening with 'r+'
<echosystm> why do people always use foo and bar as examples?
<banisterfiend> notwhoopseric: array.map { |v| v.foo.bar }
<echosystm> where did foo bar come from
<Scriptonaut> when I opened with 'w+' it made the entire file empty
<echosystm> tell me internet
matthias_ has quit [Remote host closed the connection]
<Scriptonaut> the lines are at the very bottom
<banisterfiend> nooodl_:
_nitti has quit [Ping timeout: 264 seconds]
<notwhoopseric> nooodl_: banisterfiend: ok, thanks
autumn is now known as acpx
<banisterfiend> o = lambda { |c| c.foo.bar }; array.map(&:o)
twoism has quit [Read error: Connection reset by peer]
twoism_ has joined #ruby
Divinite has left #ruby ["Leaving"]
<nooodl_> ooh, banisterfiend's first solution is cleaner
<banisterfiend> no
<banisterfiend> that wont work
<banisterfiend> :{
<echosystm> why didn't they just say A and B?
<swarley> >> -> {|x| puts "Does it accept this style?" }.call
<eval-in> swarley: Output: "/tmp/execpad-44a210a7f785/source-44a210a7f785:1: syntax error, unexpected '|'\n-> {|x| puts \"Does it accept this style?\" }.call\n ^\n/tmp/execpad-44a210a7f785/source-44a210a7f785:1: syntax error, unex ..." (http://eval.in/6529)
<banisterfiend> nooodl_: &o
<echosystm> foobar is ridiculous
acpx is now known as autumn
<echosystm> ridicballs
<echosystm> spectoridiculum
<swarley> >> ->(x) { puts "Does it accept this style?" }.call(:foo)
<eval-in> swarley: Output: "Does it accept this style?\n" (http://eval.in/6530)
<swarley> That's what I thought
<chiel> blazes816: yea, i was just doing something stupid
<nooodl_> echosystm: pfff, who do you think we are, mathematicians?
<chiel> i should figure out the best way to do monitoring/logging
<chiel> i have to admit i have kinda sucked at that so far
_46bit has joined #ruby
<chiel> i want to make a change for the better
_46bit has left #ruby [#ruby]
<chiel> and i need to sort out my deploys with capistrano as well :'<
<chiel> so much to do, so little time
<echosystm> i think you should just drink wine instead
<chiel> hah :)
<echosystm> when life throws you a deadline, drink wine
<chiel> if only i liked wine! :D
Playground has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ruby
Nuck has quit [Read error: Operation timed out]
pkrnj has joined #ruby
<Scriptonaut> Hey guys, how do you open a file, write some stuff, and *then* truncate the remainder of the file?
<Scriptonaut> whenever I open with 'w+', it truncates as soon as I open
xnm has joined #ruby
MattRb has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
lolcathost has quit [Client Quit]
yxhuvud has joined #ruby
Nuck has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
Playground has joined #ruby
<nooodl_> Scriptonaut: sounds like you should change your workflow to:
tux91 has left #ruby [#ruby]
hbpoison has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
<nooodl_> read a file, manipulate the string/array of lines you got, then write it back, overwriting everything
Banistergalaxy has joined #ruby
jpfuentes2 has joined #ruby
vlad_starkov has quit [Ping timeout: 264 seconds]
<Scriptonaut> This is what I'm trying to do, however as soon as I open the file it erases the entire thing
<Scriptonaut> with 'w+' that is
yxhuvud2 has quit [Ping timeout: 248 seconds]
<nooodl_> hmmm
caemir has joined #ruby
<Scriptonaut> The modified string/array-of-lines is shorter than the original
<nooodl_> Scriptonaut: show me your code
<Scriptonaut> so there's going to be extra lines every time
malkomalko has joined #ruby
<shevy> Scriptonaut then use 'a+'
<heftig> you want r+
<heftig> a+ is the same, but starts you at the end of the file, which you probably don't want
<Scriptonaut> I've been doing r+
<Scriptonaut> however then I end up with extra lines
<Scriptonaut> is there a simple way to just erase everything in the file after a certain point
<Scriptonaut> when I use IO.write, the cursor will be pointing at the last line I will need to write
<Scriptonaut> do you just write 0's?
<Scriptonaut> nooodl_:
<heftig> truncate
<shevy> why do you use ; at the end of the lines
<Scriptonaut> I haven't coded Ruby in about a year
<shevy> also use the block form of File.open
<Scriptonaut> I jsut pulled it up really quickly last night to write a script for work
<Scriptonaut> I've been writing C, javascript, etc
<shevy> your poor brain having to mix different syntaxes :)
<heftig> eww code
<shevy> your ruby code looks extremely C-ish