apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p385: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
emmanuelux has quit [Quit: emmanuelux]
emmanuel__ has quit [Read error: Connection reset by peer]
atmosx has quit [Quit: And so the story goes…]
kpshek has quit []
ryanf has quit [Read error: Connection reset by peer]
theRoUS has quit [Ping timeout: 248 seconds]
daig0ro has quit [Quit: Computer has gone to sleep.]
emergion has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby
anonymuse has quit [Quit: Leaving.]
cableray has quit [Quit: cableray]
onemanjujitsu has joined #ruby
samphippen has joined #ruby
DrShoggoth has joined #ruby
pu22l3r has quit [Remote host closed the connection]
dallasm has quit [Remote host closed the connection]
mikeg has quit [Quit: Leaving]
aedorn has quit [Quit: Leaving]
LouisRoR has quit [Ping timeout: 246 seconds]
mcatch has quit [Quit: Leaving]
banisterfiend is now known as banister`sleep
sahbeewah has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
erlingur has quit [Quit: http://erlingur.is]
zigomir has quit [Quit: zigomir]
erlingur has joined #ruby
erlingur has quit [Client Quit]
reppard has quit [Ping timeout: 255 seconds]
erlingur has joined #ruby
yshh has joined #ruby
jerikl_ has joined #ruby
emocakes has quit [Quit: emocakes]
io_syl_ has joined #ruby
gp5st has joined #ruby
gp5st has left #ruby [#ruby]
DrShoggoth has quit [Ping timeout: 252 seconds]
io_syl has quit [Ping timeout: 276 seconds]
io_syl_ is now known as io_syl
hehehe has quit [Quit: hehehe]
relixx has quit [Quit: relixx]
angusiguess has quit [Ping timeout: 255 seconds]
swarley-freenode is now known as swarles
swarles is now known as swarley
apok has joined #ruby
c0rn has quit [Ping timeout: 246 seconds]
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
caleb_io has joined #ruby
AntiTyping has joined #ruby
DrShoggoth has joined #ruby
c0rn has joined #ruby
qpf has quit [Remote host closed the connection]
billiam has quit [Quit: Leaving]
fumduq has quit [Quit: die()]
fir_ed has joined #ruby
apok has quit [Quit: apok]
fumduq has joined #ruby
_nitti has joined #ruby
tcstar has quit [Ping timeout: 248 seconds]
DrShoggoth has quit [Ping timeout: 256 seconds]
mcatch has joined #ruby
<mcatch> Anyone mind helping me understand the point of gems and bundleconfigs? Is a bundle config simply a collection of gems?
Proshot has quit [Quit: Leaving]
etcetera has quit []
segv- has quit [Quit: segv-]
<jacktrick> a Gemfile is basically a collection of gems and their version
joshman_ has quit [Ping timeout: 246 seconds]
NiteRain has quit [Ping timeout: 246 seconds]
_nitti has quit [Ping timeout: 256 seconds]
pu22l3r has quit [Ping timeout: 276 seconds]
<jacktrick> when you run bundle install in the project directory it installs all the gems (and the particular version if you specify)
<jacktrick> you can also organise groups
<jacktrick> such as production, testing, development etc
<jacktrick> so in development you might be using SQLite as your database
thone_ has quit [Ping timeout: 264 seconds]
dmerrick_ has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
<jacktrick> but in production you could have PostgreSQL or MySQL
Xeago has quit [Quit: Page closed]
dmerrick_ has quit [Client Quit]
havenwood has joined #ruby
etcetera has joined #ruby
<jacktrick> mcatch^
karancho has quit [Read error: Connection reset by peer]
<mcatch> ok, so gems are just 3rd party ruby modules?
<mcatch> and a gemfile is sort of a directory for various gems and their version to be used
<jacktrick> pretty much
<mcatch> and a bundleconfig is various information for an "environment", such as a gemfile, database connections, etc
dmerrick has quit [Ping timeout: 244 seconds]
ephemerian has quit [Ping timeout: 276 seconds]
<mcatch> so the point of gems are to extend my application through the use of 3rd party libraries
jets has quit [Quit: Leaving]
<jacktrick> A gem is a 3rd party ruby library. Bundler is a gem that can manage gems using a Gemfile according to certain criteria
<jacktrick> yep
<mcatch> so bundler and gemfile go hand in hand? ie, bundler reads the gemfile?
thone has joined #ruby
<jacktrick> yep
<mcatch> makes sense. i come from a Windows + web development with MVC and Nuget background
<mcatch> so nuget is the equivalent of bundle it sounds like
<jacktrick> I'd never heard of it, but from a quick google, looks like. :D
mando has quit [Remote host closed the connection]
<mcatch> is there a sort of "global gem cache" for gems that aren't to be associated with any particular project?
<mcatch> ie: it looks like getting a gem puts it in my project dir, but maybe i want it to go to some global path on my pc instead?
innohero has quit [Quit: Leaving]
tvw has quit []
<jacktrick> gems get installed globally by default
<jacktrick> bundler just makes sure you have everything you needed
Xeago has joined #ruby
<jacktrick> so for example, you check out some project
bawigga has quit [Quit: Computer has gone to sleep.]
<jacktrick> you can just run a bundle install and it will make sure all the gems you ave are installed and the right version
<mcatch> gemfiles are associated with each project, right?
<mcatch> service as a list of dependencies that project needs
Edward_ has joined #ruby
<jacktrick> yup
greenysan has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
angusiguess has joined #ruby
hbpoison has joined #ruby
fir_ed has quit [Ping timeout: 246 seconds]
justinleitgeb has joined #ruby
dmiller has joined #ruby
guns has joined #ruby
Liquid-- has quit [Quit: Textual IRC Client: www.textualapp.com]
<mcatch> cool, thanks :)
cableray has joined #ruby
<jacktrick> np
<mcatch> i have lots of questions i'm sure, but i'll collect my thoughts and save them for another time
<jacktrick> this is a good place for them
zzing has joined #ruby
<mcatch> i use windows 99% of the time, but i'm getting tired of seeing all these cool new languages pop up and do awesome stuff on other operating systems, so i'm forcing myself to use linux and learn some ruby
greenysan has quit [Ping timeout: 276 seconds]
<mcatch> well, "relatively" new languages, that is
hbpoison has quit [Ping timeout: 246 seconds]
<jacktrick> heh, I was the same
<havenwood> mcatch: FreeBSD is pretty nice as a Linux alternative as well. :)
<jacktrick> eventually I found linux a lot easier to use than windows
<mcatch> i spend a lot of time gaming, so the transition to linux hasn't been as easy as i would like
karancho has joined #ruby
<zzing> As an exercise to learn Ruby, I am doing some parsing of weblogs with the ultimate goal of making queries on them. I could store everything in a single relational table, but I was wondering if there are other data stores that I might want to look at to generate webstats from.
<mcatch> driver compatibility + no OS support from most developers makes it a lot of switching back and forth
apok has joined #ruby
<jacktrick> the day I wrote an awk one-liner to handle some csv data instead of opening up a spreadsheet program was the day I uninstalled windows
<mcatch> haha :)
<jacktrick> then I wanted to play counter strike and had to wait to reinstall XD
<mcatch> zzing, are you looking to store on file system or in memor?
<mcatch> memory*
<zzing> mcatch, definitely on the file system.
<mcatch> sqlite is a very quick and easy thing to spin up and store data in
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
<mcatch> havenwood, currently using ubuntu, haven't tried anything else yet (ubuntu gives me that nice familiar usability that i'm used to with Windows)
<zzing> mcatch, I do have mysql installed so I can use that fairly easily.
angusiguess has quit [Ping timeout: 248 seconds]
<havenwood> mcatch: ya, i like Ubuntu too - have you taken a look at Mint? i was impressed and meant to give it another look
greenysan has joined #ruby
<jacktrick> ever since unity I've been using xubuntu
<jacktrick> the keyboard shortcuts out the box are fantastic
<mcatch> havenwood, when i was evaluating linux branches a few months back i was running a Windows 8 release candidate, and dual booting was very difficult. Mint was one of the boots that was not working for me, and ubuntu eventually did with a lot of extra work
Kuifje has quit [Ping timeout: 248 seconds]
<mcatch> i haven't gone back to look at Mint yet. ubuntu is starting to feel sort of clunky and heavy for me now
<mcatch> but i don't know enough about linux to provide for myself what ubuntu is probably doing behind the scenes
JamesF has quit [Ping timeout: 246 seconds]
<mcatch> ie: ubuntu is a small step down from windows, as it's probably holding my hand a lot
Chryson has joined #ruby
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
greenysan has quit [Ping timeout: 255 seconds]
<mcatch> disappointingly, my online buddies use ventrillo to chat, and there seems to be no official linux release of ventrillo. (says "under development" on their website)
rburton- has joined #ruby
<jacktrick> there may be a 3rd party effort somewhere
<mcatch> zzing, aside from a database backend, i'm not sure what other storage you'd need/be looking for as an alternative
<jacktrick> http://www.mangler.org/ looks somewhat promising
tcstar has joined #ruby
<mcatch> i'd say you have the right idea with the sql db
<jacktrick> although their motto is worrying. XD
<mcatch> lmao
sn0wb1rd has quit [Quit: sn0wb1rd]
joeycarmello has quit [Remote host closed the connection]
<mcatch> love the blatant recommendations to use alternatives
doug has left #ruby [#ruby]
<zzing> mcatch, should I be looking at anything beyond relational databases
<jacktrick> It seems from the homepage that if you want to set up a server, use mumble. Otherwise, mangler should be good enough.
<mcatch> zzing, i suppose the alternative would be literal file storage, but that seems too primitive unless your goal is to keep it that way
cisco has joined #ruby
thone_ has joined #ruby
<jacktrick> zzing, not unless you want to. so long as you can store and fetch the information you need that should be enough.
robotmay has quit [Remote host closed the connection]
tjbiddle_ has joined #ruby
Dreamer3 has joined #ruby
<mcatch> as an alternative to mysql, i still recommend sqlite due to its "lightweight" nature
<jacktrick> and the database is just a file, so backups are the easiest thing in the world
<zzing> mcatch, i need proper locking. Although postgres might be better for that.
ErsatzRyan has joined #ruby
onemanjujitsu has quit [Quit: onemanjujitsu]
tjbiddle has quit [Read error: Operation timed out]
thone has quit [Ping timeout: 264 seconds]
skattyadz has quit [Quit: skattyadz]
DrCode has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
<zzing> I should ask - is there a good standard library for prepared queries generalized over many SQL backends?
<apeiros_> sequel
<apeiros_> also datamapper & activerecord if an ORM is fine with you
<havenwood> +1 sequel
<apeiros_> RDBI
<jacktrick> datamapper :D
<zzing> sequel is a rather nice historic name :P
<jacktrick> although the documentation is pretty lacking in my experience
tjbiddle_ has quit [Ping timeout: 248 seconds]
<zzing> Documentation is something I must have decently
thone_ has quit [Ping timeout: 252 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
marr has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby
subbyyy has joined #ruby
jimeh has quit [Quit: Bye.]
<Es0teric> ok, theres a question i have to ask about ruby
<Es0teric> coming from a php background
<zzing> I am betting that the ruby equality operator is transitive.
<yfeldblum> Es0teric, ask away
<Es0teric> yfeldblum ok... how would you show web pages without using rails
<Es0teric> or rather... how does ruby work without rails... where do you store the files and run them
jimeh has joined #ruby
<Es0teric> infact, can you use ruby in the MVC way without rails?
<havenwood> Es0teric: A more minimalist Rack web framework is Sinatra: http://www.sinatrarb.com/
<yfeldblum> Es0teric, ruby, as a standard programming language, has got no underlying integration with Web or with Web pages ... this is a major difference from PHP
reppard has joined #ruby
coin3d has quit [Quit: coin3d]
<havenwood> Es0teric: Most Ruby web servers are Rack web servers. Likewise, there are a number of Rack web frameworks in Ruby.
ckrailo has quit [Quit: Computer has gone to sleep.]
<yfeldblum> Es0teric, there are a number of libraries and frameworks that you can use as an alternative to Rails, but you're going to want to go with one or another of them
<havenwood> Es0teric: Rails and Sinatra are both Rack web frameworks.
icole has quit [Remote host closed the connection]
<Es0teric> ok so what you're saying is that you cant build a web site without rails?
<havenwood> Es0teric: Then you'll hear of stuff like Unicorn, Passenger, Thin, Puma, Webrick, etc - those are Rack web servers.
pdamer has joined #ruby
<yfeldblum> Es0teric, because Ruby all by itself isn't built for rendering Web pages; it's just a normal programming language that you can build a Web framework on top of
<reppard> Es0teric: that is not what anyone is saying
<havenwood> Es0teric: are you trolling? :P
<Es0teric> havenwood nah man.. i am serious about these questions because i am learning ruby right now... i do OOP in PHP
<havenwood> Es0teric: You can build a web app with any of the Rack web frameworks (Rails included) or even non-Rack frameworks.
<Es0teric> so the difference is not that great... its easier for me to learn this stuff
cccman has joined #ruby
sn0wb1rd has joined #ruby
<Es0teric> havenwood, yfeldblum ok rack web frameworks
<Es0teric> got it
<havenwood> Es0teric: I'd suggest taking a look at alternative web servers to Rails just to familiarize with the concept of Rack web servers. Sinatra and Camping (maybe Cuba or Renee) would be good ones.
<Es0teric> but what can you do with just ruby alone?
mattbl has joined #ruby
<cccman> i suggest shutting the fuck up
<yfeldblum> Es0teric, there are many ways to get started with Ruby-without-Rails; Sinatra is good at that, for example
<yfeldblum> Es0teric, http://www.sinatrarb.com/
thone has joined #ruby
<Es0teric> well i have used sinatra
<Es0teric> with php
caleb_io has quit [Quit: caleb_io]
<Es0teric> i think thats what it was
<Es0teric> or maybe it was haml
cccman has quit [Client Quit]
<reppard> Es0teric: you can do alot with ruby alone
<yfeldblum> Es0teric, you can write simple Web apps with it in a single file, just to get the flavor of Ruby
<davidcelis> Es0teric: sinatra has nothing to do with php
<reppard> try writing scripts in ruby instead of bash
<davidcelis> Es0teric: sinatra is a ruby web development framework, like rails is
<yfeldblum> Es0teric, Sinatra is a great way to get started for the Web
<Es0teric> ok ok
<Es0teric> too much information being flooded right now
<Es0teric> ok, first thing is first
<Es0teric> what can you accomplish with just rails alone?
<Es0teric> i mean ruby
<Es0teric> not rails
<davidcelis> ruby is just a scripting language
<davidcelis> like python
<reppard> i just told you
<davidcelis> or perl
<havenwood> Es0teric: Turing complete language? Anything that is computable...
cisco has quit [Quit: Leaving.]
<reppard> if there is to much info at once, try reading a webpage
<yfeldblum> Es0teric, consensus: get started learning Ruby on the Web, using Sinatra (http://www.sinatrarb.com/)
<reppard> one line at a time
wr has quit [Quit: Leaving]
<reppard> you'll learn a lot...just by reading
<reppard> they make books too
<Es0teric> yfeldblum well... i just want to learn raw ruby for now
<reppard> holy shit
<davidcelis> Es0teric: http://tryruby.org/
<reppard> tryruby
<davidcelis> Es0teric: http://rubykoans.com
<yfeldblum> Es0teric, Ruby all by itself has very little facility or writing Web apps or showing Web pages; you can write command-line scripts with Ruby alone ...
<davidcelis> Es0teric: http://pine.fm/LearnToProgram/
kofno has quit [Remote host closed the connection]
<Es0teric> well i already have...
<reppard> you could write a mud in ruby
<Es0teric> teamtreehouse and lynda.com
<Es0teric> as well as codeacademy
<Es0teric> when it comes down to it
kofno has joined #ruby
<havenwood> Es0teric: Thousands of lines of Ruby are used to model F-35 flight instrumentation hardware and software, to run Twitter's front-end, and yesterday I wrapped someone's animated ascii art roflcopter into a gem for OS X with whoosh noises.
<davidcelis> reppard: node.js would be better for that
cpruitt has quit [Quit: cpruitt]
<havenwood> Es0teric: gem install roflcopter; roflcopter
<yfeldblum> Es0teric, part of the nice thing about PHP is that it has a lot of Web-related stuff baked into it; but in order to get Web-related stuff in Ruby, you need to add the Web-related stuff on top ... and there's a wealth of options to choose from (sinatra and rails, to take the two most popular)
moshee has quit [Ping timeout: 276 seconds]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
<havenwood> Es0teric: gem install nyancat; nyancat
<yfeldblum> Es0teric, so doing a Web-based project with Just Ruby Alone is rather difficult, and it's not something that can be explained in IRC
<Es0teric> yfeldblum well i was trying to gauge the difference
<Es0teric> thats all
<davidcelis> Es0teric: If you want to get into the nitty-gritty of Ruby, but still write for the web, just use Rack
Aiur has quit [Quit: Computer has gone to sleep.]
<yfeldblum> Es0teric, so typically you'll use Ruby for the language, and something else like Sinatra or Rails for the Web stuff
Xeago has quit [Remote host closed the connection]
<Es0teric> i see, yfeldblum and davidcelis
<Es0teric> but i have another question
<yfeldblum> Es0teric, they're not smushed together like they are in PHP
<Es0teric> is it possible to build pub/sub apps in ruby?
<yfeldblum> Es0teric, yes
<Es0teric> what attracted me to ruby was the syntax
<davidcelis> Es0teric: Ruby itself is just like any other scripting language when you get down to it. You can write desktop applications, shell scripts, web applications, mobile applications
<Es0teric> its so freakin clean
<davidcelis> you can write whatever you want dude
goldenwest has left #ruby [#ruby]
<davidcelis> of course you can write a pub/sub app
freakazoid0223 has joined #ruby
apok has quit [Quit: apok]
<davidcelis> people have already done it
<Es0teric> so real time apps
zeade has quit [Quit: Leaving.]
<Es0teric> can be created in ruby
<yfeldblum> Es0teric, right
<davidcelis> Es0teric: yes, typically using EventMachine
<reppard> havenwood: thank you referencing nyancat. i've never seen that
<havenwood> Es0teric: you can compile Ruby to C, embed it in a LUA VM, run it on RPython, 3d apps, erlang-style telephony, encryption, nyancat, etc.
<Es0teric> hmm
<Es0teric> this makes all that time i invested in php look like a waste of time
<Es0teric> ruby is alot more flexible
<mcatch> not at all
<mcatch> php is very powerful, and built for more of a purpose
<mcatch> a purpose that it succeeds very well at
jerikl_ has quit [Quit: jerikl_]
<davidcelis> mcatch: wordpress?
<jrabbit> powerful in a bigger gun to blow off your foot sense
<Es0teric> i do like php though... thats my primary language
<spaceships> the more languages you know the easier it is to learn new ones...
<mcatch> Es0teric, you can say the same thing about python, as you can with ruby
gcoderre has joined #ruby
<mcatch> you could have "wasted" your time with php when python was out there, too
<Es0teric> mcatch yeah i was thinking about learning python but i chose ruby instead
<Es0teric> and i know raw javascript
<Es0teric> so the dot syntax is rediculously easy to understand
<Es0teric> i just have to memorize the essential methods
<yfeldblum> Es0teric, it's best to learn many languages (including Ruby of course!)
johnpcamara has joined #ruby
<Es0teric> yfeldblum yeah, i am trying to do that
<unstable> Does anyone know a way to do the USACO algorithms training in ruby?
<yfeldblum> Es0teric, well then keep on going :D
<Es0teric> also, yfeldblum you said something about EventMachine
<Es0teric> what exactly is that?
<yfeldblum> Es0teric, i didn't mention it, but EventMachine is a popular tool for writing non-blocking network daemons, like nodejs
onemanjujitsu has joined #ruby
ferdev is now known as ferdev|away
<yfeldblum> Es0teric, for writing such network daemons in Ruby
<yfeldblum> Es0teric, it's a very different way of thinking about how to write your program
<Es0teric> so it makes ruby act like node?
<Es0teric> because i know some nodejs
daig0ro has joined #ruby
nfk has quit [Quit: yawn]
<yfeldblum> Es0teric, in some ways, yes, but it doesn't turn ruby into nodejs
<Es0teric> yfeldblum well i figured that
x82_nicole has joined #ruby
<Es0teric> i would think it simulates what nodejs does
<Es0teric> which is very cool
marco has joined #ruby
<yfeldblum> Es0teric, it's a library/framework for writing non-blocking network daemons
<Es0teric> yfeldblum so basically, its possible to push information
<Es0teric> correct?
<yfeldblum> Es0teric, i'm not sure what you man by that
<Es0teric> like what pusher does, yfeldblum
<reppard> i have nyaned for 367 seconds
<reppard> beat that!
<havenwood> reppard: ROFL
joeycarmello has joined #ruby
<Es0teric> havenwood whats that nyan gem again?
<reppard> gem install nyancat
<yfeldblum> Es0teric, certain methods in that example are recognized as hook methods that EventMachine calls when data is available, sort of like Nodejs event callbacks
idkazuma has joined #ruby
<Es0teric> and how would i activate it after its installed, havenwood ?
daig0ro has quit [Client Quit]
<reppard> im looking at the source of this amazing gem right now
<Es0teric> ah i see yfeldblum
<havenwood> Es0teric: gem install nyancat; nyancat
chrishough has quit [Quit: chrishough]
<reppard> i can't wait to ssh into someones box at work and rob their tmux session with nyancat
d2dchat has joined #ruby
<Es0teric> but yfeldblum i wouldnt really be using that as a chat server
lifestream has joined #ruby
<Es0teric> i would be using it more for notifications
lifestream has left #ruby [#ruby]
jacktrick has quit [Quit: Leaving]
<yfeldblum> Es0teric, it's an example of a simple EventMachine-based app, just to get a flavor
<Es0teric> yeah, i understand yfeldblum
<havenwood> Es0teric: Very interesting Ruby evented IO library: https://github.com/celluloid/celluloid-io
kofno has quit [Remote host closed the connection]
<yfeldblum> Es0teric, so EventMachine is like the Nodejs model, and Celluloid is like the Erlang model; so there are plenty of options to choose from
<Es0teric> i think the one thing i have to get used to is... no parenthesis and {}
<Es0teric> plus semi colons
<Es0teric> i see, yfeldblum
<Es0teric> alright alright
x82_nicole has quit [Read error: Connection reset by peer]
idkazuma has quit [Ping timeout: 255 seconds]
<havenwood> Es0teric: And Agent is like the Go model: https://github.com/igrigorik/agent
<Es0teric> havenwood alright, i see
gcoderre has quit [Quit: gcoderre]
mibitzi has joined #ruby
nari has joined #ruby
yshh has quit [Remote host closed the connection]
melty has quit [Remote host closed the connection]
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
chrishough has joined #ruby
Norrin has joined #ruby
Norrin has left #ruby [#ruby]
PanPan_ has joined #ruby
kofno has joined #ruby
elaptics is now known as elaptics`away
x82_nicole has joined #ruby
angusiguess has joined #ruby
stopbit has joined #ruby
jlebrech has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
caleb_io has joined #ruby
nari has quit [Ping timeout: 240 seconds]
<Es0teric> man thats cool as hell... you can chain commands like in javascript
daniel_- has quit [Quit: WeeChat 0.3.9.2]
angusiguess has quit [Ping timeout: 252 seconds]
nfk has joined #ruby
<havenwood> Es0teric: method chaining ftw
thone_ has joined #ruby
<Es0teric> indeed havenwood
emergion has joined #ruby
thone has quit [Ping timeout: 248 seconds]
ErsatzRyan has quit [Remote host closed the connection]
chrishunt has joined #ruby
nga4 has quit [Ping timeout: 264 seconds]
thone_ has quit [Ping timeout: 252 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
jblack has joined #ruby
dallasm has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
nfk has quit [Quit: yawn]
NiteRain has joined #ruby
meoblast001 has joined #ruby
thone has joined #ruby
alexturner has joined #ruby
reppard has quit [Ping timeout: 276 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
<alexturner> Lads and Ladies, trying to get some old code written for 1.8 on my machine with 1.9.3 installed. Trying to optimise the app to run though I seem to be getting some Gem errors. Does this make sense to anyone? /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- initializer (LoadError)
mattbl has quit [Quit: This computer has gone to sleep]
adeponte has quit [Remote host closed the connection]
robscott has joined #ruby
<alexturner> .
ninegrid has quit [Ping timeout: 255 seconds]
johnpcamara has quit [Quit: johnpcamara]
onemanjujitsu has quit [Quit: onemanjujitsu]
rakl has quit [Quit: sleeping]
Hanmac1 has joined #ruby
[rupee] has quit [Quit: Leaving]
dallasm has quit [Remote host closed the connection]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
davidokner has quit [Quit: Lost terminal]
BrindleFly_ has joined #ruby
BrindleFly has quit [Read error: Operation timed out]
BrindleFly_ is now known as BrindleFly
Hanmac has quit [Ping timeout: 264 seconds]
DrShoggoth has joined #ruby
hadees has quit [Read error: Connection reset by peer]
hadees_ has joined #ruby
AntiTyping has quit [Quit: AntiTyping]
<mcatch> alexturner,
joeycarmello has quit [Remote host closed the connection]
mcatch has quit [Quit: Leaving]
etcetera has quit []
qpf has joined #ruby
bradleyprice has joined #ruby
jonahR has joined #ruby
greenarrow has quit [Quit: IRC is just multiplayer notepad]
arya_ has quit [Read error: Connection reset by peer]
reppard has joined #ruby
arya has joined #ruby
qpf has quit [Remote host closed the connection]
DrShoggoth has quit [Ping timeout: 256 seconds]
ninegrid has joined #ruby
rakl has joined #ruby
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
johnpcamara has joined #ruby
ahokaomaeha has joined #ruby
mockra has quit [Remote host closed the connection]
ninegrid has quit [Ping timeout: 252 seconds]
ninegrid has joined #ruby
havenwood has quit [Ping timeout: 264 seconds]
recycle has joined #ruby
charliesome has joined #ruby
adkron_ has joined #ruby
baphled has quit [Ping timeout: 276 seconds]
rburton- has quit [Quit: Linkinus - http://linkinus.com]
davidokner has joined #ruby
<davidokner> I'm going through the Sinatra book. People should know not to try to install the web servers mentioned in the book, because the gems don't work.
ninegrid has quit [Read error: Operation timed out]
johnpcamara has quit [Quit: johnpcamara]
<davidokner> Specifically, the web servers "Mongrel" and "Thin".
<yfeldblum> davidokner, thin works fine
<jblack> Hi. I'm trying ot set dynamic method calls into a subclass without much success. The idea is that I can dynamically inject code into my class by using included and method.call. I have sample code of what I'm trying to do at: http://codepad.org/iEtOvmNY
baphled has joined #ruby
<davidokner> yfeldblum: It installed for you, but the gem has a fault so it won't install for everybody.
<jblack> I have 2 classes, Parent and Child. Parent has an add_runner method. I have a module with 2 methods, included, and replaceampersand (that's the real work)
<jblack> however, line 7, base.add_runner(:start, method(:replaceampersand))
<jblack> gripes that undefined method `add_runner' for Child:Class (NoMethodError)
ffranz has quit [Quit: Leaving]
tylersmith has quit [Quit: tylersmith]
ninegrid has joined #ruby
<yfeldblum> jblack, in 6, `base` is a class; in 16, add_runner is an instance method, not a class method
<jblack> I have definitely been confused on instance methods vs. class methods.
<jblack> Ok, so I should be using extend instead of include?
bricker_ has joined #ruby
caleb_io has quit [Quit: caleb_io]
ctult_ has joined #ruby
bricker_ is now known as bricker`LA
johnpcamara has joined #ruby
havenwood has joined #ruby
pdamer has quit [Quit: pdamer]
<jblack> How do I get the intsance that I'm including into? self seems to be the module itself, and if base is just the class method..
stormetrooper has quit [Quit: Leaving]
chrishunt has quit [Quit: zZzZzZ...]
etcetera has joined #ruby
quest88 has joined #ruby
etcetera has quit [Client Quit]
johnpcamara has quit [Quit: johnpcamara]
rcosta has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
arya has quit [Ping timeout: 248 seconds]
erlingur has quit [Quit: Computer has gone to sleep.]
yakko has quit [Quit: No Ping reply in 180 seconds.]
angusiguess has joined #ruby
yakko has joined #ruby
arya has joined #ruby
evenix has joined #ruby
banister`sleep has quit [Remote host closed the connection]
onemanjujitsu has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
hadees_ has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
reppard has quit [Ping timeout: 256 seconds]
Dwarf has quit [Ping timeout: 246 seconds]
qpf has joined #ruby
arya has quit [Ping timeout: 260 seconds]
arya has joined #ruby
d2dchat has quit [Remote host closed the connection]
baba has joined #ruby
toekutr has quit [Remote host closed the connection]
arya_ has joined #ruby
adeponte has joined #ruby
havenwood has quit [Remote host closed the connection]
cobragoat has quit [Remote host closed the connection]
Spooner has quit [Quit: Leaving]
robscott has quit [Quit: robscott]
alexturner has quit [Quit: alexturner]
dallasm has joined #ruby
arya has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby
kmurph has quit [Quit: kmurph]
dallasm has quit [Remote host closed the connection]
bradleyprice has quit [Ping timeout: 256 seconds]
dallasm has joined #ruby
<zzing> If I have a language construct like rule(:weblog) { ... } what type of construct is :weblog? (sample from Parslet code)
evenix has quit [Ping timeout: 248 seconds]
arya_ has quit [Ping timeout: 252 seconds]
bradleyprice has joined #ruby
arya has joined #ruby
fedza has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
onemanjujitsu has quit [Quit: onemanjujitsu]
zzing has quit [Quit: Computer has gone to sleep.]
onemanjujitsu has joined #ruby
thone has quit [Ping timeout: 252 seconds]
thone has joined #ruby
chrishough has quit [Quit: chrishough]
arya_ has joined #ruby
arya has quit [Ping timeout: 256 seconds]
hmarr has joined #ruby
Proshot has joined #ruby
Targen has joined #ruby
kennyvb has quit [Read error: Operation timed out]
kennyvb has joined #ruby
wallerdev_ has joined #ruby
arya has joined #ruby
Dwarf has joined #ruby
juco has quit [Read error: Operation timed out]
juco has joined #ruby
wallerdev has quit [Read error: Operation timed out]
wallerdev_ is now known as wallerdev
etcetera has joined #ruby
mnaser has quit [Read error: Operation timed out]
pu22l3r has joined #ruby
erry has quit [Read error: Operation timed out]
erry has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
RailWolf has quit [Read error: Operation timed out]
adkron_ has quit [Ping timeout: 255 seconds]
RailWolf has joined #ruby
adeponte has quit [Remote host closed the connection]
statarb3 has quit [Ping timeout: 256 seconds]
arya_ has quit [Ping timeout: 248 seconds]
mnaser has joined #ruby
arya_ has joined #ruby
arya has quit [Ping timeout: 244 seconds]
hadees_ has joined #ruby
<unstable> (1..(num - 1)).select { |i| i.prime? }; How long would it take to find all the primes for 600851475143?
hadees has quit [Ping timeout: 248 seconds]
hadees_ is now known as hadees
main has joined #ruby
billiam has joined #ruby
banister`sleep has joined #ruby
SirRamonGabriel has joined #ruby
PanPan has quit [Read error: Connection reset by peer]
PanPan has joined #ruby
rking has joined #ruby
reset has quit [Ping timeout: 276 seconds]
adkron_ has joined #ruby
<unstable> ahh, I found a good sieve implementation
<unstable> damn, if you don't optimize it really well for big numbers.. is just rapes my processor and gives me no results.
<charliesome> unstable: a long time
wf2f has joined #ruby
zzing has joined #ruby
ThePicard has joined #ruby
xbayrockx has quit [Ping timeout: 256 seconds]
<unstable> That is the most optimal algorithm I've found so far.
banister`sleep has quit [Ping timeout: 248 seconds]
<zzing> unstable, which sieve is that
joeycarmello has joined #ruby
<unstable> zzing: It's from scriptol.org
<unstable> Even with this sieve, it's killing my processor.
Vert has quit [Ping timeout: 252 seconds]
ThePicard has quit [Client Quit]
joeycarm_ has joined #ruby
<unstable> I can't get all the primes up to 600851475143
ThePicard has joined #ruby
arya_ has quit [Read error: Connection reset by peer]
<unstable> Perhaps I should just download a list, then load it into an array and do what I want with that.
arya has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
_nitti has joined #ruby
<zzing> unstable, why are you doing up to n? If you are doing this: break if p * p > n you might as well only do it up to the sqrt of n
BrindleFly has quit [Quit: BrindleFly]
joeycarmello has quit [Ping timeout: 276 seconds]
mahmoudimus has joined #ruby
forced_request has quit [Read error: Connection reset by peer]
pkircher has quit [Quit: pkircher]
arya has quit [Ping timeout: 252 seconds]
joeycarm_ has quit [Remote host closed the connection]
<unstable> It works fine up until 10 million
<unstable> Once I add digits onto that, it falls apart.
graft_ has quit [Read error: Connection reset by peer]
pskosinski has quit [Quit: Drama warning: http://pawelk.pl/quinton-reeves]
adkron has joined #ruby
perdent has joined #ruby
CamonZ has joined #ruby
CamonZ has quit [Remote host closed the connection]
arya has joined #ruby
dcwu has joined #ruby
nga4 has joined #ruby
<perdent> I just started learning Ruby yesterday and I was wondering if it's possible to put an if/else statement inside of another if/else statement For instance: http://pastebin.com/UL6ERpUL
<adkron> perdent: yes, but it is generally accepted as a bad practice if it can be avoided. It leads to complex code with many paths.
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
tylersmith has joined #ruby
cobragoat has joined #ruby
SirRamonGabriel has quit [Remote host closed the connection]
<perdent> adkron: What is the best approach then?
<zzing> unstable, of course it does. That sieve is only good up to that point.
jamescarr has joined #ruby
arya has quit [Ping timeout: 248 seconds]
JumpMast3r has quit [Quit: JumpMast3r]
hmarr has joined #ruby
karancho has quit [Quit: Saliendo]
arya has joined #ruby
<unstable> zzing: What is the best sieve for up to 700 billion?
dmiller has quit [Ping timeout: 252 seconds]
<adkron> perdent: I think it would be at least a little better to wrap these things in methods.
qpf has quit [Remote host closed the connection]
<zzing> unstable, I don't know if Atkin would be appropraite, but you could try it: http://en.wikipedia.org/wiki/Sieve_of_Atkin
qpf has joined #ruby
graft_ has quit [Ping timeout: 245 seconds]
<zzing> Perhaps better with this one: http://en.wikipedia.org/wiki/Sieve_of_Sundaram it is O(n log n) operations and O(n) on memory - should be easier on memory than atkin
<adkron> perdent: It really just helps clarify your code.
arya has quit [Ping timeout: 255 seconds]
Proshot has quit [Ping timeout: 248 seconds]
graft_ has joined #ruby
graft_ has joined #ruby
graft_ has quit [Changing host]
dmiller has joined #ruby
mattbl has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
<zzing> unstable, you could also check out this: http://stackoverflow.com/questions/453793/which-is-the-fastest-algorithm-to-find-prime-numbers But I would be wondering why you are using ruby for prime number testing. You would likely have better luck with C++ or something native (unless you are using one of the native ruby compilers)
etcetera has quit [Ping timeout: 252 seconds]
_nitti has quit [Remote host closed the connection]
pu22l3r has quit [Remote host closed the connection]
justinleitgeb has quit [Remote host closed the connection]
arya has joined #ruby
SolidResolve has quit [Ping timeout: 276 seconds]
graft_ has quit [Ping timeout: 244 seconds]
<adkron> perdent: consider if you need that many paths through your code. Do you need to tell the user it was the password that was wrong. Would it work just as well to say the combination is bad.
graft_ has joined #ruby
jamescarr has quit [Quit: jamescarr]
Targen has quit [Read error: Operation timed out]
thufir_ has quit [Quit: Leaving.]
huoxito has joined #ruby
jamescarr has joined #ruby
* daemoen kicks himself
quest88 has quit [Quit: quest88]
jamescarr has quit [Ping timeout: 256 seconds]
<lectrick> Why does Ruby work like this? http://hastebin.com/fisetaxibu.rb
adeponte has joined #ruby
<apeiros_> because method_missing
<apeiros_> it'd not make sense to treat `thing = 5` as a method call.
<lectrick> apeiros_: method_missing makes that work? really?
<apeiros_> no
<apeiros_> you want `thing = 5` to be a method call.
<apeiros_> that makes no sense.
<apeiros_> it'd break locals.
<apeiros_> one reason being method_missing.
<lectrick> so thing by itself on a iine uses the "thing" reader, but thing = 5 by itself on a line doesn't use the "thing" writer, but creates a local var instead? and to set it via the writer I have to use self.thing = 5?
<apeiros_> yes
<lectrick> apeiros_: OH.
<lectrick> I see now. Well jeez
idkazuma has joined #ruby
<lectrick> So why not make all accessors need to be called on self? why does "thing" by itself on a line still work by calling the reader?
<apeiros_> yes, `thing` calls the method. except if you shadow it with a local
<apeiros_> in that case, you must use explicit syntax. that is, either `thing()`, or `self.thing`
<apeiros_> the latter won't work with private methods
<apeiros_> but if you shadow methods with locals, then you only have yourself to blame :)
* apeiros_ off
<lectrick> apeiros_: no kidding. i found code that used a local named the same as an accessor and I was like wtf
<lectrick> I avoid that automatically to avoid the ambiguity
icole has joined #ruby
mockra has joined #ruby
tylersmith has quit [Quit: tylersmith]
rakl has quit [Quit: sleeping]
chendo_ is now known as chendo
arya has quit [Ping timeout: 255 seconds]
otters has joined #ruby
<jblack> I just can't seem to find an easy way to tell an instance the names of the methods just loaded by include
mattbl has quit [Quit: This computer has gone to sleep]
mattbl has joined #ruby
l3o has joined #ruby
qpf has quit [Ping timeout: 264 seconds]
mattbl has quit [Client Quit]
thone has quit [Ping timeout: 276 seconds]
arya has joined #ruby
thone has joined #ruby
jfl0wers has quit [Ping timeout: 248 seconds]
thone has quit [Read error: Operation timed out]
l3o has quit [Quit: Saliendo]
senayar has joined #ruby
arya has quit [Ping timeout: 260 seconds]
dmiller has quit [Ping timeout: 276 seconds]
Aiur has joined #ruby
dnordstrom has joined #ruby
icole has quit [Remote host closed the connection]
Aiur has quit [Client Quit]
yshh has joined #ruby
lifestream has joined #ruby
lifestream has left #ruby [#ruby]
arya has joined #ruby
yshh has quit [Read error: Connection reset by peer]
thone has joined #ruby
yshh has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
reset has joined #ruby
main has quit [Ping timeout: 240 seconds]
dallasm has quit [Remote host closed the connection]
jamescarr has joined #ruby
arya has quit [Ping timeout: 256 seconds]
charliesome has quit [Ping timeout: 246 seconds]
w|t has quit [Ping timeout: 246 seconds]
mattbl has joined #ruby
charliesome has joined #ruby
crackfu has joined #ruby
arya has joined #ruby
micaeked has joined #ruby
techlife has quit [Ping timeout: 252 seconds]
pac1 has quit [Ping timeout: 245 seconds]
onemanjujitsu has quit [Quit: onemanjujitsu]
icole has joined #ruby
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
yshh_ has joined #ruby
zeade has joined #ruby
yshh has quit [Ping timeout: 240 seconds]
techlife has joined #ruby
kofno has quit [Remote host closed the connection]
Vektur has joined #ruby
cparen has joined #ruby
yshh_ has quit [Remote host closed the connection]
<Nom-> Is it adviseable to use ObjectSpace? I saw some warnings about it being horrible performance under JRuby, so wasn't sure if it's a good idea to use in MRI?
thone has quit [Ping timeout: 252 seconds]
SolidResolve has joined #ruby
cableray has quit [Ping timeout: 276 seconds]
chendo has quit [Ping timeout: 244 seconds]
jblack has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
whitedawg has joined #ruby
pu22l3r has joined #ruby
mattbl has joined #ruby
_nitti has joined #ruby
arya has quit [Ping timeout: 244 seconds]
perdent has quit [Ping timeout: 245 seconds]
cableray has joined #ruby
banister`sleep has joined #ruby
cawaker has quit [Quit: Linkinus - http://linkinus.com]
havenwood has joined #ruby
ryanf has quit [Ping timeout: 240 seconds]
fedza has quit [Ping timeout: 260 seconds]
_nitti has quit [Ping timeout: 248 seconds]
arya has joined #ruby
kmurph has joined #ruby
browndawg has joined #ruby
banister`sleep has quit [Ping timeout: 276 seconds]
dagnachew has joined #ruby
kmurph has quit [Client Quit]
thone has joined #ruby
palyboy has quit [Ping timeout: 276 seconds]
w|t has joined #ruby
w|t has quit [Changing host]
w|t has joined #ruby
dagnachew has quit [Quit: Leaving]
pu22l3r has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
techlife has quit [Ping timeout: 245 seconds]
havenwood has joined #ruby
chussenot has joined #ruby
chussenot has quit [Client Quit]
rcosta has quit [Remote host closed the connection]
therod has joined #ruby
hadees has quit [Read error: Connection reset by peer]
staafl has joined #ruby
hadees has joined #ruby
chussenot has joined #ruby
ryanf has joined #ruby
havenwood has quit [Ping timeout: 276 seconds]
chussenot has quit [Client Quit]
staafl has quit [Read error: Connection reset by peer]
<unstable> What is an efficient way to find all the factors of a number that is a ~600 billion integer?
kofno has joined #ruby
techlife has joined #ruby
bttf has quit [Remote host closed the connection]
<unstable> def factors() (1..self).select { |n| (self % n).zero? } end
<unstable> Something better than that.
arya has quit [Ping timeout: 248 seconds]
haxrbyte has joined #ruby
aedornm has joined #ruby
dmiller has joined #ruby
haxrbyte_ has joined #ruby
<micaeked> unstable: Use a sieve to find the primes between n and sqrt(n). That will give you all the potential prime factors. After filtering, if you want all the factors (not just prime), check multiples.
<micaeked> unstable: err... between 1 and sqrt(n)
kmurph has joined #ruby
arya has joined #ruby
tcstar has quit [Ping timeout: 246 seconds]
haxrbyte has quit [Ping timeout: 255 seconds]
haxrbyte_ has quit [Remote host closed the connection]
<zzing> There are also primaility testers that may be better if you are trying to determine if a number that size is in fact a prime number
haxrbyte has joined #ruby
oscardelben has joined #ruby
dmiller has quit [Ping timeout: 255 seconds]
kojul has quit [Quit: kojul]
robscott has joined #ruby
robscott has left #ruby [#ruby]
ryanf has quit [Quit: leaving]
JumpMast3r has joined #ruby
arya has quit [Ping timeout: 260 seconds]
tcstar has joined #ruby
etcetera has joined #ruby
spaceships has quit [Quit: leaving]
thone has quit [Read error: Operation timed out]
etcetera has quit [Client Quit]
<Es0teric> wow...
<Es0teric> you can chain sooo many things
<Es0teric> this shit is crazy
arya has joined #ruby
techlife has quit [Ping timeout: 272 seconds]
<unstable> Why does mathn dump crap to my pry terminal?
<unstable> /75B
<unstable> Stuff like that.
thone has joined #ruby
mcqueenorama has joined #ruby
arya has quit [Ping timeout: 255 seconds]
tk_ has joined #ruby
techlife has joined #ruby
arya has joined #ruby
graft_ has quit [Read error: Connection reset by peer]
idiocrash has joined #ruby
<idiocrash> GUISE
<idiocrash> So I'm learning ruby
<idiocrash> When creating classes, do you find yourself frequently using the initialize method to call other methods on the class to govern the existing of your objects spawned from your class?
<idiocrash> like, you kinda end up writing a sort of pseudo language
jamescarr has quit [Quit: jamescarr]
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
<idiocrash> I was just curious if that was something others did as well
<unstable> idiocrash: I do that.
lusory has quit [Quit: leaving]
<idiocrash> cool! I just sort of naturally started doing that
<idiocrash> but, apparently not just me
zzing has quit [Quit: Computer has gone to sleep.]
dnordstrom has quit [Ping timeout: 246 seconds]
senayar has quit [Quit: Quitte]
dnordstrom has joined #ruby
fwaokda has joined #ruby
cantbecool has joined #ruby
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
Umren has joined #ruby
arya has quit [Ping timeout: 255 seconds]
angusiguess has quit [Ping timeout: 244 seconds]
cantbecool has quit [Client Quit]
mattbl has quit [Quit: This computer has gone to sleep]
arya has joined #ruby
plotter has quit [Ping timeout: 246 seconds]
mattbl has joined #ruby
megha has joined #ruby
joeycarmello has joined #ruby
Evixion` has joined #ruby
Evixion` has quit [Client Quit]
baba has quit [Ping timeout: 252 seconds]
jfl0wers_ has joined #ruby
flip_digits has joined #ruby
icole has quit [Ping timeout: 264 seconds]
chendo_ has quit [Ping timeout: 248 seconds]
icole has joined #ruby
megha has quit [Quit: WeeChat 0.4.0]
browndawg has quit [Ping timeout: 264 seconds]
caleb_io has joined #ruby
joeycarmello has quit [Ping timeout: 256 seconds]
chendo_ has joined #ruby
whitedawg has quit [Quit: Leaving.]
baba has joined #ruby
kmurph has quit [Quit: kmurph]
browndawg has joined #ruby
bradleyprice has quit [Remote host closed the connection]
Fretta has quit [Quit: Fretta]
dmerrick has joined #ruby
Dcr has joined #ruby
meoblast001 has quit [Remote host closed the connection]
whowantstolivefo has quit [Quit: who wants to live forever ?]
<shevy> idiocrash usually I dont need to create many other objects, except for the main script in a large project
<shevy> I do tend to re-use common methods on my objects however, especially "reset" (restore the object to the default state again) and "run" (start the main action of that object)
<idiocrash> reset is a convention you use?
<shevy> yeah
<idiocrash> huh, I like that idea
<shevy> do you have an example how you use initialize() btw?
dmerrick has quit [Quit: dmerrick]
mattbl has quit [Quit: This computer has gone to sleep]
<idiocrash> uh, take like... a class called GuessingGame
<idiocrash> methods might be:
<idiocrash> greet_player
<idiocrash> get_player_guess
<idiocrash> check_player_guess
<idiocrash> if player_won? exit
<idiocrash> ...etc
<shevy> sounds like what I do inside of run() :)
<shevy> I used to have initialize methods like this:
<shevy> def initialize(name, age)
<shevy> @name = name; @age = age
<shevy> for very small classes I still do that, but in general I hate to modify @ivars via simple assignment alone
<idiocrash> for very small classes, do you also use attr_accessible ?
<shevy> yeah
<shevy> if I need to modify that @ivar
<shevy> if I dont need to modify it, then of course I wont use it
<shevy> but in my experience, often enough I need to do sanity checking before I assign to an @ivar
frogstarr78 has quit [Remote host closed the connection]
<shevy> and attr_* does no sanity checking (logically)
kmurph has joined #ruby
<shevy> so you would then have methods, like:
<shevy> def foo=(i)
<idiocrash> Sorry, I meant to say attr_accessor
<shevy> raise 'We need a Room Object.' unless i.is_a? RoomObject
<shevy> @foo = i
<shevy> end
Dcr has left #ruby ["Leaving"]
<shevy> yeah idiocrash, same reason for all attr* helpers really
<idiocrash> ooh, I like
<shevy> no sanity checking makes for limited use
therod has quit [Quit: Leaving...]
fgro has joined #ruby
<shevy> take ARGV for instance
<shevy> it is the same in every ruby object
<shevy> in the past, I used to have things like this:
<shevy> def bla
<shevy> @lalala = ARGV[0]
<shevy> end
<shevy> lateron I changed things towards
<shevy> def bla(i = ARGV[0])
<shevy> @lalala = i.to_s.dup # usually, depends. ARGV is tainted input.
<shevy> end
<shevy> usually some more sanity checking, before the assignment actually
huoxito has quit [Ping timeout: 245 seconds]
<shevy> I tend to only do: "@foo = input" - at this time, the input is sanitized
sterk has joined #ruby
oscardelben has quit [Quit: oscardelben]
crackfu has quit [Remote host closed the connection]
<shevy> Nom- you can use ObjectSpace fairly easily
zzing has joined #ruby
NiteRain has quit [Remote host closed the connection]
baba has quit [Quit: WeeChat 0.4.0]
<shevy> results = ObjectSpace.each_object(String)
<shevy> put results.next
<shevy> put results.next
<shevy> put results.next
<shevy> :D
<shevy> man this is so useless...
joeycarmello has joined #ruby
dmiller has joined #ruby
<Nom-> I know it's easy to use
<Nom-> But *should* I use it :P
<Nom-> Although I think I've worked out my segfault isn't coming from not cleaning up objects (yet)
joeycarmello has quit [Ping timeout: 264 seconds]
techlife has quit [Ping timeout: 252 seconds]
zzing has quit [Ping timeout: 245 seconds]
mattbl has joined #ruby
techlife has joined #ruby
inokenty has joined #ruby
cableray has quit [Quit: cableray]
fgro_ has joined #ruby
cobragoat has quit [Remote host closed the connection]
baba has joined #ruby
fgro has quit [Ping timeout: 255 seconds]
PanPan has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
baba has quit [Quit: WeeChat 0.4.0]
baba has joined #ruby
PanPan has joined #ruby
kmurph has quit [Quit: kmurph]
<shevy> Nom- you should use it when you would need it
<shevy> in general I find the need to traverse through ObjectSpace very rare
<shevy> x = "foo"; ObjectSpace._id2ref x.object_id # => "foo"
<shevy> if anyone has more examples with ObjectSpace, let me know
mattbl has quit [Quit: This computer has gone to sleep]
frewsxcv has joined #ruby
<frewsxcv> How do you call initialize on a singleton?
nari has joined #ruby
arya has quit [Ping timeout: 276 seconds]
arietis has joined #ruby
angusiguess has joined #ruby
<frewsxcv> is there a more official way than 'initalize'?
<shevy> frewsxcv you usually do not call initialize directly
<shevy> you use .new which first calls allocate() as far as I know, which then calls initialize()
mattbl has joined #ruby
<frewsxcv> i don't think you call .new on singletons
<shevy> how do you create them?
Hanmac1 is now known as Hanmac
chendo_ has quit [Ping timeout: 252 seconds]
<shevy> ah
<shevy> class Foo; include Singleton; end; foo = foo.instance
<frewsxcv> that still doesn't call the constructor though
mattbl has quit [Client Quit]
<shevy> there is only one instance allowed
arya has joined #ruby
dmiller has quit [Ping timeout: 248 seconds]
<frewsxcv> i'm aware. that's the purpose of a singleton
whowantstolivefo has joined #ruby
<shevy> yeah
x82_nicole has quit [Read error: Connection reset by peer]
<shevy> you wrote the constructor is not called
mattbl has joined #ruby
<shevy> but then how can @ivars be set?
angusiguess has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby
<frewsxcv> by constructor, i mean 'initialize()'
<shevy> yes I know
<shevy> I also just tried and your statement that the constructor is not called is not correct
<shevy> require 'pp'; require 'singleton'; ; class Foo; include Singleton; ; def initialize; @foo = 'test'; end; ; end; ; foo = Foo.instance; pp foo #<Foo:0xb749a3d8 @foo="test">
<shevy> one ; too many
Jon30 has quit [Ping timeout: 260 seconds]
<shevy> awww
<shevy> more than ; too many ...
<shevy> next time I use a pastie :\
kmurph has joined #ruby
x82_nicole has joined #ruby
havenwood has joined #ruby
joeycarmello has joined #ruby
jwang has joined #ruby
hadees has quit [Ping timeout: 245 seconds]
mattbl has quit [Quit: This computer has gone to sleep]
hadees has joined #ruby
joeycarmello has quit [Ping timeout: 240 seconds]
fgro_ has quit [Ping timeout: 255 seconds]
ananthakumaran has joined #ruby
baba has quit [Quit: WeeChat 0.4.0]
shock_one has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
cparen has quit [Quit: cparen]
irchub has joined #ruby
icole has quit [Remote host closed the connection]
greenysan has joined #ruby
zigomir has joined #ruby
zeen has joined #ruby
havenwood has quit [Ping timeout: 260 seconds]
rezzack has quit [Quit: Leaving.]
kmurph has quit [Quit: kmurph]
kmurph has joined #ruby
generalissimo has quit [Remote host closed the connection]
swex has joined #ruby
ericmathison has joined #ruby
hackerdude has quit [Remote host closed the connection]
swex_ has quit [Ping timeout: 248 seconds]
mcqueenorama has quit [Remote host closed the connection]
micaeked has quit [Quit: WeeChat 0.4.0]
idkazuma has quit [Remote host closed the connection]
techlife has quit [Ping timeout: 276 seconds]
Chryson has quit [Ping timeout: 248 seconds]
joeycarmello has joined #ruby
rohit-sharma has joined #ruby
toekutr has joined #ruby
nomenkun has joined #ruby
Pufferfood has joined #ruby
idkazuma has joined #ruby
joeycarmello has quit [Ping timeout: 246 seconds]
techlife has joined #ruby
<sterk> Hi, I need to write a hash to a human-readable, ruby-executable file. I have this http://ideone.com/5Vn7Qg (2 lines), and it works, but it does not look very good (codewise). Are there any prettier ways of doing this?
arya has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 255 seconds]
horrror has joined #ruby
<sterk> (the puts is only there for demonstartion, it's the string building code i want looked at)
<rohit-sharma> can anyone please guide me on how to integrate eventmachine in rails
lkba has quit [Ping timeout: 244 seconds]
<shevy> sterk: require 'pp'; pp hash
<shevy> I think there is also awesome_print, which may allow that kind of styling
<shevy> and I also think the PP module allows for specific formatting, but I am unsure how (never needed that level of control, normal pp was usually enough)
<shevy> hmm let's see in PP
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
subbyyy has quit [Ping timeout: 256 seconds]
<shevy> here is awesome print btw, has more docu than PP :P https://github.com/michaeldv/awesome_print
<sterk> shevy: Thanks! That made it a lot easier :)
frewsxcv has left #ruby ["Leaving"]
arya has joined #ruby
Umren has quit [Read error: Connection reset by peer]
caleb_io has quit [Quit: caleb_io]
adeponte has quit [Remote host closed the connection]
<shevy> aha
<shevy> sterk, it seems as if pp adds a method to objects
<shevy> %w( abc def ghi ).pretty_print_inspect # => "["abc", "def", "ghi"]"
<shevy> seems as if pp then calls that new method, unless I am mistaken
<shevy> so that is probably why require 'pp' is not included by default
<shevy> hmmmm or perhaps not, I wonder how p alone does that.....
<sterk> Oh, thats handy. But, I'm taking a look at awesome_print due to the formatting options
<shevy> %w( abc def ghi ).pretty_inspect # => "["abc", "def", "ghi"]\n"
<shevy> quite odd
<shevy> yeah
angusiguess has joined #ruby
<shevy> I think pretty print has formatting options too, but it has typical shitty online documentation
<shevy> oh stackoverflow haha %w( abc def ghi ).pretty_print_inspect
<shevy> oops
nari has joined #ruby
arya has quit [Ping timeout: 252 seconds]
toekutr has quit [Remote host closed the connection]
<shevy> PP.pp(hash, $>, 39)
<shevy> hehe
<shevy> what the heck is $>
etcetera has joined #ruby
carraroj has joined #ruby
irchub has quit [Quit: node-irc says goodbye]
caleb_io has joined #ruby
<shock_one> shevy, STDOUT?
adeponte has joined #ruby
<shevy> hmm
etcetera has quit [Client Quit]
<shevy> oh
<shevy> how odd
<shevy> it seems to be the same as $stdout
<shevy> thanks shock_one
BlankVerse has joined #ruby
therod has joined #ruby
naquad has quit [Remote host closed the connection]
<BlankVerse> why there is no getc in standard library?
<Hanmac> shevy $<
caleb_io has quit [Quit: caleb_io]
<shock_one> BlankVerse, STDIN.getc
one has joined #ruby
zzing has joined #ruby
<BlankVerse> shock_one: it needs to have a new line , how to make it stop accepting any input after the first character
adeponte has quit [Remote host closed the connection]
kmurph has quit [Read error: Connection reset by peer]
marr has joined #ruby
kmurph has joined #ruby
therod has quit [Ping timeout: 256 seconds]
rakm has quit [Ping timeout: 255 seconds]
joeycarmello has joined #ruby
zeepickler has joined #ruby
pyrac has joined #ruby
braoru has joined #ruby
rakm has joined #ruby
zeepickler has left #ruby [#ruby]
<shock_one> BlankVerse, seems like it works if you disable buffering. Try it STDIN.sync = false
Agis__ has joined #ruby
<shevy> shock_one is a man who knows ruby fairly well :)
Agis__ has quit [Client Quit]
<BlankVerse> shock_one: doesnt work in irb?
<shock_one> shevy, no, I just remember that in C++ you have to disable buffering for this thing, so I did some googling
<shock_one> BlankVerse, works sometimes, I don't understand the logic. Looks like you have to disable sync before each getc
banister`sleep has joined #ruby
<BlankVerse> shock_one: even that doesn;t work "inside" irb!!
joeycarmello has quit [Ping timeout: 276 seconds]
banister`sleep has quit [Remote host closed the connection]
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rakl has joined #ruby
banister`sleep has joined #ruby
browndawg has quit [Ping timeout: 252 seconds]
<shock_one> BlankVerse, sometimes it returns '\n' as soon as I press enter
<BlankVerse> it shouldn;t be this hard in a language ... almost every sane language has getc in "standard" library
<shock_one> BlankVerse, here is Matz's answer http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/2999
<shevy> BlankVerse tried IO.getc yet?
elkclone has joined #ruby
<shock_one> BlankVerse, Oh yeah, it works!
gosshedd has joined #ruby
<shevy> hmmmm
ericmathison has quit [Quit: Page closed]
<shevy> now there was some other way to do that too
<shevy> without system()
anderse has joined #ruby
<BlankVerse> shevy: which one?
one has quit []
<BlankVerse> shock_one: which one?
<shock_one> system("stty raw -echo")
one has joined #ruby
<shevy> BlankVerse not sure... but I think there is a library that does that
<shevy> perhaps highline library?
whitedawg has joined #ruby
<BlankVerse> shevy: I am using that currently
LouisRoR has joined #ruby
<BlankVerse> shevy: but its awkward to increase dependencies just for using a function as trivial as getc
tjbiddle has joined #ruby
<BlankVerse> shock_one: that is a hack , not every stdin is a tty!
<shock_one> BlankVerse, I agree.
<shevy> well you can check for that at least, if $stdout.tty?
<Es0teric> oh shit that nyancat actually pops up
<Es0teric> on the terminal
<Es0teric> lol
zzing has quit [Ping timeout: 276 seconds]
end_guy has quit [Ping timeout: 276 seconds]
rdark has joined #ruby
jgrevich has quit [Remote host closed the connection]
icole has joined #ruby
PanPan_ has quit [Quit: ChatZilla 0.9.89 [Firefox 18.0.2/20130201065344]]
end_guy has joined #ruby
maxmanders has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
hbpoison has joined #ruby
io_syl has quit [Ping timeout: 255 seconds]
icole has quit [Ping timeout: 276 seconds]
anderse has quit [Quit: anderse]
io_syl has joined #ruby
Pufferfood has quit [Read error: Operation timed out]
anderse has joined #ruby
joeycarmello has joined #ruby
yakko has quit [Remote host closed the connection]
Pufferfood has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
billiam has quit [Ping timeout: 256 seconds]
anderse has quit [Client Quit]
Cork has joined #ruby
joeycarmello has quit [Ping timeout: 256 seconds]
elkclone has quit [Ping timeout: 245 seconds]
dcwu has quit [Quit: Leaving.]
elkclone has joined #ruby
elkclone has quit [Read error: Connection reset by peer]
prtksxna has joined #ruby
browndawg has joined #ruby
icole has joined #ruby
alexturner has joined #ruby
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
d34th4ck3r has joined #ruby
<d34th4ck3r> what does underscore do in ruby? I mean if _c=2 then what is c ? and what does it represent?
alexturner has quit [Client Quit]
rohit-sharma has left #ruby ["Leaving"]
<shock_one> d34th4ck3r, it's just yet another character. _c and c are different variables
<shock_one> d34th4ck3r, it usually means that a variable is part of implementation and shouln'd be accessible from the outside
havenwood has joined #ruby
b6 has joined #ruby
<d34th4ck3r> shock_one: thanks
<b6> is there an idiom for getting values from nested hashes when you're not sure all the keys exist? like h[a][b][c] when you're not sure h.has_key?(a), etc.
<shock_one> d34th4ck3r, no problem
ahokaomaeha has quit [Ping timeout: 252 seconds]
statarb3 has joined #ruby
<shock_one> b6, just test for nil afterwards.
<b6> shock_one: yeah, i can do it, i just mean it's ugly.
<b6> surely there's an elegant way.
relixx has joined #ruby
<shock_one> b6 what do you want it to do?
zigomir_ has joined #ruby
<b6> shock_one: it's just, you end up with code like if r0 = h[a] and r1 = r0[b] and r2 = r1[c]
<b6> or you repeat the lookups over and over.
<b6> there's probably something like tap that only continues the execution if the previous result was nonnil.
kidoz has quit [Remote host closed the connection]
<prtksxna> b6: Will it make the querying easier if you use rassoc?
<shock_one> b6, there is a try method if you use rails
<b6> prtksxna: dunno, lemme read about that. never heard of it.
zigomir has quit [Ping timeout: 252 seconds]
zigomir_ is now known as zigomir
codecop has joined #ruby
<shock_one> b6, some languages allow you to call methods on nil, like Objective C or SmallTalk, but not Ruby. You can also rescue NoMethodError but I don't think you're going to like it.
<prtksxna> shock_one: rescuing on NoMethodError, reminds me of that presentation on Ruby and JS called "wat"
<prtksxna> :D
<shock_one> prtksxna, can you give me a link?
havenwood has quit [Remote host closed the connection]
joeycarmello has joined #ruby
adambeynon has joined #ruby
pyrac has quit [Quit: pyrac]
<prtksxna> shock_one: Hope you lol
<shock_one> prtksxna, it's hilarious, it there full version?
joeycarmello has quit [Ping timeout: 256 seconds]
<prtksxna> shock_one: I think that's it. I haven't found a longer version...
<unstable> weee
<unstable> I'm running a calculation that is going to take all night.
<unstable> time to sleep
adeponte has joined #ruby
Xeago has joined #ruby
Jeaye has quit [Quit: zzzZZZzzz]
<b6> ./how_much_i_dont_like_oprah.rb
* b6 waits years for result
<b6> i hope i have enough ram.
<shock_one> => 42
ycy has joined #ruby
Jackneill has joined #ruby
<b6> shock_one: i don't think you understand how i feel about oprah.
joeycarmello has joined #ruby
<shock_one> b6, it's about long calculations http://en.wikipedia.org/wiki/42_(number)#The_Hitchhiker.27s_Guide_to_the_Galaxy
<prtksxna> Very very long.
adeponte has quit [Ping timeout: 240 seconds]
<b6> oh, duh. sorry. i should have known.
idkazuma has quit [Remote host closed the connection]
joeycarmello has quit [Ping timeout: 276 seconds]
<b6> i ended up making a Hash#by_path(*keys).
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
hmarr has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
uxp has quit [Ping timeout: 252 seconds]
uxp has joined #ruby
arietis has joined #ruby
Villadelfia has quit [Remote host closed the connection]
SeySayux has quit [Remote host closed the connection]
idkazuma has joined #ruby
shock_one has quit [Remote host closed the connection]
jerikl has quit [Ping timeout: 248 seconds]
prtksxna has quit [Quit: leaving]
<epitron> b6: i made the reverse of that at some point
<epitron> Hash#mkdir_p
<epitron> :D
<epitron> it's an easy way of converting things into trees
<b6> oh yeah, i can see how that'd be cool for configs or whatever.
<epitron> i was using it to turn module/class names in objectspace into trees
<epitron> Module::Module::Module::Class
rakl has quit [Quit: sleeping]
<epitron> Module::Module::Module::Class2
<epitron> Module::Module::Module::Class3
<epitron> just split on the ::, and shove it into mkdir_p
<epitron> are you working on json?
<epitron> is that why you have to query hashes like that?
hmarr has quit [Quit: Computer has gone to sleep.]
idkazuma has quit [Ping timeout: 248 seconds]
<b6> epitron: yeah, i do happen to be working on a hash made from json.
<epitron> i was working on something a while back for querying hashes easier
<epitron> freebase has a cool method called MQL
<epitron> it's really simple -- you query databases using a json template
poseid has joined #ruby
horrror has quit [Quit: horrror]
<b6> hmm, sounds interesting.
<epitron> the template is just a json object, but if the values of any keys are left blank, it tries to fill that in
ferdev|away is now known as ferdev
<epitron> so, if i said, {artist: "Jimi Hendrix", album: null}, it would return all of jimi's albums
<epitron> and the results would be {artist:, album:} documents
<epitron> you can also nest them
BryanWB has joined #ruby
<epitron> {artist: {firstname: "Jimi"}, album: null}
<BryanWB> does thin run well on top of jruby?
<b6> that's interesting, i never thought about using json like that.
<epitron> err
<epitron> {artist: {firstname: "Jimi", lastname: null}, album: null}
<epitron> that would return everyone named jimi :D
eka has joined #ruby
<banister`sleep> b6: you're very lucky, epitron hardly ever talks here it's an honor
<epitron> banister is full of it
<BryanWB> and will a sinatra app w/ thin + jruby scale fairly well? by fairly well, i mean to about 10-20 concurrent users
<banister`sleep> epitron: sup chick
<epitron> b6: anyhow, if you're interested, i've got some code :D
<epitron> it's not finished tho
<b6> BryanWB: i don't have a ton of experience, but i think the answer to both questions is yes.
<b6> epitron: gimme your github.
<epitron> epitron
<epitron> :D
<b6> thanks.
<BryanWB> b6, awesome i shud probably move kibana to jruby then, less config headache
colonolGron has joined #ruby
<poseid> hmm .. I am looking for a way to get [1,2] into { 1 => 2 }
<b6> BryanWB: sanity check before you do too much work, i'm going from my memories.
<poseid> Hash[...]
<poseid> works but when I have { 1 => 2 }.to_a
<b6> epitron: wow, mql is already a thing.
<banister`sleep> epitron: thinking about going to amsterdam today
<epitron> b6: yeah, that's how you query freebase.com
hmarr has joined #ruby
<poseid> this: a = {1 => 2}.to_a
<epitron> freebase is what powers google's extra-info on the right side of the results
<poseid> Hash[a.flatten]
<poseid> does not give back the { 1=> 2}
<Hanmac> poseid you dont need flattern
<Hanmac> Hash[*a]
<epitron> Hanmac: 1.8 used to
<epitron> :\
<poseid> oh, ok
<Hanmac> 1.8 is dead
<poseid> the *a does work, thanks
<epitron> github still uses 1.8 :)
<poseid> (I thought * was for argument definition in a method? )
<epitron> * is called SPLAT
cespare has quit [Ping timeout: 276 seconds]
anderse has joined #ruby
<poseid> So, * is also used in passing arguments?
<epitron> it "unpacks" an array
<epitron> a, b, c = *[1,2,3]
<poseid> ok, great
<epitron> that's not a great example because ruby's syntactic sugar makes that unnecessary
<epitron> a, b, c = [1,2,3] also works
<shevy> long live 1.8!
<epitron> but you can unsplat: a, *b = [1,2,3,4]
<epitron> b #=> [2,3,4]
<shevy> poseid see? you can assign multiple values into a variable from an array that way
<epitron> [1,2,3,*other_array] :D
jfl0wers_ has quit [Ping timeout: 252 seconds]
Jackneill has quit [Ping timeout: 255 seconds]
<shevy> and if you want to discard the rest, you can do a, b = *[1,2,3,4], then a is 1, b is 2, and the rest is GONE
<poseid> yes, I knew this from def a(v, *a)
satman has joined #ruby
<shevy> of course my example is useless
<poseid> but did not see the trick to passing values
marr has quit [Ping timeout: 252 seconds]
<shevy> because it works without * just as well!!!
<poseid> i get it now
Norrin has joined #ruby
<shevy> :D
<epitron> JOLLY GOOD
* epitron slaps poseid heartily on the back
<shevy> lol omg
<shevy> a,b = *[1,2,3,*4]
<shevy> a,*b = *[1,2,3,*4]
<shevy> hahaha
<shevy> the ruby parser must be one huge evil thing
<epitron> weird
<shevy> it's all valid!!!
carraroj has quit [Quit: Konversation terminated!]
<shevy> typical Hanmac code :P
<epitron> so 4 is enumerable? :)
<shevy> a,*b = Hash[*[1,2,3,*4]] # => [{1=>2, 3=>4}]
<epitron> *4 == 4
<shevy> a,b = Hash[1,2,3,4] # => [{1=>2, 3=>4}]
<shevy> hmmm
<shevy> *4 == 4 is not valid
<epitron> yeah, it thinks it's math
joeycarmello has joined #ruby
<epitron> i just meant inside an array they're equivalent
cespare has joined #ruby
jfl0wers_ has joined #ruby
BryanWB has quit [Read error: Connection reset by peer]
<Hanmac> shevy you need it when you have it in a variable
<heftig> *4 == *Array(4) == *[4] == 4
<shevy> ack
<Nom-> Anyone know if there's a good guide to getting started with Fiddle? I'm having issues with FFI causing segfaults, so wanted to try it instead
<shevy> whoa... Array() is a method call?
<shevy> Array(%w( a b c )) == %w( a b c ) # => true
<shevy> how odd :D
<shevy> Nom- never heard of Fiddle
arturaz has joined #ruby
jerikl has joined #ruby
joeycarmello has quit [Ping timeout: 276 seconds]
<epitron> Array(array) == array
<epitron> :D
<epitron> i wonder if that casts enums
<epitron> yep
<epitron> it's like to_A
<epitron> err
<epitron> to_a
elaptics`away is now known as elaptics
shock_one has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
<Nom-> shevy: It's part of the Ruby 1.9 stdlib apparently? :P
vlad_starkov has joined #ruby
<shevy> hmmmm
statarb3 has quit [Read error: Connection reset by peer]
<shevy> peculiar
<shevy> "A libffi wrapper."
statarb3 has joined #ruby
Jackneill has joined #ruby
<Nom-> Yeah, but being a different implementation than the "ffi" gem, i'm hoping I won't hit the same issues
b6 has left #ruby ["*"]
ZT has joined #ruby
idkazuma has joined #ruby
decoponio has joined #ruby
ZT has quit [Client Quit]
banister`sleep is now known as banisterfiend
samphippen has joined #ruby
icole has quit [Remote host closed the connection]
liquid-silence has quit [Remote host closed the connection]
liquid-silence has joined #ruby
<poseid> hmm.. now: {a: 1} how to make this { :a => { :b => 1 } ?
guns has quit [Ping timeout: 255 seconds]
Inoperable has quit [Read error: Operation timed out]
<poseid> ii.e. insert the b key between a and 1
<shock_one> {a: 1}.map {|k, v| k: {b: v}}
vlad_starkov has quit [Remote host closed the connection]
Inoperable has joined #ruby
Philpax has joined #ruby
<poseid> oh, ok. map on a hash
<poseid> thanks!
<shock_one> poseid, no problem
joeycarmello has joined #ruby
jfl0wers_ has quit [Ping timeout: 248 seconds]
spider-mario has joined #ruby
Agis__ has joined #ruby
CodeGnome has joined #ruby
Neomex has joined #ruby
<banisterfiend> shock_one: i dont think that'll work
joeycarmello has quit [Ping timeout: 256 seconds]
<shock_one> banisterfiend, yeah, it won't, but he got the idea.
zomgbie has quit [Ping timeout: 245 seconds]
<banisterfiend> shock_one: well Hash#map doesnt return a Hash
<banisterfiend> so he has to do quite a lot more fiddling
<banisterfiend> Hash[{a: 1}.map {|k, v| [k, {b: v}] }]
<shock_one> banisterfiend, you're right. At least filter returns a hash.
lewellyn has joined #ruby
<lewellyn> good morning. :)
<lewellyn> i'm trying to compile ruby for a posix system which doesn't have setmode() (which isn't part of posix). io.c uses setmode() without an ifdef. i was wondering if anyone knew of this having been encountered previously.
<lewellyn> i'm not finding such :(
zzing has joined #ruby
relixx has quit [Quit: relixx]
kristofers has joined #ruby
zomgbie has joined #ruby
zzing has quit [Ping timeout: 256 seconds]
lkba has joined #ruby
marr has joined #ruby
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
erry has quit [Ping timeout: 624 seconds]
elkclone has joined #ruby
elkclone has quit [Remote host closed the connection]
kmurph has quit [Quit: kmurph]
elkclone has joined #ruby
m8 has joined #ruby
ferdev is now known as ferdev|away
mahmoudimus has quit [Quit: Computer has gone to sleep.]
hbpoison has quit [Read error: No route to host]
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
relixx has joined #ruby
qpf has joined #ruby
francisfish has joined #ruby
anderse has quit [Quit: anderse]
LouisRoR has quit [Ping timeout: 246 seconds]
joeycarmello has joined #ruby
nfk has joined #ruby
sepp2k has joined #ruby
alexturner has joined #ruby
banisterfiend has quit [Remote host closed the connection]
erry_ has joined #ruby
nfk has quit [Remote host closed the connection]
nfk has joined #ruby
BrindleFly has joined #ruby
joeycarmello has quit [Ping timeout: 244 seconds]
erry_ is now known as erry
rheoli has joined #ruby
reset has quit [Quit: Leaving...]
nfk has quit [Remote host closed the connection]
ferdev|away is now known as ferdev
Nisstyre-laptop has quit [Quit: Leaving]
<shevy> lewellyn hehe
<shevy> brave man
<shevy> come to linux!
<poseid> hmm
<shevy> leave your dark side
<poseid> now [{:a=>{:d=>1}}, {:a=>{:e=>2}}]
<lewellyn> shevy: the target is non-linux ;)
<lewellyn> embedded++
<poseid> how to make [:d =>1, :e => 2]
<poseid> how to make {:d =>1, :e => 2}
zzing has joined #ruby
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
tobstarr has joined #ruby
ahokaomaeha has joined #ruby
<tobstarr> hey
arturaz has quit [Remote host closed the connection]
ToTo has joined #ruby
arturaz has joined #ruby
jeer has joined #ruby
<CodeGnome> poseid: [:d =>1, :e => 2].pop
<spider-mario> poseid:
<spider-mario> [1] pry(main)> [{a: {d: 1}}, {a: {e: 2}}].map {|hash| hash[:a]}.reduce({}, &:update)
<spider-mario> => {:d=>1, :e=>2}
zzing has quit [Ping timeout: 244 seconds]
<poseid> nice, thanks
senayar has joined #ruby
<spider-mario> maybe better:
<spider-mario> [{a: {d: 1}}, {a: {e: 2}}].flat_map(&:values).reduce({}, &:update)
<tobstarr> is there a way to compile 2.0-rc2 with a custom openssl dir (on a mac)? telling me --with-openssl-dir is not recognized?
<poseid> reduce is probably what I need
hmarr has quit [Quit: Computer has gone to sleep.]
CodeGnome has quit [Remote host closed the connection]
Agis__ has quit [Quit: Agis__]
joneshf-laptop has joined #ruby
banisterfiend has joined #ruby
SeySayux has joined #ruby
<poseid> hmm.. flat_map works nice indeed... why the &update ?
Villadelfia has joined #ruby
Villadelfia has quit [Changing host]
Villadelfia has joined #ruby
SeySayux has quit [Remote host closed the connection]
Villadelfia has quit [Remote host closed the connection]
SeySayux has joined #ruby
<poseid> .reduce(:merge)
<poseid> works too :-)
Villadelfia has joined #ruby
ferdev is now known as ferdev|away
<Nom-> *segfault rage*
<Nom-> So close to rewriting this FFI code in native C
erry has quit [Remote host closed the connection]
codecop has quit [Ping timeout: 260 seconds]
havenwood has joined #ruby
Villadelfia has quit [Remote host closed the connection]
SeySayux has quit [Remote host closed the connection]
idkazuma has quit [Remote host closed the connection]
codecop has joined #ruby
SeySayux has joined #ruby
whitedawg has quit [Quit: Leaving.]
Villadelfia has joined #ruby
joeycarmello has joined #ruby
SeySayux has quit [Remote host closed the connection]
Villadelfia has quit [Remote host closed the connection]
jimeh has joined #ruby
SeySayux has joined #ruby
Villadelfia has joined #ruby
Villadelfia has quit [Changing host]
Villadelfia has joined #ruby
chussenot has joined #ruby
joeycarmello has quit [Ping timeout: 245 seconds]
wendallsan has quit [Remote host closed the connection]
robotmay has joined #ruby
alexturner has quit [Quit: alexturner]
marr has quit [Ping timeout: 255 seconds]
Villadelfia has quit [Remote host closed the connection]
SeySayux has quit [Remote host closed the connection]
tobstarr has quit [Quit: tobstarr]
SeySayux has joined #ruby
erry has joined #ruby
Villadelfia has joined #ruby
havenwood has quit [Remote host closed the connection]
Villadelfia has quit [Remote host closed the connection]
SeySayux has quit [Remote host closed the connection]
Agis__ has joined #ruby
havenwood has joined #ruby
<Nom-> oh... my...
<Nom-> so apparently in p385 including securerandom is causing a segfault
<Nom-> I can't beleive i finally found that
erry has quit [Read error: Connection reset by peer]
erry_ has joined #ruby
niklasb has joined #ruby
SeySayux has joined #ruby
Vivid_ has quit [Remote host closed the connection]
Virunga has joined #ruby
Villadelfia has joined #ruby
SeySayux has quit [Remote host closed the connection]
Villadelfia has quit [Remote host closed the connection]
zzing has joined #ruby
qohelet_ has joined #ruby
razibog has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
erry_ is now known as erry
<shevy> lol
maxmanders has quit [Quit: Computer has gone to sleep.]
<shevy> Nom- what are you doing
<shevy> why are you torturing your poor ruby with segfaults :(
maxmanders has joined #ruby
ferdev|away is now known as ferdev
skattyadz has joined #ruby
banisterfiend has quit [Remote host closed the connection]
erry has quit [Remote host closed the connection]
<Nom-> Well, this proprietary library I'm using via FFI is linked against openssl
<Nom-> It seems that securerandom when used in conjunction with this library causes a segfault on exit
<Nom-> Now I'm just trying to work out how on earth I can fix it
relixx has quit [Quit: relixx]
<Nom-> After all... last thing I want is my developers scratching their heads when *other* Ruby libraries linked against OpenSSL start to segfault :(
<lewellyn> Nom-: you could use strace/truss/etc. to see what it does just before the segfault :)
vlad_starkov has joined #ruby
relixx has joined #ruby
<poseid> spider-mario: hmm.. here a draft of my hash experiments posts: https://github.com/mulderp/mulderp.github.com/blob/drafts/_posts/2013-02-09-map-reduce-in-ruby.md
<poseid> i am almost through, but the last step the flat_map, I don't yet see how it works...
<poseid> anyway, if someone has feedback let me know...
relixx has quit [Client Quit]
<Nom-> lewellyn: I've done that... it's happening inside OpenSSL as far as I can tell
<shevy> how would you guys use ansi colours for small .rb scripts?
Morkel has joined #ruby
qohelet_ has quit [Ping timeout: 276 seconds]
<lewellyn> Nom-: ouch.
qohelet_ has joined #ruby
<lewellyn> Nom-: which openssl version?
<lewellyn> that actually looks very vaguely familiar
<Nom-> ii openssl 1.0.1c-3ubuntu2 amd64 Secure Socket Layer (SSL) binary and related cryptographic tools
<lewellyn> hm.
elkclone has quit [Quit: It's never too late to unplug and run.]
<lewellyn> it looks like something i saw with one of the 1.0.0 versions a while back
<lewellyn> upgrading to the latest patchlevel fixed it.
<Nom-> Well the fun part is that this particular vendor supplied library is linked against openssl 0.9.8
<Nom-> So i've got both installed
<lewellyn> oh.
<Nom-> I wish they'd just be nice and supply source code :(
<lewellyn> so are you mixing 0.9.8 and 1.0.1 at the same time? that's a feasible reason for a segfault.
pyrac has joined #ruby
<Nom-> Not by choice
joeycarmello has joined #ruby
<lewellyn> it doesn't help that useful info is "<optimised out>"
anderse has joined #ruby
<shevy> hehehe
<shevy> VERSION MISMATCH FUN!!!
<Nom-> Yeah, it's most certainly openssl though... I've got a short script now where I can comment out securerandom and a single call to it and the segfault stops
<lewellyn> i'm tempted to blame ubuntu's patches to openssl just because openssl is so fragile :)
<Nom-> I'm debating blatting Ubuntu's openssl with the vendors'
<shevy> folks on ubuntu should never compile anything
<lewellyn> good thing i'm not on ubuntu! :D
vlad_starkov has quit [Ping timeout: 240 seconds]
<Nom-> But that could create just as many problems as it solves
main has joined #ruby
<lewellyn> Nom-: you're compiling your own ruby?
<Nom-> via RVM
<shevy> hehehehe
<shevy> there was once a king trying to build a castle
<shevy> he used sand
<lewellyn> Nom-: well, i was going to suggest ensuring it finds your preferred ssl first
<lewellyn> but i don't know how to tell rvm to do so
<Nom-> Well it's a linker thing rather than openssl afaik
<Nom-> And given it's dymanically linked I can just drop others in
<lewellyn> er.
<lewellyn> 0.9.8 and 1.0.1 are incompatible. you can't just swap them.
joeycarmello has quit [Ping timeout: 276 seconds]
<Nom-> No I mean differing versions of 0.9.8
<lewellyn> oh
erry has joined #ruby
<Nom-> The vendor has supplied a .so of 0.9.8x it seems and Ubuntu has 0.9.8o
<lewellyn> that "should" work.
<lewellyn> in any case, it's a matter of convincing rvm to find the preferred openssl
<Nom-> I shall uninstall the ubuntu package and try :P
erry has quit [Read error: Connection reset by peer]
<shevy> ack
<shevy> you try to flee from the ubuntu prison
<shevy> you are a bad boy
erry_ has joined #ruby
<shevy> one day you may end up wanting to compile everything from source :(
<lewellyn> or you could be as bad as me... don't do that...
<shevy> yeah lectrick is a bad ass C hacker
<shevy> but one day I'll come to you guys, it's just that ruby is so much nicer than C
* lewellyn can type uname into 8 different ssh sessions and get 8 wildly different uname results.
<lewellyn> and almost every one is cross-compiling to the same target
Agis__ has quit [Quit: Agis__]
<shevy> hehe
kofno has quit [Read error: Connection reset by peer]
<shevy> how do you cross compile? do you use .sh scripts?
<lewellyn> well, autoconf is generally good at it these days.
<lewellyn> ruby is giving me some issues atm though
<lewellyn> see my earlier question about setmode :)
<Nom-> I haven't seriously tackled with C in a long time... my day to day is Perl (and i hate it)
<Nom-> Trying to effect change towards Ruby and need to get this library going to make that happen
<lewellyn> perl is a pain and a half to cross-compile :(
<shevy> Nom- whoa cool
<shevy> a perl guy trying to push for migration towards ruby
kofno has joined #ruby
<Nom-> Well you'd have to be a mad man to go the other way :P
<shevy> lewellyn, I am also having fun ... trying to compile qt 4 right now, it whines about gold-linker
<shevy> I really hope llvm annihilates gcc one day
<lewellyn> shevy: haha. my target has qt4 already as part of the core os!
fedza has joined #ruby
* lewellyn sticks out his tongue
<lewellyn> and llvm won't annihilate gcc till it supports arm better
<shevy> pffft arm
poseid has quit [Ping timeout: 245 seconds]
<lewellyn> arm isn't exactly a minor target, you realize ;)
<shevy> we desktop users are being attacked
erry_ is now known as erry
<Nom-> Ack. Still segfaults with vendor lib
<shevy> isn't arm for those cheap folks who cant afford a proper CPU?
<lewellyn> arm doesn't preclude desktop
<lewellyn> arm does 64 bit now!
TheFuzzball has joined #ruby
<shevy> I tell you, this mobile sector is a huge disease
<shevy> ubuntu unity wtf
<shevy> the only real way to reduce the amount of bugs is to find those developers and shoot them
<lewellyn> shevy: llvm still sucks on POWER, too, iirc
SeySayux has joined #ruby
Takehiro has joined #ruby
chussenot has quit [Quit: chussenot]
Agis__ has joined #ruby
Villadelfia has joined #ruby
<lewellyn> supporting a platform doesn't necessarily mean it does as well as even gcc ;)
<shevy> yeah but it has momentum
<shevy> and gcc was in decline even before llvm
<Nom-> Yep, so openssl.so (from ruby) is linked against 1.0.0 as suspected
<Nom-> How the heck am I going to get this sorted :/
<lewellyn> gcc was in decline in the 90s
<shevy> hehehe
<shevy> at least I could get gcc 4.0.4 to compile
<shevy> now you need mpfr mpc and gmp work properly before to even try
<lewellyn> i'm talking 2.8ish
<Nom-> I guess my best bet is going back to the vendor and trying to get a client built against openssl 1.0.0
chussenot has joined #ruby
<Nom-> Otherwise downgrade Ubuntu
<lewellyn> Nom-: or ensuring that the ruby you're building links against the desired openssl...
<lewellyn> and why is it linked against 1.0.0? you said you have 1.0.1
aaronmcadam has joined #ruby
<Nom-> ii libssl1.0.0:amd64 1.0.1c-3ubuntu2 amd64 SSL shared libraries
<Nom-> Ubuntu has this nasty habit lately of not updating the package and filename versions
berserkr has joined #ruby
<lewellyn> yet you use it anyhow.
<Nom-> Like for the kernel... the package is version 3.5.0 but it's actually based on 3.5.somethign
emocakes has joined #ruby
<Nom-> Well, our company is standardized on Ubuntu
<lewellyn> i'm glad i don't have that problem! :D
<emocakes> ouch, poor company Nom-
workmad3 has joined #ruby
<Nom-> We are looking at how we're going to do stuff going forward though... I'm toying around with the idea of doing Private PaaS
crackfu has joined #ruby
<Nom-> So if anyone has any ideas... only requiremenets are needs to run Ruby & Java (Perl is a massive bonus) and allow us to use custom C libraries like this one from TIBCO and IBM DB2 as well :P
<lewellyn> db2++
<Nom-> I hate their driver
<lewellyn> that's the first thing you've mentioned that i agree with :D
<lewellyn> yeah. but db2 itself is pretty sane.
<Nom-> Yah
<lewellyn> no database is perfect, alas.
<Nom-> But a 250MB client driver? Really?
<lewellyn> it does $everything though
<Nom-> And if you want the Perl DBI client to work, you need the 900MB complete client
<lewellyn> blame perl for that ;)
<Nom-> I blame IBM for taht... they wrote the Perl driver :P
<lewellyn> hey. i'm trying to help convince you to switch from perl!
<lewellyn> fwiw i can confirm that aside from one minor quirk (which you probably ran into on ubuntu), rhel handles db2 nicely.
<lewellyn> (the quirk is that it expects inittab to work)
Agis__ is now known as yozieor
<emocakes> Nom-, why on earth would you use ubuntu for PaaS?
<emocakes> and dont say heroku use it. you aren't heroku :p
<Nom-> We don't ... we're using Ubuntu today ... I'm trying to push some discussions about going down a Private PaaS route ... possibly with something like ActiveState Stackato
<emocakes> SmartOS
<emocakes> is awesome
<emocakes> btw
<emocakes> you should check it out
<emocakes> like, seriously have a good hard look at it
<emocakes> i love it
<lewellyn> emocakes: how well does it run db2? ;)
<lewellyn> (i know the answer)
petersaints_ has joined #ruby
<yozieor> why do people say you can't do parallelism in mri?
<Nom-> yozieor: Because you can't really unless the tasks are I/O bound? :P
petersaints has quit [Ping timeout: 257 seconds]
<Nom-> Running DB2 itself isn't the issue... we just need to be able to compile and install the client driver for the apps to use
<Nom-> I don't see us changing away from VMWare any time soon for the Hypervisor though :P
<emocakes> lewellyn, nfi ;)
<yozieor> Nom-: why must the tasks be IO bound?
<emocakes> lewellyn, but you can put rhel in a KVM on it
zigomir has quit [Quit: zigomir]
<emocakes> so no issue
<lewellyn> Nom-: db2 is FAR better supported on sparc than x86-64 for solaris. be forewarned.
<Nom-> yozieor: The GIL (different name in 1.9) still prevents multiple blocks of code running concurrently... and you can't extend past a single CPU within a single process
<lewellyn> (even the client stuff)
<lewellyn> SunOS looking-glass 5.10 Generic_137137-09 sun4u sparc SUNW,UltraAX-i2
<yozieor> Nom-: but you can spawn processes, right? and they can be running in parallel
hamed_r has joined #ruby
joeycarmello has joined #ruby
<Nom-> Yeah... server side we've got a full AIX Stack from IBM for that :P
<Nom-> yozieor: Yes, fork to parallelize... that's the model under MRI at the moment... threads are *not* parallel though unless you're in JRuby or Rubinius
<emocakes> or ironruby?
<Nom-> Don't have experience with IronRuby
<Nom-> Why would I want to run .NET ? :P
<yozieor> Nom-: so in the end, you *can* do parallelism in mri, by using processes (and not threads).. right?
anderse has quit [Quit: anderse]
<Nom-> yozieor: Yes, but then you can't easily do things like (for example of something I do in Java all the time) a thread worker pool
niklasb has quit [Ping timeout: 252 seconds]
shock_one has quit [Ping timeout: 252 seconds]
<Nom-> yozieor: Which is probably where the argument comes from.. because it's a separate process, you then need to change the way you communicate between processes
<Nom-> ZeroMQ for the win there.
<yozieor> Nom-: so it all comes down to the fact that some things you can do easier/better with just threads, not processes
greenarrow has joined #ruby
<yozieor> or are there things that you *only* can do with threads
<yozieor> ?
<Nom-> You can solve nearly any problem with forks and the right methods of communication, but that adds complexity
joeycarmello has quit [Ping timeout: 276 seconds]
<Nom-> There's also a memory penalty to forking instead of threading
<yozieor> i see..
<yozieor> thanks, that was clarifying:)
erlingur has joined #ruby
<Nom-> No problem... there's probably other things too, but I've lived without threads in Perl for a long time... there's not much you can't do given the proper motivation and time :P
<lewellyn> Nom-: you can build a threaded perl! </troll>
<Nom-> Yeah, but then you can't use signals, throw exceptions (ie. use 'die') and probably a stack of other things they don't advertise :P
<Nom-> Goodbye alarm/$SIG{ALRM} handlers for timeouts, as an example :P
nfk has joined #ruby
robustus has quit [Ping timeout: 248 seconds]
<lewellyn> i guess your parser stripped the unbalanced tag ;)
Agis__ has joined #ruby
<Nom-> :)
Agis__ has quit [Client Quit]
<Nom-> I've had that argument with Perl guys a few times
crackfu has quit [Remote host closed the connection]
<Nom-> "But perl does threads!"... yeah, like hell it does :P
<shevy> perl guys use an inferior language
Beoran_ has quit [Ping timeout: 245 seconds]
chussenot has quit [Quit: chussenot]
anderse has joined #ruby
crackfu has joined #ruby
robustus has joined #ruby
<shevy> php kicked perl in the arse
<shevy> :(
<Zelest> totally related to ruby :D
<lewellyn> Nom-: people who have been around perl a while say it in jest or they attach lots of caveats quickly.
yozieor has quit [Ping timeout: 256 seconds]
<Nom-> lewellyn: about perl doing threads, or attacking it because it doesn't really? :P
kmurph has joined #ruby
chussenot has joined #ruby
<Nom-> Probably getting a bit off topic by this point :P
<lewellyn> at some point, ruby will have some wart as bad as perl's threads. that is just par for the course after a long time and having to support a bajillion configurations
pac1 has joined #ruby
<lewellyn> Nom-: note that i was trying to stay somehow on topic ;)
anderse has quit [Client Quit]
<Nom-> Ruby already has it's quirks, but the fact there's multiple implementations might be the saving grace
cisco has joined #ruby
<lewellyn> well, revisit that after ruby's a quarter-century old :)
<shevy> Zelest well we are all a big scripting family after all, we must look at competition and see if they do something better
<Nom-> One day when JRuby isn't so slow, or Rubinius is compatable enough to use just about everything you can use in MRI...
<shevy> rubinius lost its momentum
<Nom-> Anyway, circling back to my earlier segfault problem, it seems RHEL 6.3 has openssl 1.0.1, so there's a better than even chance TIBCO will have released their software built against it
* Nom- can hope
crackfu has quit [Ping timeout: 248 seconds]
<lewellyn> Nom-: good luck ;)
workmad3 has quit [Ping timeout: 252 seconds]
sambio has joined #ruby
<Nom-> Just need to wait until Monday to get access to the download site again... our database guys don't give the credentials out :(
<lewellyn> sadly i can't provide more help than that since you're lacking things which may provide clues :(
rheoli has quit [Quit: Textual IRC Client: www.textualapp.com]
<Nom-> Well, I'm pretty confident the problem is in the fact it's loading two competing versions of OpenSSL ... if I fix that problem should go away
<Nom-> If I don't use securerandom it works fine
<Nom-> So yeah... unless someone knows of a way I can ensure they stay isolated when loaded, then I'm pretty sure i'm screwed :)
error404 has joined #ruby
<lewellyn> yeah. i'd concur based on that backtrace. but without more info at the segfault (yay optimization!), it's hard to be more sure.
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
workmad3 has joined #ruby
<Nom-> Well to be absolutely certain, I'll try loading libssl 1.0.0 manually
_Mon_Ouie_ has quit [Ping timeout: 264 seconds]
d34th4ck3r has quit [Ping timeout: 255 seconds]
DerekPow has joined #ruby
<DerekPow> I have a million dollar startup idea. Lets make twitter but without any limits ??? How do you like it?
ozgura has joined #ruby
d34th4ck3r has joined #ruby
poga has joined #ruby
<DerekPow> Who will do dat for me for 20% of stock???
arya has joined #ruby
<Nom-> Yep, just got the same segfault with a very basic openssl call
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<Nom-> Things go pear shaped as soon as libssl.so.1.0.0 is brought in
<DerekPow> LOL... B-)
<DerekPow> Any sexy chick here?
arya has left #ruby [#ruby]
arya has joined #ruby
nobuoka has joined #ruby
EvanR has quit [Ping timeout: 245 seconds]
<arya> hello everyone! ^_^
<DerekPow> Hi arya
<arya> DerekPow, hey :)
kirun has joined #ruby
<DerekPow> IRC is sexy
<arya> DerekPow, indeed
aaronmcadam has quit [Read error: Connection reset by peer]
aaronmcadam has joined #ruby
DerekPow has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
DerekPow has joined #ruby
<shevy> DerekPow you must learn ruby
<shevy> arya you must as well
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
<arya> shevy: yes i am learning it. and im loving it :)
<arya> shevy: are u a girl?
apoch632 has joined #ruby
kofno has quit [Remote host closed the connection]
aaronmcadam_ has joined #ruby
aaronmcadam has quit [Read error: Connection reset by peer]
aaronmcadam_ is now known as aaronmcadam
apoch632 has quit [Client Quit]
fris has joined #ruby
joeycarmello has quit [Ping timeout: 245 seconds]
beiter has joined #ruby
apoch632 has joined #ruby
<shevy> arya no
apoch632 has quit [Client Quit]
<shevy> I think about 98% here are male
<arya> shevy: yeah i believe so :/
anderse has joined #ruby
apoch632 has joined #ruby
zerba has joined #ruby
wf2f has quit []
workmad3 has quit [Ping timeout: 255 seconds]
apoch632 has quit [Client Quit]
apoch632 has joined #ruby
chussenot has quit [Quit: chussenot]
huoxito has joined #ruby
kristofers has quit [Ping timeout: 246 seconds]
<shevy> I think men are easier addicted to computers
<shevy> *more easily
poga has quit [Remote host closed the connection]
_nitti has joined #ruby
arya has quit [Ping timeout: 248 seconds]
AndChat| has quit [Remote host closed the connection]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
erlingur has quit [Quit: Computer has gone to sleep.]
uris has quit [Quit: Leaving]
apoch632 has quit [Quit: Leaving.]
arya has joined #ruby
apoch632 has joined #ruby
banisterfiend has joined #ruby
jeer has quit []
Neomex has quit [Quit: Neomex]
chussenot has joined #ruby
chussenot has quit [Client Quit]
kofno has joined #ruby
jamescarr has joined #ruby
braoru has quit [Ping timeout: 245 seconds]
erlingur has joined #ruby
erlingur_ has joined #ruby
Xeago has quit [Remote host closed the connection]
ferdev is now known as ferdev|away
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
joeycarmello has joined #ruby
reppard has joined #ruby
jonathanwallace has joined #ruby
ycy has left #ruby [#ruby]
whitedawg has joined #ruby
whitedawg has quit [Max SendQ exceeded]
whitedawg has joined #ruby
whitedawg has quit [Max SendQ exceeded]
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
joeycarmello has quit [Ping timeout: 256 seconds]
Coolhand|laptop has joined #ruby
alkasteve has joined #ruby
cisco has quit [Quit: Leaving.]
qohelet_ has quit [Quit: qohelet_]
Akuma has quit [Ping timeout: 264 seconds]
Bry8Star has joined #ruby
fris has quit [Quit: ircN 8.00 for mIRC (20100904) - www.ircN.org]
colonolGron has quit [Ping timeout: 252 seconds]
yacks has joined #ruby
mcatch has joined #ruby
alkasteve has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
relixx has joined #ruby
<mcatch> Can someone help me understand this? I'm trying to prove Ruby's passing of arguments to functions, and whether it's by value or by reference, but my proof is showing it can be both? https://gist.github.com/anonymous/4745373
<mcatch> essentially, if i set an argument to a value, and check that value after the function, it's not changed... but if I use a Bang method on the argument, it is changed
samphippen has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
workmad3 has joined #ruby
<mcatch> does this essentially mean that a bang method is a special case, returning a reference to the "banged" object, and the assignment operator simply returns a copy of the "changed" argument?
kristofers has joined #ruby
_nitti has quit [Remote host closed the connection]
kristofers has quit [Client Quit]
arya has quit [Ping timeout: 248 seconds]
kristofers has joined #ruby
jamescarr has quit [Quit: jamescarr]
CodeGnome has joined #ruby
baphled_ has joined #ruby
<banisterfiend> mcatch: no, ruby is pass by value, but what is passed is the reference
tk_ has quit [Quit: ばいばい]
arya has joined #ruby
<mcatch> hmm
<mcatch> not sure it's clicking in my head. so passing a local variable to a method, and setting that variable inside the method does not change the value of that method
<mcatch> but banging the argument does change the value of it
baphled has quit [Ping timeout: 256 seconds]
<mcatch> why is bang so special? isn't it just assigning something to the argument under the hood?
hmarr has joined #ruby
poga has joined #ruby
<arturaz> mcatch, because bang is mutating the thing under the ref
<mcatch> and assigning it isn't?
<mcatch> what special operator is banging using under the hood that isn't an assign?
whitedawg has joined #ruby
<banisterfiend> mcatch: no assigning isn't
kofno has quit [Remote host closed the connection]
alx- has joined #ruby
<banisterfiend> mcatch: assigning doesn't affect the object at all, it just associates another variable to that object
<banisterfiend> mcatch: x = y = z = obj
<banisterfiend> mcatch: x, y and z all point to object
<banisterfiend> x = other_obj
reppard has quit [Ping timeout: 244 seconds]
<banisterfiend> now the x variable points at other_obj
<banisterfiend> mcatch: it has *no effect* on obj (which x used to point to)
joeycarmello has joined #ruby
<mcatch> correct, that i understand
<banisterfiend> "because bang is mutating the thing under the ref" yet you said "and assigning it isn't?" in response to arturaz's comment :)
vlad_starkov has quit [Remote host closed the connection]
<jokke> hi, how can i match something in a regexp that can be anything except an " or ' unless it's preceeded with a \ ?
<mcatch> hmm, still not making myself clear i guess. let me try another way
<mcatch> i'm not doubting you guys btw, i'm sure you're right and i'm wrong, i just need to understand why
<mcatch> let me think of another way to explain myself
arietis has quit [Quit: Computer has gone to sleep.]
<arturaz> jokke, ([^\\][^"']) ?
apeiros_ has quit [Remote host closed the connection]
mityaz has joined #ruby
ninegrid has quit [Ping timeout: 255 seconds]
poga has quit [Remote host closed the connection]
<shevy> hmmm /([p3nis])/
joeycarmello has quit [Ping timeout: 260 seconds]
<shevy> wheee, bluefish 2.2.4 is out
ninegrid has joined #ruby
<shevy> I am using a "HTML editor" for ruby
<mcatch> banisterfiend: ok, here's probably a simpler example
<mcatch> banisterfiend: (assume str is an argument to a method in the following two examples) str = str.downcase # does not change the value of input argument 'str'
havenwood has joined #ruby
<mcatch> str.downcase! # DOES change the value of input argument 'str'
<banisterfiend> mcatch: because downcase makes a copy
<mcatch> what exactly is ruby doing under the hood on a downcase! that is different than an assignment?
colonolGron has joined #ruby
<banisterfiend> mcatch: downcase! does not make a copy, it mutates the object itself, that's why it has the !
<banisterfiend> mcatch: it's more the other way round
<mcatch> do they reveal it to us? the exact syntax?
eka has quit [Quit: Textual IRC Client: www.textualapp.com]
<mcatch> or is ! a compiler operator?
<banisterfiend> the implementation of downcase() is more like: self.dup.downcase!
<banisterfiend> it's not
aaronmcadam has quit [Quit: aaronmcadam]
<mcatch> so there's 2 methods on string
<mcatch> downcase and downcase! ?
<jokke> arturaz: um no
<banisterfiend> see the dup?
<banisterfiend> now i'll show u tht eorignal downcase!
<banisterfiend> mcatch: yes there's two methods
<banisterfiend> the '!' is just part of the method name, it's a separate method to downcase
<jokke> this should be matched: blabla \"blah\" bla
<jokke> this not blabla "blah" bla
<arturaz> (\\["']) then?
jimeh has quit [Quit: Computer has gone to sleep.]
<mcatch> hmm, ok
<jokke> the whole thing must be matched
<mcatch> banisterfiend: can we write our own bang methods without calling a standard lib bang method?
<arturaz> between quotes?
<jokke> no the whole thing
<mcatch> what syntax would we need to make? or do we need to write the C backend for it
<banisterfiend> mcatch: yes
<banisterfiend> mcatch: no
jonahR has quit [Quit: jonahR]
<arturaz> mcatch, a bang method is just a convention to mark things as "I MUTATE self"
<banisterfiend> mcatch: just this: o = Object.new; def o.mcatch!; puts "my very own bang method!"; end
<jokke> from here->blabla \"blah\" bla<- to here
<arturaz> def change!; @a += 1; end is a bang method
<banisterfiend> mcatch: o.mcatch! #=> OUTPUT: "my very own bang method!"
<arturaz> jokke, check if it contains
<arturaz> then get swhole string
<jokke> no
<jokke> i want a single regex
<jokke> p
<jokke> it's possible
<jokke> i know it is
l3o has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
<arturaz> /^(.*?\\['"].*?)$/
colonolGron has quit [Ping timeout: 256 seconds]
ShellFu has quit [Remote host closed the connection]
mityaz has quit [Ping timeout: 260 seconds]
havenwood has quit [Remote host closed the connection]
arya has quit []
arya has joined #ruby
erry has quit [Read error: Connection reset by peer]
aapzak has quit [Ping timeout: 252 seconds]
hybris has joined #ruby
zzing has quit [Ping timeout: 276 seconds]
alx- has quit [Quit: alx-]
poga has joined #ruby
aaronmcadam has joined #ruby
Goles has quit [Quit: Out.]
aapzak has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
jerius has joined #ruby
Goles has joined #ruby
Goles has quit [Remote host closed the connection]
alx- has joined #ruby
michele has left #ruby [#ruby]
michele has joined #ruby
hmarr has joined #ruby
rheoli has joined #ruby
maxmanders has joined #ruby
shock_one has joined #ruby
joeycarmello has joined #ruby
d34th4ck3r has quit [Ping timeout: 252 seconds]
eka has joined #ruby
BRMatt has joined #ruby
erlingur_ has quit [Quit: http://erlingur.is]
arturaz has quit [Remote host closed the connection]
kristofers has quit [Read error: Connection reset by peer]
quest88 has joined #ruby
joeycarmello has quit [Ping timeout: 246 seconds]
kristofers has joined #ruby
w|t has quit [Quit: Cya.]
samphippen has joined #ruby
jerius has quit []
w|t has joined #ruby
w|t has quit [Changing host]
w|t has joined #ruby
kristofers has quit [Read error: Connection reset by peer]
hamed_r has quit [Quit: Leaving]
main has quit [Ping timeout: 248 seconds]
xemu has joined #ruby
nari has quit [Ping timeout: 276 seconds]
ferdev|away is now known as ferdev
kristofers has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
niklasb has joined #ruby
liquid-silence has quit [Quit: Computer has gone to sleep.]
Pandaen has quit [Remote host closed the connection]
<mcatch> is there a practical usecase for the 'unless' keyword? a situation in which a simple negation in an if condition wouldn't be easier on the eyes?
pskosinski has joined #ruby
EvanR has joined #ruby
arya has quit [Ping timeout: 248 seconds]
EvanR is now known as Guest16700
Umren has joined #ruby
Jon30 has joined #ruby
erry__ has joined #ruby
<shevy> mcatch unless is very much like ! if
<shevy> I mean
<shevy> if !
<mcatch> yep, ok
<mcatch> thanks
<shevy> sometimes one has to use parens for if ! though
<shevy> perhaps "if not" is nicer to read
<shevy> game_over = true
<shevy> loop {
<shevy> run_game_logic
<shevy> break if game_over
<shevy> }
<shevy> ok, awful example ;)
Guest16700 has quit [Ping timeout: 252 seconds]
<shevy> I wanted to show unless, rather ......
arya has joined #ruby
rheoli has left #ruby ["Textual IRC Client: www.textualapp.com"]
<shevy> ah
<shock_one> log_in unless current_user
<shevy> continue_game unless game_over
Spooner has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
jrajav has joined #ruby
jrajav has quit [Max SendQ exceeded]
nomenkun has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
kofno has joined #ruby
<banisterfiend> mcatch: usually it's used in this cnotext
<banisterfiend> mcatch: raise ArgumentError, "need a block" unless block_given?
jfl0wers has joined #ruby
beiter has quit [Quit: beiter]
_nitti has joined #ruby
joeycarmello has joined #ruby
angusiguess has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
_nitti has quit [Ping timeout: 248 seconds]
joeycarmello has quit [Ping timeout: 255 seconds]
anderse has quit [Quit: anderse]
jamescarr has joined #ruby
l3o has quit [Quit: Saliendo]
angusiguess has joined #ruby
himsin has quit [Remote host closed the connection]
himsin has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
eka has quit [Quit: Computer has gone to sleep.]
erlingur has quit [Quit: http://erlingur.is]
palyboy has joined #ruby
qpf has quit [Remote host closed the connection]
relixx has quit [Quit: relixx]
qpf has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
joeycarmello has joined #ruby
otters has quit [Ping timeout: 252 seconds]
daniel_- has quit [Ping timeout: 245 seconds]
melty has joined #ruby
qpf has quit [Ping timeout: 276 seconds]
joeycarmello has quit [Ping timeout: 244 seconds]
io_syl has joined #ruby
v0n has joined #ruby
CodeGnome has left #ruby [#ruby]
_nitti has joined #ruby
nomenkun has joined #ruby
Takehiro has quit [Remote host closed the connection]
poseid has joined #ruby
<poseid> hmm... this merges nicely: [{ :a => { :b => 10, :c => 20 }}, { :d => { :b => 10, :c => 20 }}].reduce(:merge)
greenysan has quit [Quit: Lost terminal]
<poseid> to {:a=>{:b=>10, :c=>20}, :d=>{:b=>10, :c=>20}}
<poseid> however, this: [{ :a => { :b => 10, :c => 20 }}, { :a => { :f => 10, :d => 20 }}].reduce(:merge)
<poseid> merges to {:a=>{:f=>10, :d=>20}}
<poseid> I would have expected: {:a => {:b => 10, :c => 20,:f=>10, :d=>20}}
<poseid> any trick that does this?
dagnachew has joined #ruby
jblack has joined #ruby
Coolhand|laptop has quit [Ping timeout: 255 seconds]
<Hanmac> poseid because merge is not recrusive
wallerdev has joined #ruby
<poseid> oh, ok
<poseid> so, I need to walk on the elements
subbyyy has joined #ruby
Virunga has quit [Remote host closed the connection]
v0n has quit [Ping timeout: 260 seconds]
clj_newb has joined #ruby
<poseid> like [{ :a => { :b => 10, :c => 20 }}, { :a => { :f => 10, :d => 20 }}].map { |h| h.to_a.last.last }
<poseid> which could then be merged into [{:b=>10, :c=>20}, {:f=>10, :d=>20}] ?
freakazoid0223 has joined #ruby
BrindleFly_ has joined #ruby
<clj_newb> Hi, if in bash I see output from, let's say, echo $MY_VAR, then to read that var from the same bash session ENV['MY_VAR'] would suffice, isn't it? or am I missing something
nomenkun has quit [Ping timeout: 248 seconds]
mcqueenorama has joined #ruby
<Hanmac> poseid:
<Hanmac> >> p [{ :a => { :b => 10, :c => 20 }}, { :a => { :f => 10, :d => 20 }}].inject({:a=>{}}) {|o,h|o[:a].merge!(h[:a]);o}
<eval-in> Hanmac: Output: "{:a=>{:b=>10, :c=>20, :f=>10, :d=>20}}\n" (http://eval.in/9292)
mattbl has joined #ruby
<heftig> clj_newb: MY_VAR also needs be to exported (export MY_VAR)
BrindleFly has quit [Read error: Operation timed out]
BrindleFly_ is now known as BrindleFly
<clj_newb> aah, that was it, thanks heftig!
browndawg1 has joined #ruby
browndawg has quit [Ping timeout: 248 seconds]
<poseid> oh, man that's abstract :-)
dagnachew has quit [Quit: Leaving]
<poseid> I'll try to understand this, thanks!
kraljev has joined #ruby
<kraljev> how can i parse date in this form (from postgre database):
<kraljev> 2013-02-09 16:54:47.388657
ferdev is now known as ferdev|away
<heftig> strptime
braoru has joined #ruby
hmarr has joined #ruby
<kraljev> nothing native, without specifying format?
<Hanmac> nope
<heftig> kraljev: DateTime.parse("2013-02-09 16:54:47.388657")
CmdrTallen has joined #ruby
<heftig> (needs a require 'date')
braoru has quit [Client Quit]
jerikl has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
skattyadz has quit [Quit: skattyadz]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ahokaomaeha has joined #ruby
<poseid> Hanmac: hmm.. this inject with {} is it common ?
<poseid> basically, I am trying to think how it would work with http://pastie.org/6104178
<Hanmac> you could use each_with_object too
therod has joined #ruby
wallerdev has quit [Quit: wallerdev]
<kraljev> what ruby version will clear this date/time/datetime mess?
<poseid> the dates are the "shared" stuff like the :a above
eldariof has joined #ruby
jonahR has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
joeycarmello has joined #ruby
erry__ is now known as erry
jerikl has joined #ruby
<Hanmac> kraljev what excactly is your problem? heftig shows you want you need to do, you are only to lazy to type that??
jamescarr has quit [Quit: jamescarr]
<kraljev> Nooo....
<kraljev> I'm ranting about illogical date objects
<kraljev> On completely unrelated topic
<heftig> you could use Time.parse, but you'd lose the sub-second information
<Hanmac> that postgre use feaky & shitty state formats is not rubys fault ... and an good database binding should take care about that and automatic convert it
<heftig> ah, never mind, you don't
Takehiro has joined #ruby
<heftig> and it's not called postgre
aapzak has quit [Read error: Connection reset by peer]
<kraljev> but let's face it, ruby has separate date and time object, completelly unnecessary
joeycarmello has quit [Ping timeout: 245 seconds]
workmad3 has joined #ruby
<heftig> well, Time is part of core (though Time.parse isn't). Date/DateTime are stl
<heftig> er, stdlib
BrindleFly has quit [Quit: BrindleFly]
volte has quit [Ping timeout: 252 seconds]
jamescarr has joined #ruby
joneshf-laptop has quit [Ping timeout: 264 seconds]
<jerikl> kraljev: separate Date and Time objects are causing you issues?
<kraljev> Not exactly issues, but inconvenience
niklasb has quit [Ping timeout: 255 seconds]
palyboy has quit []
<jerikl> how so?
dmiller has joined #ruby
<kraljev> Time object can also store date as it is time_t internally
<poseid> Hanmac... ok, using inject asks for some practice...
<kraljev> They could make only one boject
oscardelben has joined #ruby
colonolGron has joined #ruby
<kraljev> But postgres has terible bindings :)
<kraljev> How to parse array string
<kraljev> '{1,2,3}'
<jerikl> okay, but what are you trying to do? oh, so it's more of the postgres bindings that's the issue?
<kraljev> don't say regex
<kraljev> :)
mityaz has joined #ruby
aapzak has joined #ruby
<kraljev> SELECT ARRAY[1,2,3]
megha has joined #ruby
<kraljev> returns {1,2,3} as string
jrajav has joined #ruby
<heftig> then the bindings suck
<heftig> are you using 'pg' bindings?
<kraljev> yes
<kraljev> but i guess it is a database limitation
nomenkun has joined #ruby
<kraljev> unless you make another query
<kraljev> you cannot know the type of the result columns
mityaz has quit [Client Quit]
<heftig> kraljev: SELECT unnest(ARRAY[1,2,3])
<kraljev> yes, in this example
aaronmcadam has quit [Ping timeout: 248 seconds]
<kraljev> but sometimes you have array stored in a field
mephux has quit [Excess Flood]
mephux has joined #ruby
spaceships has joined #ruby
pothibo has joined #ruby
AlSquire has quit [Ping timeout: 245 seconds]
hmarr has joined #ruby
<poseid> Hanmac: ok, slowly: [logins, signups].flatten.inject({}) { |h,v| h[v.keys.first] ||= Array.new; h[v.keys.first] << v.values; puts v.inspect; h}
nomenkun has quit [Ping timeout: 248 seconds]
aaronmcadam has joined #ruby
<poseid> what do you think the ||= Array.new is it OK ?
mityaz has joined #ruby
<kraljev> ||= [] is cleaner
arietis has joined #ruby
<poseid> I see
<poseid> ok.
<CmdrTallen> Any ruby + mongodb suggestions, tips, comments?
<poseid> ok... need to take a break...
<poseid> see you later...
<poseid> thanks!
<jblack> How do I get the instance variable of what's including my module in included?
mattbl has quit [Quit: This computer has gone to sleep]
jamescarr has quit [Quit: jamescarr]
cawaker has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
<kraljev> what is the difference between escape_bytea() and escape_string(), pg postgres binding
* lewellyn grumbles
<lewellyn> ./ext/extmk.rb:228:in `extmake': undefined method `prepend' for #<String:0x2b4e9f80e8a0> (NoMethodError)
pu22l3r has joined #ruby
poseid has quit [Ping timeout: 245 seconds]
<lewellyn> i suppose that's progress!
therod has quit [Quit: Leaving...]
HardFu has quit [Read error: Connection reset by peer]
abcdefg_ has joined #ruby
hmarr has joined #ruby
Jon30 has quit []
mattbl has joined #ruby
crackfu has joined #ruby
<Hanmac> lewellyn it shows that your ruby version is to old
freakazoid0223 has quit [Read error: Connection reset by peer]
mattbl has quit [Client Quit]
abcdefg_ has quit [Client Quit]
<lewellyn> Hanmac: well, this is while compiling ;)
<lewellyn> i wasn't even aware the build host had ruby till i got the error
<davidokner> So are software engineers/companies going to be able to compete with other countries like India and emerging markets?
BrindleFly has joined #ruby
kmurph has quit [Quit: kmurph]
hmarr has quit [Client Quit]
<jblack> I can't figure out the proper way to do this. It shouldn't be this hard!
<lewellyn> of course it should. it puts hair on your chest. ;)
* jblack cries like a girl
<jblack> =)
<davidokner> Why did countries like India choose to get into software development so much and not other things they could have done?
mattbl has joined #ruby
stormetrooper has joined #ruby
<jblack> I'm trying to come up with a clean way to include code into classes and run the included methods without knowing the names of the methods beforehand
<Dwarf> Heya, I'm fiddling with rails and I have made a link, and as text I wish to display &laquo;
<Dwarf> But instead of using the HTML entity it literally prints &laquo;
<Dwarf> How do I change that?
<jblack> for example, I might have 2 or 3 modules that might want to include to tune a search phrase. another module or two to tune search results.
<Hanmac> Dwarf #rubyonrails
therod has joined #ruby
crackfu has quit [Remote host closed the connection]
jacktrick has joined #ruby
crackfu has joined #ruby
<heftig> Dwarf: if your website uses utf8 you could just use
<heftig> «
<jblack> My original thought I'd just use modules and included to have the module add itself to a hash that lists callbacks at key points in a class, so that it can modify the class instance.
crackfu has quit [Read error: Connection reset by peer]
mattbl has quit [Client Quit]
angusigu1ss has joined #ruby
skattyadz has joined #ruby
crackfu has joined #ruby
angusiguess has quit [Ping timeout: 245 seconds]
<Dwarf> Aye, but I prefer to use html entities for maximum compatibility
uxp has quit [Quit: Lost terminal]
<jblack> e.g. in module FixSearchString, it would do something like @injections[:start] << method(FixSearchString.dowork)
uxp has joined #ruby
jonahR has quit [Quit: jonahR]
<jblack> that's within included. But I can't figure out how to get to the actual instance that's doing the actual include, so that I can add to the callbacks
blaxter has joined #ruby
LouisRoR has joined #ruby
Philpax has quit [Read error: Connection reset by peer]
<Hanmac> jblack: FixSearchString.method(:dowork) and define the dowork method as class method
<lewellyn> hm. is there a good repo for rhel-6-alikes to have a modern ruby? i thought i had one somewhere but i can't think of which server it'd be on.
DerekPow has quit [Ping timeout: 244 seconds]
therod has quit [Quit: Leaving...]
uxp has quit [Client Quit]
nimred has quit [Ping timeout: 260 seconds]
nimred has joined #ruby
wallerdev has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<jblack> I got it!!
eka has joined #ruby
banisterfiend has joined #ruby
<jblack> I'm using extend instead, and I perform the extend inside of the instande itself, in initialize.
<sterk> Are there anything like instance_variable_get for class constants? Or any other way of getting a constant by its name as string?
wallerdev has quit [Client Quit]
<banisterfiend> sterk: const_get
mcqueenorama has quit [Remote host closed the connection]
Pandaen has joined #ruby
wallerdev has joined #ruby
eka has quit [Client Quit]
<sterk> banisterfiend: Thanks
J-_-L has joined #ruby
mattbl has joined #ruby
nimred has quit [Ping timeout: 246 seconds]
<lewellyn> grumble.
<lewellyn> executable host ruby is required. use --with-baseruby option.
<lewellyn> :(
hadees has quit [Ping timeout: 276 seconds]
quest88 has quit [Quit: quest88]
<Hanmac> lewell yeah you need ruby to build ruby :P
onemanjujitsu has joined #ruby
icantbecool has joined #ruby
robotmay has quit [Remote host closed the connection]
joe____ has joined #ruby
uxp has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
recycle has quit [Remote host closed the connection]
DerekPow has joined #ruby
EvanR has joined #ruby
EvanR is now known as Guest97719
* jblack feels smart.
<jblack> That's usually a sign of being dumb
<X-Jester> lol
shock_one has quit [Ping timeout: 264 seconds]
icantbecool has quit [Quit: WeeChat 0.3.9.2]
bean has joined #ruby
bean has quit [Client Quit]
bean has joined #ruby
yacks has quit [Ping timeout: 264 seconds]
statarb3 has quit [Ping timeout: 276 seconds]
generalissimo has joined #ruby
joeycarmello has joined #ruby
Guest97719 has quit [Ping timeout: 240 seconds]
angusigu1ss has quit [Ping timeout: 276 seconds]
alx- has quit [Ping timeout: 244 seconds]
_nitti has joined #ruby
havenwood has joined #ruby
joeycarmello has quit [Ping timeout: 264 seconds]
<Hanmac> shevy you wanted some rwx samples? https://github.com/Hanmac/rwx/blob/master/tests/button.rb
anderse has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
Targen has joined #ruby
nomenkun has joined #ruby
otters has joined #ruby
mityaz has quit [Remote host closed the connection]
onemanjujitsu has quit [Quit: onemanjujitsu]
nomenkun has quit [Ping timeout: 244 seconds]
joe____ is now known as fractalontology
JohnBat26 has joined #ruby
onemanjujitsu has joined #ruby
subbyyy has quit [Ping timeout: 276 seconds]
ryanh has quit [Ping timeout: 255 seconds]
pu22l3r has quit [Remote host closed the connection]
ryanh has joined #ruby
icantbecool has joined #ruby
ryanh has quit [Excess Flood]
shock_one has joined #ruby
ryanh has joined #ruby
BrindleFly has quit [Quit: BrindleFly]
decoponio has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
icantbecool has quit [Client Quit]
arya has quit [Ping timeout: 248 seconds]
d34th4ck3r has joined #ruby
jgrevich has joined #ruby
skattyadz has quit [Ping timeout: 276 seconds]
mityaz has joined #ruby
digifiv5e_ has quit [Quit: quit]
arya has joined #ruby
jacktrick has quit [Quit: Leaving]
Takehiro has quit [Remote host closed the connection]
megha has quit [Ping timeout: 256 seconds]
skattyadz has joined #ruby
niklasb has joined #ruby
<jokke> how do i turn something like this => "'foo' 'bar' 'foo\"bar'" into ["foo","bar","foo\"bar"]
<jokke> it also has to work for '"foo" "bar" "foo\\"bar"'
<canton7> well, for your example, splitting on spaces works
kmurph has joined #ruby
<jokke> canton7: ah yes i thought of that too, but then what if i have "'foo bar' 'foo'"?
joeycarmello has joined #ruby
erry has quit [Ping timeout: 612 seconds]
<bean> >> "'foo' 'bar' 'foo\"bar'".split(" ")
<eval-in> bean: Output: "" (http://eval.in/9313)
<bean> >> "'foo' 'bar' 'foo\"bar'".split
<eval-in> bean: Output: "" (http://eval.in/9314)
<bean> bah, i can't ruby today
<jokke> :P
<jokke> i gotta work with regexp
jblack has quit [Ping timeout: 255 seconds]
whowantstolivef1 has joined #ruby
<Hanmac> bean you need p or puts with eval-in
kmurph has quit [Client Quit]
abstrusenick has joined #ruby
ForSpareParts_ has joined #ruby
hackeron has quit [Ping timeout: 252 seconds]
forced_request has joined #ruby
<canton7> str.scan(/(["'])(.*?)(?<!\\)\1/).map(&:last)
joeycarmello has quit [Ping timeout: 255 seconds]
<jokke> canton7: srsly?
<jokke> wow
<jokke> you just came up with that?
<canton7> yup
<jokke> nice
freakazoid0223 has joined #ruby
<jokke> looks neat
<canton7> started with /(['"])(.*?)\1/ which is simple enough
<jokke> yes
<canton7> then added the negative lookbehind to make sure the end quote doesn't have a \ in front of it
<jokke> yup
<canton7> started out with #scan instead of #split on a hunch :P
<bean> Hanmac, oh right
<bean> >> p "'foo' 'bar' 'foo\"bar'".split
<eval-in> bean: Output: "[\"'foo'\", \"'bar'\", \"'foo\\\"bar'\"]\n" (http://eval.in/9315)
kmurph has joined #ruby
ForSpareParts has quit [Read error: Operation timed out]
<jokke> canton7: what does &:last do?
<canton7> because there are two match groups, you get a load of two-element arrays
<jokke> ah ok
<canton7> the first element of each subarray being the quote, and the second being the actual match
<canton7> #map(&:last) == map{ |x| x.last } == (here, at least) #map{ |x| x[1] }
nomenkun has joined #ruby
ryanh has quit [Ping timeout: 276 seconds]
<canton7> bear in mind that, since we're using #scan, any garbage between the quoted sub-strings is ignored. might or might not be what you want
ananthakumaran has quit [Quit: Leaving.]
ryanh has joined #ruby
ryanh has quit [Excess Flood]
jgrevich_ has joined #ruby
ryanh has joined #ruby
ryanh has quit [Excess Flood]
ryanh has joined #ruby
ryanh has quit [Excess Flood]
mengu has joined #ruby
ryanh has joined #ruby
nomenkun has quit [Ping timeout: 252 seconds]
jgrevich has quit [Ping timeout: 276 seconds]
jgrevich_ is now known as jgrevich
skattyadz has quit [Quit: skattyadz]
mibitzi has quit [Ping timeout: 252 seconds]
hybris has quit [Quit: hybris]
anonymuse has joined #ruby
oscardelben has quit [Quit: oscardelben]
entrenador has joined #ruby
eka has joined #ruby
<heftig> jokke: Shellwords.split "'foo' 'bar' 'foo\"bar'"
arya has quit [Ping timeout: 256 seconds]
x82_nicole has joined #ruby
hadees has joined #ruby
entrenador_ has joined #ruby
entrenador_ has left #ruby [#ruby]
entrenador has quit [Client Quit]
skattyadz has joined #ruby
niklasb has quit [Ping timeout: 255 seconds]
eka has quit [Client Quit]
arya has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
angusiguess has joined #ruby
whitedawg has quit [Quit: Leaving.]
erry has joined #ruby
shock_one has quit [Read error: Operation timed out]
joeycarmello has joined #ruby
Al____ has joined #ruby
erry has quit [Read error: Connection reset by peer]
erry_ has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
gosshedd has quit [Ping timeout: 276 seconds]
eka has joined #ruby
brianpWins has joined #ruby
gosshedd has joined #ruby
eka has quit [Client Quit]
Cymurai has joined #ruby
<aedornm> hmmm.. I think I want to do something with Sinatra and EnyoJS
Norrin has left #ruby ["Textual IRC Client: www.textualapp.com"]
mercwithamouth has joined #ruby
joeycarmello has quit [Ping timeout: 252 seconds]
erry_ is now known as erry
gordon1775 has joined #ruby
tenmilestereo has joined #ruby
Hanmac has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
DerekPow has quit [Quit: Bye]
Hanmac has joined #ruby
DrShoggoth has joined #ruby
zzing has joined #ruby
sambio has quit [Ping timeout: 252 seconds]
niklasb has joined #ruby
Astralum has joined #ruby
relixx has joined #ruby
anonymuse has quit [Quit: Leaving.]
canton7 has quit [Remote host closed the connection]
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
mityaz has quit [Remote host closed the connection]
canton7 has joined #ruby
pdamer has joined #ruby
billiam has joined #ruby
kmurph has quit [Quit: kmurph]
kmurph has joined #ruby
mattbl has joined #ruby
otters has quit [Quit: WeeChat 0.3.9.2]
bricker`LA has quit [Ping timeout: 240 seconds]
otters has joined #ruby
workmad3 has joined #ruby
fractalontology has quit [Remote host closed the connection]
gordon1775 has quit [Ping timeout: 252 seconds]
Al____ has quit [Quit: Al____]
Jeaye has joined #ruby
octoberry has joined #ruby
SolidResolve has quit [Quit: Good bye]
statarb3 has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
anonymuse has joined #ruby
onemanjujitsu has quit [Quit: onemanjujitsu]
zerba has quit [Remote host closed the connection]
colonolGron has quit [Quit: leaving]
colonolGron has joined #ruby
colonolGron has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 276 seconds]
m-uh has joined #ruby
m-uh has left #ruby ["</em>"]
Opettaja has joined #ruby
pdamer has quit [Quit: pdamer]
sterNiX has joined #ruby
subbyyy has joined #ruby
EvanR has joined #ruby
sterNiX has quit [Client Quit]
eldariof has quit []
EvanR is now known as Guest29664
banisterfiend has quit [Ping timeout: 260 seconds]
Opettaja has quit [Client Quit]
meoblast001 has joined #ruby
Opettaja has joined #ruby
adkron has quit [Ping timeout: 256 seconds]
adkron_ has quit [Ping timeout: 255 seconds]
joeycarmello has joined #ruby
Opettaja has quit [Client Quit]
workmad3 has quit [Ping timeout: 246 seconds]
x82_nicole has quit [Quit: Computer has gone to sleep.]
Opettaja has joined #ruby
JumpMast3r has quit [Quit: JumpMast3r]
moofy has joined #ruby
<moofy> hoy
abcdefg has joined #ruby
fermion has quit [Quit: Textual IRC Client: www.textualapp.com]
<moofy> I have a question
daniel_- has quit [Quit: WeeChat 0.3.9.2]
otters has quit [Quit: WeeChat 0.3.9.2]
<moofy> if i'm using textile or markdown to write a thing, what might be a good way to add a custom tag?
<moofy> i want to come up with a way of adding sidebar text but i'm not sure how to approach it
otters has joined #ruby
otters has quit [Client Quit]
ahokaomaeha has quit [Ping timeout: 276 seconds]
otters has joined #ruby
<abcdefg> yes
joeycarmello has quit [Ping timeout: 252 seconds]
poga has quit [Remote host closed the connection]
Opettaja has quit [Client Quit]
Vert has joined #ruby
otters has quit [Client Quit]
rdark has quit [Ping timeout: 255 seconds]
ahokaomaeha has joined #ruby
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
<Amnesia> question, I'm "tailing" stdout, and I somehow need to detect whether there's no output anymore
<Amnesia> how could I achieve this?
<Amnesia> =~ /^$/ isn't an option
eldariof has joined #ruby
<bean> "whether there's no output anymore" man, that is a hard sentence to parse.
otters has joined #ruby
nobuoka has quit [Quit: Leaving...]
<bean> Amnesia, what sort of data are you tailing?
otters has quit [Client Quit]
<Amnesia> bean: stdout using PTY
otters has joined #ruby
arya has quit []
decoponio has quit [Quit: Leaving...]
hackeron has joined #ruby
arya has joined #ruby
colonolGron has joined #ruby
kraljev has quit [Ping timeout: 255 seconds]
cableray has joined #ruby
mercwithamouth has joined #ruby
Opettaja has joined #ruby
banisterfiend has joined #ruby
<Jeaye> I'm currently using CGI (and looking into FastCGI) for some basic Ruby scripts on my website. One thing I'd like to do is a progress bar for uploading files. I'd wager this can't be done with CGI, since it's a serial call that happens before the HTML is shown. What's the easiest way to do dynamic graphics with Ruby in a web browser that's relatively performant and portable?
shevy has quit [Read error: Operation timed out]
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
Guest29664 has quit [Ping timeout: 255 seconds]
Fretta has joined #ruby
workmad3 has joined #ruby
moofy has left #ruby [#ruby]
x82_nicole has joined #ruby
Nisstyre-laptop has joined #ruby
tcstar has left #ruby ["Leaving"]
subbyyy has quit [Ping timeout: 256 seconds]
jrajav has joined #ruby
maxmanders has quit [Ping timeout: 256 seconds]
tuixy has joined #ruby
anonymuse has quit [Quit: Leaving.]
<tuixy> Hi guys
<tuixy> I was following a rails guide but now I'm a bit confused, check this code: http://paste.kde.org/668330/
PanPan has quit [Read error: Connection reset by peer]
<canton7> tuixy, #rubyonrails
<tuixy> it's a ruby question
<canton7> (unless it is a syntax question and not a rails one)
<canton7> cool
PanPan has joined #ruby
Fretta has quit [Ping timeout: 248 seconds]
<tuixy> can anyone explain me why it uses self.current_user (which I believe is a class var), @current_user (which is a instance var) and current_user (which is a local var)?
yankeefan04 has joined #ruby
<tuixy> it seems it works, but I don't know why
<canton7> current_user refers to the method, if there isn't a local variable of that name
yankeefan04 has left #ruby [#ruby]
p2w has joined #ruby
<tuixy> ah, ok.. sure
<tuixy> same for self.current_user
<canton7> likewise self.current_user from inside a method is reffering to the current_user= method
<tuixy> I guess that if you put current_user = foo in the first method, it defines a local variable instead
<tuixy> is it correct?
<canton7> yeah
maz-dev has joined #ruby
<tuixy> ok, thanks ;)
workmad3 has quit [Ping timeout: 260 seconds]
maxmanders has joined #ruby
<canton7> one thing about ruby that I don't likle tbh :P
<canton7> *like
<tuixy> yeah, it's a bit confusing first time you see it all together
<sterk> What's the best way to get all items from an array that matches a certain condition? Something like arr.collect {|x| x if x > 10}, but that doesn't give a nil for x <= 10.
<tuixy> map
p2w has quit [Client Quit]
<canton7> #collect is #map
<tuixy> ["foo", "bar"].map {|e| e =~ /whatever/}
<canton7> you want #select
<canton7> arr.select{ |x| x > 10 }
<tuixy> collect is map? didn't know
<sterk> canton7: Thank you, #select seems to be just what i need
tommyvyo has joined #ruby
<canton7> :)
<canton7> #select and #map are, between them, incredibly powerful
<canton7> (and much easier on my eyes than list comprehensions)
kmurph has quit [Quit: kmurph]
caleb_io has joined #ruby
shevy has joined #ruby
snearch has joined #ruby
Opettaja has quit [Read error: Connection reset by peer]
albakry has quit [Read error: Operation timed out]
mercwithamouth has quit [Ping timeout: 240 seconds]
snearch has quit [Max SendQ exceeded]
<Jeaye> I don't see how FastCGI works. I have the fcgi gem, but I'd imagine FastCGI as a daemon and not a gem. o.O Seems to be no online documentation for it either.
joeycarmello has joined #ruby
brady has joined #ruby
iamjarvo has joined #ruby
brady has quit [Client Quit]
Opettaja has joined #ruby
hmarr has joined #ruby
epitron has quit [Ping timeout: 240 seconds]
anderse has quit [Quit: anderse]
peteyg has quit [Ping timeout: 248 seconds]
albakry has joined #ruby
gosshedd has quit [Ping timeout: 260 seconds]
stormetrooper has quit [Quit: Leaving]
joeycarmello has quit [Ping timeout: 256 seconds]
epitron has joined #ruby
peteyg has joined #ruby
gosshedd has joined #ruby
subbyyy has joined #ruby
nomenkun has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
LouisRoR has quit [Ping timeout: 248 seconds]
Fretta has joined #ruby
banister_ has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
Guest34984 is now known as juzprawiedaz
joeycarmello has joined #ruby
stormetrooper has joined #ruby
abcdefg has quit [Quit: ChatZilla 0.9.90 [Firefox 17.0.1/20121128204232]]
crackfu has quit [Ping timeout: 252 seconds]
nomenkun has quit [Ping timeout: 252 seconds]
generalissimo has quit [Remote host closed the connection]
arya_ has joined #ruby
jerikl_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
txdv has quit [Ping timeout: 246 seconds]
ferdev|away is now known as ferdev
stormetrooper has quit [Client Quit]
stormetrooper has joined #ruby
pdamer has joined #ruby
txdv has joined #ruby
stormetrooper has quit [Client Quit]
goraxe has quit [Ping timeout: 252 seconds]
stormetrooper has joined #ruby
BrindleFly has joined #ruby
hmarr has quit [Quit: Computer has gone to sleep.]
browndawg1 has left #ruby [#ruby]
snearch has joined #ruby
snearch has quit [Max SendQ exceeded]
BrindleFly has quit [Client Quit]
snearch has joined #ruby
hmarr has joined #ruby
snearch has quit [Max SendQ exceeded]
snearch has joined #ruby
jerikl_ has quit [Quit: jerikl_]
stormetrooper has quit [Quit: Leaving]
joofsh has joined #ruby
Cymurai has quit [Quit: Leaving]
berserkr has quit [Quit: Leaving.]
snearch has quit [Max SendQ exceeded]
pdamer has quit [Quit: pdamer]
snearch has joined #ruby
subbyyy has quit [Ping timeout: 245 seconds]
nazty has quit [Read error: No route to host]
nazty has joined #ruby
adambeynon has joined #ruby
snearch has quit [Max SendQ exceeded]
eka has joined #ruby
subbyyy has joined #ruby
otters has quit [Quit: WeeChat 0.3.9.2]
weasels has joined #ruby
weasels has quit [Client Quit]
otters has joined #ruby
otters has quit [Client Quit]
snearch has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
colonolGron has quit [Quit: leaving]
colonolGron has joined #ruby
snearch has quit [Max SendQ exceeded]
otters has joined #ruby
Virunga has joined #ruby
weasels has joined #ruby
Virunga has quit [Read error: No route to host]
weasels has quit [Client Quit]
Virunga has joined #ruby
otters has quit [Client Quit]
otters has joined #ruby
subbyyy has quit [Ping timeout: 260 seconds]
otters has quit [Client Quit]
albakry_ has joined #ruby
albakry_ has quit [Client Quit]
otters has joined #ruby
Chryson has joined #ruby
albakry_ has joined #ruby
otters has quit [Client Quit]
otters has joined #ruby
Morkel has quit [Read error: Connection reset by peer]
albakry has quit [Ping timeout: 255 seconds]
chrishough has joined #ruby
wyhaines has quit [Ping timeout: 245 seconds]
Morkel has joined #ruby
albakry has joined #ruby
albakry has quit [Read error: Connection reset by peer]
mityaz has joined #ruby
jamescarr has joined #ruby
albakry_ has quit [Ping timeout: 248 seconds]
txdv_ has joined #ruby
weasels has joined #ruby
txdv has quit [Read error: Connection reset by peer]
weasels has quit [Client Quit]
albakry has joined #ruby
albakry has quit [Changing host]
albakry has joined #ruby
BrindleFly has joined #ruby
otters has quit [Quit: WeeChat 0.4.0]
jimeh has joined #ruby
jamescarr has quit [Ping timeout: 240 seconds]
elaptics is now known as elaptics`away
canton7 has quit [Read error: Connection reset by peer]
octoberry has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
otters has joined #ruby
banister_ is now known as banisterfiend
snearch has joined #ruby
Virunga has quit [Remote host closed the connection]
snearch has quit [Max SendQ exceeded]
octoberry has joined #ruby
txdv_ has quit [Ping timeout: 245 seconds]
snearch has joined #ruby
atno has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
Xeago has joined #ruby
atno has joined #ruby
Virunga has joined #ruby
snearch has quit [Max SendQ exceeded]
relixx has quit [Quit: relixx]
colonolGron has quit [Quit: leaving]
elux has joined #ruby
snearch has joined #ruby
relixx has joined #ruby
snearch has quit [Max SendQ exceeded]
generalissimo has joined #ruby
Es0teric has joined #ruby
angusiguess has joined #ruby
kold has joined #ruby
DaltonUS has joined #ruby
DaltonUS has quit [Client Quit]
hmarr has quit [Quit: Computer has gone to sleep.]
arya_ has quit [Ping timeout: 248 seconds]
SolidResolve has joined #ruby
<atno> 50GB free if anyone is interested https://www.box.com/signup/o/dell_50gb_give_get
ferdev is now known as ferdev|away
arya has joined #ruby
octoberry has quit [Quit: [BX] Tone Loc uses BitchX, and funky cold medina.]
crackfu has joined #ruby
nomenkun has joined #ruby
crackfu has quit [Remote host closed the connection]
wyhaines has joined #ruby
arya_ has joined #ruby
danielpcox has joined #ruby
arya has quit [Ping timeout: 248 seconds]
nomenkun has quit [Ping timeout: 248 seconds]
arya_ has quit [Ping timeout: 248 seconds]
allaire has joined #ruby
Jackneill has quit [Remote host closed the connection]
snearch has joined #ruby
snearch has quit [Max SendQ exceeded]
JohnBat26 has quit [Ping timeout: 276 seconds]
octoberry has joined #ruby
octoberry has left #ruby [#ruby]
arya has joined #ruby
octoberry has joined #ruby
<allaire> I can't remember what's the method that makes it easy to add separator (like "|") between different string in a each
snearch has joined #ruby
ferdev|away is now known as ferdev
albakry has quit [Quit: Leaving]
Edward__ has joined #ruby
<swarley> [37] pry(main)> 9e99 - 8e99
<swarley> => 1.0000000000000002e+99
snearch has quit [Max SendQ exceeded]
<epitron> atno: hahah.. now that's a good bet from a business perspective
snearch has joined #ruby
<epitron> sell X amount of anything on an expoential growth curve 'for life'
Dcr has joined #ruby
calgaryeng has joined #ruby
kold has quit [Remote host closed the connection]
ctult has joined #ruby
ctult_ has quit [Read error: Connection reset by peer]
eldariof has quit []
Edward_ has quit [Ping timeout: 248 seconds]
snearch has quit [Max SendQ exceeded]
snearch has joined #ruby
<atno> epitron: :)
calgaryeng has left #ruby [#ruby]
nomenkun has joined #ruby
snearch has quit [Max SendQ exceeded]
bkparsons has joined #ruby
daniel_hinojosa has joined #ruby
jerikl_ has joined #ruby
jerikl_ has quit [Client Quit]
<Es0teric> atno i definitely took that 50GB offer, thanks
<banisterfiend> epitron: do u have mad css skillz
<Es0teric> also whats the difference between { "val1" => "val1" } and { :val_1 => "val1" } ?
<Hanmac> Es0teric the second one is a symbol
kristofers has quit []
jimeh has quit [Quit: Computer has gone to sleep.]
apoch632 has quit [Quit: Leaving.]
nomenkun has quit [Ping timeout: 248 seconds]
rakl has joined #ruby
elux has quit [Remote host closed the connection]
invisime has joined #ruby
dcwu has joined #ruby
elux has joined #ruby
<Es0teric> Hanmac is there any way to convert a JSON array into a hash with symbol/value pairs?
Dcr has quit [Quit: Leaving]
<Hanmac> yes, but i do not recoment it ... because it can be used for DOS attacks ...
subdigital has joined #ruby
<invisime> Es0teric: yes, it's JSON.parse the_json_string, symbolize_names: true
monkegjinni has joined #ruby
<invisime> Hanmac: I thought that's been fixed at this point?
<atno> Es0teric: np
<Hanmac> invisime it was yaml you mean ... symbolize is an other kind of attack
subdigital has left #ruby [#ruby]
subdigital has joined #ruby
<Es0teric> Hanmac wait so its best not to convert json into symbol/value pairs?
<invisime> huh.
<invisime> Es0teric: you still want it in key/value, but you might want to keep the keys as strings.
subdigital has quit [Client Quit]
<Es0teric> invisime i see...
<Es0teric> so when is the best time to use symbols?
chrishough has quit [Quit: chrishough]
<Hanmac> Es0teric: symobls for internal stuff, strings for userinput
Astralum has quit [Ping timeout: 256 seconds]
octoberry has quit [Ping timeout: 248 seconds]
<invisime> ^
<Es0teric> Hanmac but i am not taking any user input...
elux has quit [Ping timeout: 276 seconds]
<Es0teric> so in reality, the JSON i am retrieving is just from an ID
<Es0teric> the user has no way of manipulating that
chrishough has joined #ruby
<Hanmac> in this point, you can use symbolize_names: true
<Es0teric> i see
IceDragon has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
br4ndon has joined #ruby
jankly has quit [Ping timeout: 248 seconds]
psyprus has quit [Ping timeout: 248 seconds]
kofno has quit [Remote host closed the connection]
kofno has joined #ruby
EvanR has joined #ruby
Edward_ has joined #ruby
psyprus has joined #ruby
EvanR is now known as Guest9756
workmad3 has quit [Ping timeout: 252 seconds]
snearch has joined #ruby
snearch has quit [Max SendQ exceeded]
flashuni has joined #ruby
snearch has joined #ruby
bradleyprice has joined #ruby
Edward__ has quit [Ping timeout: 248 seconds]
Guest9756 has quit [Ping timeout: 246 seconds]
snearch has quit [Max SendQ exceeded]
JumpMast3r has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
arturaz has joined #ruby
atno has quit [Ping timeout: 246 seconds]
jimeh has joined #ruby
workmad3 has joined #ruby
tuixy has quit [Quit: Page closed]
s1n4 has joined #ruby
s1n4 has quit [Client Quit]
br4ndon has joined #ruby
angusiguess has quit [Ping timeout: 245 seconds]
atno has joined #ruby
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
octoberry has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
BrindleFly has quit [Remote host closed the connection]
swarley| has joined #ruby
BrindleFly has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
SeySayux has quit [Ping timeout: 255 seconds]
octoberry has quit [Quit: User abortion with 5 coathooks]
octoberry has joined #ruby
stormetrooper has joined #ruby
Villadelfia has quit [Ping timeout: 264 seconds]
kold has joined #ruby
Villadelfia has joined #ruby
SeySayux has joined #ruby
icole_ has joined #ruby
beardyjay has quit [Ping timeout: 246 seconds]
workmad3 has quit [Read error: Operation timed out]
qohelet_ has joined #ruby
flashuni has quit [Ping timeout: 252 seconds]
pothibo has quit [Quit: pothibo]
toekutr has joined #ruby
Vert has quit [Remote host closed the connection]
subbyyy has joined #ruby
etcetera has joined #ruby
maxmanders has quit [Ping timeout: 256 seconds]
J-_-L has quit [Quit: Leaving.]
samphippen has quit [Ping timeout: 245 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
stormetrooper has quit [Read error: Connection reset by peer]
LouisRoR has joined #ruby
TomJ has quit [Quit: TomJ]
<havenwood> Refactoring SHA3 implemented in pure Ruby. Anyone see any improvements to be had?!? https://gist.github.com/havenwood/4747260
emmanuelux has joined #ruby
samphippen has joined #ruby
maxmanders has joined #ruby
allaire has quit []
adeponte has joined #ruby
stormetrooper has joined #ruby
main has joined #ruby
apoch632 has joined #ruby
bbttxu has joined #ruby
cparen has joined #ruby
etcetera has quit [Ping timeout: 260 seconds]
<Es0teric> who was the one who told me about webservers in ruby?
wargasm has quit [Ping timeout: 255 seconds]
sepp2k has quit [Remote host closed the connection]
<havenwood> Es0teric: dunno, maybe me?
backjlack has joined #ruby
<Es0teric> yeah, havenwood what is the best webserver for ruby?
<Es0teric> i do not like rails
kold has quit [Remote host closed the connection]
<havenwood> Es0teric: Web framework you mean?
<Es0teric> havenwood yeah
relixx has quit [Quit: relixx]
<yfeldblum> Es0teric, what's up?
<havenwood> I like Sinatra. Other options I can think of are Cuba, Renee, and Camping.
<invisime> sinatra's pretty great.
Opettaja has quit [Remote host closed the connection]
<invisime> I just made a sample app for it today, actually.
<invisime> because I got tired of starting from bare-ass scratch sinatra.
<Es0teric> yfeldblum yeah you told me about web frameworks for ruby yesterday
<yfeldblum> Es0teric, there are also Padrino, WebMachine, and Goliath
Al____ has joined #ruby
<havenwood> or plain ole Rack apps
<Es0teric> ok which is the best choice
<Es0teric> out of all of them
<arturaz> Es0teric, out of curiosity - why don't you like rails?
pyrac has quit [Quit: pyrac]
<Es0teric> arturaz its just... wierd
<yfeldblum> Es0teric, there is no best choice; there is only the choice that is the best match, at the time, for your needs, at the time
<arturaz> like?
<invisime> ^
<Es0teric> yfeldblum ok so sinatra vs rails... what are the pros and cons?
mengu_ has joined #ruby
<yfeldblum> Es0teric, depends; what are you looking to do?
brianpWins has quit [Ping timeout: 264 seconds]
<Es0teric> yfeldblum well for starters... i am going to create something to view books/comic books/literature on
<Es0teric> or create a booking system of some sort
sorbo_ has joined #ruby
<yfeldblum> Es0teric, i'm much more familiar with Rails; Rails will allow you to write normal Ruby classes and do normal object-oriented programming for the majority of the system
<Es0teric> yfeldblum so that means the OOP i learned in PHP will be transferrable with rails?
<yfeldblum> Es0teric, Ruby is much more OOP than PHP
<yfeldblum> Es0teric, so, yes it is transferable, but more so :D
<Es0teric> intresting
d34th4ck3r has quit [Ping timeout: 276 seconds]
<swarley> iirc a lot of php's stdlib is in a procedural style
<yfeldblum> Es0teric, Rails has plenty of helper functions that make writing apps easier, for example, `book_url(@book)` will return "http://myapp.com/books/345", where @book is an instance of class Book, which represents a record in your database in the "books" table
<Es0teric> yfeldblum well i would be using a API for the most part
<swarley> explode("string", "i") etc
icole_ has quit [Remote host closed the connection]
<yfeldblum> Es0teric, what kind of API?
<swarley> I don't know any real php though
statarb3 has quit [Read error: Connection reset by peer]
onemanjujitsu has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
yakko has joined #ruby
<Es0teric> swarley is really barney right?
<swarley> MY COVER IS BLOWN
<Es0teric> and str.split is same as explode()
<swarley> FALL BACK
<Es0teric> swarley i watch HIMYM too lol
<Es0teric> Swarles Barkley
qohelet_ has quit [Quit: qohelet_]
<arturaz> Es0teric, ditch ruby, go Scala :))
<Es0teric> arturaz man i just got into ruby
ebobby has joined #ruby
<yfeldblum> arturaz, um ... why?
Vektur has quit [Ping timeout: 252 seconds]
<Es0teric> yfeldblum just an api... from a third party site
<Es0teric> i am using it to make a sample app
<Es0teric> so i can get the feel for ruby
Morkel has quit [Quit: Morkel]
<arturaz> yfeldblum, do you want an objective reason or the illogical one? ;)
<Es0teric> i was thinking of using net/http
<Es0teric> and json
Al____ has quit [Quit: Al____]
<Es0teric> to parse the data
Vektur has joined #ruby
<yfeldblum> arturaz, i want one that applies specifically to Es0teric's case, based on his particular needs ...
<arturaz> Es0teric, yfeldblum, scala & play are way more scalable with futures & async io than traditional request/response cycle on which all rack-based servers are built.
<Es0teric> arturaz for the booking system
<bbttxu> 0
<Es0teric> i am looking for something more event based
<Es0teric> because everything should happen in real time
<arturaz> the illogical one - guy dislikes rails because it feels weird. So why not scala? :D
gosshedd has quit [Ping timeout: 248 seconds]
<Es0teric> arturaz i mean, i am open to using rails
<Es0teric> maybe it will grow on me
<swarley> sinatra \o/
<yfeldblum> arturaz, oh he should certainly try Scala too
<swarley> Not for a large web app maybe..
<Es0teric> swarley that booking system would be a huge web app
<arturaz> Es0teric, if you're just getting data, transforming it and spewing it out, play is really built for that
danielpcox has quit [Ping timeout: 244 seconds]
<Es0teric> i mean its 5% done in php but its difficult to get real-time results with php
Proshot has joined #ruby
<Es0teric> arturaz no its more like... there will be invoicing, multiple users, multiple user levels
<Es0teric> social network
<Es0teric> shit like that
<swarley> look at reddit's code or something
<Es0teric> so the data would be created by the site
bkparsons has quit [Quit: bkparsons]
<yfeldblum> Es0teric, you can certainly use threads with Ruby and Rails; you can have a multithreaded app server that handles a request in its own thread, plus each request handler can itself do IO work in worker threads too
<Es0teric> yfeldblum so it would be more pub/sub
<Es0teric> right?
<Es0teric> i mean i want everything in that app to be in realtime
<swarley> you keep saying that
<yfeldblum> Es0teric, you can use Celluloid for an actor-based concurrency model for doing that concurrent work if you need it
<arturaz> Es0teric, real advise - just skim over frameworks, read the docs, find one that feels right :)
<swarley> but there are many ways to interpret it
<yfeldblum> Es0teric, you can use Celluloid with Rails, or probably with many of the Ruby web frameworks
<swarley> truly real time would be *very* data expensive, websockets or http-streams
<Es0teric> swarley, let me use this example... when someone creates an event.. i want all people that are involved to instantly recieve it
<Es0teric> *recieve
<arturaz> yfeldblum, +1 for celluloid. We've been using it since early days successfully on our game server. Even laid my hands on some dev. Although to be honest its far from something like Akka in java-land.
<yfeldblum> arturaz, yeah but then you need to be in java-land :D
<arturaz> Es0teric, you want websockets?
<arturaz> yfeldblum, or jruby
<Es0teric> arturaz i dont mind websockets
<Es0teric> i do plan on using HTML5
<swarley> that sounds like something that could be done with javascript and an EventSource
<yfeldblum> arturaz, Akka in JRuby?
<arturaz> yfeldblum, yeah? why the question?
angusiguess has joined #ruby
<Es0teric> swarley see i was looking at nodejs
<Es0teric> for that
<yfeldblum> arturaz, just asking if that's what you meant
<swarley> no i mean
<Es0teric> but the problem with node is that.. it only ouputs in json or text
<Es0teric> not html
<arturaz> yfeldblum, yes, you can use akka from jruby :)
pothibo has joined #ruby
<Es0teric> well from the last time i used node
<swarley> no what I'm saying is that you would create an EventSource object client side
<swarley> and it would listen for events
relixx has joined #ruby
<swarley> coming from the server
<Es0teric> ok does this only apply for ruby?
<arturaz> swarley, transferred by?
<Es0teric> or can it be done in php as well?
<arturaz> websockets?
quest88 has joined #ruby
<arturaz> Es0teric, php generally sucks outside request/response cycle. And as a language too.
JumpMast3r has quit [Quit: JumpMast3r]
<Es0teric> arturaz so then this is for ruby
<swarley> I've done it with sinatra, I'm not really sure how you would go about doing it with another framework
brianpWins has joined #ruby
iamjarvo has quit [Quit: Leaving.]
<Es0teric> swarley this is for ruby right?
<swarley> EventSource is JAVASCRIPT. you would put it in <script> tags in the page the user is on
<Es0teric> right
etcetera has joined #ruby
daniel_- has joined #ruby
Umren has quit [Read error: Connection reset by peer]
<Es0teric> i mean i have no problem building it in ruby... i just have to get used to the OO aspect of it
<Es0teric> but at the same time, i am looking for something that will be better in the long run
<swarley> actually
<swarley> that's a better link for what you want
angusiguess has quit [Ping timeout: 245 seconds]
<arturaz> Es0teric, php gains you sort of simplicity and tons of uneducated programmers. ruby gains you nice OOP model, lots of gems and an ability to run on quite nice performance using jruby. Scala gains you static typing that helps to avoid bugs, massive performance boost, but lacks in libraries and is in general more "mathy".
<arturaz> Determine what client-server communication you need, pick your language/framework based on that.
mityaz has quit [Remote host closed the connection]
<Es0teric> arturaz i see
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
<Es0teric> i mean with php i find myself using composer alot
<Es0teric> but i mean... even that is alittle frustrating
<invisime> it's also worth noting that the *VAST* majority of applications don't have to worry about scalability.
TomJ has quit [Client Quit]
<Es0teric> so wait
<Es0teric> i can use nodejs to talk to ruby
<Es0teric> and provide something similar
<Es0teric> right?
<arturaz> no
<swarley> here
<swarley> activity stream plugin for rails
JoeyJoeJo has quit [Ping timeout: 264 seconds]
<arturaz> Developed and tested on Rails 2.1
<arturaz> yeah...
<arturaz> that's old
<swarley> arturaz; to be fair
<swarley> he's asking a rails question in #ruby
<swarley> #rubyonrails
<swarley> might be better
<swarley> I have literally never used rails past a hello world
<Es0teric> lol
etcetera has quit [Ping timeout: 260 seconds]
marr has joined #ruby
cparen has quit [Quit: cparen]
<Dwarf> Hello folks, care to give me a hand? Can you name the first three words that come up in your head when you see the word programming?
ryanf has joined #ruby
thufir_ has joined #ruby
<havenwood> Dwarf: Ruby, nunchucks, brunch
<arturaz> Dwarf, bros, donkeys, sunglasses
<Dwarf> Thanks guys :D
cwd1 has joined #ruby
kirun has quit [Quit: Client exiting]
codecop has quit [Remote host closed the connection]
cwd1 has quit [Remote host closed the connection]
jarjar_prime has joined #ruby
etcetera has joined #ruby
M13 has joined #ruby
<M13> hello, how do you compile ruby??
<jarjar_prime> M13: what OS?
<M13> Puppy Linux
<M13> I have the rb exe.
kofno has quit [Remote host closed the connection]
<Dwarf> exe.
<Dwarf> May I ask, how long have you been using linux?
<M13> executable
<Dwarf> Oh god I thought you meant .exe file
whowantstolivef1 has quit [Quit: quit]
<M13> ohh, lol
<Dwarf> I was like
<Dwarf> wat
<M13> no, I have windwos
Vert has joined #ruby
<Dwarf> But puppy linux..?
<M13> so, how do you compile this?: https://github.com/hut/ranger/tree/v0.1.0
<M13> puppy Linux, google it
<M13> its a small linux distro
<Dwarf> Eh
<M13> it comes with the rb executable
<Dwarf> You don't compile ruby
<Dwarf> Ruby is ran with an interpreter
ashp has left #ruby [#ruby]
<M13> so its run with the rb executable?
<M13> rm
<M13> fm I mean
<Dwarf> Type "rb fm"
<sterk> Is *[*x] a stupid thing to do if I need an array and x can be either an array or a single value? (Meaning, are there any other way I should do it?)
<Dwarf> Without quotes of course
<M13> ok, thanks
<Dwarf> sterk, in what context?
<sterk> Dwarf: (*[*x]).map { ... }
<Dwarf> I should learn more ruby
icole has joined #ruby
mengu_ has quit [Quit: This computer has gone to sleep]
<M13> I think my graphics card just blew up... :/
<Dwarf> oops
grzywacz has quit [Ping timeout: 248 seconds]
qpf has joined #ruby
cyong has joined #ruby
kofno has joined #ruby
cyong has quit [Client Quit]
mengu_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
kofno has quit [Remote host closed the connection]
fjfish has joined #ruby
cyong has joined #ruby
jdstraughan has joined #ruby
<kalleth> say i have an object, and i want to create a block using that object with every operatin inside the block operatnig on that object
<kalleth> with @object do; save_item, do_stuff; end replacing @object.save_item, @object.do_stuff
<kalleth> i know I can do that, not sure how
arya has joined #ruby
francisfish has quit [Ping timeout: 248 seconds]
dmiller has quit [Read error: Operation timed out]
alanp_ has joined #ruby
<arturaz> kalleth, @object.with do; ...; end
alanp has quit [Ping timeout: 246 seconds]
<arturaz> and with is def with(&block); instance_eval(&block); end
clj_newb has quit [Quit: Lost terminal]
<arturaz> something along these lines
<arturaz> you want self in the block to point to @object
<kalleth> hmmm
seba4 has quit [Ping timeout: 248 seconds]
spider-mario has quit [Remote host closed the connection]
rakun has joined #ruby
gcoderre has joined #ruby
hackerdude has joined #ruby
chrishough has quit [Quit: chrishough]
etcetera has quit []
razibog has quit [Ping timeout: 255 seconds]
adeponte has quit [Remote host closed the connection]
workmad3 has joined #ruby
nfk has quit [Read error: Operation timed out]
banister_ has joined #ruby
kmurph has joined #ruby
palyboy has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banister_ has quit [Read error: Connection reset by peer]
fedza_ has joined #ruby
M13 has quit [Quit: Leaving]
banisterfiend has joined #ruby
adeponte has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
idkazuma has joined #ruby
jonathanwallace1 has joined #ruby
seba4 has joined #ruby
jonathanwallace has quit [Ping timeout: 255 seconds]
kmurph has quit [Ping timeout: 252 seconds]
gcoderre has quit [Quit: gcoderre]
fedza has quit [Ping timeout: 255 seconds]
nfk has joined #ruby
chrishough has joined #ruby
caleb_io has quit [Quit: caleb_io]
apok has joined #ruby
arya has quit [Ping timeout: 248 seconds]
angusiguess has joined #ruby
caleb_io has joined #ruby
techlife has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
arya has joined #ruby
techlife has joined #ruby
icole has quit [Remote host closed the connection]
BadLarry has quit [Quit: quitting]
hmarr has joined #ruby
BadLarry has joined #ruby
kofno has joined #ruby
samphippen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
kmurph has joined #ruby
adeponte has joined #ruby
samphippen has joined #ruby
mengu_ has quit [Quit: This computer has gone to sleep]
tjbiddle has joined #ruby
baphled_ has quit [Ping timeout: 255 seconds]
hmarr has quit [Quit: Computer has gone to sleep.]
cawaker has quit [Remote host closed the connection]
cawaker has joined #ruby
apok has quit [Quit: apok]
<jokke> is there a clever way to group an array of objects by a certain attribute of those objects?
alanjc has joined #ruby
<banisterfiend> jokke: group_by
apok has joined #ruby
danneu has joined #ruby
Proshot has quit [Quit: Leaving]
caleb_io has quit [Quit: caleb_io]
<jokke> banisterfiend: yes but i can only say something like group_by {|obj| obj.attr == "foo"}
<jokke> but i want objects with the _same_ attributes to be grouped together
punk_ has joined #ruby
punk_ has quit [Client Quit]
<banisterfiend> jokke: can u post a gist showing what u mean
<jokke> well no, because i have no clue
<jokke> i try to explain
samphippen has quit [Quit: Computer has gone to sleep.]
sorbo_ has quit [Quit: sorbo_]
<jokke> i have a class Dependency which has three attributes: name, version and op
ahokaomaeha has joined #ruby
apok has quit [Client Quit]
<jokke> now i defined a class method which gets an array of Dependency objects and has to play around with them. For one it has to group those dependencies, that have the same name
onemanjujitsu has quit [Quit: onemanjujitsu]
generalissimo has quit [Remote host closed the connection]
chrishough has quit [Quit: chrishough]
<jokke> so if i have dep_a = Dependency.new "foo", "1.0", "=" and dep_b = Dependency.new "foo", "2.0", "<="
cawaker has quit [Ping timeout: 252 seconds]
<banisterfiend> jokke: deps.group_by { |dep| dep.name } ?
<jokke> and my class method gets [dep_a, dep_b] it should return [[dep_a, dep_b]]
arya has quit []
wyhaines has quit [Remote host closed the connection]
<jokke> banisterfiend: oh that does it?
<jokke> :D
reset has joined #ruby
sailias has joined #ruby
havenwood has quit [Remote host closed the connection]
Billiam_ has joined #ruby
monkegjinni has quit [Remote host closed the connection]
billiam has quit [Ping timeout: 246 seconds]
angusiguess has quit [Ping timeout: 255 seconds]
<banisterfiend> jokke: you can even group by all attributes by doing this: deps.group_by { |dep| [dep.x, dep.y, dep.z] }
<banisterfiend> it'll group according to which objects have those attributes in common
<jokke> okay, good to know
<jokke> thanks
ctult has quit [Ping timeout: 276 seconds]
jamescarr has joined #ruby
idkazuma has quit [Remote host closed the connection]
<maetthew> This might be kinda weird question but I'm not really sure what to search for. I want to make a quite simple script that I can invoke from command-line.
<maetthew> someone point me in the right direction :)
JumpMast3r has joined #ruby
ShellFu has joined #ruby
<banisterfiend> maetthew: google for Thor
jowee has joined #ruby
<maetthew> banisterfiend: cool looks sweet
<maetthew> thanks
arturaz has quit [Remote host closed the connection]
<ShellFu> Hey All I have two hashes. >h1 = {"item" => {"key1" => "value1"}}< and >h2 = {"item" => {"key2" => "value2"}}< How can I merge h1 and h2 on item and append the key1 and key2 value pairs?
jamescarr has quit [Ping timeout: 244 seconds]
dnordstrom has quit [Ping timeout: 252 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<ShellFu> to end up with {"item" => {"key2" => "value2", "key1" => "value1"}} something like that
<maetthew> banisterfiend: lol it even has source code for basically exactly what i want to do
<maetthew> fetch stuff from git
<ShellFu> ive tried variations on merge and inject, but i cannot seem to keep the key value pairs they overwrite
<banisterfiend> maetthew: where are you looking? link?
<maetthew> banisterfiend: http://whatisthor.com/
<banisterfiend> thx
<jokke> what method does sort_by use on the objects to sort?
invisime has left #ruby [#ruby]
<maetthew> the last code example on the page. if that's what you're looking for
<jokke> and can i rewrite it?
AntiTyping has joined #ruby
<danneu> ShellFu: h1["item"].merge!(h2["item"]) will mutate h1
<ShellFu> hmm havent tried the merge! only merge. Ill lookup the difference if it works like I expect.
brianpWins has quit [Quit: brianpWins]
<vetsin> whats the best way to regex match a string and for each do a function on the match
<banisterfiend> jokke: anyway, it uses <=>
<vetsin> is it ''.gsub(//) { }
zigidias has quit [Ping timeout: 276 seconds]
<jokke> ah okay great
fixl has joined #ruby
<jokke> thanks ;)
<ShellFu> danneu, what if I do not know the exact string of item. It could potentially be any string based of user input
<ShellFu> can I use h1.keys?