apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p286: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com
<voodoofish430> is there a quick way to create a hash or do you always have to do myhash= Hash.new?
<blazes816> {}
<blazes816> myhash = {}
<voodoofish430> ah
<voodoofish430> hmm..
<voodoofish430> maybe thats why...
<blazes816> why what?
<apeiros_> I hope you don't do Array.new and String.new…
<voodoofish430> no...
<blazes816> def hash_factory; Hash.new{nil}; end
<apeiros_> class HashFactoryFactoryFactory
slainer68 has quit [Ping timeout: 255 seconds]
<apeiros_> hash_factory_factory = HashFactoryFactoryFactory.new; hash_factory = hash_factory_factory.new; hash = hash_factory.new
* apeiros_ misses java
jenrzzz has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
pdtpatr1ck has joined #ruby
headius has joined #ruby
rmillerx has joined #ruby
yoklov has quit [Quit: computer sleeping]
<arietis> wonder how long will it take to calculate 62,500,500,000 iterations for ruby
rmillerx has quit [Client Quit]
<apeiros_> long
<arietis> longer than hour?
<apeiros_> that depends on what you do in your loop
<apeiros_> and your computers horse power, of course
Vert has quit [Ping timeout: 252 seconds]
yoklov has joined #ruby
<arietis> i'm doing a + b + c
<apeiros_> you test with a set of 100, maybe 1000
<apeiros_> bench that
slainer68 has joined #ruby
<apeiros_> then you can assess how long it will approximately take
Serial_Killer_C has joined #ruby
<atmosx> arietis: there's a project on kickstart, called parallela, home-based super-computer, willl suit you ;-)
<apeiros_> if you store data somewhere, it might take longer (memory allocation, gc, swapping etc.)
c0rn_ has quit [Quit: Computer has gone to sleep.]
<apeiros_> arietis: sounds like you're brute-forcing a project euler…
chrishunt has quit [Quit: Leaving...]
<arietis> trying to find out how many numbers i need from 1 to n to get arithmetic progression = specific value
<arietis> :)
glyytchy has joined #ruby
<arietis> so idecided to do it hard way
<arietis> and very dumb one
<arietis> it's slow but it works
<arietis> using 1 core of core 2 duo with 2.0GHz
<apeiros_> assuming one iteration is 1µs (1e-6), it'll take almost a day
<apeiros_> if one iteration takes 1ms, it'll be something around 2 years
kenichi is now known as kenichi-away
<arietis> lol
<apeiros_> you *might* want to do that bench of 1000 iterations…
<arietis> indeed
<arietis> or better algorithm
<apeiros_> well, I'd decide on that after the test run
<apeiros_> if it is 10ns/iteration, then you're fine… only a couple of minutes then
<arietis> 100 takes 1s
<apeiros_> (but I'd bet that it's more in the range of 10-100µs)
<apeiros_> haha
<apeiros_> yeah, 20 years or so then
<arietis> how do i test?
<apeiros_> enjoy your waiting time
<arietis> 1s is my estimation
<apeiros_> take a look at the Benchmark module (stdlib)
mercwithamouth has joined #ruby
awarner has quit [Remote host closed the connection]
<arietis> 10000 takes about 8s
<apeiros_> 10+20+30 on my machine takes 0.1µs on average
<arietis> looks liek i need better algorithm
<arietis> :)
<apeiros_> well, then go ahead and calculate the required time. I'd say you should start to improve the algorithm
<apeiros_> yeah
<arietis> actually it's 85000 iterations
<apeiros_> that's slightly less than the initially stated 62,500,500,000
<arietis> yeah but complexity is higher
<arietis> with higher value
<apeiros_> (and I still think the swiss thousands mark is superior: 62'500'500'000 - no confusion with decimals)
<arietis> since i have loop in loop
Serial_Killer_C has quit [Remote host closed the connection]
glyytchy has quit [Quit: glyytchy]
<apeiros_> that's called O(n^2) usually (or O(n*m))
<blazes816> there's also no confusion with decimals if europeans wouldn't use commas as decimals
<apeiros_> wrong
<apeiros_> with printed text maybe
<apeiros_> but people write horribly by hand
<apeiros_> but even with printed text… if your printer has a bit of ink-bleed or somesuch…
BSaboia__ has quit [Read error: Connection reset by peer]
<apeiros_> ' is rather hard to mistake for , or .
<blazes816> unless it's written horribly or the printer sucks
<apeiros_> I'M SWISS, I KNOW ABOUT BANKING AND MONEY, DAMIT!!!
<apeiros_> ;-p
<blazes816> haha
emmanuelux has quit [Remote host closed the connection]
<blazes816> also neutrality
<apeiros_> yes, but that stuff happens. and when money is involved, you don't want ambiguity. come on, you as a programmer should be on my side!
<apeiros_> yeah, damn neutrals…
<apeiros_> you never know on whose side they are…
* apeiros_ really got to learn that quote by zap
mneorr_ has quit [Read error: No route to host]
ebobby has quit [Quit: Lost terminal]
tyfighter has quit [Quit: tyfighter]
k610 has joined #ruby
<arietis> apeiros_: took 1s to get value with binary search
blazes816 has quit [Quit: blazes816]
<arietis> :)
Araxia has quit [Quit: Araxia]
<apeiros_> errrrrrrrrrrr… ok
k610 has quit [Ping timeout: 272 seconds]
caleb_io has joined #ruby
k610 has joined #ruby
arubin has joined #ruby
mikepack has quit [Remote host closed the connection]
<arietis> used linear one 1st time
<arietis> looks like bad idea for big amount of iterations
<apeiros_> orly? :)
<arietis> yeah, i thought it's ok
mneorr has joined #ruby
<apeiros_> if you do shitloads of iterations, just run a small batch in a bench. not that hard.
* apeiros_ has Kernel#bench, #pbench and #mbench for that in his irbrc
Brainix has joined #ruby
<arietis> well, i did it only once to pass some puzzle question
<arietis> :)
mneorr has quit [Read error: Connection reset by peer]
<arietis> ruby is nice for such challenges
<arietis> :)
k610 has quit [Ping timeout: 255 seconds]
mneorr has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
artOfWar has quit [Ping timeout: 252 seconds]
akem has quit [Max SendQ exceeded]
chrishunt has joined #ruby
akem has joined #ruby
Servidorv has quit [Quit: Always try to be modest, and be proud about it!]
akem has quit [Max SendQ exceeded]
caleb_io has quit [Quit: caleb_io]
hron84 has quit [Quit: Leaving.]
headius has quit [Quit: headius]
daniel_- has quit [Ping timeout: 245 seconds]
chrishunt has quit [Quit: Leaving...]
gridaphobe` has quit [Read error: Operation timed out]
eph3meral has quit [Quit: eph3meral]
jenrzzz has quit [Ping timeout: 245 seconds]
Takehiro has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
seanstickle has joined #ruby
[Pi] has joined #ruby
Takehiro has quit [Ping timeout: 245 seconds]
<atmosx> good night
dnstbr has joined #ruby
savage- has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
atmosx has quit [Quit: quiting...]
apok_ has joined #ruby
apok_ has quit [Client Quit]
emergion has joined #ruby
<elliottcable> Hey, y'all. Does `next` inside a {..block..} just break out of the block, or also iterate the entire surrounding looping structure?
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<waxjar> elliottcable, it just skips whatever is after it i believe and goes on with the next iteration
apok has quit [Ping timeout: 244 seconds]
<waxjar> *next object in line
dakine has joined #ruby
<waxjar> [1,2,3].each { |x| next; puts 'never printed' }
jamjam has joined #ruby
niklasb has quit [Ping timeout: 260 seconds]
centr0 has left #ruby [#ruby]
g0bl1n has quit [Ping timeout: 248 seconds]
seanstickle has quit [Quit: seanstickle]
baroquebobcat has quit [Quit: baroquebobcat]
fungoat has joined #ruby
<apeiros_> elliottcable: next returns from the block to the yielding method
<apeiros_> and it returns with the value passed to next (defaulting to nil)
<elliottcable> apeiros_: damn. okay, thanks.
<elliottcable> how's life? long time no see.
<apeiros_> life's fine
<apeiros_> enjoying sc2 and some js at the moment
<elliottcable> <3 JS :3
<apeiros_> meh, js' stdlib is shit
<apeiros_> and the language has tons of syntactical shortcomings
kbeddingfield has quit [Remote host closed the connection]
<apeiros_> but if you want, you can review my benchmark utility function in a bit. I'm not quite sober anymore, so a peer review might not be a bad idea…
manizzle has quit [Ping timeout: 252 seconds]
Kichael has joined #ruby
jamjam has quit [Ping timeout: 260 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
* elliottcable laughs
Cultofmetatron has joined #ruby
ffranz has quit [Quit: Leaving]
<elliottcable> don't all languages, though? And I'm, personally, not a big fan of the idea of a “standard library.”
<apeiros_> elliottcable: with js, you want one. a big one.
<apeiros_> for the simple reason that you don't want to push a few megabytes of your own library over the wire all the time
mercwithamouth has quit [Ping timeout: 256 seconds]
<apeiros_> and things like encryption, decryption, compression, decompression, image processing etc. would be quite nice, especially with some hardware support
<apeiros_> and that can only be provided by a browser supplied stdlib
<elliottcable> I'd argue that better caching, and publically-available and widely-utilized libraries (such as jquery served via Google's CDN, or similar) is a better solution
dylanjha has quit [Quit: Leaving...]
<apeiros_> no
<elliottcable> as for hardware support, again, internalization to the language isn't the solution
<elliottcable> not a conversation to muck up #Ruby with. Check your /invite!
Monie has quit [Ping timeout: 260 seconds]
Cultofmetatron has quit [Remote host closed the connection]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
caleb_io has joined #ruby
zomgbie has quit [Ping timeout: 246 seconds]
<elliottcable> Is there any way to break out of an outer loop? I can't remember if Ruby's got named loops.
<apeiros_> throw/catch
akem has quit [Ping timeout: 268 seconds]
awaage has joined #ruby
dakine has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
carlzulauf has quit [Ping timeout: 260 seconds]
hotovson has quit [Remote host closed the connection]
carlzulauf has joined #ruby
nesoi has joined #ruby
jarred has quit [Quit: jarred]
<nesoi> ruby is complaining about an if clause I have like this: if (Model.where(query) or Model.where(query)
<nesoi> it doesn't like the or
<nesoi> should be: if (Model.where(query) or Model.where(query))
<nesoi> it complains "expecting )"
<nesoi> how would I say that?
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
<apeiros_> you're missing a ) somewhere
<apeiros_> it doesn't have an issue about the or
<apeiros_> and it says so actually…
tvw has quit [Ping timeout: 245 seconds]
Hanmac1 has joined #ruby
<nesoi> hm. I guess I should have used
<nesoi> ||
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<nesoi> but that also fails the same way
<apeiros_> …
<nesoi> ?
<apeiros_> "let's not figure out what I did wrong, playing guessing games is so much more fun"
<nesoi> I counted the parens
<apeiros_> ruby is better at counting the parens and putting them into context…
mikepack has joined #ruby
<nesoi> also, the statement used to be: if Model.where(querey)
<apeiros_> but yes, if the code isn't what you pasted here, then it might well be because of the 'or'
<nesoi> and I just copied the Model.where(query) and put parens around it
Hanmac has quit [Ping timeout: 252 seconds]
<apeiros_> but in the code which you did post, it *definitively* is not because of the 'or'.
kbeddingfield has joined #ruby
dakine has joined #ruby
<apeiros_> how about you take out the guesswork and put your code up on gist or pastie?
[Pi] has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
Araxia has joined #ruby
helichopter has quit [Quit: Leaving.]
helichopter has joined #ruby
<nesoi> apeiros_
<apeiros_> line 20 closes the opening paren of line 11, the one from line 1 is still open.
mmitchell has quit [Remote host closed the connection]
<apeiros_> unrelated to or vs. ||.
<nesoi> line 19 closes it
<nesoi> no?
Takehiro has joined #ruby
<apeiros_> ah, indeed
baroquebobcat has joined #ruby
<apeiros_> then it's in a part of the code which you didn't paste
<nesoi> I don't think so... that's all I modified
<nesoi> yeah, if I take out everything after the || it runs
<nesoi> after the || and before the final )
zomgbie has joined #ruby
kbeddingfield has quit [Ping timeout: 245 seconds]
<nesoi> I mean, starting with the || and ending before the final )
slainer68 has quit [Remote host closed the connection]
baroquebobcat has quit [Client Quit]
<apeiros_> na, it's because you're having the || on a separate line
<nesoi> oh?
<apeiros_> move it to the same line as `r.date).first ` and it'll work. or/|| doesn't matter
<nesoi> yeah, that worked
<nesoi> thanks
<nesoi> I didn't realize it was picky about that
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<apeiros_> also, My_record --> MyRecord (as per convention)
Takehiro has quit [Ping timeout: 245 seconds]
caleb_io has quit [Quit: caleb_io]
slainer68 has joined #ruby
<nesoi> apeiros_ : what does that mean?
[Pi] has joined #ruby
caleb_io has joined #ruby
<apeiros_> there are naming conventions, code styleguides. and My_records is not following common ruby conventions.
chrishunt has joined #ruby
<nesoi> oh right
pdtpatr1ck has quit [Quit: pdtpatr1ck]
<apeiros_> Constants are CamelCased. all_other_variables are snake_cased
Tref has quit [Remote host closed the connection]
<nesoi> I actually did do that in the actual code. that was just an example :)
eataix has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
havenn_ has joined #ruby
lecreme has quit [Quit: Leaving]
<[Pi]> I am having a horrible time trying to install / update Ruby on OS X lion. I've installed http://unfiniti.com/software/mac/jewelrybox
awaage has quit [Quit: awaage]
DarthGandalf has quit [Read error: Connection reset by peer]
<waxjar> [Pi], this tutorial worked really well for me: http://www.mentalbrew.com/blog/2011/10/24/using-rbenv-to-manage-your-ruby-installs/
zomgbie has quit [Ping timeout: 240 seconds]
Cultofmetatron has joined #ruby
drago757 has joined #ruby
<havenn_> Pi: Have you installed Xcode with Command Line Tools? Homebrew?
LouisGB has quit [Ping timeout: 244 seconds]
<apeiros_> how about he describes what's going wrong first, before we jump to conclusions?
<apeiros_> but srsly, today is horrible - full of people who don't think it'd matter to actually *describe* their issue
headius has joined #ruby
DarthGandalf has joined #ruby
SPYGAME has quit [Ping timeout: 240 seconds]
<[Pi]> when I run it it presents http://cl.ly/KT6A I figure I need to install the latest Ruby, http://cl.ly/KTkc but when I hit ' install ', it crashes out. I just managed to grab the momentary screenshot http://cl.ly/KSev/Screen%20Shot%202012-10-27%20at%2002.52.01.png
<[Pi]> apeiros_: give me a chance, I'm slow
<apeiros_> [Pi]: k, my apologies.
SPYGAME has joined #ruby
<[Pi]> havenn_: not sure whether or not I have the commandline tools... And I may have fiddled around with homebrew at some point
codezombie has joined #ruby
joeycarmello has joined #ruby
<[Pi]> my system is going to be quite a mess I think. I've been working purely within Xcode, and now I've moved to Unity and been working purely within that
butblack has joined #ruby
<nesoi> ok, thanks apeiros_! later..
nesoi has left #ruby [#ruby]
carlzulauf has quit [Ping timeout: 260 seconds]
voodoofish430 has quit [Quit: Leaving.]
<[Pi]> this is the first time I have actually needed something outside of these frameworks ( https://gist.github.com/3780235 )
dylanjha has joined #ruby
joeycarmello has quit [Ping timeout: 240 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
carlzulauf has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
bitZero__ has quit [Quit: leaving]
* [Pi] reads waxjar's link
bitZero__ has joined #ruby
pipopopo has quit [Ping timeout: 268 seconds]
arubin has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Ruler_Of_Heaven_ has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
blazes816 has joined #ruby
cakehero has joined #ruby
fungoat has quit [Quit: fungoat]
havenn_ has quit [Remote host closed the connection]
angusmorrison has quit [Quit: angusmorrison]
dylanjha has quit [Quit: Leaving...]
<[Pi]> havenn: I didn't have the command line developer tools, currently installing them from Xcode's preferences -> downloads
<[Pi]> I need homebrew as well?
<waxjar> home-brew's always good to have. if your still following my links guide you need it as well i believe
cakehero has quit [Quit: Computer has gone to sleep.]
mmealling has joined #ruby
thone has joined #ruby
thone_ has quit [Ping timeout: 244 seconds]
zomgbie has joined #ruby
<[Pi]> Is anyone using this JewelryBox GUI? I don't think it's ready for public release, any error in the installation and it instantly blanks the screen... no indication of where to find the log
<[Pi]> installation gets a bit further before dying
<[Pi]> maybe if I update my homebrew as well it will complete...
dylanjha has joined #ruby
spygame213 has joined #ruby
SPYGAME has quit [Ping timeout: 240 seconds]
caleb_io has quit [Quit: caleb_io]
love_color_text has joined #ruby
<apeiros_> I'd open an issue/ticket/bugreport
headius has quit [Quit: headius]
emergion has joined #ruby
zomgbie has quit [Ping timeout: 252 seconds]
<[Pi]> I'm not finding homebrew from the command line... and the links I'm finding all suggest installing it into /usr/local/
<[Pi]> but it appears I don't have a /usr/local/
spygame213 has quit [Ping timeout: 244 seconds]
<[Pi]> what should I use instead?
davidcelis has joined #ruby
jlwestsr has joined #ruby
<apeiros_> you generally just use the default settings. those are the best tested settings.
SPYGAME has joined #ruby
<[Pi]> https://github.com/mxcl/homebrew/wiki/Installation ... 'The standard script installs Homebrew to /usr/local' ... I don't seem to have /usr/local http://pastebin.com/vZd162Tm
quest88 has joined #ruby
<apeiros_> I don't think I created /usr/local by hand when I installed homebrew, I'd assume it will create it if it isn't present.
radic has quit [Ping timeout: 246 seconds]
spygame213 has joined #ruby
SPYGAME has quit [Ping timeout: 246 seconds]
<waxjar> /usr/local exists, its just a hidden folder
angusmorrison has joined #ruby
datafirm has joined #ruby
<datafirm> hello!
<datafirm> I have a rake task (worker) running and I want to HUP (or something similar) to reload the code but keep the process running. Do I have to intercept this signal myself, or is there a standard way of doing such?
nari_ has joined #ruby
mercwithamouth has joined #ruby
<apeiros_> datafirm: see Kernel#trap
<datafirm> apeiros_: Thanks. Sounds like I need to interpret the signal and do the reloading myself.
<rking> datafirm: I'm confused at what it is you don't want to do.
<rking> You mean the reloading part in particular?
kbeddingfield has joined #ruby
<rking> The problem with reloading .rb's is that many of them do not act identically upon reload, so it's a bit hard to make a general solution. Maybe there's a gem that helps
<datafirm> rking: I have foreman running a batch or processes and I want to one ruby process to reload it's codebase, but not die.
dylanjha has quit [Quit: Leaving...]
<datafirm> rking: It's a simple rack app, so I'll see what I can come up with.
aboudreault has joined #ruby
aboudreault has left #ruby ["Leaving"]
<datafirm> rking: Im also using a gem called guard to hellp.
Takehiro has joined #ruby
<datafirm> So Im trying got write script in guard knowing that I have the pid of the process needing to restart
FifthWall has joined #ruby
angusmorrison has quit [Read error: Connection reset by peer]
angusmorrison has joined #ruby
radic has joined #ruby
<[Pi]> waxjar: after installing homebrew it appears to be visible http://pastebin.com/Uqh68JdU
<apeiros_> shotgun is also a reloader
<datafirm> rking: I'll take a look at that.
<apeiros_> reloading ruby code can't present a couple of issues, though
<rking> can't present?
<[Pi]> 'homebrew doctor' gives me a warning ( in that link ) that I might want to move MacPorts or Fink
kbeddingfield has quit [Ping timeout: 240 seconds]
cakehero has joined #ruby
<[Pi]> if anyone knows that I need to do this, please do say
<rking> datafirm: Hrm. class_loader just uses constant polling. not great
<waxjar> no idea [Pi]
<rking> But probably good enough for dev
<datafirm> rking: I may use a technique like such: https://github.com/guard/guard-rack/blob/master/lib/guard/rack/runner.rb
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<datafirm> suppose I don't really care if it dies. I just need to be sure that my modifications to foreman rewrite the pid correctly
Takehiro has quit [Ping timeout: 245 seconds]
angusmorrison has quit [Client Quit]
<[Pi]> <sigh> even with successful installation of developer commandline tools ( through Xcode ) and homebrew, JewelryBox fails
<datafirm> rking: actually, when the process dies, so does foreman.. hmm
love_color_text has quit [Remote host closed the connection]
butblack has quit [Quit: butblack]
<waxjar> [Pi] just give up jewelrybox, you'll be working plenty with the CLI anyway probably
bapa has quit [Read error: Connection reset by peer]
joast has quit [Quit: Leaving.]
<[Pi]> waxjar: mmk
slainer68 has quit [Remote host closed the connection]
`brendan has joined #ruby
bapa has joined #ruby
hsbt is now known as hsbt_away
dylanjha has joined #ruby
cakehero has quit [Client Quit]
mmitchell has joined #ruby
lecreme has joined #ruby
Hanmac has joined #ruby
headius has joined #ruby
mmitchell has quit [Ping timeout: 245 seconds]
lecreme is now known as BoomCow
scx has quit [Ping timeout: 248 seconds]
a_a_g has joined #ruby
mmealling has quit [Quit: Leaving.]
Nisstyre-laptop has joined #ruby
macabre has joined #ruby
Hanmac1 has quit [Ping timeout: 276 seconds]
scx has joined #ruby
vitor-br has joined #ruby
kbeddingfield has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
slainer68 has joined #ruby
slainer68 has quit [Remote host closed the connection]
hbpoison has quit [Read error: Connection reset by peer]
kaawee has quit [Ping timeout: 260 seconds]
g-ram has quit [Quit: Computer has gone to sleep.]
drago757 has quit [Quit: drago757]
mmealling has joined #ruby
cobragoat has joined #ruby
Cultofmetatron has joined #ruby
g-ram has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
zomgbie has joined #ruby
shadoi has quit [Quit: Leaving.]
jlwestsr has quit [Ping timeout: 246 seconds]
mikepack has quit [Remote host closed the connection]
scx has quit [Read error: Connection reset by peer]
n_blownapart has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
omry has quit [Ping timeout: 252 seconds]
macmartine has joined #ruby
butblack has joined #ruby
zomgbie has quit [Ping timeout: 265 seconds]
<n_blownapart> http://pastie.org/5121932 hi . I'm trying to figure out lines 6,7 and 12-17 in this prog. i.e. I'm still not sure what an enum is. thanks.
macmartine has quit [Client Quit]
emergion has quit [Quit: Computer has gone to sleep.]
iamjarvo has joined #ruby
spygame213 has quit [Ping timeout: 255 seconds]
SPYGAME has joined #ruby
cobragoat has quit [Ping timeout: 265 seconds]
mmitchell has joined #ruby
nappy has joined #ruby
SCommette has joined #ruby
jlwestsr has joined #ruby
SCommette has quit [Client Quit]
tekknolagi has joined #ruby
<tekknolagi> hi guys, quick question. i'm using datamapper with a redis adapter for a db
<tekknolagi> and for some reason when i try and query (with .where), i get a NoMethodError
<tekknolagi> you can see this live at brightswipe.com - just try and upload/tag a torrent.
<tekknolagi> (it's in dev mode so it will show code)
<tekknolagi> what's wrong?
ryanf has quit [Ping timeout: 260 seconds]
jaygen has quit [Remote host closed the connection]
dylanjha has quit [Quit: Leaving...]
Cultofmetatron has joined #ruby
spygame213 has joined #ruby
<blazes816> tekknolagi: i'm looking at the DM docs right now and I don't see anything about a where method
SPYGAME has quit [Ping timeout: 246 seconds]
<tekknolagi> blazes816: okay i might have completely confused it for another ORM. hang on.
<blazes816> Arel/ActiveRecord3 has where
<blazes816> that could be what you're thinking of
<blazes816> most tutorials and stuff will use AR, not DM
<tekknolagi> ....okay yeah ActiveRecord.
<tekknolagi> i am officially an idiot
<tekknolagi> thanks :)
<blazes816> np
<blazes816> lol, no worries
<blazes816> looks like DM uses very similar syntax to AR2 if you ever used it
<blazes816> regardless, the docs are pretty good
<tekknolagi> so can i use .all?
<tekknolagi> brb a sec
butblack has quit [Quit: butblack]
lahwran has quit [Excess Flood]
<blazes816> looks like it
<tekknolagi> blazes816: okay now i get no method aggregate:
<tekknolagi> (just refresh and try the POST again)
<tekknolagi> brb
mmitchell has quit [Remote host closed the connection]
joast has joined #ruby
<blazes816> okay, now that looks like an issue with the Redis adapter
jarred_ has joined #ruby
<blazes816> it appears to have not implemented that method
<blazes816> :(
<tekknolagi> blazes816: dammit. is there a way i could check if a list is empty otherwise?
datafirm has quit [Quit: datafirm]
<tekknolagi> instead of .count > 0, that is
emergion has joined #ruby
<blazes816> list.empty?
<tekknolagi> hmm
<tekknolagi> trying
<tekknolagi> brb
Takehiro has joined #ruby
<tekknolagi> (i have irssi and tmux running in the same window, have to switch between)
<blazes816> that sucks man, but np
<tekknolagi> blazes816: aaaagh. okay. so the .empty? == false worked, but now i have "no method .include?" for some code that (at least i think) doesn't check that
<blazes816> if model.allowed_writer_methods.include?(setter = "#{name}=")
<blazes816> is the line
Cultofmetatron has quit [Remote host closed the connection]
<blazes816> so, allowed_writer_methods is returning nil
<tekknolagi> hmm. what does that mean for me?
<blazes816> not quite sure yet
<tekknolagi> (i'm not exactly sure what's going on behind the scenes with datamapper or the redis adapter)
<tekknolagi> i mean i could switch to mysql if it's that bad
<blazes816> can you gist your Tag model?
<blazes816> m
<tekknolagi> sure
<blazes816> me either
spygame213 has quit [Ping timeout: 246 seconds]
<blazes816> redis and mysql are for different jobs
cableray has quit [Quit: cableray]
<blazes816> redis is a key-value store
<blazes816> if
Takehiro has quit [Ping timeout: 245 seconds]
<tekknolagi> blazes816: but that's abstracted away by this ORM
<blazes816> if you need real relational data you should use mysql or postgres
SPYGAME has joined #ruby
<tekknolagi> blazes816: i need pseudorelational data, which redis works for
dnstbr has quit [Quit: Computer has gone to sleep.]
<tekknolagi> also the entire source will go on github as soon as it starts working
<blazes816> so it looks like perhaps the Redis adapter is the issue, but i'm not sure
lahwran has joined #ruby
<tekknolagi> oh lovely.
k0nichiwa has quit [Ping timeout: 240 seconds]
<blazes816> for every property DM should generate a writer method
__miha__ has joined #ruby
<blazes816> like, name=
[Pi] has quit [Remote host closed the connection]
<__miha__> fafs
<tekknolagi> i mean i used to hard-code this redis shit. but i'd rather not right now.
Serial_Killer_C has joined #ruby
<blazes816> for sure
butblack has joined #ruby
n_blownapart has quit [Remote host closed the connection]
<blazes816> try it with mysql instead of redis and see if it changes anything
<tekknolagi> alright. mysql server here we come...
<blazes816> my bet is it does
<blazes816> perhaps sqlite3?
spygame213 has joined #ruby
<tekknolagi> is mysql the default? and i'd rather not use sqlite
<tekknolagi> i used it beforehand, as you can see at github.com/tekknolagi/indexer
<blazes816> i think mysql IS the default these days
<tekknolagi> alrighty will report back in a sec
<blazes816> i just like not having to much with having a server up
hsbt_away is now known as hsbt
SPYGAME has quit [Ping timeout: 255 seconds]
helichopter has quit [Ping timeout: 240 seconds]
<blazes816> are you going to Stanford?
<blazes816> (not meaning to creep, but nice job)
hsbt is now known as hsbt_away
tekknolagi has quit [Ping timeout: 240 seconds]
tekknolagi has joined #ruby
<tekknolagi> blazes816: working on mysql at the moment. should be up shortly...
<tekknolagi> still trying to find the redis adaptert hough o.O
<tekknolagi> adapter though*
<blazes816> the DM adapter?
butblack has quit [Quit: butblack]
<tekknolagi> yeah. requires an adapter
<tekknolagi> check out /getting-started.html on the dataqmapper website
<tekknolagi> that's the redis one i used
<tekknolagi> but i'm talking mysql now
<blazes816> OHHH
<blazes816> you said redis on accident
<blazes816> tekknolagi: ^
<blazes816> dm-mysql-adapter
krisbulman has quit [Quit: krisbulman]
datafirm has joined #ruby
Drewch has quit [Ping timeout: 244 seconds]
mmealling has quit [Quit: Leaving.]
mneorr has quit [Read error: Connection reset by peer]
<tekknolagi> blazes816: right but check out brightswipe.com now
<tekknolagi> it's still trying to find dm-redis-adapter
mneorr has joined #ruby
<tekknolagi> forsome weird reason. i bundled again, then restarted...
rakl has joined #ruby
<tekknolagi> brb
<blazes816> did you include Gemfile.lock?
haxrbyte has joined #ruby
Drewch has joined #ruby
Takehiro has joined #ruby
hron84 has joined #ruby
macmartine has joined #ruby
slainer68 has joined #ruby
hron84 has quit [Client Quit]
Slivka has quit [Remote host closed the connection]
sertaconay has joined #ruby
slainer68 has quit [Ping timeout: 255 seconds]
jlwestsr has quit [Ping timeout: 246 seconds]
Playb3yond has joined #ruby
<tekknolagi> blazes816: okay so
<tekknolagi> i bundled, the Gemfile.lock is in the directory
<tekknolagi> and dm-mysql-adapter appears in the stdout of `bundle`
<blazes816> are you using version control? git?
<tekknolagi> yep
<tekknolagi> git
<tekknolagi> but i have not committed since i redesigned anything
<tekknolagi> (raw sqlite -> datamapper)
zomgbie has joined #ruby
<blazes816> wait, is this hosted on your local machine, or a server somewhere?
<blazes816> what I'm getting at
<tekknolagi> haha
<blazes816> is make sure Gemfile.lock is deployed correctly
justinmcp has joined #ruby
<blazes816> that gets me all the time
<tekknolagi> i'm ssh'd into a vps that is both runing this and irssi
<tekknolagi> i'm editing live
<blazes816> nice
<blazes816> cool
<blazes816> so, hmmmm
<tekknolagi> (then i push to github frm there)
Playb3yond has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<blazes816> are you sure you're trying to connect to mysql and not redis still?
<blazes816> and also, have you removed the redis stuff from the Gemfile?
<tekknolagi> i did remove the redis stuff, replacing it with mysql stuff
<tekknolagi> i can push to github if you'd like
<tekknolagi> and i did DataMapper.setup with msyql
<blazes816> go ahead, and I'll see if I can see anything
<tekknolagi> alright
stuartrexking has quit [Quit: Leaving...]
stuartrexking has joined #ruby
<tekknolagi> blazes816: pushed
<tekknolagi> minus the user/pw in the config
zomgbie has quit [Ping timeout: 276 seconds]
stuartrexking has quit [Client Quit]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<blazes816> tekknolagi: DataMapper.setup(:default, {:adapter => "redis"})
<blazes816> tsk tsk tsk!
<tekknolagi> blazes816: ...well i am an idiot
<tekknolagi> okay
<tekknolagi> i need to sleep more -.-
<blazes816> lol, no worries
<blazes816> happens all the time
<blazes816> I had something like: Mail.defaults do{ retrieve…}
<blazes816> that was trippin me up for ever just a bit ago
<tekknolagi> lol
Nisstyre-laptop has quit [Read error: Connection reset by peer]
Nisstyre-laptop has joined #ruby
<tekknolagi> hmm
<tekknolagi> so brightswipe.com loads
<tekknolagi> but no tables at all are in the DB when i check
i8igmac has quit [Remote host closed the connection]
akem has joined #ruby
<tekknolagi> blazes816: hmm
<tekknolagi> blazes816: front page loads, /upload is blank for some reason
<blazes816> did you migrate?
<tekknolagi> i moved no data over
<blazes816> structrual migrations?
<tekknolagi> what do you mean?
<tekknolagi> (sorry jumped into datamapper with no prior experience with ORMs except for ActiveRecord)
<blazes816> you know about AR migrations?
macmartine has joined #ruby
<tekknolagi> Yeah
<tekknolagi> Oh
<tekknolagi> d'oh
<tekknolagi> Fuck I need to get more than three hours a night
cableray has joined #ruby
<blazes816> open pry (or rib, lol) and require your DM environment
<blazes816> then: require 'dm-migrations'
<blazes816> DataMapper.auto_migrate!
<tekknolagi> what are pry and rib?
<blazes816> irb, not rib, lol
<blazes816> stupid mac
<blazes816> irb is the ruby REPL
jaygen has joined #ruby
<blazes816> pry is the new ruby REPL
<tekknolagi> ahhh
<tekknolagi> i know irb
<tekknolagi> never used pry before
<blazes816> check it out man, it's awesome
<tekknolagi> so just require 'data_mapper' then 'dm-migrations' then setup then .auto_migrate!?
<blazes816> but you don't need to worry with now
<blazes816> and your models
<tekknolagi> oh right
<blazes816> but then, yeah, that should work
<blazes816> (I don't use DM, this is from the docs)
<tekknolagi> hmm require 'dm-migrations' returns false but doesn't have a loaderror
<tekknolagi> ...?
hsbt_away is now known as hsbt
<tekknolagi> ooh this could wor
<tekknolagi> k
<blazes816> some things return false
<blazes816> idk why
<blazes816> when your require them I mean
<tekknolagi> blazes816: oh for the love of all that is holy
<tekknolagi> check out the /upload now
<tekknolagi> -.-
mneorr has quit [Remote host closed the connection]
<blazes816> check that that datamappper constant exists
<tekknolagi> eh?
<tekknolagi> it's Tag.create
<blazes816> that's, shit
<tekknolagi> and it says" undefined method include? for nil:NilClass"
<tekknolagi> agh
<blazes816> not cool
<blazes816> basically
<tekknolagi> uh oh
<blazes816> DataMapper.finalize
<blazes816> call it
answer_42 has joined #ruby
kbeddingfield has quit [Remote host closed the connection]
<tekknolagi> in irb?
<blazes816> no
<tekknolagi> where in my code?
<blazes816> in torrentdb.rb probably
a_a_g has quit [Quit: Leaving.]
<blazes816> after your models
<tekknolagi> ah ok
nappy has quit [Quit: Leaving]
emergion has quit [Quit: Computer has gone to sleep.]
<blazes816> (assuming you don't create any models anywhere else)
macmartine has quit [Quit: Computer has gone to sleep.]
<tekknolagi> blazes816: okay so i added it, restarted... testing time
nappy has joined #ruby
ryanf has joined #ruby
<tekknolagi> blazes816: ...now there's some weirdass error
carlyle has joined #ruby
<tekknolagi> i think it's ruby specific
<tekknolagi> rather, not about datamapper
haxrbyte has quit [Remote host closed the connection]
BadProphet has joined #ruby
<blazes816> check that class of tag in insert_torrent
<blazes816> /the/that/
mercwithamouth has quit [Ping timeout: 245 seconds]
carlyle has quit [Remote host closed the connection]
<tekknolagi> in insert_torrent its a string array
mercwithamouth has joined #ruby
<tekknolagi> then in add_tags they get Tag objs
<tekknolagi> then they get iterated over
<tekknolagi> so each should be of class Tag
emergion has joined #ruby
mklappstuhl has joined #ruby
BoomCow has quit [Quit: Leaving]
<tekknolagi> (which is good, presumably)
ryanf has quit [Quit: leaving]
ryanf has joined #ruby
iamjarvo has quit [Quit: Computer has gone to sleep.]
LucidDreamZzZ has quit [Remote host closed the connection]
zeeclor has left #ruby [#ruby]
<tekknolagi> blazes816: fixed by using .new, same error
<tekknolagi> which is weird
mattp_ has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
<blazes816> follow along in the code in functions.rb
<blazes816> starting on 62
<blazes816> tag_objs = add_tags tags
<tekknolagi> right
<tekknolagi> so it's an array of type Tag
<blazes816> in add_tags on 56: objs.push(add_tag tag)
<blazes816> (which is returned in 58)
<blazes816> add_tag (50: return Tag.all :name => tag
pdtpatr1ck has joined #ruby
<blazes816> meaning objs is an array of collections
<tekknolagi> which should be one result
<tekknolagi> oh
<tekknolagi> oh.
<blazes816> a collection of 1 result
kbeddingfield has joined #ruby
<blazes816> if name is unique, you can probably do Tag.find :name => tag
<blazes816> to get 1 result
<tekknolagi> yeah it is
<tekknolagi> ok
<blazes816> now, later one tag will be a result, not a collection
<blazes816> later on*
Serial_Killer_C has quit [Remote host closed the connection]
<tekknolagi> it's an Enumerator...
mmealling has joined #ruby
<blazes816> find must not return a raw model instance
<tekknolagi> well damn
<tekknolagi> what does?
<blazes816> first
<tekknolagi> wait shit i could google this
<blazes816> (just checked docs)
<blazes816> lol
<blazes816> first :name => tag
yakko has joined #ruby
<blazes816> which would be a horrible first name
jlwestsr has joined #ruby
<tekknolagi> aaaand we're live
<tekknolagi> lol
joofsh has quit [Remote host closed the connection]
<blazes816> nice
BadProphet has quit [Ping timeout: 245 seconds]
<tekknolagi> blazes816: does it really work?
<tekknolagi> blazes816: doesn't insert into the db o.O
<blazes816> yep
<tekknolagi> oh well. ok for now.
<blazes816> I downloaded it
<blazes816> so it uploads the file
<blazes816> and I can access it
mmealling has quit [Ping timeout: 245 seconds]
tekknolagi has quit [Ping timeout: 260 seconds]
roadt has joined #ruby
vectorshelve has joined #ruby
kzrl has quit [Ping timeout: 260 seconds]
postmodern has quit [Quit: Leaving]
kzrl has joined #ruby
justinmcp has quit [Remote host closed the connection]
<vectorshelve> is there a way I can better this rake task https://gist.github.com/3963046 it assigns a value to user attribute incrementing each time
mneorr has joined #ruby
mercwithamouth has quit [Ping timeout: 260 seconds]
<blazes816> User.all.each_with_index{|user, i| user.update_attribute(:kid, 111111+i)}
<blazes816> vectorshelve: ^
mneorr has quit [Read error: Connection reset by peer]
zomgbie has joined #ruby
mneorr has joined #ruby
<vectorshelve> blazes816: thanks :)
SPYGAME has joined #ruby
spygame213 has quit [Ping timeout: 245 seconds]
<vectorshelve> blazes816: i can be replaced with a meaningful word.. what could be a meaningful word for increment value ?
<blazes816> index would be the best work
<blazes816> word*
<blazes816> or accum
zomgbie has quit [Ping timeout: 245 seconds]
<vectorshelve> blazes816: but dude... the id isnt get setting in order of id of user.. I expect user with id 1 to have 100000 and user with id 2 to have 100001 like that
<vectorshelve> blazes816: this isnt setting it like that
<blazes816> okay?
<vectorshelve> blazes816: User.all.each_with_index{|user, value| user.update_attribute(:kid, 100000+value)}
<vectorshelve> blazes816: how to modify this so that it starts assigning with 10000 to id 1 and 100001 to id 2 ... and so on ?
<blazes816> yeah, value is really the index of the user in the collection
<blazes816> you can't change your id in active record i don't think
d2dchat has quit [Remote host closed the connection]
<blazes816> User.all.each{|user| user.update_attribute(:id, user.id + 10000)}
<blazes816> if you can
<vectorshelve> blazes816: so should I settle with this https://gist.github.com/3963074 ?
kbeddingfield has quit [Remote host closed the connection]
<blazes816> what I wrote is exactly the same
<blazes816> I only redid the syntax
<blazes816> not the semantics
yakko has quit [Read error: Connection reset by peer]
<blazes816> if that works, do it
<vectorshelve> blazes816: User.all.each{|user| user.update_attribute(:id, user.id + 1)} ryt ?
<blazes816> that will just add 1 to the id
<vectorshelve> blazes816: well.. I want it as short as possible looks good in ruby
<blazes816> which is going to blow up unless it's the last record
hsbt is now known as hsbt_away
yakko has joined #ruby
<vectorshelve> blazes816: where is kid in this ? User.all.each{|user| user.update_attribute(:id, user.id + 10000)}
<blazes816> sorry, :id should be :kid
<vectorshelve> blazes816: ok
<vectorshelve> User.all.each{|user| user.update_attribute(:kid, user.kid + 10000)}
<vectorshelve> blazes816: ^^ ?
<blazes816> that will set kid = to kid + 10000 for every user
<blazes816> if that's what you want, that's correct
<vectorshelve> blazes816: thats what I initially asked +1 or +10000 ? :)
<vectorshelve> blazes816: aah its becoming confusing
<blazes816> i don't understand what you're trying to do at all
<blazes816> but all your doing is basic active record stuff
<vectorshelve> blazes816: ok I will explain simple
<blazes816> it can't be difficult
yakko_ has joined #ruby
<vectorshelve> blazes816: https://gist.github.com/3963074 make this short thats all :)
quest88 has quit [Quit: quest88]
invapid has quit [Ping timeout: 272 seconds]
<blazes816> yes, which is equal to what I initially wrote
<blazes816> User.all.each_with_index{|user, i| user.update_attribute(:kid, 111111+i)}
yakko has quit [Ping timeout: 245 seconds]
<vectorshelve> blazes816: ok
Juul has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
jgrevich_ has joined #ruby
mneorr has joined #ruby
yakko_ has quit [Read error: Connection reset by peer]
gmci has quit [Quit: Computer has gone to sleep.]
yakko has joined #ruby
jgrevich has quit [Ping timeout: 244 seconds]
jgrevich_ is now known as jgrevich
<vectorshelve> blazes816: thanks a lot mate
sambio has quit []
a_a_g has joined #ruby
hvq has joined #ruby
dylanjha has joined #ruby
mneorr has quit [Remote host closed the connection]
<blazes816> np
hvq has quit [Client Quit]
dylanjha has quit [Client Quit]
savage- has joined #ruby
hvq has joined #ruby
deadalus has quit [Ping timeout: 245 seconds]
g-ram has quit [Quit: Computer has gone to sleep.]
g-ram has joined #ruby
g-ram has quit [Client Quit]
Tearan has quit [Quit: Sleepy Badger....]
a_a_g has quit [Quit: Leaving.]
rippa has joined #ruby
`brendan has quit [Ping timeout: 252 seconds]
tekknolagi has joined #ruby
<tekknolagi> blazes816: well yeah it uploads and stuff
<tekknolagi> but no mysql entries
<tekknolagi> o.O
<tekknolagi> also weirdness in /new yayyy
kiyoura has quit [Quit: Leaving]
invapid has joined #ruby
bairui_ has joined #ruby
jasond has left #ruby ["Killed buffer"]
Juul has quit [Ping timeout: 268 seconds]
hsbt_away is now known as hsbt
bairui has quit [Ping timeout: 252 seconds]
yshh has joined #ruby
invapid has quit [Ping timeout: 240 seconds]
<tekknolagi> blazes816: okay so just issues withd isplaying on /new :(
Tearan has joined #ruby
<blazes816> I get a server error
<blazes816> with no debug info
Erfankam has joined #ruby
trp has joined #ruby
<trp> join me for comedy http://synchtu.be/LJdG
trp has quit [Killed (idoru (Spam is off topic on freenode.))]
starship has quit [Read error: Operation timed out]
lukeholder has joined #ruby
starship has joined #ruby
tekknolagi has quit [Ping timeout: 268 seconds]
yshh has quit [Remote host closed the connection]
hbpoison has joined #ruby
bairui_ is now known as bairui
vlad_starkov has joined #ruby
tekknolagi has joined #ruby
<tekknolagi> blazes816: server error?
<tekknolagi> (sorry for repeated leaving, but bg'ing screen is not a great idea)
emergion has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<blazes816> a 500 error
<tekknolagi> hmm
<tekknolagi> 500 is some sort of unidentified server error?
tommyvyo has quit [Quit: Computer has gone to sleep.]
<tekknolagi> idk why there's no debug though
<blazes816> it's the standard error for when something goes wrong
<blazes816> all the other errors were 500s
<tekknolagi> ah
<blazes816> but, it showed the debug
<blazes816> are you in production now?
<tekknolagi> i am not in production
<tekknolagi> and won't be for a while
<tekknolagi> at least until i get that new UI up
yakko has quit [Ping timeout: 245 seconds]
yakko has joined #ruby
Cidan is now known as zz_Cidan
<tekknolagi> hmm i think it's the lack of Torrents in thedb
<tekknolagi> which i should fix first
<tekknolagi> brb to put this in a screen sesh
tekknolagi has quit [Client Quit]
tekknolagi has joined #ruby
<tekknolagi> blazes816: back
<tekknolagi> i love irssi
alem0lars has joined #ruby
<blazes816> i love xchat but i'm stuck on a mac
nappy has quit [Read error: Connection reset by peer]
<tekknolagi> blazes816: there is xchat for mac
<blazes816> it's crap
<blazes816> i tried it
<tekknolagi> qwebirc?
nappy has joined #ruby
<tekknolagi> *shrug*
<blazes816> but colloquy worked much better
nappy has quit [Read error: Connection reset by peer]
kozerski has joined #ruby
<tekknolagi> colloquy is nice
<tekknolagi> my mac is my main machine
<tekknolagi> but i run fedora on my dev machine, and ubuntu on my server
Soliah has joined #ruby
nappy has joined #ruby
<blazes816> nice
<tekknolagi> okay fuck it i am opening irssi in tmux
<tekknolagi> brb
tekknolagi has quit [Client Quit]
tekknolagi has joined #ruby
<tekknolagi> back
<tekknolagi> okay
<tekknolagi> i can dev and talk now
yakko_ has joined #ruby
yakko has quit [Ping timeout: 245 seconds]
<blazes816> so are you using passenger?
<tekknolagi> blazes816: so there's something wrong with Torrent input
<tekknolagi> yeah passenger
<tekknolagi> that was my original error :P
<blazes816> haha
<blazes816> so what's the current issue?
<tekknolagi> db is blank
justinmcp has joined #ruby
<blazes816> just had handling for that
<blazes816> d
<blazes816> display "no torrents", etc
<tekknolagi> no i mean
<tekknolagi> even though you uploaded one nothing got inputted
<blazes816> hmm
<tekknolagi> the "no torrents" functionality already exists
<tekknolagi> that's my problem now
<blazes816> gotcha
Seventoes has quit [Ping timeout: 252 seconds]
<tekknolagi> something to do with the Torrent.new and then the save
<blazes816> try calling save! instead of save when you save, it will raise an exception if it can't save it
zomgbie has joined #ruby
Trioke has quit [Ping timeout: 245 seconds]
<tekknolagi> ok doing that then restarting
<tekknolagi> /upload is blank
<tekknolagi> or 500 i can't tell which
<tekknolagi> presumably because of .save!
<blazes816> worked for me
<tekknolagi> yeah that's the difference that made the 500
<tekknolagi> really? wait let me change then start again
<tekknolagi> 1sec
<blazes816> yeah, and exception will cause a 500
<blazes816> but will tell you why it isn't saving
hvq has quit [Ping timeout: 245 seconds]
<tekknolagi> ok changed
<tekknolagi> 500 error. where's the passenger log? o.O
<blazes816> not sure
<tekknolagi> checking out apache log now
<blazes816> can you just do "rackup config.ru -p 8080" ?
jaygen_ has joined #ruby
hvq has joined #ruby
<tekknolagi> oh good idea
yakko has joined #ruby
zomgbie has quit [Ping timeout: 260 seconds]
yakko has quit [Read error: Connection reset by peer]
yakko_ has quit [Ping timeout: 245 seconds]
jaygen has quit [Ping timeout: 245 seconds]
yakko has joined #ruby
<tekknolagi> blazes816: okay what the heck
<tekknolagi> 1054
dnyy has quit [Remote host closed the connection]
<blazes816> can't access it
<blazes816> perhaps you're vps host denies traffic
<blazes816> on that port
<blazes816> or you do, in your iptables
<tekknolagi> oh pardon
<tekknolagi> i just closed the server
<tekknolagi> but i don't get a 500 error
<tekknolagi> lemme open it again for one minute exactly (in another window)
<tekknolagi> you can have at it
<tekknolagi> and i'll gist/pastie the results
<tekknolagi> sound ok?
<blazes816> k
<tekknolagi> GO
<tekknolagi> ah pardon
<tekknolagi> use
<shevy> lol
jaygen_ has quit [Remote host closed the connection]
<blazes816> hmm, yeah upload is blank
hvq has quit [Ping timeout: 240 seconds]
<tekknolagi> blazes816: ^link
jaygen has joined #ruby
<blazes816> wat
<tekknolagi> i have never heard of a 1054...
<tekknolagi> /it doesn't exist
<blazes816> it doesn't
<blazes816> so what's happening
jarred_ has quit [Quit: jarred_]
<blazes816> is somehow that's getting returned to rack
<blazes816> 1054 is a mysql error code
<blazes816> unknown column
<tekknolagi> oh
<tekknolagi> OH
<blazes816> dunno if it's related
<tekknolagi> OH FOR FUCK'S SAKE I'M AN IDIOT
<tekknolagi> what are the migration instructions again?
SCommette has joined #ruby
<blazes816> load your models + DM
<blazes816> and run DataMapper.auto_migrate!
<tekknolagi> okay so
<tekknolagi> did that
<tekknolagi> then it said "cannot delete parent row"
Lemtzas has quit [Ping timeout: 245 seconds]
<tekknolagi> for deleting "torrents" as a column or something
<blazes816> parent row? wtf?
<tekknolagi> i'll pastie
<blazes816> you could also try DataMapper.auto_upgrade!
haxrbyte has joined #ruby
<tekknolagi> auto_uupgrade! seemed to work
<tekknolagi> YEAH
<tekknolagi> IT WORKS
<blazes816> w00t
<tekknolagi> i am going to list you as a contrib
<blazes816> stick that at the bottom of the torrentdb.rb file
<blazes816> ha
<blazes816> then you shouldn't need to worry about doing it manually
Goles has joined #ruby
<tekknolagi> yeah good idea
<tekknolagi> adding now
kozerski has quit [Read error: Connection reset by peer]
nappy has quit [Read error: Connection reset by peer]
<blazes816> so what's the purpose of the application?
<tekknolagi> fun
<tekknolagi> wanted a side project
<blazes816> for sure, but is it a torrent tracker I presume?
<tekknolagi> well not a tracker
<tekknolagi> jsut an indexer
<tekknolagi> i don't wanna get sued
<blazes816> yeah, bad choice of words
<tekknolagi> oh for fuck's sake
<tekknolagi> more /upload errors
<blazes816> indexer is a good word i guess :D
nappy has joined #ruby
<tekknolagi> inputting doesn't work
<tekknolagi> .save fails...
<tekknolagi> :(
<blazes816> why? validations errors probably
SPYGAME has quit [Read error: Connection reset by peer]
<blazes816> if it works like AR you can check .errs
areil has joined #ruby
<blazes816> .errors
<tekknolagi> idts but i can check
hsbt is now known as hsbt_away
<tekknolagi> another db error
<tekknolagi> 1406
<tekknolagi> lol
<tekknolagi> hmm
<tekknolagi> data too long for column
<tekknolagi> O_O
SPYGAME has joined #ruby
<tekknolagi> the magnet isn't that long...
<blazes816> say what
<blazes816> what type is the column?
<tekknolagi> idk i didn't make it -.-
<blazes816> haha
stkowski has quit [Quit: stkowski]
<blazes816> ORMs suck sometimes
<tekknolagi> could install phpmyadmin
<blazes816> f that
<blazes816> how big is the magnet?
<blazes816> and DM type is it?
<tekknolagi> 2kb maybe?
<tekknolagi> and dm type is text presumably
<blazes816> ? I mean in the model where you set the type
<tekknolagi> brb installing phpmyadmin
<tekknolagi> oh
<tekknolagi> String
<tekknolagi> or Text
<tekknolagi> String
<blazes816> make it Text
<tekknolagi> then i just restart and it migrates?
<blazes816> it should
<blazes816> a String is usually a varchar(255) in the db, and Text is usually a text type in the db, which is mapped (internally in the db) to a blog
<blazes816> blob*
<tekknolagi> still 1406 too long
<blazes816> so you get much more space
Seventoes has joined #ruby
<tekknolagi> this is weird
<blazes816> log into the console and ensure the change happened
<blazes816> the mysql console
<tekknolagi> good idea.
<tekknolagi> how do i check column type in a mysql query?
<blazes816> use db_name; describe table_name;
<tekknolagi> good idea
<tekknolagi> doesn't change with either auto or manual migration/upgrade
jenrzzz has joined #ruby
<blazes816> that's uncool
spygame213 has joined #ruby
SPYGAME has quit [Ping timeout: 240 seconds]
<tekknolagi> could i change it manually?
<blazes816> alter torrents alter column_name column_name TEXT NOT NULL;
<blazes816> yep
<tekknolagi> column_name twice?
<tekknolagi> eh?
<blazes816> yeah
<blazes816> because you could rename it
<blazes816> you're saying take this column, and make it this new column
<tekknolagi> so assuming the db is called brightswipe:
<blazes816> and you give an entire definition for it
<tekknolagi> alter brightswipe alter torrents torrents text not null;
<blazes816> no, use the table name
<tekknolagi> ^yes?
<tekknolagi> oh
<blazes816> instead of db name
<tekknolagi> i meant table
<tekknolagi> but yeah d'oh
<blazes816> then yeah
<blazes816> but are you sure bright swipe isn't the db and torrents isn't the table?
<tekknolagi> sql syntax error
<tekknolagi> with
<tekknolagi> alter torrents alter magnet magnet text not null;
<blazes816> hmm, my sql is permanently rusty. 1 sec
mattp_ has joined #ruby
<tekknolagi> oh
<tekknolagi> no
<tekknolagi> you say "alter column magnet"
<blazes816> ah
<blazes816> good call
yaymukund has quit [Read error: Operation timed out]
<tekknolagi> it's
<tekknolagi> alter table torrents modify magnet text not null;
<tekknolagi> which worked
<tekknolagi> checking what's in the db now after submitting a link
<tekknolagi> and not getting a 500 or 1604
<tekknolagi> hallelujah.
<tekknolagi> now for the new UI... i love my designer.
<tekknolagi> egegorgulu.com
<tekknolagi> well no
<tekknolagi> madebyargon.com designed it and egegorgulu.com implemented it
jarred_ has joined #ruby
Seventoes has quit [Ping timeout: 272 seconds]
<blazes816> nice man
<blazes816> i suck at design
<tekknolagi> same lol
jarred_ has left #ruby [#ruby]
<blazes816> good designers are always great
<tekknolagi> that is tomorrow's project
<tekknolagi> for when i don't have a killer headache
<tekknolagi> i'll push this
<tekknolagi> thank you sir. you'll see your name up on the interwebz shortly.
send_ has joined #ruby
send_ is now known as send9
mucker has joined #ruby
<blazes816> np. haha, that's happened on occasion
<tekknolagi> check out github.com/tekknolagi/indexer
haxrbyte has quit [Remote host closed the connection]
<send9> dumb late night question
<tekknolagi> send9: sure thing
Lemtzas has joined #ruby
<tekknolagi> i just spent several hours on dumb questions ^_^
<blazes816> nice man
<tekknolagi> well, asking them.
<tekknolagi> lol
<send9> anyone know why @xmlx = Nokogiri::XML(@res) would return just a single node of an xml doc?
hvq has joined #ruby
<tekknolagi> what are you expecting it to return?
<send9> it's the pastebin api
<blazes816> because all xml documents must have 1 and only 1 root node
<send9> it's like <paste><tag1></tag1><tag2></tag2></paste><paste>...</paste>
<send9> etc
<tekknolagi> well. all valid ones.
<send9> but when i do parse it only gets one <paste> block
<send9> when i puts the variable it has the whole doc
<tekknolagi> then it's not valid
<blazes816> have you tried "@xmlx.children.size"?
<tekknolagi> add one surrounding tag and go for it
<blazes816> yeah, sorry
<blazes816> misread you xml
<blazes816> chuck it in a <pastes> tag
<send9> children.size = 1
<blazes816> then redo the children thing
Takehiro has quit [Remote host closed the connection]
<tekknolagi> thank you all
<tekknolagi> and to all, a good night
tekknolagi has quit [Quit: leaving]
<send9> so sorround the whole output with a new tag>
<send9> er ?
SCommette has quit [Quit: SCommette]
<blazes816> I guess, if your xml is output from something else
<send9> yeah it's from an api
<blazes816> "<root>#{output}</root>"
jenrzzz has quit [Ping timeout: 245 seconds]
<send9> ok thanks
<blazes816> np
Rix has joined #ruby
headius has quit [Quit: headius]
jaygen has quit [Remote host closed the connection]
slainer68 has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
headius has joined #ruby
headius has quit [Client Quit]
<send9> yep that worked
<send9> man why would they make it so hard to parse
<send9> cool trick though thanks
hbpoison has quit [Read error: Connection reset by peer]
send9 has quit [Quit: leaving]
akemEikko has joined #ruby
haxrbyte has joined #ruby
haxrbyte has quit [Remote host closed the connection]
yakko_ has joined #ruby
slainer68 has quit [Ping timeout: 245 seconds]
dylanjha has joined #ruby
yshh has joined #ruby
pdtpatr1ck has quit [Quit: pdtpatr1ck]
akem has quit [Read error: Connection reset by peer]
hekin has joined #ruby
yakko has quit [Ping timeout: 245 seconds]
yakko has joined #ruby
yakko_ has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby
akemEikko has quit [Ping timeout: 268 seconds]
pdtpatr1ck has joined #ruby
datafirm has quit [Quit: datafirm]
nappy has quit [Read error: Connection reset by peer]
zomgbie has joined #ruby
<hekin> question, https://gist.github.com/3963337, thanks
Neomex has joined #ruby
Neomex has quit [Client Quit]
hbpoison has joined #ruby
dylanjha has quit [Ping timeout: 255 seconds]
clutchski has joined #ruby
clutchski has left #ruby [#ruby]
mahmoudimus has joined #ruby
hbpoison has quit [Read error: Connection reset by peer]
hvq has quit [Ping timeout: 240 seconds]
yoklov has quit [Quit: computer sleeping]
zomgbie has quit [Ping timeout: 252 seconds]
cableray has quit [Quit: cableray]
hamed_r has joined #ruby
spygame213 has left #ruby [#ruby]
psycho_one has joined #ruby
Blacksignals has quit []
carlzulauf has quit [Ping timeout: 264 seconds]
Seventoes has joined #ruby
Araxia has quit [Quit: Araxia]
Seventoes has left #ruby [#ruby]
carlzulauf has joined #ruby
Experium has quit [Quit: Leaving]
yakko_ has joined #ruby
darthdeus has joined #ruby
blazes816 has quit [Quit: blazes816]
mucker has quit [Quit: leaving]
yakko has quit [Ping timeout: 245 seconds]
Virunga has joined #ruby
justinmcp has quit [Remote host closed the connection]
Chryson has quit [Quit: Leaving]
pskosinski has joined #ruby
robustus has joined #ruby
lukeholder has quit [Quit: Computer has gone to sleep.]
anderse has joined #ruby
yaymukund has joined #ruby
anderse has quit [Client Quit]
yakko_ has quit [Read error: Connection reset by peer]
tchebb1 has quit [Ping timeout: 272 seconds]
yakko has joined #ruby
FifthWall has quit [Quit: Goodbye everyone]
awestroke has joined #ruby
nyrb has quit [Remote host closed the connection]
justinmcp has joined #ruby
pehlert has joined #ruby
<pehlert> Hi everyone. Quick question, is there any way to tell ruby that the default encoding of my files is UTF-8? I
haxrbyte has joined #ruby
<pehlert> I'm having a few German clients and I always end up with "#-*- encoding: UTF-8 -*-" in my files as soon as I use umlauts
<Hanmac> pehlert -Ku but i dont trust it
hbpoison has joined #ruby
<pehlert> Hanmac: So the official way is to use magic comments on every single file?
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
<pehlert> I mean, it's not the worst way of handling it after all, but I doubt it would've hurt anyone to make UTF-8 the default encoding
<Hanmac> i would prefer it ... (because -K does not appear at ruby --help )
blacktulip has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
Juul has joined #ruby
yakko has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
yakko has joined #ruby
<pehlert> Hanmac: Heh, thanks though
* Hanmac is germany too so he knows about öäü and ß
khakimov has quit [Quit: Computer has gone to sleep.]
<shevy> I still use ISO encodings rather than UTF-8
<shevy> I usually set "# Encoding: ASCII-8BIT" in .rb files on the second line
<shevy> quick question
<shevy> user_input = gets.chomp
<shevy> vs
<shevy> user_input = $stdin.gets.chomp
<shevy> what to use?
pskosinski has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
icooba has joined #ruby
darthdeus has quit [Quit: Leaving...]
Brainix has quit [Quit: Brainix]
haxrbyte has quit [Remote host closed the connection]
pdtpatr1ck has quit [Quit: pdtpatr1ck]
<pehlert> shevy: If you use ISO encodings for file size, I'd recommend the first approach :-P
shtirlic has joined #ruby
<shevy> it's our fate, with german umlauts we must specify the encoding to use since ruby 1.9x :(
cakehero has joined #ruby
fantazo has joined #ruby
<pehlert> Hanmac: I'm living in Malta right now and there is a lot more of weird characters here ;-) So actually I'm quite happy when all I have a deal with is "ä ö ü ß" ;-)
irleif has joined #ruby
zomgbie has joined #ruby
rippa has quit [Ping timeout: 268 seconds]
pdtpatr1ck has joined #ruby
pskosinski has joined #ruby
Uzix has left #ruby [#ruby]
<shevy> I use Signal.trap('SIGINT') { exit } but why does bash give me a ^C output still?
<shevy> this ^C is annoying me!
hekin has quit [Ping timeout: 245 seconds]
hotovson has joined #ruby
rippa has joined #ruby
irleif has quit [Ping timeout: 265 seconds]
kramutils has joined #ruby
<pehlert> I'd love to hear the answer on this
<Hanmac> hm i think the ^C is printed by bash, and not by the ruby programm
irleif has joined #ruby
hron84 has joined #ruby
havenn_ has joined #ruby
<shevy> aha
havenn has quit [Ping timeout: 245 seconds]
tgenov has joined #ruby
Takehiro has joined #ruby
jgrevich has quit [Quit: jgrevich]
answer_42 has quit [Ping timeout: 276 seconds]
therod has joined #ruby
<shevy> cool
<shevy> raise SystemExit is like exit
<shevy> :)
Tuxist has joined #ruby
classix has quit [Ping timeout: 252 seconds]
wallerdev has quit [Quit: wallerdev]
bluesm has joined #ruby
cantonic has quit [Quit: cantonic]
justinmcp has quit [Remote host closed the connection]
chimkan has joined #ruby
shtirlic has quit [Remote host closed the connection]
havenn_ has quit [Remote host closed the connection]
c0rn_ has joined #ruby
casheew has quit [Read error: Connection reset by peer]
casheew has joined #ruby
chimkan has quit [Quit: chimkan]
Xeago has joined #ruby
workmad3 has joined #ruby
rakl has quit [Quit: sleeping]
knite has quit [Quit: knite]
codezombie has quit [Quit: Linkinus - http://linkinus.com]
hbpoison has quit [Ping timeout: 244 seconds]
hbpoison has joined #ruby
und3f has joined #ruby
hamed_r has quit [Quit: Leaving]
savage- has quit [Quit: savage-]
<shevy> hmm
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
daniel_- has quit [Ping timeout: 245 seconds]
hbpoison_ has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
hbpoison has quit [Ping timeout: 245 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
slainer68 has joined #ruby
<shevy> wheeee
<shevy> there is ... singleton_method_added, singleton_method_removed and singleton_method_undefined
workmad3 has quit [Ping timeout: 264 seconds]
<shevy> now what to do with all that
elaptics`away is now known as elaptics
arturaz has joined #ruby
<Hanmac> shevy this are hook methods ... they are automaticly called when methods are added or deleted
<shevy> hmm
slainer68 has quit [Ping timeout: 245 seconds]
yakko_ has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
yakko has quit [Ping timeout: 245 seconds]
Takehiro has quit [Remote host closed the connection]
Takehiro has joined #ruby
clj_newb has joined #ruby
vlad_starkov has joined #ruby
Axsuul has quit [Ping timeout: 246 seconds]
cento has joined #ruby
PragCypher has joined #ruby
carlzulauf has quit [Ping timeout: 240 seconds]
carlzulauf has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
jslowe has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
akem has joined #ruby
cantonic has joined #ruby
rippa has quit [Ping timeout: 245 seconds]
<shevy> ok this sucks
Takehiro has quit [Remote host closed the connection]
<shevy> writing games in ruby, why is this so hard
<Hanmac> shevy what do you currently use? gosu? or something similar?
c0rn_ has quit []
arturaz has quit [Ping timeout: 244 seconds]
<shevy> hmm no
<shevy> I mean just the whole design phase
<shevy> perhaps I should not design a game at all
margle has joined #ruby
<Hanmac> hm you could design an engine layer first that makes the game dev itself easier ... but i dont know
zomgbie has quit [Ping timeout: 260 seconds]
<shevy> yeah there is usually a spur of activity for some days
<shevy> then you lose interest and you make a break
<shevy> and when you come back, it progresses only very slowly
<shevy> that's horrible !
havenn has joined #ruby
levabalkin has joined #ruby
Juul has quit [Ping timeout: 268 seconds]
havenn has quit [Ping timeout: 255 seconds]
<Hanmac> yeah ... i need to develop more too
hbpoison_ has quit [Read error: Connection reset by peer]
<Hanmac> i think i need to do something before my PC Fans trying to freeze me
PragCypher has quit [Remote host closed the connection]
tintin has joined #ruby
tintin has left #ruby [#ruby]
PragCypher has joined #ruby
ltsstar has joined #ruby
arturaz has joined #ruby
kkiero has quit [Read error: Operation timed out]
instinkt has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<shevy> hehe
cantonic has quit [Read error: Connection reset by peer]
codefyre has joined #ruby
pehlert has quit [Quit: Leaving.]
kaawee has joined #ruby
SeySayux has quit [Ping timeout: 252 seconds]
Villadelfia has quit [Ping timeout: 272 seconds]
SeySayux has joined #ruby
Villadelfia has joined #ruby
zomgbie has joined #ruby
postmodern has joined #ruby
Takehiro has joined #ruby
hbpoison has joined #ruby
deadalus has joined #ruby
deadalus has quit [Changing host]
deadalus has joined #ruby
hamed_r has joined #ruby
zomgbie has quit [Read error: Operation timed out]
dangerousdave has joined #ruby
bier has quit [Ping timeout: 240 seconds]
havenn has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ruby
hbpoison has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 246 seconds]
margle has joined #ruby
pehlert has joined #ruby
pdtpatr1ck has quit [Read error: Connection reset by peer]
clj_newb has quit [Ping timeout: 244 seconds]
bier has joined #ruby
`brendan has joined #ruby
zaki[] has quit [Read error: Operation timed out]
codecaster has joined #ruby
<codecaster> Hi there
margle has quit [Quit: Computer has gone to sleep.]
<codecaster> is anybody using faye or anything similar on heroku?
<codecaster> I would like to add live notifications to my app
<codecaster> Currently using mailboxer for persistence
codefyre has quit [Quit: Leaving]
jlwestsr has quit [Ping timeout: 246 seconds]
noxoc1 is now known as noxoc
zomgbie has joined #ruby
zaki[] has joined #ruby
adambeynon has joined #ruby
havenn has joined #ruby
eph3meral has joined #ruby
daniel_- has joined #ruby
yakko_ has quit [Read error: Connection reset by peer]
codefyre has joined #ruby
<codefyre> join #ubuntu
zomgbie has quit [Ping timeout: 248 seconds]
yakko has joined #ruby
chendo_ has quit [Ping timeout: 245 seconds]
clj_newb has joined #ruby
<shevy> join #perl
<codefyre> sorry , happened by mistake
<apeiros_> join #preparationsForEarthsInvasion
havenn has quit [Ping timeout: 240 seconds]
kil0byte has joined #ruby
tgenov has quit [Quit: This computer has gone to sleep]
niklasb has joined #ruby
chendo_ has joined #ruby
margle has joined #ruby
hamed_r has quit [Ping timeout: 244 seconds]
hbpoison has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
k610 has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<codecaster> join #split
k610 has quit [Ping timeout: 248 seconds]
yakko has quit [Read error: Connection reset by peer]
k610 has joined #ruby
yakko has joined #ruby
k610 has quit [Ping timeout: 240 seconds]
Agis__ has joined #ruby
havenn_ has joined #ruby
k610 has joined #ruby
codefyre has quit [Quit: Leaving]
Slivka has joined #ruby
Erfankam has quit [Ping timeout: 268 seconds]
k610 has quit [Ping timeout: 260 seconds]
k610 has joined #ruby
Dolphinius has joined #ruby
havenn_ has quit [Ping timeout: 264 seconds]
Virunga has quit [Remote host closed the connection]
Erfankam has joined #ruby
<instinkt> join #preparationsForEarthsInvasion
<instinkt> wtf
k610 has quit [Ping timeout: 245 seconds]
instinkt has quit [Quit: leaving]
<apeiros_> hush, you puny humans are not supposed to go there
k610 has joined #ruby
yakko has quit [Read error: Connection reset by peer]
LouisGB has joined #ruby
yakko has joined #ruby
hbpoison has quit [Read error: Connection reset by peer]
Erfankam has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
eataix has quit [Ping timeout: 245 seconds]
k610 has joined #ruby
Dolphinius has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
Slivka has quit [Read error: Connection reset by peer]
hamed_r has joined #ruby
codecaster has left #ruby [#ruby]
jimeh has joined #ruby
eataix has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
kaawee has quit [Ping timeout: 246 seconds]
k610 has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
zomgbie has joined #ruby
k610 has quit [Ping timeout: 255 seconds]
yakko_ has joined #ruby
k610 has joined #ruby
gmci has joined #ruby
yakko has quit [Ping timeout: 245 seconds]
Xeago has quit [Remote host closed the connection]
richwestcoast has joined #ruby
k610 has quit [Ping timeout: 255 seconds]
zomgbie has quit [Ping timeout: 264 seconds]
k610 has joined #ruby
mohanmcgeek has joined #ruby
havenn has joined #ruby
kzrl has quit [Ping timeout: 240 seconds]
kzrl has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
Morkel has joined #ruby
Virunga has joined #ruby
k610 has quit [Ping timeout: 276 seconds]
kaawee has joined #ruby
arya has joined #ruby
_main_ is now known as __main__
havenn has quit [Ping timeout: 272 seconds]
Goles has quit [Ping timeout: 245 seconds]
hotovson has quit [Remote host closed the connection]
arya has quit [Ping timeout: 240 seconds]
samphippen has joined #ruby
LouisGB has quit [Ping timeout: 245 seconds]
arya has joined #ruby
monkegjinni has quit [Read error: No route to host]
yakko_ has quit [Read error: Connection reset by peer]
arya has quit [Ping timeout: 260 seconds]
monkegjinni has joined #ruby
yakko has joined #ruby
postmodern has quit [Quit: Leaving]
clj_newb has quit [Ping timeout: 255 seconds]
yshh has quit [Remote host closed the connection]
nobitoyep has joined #ruby
arya has joined #ruby
<shevy> I am booooored
butblack has joined #ruby
alem0lars has quit [Quit: quit]
bluesm has left #ruby [#ruby]
<Hanmac> shevy watch movie trailer: http://www.youtube.com/watch?v=_q6DDm-3urE
daniel_- has quit [Ping timeout: 245 seconds]
hsbt_away is now known as hsbt
emmanuelux has joined #ruby
leoncamel has quit [Remote host closed the connection]
Takehiro has quit [Remote host closed the connection]
leoncamel has joined #ruby
Alperen has joined #ruby
<Alperen> hi. i am trying to run a ruby script. but when run it gives me an error. export.rb:1:in `require': no such file to load -- octokit (LoadError)
<Alperen> how can i fix thix?
<Alperen> i already run gem install octokit
vlad_starkov has quit [Remote host closed the connection]
<Alperen> and it installed
havenn has joined #ruby
<Hanmac> Alperen your ruby version?
<Alperen> ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-linux]
<Hanmac> do require "rubygems" before
<Alperen> Hanmac, thanks it worked. :)
richwestcoast has quit [Read error: Connection reset by peer]
krisbulman has joined #ruby
<Hanmac> information: ruby1.8.7 will die next year
<Alperen> i am using the centos' repos
<mohanmcgeek> use rvm
<mohanmcgeek> http://rvm.io
<Hanmac> "centos - software from the last century"
Tuxist has quit [Read error: Connection reset by peer]
<Alperen> :D
<Alperen> but it is good for servers i think
<mohanmcgeek> distro repos never had updated software.
<mohanmcgeek> and it is assumed to be good for servers because it's redhat for free. :O
magggie has joined #ruby
havenn has quit [Ping timeout: 276 seconds]
<Hanmac> "software from the last century on hardware from the last century" :D
kaawee has quit [Ping timeout: 246 seconds]
<Alperen> :D:D
krisbulman has quit [Client Quit]
<magggie> hi
<Mon_Ouie> I'm actually surprised they even have 1.8.7
<mohanmcgeek> Alperen: You should be using ruby 1.9.3 already..
<mohanmcgeek> or you should have a strong reason to continue using 1.8.7
<Alperen> :S
<Alperen> i am new to ruby so i just installed from repo for redmine
<Alperen> if i delete ruby and install rvm what will happen to my gems? :D
<mohanmcgeek> ^ you don't "delete" ruby...
cento has quit [Ping timeout: 260 seconds]
Vinz_` is now known as Vinz_
roadt` has joined #ruby
<mohanmcgeek> and you can make a backup of your gem lists
Russell^^ has joined #ruby
roadt has quit [Ping timeout: 264 seconds]
<Alperen> it is installing ruby 1.9.3 now :D
daniel_- has joined #ruby
<mohanmcgeek> Alperen: Nice :)
<mohanmcgeek> CheesyInfo: 1.9.3 has inbuilt rubygems support. So you don't need to require "rubygems"
jamjam has joined #ruby
yakko has quit [Read error: Connection reset by peer]
<Alperen> that is good :)
yakko has joined #ruby
mercwithamouth has joined #ruby
<shevy> yeah
<shevy> and perhaps 2.0 will have all of standardlib gemified
<shevy> debian will happily make use of that to cripple things away!
<mohanmcgeek> Btw, people. Thre's a gem from thoughtbot called cocaine. What advantage does it give over backticks?
<shevy> "Sorry, your installation of ruby lacks these 135 .gem files."
<Kovensky> shevy: well, perl has had its standardlip CPANified for ages
<Kovensky> and debian doesn't ship it crippled
<Kovensky> =p
<shevy> who knows what this gem can do mohanmcgeek?
<Kovensky> standardlib*
<shevy> although perhaps it is like popen and provides separate streams
<shevy> Kovensky, but gem has become better than cpan!
<Kovensky> how so
Takehiro has joined #ruby
<Kovensky> it is easier to contribute to, but I don't see how that makes it better on the user side
zomgbie has joined #ruby
<shevy> there are 2953 gems on rubygems.org
<shevy> hmm I doubt these numbers
<shevy> I alone have 18... so this cant be right.
<Kovensky> "The Comprehensive Perl Archive Network (CPAN) currently has 114,558 Perl modules in 25,995 distributions, written by 10,127 authors, mirrored on 274 servers. "
<shevy> " Displaying Rubygem 1 - 30 of 2953 in total"
<shevy> yeah something is fishy there
<shevy> 3000 / 20 is ... 150
<shevy> only 150 folks using rubygems as authors wtf that can't be right
psycho_one has quit [Remote host closed the connection]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<wmoxam> 2953 start with the letter 'A'
<wmoxam> :p
x0F_ is now known as x0F
pskosinski has quit [Quit: Whatever]
<Kovensky> http://perldoc.perl.org/perlmodlib.html#Standard-Modules <-- they're all CPAN modules
<shevy> ohhhhh
<shevy> now it makes sense :)
psycho_one has joined #ruby
<shevy> now how do I get the total number ...
arya has left #ruby [#ruby]
<mohanmcgeek> shevy: last time i checked, I saw something like "46000 gemcuts"
zomgbie has quit [Ping timeout: 248 seconds]
<mohanmcgeek> 46115
<shevy> hmm
<shevy> 1/3 of perl then
[Pi] has joined #ruby
<Kovensky> 2953+1937+3459+2061+1552+1910+2201+1549+1134+1036+679+1184+3187+1096+1208+2370+254+5521+4979+2468+567+738+1094+261+407+288
<Kovensky> 46093
<shevy> uh how did you get that so quickly?
coffer has joined #ruby
<Kovensky> number of gems starting with A, number of gems starting with B, number of gems starting with C...
<shevy> did you click on every page there!!!
<Kovensky> yep
<mohanmcgeek> Kovensky: Did you add em all manually?
<shevy> hehe whoa :)
<Kovensky> figured it was less effort than searching through statistics
<shevy> hehehehe
<Kovensky> and too low effort to write a script to do it for me :>
<mohanmcgeek> what about gems starting with numbers?
<mohanmcgeek> :o
Danielpk_ has joined #ruby
<shevy> with numbers?
<mohanmcgeek> gems can't have numbers as 1st character?
<shevy> you can have gems start with numbers?
<shevy> I dunno
clj_newb has joined #ruby
<shevy> I never had the idea so far
<shevy> I am also not sure I ever saw such a gem
<mohanmcgeek> lemme check
<shevy> lol
<Kovensky> why do pretty much all non-lisp languages forbid numbers as first characters in identifiers anyway
justinmcp has joined #ruby
arielpts has quit [Read error: Connection reset by peer]
<shevy> it might disturb the greater space continuum
Danielpk has quit [Read error: Connection reset by peer]
Danielpk_ is now known as Danielpk
<mohanmcgeek> i just checked, creating a gem with number as 1st char worked.
<[Pi]> could someone take a look and help me through?
<mohanmcgeek> So, 46115 - 46093 = 22 gems with numbers as 1st char.
<Alperen> i am getting this error when i try to install new gems. /usr/local/rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>':
<Alperen> It seems your ruby installation is missing psych (for YAML output).
philcrissman_ has joined #ruby
<[Pi]> I'm getting confused now. it appears that I already had a ' system ruby ' version, I checked yesterday before I installed anything. but it was really low, much lower than the version officially shipped with OS X lion
<Kovensky> install libyaml
<apeiros_> [Pi]: Lion ships with 1.8.7
<Kovensky> the annoying bit is that if you forgot to install openssl headers, or libyaml, or whatever, you have to completely recompile ruby :(
arietis has joined #ruby
Morkel has quit [Quit: Morkel]
levabalkin has quit [Ping timeout: 248 seconds]
arielpts has joined #ruby
<[Pi]> I don't understand how that could be... can I do the check again now? how do I check my system function now that I have fiddled with homebrew and France and installed a new version?
<[Pi]> ^ system version
<Alperen> i did rvm pkg install libyaml
<[Pi]> ( sorry, speech recognition errors )
<mohanmcgeek> [Pi]: You're using rvm. But the /usr/bin/ command is using system's 1.8 ruby.. I think.
mercwithamouth has quit [Ping timeout: 245 seconds]
<Alperen> there is no ruby 1.8 anymore :D
<Alperen> i removed it
<shevy> Alperen I dont know what that command does, but in standard ruby, one has to recompile after having compiled libyaml
<apeiros_> Alperen: bad idea
<apeiros_> Alperen: *NEVER* remove system stuff
<Alperen> ruby 1.9.3p286 (2012-10-12 revision 37165) [i686-linux]
<mohanmcgeek> Alperen: You should do normal gem install.
<Alperen> ruby -v
<shevy> you dont have psych working
<mohanmcgeek> Alperen: Like you would do normally...
mercwithamouth has joined #ruby
havenn has joined #ruby
<[Pi]> how can I check my system version of Ruby? I am curious...
ZubKonst has joined #ruby
<Alperen> ok fixed :D
<Alperen> gem install psych
<[Pi]> doing 'which ruby' reports /Users/sunfish7/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
thatRD has joined #ruby
pskosinski has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
ZubKonst_ has quit [Ping timeout: 248 seconds]
kirun has joined #ruby
<Kovensky> do `which -a ruby`
arya has joined #ruby
arya has left #ruby [#ruby]
drago757 has joined #ruby
havenn has quit [Ping timeout: 244 seconds]
Virunga has quit [Remote host closed the connection]
Karunamon has quit [Read error: Connection reset by peer]
<mohanmcgeek> [Pi]: The guy who replied to your thread thinks you installed ruby via homebrew
<mohanmcgeek> [Pi]: but you've used rvm
<[Pi]> mohanmcgeek: I'm very confused. I think I might have used both.
krisbulman has joined #ruby
JohnBat26 has joined #ruby
philcrissman_ has quit [Remote host closed the connection]
<[Pi]> I spent all of yesterday following various scraps of instruction on how to install and update Ruby, so my system is going to be a bit of a tangle
drago757 has quit [Client Quit]
haxrbyte has joined #ruby
<[Pi]> I definitely interacted with both homebrew and rvm
magggie has left #ruby [#ruby]
Takehiro has quit [Remote host closed the connection]
<mohanmcgeek> I'm not sure what you're doing.. but the gem you're trying to install, did get installed successfully in rvm's ruby 1.9.3
<[Pi]> http://stackoverflow.com/questions/6840719/installing-ruby-on-rails-mac-os-lion <-- Alain's answer was the one I finally used to get Ruby up-to-date
Agis__ has quit [Quit: Agis__]
butblack has quit [Quit: butblack]
pskosinski has left #ruby ["Whatever"]
pehlert has quit [Quit: Leaving.]
<[Pi]> how come I have two rubies listed under /.../.rvm/ ?
<mohanmcgeek> [pi] thats the whole point of rvm.. to have many ruby environments..
<[Pi]> mohanmcgeek: but it looks strange. One of them has complete version information. the other doesn't. I can't remember installing two variants.
<shevy> hilarious mohanmcgeek :D
<shevy> gobolinux solved it in a generic way via /Programs/Ruby/VERSION_HERE
haxrbyte has quit [Remote host closed the connection]
butblack has joined #ruby
<[Pi]> which ruby
arya has joined #ruby
arya has left #ruby [#ruby]
<[Pi]> sorry, getting my commandlines mixed :D
krisbulman has quit [Quit: krisbulman]
butblack has quit [Client Quit]
Xeago has joined #ruby
butblack has joined #ruby
pmros has joined #ruby
<mohanmcgeek> shevy: You mean we should use gobolinux instead of just using rvm?
<pmros> hi!
<mohanmcgeek> not nice.
mercwithamouth has quit [Ping timeout: 240 seconds]
<shevy> mohanmcgeek no, not gobolinux, but a gobolinux-like solution YES
<mohanmcgeek> shevy: but rvm is more local..
<mohanmcgeek> shevy: it's in your home directory.. :O
<shevy> gobolinux started the same way
<shevy> http://www.gobolinux.org/?page=doc/articles/clueless
<shevy> "I work in an university environment, and I have for many years. There, I am not the superuser, so I have to install every extra app I need in my $HOME directory."
<shevy> sadly gobolinux died years ago :(
<mohanmcgeek> shevy: But getting ruby installed is also easy with rvm..
<mohanmcgeek> i dont want to do curl-ing
<pmros> don't forget rbenv
<shevy> yeah and getting ruby installed is also easy without rvm :)
hbpoison has joined #ruby
<shevy> I have 1.8.7 and 1.9.3something right now in $PROGRAMS/Ruby/VERSION
krisbulman has joined #ruby
bluenemo has quit [Remote host closed the connection]
Takehiro has joined #ruby
pehlert has joined #ruby
<mohanmcgeek> [Pi]: Actually, I think you have only one rvm ruby installed
<shevy> [Pi] how many rubies do you need?
<mohanmcgeek> and other via homebrew/OSX
<shevy> hehehe coooool
<shevy> mixing homebrew with rvm
kil0byte has quit [Ping timeout: 272 seconds]
<mohanmcgeek> shevy: I don't think that's a huge problem... rvm is very isolated and it is loaded. :P
pehlert has quit [Client Quit]
krisbulman has quit [Client Quit]
medik has quit [Ping timeout: 245 seconds]
<shevy> [Pi] mohanmcgeek has a lot of faith in you :)
<shevy> you could always listen to pmros
<shevy> and install rbenv additionally
<shevy> :>
kaneda__ has quit [Ping timeout: 240 seconds]
<pmros> :)
arya has joined #ruby
justinmcp has quit [Remote host closed the connection]
hron841 has joined #ruby
hron84 has quit [Read error: Connection reset by peer]
hron841 has quit [Client Quit]
hron84 has joined #ruby
chussenot has joined #ruby
toto_ has joined #ruby
krisbulman has joined #ruby
havenn has joined #ruby
instinkt has joined #ruby
pehlert has joined #ruby
arya has quit [Ping timeout: 268 seconds]
slainer68 has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 240 seconds]
pehlert1 has joined #ruby
pehlert has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
arya has joined #ruby
g-ram has joined #ruby
clj_newb has quit [Ping timeout: 256 seconds]
helichopter has joined #ruby
zomgbie has joined #ruby
Xeago has quit [Remote host closed the connection]
jude0 has joined #ruby
Xeago has joined #ruby
<crocket> Oh ruby
zomgbie has quit [Ping timeout: 246 seconds]
arya has quit [Ping timeout: 256 seconds]
xcvd`` has joined #ruby
zigidias has quit [Remote host closed the connection]
JarJar has joined #ruby
pmros has quit [Quit: Konversation terminated!]
pehlert1 has quit [Read error: Connection reset by peer]
Xeago has quit [Ping timeout: 272 seconds]
pehlert has joined #ruby
jslowe has quit [Ping timeout: 255 seconds]
arya has joined #ruby
irleif has joined #ruby
nobitoyep has quit [Ping timeout: 245 seconds]
<[Pi]> can I start over? I didn't understand how much of the above was directed to my thread...
<[Pi]> all this is still unfamiliar territory for me...
arya has left #ruby [#ruby]
hvq has joined #ruby
maesbn has quit [Remote host closed the connection]
mohanmcgeek has left #ruby [#ruby]
mucker has joined #ruby
pehlert has quit [Read error: Connection reset by peer]
pehlert has joined #ruby
hvq has quit [Ping timeout: 265 seconds]
irleif has quit [Read error: Connection reset by peer]
Vinz_ is now known as Vinz_`
havenn has joined #ruby
therod has quit [Quit: Linkinus - http://linkinus.com]
<[Pi]> the first suggestion from this guy is to 'sudo /usr/bin/gem install xcodeproj' -- i.e. install this module in the SYSTEM version of Ruby
<[Pi]> But it fails: https://gist.github.com/3964768
anirudh24seven has joined #ruby
g-ram has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
und3f has quit [Quit: Leaving.]
<[Pi]> can anyone tell me what is causing this error?
irleif has joined #ruby
havenn has quit [Ping timeout: 245 seconds]
jamjam has quit [Ping timeout: 268 seconds]
mmealling has joined #ruby
classix has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<canton7> [Pi], you don't have a C99 compiler installed
<[Pi]> canton7: I thought I fixed this yesterday going through a set of instructions that came onscreen when I did 'rvm install 1.9.2'
<[Pi]> the instructions pointed out that new Xcode 4.2+ replaces the old GCC compiler with LLVM
<[Pi]> and offers a process of getting the old compiler back through homebrew (IIRC)
<[Pi]> which I completed...
jlwestsr has joined #ruby
F1skr has joined #ruby
<[Pi]> canton7: how Should I proceed?
chussenot has quit [Quit: chussenot]
krisbulman has quit [Quit: krisbulman]
<canton7> no idea I'm afraid. If you're sure you've got a compiler installed, in your path, which takes the --std=c99 option..."
kil0byte has joined #ruby
krisbulman has joined #ruby
Takehiro has quit [Remote host closed the connection]
originerd has joined #ruby
shtirlic has joined #ruby
jaygen has joined #ruby
irleif has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
iamjarvo has joined #ruby
pehlert1 has joined #ruby
pehlert has quit [Read error: Connection reset by peer]
rjsamson has joined #ruby
jude0 has left #ruby [#ruby]
aaroncm has quit [Remote host closed the connection]
thatRD has quit [Quit: thatRD]
Serial_Killer_C has joined #ruby
irleif has joined #ruby
aaron has joined #ruby
Takehiro has joined #ruby
aaron is now known as Guest40106
Guest40106 is now known as aaroncm
pehlert has joined #ruby
Vinz_` is now known as Vinz_
pehlert1 has quit [Read error: Connection reset by peer]
coffer has quit [Remote host closed the connection]
morozovm has joined #ruby
zomgbie has joined #ruby
slainer68 has joined #ruby
morozovm has quit [Client Quit]
krisbulman has quit [Quit: krisbulman]
havenn has joined #ruby
irleif has quit [Read error: Connection reset by peer]
rafter has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
deo_ has joined #ruby
daniel___ has joined #ruby
irleif has joined #ruby
havenn has quit [Ping timeout: 246 seconds]
akemEikko has joined #ruby
akem has quit [Read error: Connection reset by peer]
akemEikko has quit [Max SendQ exceeded]
Liothen has quit [Ping timeout: 246 seconds]
akemEikko has joined #ruby
freeayu has joined #ruby
akemEikko has quit [Max SendQ exceeded]
iamjarvo has quit [Quit: Computer has gone to sleep.]
akemEikko has joined #ruby
daniel___ is now known as damireh
damireh has quit [Quit: damireh]
mikepack has joined #ruby
CaptainKnots has joined #ruby
patatahooligan has joined #ruby
patatahooligan has left #ruby [#ruby]
Serial_Killer_C has quit [Remote host closed the connection]
Morkel has joined #ruby
pehlert has quit [Quit: Leaving.]
iamjarvo has joined #ruby
zomgbie has quit [Ping timeout: 240 seconds]
pehlert has joined #ruby
fantazo has quit [Remote host closed the connection]
vectorshelve has quit [Ping timeout: 245 seconds]
Vecklock has joined #ruby
darthdeus has joined #ruby
SCommette has joined #ruby
vlad_starkov has joined #ruby
kil0byte has quit [Ping timeout: 265 seconds]
Serial_Killer_C has joined #ruby
Ivoz has quit [Quit: WeeChat 0.3.9]
Ivo has joined #ruby
kidoz has joined #ruby
originerd has quit [Quit: Originerd]
zomgbie has joined #ruby
kaneda__ has joined #ruby
Serial_K_ has joined #ruby
Ivo has quit [Client Quit]
Ivo has joined #ruby
jipiboily has joined #ruby
havenn has joined #ruby
kidoz has quit [Remote host closed the connection]
workmad3 has joined #ruby
Serial_Killer_C has quit [Ping timeout: 240 seconds]
maesbn has joined #ruby
jaygen has quit [Remote host closed the connection]
jaygen has joined #ruby
sambio has joined #ruby
Vinz_ is now known as Vinz_`
nobitanobi_ has joined #ruby
krisbulman has joined #ruby
Serial_K_ has quit [Remote host closed the connection]
<nobitanobi_> Given a hash like this: products = { "food" => ["cereal", "sausage"], "music" => ["cd", "radio"] } -- What would be a proper way to find if a particular sentence is food or music, depending on the words. So, if I have "I love cereal". The sentence would be of "food" type. How would I go through that hash efficiently?
hamed_r has quit [Quit: Leaving]
Ivo has quit [Quit: WeeChat 0.3.9]
Ivo has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
gr4v3|\| has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
instinkt has quit [Ping timeout: 268 seconds]
akemEikko has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
Ivo has quit [Client Quit]
Ivo has joined #ruby
<canton7> something like products.select{ |k,v| v.any{ |w| string.contains?(w) } }.keys would do it
<canton7> nobitanobi_, ^^
maesbn has quit [Remote host closed the connection]
khakimov has joined #ruby
<nobitanobi_> thanks canton7
<canton7> oops, replace any{ with ant?{
<canton7> * any?{
<nobitanobi_> yep, I saw that. Perfect :)
<Hanmac> canton7 i would first split the sentence into an array of words, because something like "cd" can cause false-positive
Vecklock has quit [Quit: Vecklock]
<jaygen> nobitanobi_: ^
<canton7> yeah, very true
Ivo has quit [Client Quit]
<nobitanobi_> jaygen: thank you.
Ivo has joined #ruby
freeayu has quit [Remote host closed the connection]
<jaygen> convoluted hangover coding
<canton7> that's a... really roundabout way of doing it. efficient though maybe?
<Hanmac> jaygen ok but your version is also not perfect
<nobitanobi_> I am wondering that if this hash grows a lot, the complexity would do too...
<jaygen> yeah definitely imperfect, perhaps use contains with a regex match?
bigmac has joined #ruby
Ivo has quit [Client Quit]
Ivo has joined #ruby
rmillerx has joined #ruby
<jaygen> /[^a-zA-Z]+#{string}[^a-zA-Z]+/
<canton7> USe \b maybe?
<nobitanobi_> jaygen: I'm lost now. What would this be for?
<jaygen> if you use the contains? with a regex matcher you can avoid false positives
clj_newb has joined #ruby
<jaygen> canton7: /\b#{search_string}\b/ ?
dnyy has joined #ruby
<canton7> I was thinking proucts.select{ |k,v| the_string =~ /\b(#{v.join('|')})\b/ }.keys
<nobitanobi_> wow. let me read that
yshh has joined #ruby
<jaygen> canton7: nice
F1skr has quit [Quit: WeeChat 0.3.9]
<nobitanobi_> awesome. Thanks.
<canton7> not sure whether that would win over splitting the_string once (using regex?) and using any? on it.
<nobitanobi_> It's a pain if the different kind of products grow, as I need to look through the hash, but I can't see another way of do so.
<apeiros_> nobitanobi_: what if you have "I love that cd about cereals"?
<nobitanobi_> apeiros_: right. I don't know, I guess I would wrongly classify.
wallerdev has joined #ruby
<canton7> I've been using #keys, so you get an array of all matches out
<nobitanobi_> apeiros_: However, the inputs are more like shopping inputs: 1 box of cereals at #price.
dharmaturtle has joined #ruby
clj_newb has quit [Ping timeout: 244 seconds]
<nobitanobi_> I need to figure out the kind of "good" in each input, to apply a particular tax.
<apeiros_> personally, I'd probably invert the hash
<havenn> ^
<nobitanobi_> uhm... {"chocolate" => "food", "cereal" => "food"} ?
<havenn> key lookups are fast, value lookups are slow
<Hanmac> hm i do this: s=sentence.split(/\s/);products.find {|k,v|(v & s).empty? ? nil : k}[0] => "food"
<nobitanobi_> interesting
<apeiros_> categories = {"cereal" => "food", "sausage" => "food", "cd" => "music", "radio" => "music"}
<nobitanobi_> apeiros_: that's interesting, but the complexity would grow a lot if I have X kind of food, right?
<apeiros_> then something like: sentence.words.map { |word| categories[word] }.compact
<canton7> I don'y know that it would make that much difference - you're still just iterating over the whole hash at the end of the day
<apeiros_> nobitanobi_: no, it's linear
<apeiros_> with that approach, it grows linearly with the size of sentence
<apeiros_> the amount of products is (almost) irrelevant
<nobitanobi_> apeiros_: wow.
xcvd`` has quit [Quit: Leaving]
<apeiros_> remember, hash lookup is O(1)
<Hanmac> apeiros_ i think yours may be better but i would use symbols for :food and :music because of too many strings in this table
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros_> canton7: no, you're not. and that's the point
jslowe has joined #ruby
<nobitanobi_> apeiros_: Yes. I guess I shouldn't be worried about colisions.
<apeiros_> hash lookup does *not* iterate the hash
bigmac is now known as i8igmac
<canton7> apeiros_, yeah I wrote me response before I saw your "then soemthing like" post. You make a good point
<canton7> s/me/my
<nobitanobi_> guys, I just got a really good lesson in less than 15 minutes.
<apeiros_> Hanmac: sure
<nobitanobi_> thanks a lot.
mikepack_ has joined #ruby
<apeiros_> Hanmac: though given the source, chances are good that it'd always be the same string object
<nobitanobi_> apeiros_: I don't need to worry about the hash function to use in the lookup right?
<apeiros_> nobitanobi_: don't know what you mean, sorry
<Hanmac> maybe an :food to "food" table for the output ... this could be powerd by l18n or something similar
Cultofmetatron has joined #ruby
<Hanmac> or was it l10n? i forgot which was which
<apeiros_> i18n
<apeiros_> or l10n, but l10n is more used for things like formats (dates, money, …)
<nobitanobi_> apeiros_: I have read that is important, when working with hash functions, to choose a good function in order to avoid collisions.
<apeiros_> nobitanobi_: you're using rubys Hash implementation
<apeiros_> you don't have to write your own hashing function in order to use it
<nobitanobi_> apeiros_: right. ok.
<apeiros_> Hanmac: ?
<Hanmac> watch this trailer
mucker has quit [Quit: leaving]
<nobitanobi_> Hanmac: if I use symbols as the keys in the hash I would have to "translate" the string into the symbol. Is that worth it in this case?
<canton7> nobitanobi_, and every half-arsed hash system has a way of handling collisions. ruby is no exception
<apeiros_> nobitanobi_: he meant the values
Ivo has quit [Quit: WeeChat 0.3.9]
<jaygen> don't use symbols
<apeiros_> {"cereals" => :food}
Ivo has joined #ruby
<nobitanobi_> uhm, ok
<nobitanobi_> well, those are going to be inmutable so maybe symbols are a good approach, I would think about it
Ivo has quit [Client Quit]
Ivo has joined #ruby
<Hanmac> jaygen: yeah fourthousand strings are so much better and one symbol
<apeiros_> Hanmac: as said, it'd probably be a single string anyway
Alperen has quit [Ping timeout: 245 seconds]
<apeiros_> at least if you construct the inverted hash from the original hash
invapid has joined #ruby
<nobitanobi_> apeiros_: what do you think it would be a single string?
<apeiros_> x = "food"; {"cereals" => x, "apples" => x, "pears" => x}
<apeiros_> there's only a single string "food", even if it is referenced 3 times
<nobitanobi_> uh. right
<gr4v3|\|> Hanmac: do u prefer soft kisses or rough love
<apeiros_> hm, who could gr4v3|\| possibly be…
rmillerx has quit [Quit: rmillerx]
Ivo has quit [Quit: WeeChat 0.3.9]
instinkt has joined #ruby
Ivo has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
<Hanmac> apeiros_ &nobitanobi_ : Hash[*products.map {|k,v| v.zip([k].cycle) }.flatten] #=> {"cereal"=>"food", "sausage"=>"food", "cd"=>"music", "radio"=>"music"}
scx has joined #ruby
Ivo has quit [Read error: Connection reset by peer]
Ivo has joined #ruby
<Hanmac> this line generates the better hash, from your hash
<apeiros_> Hanmac: don't * + flatten
<apeiros_> Hash[*foo.flatten] --> Hash[foo]
<apeiros_> Hash[products.flat_map { |cat, prods| prods.map { |prod| [prod, cat] } }]
Ivo has quit [Client Quit]
syamajala has joined #ruby
Ivo has joined #ruby
instinkt has quit [Ping timeout: 265 seconds]
<nobitanobi_> Hanmac: Actually I don't need to create the hash from that hash. I can create it the way apeiros_ suggested directly.
<Hanmac> Hash[products.flat_map {|k,v| v.zip([k].cycle) }]
Ivo has quit [Client Quit]
Ivo has joined #ruby
rippa has joined #ruby
clj_newb has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
anderse has joined #ruby
Araxia has joined #ruby
Ivo has quit [Client Quit]
Ivo has joined #ruby
Gonzih has quit [Ping timeout: 268 seconds]
Gonzih has joined #ruby
vonsar has joined #ruby
Nisstyre-laptop has joined #ruby
<nobitanobi_> apeiros_: I will use singularize in case in the hash I have cereal, and in the sentence I have cereals.
cakehero has joined #ruby
CaptainJet has joined #ruby
tommyvyo has joined #ruby
Vinz_` is now known as Vinz_
deo_ has quit [Quit: Leaving]
[Pi] has quit [Remote host closed the connection]
datafirm has joined #ruby
Ivo has quit [Quit: WeeChat 0.3.9]
Ivo has joined #ruby
Ivo has quit [Client Quit]
Ivo has joined #ruby
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
irleif has quit [Read error: Connection reset by peer]
rabidpraxis has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
nobitanobi_ has quit [Ping timeout: 245 seconds]
cantonic has joined #ruby
anderse has quit [Quit: anderse]
tchebb has joined #ruby
mikepack_ has quit [Remote host closed the connection]
eataix has quit [Quit: ZNC - http://znc.in]
nari_ has quit [Ping timeout: 245 seconds]
flype has joined #ruby
datafirm has quit [Quit: datafirm]
Neomex has joined #ruby
irleif has joined #ruby
Neomex has quit [Client Quit]
andy_ has joined #ruby
pehlert has quit [Read error: Connection reset by peer]
pehlert has joined #ruby
andy_ is now known as Guest51202
clj_newb has quit [Ping timeout: 245 seconds]
RyanD has quit []
Vinz_ is now known as Vinz_`
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
chrishunt has quit [Quit: Leaving...]
yoklov has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
sailias has joined #ruby
gr4v3|\| is now known as banisterfiend
Agis__ has joined #ruby
mahmoudimus has joined #ruby
<Agis__> how could I map vim to run the rspec command with the current file I'm editing?
arya has joined #ruby
kkiero has joined #ruby
clj_newb has joined #ruby
pehlert has quit [Quit: Leaving.]
mklappstuhl has quit [Ping timeout: 245 seconds]
erichmenge has joined #ruby
sailias has quit [Quit: Leaving.]
<workmad3> Agis__: :!rspec %
jgrevich has joined #ruby
<workmad3> Agis__: :! is a nice one to remember btw, it lets you run an arbitrary shell command ;)
<workmad3> Agis__: and % will translate to the path of the file in the currently active buffer
<Agis__> workmad3: nice!
<Agis__> workmad3: and how could I map this to for example ,R (, is my leader key)
clj_newb has quit [Ping timeout: 255 seconds]
<workmad3> Agis__: map <leader>R :!rspec %
<workmad3> Agis__: you might need a <cr> on the end of that, can't quite remember
<workmad3> Agis__: ah, looking at some of my other mappings, you will
quest88 has joined #ruby
<jaygen> Hanmac: symbols don't get GC'd so far as I know, if you're creating thousands of them dynamically in a long running program you might run in to high memory usage
brianpWins has quit [Quit: brianpWins]
<apeiros_> thousands would matter little
<apeiros_> that's a couple of KB
<workmad3> Agis__: you could also consider looking at something like https://github.com/skwp/vim-rspec
daniel_- has joined #ruby
datafirm has joined #ruby
mikepack_ has joined #ruby
<workmad3> jaygen: no they aren't GC'd... because there is always a reference to a symbol once it has been created
Tuxist has joined #ruby
<workmad3> jaygen: but at least you didn't make the mistake some people do and class that as a 'memory leak' :)
<apeiros_> o0
phelps has joined #ruby
arya has left #ruby [#ruby]
<Agis__> workmad3: others suggested to do a nnoremap. u know w hat's the difference?
<apeiros_> workmad3: by all means, the way symbols work *is* a memory leak. albeit an intentional one.
<canton7> RuntimeError: symbol table overflow. Never had that one before
<workmad3> Agis__: I believe that's a normal mode that is 'map if not already set'
zomgbie has quit [Ping timeout: 240 seconds]
Tuxist has quit [Remote host closed the connection]
<workmad3> apeiros_: no, they aren't a memory leak... because a memory leak is memory that has been allocated and then all pointers to it have been lost without it being de-allocated
<apeiros_> that's a narrow definition
Tuxist has joined #ruby
<phelps> how do you set the value of another attribute inside a attr_writer (ex. method called cash sets a real attribute called amount), so far I've tried amount and @amount (thats the name of the real attribute), perhaps I'm missing something
pehlert has joined #ruby
<apeiros_> the broad one is memory that is unused and can't be reused
<phelps> Using ActiveRecord (no rails)
<workmad3> apeiros_: right, neither definition applies to a symbol though :P
<apeiros_> workmad3: i.e., your definition is very much C specific
<apeiros_> workmad3: yes, it does
wakoinc has joined #ruby
<workmad3> apeiros_: no, because the memory a symbol occupies is *not* unused
<apeiros_> if you use the symbol :foobazzldazz once in your app and never use it again, you just leaked memory
chimkan has joined #ruby
<apeiros_> you can't reclaim it. you have no way of reclaiming it.
<workmad3> apeiros_: no, you simply misused a symbol
<apeiros_> so?
<apeiros_> of course you did. but by doing so, you did leak memory.
<workmad3> apeiros_: the memory has not been 'leaked'
<apeiros_> of course it has been.
skcin7 has joined #ruby
<workmad3> apeiros_: the memory is still always referenced, always being used for what it was meant for, always *accessible*, just not *accessed*
<apeiros_> you're unable to reclaim it.
<apeiros_> that's pointless
<jaygen> it's not "leaked" per se, just wasted
<workmad3> ^^
<Hanmac> "x = 3" also generates symbols :P
<apeiros_> "hey, I can still access that bit of memory which I no longer need or use"
<apeiros_> that's a technical detail which doesn't matter
<workmad3> apeiros_: it does matter, because that's the difference between a memory leak and just inefficient memory use :P
<jaygen> this is why I don't dynamically generate symbols
<apeiros_> workmad3: no, it's not
<apeiros_> you can use memory inefficiently and still reclaim it after that inefficient use
F1skr has joined #ruby
<apeiros_> inefficient memory use is *temporary*
<apeiros_> a memory leak is *permanent*
<workmad3> apeiros_: memory leaks are detectable when the program exits too
<workmad3> apeiros_: but the symbol table is cleaned up correctly...
<apeiros_> you're back at C specific viewpoints there
<jaygen> "In object-oriented programming, a memory leak happens when an object is stored in memory but cannot be accessed by the running code."
<workmad3> ^^
<apeiros_> not all that is C applies to all other languages.
<jaygen> technically you can still access the symbol
<apeiros_> yeah, I can cite from WP too: "A memory leak, in computer science (or leakage, in this context), occurs when a computer program consumes memory but is unable to release it back to the operating system."
<banisterfiend> workmad3: where do 'cyclic references' leaks exist in your definition? :P
<apeiros_> you're unable to release a symbol back
<workmad3> apeiros_: the program can release it
<jaygen> it can?
<workmad3> apeiros_: because that's what happens when the ruby runtime process exits
<apeiros_> workmad3: not from ruby
<workmad3> apeiros_: in that sense, every object in ruby is a memory leak then
<workmad3> apeiros_: because you can't actually release any of it
<workmad3> apeiros_: the garbage collector releases it
<apeiros_> yes, by stopping to reference it, the memory can reclaimed
<apeiros_> yes, which is a mechanism you make use of
<jaygen> yes, here lies the distinction... it's not a leak if the program still has control over the memory space
<apeiros_> even if indirectly
<workmad3> apeiros_: right... but symbols are perpetually referenced
<workmad3> apeiros_: that's part of their functionality
<apeiros_> workmad3: yes, that's the part about "intentional memory leak"
wakoinc has quit [Remote host closed the connection]
<workmad3> apeiros_: no, because a memory leak would be memory that isn't reclaimed after all references are lost
<apeiros_> it's a tradeoff, and a useful one too.
<apeiros_> you're stuck in a narrow viewpoint :-p
wakoinc has joined #ruby
<jaygen> I think generating symbols dynamically is bad practice and that was the point.
butblack has quit [Quit: butblack]
<apeiros_> I think I'll stop arguing at that point, as it's useless. I stand by my point that it is a memory leak by the intended meaning of the term.
JohnBat26 has joined #ruby
<workmad3> apeiros_: the 'intended' meaning of the word was a term for a bug where all references to memory was lost and couldn't be cleaned up by the program
<Hanmac> jaygen i never said you should generate them dynamically
<workmad3> apeiros_: so it's not a memory leak by the intended meaning
maletor has joined #ruby
<apeiros_> workmad3: see scrollback.
<apeiros_> I disagree with that viewpoint. end of discussion for me.
<workmad3> apeiros_: 'the program' includes the ruby runtime :P
butblack has joined #ruby
<apeiros_> again, already adressed.
blurred has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
<jaygen> not sure how you would look up a symbol in a hash without generating a symbol to look up
noxoc has quit [Ping timeout: 245 seconds]
<Hanmac> jaygen you could use symbols without generating them dynamicly
<Hanmac> and as i said: "x = 3" generates symbols too :P
JohnBat26 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<jaygen> I am actually interested in the answer to my question, look up the value of a hash which has symbols as keys without generating a symbol to look up, in this case, given a sentence which is being split into words.
kiyoura has joined #ruby
<workmad3> jaygen: well, you could iterate over hsh.keys and look up by that, which would avoid generating additional symbols
<jaygen> yeah but that would be inefficient
<workmad3> jaygen: all methods at this point will be inefficient compared to just attempting to use the symbol ;)
<jaygen> yes I agree
skcin7 has quit [Quit: Computer has gone to sleep.]
vonsar has quit [Quit: This computer has gone to sleep]
skcin7 has joined #ruby
<Hanmac> jaygen every method definition generates symbols so you should focus your hate one something that deserve it ... like ruby1.8
<jaygen> methods aren't generally declared dynamically and if you're generating millions of methods you're doing it wrong.
schwap has quit [Ping timeout: 256 seconds]
phelps has left #ruby ["Linkinus - http://linkinus.com"]
tk__ has joined #ruby
<jaygen> I don't hate you, I'm genuinely interested, sorry if it comes off the wrong way.
<apeiros_> it'd beat the purpose of having a hash (iterating over hsh.keys)
<apeiros_> jaygen: you can't. you'd have to reimplement Hash to be indifferent.
tommyvyo has quit [Quit: Computer has gone to sleep.]
blurred has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
vonsar has joined #ruby
alee has joined #ruby
rouss has joined #ruby
SCommette has quit [Quit: SCommette]
<apeiros_> hm, it'd be nice if there was a Symbol.defined?(name)
rouss is now known as Guest66160
irleif has quit [Quit: Computer has gone to sleep.]
<apeiros_> then you could do it in plain ruby, two step: `class Hash; def has_symbol_key?(key); Symbol.defined?(key) && has_key?(key.to_sym) end; end`
jimeh has quit [Quit: bye]
chimkan__ has joined #ruby
<jaygen> yeah that would be useful
<apeiros_> hm, you could implement it in pure ruby
stillEPIK has joined #ruby
<jaygen> it all comes back to that inefficiency problem though
<apeiros_> it'd require to keep track of all keys and enter them in a hash of its own
lucaspiller has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
arubin- has quit [Remote host closed the connection]
dkannan has quit [Remote host closed the connection]
NimeshNeema has quit [Remote host closed the connection]
yeban has quit [Remote host closed the connection]
ctevie has quit [Remote host closed the connection]
kapowaz has quit [Read error: Connection reset by peer]
jhowarth has quit [Write error: Broken pipe]
MoMo has quit [Write error: Broken pipe]
<apeiros_> yes
JarJar has left #ruby ["Leaving"]
<apeiros_> there we're back at what I said too already - the way symbols work is a tradeoff
<apeiros_> you trade performance for irreclaimable memory. this is acceptable since there's many situations where it won't lead to a problem.
<Hanmac> i use symbols as enum replacement
EPIK has quit [Ping timeout: 260 seconds]
<apeiros_> accepting arbitrary user input of course isn't one of those situations (which is what you covered as "dynamic symbol generation")
chimkan has quit [Ping timeout: 245 seconds]
chimkan__ is now known as chimkan
<apeiros_> btw. workmad3 - of course you can free *any* pointer - you can always just iterate the full memory space available to an app…
jenrzzz has joined #ruby
<apeiros_> i.e., if you'd hold on to your definition, then there's no memory leaks at all.
<workmad3> apeiros_: you can't tell if the memory has been allocated or not though
<apeiros_> workmad3: so? you can free it. that's all you need in your definition.
<banisterfiend> workmad3: if your closure accidentally keeps a reference to a huge object (by closing over a local) would you consider that a memory leak?
<apeiros_> collateral damage wasn't in it :-p
<workmad3> apeiros_: ' however, many people[who?] refer to any unwanted increase in memory usage as a memory leak, though this is not strictly accurate from a technical perspective.'
<apeiros_> yeah, "unwanted" is rather broad too…
<apeiros_> the phrasing of that one sentence is relatively useless anyway
andrew__ has joined #ruby
<apeiros_> leaking is not about the growth. it's about the inability to reclaim.
krisbulman has quit [Quit: krisbulman]
<workmad3> apeiros_: from the perspective of the program as a whole, the memory is reclaimable though
andrew__ is now known as andrewhl
<jaygen> I thought you guys were done
rabidpraxis has quit [Remote host closed the connection]
<apeiros_> workmad3: as said, I disagree, and I explained why. as said, as per your definition, there are no mem leaks whatsoever, since you can always somehow reclaim all memory.
<jaygen> not without rebooting the system
<workmad3> apeiros_: being able to iterate the memory space isn't the same as being able to reclaim the memory, because you have no way of telling what memory needs to be reclaimed at that point
Liquid_X has quit [Ping timeout: 260 seconds]
Takehiro has quit [Remote host closed the connection]
brianpWins has joined #ruby
<workmad3> apeiros_: still... you're right, I'm right, you're wrong, I'm wrong, still need to be careful with symbols :P
areil has quit [Remote host closed the connection]
Guest66160 has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
jenrzzz has quit [Ping timeout: 260 seconds]
vlad_starkov has quit [Remote host closed the connection]
nateberkopec has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
wakoinc has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
jgrevich_ has joined #ruby
chimkan has quit [Quit: chimkan]
jgrevich has quit [Ping timeout: 246 seconds]
jgrevich_ is now known as jgrevich
knite has joined #ruby
mmealling has left #ruby [#ruby]
blazes816 has joined #ruby
imami|afk is now known as banseljaj
medik has joined #ruby
itnomad has joined #ruby
<Hanmac> i do bindings they are bigger than the memory size they take while running ... so do i something wrong? :'P
Xeago has quit [Remote host closed the connection]
g_bleezy has joined #ruby
Xeago has joined #ruby
g-ram has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.9]
Ivo has quit [Quit: WeeChat 0.3.9]
mikepack_ has quit [Remote host closed the connection]
i8igmac has quit [Remote host closed the connection]
<shevy> yes
joeycarmello has joined #ruby
<shevy> you don't write documentation
<shevy> that is what you do wrong
slainer68 has joined #ruby
<Hanmac> yeah i know :'(
Xeago has quit [Ping timeout: 265 seconds]
slainer68 has quit [Ping timeout: 245 seconds]
apeiros_ has quit [Remote host closed the connection]
SCommette has joined #ruby
maletor has joined #ruby
jlwestsr has quit [Ping timeout: 246 seconds]
SCommette has quit [Client Quit]
krisbulman has joined #ruby
Vinz_` is now known as Vinz_
kaawee has joined #ruby
darthdeus has quit [Quit: Leaving...]
Virunga has joined #ruby
Takehiro has joined #ruby
Tuxist has quit [Read error: Connection reset by peer]
anildigital_work has joined #ruby
Tuxist has joined #ruby
arubin- has joined #ruby
dkannan has joined #ruby
rjsamson has quit [Remote host closed the connection]
rjsamson has joined #ruby
kapowaz has joined #ruby
jenrzzz has joined #ruby
shevy has quit [Read error: Operation timed out]
pehlert has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
clj_newb has joined #ruby
pmros has joined #ruby
neersighted has quit [Quit: http://neersighted.com]
rjsamson has quit [Ping timeout: 245 seconds]
Takehiro has quit [Ping timeout: 244 seconds]
jlwestsr has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
krisbulman has quit [Quit: krisbulman]
mikepack_ has joined #ruby
<pmros> hi!
neersighted has joined #ruby
bbttxu has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<matti> Lo
<pmros> hey, guys: what plugins could you code in ruby?
<pmros> kate
<pmros> sketchup
<pmros> ...
<pmros> mmmmmm
<blazes816> wat
<blazes816> plugins for what?
<pmros> plugins for some application
<pmros> whatever
<pmros> an editor
<pmros> for example
<blazes816> hmm. the only text editor I can think up would be RedCar, but idk how active that still is
<pmros> I know
pehlert has joined #ruby
irleif has joined #ruby
<pmros> it's a bit... inactive
vlad_starkov has quit [Ping timeout: 245 seconds]
MoMo has joined #ruby
<blazes816> figured
<blazes816> idk of any others
<blazes816> I used sublime, but it's python based
<blazes816> gross
zomgbie has joined #ruby
<pmros> mmmmmm sublimetext.... it's closed sourced
syamajala has quit [Remote host closed the connection]
<pmros> and maybe not free
<pmros> you can code plugins in python for many applications
<blazes816> I was specifically speaking of text editors
<blazes816> not many applications use ruby as a plugin system
<pmros> what's a pity
lucaspiller has joined #ruby
shevy has joined #ruby
Vinz_ is now known as Vinz_`
kaawee has quit [Ping timeout: 245 seconds]
zomgbie has quit [Ping timeout: 260 seconds]
zomgbie has joined #ruby
<pmros> blazes816: what kind of license have sublemetext? it's free... but you should pay
<pmros> like a donation?
<blazes816> it's not free, but it doesn't have a max length of the trial
<pmros> it's not logical
<blazes816> so like, I used the trial for ~6months before purchasing it
vlad_starkov has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
<blazes816> it isn't illogical. he gets what people pay AND people use his product
<pmros> a "trial" is time limited, by definition
<blazes816> if you want to be pedantic
<blazes816> call it 'free mode' then
<pmros> i think logical way is donation
<havenn> I like TextMate 2, as of recently open sourced :) https://github.com/textmate/textmate
<pmros> I use like
NimeshNeema has joined #ruby
<pmros> I think never will be a linus port
roadt` has quit [Ping timeout: 240 seconds]
<pmros> how many mac guys!
Takehiro has joined #ruby
<blazes816> i'm on a mac, but would consider myself a linux guy
irleif has joined #ruby
mikepack_ has quit [Remote host closed the connection]
<pmros> mac is unix, I know
<pmros> but what about freedom spirit?
<blazes816> what is freedom spirit?
<jaygen> it's pretty wide open still
<pmros> I guess matzu uses mac
<jaygen> you can install anything you want, iOS is another story
miphe has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
<blazes816> you can install whatever you want but you can't checkout a copy of the osx source or anything
<jaygen> it isn't FOSS, which sucks, but the hardware/software integration can't be beat
<pmros> darwin is open source... but anything else...
<blazes816> i don't have an issue with that, but I definitely wouldn't consider it 'open'
<jaygen> yeah I thought he was referring to it being locked down/requiring signed apps
ctevie has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
mneorr has joined #ruby
Poapfel has joined #ruby
<pmros> I'd like some hardware trademark ships linux on laptops
<pmros> 100% tested
krisbulman has joined #ruby
<pmros> it woud be very cheap
<pmros> it's like android
<pmros> linux + good hardware support
irleif has quit [Quit: Computer has gone to sleep.]
<pmros> many user would buy laptops with linux
<pmros> no windows licencese to pay
krisbulman_ has joined #ruby
krisbulman has quit [Read error: Connection reset by peer]
krisbulman_ is now known as krisbulman
<pmros> sometimes I can't understand
<pmros> so...
jude0 has joined #ruby
mmsequeira has joined #ruby
thinkdevcode has joined #ruby
mark06 has joined #ruby
<jude0> is there a standard/built-in/good way of doing lexical array comparison other than just diy checking each element iteratively?
rabidpraxis has joined #ruby
<banisterfiend> jude0: what is a "lexical array comparison"
mmsequeira_ has joined #ruby
<mark06> how to get standard and daylight saving time abbreviations for a given location in tzinfo?
<jude0> like checking each element for a comparator
telagraphic has joined #ruby
krisbulman has quit [Quit: krisbulman]
<banisterfiend> jude0: like sort_by ?
mneorr has quit [Ping timeout: 245 seconds]
<jude0> like sort_by in that it creates an iterator
dagnachewa has joined #ruby
<jude0> the <=>
gokul has joined #ruby
<banisterfiend> jude0: not quite sure what u're asking, can u give some example code?
<telagraphic> when initiating a new object, like a new account that accepts a starting balance parameter, is there a way to make that optional?
psycho_one has quit [Remote host closed the connection]
mmsequeira has quit [Ping timeout: 252 seconds]
<telagraphic> with some if logic?
rabidpraxis has quit [Ping timeout: 248 seconds]
instinkt has joined #ruby
Tref has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
<havenn> jude0: Is it demonstrable with two short example arrays, and the expected output?
<jude0> [1,2,3] <=> [1,2,3] = 0
<jude0> [1,2,4] <=> [1,2,3] = -1
<jude0> [1,2,3] <=> [1,2,4] = 1
<jude0> i am trying to see if there is a built in way to to define the <=>
krisbulman has joined #ruby
demas has joined #ruby
mark06 has left #ruby [#ruby]
jhowarth has joined #ruby
demas has left #ruby [#ruby]
demas has joined #ruby
tjbiddle has joined #ruby
mmsequeira_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
psycho_one has joined #ruby
<jude0> hm i will try that ... yea might not work with Proc... alright thanks for the input. I kind of do not think there is an answer. thanks for trying
dagnachewa has quit [Read error: Connection reset by peer]
<banisterfiend> jude0: so if you awnt different behaviour for a given array, you have to redefine <=> on the singleton class of the array
<banisterfiend> (you shoudl not redefine <=> on the Array class itself)
answer_42 has joined #ruby
jlwestsr has quit [Ping timeout: 246 seconds]
psycho_one has quit [Remote host closed the connection]
<telagraphic> can you set the initialize variable depending if it provided as an argument... if not provided it will default to 0 or if provided if will be the argument given https://gist.github.com/3965616
LucidDreamZzZ has joined #ruby
Morkel has quit [Quit: Morkel]
skcin7 has quit []
mmsequeira has joined #ruby
mmsequeira has quit [Client Quit]
yeban has joined #ruby
SCommette has joined #ruby
rafter has quit [Remote host closed the connection]
skcin7 has joined #ruby
SCommette has quit [Client Quit]
BoomCow has joined #ruby
CaptainJet has quit []
starship has quit [Quit: WeeChat 0.3.9]
krisbulman has quit [Quit: krisbulman]
CaptainJet has joined #ruby
sepp2k has joined #ruby
krisbulman has joined #ruby
darthdeu has joined #ruby
tk__ has quit [Quit: ばいばい]
mark06 has joined #ruby
<mark06> how to get standard and daylight saving time abbreviations for a given location in tzinfo?
levabalkin has joined #ruby
krisbulman has quit [Client Quit]
clj_newb has quit [Quit: Reconnecting]
clj_newb has joined #ruby
krisbulman has joined #ruby
joast has quit [Ping timeout: 245 seconds]
jmaya has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
levabalkin has quit [Ping timeout: 245 seconds]
aldodelgado has joined #ruby
kramutils has left #ruby [#ruby]
Tuxist has quit [Remote host closed the connection]
Rhynn has quit [Ping timeout: 244 seconds]
<Agis__> what do you guys for vim auto-completion with ruby?
d2dchat has joined #ruby
Chryson has joined #ruby
helichopter has quit [Quit: Leaving.]
helichopter has joined #ruby
<havenn> jude0: Just for the heck of it, here is a contrived example of using Ruby 2.0.0 refinements to modify <=>'s behavior with Array.
pmros has quit [Quit: Konversation terminated!]
rakl has joined #ruby
Agis__ has quit [Quit: Agis__]
<banisterfiend> havenn: awesome! curious how that looks
<banisterfiend> havenn: do you have much experience with 2.0 in general? can you show me how to use named parameters too?
Sol has joined #ruby
Sol is now known as Guest8394
jmaya has quit [Remote host closed the connection]
<havenn> banisterfiend: I haven't played around with the new params yet, must do!
whowantstolivefo has joined #ruby
aldodelgado has quit [Quit: aldodelgado]
chussenot has joined #ruby
Soliah has quit [Ping timeout: 260 seconds]
Rhynn has joined #ruby
Cultofmetatron has joined #ruby
vlad_starkov has joined #ruby
<jude0> thanks havenn. i just ended up doing something rather like that
geggam has quit [Remote host closed the connection]
sambio has quit [Ping timeout: 255 seconds]
awarner has joined #ruby
philcrissman has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
havenn has quit [Remote host closed the connection]
BoomCow has quit [Quit: Leaving]
Cultofmetatron has quit [Remote host closed the connection]
geggam has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
chussenot_ has joined #ruby
CQN has joined #ruby
brianpWins has quit [Ping timeout: 265 seconds]
chussenot has quit [Ping timeout: 246 seconds]
chussenot_ is now known as chussenot
icooba has quit [Ping timeout: 272 seconds]
icooba has joined #ruby
Axsuul has joined #ruby
mikeycgto has quit [Ping timeout: 260 seconds]
brianpWins has joined #ruby
brianpWins has quit [Remote host closed the connection]
irleif has joined #ruby
brianpWins has joined #ruby
jlwestsr has joined #ruby
nobitanobi_ has joined #ruby
datafirm has quit [Quit: datafirm]
<nobitanobi_> How can I round up a float to the nearest 0.05??
rjsamson has joined #ruby
Cultofmetatron has joined #ruby
krisbulman has quit [Quit: krisbulman]
mikepack_ has joined #ruby
rjsamson has quit [Remote host closed the connection]
rjsamson has joined #ruby
Morkel has joined #ruby
slainer68 has joined #ruby
cakehero has joined #ruby
krisbulman has joined #ruby
elaptics is now known as elaptics`away
Morkel has quit [Client Quit]
Morkel has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
flagg0204 has quit [Quit: Lost terminal]
khakimov has joined #ruby
Morkel has quit [Client Quit]
Slivka has joined #ruby
rjsamson has quit [Ping timeout: 252 seconds]
nicoulaj has joined #ruby
Morkel has joined #ruby
datafirm has joined #ruby
slainer68 has quit [Ping timeout: 252 seconds]
apeiros_ has joined #ruby
gokul has quit [Quit: Leaving]
krisbulman has quit [Quit: krisbulman]
awestroke has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #ruby
BoomCow has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
carlzulauf has quit [Ping timeout: 260 seconds]
<BoomCow> hi
carlzulauf has joined #ruby
geggam has quit [Remote host closed the connection]
_alejandro has joined #ruby
mark06 has left #ruby [#ruby]
mark06 has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
telagraphic has quit [Quit: Page closed]
frogstarr78 has quit [Read error: Connection reset by peer]
Morkel_ has joined #ruby
sent-hil has joined #ruby
frogstarr78 has joined #ruby
uris has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
Morkel has quit [Ping timeout: 240 seconds]
Morkel_ is now known as Morkel
nyrb has joined #ruby
d2dchat has quit [Remote host closed the connection]
clj_newb has quit [Ping timeout: 276 seconds]
instinkt has quit [Quit: leaving]
instinkt has joined #ruby
nlpplz has quit [Quit: Leaving]
hbpoison has quit [Read error: Connection reset by peer]
daniel_- has joined #ruby
elaptics`away is now known as elaptics
rippa has quit [Ping timeout: 245 seconds]
Cultofmetatron has quit [Remote host closed the connection]
Cultofmetatron has joined #ruby
sambio has joined #ruby
yaymukund has quit [Ping timeout: 265 seconds]
erichmenge has quit [Quit: Be back later]
LouisGB has joined #ruby
Cultofmetatron has quit [Remote host closed the connection]
akem has joined #ruby
SCommette has joined #ruby
Servidorv has joined #ruby
<Servidorv> hey guys how are you
<Servidorv> ??
<Servidorv> anyone here??
coj has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
dakine has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
k0nichiwa has joined #ruby
Takehiro has quit [Remote host closed the connection]
<Servidorv> no one??
dakine has joined #ruby
Virunga has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
<coj> question about eventmachine: is a spawned process basically just a function that runs asynchronously and whose .notify method returns instantly?
clj_newb has joined #ruby
jrist-afk has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
rjsamson has joined #ruby
tommyvyo has joined #ruby
answer_42 has quit [Ping timeout: 276 seconds]
chussenot has quit [Quit: chussenot]
mklappstuhl has joined #ruby
hbpoison has joined #ruby
andrewhl has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
mikepack_ has quit [Remote host closed the connection]
jrist-afk has joined #ruby
nobitanobi_ has quit [Ping timeout: 245 seconds]
tjbiddle has joined #ruby
Guest51202 has quit [Ping timeout: 272 seconds]
cantonic has quit [Quit: cantonic]
carlzulauf has quit [Remote host closed the connection]
carlzulauf has joined #ruby
hbpoison has quit [Read error: Connection reset by peer]
cantonic has joined #ruby
Alperen has joined #ruby
krisbulman has joined #ruby
slainer68 has joined #ruby
_alejandro has quit [Remote host closed the connection]
dangerousdave has quit [Read error: Connection reset by peer]
BoomCow has quit [Quit: This computer has gone to sleep]
mikepack_ has joined #ruby
Cache_Money has joined #ruby
slainer68 has quit [Ping timeout: 240 seconds]
rjsamson has quit [Remote host closed the connection]
rjsamson has joined #ruby
pdswan_ has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
cantonic has quit [Read error: Connection reset by peer]
mark06 has left #ruby [#ruby]
rjsamson has quit [Ping timeout: 245 seconds]
jaygen has quit [Remote host closed the connection]
jaygen has joined #ruby
akem has quit [Ping timeout: 276 seconds]
<shevy> servidorv heyyya
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
tommyvyo has joined #ruby
awarner has joined #ruby
icooba has quit [Quit: Computer has gone to sleep.]
cakehero has quit [Quit: Computer has gone to sleep.]
damagednoob has joined #ruby
dakine has quit [Quit: Leaving]
maletor has joined #ruby
mercwithamouth has joined #ruby
brianpWins has quit [Quit: brianpWins]
shadewind has joined #ruby
<shadewind> why does OptionParser#new take a block? why not just set things directly?
<apeiros_> and how'd you set things directly?
emergion has joined #ruby
tvw has joined #ruby
<shadewind> well... the initializer just yields the object itself
awarner has quit [Remote host closed the connection]
dimka has quit [Quit: leaving]
emergion has quit [Client Quit]
<apeiros_> so you mean instead of `option_parser = OptionParser.new do |o| o.foo end` you'd do `option_parser = OptionParser.new; option_parser.foo`?
dimka has joined #ruby
cakehero has joined #ruby
<shadewind> exactly
mercwithamouth has quit [Ping timeout: 245 seconds]
<apeiros_> well, you can do that
<shadewind> yeah I know ;)
conor_ireland has left #ruby [#ruby]
<shadewind> that's why I'm wondering why you'd use a block
<apeiros_> the block gives a nice way to show start/end of the parser definition
<apeiros_> it also gives a handy way to name your variable meaningfully, but use a shortcut during the definition
justinmcp has joined #ruby
<shadewind> I see
<apeiros_> (of course, you could do that using `o = option_parser = OptionParser.new` too)
<apeiros_> in this case, it's mostly a "stylistic" element
<shadewind> yeah, but the scope of 'o' would not go away after the parsing is done
dimka has quit [Client Quit]
dimka has joined #ruby
<apeiros_> s/parsing/definition of the parser/
<apeiros_> parsing happens at OptionParser#parse(!)
<shadewind> seems like a nice class in any case
<shadewind> especially when compared to getopts_long
<apeiros_> it's convenient. there are libraries built on top of it, which make it even simpler, though.
<shadewind> simple enough for me :)
<apeiros_> ^^
<shadewind> my most used language is C so I'm not very picky about convenience
<apeiros_> eh
<apeiros_> but that's one of the main reasons to use ruby
<shadewind> yeah I know
<shadewind> that's why I use it
fantazo has joined #ruby
<apeiros_> but I think I know what you mean ;-)
bapa has quit [Read error: Connection reset by peer]
J-_-L has joined #ruby
<shadewind> yeah, I'm just saying that my definition of "simple" and an experienced ruby programmers definition of "simple" are probably different
bapa has joined #ruby
krisbulman has quit [Quit: krisbulman]
JohnBat26 has quit [Ping timeout: 252 seconds]
LouisGB has quit [Ping timeout: 260 seconds]
<shadewind> though I must say that the documentation for the standard library is a bit spotty
<shadewind> the standard library seems more like a bunch of "these modules are nice, let's put them in ruby" that designed
hotovson has joined #ruby
<shadewind> which might be a good thing in many cases, though
<apeiros_> I assume the issue is more that most of stdlib originated in japan
<apeiros_> but yes
<apeiros_> sometimes docs leave something to be desired
<shadewind> but then again, I'm from a background of Java, Qt, POSIX, libc et.c. where documentation is very fleshed out
bapa has quit [Remote host closed the connection]
havenn has joined #ruby
tenmilestereo has joined #ruby
h4mz1d has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
bapa has joined #ruby
bapa has quit [Read error: Connection reset by peer]
bapa has joined #ruby
PragCypher has quit [Quit: Leaving]
tchebb has quit [Ping timeout: 245 seconds]
eph3meral has quit [Quit: eph3meral]
bapa has quit [Excess Flood]
mikeycgto has quit [Ping timeout: 245 seconds]
tjbiddle has quit [Quit: tjbiddle]
bapa has joined #ruby
vonsar has quit [Read error: No route to host]
Slivka has quit [Remote host closed the connection]
BoomCow has joined #ruby
h4mz1d has quit [Ping timeout: 245 seconds]
robustus has quit [Quit: ZNC - http://znc.in]
Morkel has quit [Quit: Morkel]
ltsstar has quit [Quit: ltsstar]
BoomCow has quit [Quit: Leaving]
justinmcp has quit [Remote host closed the connection]
arturaz has quit [Remote host closed the connection]
ryanf has joined #ruby
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
<Servidorv> hey guys
cakehero has quit [Quit: Computer has gone to sleep.]
<Servidorv> i have a var params, that contain the params i have
<Servidorv> but what i need is if params['pageid'] exists delete it
<Servidorv> what will be the best way to do it??
<blazes816> params.delete 'pageid'
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
<Servidorv> that easy?? and if is not there ?? will it return an error??
<blazes816> nope
<blazes816> it will return nil
<Servidorv> oh cool thanks bro :)
erichmenge has joined #ruby
<blazes816> if it is there, it will return the value deleted
<blazes816> np
<Servidorv> oh but the value??
<Servidorv> can it delete the key and the value??
cableray has joined #ruby
<blazes816> yeah, all keys must have values and visa versa
<blazes816> delete takes a key, and removes that key and value
<blazes816> {'foo' => 1}.delete('foo') #=> 1
<blazes816> and the hash would now be empty as well
clj_newb has quit [Quit: Reconnecting]
clj_newb has joined #ruby
<Servidorv> so when i do params.delete 'pageid' will delete params{'pageid'=>'1'} ??
jaygen has quit [Remote host closed the connection]
<blazes816> yeah
<Servidorv> cool man
<Servidorv> thanks bro
<Servidorv> u have saved me :)
<blazes816> i've been known to sow salvation
slainer68 has joined #ruby
Russell^^ has quit [Quit: Russell^^]
<Servidorv> :)
<Servidorv> hey bro this is the result https://gist.github.com/3966473
<Servidorv> is it written right??
<blazes816> yeah
<blazes816> looks like it
<Servidorv> thanks bro :)
jlwestsr has quit [Ping timeout: 246 seconds]
blacktulip has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 265 seconds]
cableray has quit [Quit: cableray]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
dmiller has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
skcin7 has quit [Quit: Computer has gone to sleep.]
pskosinski has joined #ruby
BadProphet has joined #ruby
eph3meral has joined #ruby
datafirm has quit [Quit: datafirm]
chussenot has joined #ruby
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
alanp has joined #ruby
tjbiddle has joined #ruby
krisbulman has joined #ruby
tjbiddle has quit [Client Quit]
cableray has joined #ruby
ryanf has quit [Ping timeout: 245 seconds]
alanp_ has quit [Ping timeout: 255 seconds]
<apeiros_> blazes816: vice versa ;-)
<blazes816> what?
nyrb has quit [Remote host closed the connection]
<apeiros_> it's vice versa, not visa versa
<blazes816> :(
akemEikko has joined #ruby
akem has quit [Read error: Connection reset by peer]
<dharmaturtle> can someone tell me the word for #{variable} so I know what to google?
<apeiros_> string interpolation
<dharmaturtle> :D thanks
<apeiros_> but there isn't really anything to it other than #{} being the sequence, and arbitrary ruby code being allowed in it
<blazes816> two words, but close
<apeiros_> ok, there is a bit more to it
<apeiros_> #{} is the sequence to invoke it
<apeiros_> any code is allowed, the return value is inserted in the string. if the return value is not a string, to_str or to_s is called on it
anderse has joined #ruby
anderse has quit [Client Quit]
<apeiros_> it can be used in double quoted strings (that's "foo", %{foo}, %Q{foo}), regexen /#{}/ and dquoted symbols: :"#{foo}"
<apeiros_> oh, and in here-docs too of course (except the single quoted here-doc)
<dharmaturtle> ahh, that's handy. Thanks apeiros_! Pretty cool about the regex part
cantonic has joined #ruby
akemEikko has quit [Quit: Forget progress by proxy. Land on your own moon.]
<apeiros_> but that's now really all I think
akem has joined #ruby
<apeiros_> yeah, with regexen, there's a special niceness: you can do: a = /a/i; b = /b/; c = /#{a}#{b}/
BoomCow has joined #ruby
love_color_text has joined #ruby
<blazes816> it's wonderful
<apeiros_> it'll retain the flags (that's because Regexp#to_s is awesome)
<blazes816> especially if you write web scrapers all day ;)
love_color_text has quit [Remote host closed the connection]
<apeiros_> or irc parsers
<apeiros_> (hell on earth, I tell you)
akem has quit [Max SendQ exceeded]
<blazes816> psh, try extracting a business name out of an arbitrary html document
<blazes816> bullshit
pjs has joined #ruby
_alejandro has joined #ruby
elaptics is now known as elaptics`away
Dreamer3 has joined #ruby
akem has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
sent-hil has quit [Remote host closed the connection]
<pjs> hey all.. Total Ruby noob here. Is this valid? http://dpaste.com/819145/
<apeiros_> dpaste is never valid!!!!!!!1!1
* apeiros_ takes a look
<apeiros_> looks good, I'd use || instead of `or` (I'm never sure about precedence with `or`)
<pjs> apeiros_ thanks! I'll update
mklappstuhl has quit [Ping timeout: 240 seconds]
<apeiros_> I'd also use #{identifier.inspect} or even #{identifier.class}:#{identifier.inspect} instead of #{identifier}
<apeiros_> pjs: the `or` may very well be fine
love_color_text has joined #ruby
_alejandro has quit [Ping timeout: 240 seconds]
<pjs> apeiros_ well #{identifier} is a string.
<pjs> apeiros_ I'm trying to update this plugin (which I only inherited cause the main repo maintainer doesn't update anything!) https://bitbucket.org/petersanchez/redmine-bitbucket/src/12afb9f4bd15d16ae7ee68ad039b1a5569fcfa41/app/controllers/bitbucket_hook_controller.rb?at=default
<apeiros_> pjs: ah, well, then I'd replace identifier with repository there
<apeiros_> so you see what it actually is
J-_-L has quit [Quit: Leaving.]
<pjs> apeiros_ so some how I became the maintainer of a Ruby project when I don't know thing about ruby lol. But I want to update this plugin so I can accept git repo's also hosted at BitBucket
<apeiros_> i.e., a good exception states what was expected and what was there instead
_alejandro has joined #ruby
<apeiros_> pjs: with git, you can just maintain a fork. as for the rest - just learn ruby then :-p
ryanf has joined #ruby
<pjs> apeiros_ I've got enough on my plate right now ;)
jenrzzz has joined #ruby
mercwithamouth has joined #ruby
_alejandro has quit [Ping timeout: 240 seconds]
<pjs> apeiros_ thanks for the help!
jenrzzz has quit [Ping timeout: 260 seconds]
GoGoGarrett has joined #ruby
hbpoison has joined #ruby
sertaconay has quit [Ping timeout: 245 seconds]
Zoxc has joined #ruby
tjbiddle has joined #ruby
yaymukund has joined #ruby
volty has joined #ruby
nicoulaj has quit [Remote host closed the connection]
advorak has quit [Quit: This computer has gone to sleep]
pskosinski has quit [Ping timeout: 252 seconds]
Cultofmetatron has joined #ruby
advorak has joined #ruby
mikepack_ has quit [Remote host closed the connection]
advorak has quit [Client Quit]
advorak has joined #ruby
cantonic has quit [Quit: cantonic]
jlwestsr has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
_alejandro has joined #ruby
miphe has quit [Quit: Leaving]
yeggeps has quit [Ping timeout: 276 seconds]
micsha has joined #ruby
<Zoxc> anyone know how to test for end of input in treetop?
whowantstolivefo has quit [Ping timeout: 245 seconds]
darthdeu has quit [Quit: Leaving...]
whowantstolivefo has joined #ruby
mklappstuhl has joined #ruby
shtirlic has quit [Remote host closed the connection]
joeycarmello has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
havenn has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
havenn has joined #ruby
fdddd333 has joined #ruby
whowantstolivefo has quit [Disconnected by services]
jenrzzz has joined #ruby
fdddd333 is now known as whowantstolivefo
_alejandro has quit [Ping timeout: 264 seconds]
<micsha> I'm reading Manning's "Well grounded rubyist": need help with modules, I have a simple module written, all it does is puts "hello", now when I try to include it as a module in my testmodule.rb it gives me 'require cannot load such file -- Testmodule (LoadError)
<micsha> what does this mean or what am I doing wrong?
GoGoGarrett has quit [Remote host closed the connection]
awarner has joined #ruby
statarb3 has quit [Quit: Leaving]
<volty> micsha: what do you mean by including? Paste the offending line, please.
<volty> @others, what' s the diff between this chan and #ruby-lang?
<micsha> what service do you prefer I paste it into?
ryanf has quit [Ping timeout: 240 seconds]
freakazoid0223 has joined #ruby
<volty> micsha: here, just the line where you "include" you module
<volty> your
zomgbie has quit [Ping timeout: 240 seconds]
<micsha> class ModuleTester
<micsha> include Testmodule
<micsha> end
jude0 has left #ruby [#ruby]
CaptainJet has quit []
<micsha> this is from test.rb it's just a simple driver program that runs the module.
<blazes816> #ruby-lang is for development of the language itself
<blazes816> this is for development with it
<micsha> idealy
<volty> thx blazes816
damagednoob has quit [Read error: Connection reset by peer]
<volty> micsha: where's your module defined? In the same source (test.rb) ? - then check spelling, it seems that it tries to autoload
<micsha> no, it's in a seperate source file
pskosinski has joined #ruby
<apeiros_> blazes816: um, actually there's not really any difference between #ruby and #ruby-lang - just different owner
<micsha> #ruby is friendlier #ruby-lang tends to be elitist. I've told them to fuck themselves a couple of times.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
tvw has quit [Ping timeout: 245 seconds]
Cultofmetatron has quit [Remote host closed the connection]
<volty> micsha: then require it before including (e.g. require 'testmodule' - if the file containing it is caleld 'testmodule.rb')
<micsha> it's pretty rare that I have problems with people in #ruby
tenmilestereo has quit [Quit: Leaving]
bbttxu has quit [Quit: bbttxu]
tjbiddle has quit [Quit: tjbiddle]
<micsha> volty: I'll give that a shot, just a second.
<blazes816> as long as shevy isn't around it's a pretty manageable place
<micsha> volty: require 'Testmodule'
<micsha> class ModuleTester
<micsha> include Testmodule
<micsha> end
mikepack_ has joined #ruby
<micsha> that's how it looks right now.
<micsha> is that correct?
<pskosinski> I have something like this: http://wklej.org/id/856403/ and in "start" I'm getting error "undefined method `eof?' for nil:NilClass" I think that I see why… Anyway, how to initialize handler properly? If I understand correctly I need to make new object of class but problem is that I don't want to connect when initializing
<micsha> ruby 1.9.3p194 (2012-04-20 revision 35410) [amd64-freebsd8]
<micsha> /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require': cannot load such file -- Testmodule (LoadError)
<micsha> from /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `require'
<micsha> from test.rb:2:in `<main>'
<volty> micsha: you have to include (require) the file that contains the module to be included, or you have to follow the rules for autoloading files
kirun has quit [Quit: Client exiting]
virtuose has quit [Ping timeout: 272 seconds]
<micsha> the book I'm reading hasn't said word 1 about that yet...
<micsha> a little disappointing...
<apeiros_> pskosinski: did you call `connect` before calling `start`?
<pskosinski> apeiros_: Oh, sh. -.- I failed again. Thank you. :)
<volty> micsha: just place (for now) the definition of the module in the same file (test.rb)
<apeiros_> shit happens :)
<apeiros_> yw
c0rn_ has joined #ruby
virtuose has joined #ruby
mneorr has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
<micsha> [grumble]
clj_newb has quit [Ping timeout: 244 seconds]
mneorr has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
mneorr has quit [Remote host closed the connection]
<whowantstolivefo> i created a sample app in my folder and i created a controller with name os `say` action name with ` hello ` . in my app i created hello.html.erb. and i put ` <h1>hello this is sample text and image</h1> <img src="/app/assets/images/rails.png"> ' <<<< when i go to localhost:3000/say/hello i can see text message but i cant view rails.png ? this picture is in my /app/assets/images/ folder i can see that... i tried <img src=''images/rails.png> also
<whowantstolivefo> but i still cant view rails.png when i go localhost:3000/say/hello ?
jaygen has joined #ruby
skcin7 has joined #ruby
hotovson has quit [Remote host closed the connection]
yeggeps has joined #ruby
ryanf has joined #ruby
BrianJ has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
tekknolagi has joined #ruby
<tekknolagi> hi blazes816
<tekknolagi> you here and ready for more questions? ruby specific this time :P
dpn` has joined #ruby
<apeiros_> whowantstolivefo: #rubyonrails is a channel dedicated to rails issues
<blazes816> haha, i'll try
<tekknolagi> blazes816: fantastic. well first off check out the new UI at http://brightswipe.com
<dpn`> howdy.. just a quick noob question I'm having trouble googling for. How do you split a method call over multiple lines?
<dpn`> with named params
<tekknolagi> dpn`: just do it as such
<blazes816> wow, very nice
<dpn`> Ruby seems to be converting my params into a hash
<BrianJ> how would I go about taking a url like https://s3.amazonaws.com/test/database_export.rb and only returning database_export? I can get down to database_export.rb by using pathname and base name, but is there a way to also remove the .rb?
<apeiros_> dpn`: that's probably because your last param is a hash
<apeiros_> and is unrelated to how you spread it over the lines
<apeiros_> obj.foo bar: 1, baz: 2 # that passes a single argument to foo, the hash {:bar => 1, :baz => 2}
<BoomCow> apeiros_, elaborate?
<tekknolagi> blazes816: anyhow, can i pm? #ruby is more crowded atm
<blazes816> sure
<dpn`> apeiros_ tekknolagi I've tried these two variations: http://dpaste.com/819160/
<apeiros_> dpn`: yes, what you pass is indeed a hash
<BoomCow> both are hashes
<tekknolagi> dpn`: try adding braces {} for multiline?
<dpn`> apeiros_: can you give me an example of calling the method with named parameters?
<apeiros_> dpn`: there is no such thing in ruby
<BoomCow> what do you mean by named parameters don`
<apeiros_> your second version is what we use which is close to named params, but isn't really named params
<micsha> volty: ok, that seemed to work. Thanks.
<BoomCow> dpn` *
Cultofmetatron has joined #ruby
toto_ has quit [Ping timeout: 255 seconds]
pac1 has joined #ruby
andy__ has joined #ruby
<BoomCow> php thing?
<dpn`> ah.. rubists use a hash to mimic named param like behaviour?
<apeiros_> yes
<apeiros_> I think 2.0 will add real named params, until then, only syntax sugared hash passing
nyrb has joined #ruby
<dpn`> yeah.. it's sugar in python too
<dpn`> hence why method calls are expensive
<dpn`> great, thanks for the info
<apeiros_> yeah, it's not the only reason for expensive method calls, tho
<dpn`> no, of course
zomgbie has joined #ruby
<micsha> thanks guys.
micsha has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Now with extra fish!]
<volty> yw
vonsar has joined #ruby
<dpn`> BoomCow: python fwiw :)
<dpn`> syntactically it's not much different from the ruby hash passing syntax
<dpn`> it's just already unpacked in the function you are calling
<BoomCow> dpn`, ahh :)
<BoomCow> if you want to give it a name
<volty> (1..5).to_a.map { |i| "&#{i}" }, is there a way (ruby-1.8) to get read of that local i? Something like (but with sugar) map(:&to_s) ?
<BoomCow> can't you just pass in the hash itself
<volty> s/read/rid/
jaygen has quit [Remote host closed the connection]
<dpn`> BoomCow: I'm a relative noob.. I don't have a hash yet.. and the function i wrote doesn't expect a hash
Progster has joined #ruby
<dpn`> but I'll change my style to be more idiomatic now that i know better :)
<BoomCow> and then to referencee it
<BoomCow> params[:name][:user]
nyrb has quit [Remote host closed the connection]
<BoomCow> params[:name][:deal]
<BoomCow> iirc
<BoomCow> I'm semi-noob :)
zomgbie has quit [Read error: Operation timed out]
<pjs> hey all, is this valid Ruby? http://dpaste.com/819163/ It was working fine, but I've added / changed lines 19, and 21-27. I'm guessing it's if/else that's wrong?
lkba has quit [Ping timeout: 252 seconds]
banseljaj is now known as imami|afk
mercwithamouth has joined #ruby
<dpn`> BoomCow: yep.. thanks :)
<BoomCow> pjs let me look
<blazes816> pjs: use || instead of or, for one
<blazes816> idk other than that
<blazes816> looks good at least
<BoomCow> is his logic for that line correct?
<BoomCow> shouldn't it be if?
<BoomCow> if it's unlesss
<BoomCow> it should be
<BoomCow> unless repository.is_a?(Repository::BitBucket) || ...
mneorr has joined #ruby
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<apeiros_> pjs: `exec(command)` <-- you most likely do *not* want that
<pjs> BoomCow, ahh.. let me try
<apeiros_> exec replaces the currently running process entirely. your rails app will no longer run.
<apeiros_> oh
<BoomCow> pjs, lmk if it works
<apeiros_> you redefined exec further down
<apeiros_> meh, baaaaaad, don't shadow kernel methods :-p
g-ram has joined #ruby
cakehero has joined #ruby
<apeiros_> makes your code harder to read & understand
<pjs> apeiros_ It worked fine before? heh
<blazes816> oh well then you should totally do it
<apeiros_> pjs: yes, I didn't notice that you redefined exec.
<apeiros_> pjs: note however, that Kernel.system does not return the output. that'd be either ``, or one of the popen/spawn family
<apeiros_> (system returns the exit status)
<BoomCow> pjs i was wrong
<BoomCow> unless repository.is_a?(Repository::BitBucket)
<pjs> BoomCow hrmm, still getting an exception
<BoomCow> that should be sufficient
<apeiros_> also, foo("#{command}") is a pointlessly verbose way to say foo(command) (since command already is a string…)
<pjs> apeiros_ right.. like I said, I just try to udpate this plugin. I'm not a ruby dev at all. I just use this plugin and the maintainer doesn't respond to anything.. so I can't explain why things are the way they are.. I just know it "worked".. I'm just trying to add support for git repo's that are hosted on BitBucket
<pjs> BoomCow, Repository::BitBucket ?
chussenot has quit [Quit: chussenot]
<BoomCow> pjs however you defined your BitBucket repository
<BoomCow> you want to raise that error unless repository is bitbucket
<BoomCow> you just leave it your way
<pjs> Yea.. you know what.. let me remove this line
<BoomCow> if repository.is_a?(Repository::Mercurial) or repository.is_a?(Repository::Git)
<BoomCow> just use an if instead
<BoomCow> it's the same thing
<BoomCow> as unless bitbucket
<BoomCow> so you raise the error if repository is mercurial or github
<pjs> is "if not repository.is_?... or ...." valid?
sent-hil has joined #ruby
sent-hil has quit [Remote host closed the connection]
<BoomCow> sure
<BoomCow> just think about it for a bit :)
Hanmac has quit [Ping timeout: 245 seconds]
<pjs> oh wow.. it's working.. I was being dumb. I was sending the json but not placing it in the payload variable.
chussenot has joined #ruby
<BoomCow> awesome :)
<BoomCow> which line was that
Hanmac has joined #ruby
chussenot has quit [Client Quit]
<pjs> it wasn't in the code.. I was sending json to test so I don't have to actually hook to bitbucket
mahmoudimus has joined #ruby
<pjs> so the good news is, the code worked. The bad news is, something isn't working with the git call.. but that's not related to this.. hah
<pjs> BoomCow, apeiros_, thanks again for the help
chussenot has joined #ruby
<BoomCow> good luck man
andrewhl has quit [Remote host closed the connection]
hbpoison has quit [Read error: Connection reset by peer]
thinkdevcode has quit [Read error: No route to host]
jaygen has joined #ruby
thinkdevcode has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
ebobby has joined #ruby
mikepack_ has quit [Remote host closed the connection]
pskosinski has left #ruby ["Whatever"]
c0rn_ has quit []
nerdy has joined #ruby
daniel_- has joined #ruby
kzrl has quit [Ping timeout: 260 seconds]
daniel_- has quit [Client Quit]
freeayu has joined #ruby
kzrl has joined #ruby
tjbiddle has joined #ruby
<havenn> I balked at Ruby 2.0's named parameters requiring parens, but I guess naked parens already do. https://gist.github.com/3966916
<havenn> *guess naked hashes already do*
pjs has left #ruby [#ruby]
khakimov has quit [Quit: Computer has gone to sleep.]
<heftig> havenn: naked hashes?
coj has quit []
<havenn> heftig: I mean when you can ditch the "{}" around a hash when it is used as a argument with parens. I said that terrible...
<heftig> you mean what "why adjective: 'tasty', noun: 'Bacon'" would currently do?
<havenn> heftig: yeah
<heftig> that doesn't require parens
<volty> a good one: «Matz himself said that autoload will be removed from the language and he "strongly discourages the use of autoload in any standard library" »
carlzulauf has quit [Read error: Operation timed out]
Cultofmetatron has quit [Remote host closed the connection]
<havenn> volty: But not removed in 2.0, right?
tenmilestereo has joined #ruby
<havenn> volty: Just a future deprecation warning?