apeiros changed the topic of #ruby to: Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com
<popl> 16:55 < zendeavor> waxjar: you should see this other spam link from #freenode # recommendation
narcan has joined #ruby
kaspergrubbe has joined #ruby
tjbiddle has quit [Ping timeout: 264 seconds]
archer_ has joined #ruby
<xybre> Here's an example: https://gist.github.com/acook/6198305
echevemaster has joined #ruby
<zendeavor> okay.
archer_ is now known as Guest34834
binw has quit [Ping timeout: 264 seconds]
pipework has quit [Remote host closed the connection]
JumpMast3r has joined #ruby
Yakko has quit [Ping timeout: 240 seconds]
efrainolivares has joined #ruby
mlpinit has joined #ruby
arya_ has joined #ruby
marcdel has joined #ruby
<xybre> However, when you explicitly reopen the module and define the method, it works. (Gist updated)
bradsmith has quit [Ping timeout: 248 seconds]
rupee has quit [Quit: Leaving]
<waxjar> when you do Enumerable.extend it defines the methods as class methods xybre
baroquebobcat has joined #ruby
<waxjar> so Enumerable.whatever
<xybre> waxjar: I know, the gist says that.
Mekkis has quit [Ping timeout: 245 seconds]
nfk has quit [Quit: yawn]
<waxjar> instead ah, didnt see the gist i was scrolled up i guess
<xybre> Oh, I said extend earlier when I meant include, sorry :) Its fixed in the gist.
<xybre> I've only tested this on Ruby 2.0.0p247, so I'm not sure if its different in 1.9.3.
arya_ is now known as arya__
arya__ has quit []
arya_ has joined #ruby
arya_ is now known as arya__
arya__ has quit [Client Quit]
Mekkis has joined #ruby
arya_ has joined #ruby
arya_ has quit [Client Quit]
arya__ has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
pitzips has quit [Quit: Leaving]
rodacato has quit [Remote host closed the connection]
arya__ has quit [Client Quit]
arya_ has joined #ruby
<waxjar> hmm, that's weird
<xybre> So, there's no sane way to add methods to already loaded modules.
mlpinit has quit [Remote host closed the connection]
cj3kim has quit [Remote host closed the connection]
<xybre> Looks like 1.9.3 works the same way.
zorg24 has joined #ruby
s00pcan has quit [Ping timeout: 245 seconds]
BRMatt has joined #ruby
mlpinit has joined #ruby
mlpinit has quit [Remote host closed the connection]
Neener54 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baroquebobcat has quit [Quit: baroquebobcat]
sailias has joined #ruby
dallasm has joined #ruby
s00pcan has joined #ruby
athst has quit [Quit: athst]
sparr_ has quit [Ping timeout: 240 seconds]
twoism has joined #ruby
edj4en has joined #ruby
Spooner has quit [Remote host closed the connection]
sailias has quit [Ping timeout: 246 seconds]
terlar has quit [Quit: leaving]
edj4en has quit [Remote host closed the connection]
tealmage has joined #ruby
marr has quit [Ping timeout: 260 seconds]
lebek has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lebek has joined #ruby
elaptics is now known as elaptics`away
eka has quit [Quit: Computer has gone to sleep.]
Kricir has joined #ruby
rbento has quit [Quit: ZZZzzz…]
i_s has quit [Remote host closed the connection]
efrainolivares has quit [Quit: efrainolivares]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
s00pcan has quit [Read error: Operation timed out]
bradsmith has joined #ruby
bradsmith has quit [Remote host closed the connection]
bradsmith has joined #ruby
Kricir has quit [Ping timeout: 276 seconds]
twoism has quit [Remote host closed the connection]
lebek has quit [Ping timeout: 276 seconds]
twoism has joined #ruby
bradsmith has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
rbento has joined #ruby
rbento has quit [Max SendQ exceeded]
Ciscoridze has quit [Quit: WeeChat 0.4.1]
efrainolivares has joined #ruby
cj3kim has joined #ruby
mlpinit has joined #ruby
s00pcan has joined #ruby
mityaz has quit [Quit: See ya!]
BRMatt has quit [Ping timeout: 240 seconds]
Roa has quit [Ping timeout: 240 seconds]
bradhe has quit [Ping timeout: 248 seconds]
ewnd9 has quit [Ping timeout: 264 seconds]
robert_ has joined #ruby
efrainolivares has quit [Client Quit]
bricker is now known as bricker`away
mlpinit has quit [Remote host closed the connection]
marcdel has joined #ruby
pkrnj has quit [Quit: Computer has gone to sleep.]
v0n has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
agarie has quit [Remote host closed the connection]
scarolan1 has quit [Ping timeout: 264 seconds]
scarolan has joined #ruby
adeponte has quit [Remote host closed the connection]
scarolan2 has quit [Ping timeout: 246 seconds]
<awpti> Okay, my mind is blown. Is there a single tutorial that goes over including and using external resources? I've created a class, included it with "require_relative", but none of the methods are available. It's either my including an external resource wrong or I don't get how to call methods from an included class.
scarolan_ has joined #ruby
<pontiki> require does not include things
pkrnj has joined #ruby
mando has quit [Remote host closed the connection]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<awpti> Then I'm completely lost. https://gist.github.com/gominecraft/6198544
bigmac has joined #ruby
bigmac is now known as i8igmac
Guest34834 has quit [Remote host closed the connection]
amacgregor_ has joined #ruby
snovak has quit [Remote host closed the connection]
robbyoconnor has quit [Read error: Connection reset by peer]
bzitzow has quit [Ping timeout: 276 seconds]
tommyvyo has joined #ruby
amacgregor has quit [Ping timeout: 260 seconds]
twoism_ has joined #ruby
maniacal has joined #ruby
robbyoconnor has joined #ruby
amacgregor_ has quit [Ping timeout: 260 seconds]
twoism has quit [Ping timeout: 240 seconds]
<pontiki> you're mixing sinatra app typs
tommyvyo has quit [Quit:]
twoism_ has quit [Ping timeout: 240 seconds]
<awpti> What does that even mean?
dodosan has quit [Remote host closed the connection]
<pontiki> where you have at line 10, "get_users"
<pontiki> how do you think it will know where that is?
x1337807x has quit [Quit: Textual IRC Client: www.textualapp.com]
<pontiki> you have a method in a class, App#get_users
<pontiki> why would the sinatra app know about that?
<awpti> I also tried App.get_users, App::get_users
<awpti> That was just my latest pasted try.
<pontiki> it's an instance method
<pontiki> i don't see anywhere you created an instance of App
<awpti> Oh shit. Yay for a second pair of eyes.
athst has joined #ruby
mlpinit has joined #ruby
outmyself has joined #ruby
outmyself has left #ruby [#ruby]
baroquebobcat has joined #ruby
dayepa has quit [Quit: dayepa]
amacgregor has joined #ruby
jjbohn has joined #ruby
jacktrick has quit [Quit: Leaving]
dayepa has joined #ruby
Tippler has quit [Quit: Textual IRC Client: www.textualapp.com]
Tippler has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
Lewix has quit [Remote host closed the connection]
tommyvyo has joined #ruby
Lewix has joined #ruby
scarolan has quit [Ping timeout: 240 seconds]
scarolan has joined #ruby
DrShoggoth has joined #ruby
scarolan_ has quit [Ping timeout: 260 seconds]
scarolan_ has joined #ruby
sailias has joined #ruby
Lewix has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Ping timeout: 260 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
poga has quit [Remote host closed the connection]
mrsolo has left #ruby ["Leaving"]
freeayu has joined #ruby
Lewix has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
arya_ has quit [Ping timeout: 264 seconds]
zeade has joined #ruby
Kricir has joined #ruby
twoism has joined #ruby
tkuchiki has joined #ruby
reset has quit [Ping timeout: 276 seconds]
arya_ has joined #ruby
narcan has joined #ruby
Spami has joined #ruby
mikepack has quit [Remote host closed the connection]
Spami has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 264 seconds]
twoism has quit [Ping timeout: 240 seconds]
optimusprimem has quit [Ping timeout: 245 seconds]
mlpinit has quit [Remote host closed the connection]
mlpinit has joined #ruby
robscomputer has joined #ruby
Inside has quit [Ping timeout: 246 seconds]
i_s has joined #ruby
athst has quit [Quit: athst]
Emmanuel_Chanel has quit [Read error: No route to host]
diegoviola has quit [Ping timeout: 256 seconds]
Neener54 has joined #ruby
twoism has joined #ruby
sgkim126l has quit [Read error: Connection reset by peer]
ilyam has quit [Quit: ilyam]
i_s has quit [Ping timeout: 260 seconds]
Neener54 has quit [Client Quit]
kreeves has joined #ruby
tjad has quit [Ping timeout: 246 seconds]
sparr_ has joined #ruby
ssvo has joined #ruby
Voodoofish4301 has quit [Quit: Leaving.]
twoism has quit [Remote host closed the connection]
twoism has joined #ruby
dankest has quit [Quit: Peace]
maniacal has quit [Remote host closed the connection]
dorei has quit []
wesside has quit [Quit: Computer has gone to sleep.]
pen has quit [Read error: Connection reset by peer]
pen has joined #ruby
bricker`LA has joined #ruby
mikeg has joined #ruby
ctp has quit [Ping timeout: 240 seconds]
wesside has joined #ruby
snovak has joined #ruby
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ffranz has quit [Quit: Leaving]
wy_stack has quit [Remote host closed the connection]
blandflakes has quit [Disconnected by services]
ixti has quit [Quit: WeeChat 0.4.1]
mikeg has quit [Remote host closed the connection]
snovak has quit [Ping timeout: 276 seconds]
gh has joined #ruby
poga has joined #ruby
ilyam has joined #ruby
<platzhirsch> meh, how do I write Ruby core extensions in a modular way so I can include them via mix-in? Seems like module M; class Symbol; def m; ... ; end ; end ; end does not work very well
ilyam has quit [Remote host closed the connection]
<r0bgleeson> platzhirsch: why not?
<platzhirsch> r0bgleeson: don't know yet, but I guess the problem is elsewhere
<platzhirsch> r0bgleeson: what is important is, that Symbol should be Symbol from the Ruby core and not my own class
radic_ has quit [Read error: Operation timed out]
ZoanthusR has quit [Quit: Linkinus - http://linkinus.com]
<fryguy> platzhirsch: add the methods to the module, redefine Symbol, and then include the module in the reopened Symbol
gh has quit [Quit: quit]
<platzhirsch> well, it works when I write it like module M; class ::Symbol ...
<r0bgleeson> platzhirsch: that's the same as class Symbol; end outside any module.
<r0bgleeson> the Symbol you open inside M does not belong to M
Astral__ has quit [Ping timeout: 260 seconds]
<r0bgleeson> because of the '::' prefix.
<r0bgleeson> what are you trying to do?
<platzhirsch> ah ok, so I does not matter then whether I mixin my module or not, as long as the file gets executed the Symbol class is extended
<r0bgleeson> im confused as to how you expect this to work
twoism has quit [Ping timeout: 246 seconds]
<r0bgleeson> if you want to mixin methods to Symbol, you say: class Symbol; include MyModule; end.
<platzhirsch> okay, so I want to add some additional functionality, but I only want it to work when I mix in the module to my code
<platzhirsch> I guess it makes more sense this way
<r0bgleeson> i see
diegoviola has joined #ruby
jjbohn has quit [Quit: Leaving...]
renderful has joined #ruby
<platzhirsch> r0bgleeson: I just reread what baisterfiend suggested me and that's what you said
<r0bgleeson> i'm going to give you a solution but i dont know what youre trying to do: module MyModule; def self.included(klass); Symbol.class_eval { include MyMod }; end; end
<platzhirsch> ¨and it's polite if you put that stuff in a module that you then *include* into the core class. hat way you give way to other redefinitions of those methods, and also give precedence to a core method if ruby decides to implement it”
<r0bgleeson> yeah, you're not redefining any methods by using a module
<r0bgleeson> you might add a method that takes precedence over another
mando has joined #ruby
<platzhirsch> I mean that's the whole thing of modules, you want to add behavior to the class (object) where you mix in the module
<platzhirsch> idea*
<r0bgleeson> but if you it to *only* happen when a user includes your module into their class, you can use the included() hook to do it then.
<r0bgleeson> if i'm extending a core class i make it opt-in, and you opt-in by require "robslibrary/core_ext/hash"
<r0bgleeson> but i dont extend core classes that much, hardly ever
<platzhirsch> r0bgleeson: for a vanilla Ruby library that seems perfectly fine, but since Rails does the requiring I just write it into a file that gets auto-loaded anyway. I just tried to understood what banisterfiend meant when he said I should put the methods into a module and mix in the module into the core library class
zets has joined #ruby
<r0bgleeson> yeah thats the nice way to do it, you're not redefining any methods.
twoism has joined #ruby
<platzhirsch> I didn't intent to start monkey patching in the first place, but I listened to the Confident Ruby talk and presented some patterns to avoid timid code which tends to too many nil checks, type checks, exceptions etc.
gildo has quit [Ping timeout: 264 seconds]
amacgregor_ has joined #ruby
<r0bgleeson> i dont encourage monkey patching, i try to avoid it, but it's a nice flexibility when you need to extend or fix other code
<platzhirsch> for instance I am dealing a lot of time with symbols representing objects of my domain and I keep translating the symbol into the object, adding a lot checks
<r0bgleeson> so wrap the symbol in a class in your domain
<r0bgleeson> implement the behavior there
<r0bgleeson> dont monkey patch Symbol to do it
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<platzhirsch> yeah you are right
mlpinit has quit [Remote host closed the connection]
<platzhirsch> you mean something like my_domain(symbol) which then returns the desired output?
radic_ has joined #ruby
amacgregor has quit [Ping timeout: 260 seconds]
<r0bgleeson> i meant something like: module NS; class Symbol; def initialize(ruby_symbol); @ruby_symbol = ruby_symbol; end; ...... ; end
<r0bgleeson> where ..... is the custom behavior
<r0bgleeson> and your code passe NS::Symbol's around.
<r0bgleeson> NS is short for namespace
<r0bgleeson> just random name
<platzhirsch> ok
<r0bgleeson> the idea is that you define the custom behavior local to the code that interacts with yours
<r0bgleeson> and not something global, like Symbol
pen has quit [Remote host closed the connection]
efrainolivares has joined #ruby
<platzhirsch> makes sense, it would be too narrow otherwise
pen has joined #ruby
Kricir has joined #ruby
<r0bgleeson> if its a private object, it should never leak out of your interface ever
<r0bgleeson> no one knows about it but you
<r0bgleeson> it doesnt need to
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby
twoism has quit [Remote host closed the connection]
otherj has joined #ruby
otherj has quit [Max SendQ exceeded]
jonathanwallace has quit [Read error: Operation timed out]
twoism has joined #ruby
bricker`LA has quit [Quit: leaving]
efrainolivares has quit [Client Quit]
Kricir has quit [Ping timeout: 264 seconds]
jp- has joined #ruby
Lewix has quit [Ping timeout: 248 seconds]
twoism has quit [Ping timeout: 240 seconds]
emergion has joined #ruby
jp- has quit [Client Quit]
freerobby has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
zachrab has joined #ruby
jp- has joined #ruby
Emmanuel_Chanel has joined #ruby
<r0bgleeson> platzhirsch: those are just my ideas on how i normally try to approach an API. some people think trying to make things private is not "ruby ish"
io_syl has quit [Ping timeout: 264 seconds]
<r0bgleeson> so consider other approaches too dont need to go that far
IceyEC has quit [Quit: IceyEC]
<platzhirsch> r0bgleeson: well, it sounds healthy, I am just thinking through some refactorings for my code :)
Neener54 has joined #ruby
randomau_ has joined #ruby
dik_dak has joined #ruby
v0n has quit [Ping timeout: 276 seconds]
Inside has joined #ruby
saarinen has joined #ruby
randomautomator has quit [Ping timeout: 246 seconds]
ffio has joined #ruby
randomau_ has quit [Ping timeout: 276 seconds]
scarolan has quit [Read error: Operation timed out]
scarolan_ has quit [Ping timeout: 246 seconds]
away_sondr3 has quit [Quit: QUIT:Reason::Probably a crash]
sailias has quit [Read error: Connection reset by peer]
Es0teric has joined #ruby
bradsmith has joined #ruby
platzhirsch has left #ruby [#ruby]
thesheff17 has quit [Remote host closed the connection]
wesside has quit [Quit: Computer has gone to sleep.]
optimusprimem has joined #ruby
optimusprimem has quit [Changing host]
optimusprimem has joined #ruby
zodiak has quit [Quit: Leaving]
supergiantrobot has quit [Quit: supergiantrobot]
snovak has joined #ruby
zachrab has quit [Read error: Connection reset by peer]
zachrab has joined #ruby
snovak has quit [Ping timeout: 248 seconds]
Kruppe has joined #ruby
zmansiv has quit [Read error: Operation timed out]
wesside has joined #ruby
saarinen has quit [Quit: saarinen]
zachrab has quit [Remote host closed the connection]
saarinen has joined #ruby
stkowski has quit [Quit: stkowski]
pen has quit [Remote host closed the connection]
becky_ has quit [Ping timeout: 246 seconds]
nanoxd_ has joined #ruby
carlyle has joined #ruby
nanoxd has quit [Ping timeout: 240 seconds]
pen has joined #ruby
wesside has quit [Quit: Computer has gone to sleep.]
zmansiv has joined #ruby
io_syl has joined #ruby
saarinen has quit [Quit: saarinen]
iFire_ has quit [Read error: Connection reset by peer]
iFire has joined #ruby
dallasm has quit [Remote host closed the connection]
devoldmx3 has quit [Remote host closed the connection]
Kricir has joined #ruby
wesside has joined #ruby
Vivekananda has quit [Remote host closed the connection]
stuartrexking has quit [Quit: Leaving...]
cj3kim has joined #ruby
stuartrexking has joined #ruby
fgo has joined #ruby
tanema has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 240 seconds]
tommyvyo has joined #ruby
echevemaster has quit [Ping timeout: 264 seconds]
nitish has joined #ruby
endash has quit [Quit: endash]
cj3kim has quit [Ping timeout: 248 seconds]
echevemaster has joined #ruby
mlpinit has joined #ruby
ColKurtz has joined #ruby
devoldmx has joined #ruby
v0n has joined #ruby
16WAAU1XB has joined #ruby
arya_ has quit [Ping timeout: 260 seconds]
RichardBaker has joined #ruby
baroquebobcat has joined #ruby
jonathanwallace has joined #ruby
baroquebobcat has quit [Client Quit]
mlpinit has quit [Ping timeout: 260 seconds]
stuartrexking has quit [Quit: Linkinus - http://linkinus.com]
marcdel has joined #ruby
ananthakumaran has joined #ruby
chriskk has quit [Quit: chriskk]
pkrnj has quit [Quit: Computer has gone to sleep.]
jonathanwallace has quit [Read error: Operation timed out]
ElCapitanMarklar has joined #ruby
v0n has quit [Ping timeout: 240 seconds]
johnkary has joined #ruby
zeromodulus has quit [Remote host closed the connection]
tanema has joined #ruby
johnkary has quit [Client Quit]
Opettaja has joined #ruby
johnkary has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
fgo has quit [Remote host closed the connection]
mando has quit [Remote host closed the connection]
scarolan has joined #ruby
scarolan_ has joined #ruby
tanema has quit [Ping timeout: 240 seconds]
zorg24 has quit [Ping timeout: 248 seconds]
carlyle has quit [Remote host closed the connection]
noop has joined #ruby
randomautomator has joined #ruby
Opettaja has quit [Remote host closed the connection]
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
scarolan_ has quit [Read error: Operation timed out]
scarolan has quit [Ping timeout: 241 seconds]
i_s has joined #ruby
Bry8Star{T2 has quit [Remote host closed the connection]
<pontiki> feh. bundler
Megtastique has quit [Ping timeout: 260 seconds]
Bry8Star{T2 has joined #ruby
kobain has quit [Ping timeout: 240 seconds]
randomautomator has quit [Ping timeout: 264 seconds]
nitish has quit [Remote host closed the connection]
ssvo has quit [Ping timeout: 260 seconds]
St_Marx has joined #ruby
snovak has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
kobain has joined #ruby
pierre1 has joined #ruby
snovak has quit [Ping timeout: 276 seconds]
kobain_ has joined #ruby
pierre1 has quit [Ping timeout: 248 seconds]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
ElCapitanMarklar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xcv_ has quit [Remote host closed the connection]
kobain has quit [Ping timeout: 276 seconds]
ffio has quit [Ping timeout: 264 seconds]
crucify_me has joined #ruby
sparr_ has quit [Ping timeout: 260 seconds]
dik_dak has quit [Quit: Leaving]
stevenrockarts has joined #ruby
fuzzy_ has joined #ruby
<crucify_me> hi please describe what this #gsub! is actually doing. should I be entering a key/value pair at the command prompt "Enter your new idea: " ? this is from why's poignant. thanks http://pastie.org/8223654
fuzzy has quit [Ping timeout: 246 seconds]
grits has quit [Ping timeout: 260 seconds]
fgo has joined #ruby
staafl has joined #ruby
hamakn_ has quit [Remote host closed the connection]
ryannielson has joined #ruby
<havenwood> crucify_me: Its a method for string substitution: http://ruby-doc.org/core-2.0/String.html#method-i-gsub
<crucify_me> thanks I know havenwood but how do I get this to work? Do I type in a key/value or just a new key name, here called the "new idea." thanks
nijan has joined #ruby
<Nilium> What isn't working?
<crucify_me> Nilium: by looking at the code, and playing around with entries, I can't figure out what it should be doing.
<Nilium> What are you trying to do?
<nijan> Hello, I want to log all exception into a file. Is there any difference in using $stderr vs redefining the Exception class?
<crucify_me> Nilium: It
<Nilium> nijan: Uh.. those are completely different things?
<crucify_me> It's an example, just trying to see how it works
<crucify_me> Nilium: ^^
<Nilium> How it works is by iterating over the kv-pairs in the hash and replacing any instances of the key with the value.
<nijan> Nilium, don't they lead to the same result?
<pontiki> why is pry trying to load a gem i'm developing in a completely different directory? https://gist.github.com/tamouse/1ffe94e30f6def673266
<Nilium> nijan: How does changing Exception and using $stderr for something lead to the same thing?
<nijan> I don't know, that why I am asking.
<Nilium> Are you trying to log all exceptions as they're raised?
<nijan> Yes
ananthakumaran1 has quit [Ping timeout: 248 seconds]
<crucify_me> replacing any instances of the key. but I'm entering new input at the prompt, so the textbook says to get rid of the evil word and replace it with a "code" word. its why's poignant which is a bit distracting...
<Nilium> You could just alias raise, override it, and call the alias after logging the exception.
<crucify_me> Nilium: ^
<Nilium> You don't have to say my name each time. I can read.
<Nilium> Though I should set up a notification sound that screams my name.
<Nilium> Like an angry "you've got mail" sound
<crucify_me> pardon I always do the wrong thing hence moniker
<nijan> Hmm, I still don't get it, what's the difference with using $stderr?
<Nilium> What's using $stderr have to do with anything?
<nijan> Alright.
<crucify_me> let me put it this way. what would you input at the two prompts in this prog. to do what the code intends to do?
<crucify_me> I understand the file naming part
freerobby has quit [Quit: Leaving.]
<Nilium> What does the code intend to do?
<nijan> Thanks
nijan has quit []
<Nilium> I have to assume you know what it does already, 'cause I'm not going to guess at its intent
<fuzzy_> Hi I have a piece of code running in eventmachine that 1 in 50 processes will runaway ( 100% cpu util ) maybe twice a day ( the code runs 24/7 ) could anyone suggest a way to find out what is causing it?
amacgregor_ has quit [Ping timeout: 260 seconds]
<zets> fuzzy- I think there's an #eventmachine
Kruppe has quit [Remote host closed the connection]
Lewix has joined #ruby
<crucify_me> well the code_words hash has these evil keys firebomb, starmonkey etc. I guess I am to replace the evil sounding key with a gentler sounding one, and then store -something I'm not sure what - in the file
<Nilium> Well, go back and read the book thing again and figure out what you're supposed to do
<Nilium> 'Cause not knowing what you're supposed to do is just going to make this unnecessarily difficult and kind of stupid
tgunr_ has quit [Quit: Nity nite]
<crucify_me> the book is garbled and overly clever and I can't glean what it wants to do. I am confused around line 6
<pontiki> line 6 in the pastie?
<Nilium> Then try harder, re-read it, or find a different book?
<crucify_me> sorry pontiki line 17.
<Nilium> Again, this looks like a case of you trying to do something but you don't even know what you're supposed to do so you're assuming we'll know but we obviously won't
<crucify_me> I tried to explain.
<Nilium> Third-hand mind-reading of someone's reading of a book they don't understand isn't really a good way to figure out how to help someone.
<Nilium> All I got from your explanation was "I don't know what this is supposed to do and I don't know what I'm supposed to do"
sparr_ has joined #ruby
<pontiki> crucify_me: did you read the documentation posted previously?
<Nilium> Maybe you can point someone to the part of the book that's giving you trouble? I don't know.
kreeves has quit [Ping timeout: 264 seconds]
taion809 has joined #ruby
<Nilium> If the book's not getting through to you though, then just don't read it. It's fair enough, why's really not that good of a writer, he's just eccentric.
<Nilium> Got a heading you can point to?
arya_ has joined #ruby
ssvo has joined #ruby
<crucify_me> 'making the swap'
<Nilium> Think I found it under "Your Repetitiveness Pays Off"
osvico has joined #ruby
<crucify_me> yeah just before 'text files of a madman'
<crucify_me> :)
<pontiki> oh well
<pontiki> Nilium: don't enable
<crucify_me> ok I'm out thanks
BurntToast has joined #ruby
<Nilium> I can only assume you either stopped reading or weren't reading.
<Nilium> That said, I'm still convinced why tried way too hard to be eccentric.
<crucify_me> I understand 95% of the code. but when code_words is used in the code block with idea.gsub!(real, code) I lose a sense of what is happening.
<Nilium> Why?
<crucify_me> because I can't tell what the inputted "idea" is intended to replace/ or do. is it the new key or is the whole key/value to be switched out?
<Nilium> What?
<Nilium> Here's an idea, something you can do on your own: go line by line and comment each one explaining exactly what it's doing.
<Nilium> Now go do it.
<crucify_me> ok
rheologic55 has quit [Quit: rheologic55]
<Nilium> What a horrible night to have a curse.
sparr_ has quit [Ping timeout: 260 seconds]
<pontiki> i think my pry issue might be an issue with bundler :(
fricandelle11 has joined #ruby
<pontiki> but i don't understand why it would be
ananthakumaran has joined #ruby
<crucify_me> curse?
<pontiki> or rvm...
stevenrockarts has quit [Quit: stevenrockarts]
<Nilium> Curse or cold.
<Nilium> Family visiting and at least one of them is carrying a virus.
<BurntToast> Hey lads. Any chance I could get a quick bit of help? I need to loop through the instance variables of an object, and set them to something. I've got this got worked out:
<BurntToast> [#ruby] ce variables of an object, and set them to something.
<BurntToast> Ive got this bit worked out a.instance_variables.each do |var|
<Nilium> Please, please use a pastebin.
<BurntToast> Sorry... be back in a moment
kaspergrubbe has joined #ruby
<crucify_me> lads and lassies
<BurntToast> Hey lads. Any chance I could get a quick bit of help? I need to loop through the instance variables of an object, and set them to something. I've got this got worked out:
<BurntToast> sry... stopping
snovak has joined #ruby
<pontiki> i'll just ignore the question
<Nilium> I prefer to be called an it.
<crucify_me> << just please
dodosan has joined #ruby
parzo_ has quit [Remote host closed the connection]
sevenseacat has joined #ruby
i8igmac has quit [Quit: Leaving]
kaspergrubbe has quit [Ping timeout: 240 seconds]
snovak has quit [Ping timeout: 248 seconds]
rippa has joined #ruby
agjacome has quit [Ping timeout: 260 seconds]
JumpMast3r has quit [Quit: JumpMast3r]
josiah14 has joined #ruby
<josiah14> quick question from a ruby learner
<josiah14> so, in haskell
<Nilium> So help me, if you mention a monad..
<josiah14> I can define a function that gives me an array [n..0] as such
<josiah14> let f n = enumFromThenTo n (pred n) 0
subbyyy has quit [Ping timeout: 264 seconds]
<josiah14> then f 10 gives me [10, 9, 8, 7, 6, 5, 4, 3, 2,1,0]
<josiah14> is there a way to do something like that in Ruby
<popl> >> (10..0).to_a
<eval-in> popl => [] (https://eval.in/42038)
<popl> \o/
fricandelle11 has quit [Quit: fricandelle11]
<popl> a winner is me
<Nilium> >> (0..10).to_a.reverse
<eval-in> Nilium => [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] (https://eval.in/42039)
<popl> (0..10).to_a.reverse
<popl> haha
<popl> beat me
<Nilium> popl spends too much time in rubinius I think
<popl> Nilium: never used it
<josiah14> popl, looking for something more generic
<Nilium> That is generic.
<popl> but I imagine ranges like that can't be descending?
<Nilium> Ranges can't have negative steps.
<popl> bitchin'
<crucify_me> http://pastie.org/8223654 ok, back to the deep stuff: if I enter at the prompt 'Enter your new idea:' firebomb, kindling I'm attempting to replace firebomb with the key kindling, a gentle word for an evil word
<Nilium> Not seein' comments, back to your desk and work on your assignment.
<popl> Nilium: similar in Perl
<BurntToast> Hey guys, sorry for the earlier spam. My questions is here: pastebin.com/4JBw142q
<BurntToast> I am just unsure of the syntax to use |var| to access the instance variable for assignment.
gz0 has quit [Ping timeout: 248 seconds]
<pontiki> josiah14: simple enough to define a method, like your f function in haskell:
<Nilium> Did you check the docs?
<josiah14> that's a huge shortcoming, actually, because that means if I had to do some calculation that is faster starting at the end of the list, I would have to first compute the entire list to get to the last element and work backward
<pontiki> >> def f(n); (0..n).to_a.reverse; end; p f(7); p f(2); p f(13)
<eval-in> pontiki => [7, 6, 5, 4, 3, 2, 1, 0] ... (https://eval.in/42040)
<Nilium> josiah14: wat?
<Nilium> These aren't lists.
<josiah14> so if I am working with lists of 100 million elements, that's going to be a performance bottleneck
<popl> josiah14: ruby is different inside
<Nilium> You asked how to make an array of 0 to N numbers in reverse. You got the answer.
<Nilium> If your concern is something else, ask the actual question.
<popl> ^
<josiah14> dunno, I just tried to grab the last element of a 100 million element *array in Ruby and it took a long time
<BurntToast> did you use .last or try to iterate to it?
<josiah14> Infinity = 1.0/0
<josiah14> Z = 0..Infinity
<Nilium> He's probably confusing creating a 100 million-element array and its population with access.
<josiah14> puts Z.take(100000000).last
<Nilium> ..
Neener54 has quit [Quit: Adios muchachos!!!]
<Nilium> I think haskell broke you
<josiah14> hahaha
fixl has joined #ruby
<josiah14> I'm just seeing how far away from C/C++ style stuff I can get in Ruby
<BurntToast> Is that intended to get the last element from an array stored in an array of arrays?
<popl> >>omg I don't have enough memory
<eval-in> popl => /tmp/execpad-8a7af0a66606/source-8a7af0a66606:2: unterminated string meets end of file ... (https://eval.in/42041)
<popl> oops
<popl> sorry
<josiah14> yah, 1 billion exceeds my memory restrictions
<josiah14> which tells me it isn't truly lazy
<popl> I just got up to 83% of my memory being used and 2% swap and figured I should abort
<josiah14> well, it is
<josiah14> but I have to compute the entire array to get the last elem
<crucify_me> commented version : http://pastie.org/8223744
Koshian has quit [Quit: Tiarra 0.1+svn-39192: SIGTERM received; exit]
ntus1017 has joined #ruby
Koshian has joined #ruby
unurged48 has joined #ruby
<Nilium> josiah14: If you already know the last element, why are you building the entire array?
<josiah14> I'll tell y'all what I'm trying to do, at the risk of somebody solving the whole damn problem for me
<Nilium> .. Why didn't you just do that in the first place?
<popl> if they do you can then meditate on the rubiness of the answer
<josiah14> I'm working on a generic solution for project euler problem 1
<popl> which one is that again?
fgo has quit [Remote host closed the connection]
<Nilium> It's the easy one
tommyvyo has quit [Quit:]
<josiah14> the problem is to find the sum of teh multiples of 5 and 3 between 0 and 999
<popl> make me look…
<josiah14> I know well how to do this C++ style
<Nilium> "If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000."
<popl> its sort of fizz-bangy
<josiah14> but would rather learn some of the more functional aspects of Ruby
<josiah14> so my first solution was
<josiah14> Infinity = 1.0/0
<josiah14> Z = 0..Infinity
<popl> 10*23?
<Nilium> ...
<josiah14> puts Z.take(100000000).select { |i| i%3 == 0 || i%5 == 0 }.inject { |sum, x| sum + x }
<Nilium> Why infinity? O_o
<josiah14> but I took 1000 instead
<josiah14> I wanted to be able to genericize the list
<Nilium> *array
agjacome has joined #ruby
<josiah14> array, damn haskell terms
unurged48 has quit [Client Quit]
<josiah14> anyway
<Nilium> You should really just forget about haskell for this. It's going to seriously screw you over.
<popl> oh wait not 10*23
pkrnj has joined #ruby
<josiah14> yah, it works for Z.take(1000)
Spami has joined #ruby
<josiah14> but I would like it to work for any number
<josiah14> so
<josiah14> I know how to speed up performance
<Nilium> 1) look at enumerable and lazy enumeration
Koshian has quit [Client Quit]
<josiah14> if I find the last multiple of 15 in the list
Koshian has joined #ruby
<josiah14> I can add n/3(last common mult + 3)/2
<josiah14> and n/5(last common mult + 5)/2
<Nilium> Check out Enumerable#select
<josiah14> and subtract n/15(last commom mult + 15)/2
<josiah14> + the remaining multiples of 3 and 5 after the last common mult of 15
<josiah14> and that will get me the sum
<josiah14> so if I could reverse the list
<BurntToast> *array
<BurntToast> =p
<josiah14> finding the last few multiples would be easy
tommyvyo has joined #ruby
<josiah14> and then I could make the solution generic so that it would work for finding the sum of say, any combo of multiples I want
<Nilium> >> 999.downto 0
<eval-in> Nilium => #<Enumerator: 999:downto(0)> (https://eval.in/42042)
<josiah14> aah
<josiah14> so I could use n.downto assuming n is an integer
<Nilium> Yes.
<Nilium> Or n.to_i.downto
<Nilium> However, that's a waste of time
<Nilium> General Ruby practice seems to be to assume input is correct.
osvico has quit []
<josiah14> oh, okay
<josiah14> rather than C where I basically assume the input is going to be wrong all the time
<josiah14> lol
cj3kim has joined #ruby
<Nilium> Also look at Enumerable#find
conjugium18 has joined #ruby
<josiah14> I should probably just read through the entire Enumerable doc
<Nilium> I'd highly recommend it.
conjugium18 has quit [Client Quit]
<Nilium> It's probably the thing you end up using most in Ruby.
mikepack has joined #ruby
<BurntToast> Hey guys, I have a (probably) simple problem, could you please have a quick look at my issue. http://pastebin.com/P3nBgffT
<josiah14> I'm of the general opinion that if possible, Web crap should be kept stateless unless state is absolutely needed
aetaric has quit [Ping timeout: 264 seconds]
<Nilium> I'm of the general opinion that the web is horrifyingly and full of tiny spiders that leap out of your computer at night and crawl into your tear ducts so that when you next cry your face is consumed by spiders.
<Nilium> *horrifying
<BurntToast> so you frequent 4chan.
<Nilium> No.
<BurntToast> =p
<Nilium> I frequent Something Awful.
<josiah14> hahaha
redmenace has quit [Ping timeout: 240 seconds]
<josiah14> I'm not so certain I haven't had dreams like that
<crucify_me> sorry, but I guess the "idea" is to enter two inputs , so I did crutch, broken_foot, and now I see how it works. what threw me was inputting the entire key/value pair separated by a comma. is that correct Nilium?
<Nilium> I don't know.
* Nilium munches crackers.
<pontiki> jeepers
<Nilium> My modified LimeChat theme is purdy.
cj3kim has quit [Ping timeout: 240 seconds]
hamakn has joined #ruby
<BurntToast> Nilium: would you mind checking my pastebin? I don't even need a definite answer, just a pointer in the right direct.
<BurntToast> direction*
<BurntToast> I would really appreciate it.
<popl> BurntToast: Can you describe your problem outside of the paste?
hamakn has quit [Read error: Connection reset by peer]
<popl> BurntToast: I mean, in English?
hamakn_ has joined #ruby
<popl> BurntToast: If you can't understand your problem how do you expect other people to? :)
<BurntToast> I can. I have an object, and I am looping throug its instance variables like so:
<pontiki> oh crikey, popl, if that were the cases, we could shut this place down and just hang out
aetaric has joined #ruby
<BurntToast> popl: I explained and linked a pastebin.com question as per an earlier request to not spam the channel
16WAAU1XB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<BurntToast> but basicall I have a loop like: a.instance_variables.each do |var|
<popl> you were pasting code
<popl> no
<popl> not in code, BurntToast
<popl> English
Demo_of_doom_ has joined #ruby
<BurntToast> sorry
<popl> :)
shadoi has quit [Quit: Leaving.]
<BurntToast> It's not my first language
<popl> don't be sorry, I'm not looking for some apology.
<popl> I want you to translate your thoughts from code into English. If you can do that there's a good chance that you can figure your own problem out whilst explaining it.
<BurntToast> I have two objects, which are identical, but unknown to me. I have to randomly choose instance variables from one or the other and make an 'offspring'
<Nilium> Your pastebin link lacked an http:// which means my client doesn't consider it clickable
<BurntToast> Ohh sorry
<popl> Nilium: have another cracker.
<crucify_me> Nilium: have two
<pontiki> BurntToast: what do you get when you run that?
<pontiki> i'm not answering cos not-a-lad
<pontiki> but i'll ask questions still
<BurntToast> irb(main):032:0> puts a.instance_variables
<BurntToast> @a
<BurntToast> @b
<crucify_me> pontiki: Me Lady, may I ask a question?
<BurntToast> Using the @a and @b I would like to assign a's a and b property a value
<popl> me lady?
<Senjai> BurntToast: What are you trying to do?
ananthakumaran has quit [Ping timeout: 248 seconds]
<BurntToast> popl: a clearer version of my question would be 'how do I loop through the instance variables of an object and assign them the value 5'
<crucify_me> me lady , yes it's a polite form
<crucify_me> from shakespeare's time
ntus1017 has quit [Remote host closed the connection]
<pontiki> sure, crucify_me, but you never answer anything i say to you
<BurntToast> Senjai: I am trying to create a new object which contains properties from two other objects, randomly chosen vetween the two. But the objects are unknown to me while I write the script.
nijan has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
tetraedron41 has joined #ruby
<Senjai> BurntToast: Sorry, I don't quite understand
<Nilium> popl: Would, but the cat is biting my arm
tetraedron41 has quit [Client Quit]
ehaliewicz has joined #ruby
<Nilium> She's been locked in a room with a litter box all day and now it's night, she's out, and she's hyper.
<crucify_me> http://pastie.org/8223744 one sec pontiki
<Nilium> But we can't let her out during the day because my niece and nephew are horrible to cats.
<popl> Nilium: put it on the cracker
<pontiki> BurntToast: i do think i understand what you want to do
joast has quit [Quit: Leaving.]
<pontiki> basically, genetic combinations from two parents to child, based on random selection of traits from the parents
<BurntToast> pontiki: I have two objects, unknown structure, and I want to make a third new one, and assign it values from one of the parents raondly.
<BurntToast> Yes pontiki!
ColKurtz has quit [Ping timeout: 260 seconds]
<crucify_me> pontiki: I don't see how line 6 works with the beginning of the code block on line five. Is it because only line 5 indicates that the object is a hash?
<nijan> Hello, I want all ruby's exceptions to be logged in a file. I aliased and redefined raise for that, but the code won't work as expected. http://pastebin.com/h83ZcwK5
cj3kim has joined #ruby
<pontiki> crucify_me: tell me what class $code_words is
<nijan> Maybe I should redefine Exception...
<crucify_me> pontiki: it's a hash
<crucify_me> sorry it was in the original paste
ryannielson has quit [Quit: ryannielson]
huskies34 has joined #ruby
<crucify_me> also I needed to make the code_words global -- I was wondering if that is archaic ruby
<Nilium> I think I'll just use some sort of broken socratic method going forward.
<crucify_me> sounds good
<Nilium> Which doesn't mean I'm helping you
<popl> Nilium: Did you have a cracker?
<Nilium> I've had about three.
<pontiki> crucify_me: what happens when you do .each on a hash?
<popl> how's the cat taste?
huskies34 has quit [Client Quit]
<Nilium> Moderately cat-like
<popl> Nilium: can't go wrong with that description :)
kevinykchan has joined #ruby
cmw46 has joined #ruby
Inside has quit [Ping timeout: 264 seconds]
cmw46 has quit [Client Quit]
<crucify_me> it iterates over the hash. using the two vars which I assume are key/value. so is that how idea knows that it is to be a hash entry? because when I look at the resultant file, the form is just separated by a comma.
diegoviola has quit [Ping timeout: 248 seconds]
<crucify_me> i.e. when I input crutch, broken_foot, there's nothing throughout the operation and storage into the file that indicates it is a hash, which is confusing.
<crucify_me> pontiki: ^
byprdct has joined #ruby
ssvo has quit [Ping timeout: 264 seconds]
<Nilium> I'm pretty happy with how I handle uniform bindings in this code now.
i_s has quit [Remote host closed the connection]
<Nilium> Even if I'm using a subclassed Hash.
<Nilium> Which feels like a dirty thing to do.
i_s has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
narcan has joined #ruby
ColKurtz has joined #ruby
snovak has joined #ruby
BurntToast has left #ruby [#ruby]
diegoviola has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
mstksg has joined #ruby
cj3kim has joined #ruby
<pontiki> idea is NOT a hash
enneagonal33 has joined #ruby
enneagonal33 has quit [Client Quit]
fgo has joined #ruby
snovak has quit [Ping timeout: 248 seconds]
emdub_ has joined #ruby
emdub_ has quit [Client Quit]
cads2 has joined #ruby
cads has joined #ruby
<crucify_me> thanks well I apologize I can't see what lines 5 to 7 are doing pontiki. line 5 iterates over the hash code_words with two variables. I don't see how those vars are related to the arguments passed to idea.
havenwood has quit [Remote host closed the connection]
<pontiki> i've lost your pastie
<pontiki> but do you see the line that has idea = gets ?
<crucify_me> http://pastie.org/8223746 no its this
<crucify_me> sorry I'm tripping its this: http://pastie.org/8223776
<mstksg> can anyone help me think of a clever name for a technical blog
<mstksg> how can i be e-famous without a clever name
<zets> crucify_me: that doesn't have anything to do with idea, it's iterating through what's stored in your global variable $code_words
<zets> oh, wait, I failed to read the next line down
<crucify_me> pontiki: yeah I know that line takes the input from the prompt
<pontiki> and so what class is idea?
eldariof has joined #ruby
taion809 has quit [Ping timeout: 246 seconds]
<crucify_me> that's interesting , a string?
<pontiki> are you asking me?
<crucify_me> one sec
tommyvyo has quit [Quit:]
lethjakman has joined #ruby
fgo has quit [Remote host closed the connection]
<crucify_me> I don't know, unless gets has a constructor for a string pontiki
<pontiki> perhaps read the docs
<crucify_me> thanks
ssvo has joined #ruby
hokanson35 has joined #ruby
DrCode has quit [Ping timeout: 240 seconds]
DrCode has joined #ruby
tommyvyo has joined #ruby
emdub has quit [Quit: .]
emdub has joined #ruby
<byprdct> Experience Appreciated! - I have an idea for an app but it depends on using other websites, some with API's to work with and others with no API which I would use mechanize to work with those sites without the API. What I'm hoping to find out is is it dumb for me to think that I could continue to use mechanize with these sites that dont have API's?
nijan has left #ruby [#ruby]
Kricir has joined #ruby
crucify_me has quit [Remote host closed the connection]
johnkary has quit [Quit: @johnkary]
i_s has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 264 seconds]
parzo has joined #ruby
<pontiki> it's not dumb, really, it's just brittle
amacgregor has joined #ruby
<pontiki> and if they use JS to fill the page, you need to up to something like watir
pkrnj has quit [Quit: Computer has gone to sleep.]
redmenace has joined #ruby
resure has quit [Ping timeout: 268 seconds]
bzitzow has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
Olipro has quit [Ping timeout: 246 seconds]
parzo has quit [Remote host closed the connection]
resure has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.1]
kobain_ has quit [Quit: El motor por excelencia http://www.europio.org/]
redmenace has quit [Ping timeout: 264 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
emergion has joined #ruby
love_color_text has joined #ruby
Demo_of_doom_ has quit [Remote host closed the connection]
vince_prignano has joined #ruby
ananthakumaran has joined #ruby
io_syl has quit [Quit: io_syl]
mando has joined #ruby
apeiros has joined #ruby
bradsmith has quit [Remote host closed the connection]
bradsmith has joined #ruby
ecksit has joined #ruby
dash_ has joined #ruby
mando has quit [Ping timeout: 264 seconds]
ssvo has quit [Ping timeout: 264 seconds]
LaPetiteFromage has quit [Ping timeout: 264 seconds]
RichardBaker has joined #ruby
bradsmith has quit [Ping timeout: 276 seconds]
ecksit has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
i8igmac has joined #ruby
AlHafoudh has joined #ruby
snovak has joined #ruby
Torstein has quit [Read error: Connection reset by peer]
jarray52 has left #ruby [#ruby]
snovak has quit [Ping timeout: 240 seconds]
_honning_ has joined #ruby
ecksit has joined #ruby
AlHafoudh has quit [Quit: Textual IRC Client: www.textualapp.com]
ecksit has quit [Read error: Connection reset by peer]
neo_ has joined #ruby
amacgregor_ has joined #ruby
neo_ has quit [Client Quit]
ecksit has joined #ruby
amacgregor__ has joined #ruby
cads2 has quit [Quit: Leaving]
amacgregor has quit [Ping timeout: 260 seconds]
ecksit has quit [Read error: Connection reset by peer]
ecksit has joined #ruby
amacgregor_ has quit [Ping timeout: 260 seconds]
wallerdev has quit [Quit: wallerdev]
BizarreCake has joined #ruby
visof has joined #ruby
gr33n7007h has quit [Ping timeout: 246 seconds]
dopie has joined #ruby
love_color_text has quit [Remote host closed the connection]
<dopie> what does ||= mean in ruby?
<sevenseacat> dopie: or equals.
<dopie> sevenseacat, thank yeh
<dopie> you get a ruby gold star sevenseacat
<dopie> )
<dopie> :)
<sevenseacat> \o/
<pontiki> "memoize"
Senjai has quit [Ping timeout: 276 seconds]
<popl> pontiki: I didn't get the memo.
<pontiki> what's the fequency, kenneth?
<pontiki> there's you memo
<pontiki> now memorize it
ecksit has quit [Read error: Connection reset by peer]
ecksit has joined #ruby
<popl> something's wong with your r key
ch_ has joined #ruby
<pontiki> you think i'm spelling memoize wrong?
<pontiki> look at the wiki page
hokanson35 has quit [Quit: hokanson35]
dodosan has quit [Remote host closed the connection]
<popl> no, frequency and your
ch_ has quit [Remote host closed the connection]
<popl> :)
<popl> I know what memoization is, silly. :)
Kricir has joined #ruby
<popl> Is it too late for jokes where you come from?
<pontiki> it's not actually the r key
dodosan has joined #ruby
<pontiki> i type so fast i don't lift off some of the keys properly
ch_ has joined #ruby
<popl> touchscreen?
<popl> ah
<pontiki> and r seems to get the worst of it
dodosan has quit [Remote host closed the connection]
<popl> the nubs on my f and j keys have worn off almost completely.
<pontiki> this is nearly brand new mbp
olivine-andesite has joined #ruby
<popl> sometimes I get discombobulated and have to catch myself
<popl> cool. I have a new keyboard for this laptop, just need to install it.
<popl> I stripped a screw last time I tried to take it apart so I am now hesitant to continue. :P
<popl> damned Dell and the over-tightening of the screws
adambeynon has joined #ruby
dopie has left #ruby ["Leaving"]
visof has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 248 seconds]
fwchld has joined #ruby
<fwchld> hi guys!
<fwchld> any non-rails tutorials out there on activerecord?
ecksit has quit [Read error: Connection reset by peer]
pagios_ has joined #ruby
<pagios_> hi all
<pagios_> i am having a problerm where i install ruby 1.9.1 from source
<pagios_> how can i uninstall now?
<pontiki> how did you install it?
<pagios_> i have ruby 1.1 and 1.9.3 running on the system and things are getting confusing
<pagios_> from tar.gz
<pontiki> fwchld: what do you mean?
<zendeavor> make; make install?
<pagios_> yse
mikepack has quit [Remote host closed the connection]
<pagios_> yes
<zendeavor> perhaps make uninstall
<pontiki> activerecord will work the same way in or out of rails
<fwchld> pontiki - thanks..
<pagios_> can i remove those directories? http://pastebin.com/ptWc4Ls5
<pontiki> do you want info on integrating it with something like sinatra or a command line app?
<pagios_> is that for me/
decoponio has joined #ruby
<pontiki> no
<pontiki> fwchld:
<sevenseacat> does it even relate to your question at all?
<pagios_> sevenseacat: yes
<fwchld> pintiki - yeah sinatra
ecksit has joined #ruby
<sevenseacat> lol
<fwchld> or a command line app
<pontiki> i'm pretty sure there's something in the recipes: http://recipes.sinatra.com
<pontiki> i just used it in a command line app
<pontiki> not sure that code is on github...
Swizzy has joined #ruby
<fwchld> oh ok
<fwchld> yeah cuz im writing a command line app at the moment but was going to push it to heroku
<fwchld> so i could wrap it in sinatra im guessing
<fwchld> but i'll check that
i8igmac has quit [Ping timeout: 246 seconds]
<fwchld> pontiki
<fwchld> if you can push it to github can you dm me the link to the code? i'll fork it
<fwchld> brb food is here >:)
relix has joined #ruby
LMolr has joined #ruby
eldariof has quit [Ping timeout: 246 seconds]
bzitzow has quit [Ping timeout: 240 seconds]
ch_ has quit [Remote host closed the connection]
Vivekananda has joined #ruby
freeayu has quit [Quit: This computer has gone to sleep]
bradsmith has joined #ruby
parzo has joined #ruby
i8igmac has joined #ruby
byprdct has quit [Ping timeout: 276 seconds]
ch_ has joined #ruby
ch_ has quit [Read error: Connection reset by peer]
ch_ has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
fwchld has quit [Quit: Textual IRC Client: www.textualapp.com]
bradsmith has quit [Ping timeout: 240 seconds]
vince_prignano has quit [Remote host closed the connection]
ephemerian has joined #ruby
tommyvyo has quit [Quit:]
mityaz has joined #ruby
ecksit has quit [Read error: Connection reset by peer]
snovak has joined #ruby
Swizzy has quit [Ping timeout: 248 seconds]
smathieu has quit [Ping timeout: 246 seconds]
Swizzy has joined #ruby
snovak has quit [Ping timeout: 240 seconds]
Astralum has joined #ruby
s2013 has joined #ruby
narcan has joined #ruby
blackmes1 has joined #ruby
Ciscoridze has joined #ruby
workmad3 has joined #ruby
pen has quit [Remote host closed the connection]
txdv has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
goleldar has quit [Ping timeout: 264 seconds]
Es0teric has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby
ch_ has quit [Remote host closed the connection]
threesome has joined #ruby
Hobogrammer has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
mityaz has quit [Quit: See ya!]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Kricir has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
ejnahc has quit [Ping timeout: 276 seconds]
ejnahc has joined #ruby
smathieu has joined #ruby
Kricir has quit [Ping timeout: 276 seconds]
timonv has joined #ruby
yasu_ is now known as yasu
smathieu has quit [Ping timeout: 264 seconds]
parzo has quit [Remote host closed the connection]
redmenace has joined #ruby
dangerousdave has joined #ruby
altamic has joined #ruby
bear213 has joined #ruby
altamic has left #ruby [#ruby]
_honning_ has quit [Ping timeout: 264 seconds]
redmenace has quit [Ping timeout: 264 seconds]
staafl has quit [Ping timeout: 276 seconds]
tommyvyo has joined #ruby
sayan has joined #ruby
spider-mario has joined #ruby
MrZYX|off is now known as MrZYX
ntus1017 has joined #ruby
_honning_ has joined #ruby
bradsmith has joined #ruby
Banistergalaxy has joined #ruby
AndChat| has quit [Ping timeout: 264 seconds]
jenskarlsen has quit [Quit: jenskarlsen]
bradsmith has quit [Ping timeout: 276 seconds]
_honning_ has quit [Ping timeout: 260 seconds]
snovak has joined #ruby
zeade has quit [Quit: Leaving.]
Elhu has joined #ruby
ffio has joined #ruby
snovak has quit [Ping timeout: 240 seconds]
another_eddie has joined #ruby
timonv has quit [Remote host closed the connection]
gildo has joined #ruby
noop has quit [Ping timeout: 276 seconds]
ctp has joined #ruby
Matriks has joined #ruby
tvw has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
tvw has quit [Client Quit]
ctp has quit [Ping timeout: 264 seconds]
Matriks has quit [Remote host closed the connection]
i8igmac has quit [Quit: Leaving]
mneorr has joined #ruby
Astral_ has joined #ruby
Astralum has quit [Ping timeout: 256 seconds]
relix has quit [Quit: Textual IRC Client: www.textualapp.com]
s2013 has quit [Ping timeout: 276 seconds]
Astral_ has quit [Read error: Connection reset by peer]
noop has joined #ruby
Astral_ has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
gasbakid has joined #ruby
BizarreCake has quit [Read error: Connection reset by peer]
Dave has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
Dave is now known as Guest61898
lethjakman has quit [Ping timeout: 246 seconds]
Karpuragauram has joined #ruby
HardFu has joined #ruby
m8 has joined #ruby
kevinykchan has quit [Read error: Connection reset by peer]
Spooner has joined #ruby
Karpuragauram has quit [Client Quit]
Elhu has quit [Quit: Computer has gone to sleep.]
kevinykchan has joined #ruby
nathandial has joined #ruby
bear213 has quit [Ping timeout: 250 seconds]
pagios_ has quit [Ping timeout: 246 seconds]
mneorr has quit [Remote host closed the connection]
Guest61898 has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
ntus1017 has quit [Ping timeout: 264 seconds]
arya_ has quit [Ping timeout: 256 seconds]
bradsmith has joined #ruby
gildo has quit [Quit: Leaving]
kjellski has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
arya_ has joined #ruby
bradsmith has quit [Ping timeout: 248 seconds]
ananthakumaran has quit [Quit: Leaving.]
Matriks has joined #ruby
shevy2 has quit [Ping timeout: 276 seconds]
pagios_ has joined #ruby
snovak has joined #ruby
Elhu has joined #ruby
kevinykchan has quit [Ping timeout: 256 seconds]
Elhu has quit [Client Quit]
snovak has quit [Read error: Operation timed out]
kevinykchan has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
kaspergrubbe has joined #ruby
ismlages has joined #ruby
arya_ has joined #ruby
vlad_starkov has joined #ruby
shevy2 has joined #ruby
Lewix has quit [Remote host closed the connection]
bamdad has joined #ruby
love_color_text has joined #ruby
LMolr has quit [Ping timeout: 246 seconds]
usc911 has joined #ruby
taion809 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Kricir has joined #ruby
agjacome has quit [Quit: leaving]
JumpMast3r has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
geggam has joined #ruby
arya_ has quit [Ping timeout: 260 seconds]
Kricir has quit [Ping timeout: 264 seconds]
emergion has joined #ruby
v0n has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
mneorr has joined #ruby
redmenace has joined #ruby
h8R has quit [Ping timeout: 240 seconds]
kaspergrubbe has quit [Ping timeout: 264 seconds]
BizarreCake has joined #ruby
h8R has joined #ruby
letstest has joined #ruby
v0n has quit [Ping timeout: 264 seconds]
<letstest> hi. i am a bit of a n00b. I am trying to make a commandline ruby app for the local weather using the forecast.io gem. The problem i am having is that it is slow. So, I was told that I should store the values in an in memory hash table for faster access. I cant seem to find much on in memory hash tables. Any suggestions?
another_eddie has quit [Ping timeout: 256 seconds]
ebanoid has joined #ruby
pagios_ has quit [Read error: Operation timed out]
timonv has joined #ruby
SHyx0rmZ has joined #ruby
banisterfiend has joined #ruby
<Xeago> letstest: any hash in ruby is in memory
<letstest> oh
<letstest> so, if i store it in a hash table and then the next time i run my script will it get the value from memory?
<Xeago> no, because you didn't persist the hash-table
<letstest> ok
<waxjar> isnt the point of a weather app to be up to date tho?
amacgregor__ has quit [Ping timeout: 264 seconds]
<letstest> yes, there are 3 steps to the app - 1.) Get local ip 2.)derive latitude, longitude 3.) Get Weather
<letstest> I figure persisting longitude/langitude for every 4 hours or so will speed it up
<waxjar> ah
arya_ has joined #ruby
<letstest> i am googling persisting ruby hash table and am getting a bunch of different gems etc, any suggestions based on my use case?
atno has joined #ruby
<Xeago> letstest: just marshal it into a file..
<waxjar> id just use a preference file of some sort i think
blackmes1 has joined #ruby
<waxjar> i dunno how cli apps generally do that. a dot-file in ~ i think?
<letstest> a file as in write to disk?
<Xeago> yes
<letstest> wouldn't that be slow?
<Xeago> faster than reloading ip, lat/long
<letstest> ok
<Xeago> otherwise
<waxjar> it would be slower than keeping it in memory, but you can't keep something in memory when your process has exited anyway
<letstest> what are preference files?
agjacome has joined #ruby
<Xeago> store it in either a persistent store, or an always running in-memory store
bamdad has quit [Quit: bamdad]
<Xeago> letstest: files that hold a preference?
<Xeago> they are just files
<letstest> aah ok, i was confused about keeping something in memory after the program exits
<letstest> alright
mneorr has quit [Remote host closed the connection]
<Xeago> it is possible to keep things in memory, but it greatly complicates your architecture
<letstest> ok
<Xeago> it is easier to write to disk
<letstest> would yaml be a good idea?
<waxjar> disk i/o will be a ton faster than network i/o
<Xeago> letstest: it doesn't matter what format you store it in
<Xeago> I would go with marshal, it comes natively with ruby
<Xeago> requires no extra gem
<Xeago> and is very easy
shevy2 has quit [Ping timeout: 264 seconds]
usc911 has quit [Quit: Leaving.]
<waxjar> or json: { longitude: …, langitude: … } ?
<letstest> ok, will do. hadn't heard of it before. Thank you so much Xeago and waxjar. I will actually try both and benchmark it. Just doing this as a learning project.
<Xeago> > Marshal.dump( { lon: 12.0, lat: 0.12 } )
<letstest> nice
<Xeago> how does eval-in work now?
<waxjar> two >>
bradsmith has joined #ruby
<waxjar> eh, 1 >> i guess :P
<letstest> k
<Xeago> >> Marshal.dump( { lon: 12.0, lat: 0.12 } )
<eval-in> Xeago => "\x04\b{\a:\blonf\a12:\blatf\t0.12" (https://eval.in/42326)
<Xeago> and write that to a file
another_eddie has joined #ruby
<letstest> wicked
<Xeago> >> Marshal.load("\x04\b{\a:\blonf\a12:\blatf\t0.12")
<eval-in> Xeago => {:lon=>12.0, :lat=>0.12} (https://eval.in/42327)
nathandial has quit [Quit: Leaving.]
jibi has joined #ruby
<letstest> thanks again.
h8R has quit [Ping timeout: 248 seconds]
pagios_ has joined #ruby
S0da has joined #ruby
taion809 has quit [Ping timeout: 264 seconds]
arya_ has quit [Ping timeout: 264 seconds]
banisterfiend is now known as banister
bradsmith has quit [Ping timeout: 276 seconds]
letstest has quit [Quit: Page closed]
Elhu has joined #ruby
arya_ has joined #ruby
h8R has joined #ruby
LMolr has joined #ruby
Elhu has quit [Client Quit]
r0bgleeson has quit [Read error: Connection reset by peer]
nathandial has joined #ruby
r0bgleeson has joined #ruby
nfk has joined #ruby
v0n has joined #ruby
alem0lars has joined #ruby
spyzer_ has joined #ruby
spyzer_ has left #ruby [#ruby]
tonni has quit [Remote host closed the connection]
kirun has joined #ruby
AlSquire has joined #ruby
shevy2 has joined #ruby
v0n has quit [Ping timeout: 256 seconds]
sergiocampama has quit [Ping timeout: 240 seconds]
dash_ has quit [Ping timeout: 264 seconds]
ahawkins has joined #ruby
another_eddie has quit [Ping timeout: 240 seconds]
<Vis3r> i get this http://pastebin.com/fivgFTdU ... when trying to mongrel_rails service::install -N ruby-myapp -c C:\wamp\ror\my.app -p 3001 -e production
<Vis3r> can anybody help me out?
freeayu has joined #ruby
dash_ has joined #ruby
amacgregor has joined #ruby
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<Vis3r> or at least point me into the right direction..what i should search for
taion809 has joined #ruby
alem0lars has quit [Quit: Leaving]
alem0lars has joined #ruby
BizarreCake has quit [Ping timeout: 260 seconds]
arya_ has quit [Ping timeout: 264 seconds]
<apeiros> IMO Hash#fetch is underused
timonv has quit [Remote host closed the connection]
blackmes1 has quit [Ping timeout: 240 seconds]
arya_ has joined #ruby
cj3kim has quit [Remote host closed the connection]
arya_ has quit [Client Quit]
timonv has joined #ruby
arya_ has joined #ruby
agjacome has quit [Ping timeout: 260 seconds]
platzhirsch has joined #ruby
snovak has joined #ruby
endash has joined #ruby
<Spooner> Vis3r, Ask in #rubyonrails ?
<platzhirsch> What method establishes to construct objects by Class(value)? Like Array([1,2,3]) ?
<Spooner> platzhirsch, They are methods on Kernel.
<platzhirsch> Spooner: ah I see, so normally one does not define this for his/her own classes
osvico has joined #ruby
<platzhirsch> first I thought it's a short-cut for writing Array.new
byprdct has joined #ruby
snovak has quit [Ping timeout: 240 seconds]
endash has quit [Ping timeout: 240 seconds]
xcv has joined #ruby
freeayu has quit [Ping timeout: 264 seconds]
freeayu has joined #ruby
JDHankle has joined #ruby
joonty has quit [Ping timeout: 256 seconds]
alem0lars has quit [Read error: No route to host]
St_Marx has quit [Quit: Leaving]
alem0lars has joined #ruby
nathandial1 has joined #ruby
St_Marx has joined #ruby
marr has quit [Ping timeout: 256 seconds]
nathandial has quit [Ping timeout: 264 seconds]
sahil has quit [Ping timeout: 268 seconds]
ananthakumaran has joined #ruby
timonv has quit [Remote host closed the connection]
<platzhirsch> anyone using an alternative maybe monad implementation to andand?
sahil has joined #ruby
banister has quit [Remote host closed the connection]
bradsmith has joined #ruby
cj3kim has joined #ruby
redmenace has quit [Ping timeout: 264 seconds]
eka has joined #ruby
bradsmith has quit [Ping timeout: 260 seconds]
lebek has joined #ruby
another_eddie has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
DrCode_ has joined #ruby
DrCode has quit [Ping timeout: 240 seconds]
ahawkins has quit [Quit: leaving]
cj3kim has quit [Ping timeout: 240 seconds]
JDHankle has quit [Remote host closed the connection]
cads has quit [Ping timeout: 264 seconds]
tommyvyo has quit [Quit:]
DrCode_ is now known as DrCode
thebastl has joined #ruby
nathandial1 has quit [Quit: Leaving.]
jjbohn has joined #ruby
rippa has joined #ruby
bsaboia_ has joined #ruby
tgunr has joined #ruby
joonty has joined #ruby
<aspiers> any suggestions how to debug "superclass mismatch for class Note"? I only have one class definition, and I suspect the issue is related to the way it's being loaded
<platzhirsch> aspiers: playing around with pry and pry-debug?
<platzhirsch> inserting the require 'pry'; binding.pry at different parts of the code
<platzhirsch> and look whether its available as a constant
<aspiers> platzhirsch: yeah I guess, I'll try ...
tgunr has quit [Client Quit]
<aspiers> platzhirsch: that should tell me what the superclasses of the already loaded class are, but how do I see what the new superclasses which conflict with this are?
resure has quit [Ping timeout: 246 seconds]
machuga has quit [Ping timeout: 246 seconds]
lebek has quit [Ping timeout: 246 seconds]
kirun has quit [Ping timeout: 246 seconds]
ephemerian has quit [Ping timeout: 246 seconds]
matchaw has quit [Ping timeout: 246 seconds]
heidar has quit [Ping timeout: 246 seconds]
thelames1 has quit [Ping timeout: 246 seconds]
sahil has quit [Ping timeout: 246 seconds]
txdv has quit [Ping timeout: 246 seconds]
asuka has quit [Ping timeout: 246 seconds]
naquad has quit [Ping timeout: 246 seconds]
_br_ has quit [Ping timeout: 246 seconds]
another_eddie has quit [Ping timeout: 246 seconds]
AlSquire has quit [Ping timeout: 246 seconds]
DrShoggoth has quit [Ping timeout: 246 seconds]
ninegrid has quit [Ping timeout: 246 seconds]
Matriks has quit [Ping timeout: 246 seconds]
gasbakid has quit [Ping timeout: 246 seconds]
sayan has quit [Ping timeout: 246 seconds]
tealmage has quit [Ping timeout: 246 seconds]
Akuma has quit [Ping timeout: 246 seconds]
yfeldblum has quit [Ping timeout: 246 seconds]
withnale has quit [Ping timeout: 246 seconds]
conner has quit [Ping timeout: 246 seconds]
eliasp has quit [Ping timeout: 246 seconds]
spike|spiegel has quit [Ping timeout: 246 seconds]
<aspiers> platzhirsch: I'm surprised the exception doesn't already give this info
<platzhirsch> aspiers: mh, no idea.. I would just play a around a bit, changing the scope by entering ::Superclass etc
otherj has joined #ruby
tgunr has joined #ruby
brianpWins has quit [Ping timeout: 264 seconds]
<Banistergalaxy> Aspires do you use Strict. New.?
<Banistergalaxy> Strucy
otherj has joined #ruby
<aspiers> Banistergalaxy: ?
machuga_ has joined #ruby
resuremade has joined #ruby
tealmage_ has joined #ruby
matchaw_ has joined #ruby
txdv_ has joined #ruby
eliasp_ has joined #ruby
kirun_ has joined #ruby
kirun_ has quit [Remote host closed the connection]
_withnale has joined #ruby
sahil__ has joined #ruby
joonty has quit [Ping timeout: 240 seconds]
AlSquirrel has joined #ruby
banister has joined #ruby
yfeldblum_ has joined #ruby
jlebrech has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
thelamest has joined #ruby
_br_- has joined #ruby
<banister> aspiers: class Blah < Struct.new can cause that problem, if you reload the file
procrastinat0r has joined #ruby
<aspiers> ahhhh! yes, I'm doing that
asuka_ has joined #ruby
joonty has joined #ruby
another_1ddie has joined #ruby
<aspiers> wow, good guess!
<banister> seen it before ;)
ninegrid_ has joined #ruby
Kricir has joined #ruby
subbyyy has joined #ruby
<aspiers> thanks!!
<banister> np
<banister> platzhirsch: which alternative to andand do you use?
love_color_text has joined #ruby
<platzhirsch> banister I was just asking if there is a better implementation or one that is more common, just started wondering after seeing some self-made implementations
xcv has quit [Remote host closed the connection]
brianpWins has joined #ruby
mneorr has joined #ruby
<banister> platzhirsch: i wrote one that actually uses monadic do-notation, but that was mostly for the lulz
BizarreCake has joined #ruby
<platzhirsch> I would rather use .maybe, but I guess all I need is to define an alias
vereteran has joined #ruby
<banister> platzhirsch: avdi had one
alem0lars has quit [Quit: Leaving]
enthrops has joined #ruby
Matriks_ has joined #ruby
machuga_ is now known as machuga
enthrops has left #ruby [#ruby]
Kricir has quit [Ping timeout: 248 seconds]
thebastl has quit [Remote host closed the connection]
cj3kim has joined #ruby
snovak has joined #ruby
_5kg has quit [Read error: No route to host]
jjbohn has quit [Quit: Leaving...]
endash has joined #ruby
<platzhirsch> banister ah, just saw his taslk confidend ruby yesterday
DrShoggoth has joined #ruby
fcanela has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
lkba has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
spike|spiegel has joined #ruby
Akuma has joined #ruby
cody-- has joined #ruby
conner has joined #ruby
endash has quit [Ping timeout: 264 seconds]
Megtastique has joined #ruby
kjellski_ has joined #ruby
awarner has quit [Remote host closed the connection]
awarner has joined #ruby
yxhuvud has joined #ruby
AndChat| has joined #ruby
yxhuvud2 has quit [Ping timeout: 245 seconds]
kjellski has quit [Ping timeout: 248 seconds]
joonty has quit [Ping timeout: 256 seconds]
awarner has quit [Ping timeout: 264 seconds]
Banistergalaxy has quit [Ping timeout: 264 seconds]
mneorr has quit [Remote host closed the connection]
carlyle has joined #ruby
h8R has quit [Ping timeout: 264 seconds]
joonty has joined #ruby
Kobrakao has joined #ruby
blackmes1 has joined #ruby
KobraK has joined #ruby
<platzhirsch> If you make the Logger class singleton it can only be instantiated through .instance(). How would one then pass an additional parameter, for instance for specifying an external file path
mneorr has joined #ruby
fuzzy has joined #ruby
<apeiros> either that parameter must be a constant (readable at time of first instantiation), or you don't really want singleton pattern but multiton instead.
yxhuvud2 has joined #ruby
fuzzy_ has quit [Ping timeout: 264 seconds]
yxhuvud has quit [Ping timeout: 276 seconds]
Banistergalaxy has joined #ruby
nathandial has joined #ruby
bradsmith has joined #ruby
<platzhirsch> apeiros: I see many people making the standard Logger class singleton and then try to wrap their own object around it. This works just fine if you keep logging to STDERR, but since you cannot invoke Logger.instance("log.txt")
kaspergrubbe has joined #ruby
AndChat| has quit [Ping timeout: 276 seconds]
vlad_starkov has quit [Remote host closed the connection]
<apeiros> parametrization through arguments goes against singleton pattern. see what I wrote.
<platzhirsch> apeiros: yes I agree, you do not use Singleton in this case
<apeiros> and on a sidenote: "many people do X" was never a convincing argument for "X" being "the right thing to do"
<platzhirsch> definitely
bradsmith has quit [Ping timeout: 240 seconds]
ewnd9 has joined #ruby
joonty has quit [Ping timeout: 260 seconds]
S0da has quit [Remote host closed the connection]
sergiocampama has joined #ruby
redmenace has joined #ruby
cody-- has quit [Quit: Computer has gone to sleep.]
taion809 has quit []
seriously_random has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
ananthakumaran has joined #ruby
alem0lars has joined #ruby
<seriously_random> hello, I want the same color scheme for my syntax highlighting as is used here: https://www.bloc.io/ruby-warrior any idea how I might get this?
rodacato has joined #ruby
<Kobrakao> oi
KobraK has left #ruby ["Leaving"]
apeiros has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
mityaz has joined #ruby
<Kobrakao> is there any way to optimize this?
<Kobrakao> the database is postgres? and there are 35,000 users
redmenace has quit [Ping timeout: 264 seconds]
<Kobrakao> the rake lasts 1 hour
ramblex has joined #ruby
sparr_ has joined #ruby
kreeves has joined #ruby
raul782 has joined #ruby
jonathanwallace has joined #ruby
maxmanders has joined #ruby
vlad_starkov has joined #ruby
Kobrakao has left #ruby ["Leaving"]
kct has joined #ruby
Kobrakao has joined #ruby
<Kobrakao> is there any way to optimize this? http://pastebin.com/Pk9YJiqd the database is postgres? and there are 35,000 users, the rake lasts 1 hour...
otherj has quit []
atno has quit [Remote host closed the connection]
xcv has joined #ruby
procrastinat0r has quit [Ping timeout: 264 seconds]
fgo has joined #ruby
babykosh has joined #ruby
chimkan has joined #ruby
sparr_ has quit [Ping timeout: 264 seconds]
mlpinit has joined #ruby
jibi has quit [Ping timeout: 260 seconds]
<kct> hi, does anyone know why the chat server standard example of eventmachine does not wait for enter when I connect with telnet?
vlad_starkov has quit [Remote host closed the connection]
joonty has joined #ruby
JZTech101 has joined #ruby
mlpinit has quit [Read error: Connection reset by peer]
mlpinit_ has joined #ruby
Speed has joined #ruby
Peej has quit [Ping timeout: 240 seconds]
maxmanders has quit [Quit: Textual IRC Client: www.textualapp.com]
mlpinit_ has quit [Remote host closed the connection]
Peej has joined #ruby
<pontiki> Kobrakao: User.update_all ?
gemmy has joined #ruby
<pontiki> what's secondary?
snovak has joined #ruby
dorei has joined #ruby
endash has joined #ruby
tgunr has quit [Quit: I'm outta here]
tgunr has joined #ruby
seriously_random has quit [Quit: Leaving]
snovak has quit [Ping timeout: 240 seconds]
<platzhirsch> Do you think the colon : to create symbols can be understood as an operator?
<platzhirsch> you can pass either names or "strings" to it
endash has quit [Ping timeout: 276 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
<MrZYX> no, it's part of the literal, like ' and " for strings and / for regexps
olivine-andesite has quit [Quit: olivine-andesite]
<platzhirsch> so I knew already that if you want to have a symbol with a name containing whitespaces, you need to pass a string. Meaning >> :my symbol << returns a syntax error, but :"my_symbol" is fine
<platzhirsch> err :"my symbol"
arya_ has quit [Ping timeout: 260 seconds]
<MrZYX> or %( ) for strings or [ ] and %w( ) for arrays, or { } for hashes, they're all part of the literal, they don't provoke any action or modify a value, like operators do
xjunior has joined #ruby
<platzhirsch> In addition, I also noticed that :foo is the same as :"foo" althought represented in a different ways
AndChat| has joined #ruby
sparr_ has joined #ruby
<platzhirsch> that's a distinct characteristics of operators, I just got curious about the differences when using strings or mere names to create a symbol
kowtows11 has joined #ruby
<MrZYX> don't think of it like passing a string, it's a different way to write the same literal, like you can write ['foo', 'bar'] also as %w(foo bar)
Banistergalaxy has quit [Ping timeout: 260 seconds]
JZTech101 has quit [Quit: Bye]
mneorr has quit [Remote host closed the connection]
<platzhirsch> so it simply gets interpreted
kowtows11 has quit [Client Quit]
kaspergrubbe has quit [Remote host closed the connection]
<MrZYX> yeah, :'foo' the 'foo' part doesn't create a String object at any time (afaik)
maasdesigner1 has joined #ruby
maasdesigner1 is now known as maasdesigner
<platzhirsch> also :"foo " != :foo
arya_ has joined #ruby
<MrZYX> interestingly :"foo#{1+1}" produces :foo2, hmm
blackmes1 has joined #ruby
<dorei> platzhirsch: r u sure ?
<platzhirsch> dorei: jsut tried it
<platzhirsch> just*
<platzhirsch> the whitespace does not get abolished
<dorei> oh, the whitespace
<dorei> i see
kaspergrubbe has joined #ruby
<dorei> i missed the whitespace
<platzhirsch> :"foo " != :foo makes it more clearer :) but already :"foo" == :foo suprised me
<dorei> symbols are not garbage collected, right?
DrCode has quit [Ping timeout: 240 seconds]
SeySayux has quit [Ping timeout: 248 seconds]
bklane has joined #ruby
scarolan_ has joined #ruby
scarolan has joined #ruby
<MrZYX> right
<Kobrakao> pontiki secondary is the password sencondary for financial
carlyle has quit [Remote host closed the connection]
<dorei> so, is there a way to get a list of all symbols?
DrCode has joined #ruby
<MrZYX> Symbol.all_symbols
<MrZYX> >> Symbol.all_symbols.size
<eval-in> MrZYX => 2243 (https://eval.in/42355)
<dorei> w0w, they're lot of them
Banistergalaxy has joined #ruby
xcv has quit [Remote host closed the connection]
another_1ddie has quit [Ping timeout: 240 seconds]
SeySayux has joined #ruby
evenix has joined #ruby
bradsmith has joined #ruby
<MrZYX> >> def foobarzs; end; Symbol.all_symbols.size
<eval-in> MrZYX => 2244 (https://eval.in/42356)
v0n has joined #ruby
<platzhirsch> I think entering :"foo" makes it clear, because what is returned is just :foo
tmme has joined #ruby
AndChat| has quit [Ping timeout: 264 seconds]
<Kobrakao> in update_all using .save ?
<Kobrakao> example
relix has joined #ruby
<Kobrakao> User.update_all { |user| user.password = "123456" user.save! }
PapaSierra has joined #ruby
<Kobrakao> ?
joonty has quit [Ping timeout: 264 seconds]
<Kobrakao> or do not need. save
<Kobrakao> .save *
joonty has joined #ruby
<MrZYX> -> #RubyOnRails
<PapaSierra> i'm trying to remove the vagrant gem. i don't know much about gems (n00b here), i'm getting this http://www.hastebin.com/raw/xaqojiheso
platzhirsch has left #ruby [#ruby]
coo-coo18 has joined #ruby
bradsmith has quit [Ping timeout: 240 seconds]
Spami has joined #ruby
s00pcan_ has joined #ruby
vlad_starkov has joined #ruby
timonv has joined #ruby
BRMatt has joined #ruby
archer_ has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
cj3kim has joined #ruby
archer_ is now known as Guest41889
cj3kim has quit [Read error: Connection reset by peer]
sparr_ has quit [Ping timeout: 248 seconds]
v0n has quit [Read error: Operation timed out]
tgunr has quit [Quit: I'm outta here]
DefV has quit [Ping timeout: 245 seconds]
thesheff17 has joined #ruby
redmenace has joined #ruby
subbyyy has quit [Ping timeout: 264 seconds]
Kobrakao has quit [Ping timeout: 264 seconds]
gioele has joined #ruby
<gioele> hi
<gioele> how can I prevent WEBrick from doing any caching?
Spami has quit [Quit: Leaving]
coo-coo18 has quit [Quit: coo-coo18]
Kobrakao has joined #ruby
Spami has joined #ruby
havenwood has joined #ruby
nathandial has quit [Quit: Leaving.]
lurch_ has joined #ruby
nathandial has joined #ruby
nathandial has quit [Client Quit]
<pontiki> Kobrakao: User.update_all(password: '123456')
<pontiki> gioele: i had no idea webrick did caching at all...
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
Kobrakao has left #ruby [#ruby]
<pontiki> PapaSierra: it looks like it's already uninstalled...
<gioele> pontiki: neither did I, but my sinatra-based application is returning 304 and sinatra does not implement any caching
Kobrakao has joined #ruby
<Kobrakao> pontiki please, paste again
<Kobrakao> because exit channel
chimkan has quit [Quit: chimkan]
<Kobrakao> jajaja
<pontiki> [20130810|0933.59] < pontiki> Kobrakao: User.update_all(password: '123456')
<pontiki> [20130810|0934.03] < pontiki> Kobrakao: http://apidock.com/rails/ActiveRecord/Relation/update_all
sjltaylor has joined #ruby
goganchic has joined #ruby
<PapaSierra> pontiki: yeah but then when i do "vagrant -v" it gives me back the version number
BRMatt has quit [Ping timeout: 264 seconds]
xbob_ has joined #ruby
<PapaSierra> are gems installed specific to user accounts?
<pontiki> that depends
ecart has joined #ruby
<pontiki> some ruby version managers do that
<pontiki> rvm also uses gemsets (not sure about how others do this)
<pontiki> which means you can have gems installed for a given project
Kricir has joined #ruby
ephemerian has joined #ruby
<PapaSierra> pontiki: yeah but this is just a macbook pro with osx and all i did was gem install vagrant. simple. now i'm trying to reverse that. i haven't installed anything fancy like rvm
<PapaSierra> unless of course osx has something built in?
<pontiki> nope
<PapaSierra> hmm... then i'm stuck
<pontiki> type 'which vagrant'
<PapaSierra> -> /usr/bin/vagrant
<pontiki> while i go look into this, here's a kitty: http://imgur.com/gallery/ErqZSiO
<pontiki> PapaSierra: did you install vagrant using the .dmg file downloaded from vagrantup.com?
Ciscoridze has quit [Quit: WeeChat 0.4.1]
evenix has quit [Remote host closed the connection]
<PapaSierra> no, that's the *new* way. that's what i'm trying to do. i did something more like this (old version) http://rubygems.org/gems/vagrant
fgo has quit [Remote host closed the connection]
Kricir has quit [Ping timeout: 276 seconds]
Inside has joined #ruby
Inside has joined #ruby
raul782 has quit [Remote host closed the connection]
undersomething88 has joined #ruby
heidar has joined #ruby
endash has joined #ruby
raul782 has joined #ruby
snovak has joined #ruby
Bry8Star{T2 has quit [Remote host closed the connection]
raul782 has quit [Read error: Connection reset by peer]
raul782_ has joined #ruby
vlad_starkov has joined #ruby
ZoanthusR has joined #ruby
mityaz has quit [Quit: See ya!]
Bry8Star{T2 has joined #ruby
<pontiki> enh, i got nothing, PapaSierra
undersomething88 has quit [Client Quit]
<PapaSierra> no worries, thanks for the help though pontiki
<pontiki> if you goal is to get the newest vagrant, i guess maybe just go ahead and download the .dmg and install it
snovak has quit [Ping timeout: 248 seconds]
endash has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
ZoanthusR has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
Elhu has joined #ruby
txdv_ has quit [Ping timeout: 276 seconds]
laurone16 has joined #ruby
Kobrakao has quit [Quit: This computer has gone to sleep]
raul782_ has quit [Remote host closed the connection]
raul782 has joined #ruby
bradsmith has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
txdv has joined #ruby
ZoanthusR has joined #ruby
raul782 has quit [Ping timeout: 256 seconds]
vince_prignano has joined #ruby
TheDick has quit [Quit: TheDick]
sevenseacat has left #ruby [#ruby]
carlyle has joined #ruby
<shevy2> why is linux such a mess
timonv has joined #ruby
goganchic has quit []
tmme has quit [Remote host closed the connection]
somu has joined #ruby
<somu> hey :-)
lurch_ has quit [Quit: lurch_]
shevy2 is now known as shevy
<shevy> hey somu
altivec has joined #ruby
noop has quit [Ping timeout: 264 seconds]
joonty has quit [Ping timeout: 264 seconds]
altivec has quit [Client Quit]
noop has joined #ruby
<somu> writing a gem to help non-programmer guys to use sass, compass, slim et cetera in their everyday needs
freeayu has quit [Remote host closed the connection]
somu has quit [Quit: Page closed]
bradsmith has quit [Remote host closed the connection]
bradsmith has joined #ruby
ccolorado has joined #ruby
blackmes1 is now known as blackmesa
i_s has joined #ruby
tommyvyo has joined #ruby
gioele has quit [Quit: n]
cj3kim has joined #ruby
bradsmith has quit [Ping timeout: 276 seconds]
platzhirsch has joined #ruby
<platzhirsch> Is single method the preferred term for class method? Like class A; def self.method ... end; end?
gemmy has quit [Read error: Connection reset by peer]
<waxjar> no
blip99 has quit [Read error: Connection reset by peer]
cj3kim has quit [Read error: Connection reset by peer]
BizarreCake has quit [Read error: Connection reset by peer]
iAreBaboon has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<platzhirsch> waxjar: but it still means the same, doesn't it?
rodacato has quit [Remote host closed the connection]
<waxjar> i've never heard the term, tbh
<zets> me neither
agjacome has joined #ruby
<zets> are you talking about a singleton method?
zeromodulus has joined #ruby
gemmy has joined #ruby
<platzhirsch> oh, it was a typo
<platzhirsch> of course singleton method
<platzhirsch> so singleton methods are methods that are defined only for a particular object
<platzhirsch> like o = Object.new and then you write def o.blah ... end
<zets> yeah
<platzhirsch> which is kind of the case when you write def self.bla ... I just wondered, if it ultimately means the same in the context of such a class method or if class method coins a more narrow type of methods
<zets> yeah... I think that would be technically considered a singleton method, since it's being created for a single object (the class object itself)
<zets> but it's less confusing just to refer to it as a class method
gz0 has joined #ruby
maz-dev has quit [Ping timeout: 276 seconds]
wallerdev has joined #ruby
<platzhirsch> good
rodacato has joined #ruby
redmenace has quit [Ping timeout: 260 seconds]
fgo has joined #ruby
mengu has joined #ruby
kobain has joined #ruby
jjbohn has joined #ruby
DonRichie has joined #ruby
jjbohn has quit [Client Quit]
<banister> platzhirsch: i think of a class method as a subset of 'singleton methods'
raul782 has joined #ruby
<banister> though, even that's not true
<banister> as there are some class methods which are not singleton methods
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
fgo has quit [Ping timeout: 240 seconds]
<platzhirsch> banister: for instance if you define them by writing the concrete class? def MyClass.method ?
Kricir has joined #ruby
<banister> platzhirsch: no, those are still singleton methods
xjunior has quit [Ping timeout: 256 seconds]
mengu has quit [Client Quit]
nomenkun has joined #ruby
<banister> platzhirsch: but if you define a method here: class Class; def hello; end; end
<platzhirsch> ah
<banister> platzhirsch: then that method becomes a 'class method' on all classes, yet it's not a singleton method ;)
fuzzy has quit [Quit: No Ping reply in 180 seconds.]
Spami has quit [Quit: This computer has gone to sleep]
fuzzy has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
Swizzy has quit [Ping timeout: 264 seconds]
Kobrakao has joined #ruby
Swizzy has joined #ruby
i_s has quit [Remote host closed the connection]
<platzhirsch> Is there an alternative way of writing something in the class << self scope? I noticed this on some Rails methods, like alias_method_chain. If I want to apply it to the class methods I need to write it inside class << self
<platzhirsch> yet self.alias_method_chain does not work, even though I would have thought that the method is sent to the class object
Kricir has quit [Ping timeout: 260 seconds]
<banister> platzhirsch: you can often use instance_eval
zets has quit []
Inside has quit [Ping timeout: 276 seconds]
_honning_ has joined #ruby
fgo has joined #ruby
raul782 has quit [Remote host closed the connection]
endash has joined #ruby
raul782 has joined #ruby
endash has quit [Read error: Connection reset by peer]
endash has joined #ruby
alem0lars has quit [Read error: Operation timed out]
LMolr has quit [Quit: Leaving]
dodosan has joined #ruby
havenwood has quit [Remote host closed the connection]
endash has quit [Ping timeout: 240 seconds]
raul782 has quit [Ping timeout: 260 seconds]
d2dchat_ has joined #ruby
timonv has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
arya_ has quit [Ping timeout: 256 seconds]
Spami has joined #ruby
kold has joined #ruby
dodosan has quit [Ping timeout: 256 seconds]
BizarreCake has joined #ruby
subbyyy has joined #ruby
wallerdev has quit [Quit: wallerdev]
arya_ has joined #ruby
vlad_starkov has quit [Ping timeout: 248 seconds]
nomenkun has quit [Ping timeout: 264 seconds]
Kobrakao has quit [Ping timeout: 264 seconds]
nomenkun has joined #ruby
Kobrakao has joined #ruby
fgo has quit [Remote host closed the connection]
Swizzy has quit [Ping timeout: 260 seconds]
wallerdev has joined #ruby
Swizzy has joined #ruby
sweet_kid has quit [Ping timeout: 264 seconds]
sheerun has joined #ruby
<platzhirsch> banister: well, it does not ahve the same effect, but I could imagine this is due to the implementation details of alias_method_chain
nomenkun has quit [Ping timeout: 246 seconds]
<banister> platzhirsch: i dont know anything about alias_method_chain (not a rails programmer) :)
nomenkun has joined #ruby
sweet_kid has joined #ruby
<platzhirsch> Banister I think one way is to assign class << self; self; end to a variable
johnkary has joined #ruby
<banister> platzhirsch: why do that? you can just use singleton_class method
allsystemsarego has joined #ruby
<platzhirsch> no reason, in particular I don't want to use this
<platzhirsch> I really just wondered how to the eigenclass object
sheerun has quit [Quit: Textual IRC Client: www.textualapp.com]
<platzhirsch> this makes me crazy, I need eggs
sheerun has joined #ruby
vereteran has quit [Quit: ZNC - http://znc.in]
<banister> platzhirsch: well people used to use: class << self; self; end before singleton_class method existed ;)
naquad has joined #ruby
nomenkun_ has joined #ruby
DonRichie has quit [Quit: Verlassend]
nomenkun has quit [Read error: Connection reset by peer]
jlebrech has quit [Quit: Computer has gone to sleep.]
<platzhirsch> banister: ah you mean literally the singleton_class method. But where can I call it? A class or object does not define it, does it?
<banister> platzhirsch: yeah they do, it's available everywhere
carlyle has quit [Remote host closed the connection]
ItSANgo___ has joined #ruby
<platzhirsch> Banister: NoMethodError: undefined method `singleton_method' for A:Class
Spami has quit [Quit: This computer has gone to sleep]
<banister> platzhirsch: then you must be on a weird version of ruby
<banister> platzhirsch: oh i said singleton_class
<banister> *not* singleton_method :)
<platzhirsch> 0.9.6, huh.. I thought I was on 2.0.0
<banister> platzhirsch: you just didn't read properly ;) i said singleton_class, but you typed singleton_method
<dorei> how can I get a list of classes defined in a module ?
<banister> dorei: in Pry, use: ls -c ThatModule
<dorei> outside pry?
<platzhirsch> oh, I am sorry... I need a break
<banister> dorei: outside of Pry it's more difficult: MyModule.constants(false).select { |v| MyModule.const_get(v).is_a?(Module) }
<dorei> merci :)
nomenkun_ has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
m8 has quit [Quit: Sto andando via]
Guest18710 has joined #ruby
cougarten has joined #ruby
ffio_ has joined #ruby
cj3kim has joined #ruby
bradhe has joined #ruby
<cougarten> hej. i got troubles with ruby 2.x (on rails) and mysql on windows x64. Does anyone want to help me on that? I'd be willing to do a full re-install if it helps
ffio has quit [Ping timeout: 264 seconds]
BizarreCake has quit [Read error: Connection reset by peer]
bradsmith has joined #ruby
ecart has quit [Ping timeout: 264 seconds]
<cougarten> (I don't want to go with a linux VM. it crashed quite often and i'm rather the front-end guy and need the new adobe stuff)
cj3kim has quit [Read error: Connection reset by peer]
<shevy> I am on ruby 1.9.3 and linux so I would not be a good candidate to try and help for 2.x on windows
<cougarten> (: thanks anyway...
<shevy> one problem is - you did not specify what kind of troubles you have btw
stkowski has joined #ruby
subbyyy has quit [Ping timeout: 248 seconds]
<cougarten> shevy, if i knew... I think the precompilled mysql version is broken by default, so i need to compile it myself. Which i think i suceeded in. But now ruby doesn't find the gem or something.
<cougarten> last time it took me 1,5 days trial and error and than it worked, but i forgot the solution
ZoanthusR has quit [Quit: Linkinus - http://linkinus.com]
<cougarten> i can alternate between 3 errormessages i think (: depending on what i did before
johnkary has quit [Quit: @johnkary]
bradsmith has quit [Ping timeout: 276 seconds]
<cougarten> shevy, oh i got further! maybe you can help
byprdct has quit [Quit: Textual IRC Client: www.textualapp.com]
<cougarten> i got a ruby project and did "bundle install"
<cougarten> where does it put the gems?
babykosh has quit [Quit: babykosh]
<cougarten> i now got gems in [rubyProcect]\vendor\bundle\ruby\2.0.0\gems\
<cougarten> and want to uninstall mysql there
<fryguy> is it checked into version control?
<cougarten> yes
<shevy> sorry cougarten
<shevy> I loathe bundler with a passion and avoid it
<fryguy> good luck then, you will just fuck over your other devs by removing it
<fryguy> although none of that should be checked into version control
<shevy> cougarten "gem" binary normally has a default way to put things
<shevy> cougarten, can you start "irb" on windows?
<cougarten> fryguy, a sorry, no. i think the gems are not in version control, the project is though
havenwood has joined #ruby
<shevy> otherwise, try "gem env"
Davey has joined #ruby
<shevy> from cmd.exe or something
<fryguy> cougarten: just remove it then
fgo has joined #ruby
<cougarten> simply deleting it?
<shevy> with gem alone, "gem uninstall mysql" should work. no idea how bundler does the same
freerobby has quit [Quit: Leaving.]
<fryguy> i don't know why you are making everything so complicated
bklane has quit [Remote host closed the connection]
supernullset has joined #ruby
<cougarten> shevy, gem seems to be something seperated, it's not listed in gem list any more
AndChat377264 has joined #ruby
<fryguy> you make a gemfile, you run bundle, and then you are done, i don't know why you have things in multiple locations and such
supernullset has quit [Client Quit]
<shevy> cougarten yeah I suspected that... I will never understand why ruby now has both gems and bundler ... they seem to fight each other rather than work together in a unified way
<cougarten> fryguy, the problem is: "bundle install" installs a precompilled mysql. so i need to uninstall it and install my own after bundle install
<cougarten> i at least think that is part of my solution :)
<fryguy> cougarten: so fix your gemfile so that it doesn't do that
<fryguy> cougarten: you would be particularly interested in using gemfile syntax to specify per-platform gems
<fryguy> or, just run on the same platform as the rest of your team
AndChat377264 has quit [Remote host closed the connection]
<shevy> "If you are using Bundler 1.1 or later you can use bundle clean, just as you imagined you could."
<cougarten> fryguy, ok, thank you.
<shevy> come to linux one day, cougarten ;)
redmenace has joined #ruby
mando has joined #ruby
<cougarten> shevy, i've been there and enjoyed it. but i need photoshop, flash, indesign and all that s***
<fryguy> cougarten: that's what VMs are for
<shevy> yeah I can understand that
<cougarten> and no, gimp or an old photoshop in wine does not do the trick
<shevy> they dont work in wine though?
<fryguy> cougarten: also osx
<shevy> years ago I could play warcraft 3 on linux through wine... no idea if wine got even better, or worse since those days
St_Marx has quit [Remote host closed the connection]
<fryguy> shevy: it's gotten substantially better
<cougarten> i think photoshop is no problem, but the lesser used stuff is not as well supported
St_Marx has joined #ruby
<shevy> I see
<shevy> been a while since I used wine a lot, stopped playing games pretty much too
<cougarten> fryguy, osx... I don't have the money for a macbook and i dislike apple in general. i don't know if my laptob is hackintoshable :)
jlebrech has joined #ruby
momomomomo has joined #ruby
ehaliewicz has joined #ruby
<fryguy> cougarten: so, VMs, or make your employer buy you sufficient hardware (or find an employer who is willing to)
<fryguy> or just get more money
s00pcan has quit [Remote host closed the connection]
s00pcan_ has quit [Quit: leaving]
fgo has quit [Ping timeout: 246 seconds]
<shevy> hehe
<cougarten> fryguy, we're a startup of 4 people and have little funding so far :). but I'll see...
agjacome has quit [Ping timeout: 264 seconds]
<canton7> ... this is all because bundler is shit at cross-platform stuff. I'd rather have bundler fixed :P
s00pcan has joined #ruby
<cougarten> hehe
<shevy> bundler has always been like that
<fryguy> canton7: bundler is great at cross platform stuff
redmenace has quit [Ping timeout: 240 seconds]
<canton7> it used to be shit... no idea whether things have improved
<shevy> the first time I saw it, in the rails tutorial, it crashed on me
<fryguy> it allows you to install per-platform gems for the cases when gems are distributed as binaries or otherwise extensions and contain non-ruby code
<canton7> aha, that sounds new
<fryguy> other than that, it's a problem of binary and non-native gems, not of bundler
<canton7> is that for lockfiles too? so you can have a lockfile which isn't platform-specific?
<fryguy> protip: don't run in a platform that is different from production unless you are willing ot deal with random bullshit like this
<fryguy> canton7: yes
<cougarten> fryguy, so osx wouldn't help either :) ?
<canton7> that's nice. they were adamant that that was never going to happen last time I looked
jefflyne has joined #ruby
<fryguy> cougarten: it's better, but no it doesn't really help
<fryguy> completely
lethjakman has joined #ruby
<canton7> for heroku, I ended up with a custom buildpack which didn't require a lockfile. might be able to scrap that now
<fryguy> i work on a team full of osx users, i'm the only linux guy, and at least once a month somebody has me at least double check something that's different for them
endash has joined #ruby
Elhu has joined #ruby
tonni has joined #ruby
snovak has joined #ruby
s2013 has joined #ruby
snovak has quit [Ping timeout: 256 seconds]
arya_ has quit [Ping timeout: 240 seconds]
<platzhirsch> I work with a series of classes which are used in my application. Often, very often, I iterate over these types that are modeled by my classes. Do you think I should keep a constant containing symbols mapping to those classes, or should I create a list of these classes dynamically by looking at which classes of these types are there?
JDHankle has joined #ruby
enebo has joined #ruby
<cougarten> now i'm tempted: http://www.youtube.com/watch?v=o70fr8h6zLM&feature=player_embedded but i don't want to loose the nvidia gfx card and the external mini-subwover
<endash> platzhirsch: maybe something using Module#constants?
<endash> if you have module YourNamespace module Models end end
<endash> YourNamespace.constants will give you your list
bklane has joined #ruby
arya_ has joined #ruby
<endash> er
jerius has joined #ruby
<endash> YourNamespace::Models.constants
tanema has joined #ruby
jerius has quit [Client Quit]
<platzhirsch> oh, that's nice
momomomomo has quit [Quit: momomomomo]
Swizzy has quit [Quit: Lost terminal]
zorg24 has joined #ruby
kold has quit [Ping timeout: 264 seconds]
xjunior has joined #ruby
xjunior has quit [Remote host closed the connection]
<platzhirsch> endash: ok, but that reutrns a list of constants
<endash> they're symbols
Elhu has quit [Quit: Computer has gone to sleep.]
<platzhirsch> endash: I see, well for some reason my classes are not listed, I guess there were not loaded yet
<endash> hmmm
<endash> is this rails?
Morrolan has quit [Ping timeout: 260 seconds]
<platzhirsch> endash: yes
Elhu has joined #ruby
<endash> classes are lazy loaded in rails in development
jlebrech has quit [Ping timeout: 256 seconds]
<endash> it can cause problems in certain cases… single table inheritence comes to mind
freerobby has joined #ruby
<platzhirsch> well, then it does not seem an option if this causes problems for development phase
<endash> you can set config.eager_load_paths
jfelchner has joined #ruby
<platzhirsch> endash: so just load the module folder, nice.. will the classes still be reloaded after I change them?
subbyyy has joined #ruby
<endash> I believe so...
companion is now known as Companion
<endash> no reason eager/lazy loading should be conflated with cache expiration
<endash> but it's not something i have to do often
<endash> eager_load_namespaces is a shortcut it seems
<endash> oh I should mention this is rails 4 only
freerobby has quit [Ping timeout: 240 seconds]
Morrolan has joined #ruby
<endash> on earlier versions you'll have to manually load
ehc has joined #ruby
<platzhirsch> meh
<platzhirsch> I need to upgrade anyway
<platzhirsch> Just wonder where to put it, because I tried config/environments/development.rb and there it complaint the array is frozen
ismell has left #ruby [#ruby]
arya_ has quit [Ping timeout: 248 seconds]
arya_ has joined #ruby
BizarreCake has joined #ruby
carlyle has joined #ruby
<platzhirsch> well, it works when written in config/application.rb although still not appearing in the constants list
<platzhirsch> this is an outrage
Guest41889 has quit [Remote host closed the connection]
<RubyPanther> I agree, making mistakes is outrageous.
babykosh has joined #ruby
agatha has quit [Quit: Leaving...]
<endash> make sure to set eager_load to true as well
iliketurtles has joined #ruby
relix has joined #ruby
<platzhirsch> endash: at least it is as you say. In pry, everytime I access a class, it gets added as a constant to to Module.constants
nick1 has joined #ruby
<platzhirsch> endash: that method does not exist, Rails 4 only?
xbob_ has quit [Quit: Leaving]
joast has joined #ruby
rodacato has quit [Remote host closed the connection]
guillehorno has joined #ruby
<endash> might be simpler just to manually require your files in an inintializer
b00stfr3ak has joined #ruby
<platzhirsch> I wouldn't have thought it has to be so hacky
x3nu_ has joined #ruby
tanema has quit [Remote host closed the connection]
<x3nu_> sry for the newbie question, if i use "or" or "||" in ruby to check two conditions, will it still return true if both conditions are met ?
<x3nu_> or is there some "AndOr" operator
ebanoid has quit [Quit: brbomgwtfbbq]
banger has joined #ruby
freerobby has joined #ruby
<endash> x3nu_: ^ is XOR
ZoanthusR has joined #ruby
<x3nu_> thx
<havenwood> x3nu_: Yes. If one or both are true it will return true. The difference between `or` and `||` is precedence. (Being higher precedence `||` is generally advised to avoid confusion. Though both are correct.)
guillehorno has quit [Remote host closed the connection]
guillehorno has joined #ruby
<havenwood> x3nu_: ^= too for setting on xor, like ||= or &&=
guillehorno has quit [Client Quit]
ZoanthusR has quit [Client Quit]
<havenwood> ^ order of precedence
<endash> '||=' also known as the colonel sanders
guillehorno has joined #ruby
rodacato has joined #ruby
<havenwood> or the `cuidado, cuidado, hay llamas!`
<havenwood> okay, maybe people don't call it that >.>
fgo has joined #ruby
<endash> haha
<havenwood> Llamas are larger than frogs: http://www.youtube.com/watch?v=hBaUmx5s6iE
tkuchiki has quit [Remote host closed the connection]
<nick1> YouTube Title: Monty Python - Llamas Views: 143,902 Length: 2:32
Guest18710 has quit [Ping timeout: 264 seconds]
cj3kim has joined #ruby
stuartrexking has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
iliketurtles has quit [Quit: zzzzz…..]
Matriks_ has quit [Remote host closed the connection]
<platzhirsch> endash: thanks in any case :)
<endash> yeah sorry about the rails complications
cads has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
diegoviola has joined #ruby
timonv has joined #ruby
a7d7p has joined #ruby
IceDragon has joined #ruby
rodacato has quit [Remote host closed the connection]
ZoanthusR has joined #ruby
ssvo has joined #ruby
Naoe-Kanno has joined #ruby
Kobrakao has quit [Quit: Leaving]
snovak has joined #ruby
SHyx0rmZ has quit [Ping timeout: 248 seconds]
Matriks has joined #ruby
Matriks has quit [Remote host closed the connection]
iliketurtles has joined #ruby
carlyle has quit [Remote host closed the connection]
iliketurtles has quit [Client Quit]
iliketurtles has joined #ruby
iliketurtles has quit [Max SendQ exceeded]
snovak has quit [Ping timeout: 248 seconds]
iliketurtles has joined #ruby
iliketurtles has quit [Max SendQ exceeded]
iliketurtles has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
<nick1> Hi there, I do not know any ruby, but I am trying to run a RB file. I have installed Ruby 1.9.3 but when I try to run it I get the following error
linux_noob_666 has joined #ruby
Elhu has joined #ruby
<fryguy> nick1: so install mechanize
<nick1> wow that was unforgivable
<nick1> sorry abotu that fryguy...
gz0 has quit [Ping timeout: 248 seconds]
<banister> nick1: btw, it's idiomatic ruby to use snake_case for file names, not CamelCase :)
goshakkk has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nick1> interesting, pretty sure I didn't name it though
<nick1> hey did ruby 2 break compatability with a lot of files?
kirun has joined #ruby
<fryguy> nick1: no
<nick1> how long has it been released as stable version
<fryguy> few weeks
<nick1> ahh okay
freerobby has quit [Quit: Leaving.]
iliketurtles has quit [Quit: zzzzz…..]
nari has quit [Ping timeout: 260 seconds]
IceDragon_ has joined #ruby
<Xeago> isn't it at least a month or 2 now, fryguy?
tanema has joined #ruby
<nick1> hmm i just checked. it's been out 5 and a half months
IceDragon has quit [Ping timeout: 264 seconds]
<fryguy> xeago, that's a few weeks
pen has joined #ruby
<fryguy> yah it was earlier than I thought
<fryguy> i thought i was using the beta at work for longer than that, I guess not
diegoviola has quit [Quit: WeeChat 0.4.1]
joonty has joined #ruby
<nick1> i was just curious to see which version i had last time i tried to run this file
<nick1> i think i got 2.0 then and it didn't work with this file or something
felixjet has quit [Quit: felixjet]
sormina has joined #ruby
gz0 has joined #ruby
relix has joined #ruby
<nick1> try to install one gem.... 10 minutes later i got 43 and still going
bradhe has quit [Remote host closed the connection]
Inside has joined #ruby
<sormina> Hey there, I hope you don't mind me asking here: Is there an instance-level equivalent of Module#extended that gets called on the extended instance instead of the module?
Kricir has joined #ruby
fuzzy_ has joined #ruby
cj3kim has joined #ruby
fuzzy has quit [Ping timeout: 240 seconds]
kpshek has joined #ruby
gemmy has quit [Remote host closed the connection]
dallasm has joined #ruby
<nick1> sormina, don't mind you asking at all! Sorry that I specifically can't help you - but I hope you find what you are looking for here in #ruby
nick1 has quit []
platzhirsch has left #ruby [#ruby]
ehc has quit [Quit: ehc]
Kricir has quit [Ping timeout: 240 seconds]
cj3kim has quit [Ping timeout: 240 seconds]
devoldmx has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
archer_ has joined #ruby
archer_ is now known as Guest86900
guillehorno has quit [Quit: guillehorno]
redmenace has joined #ruby
procrastinat0r has joined #ruby
Naoe-Kanno has quit [Ping timeout: 260 seconds]
bsaboia_ has quit [Ping timeout: 264 seconds]
RichardBaker has joined #ruby
RichardBaker has quit [Client Quit]
<cougarten> fryguy, if your team develops on osx, don't they run into trouble with a linux server than?
ebanoid has joined #ruby
<cougarten> I'm really considering hackintoshing right now (even if i manage to get mysql back on track, imageMagick will be the next fun thing to install on windows)
nomenkun has quit [Remote host closed the connection]
thesheff17 has quit [Remote host closed the connection]
Shirakawasuna has joined #ruby
TacitBlue has left #ruby [#ruby]
Shirakawasuna has quit [Max SendQ exceeded]
thesheff17 has joined #ruby
Shirakawasuna has joined #ruby
jefflyne has quit [Ping timeout: 264 seconds]
wes_ has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
rovalent has joined #ruby
goshakkk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jefflyne has joined #ruby
resuremade is now known as resure
<Kelet> cougarten, Well, you don't really need anything complex to use ImageMagick via Ruby provided you don't need RMagick
wes_ has quit [Client Quit]
<Kelet> minimagick or quickmagick can both use the command-line tools thus no compilation is needed
<cougarten> Kelet, our dev uses RMagick...
terlar has joined #ruby
tommyvyo has quit [Quit:]
<cougarten> I'm kind of just the front-end guy but need to run rubyMine at least :)
<cougarten> and the server...
<banister> cougarten: "just the front-end" guy isn't 'just' a guy anymore in a world of js MVC
<cougarten> and is i had noumerous troubles with an ubuntu VM i tried going windows which works well, if it works at all
terlar has quit [Client Quit]
SHyx0rmZ has joined #ruby
levabalkin has joined #ruby
<Kelet> It took me a while but I got everything I need working on Windows, but unfortunately no one really offers too much help 'round here for Windows users.
bklane has quit [Remote host closed the connection]
<Kelet> And things usually have to be installed in a round-about way ofc.
ZoanthusR has quit [Ping timeout: 248 seconds]
<shevy> I think most folks here use linux or osx
scarolan_ has quit [Ping timeout: 248 seconds]
scarolan has quit [Ping timeout: 248 seconds]
<cougarten> i really might make a hackintosh out of this laptop, seemsto be the easiest way for now, haha
stuartrexking has quit [Quit: Linkinus - http://linkinus.com]
tanema has quit [Remote host closed the connection]
<cougarten> banister, you mean because i have to handle some ruby as well?
<banister> cougarten: no because modern webdev pushes a lot more stuff into the client
noop has quit [Ping timeout: 264 seconds]
<banister> cougarten: backbone.js / ember.js, etc
<cougarten> banister, ah, right :).
nitish has joined #ruby
<banister> cougarten: i dont know the kind of stuff you're doing, it might still be simple stuff, but a lot of front-end dev is pretty sophisticated these days
Guest86900 has quit [Remote host closed the connection]
fgo has joined #ruby
scarolan has joined #ruby
<cougarten> banister, i focus on design and user-experience. So it's farely basic for now. But we'll see where things will go :)
scarolan_ has joined #ruby
<banister> cougarten: oh cool :)
timonv has quit [Remote host closed the connection]
hamed_r has joined #ruby
zeromodulus has quit [Read error: Connection reset by peer]
Astral_ has quit [Ping timeout: 245 seconds]
zeromodu_ has joined #ruby
colonolGron has joined #ruby
JDHankle has quit [Remote host closed the connection]
kevinykchan has quit [Quit: Computer has gone to sleep.]
<cougarten> banister, i should probably learn ember.js or something :) but it's hard to find the time for it... doing job and studying
fgo has quit [Ping timeout: 256 seconds]
BRMatt has joined #ruby
kpshek has quit []
ananthakumaran has quit [Quit: Leaving.]
Shirakawasuna has quit [Ping timeout: 256 seconds]
jfelchner has quit [Quit: jfelchner]
freerobby has joined #ruby
Astralum has joined #ruby
timonv has joined #ruby
ahawkins has joined #ruby
arya_ has quit []
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
decoponio has quit [Quit: Leaving...]
Es0teric has joined #ruby
snovak has joined #ruby
agatha has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
sheerun has quit [Ping timeout: 264 seconds]
rodacato has joined #ruby
osvico has quit [Read error: Connection reset by peer]
m104 has joined #ruby
snovak has quit [Ping timeout: 246 seconds]
sheerun has joined #ruby
JimmyNeutron has joined #ruby
tommyvyo has joined #ruby
ravster has joined #ruby
dodosan has joined #ruby
BizarreCake has quit [Ping timeout: 264 seconds]
Vivekananda has quit [Ping timeout: 260 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
zodiak has joined #ruby
osvico has joined #ruby
poga has quit [Remote host closed the connection]
Elhu has joined #ruby
i_s has joined #ruby
splittingred has joined #ruby
kpshek has joined #ruby
splittingred has quit [Client Quit]
m104 has quit [Quit: brb]
JumpMast3r has quit [Quit: JumpMast3r]
b00stfr3ak has quit [Read error: Operation timed out]
Kricir has joined #ruby
Shirakawasuna has joined #ruby
cj3kim has joined #ruby
stevenrockarts has joined #ruby
b00stfr3ak has joined #ruby
relix has joined #ruby
brennanMKE has joined #ruby
jjbohn has joined #ruby
poga has joined #ruby
smathieu has joined #ruby
lepht_afk is now known as lepht
Shirakawasuna has quit [Client Quit]
vlad_starkov has joined #ruby
archer_ has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
arya_ has joined #ruby
archer_ is now known as Guest21208
cj3kim has quit [Ping timeout: 240 seconds]
Kricir has quit [Ping timeout: 264 seconds]
devoldmx3 has joined #ruby
fcanela has quit [Ping timeout: 256 seconds]
goshakkk has joined #ruby
lepht is now known as lepht_afk
hamed_r has quit [Quit: Ex-Chat]
timonv has quit [Remote host closed the connection]
smathieu has quit [Ping timeout: 264 seconds]
ramblex has quit [Remote host closed the connection]
Rokko11 has joined #ruby
poga has quit [Remote host closed the connection]
poga has joined #ruby
ch_ has joined #ruby
devoldmx has quit [Ping timeout: 276 seconds]
<Rokko11> Hi! Does someone know Savon? I have some problems with the xpath-functionality of it
gz0 has quit [Ping timeout: 246 seconds]
enebo has quit [Quit: enebo]
i_s has quit [Remote host closed the connection]
kold has joined #ruby
fcanela has joined #ruby
sarkis has quit [Quit: leaving]
poga_ has joined #ruby
terlar has joined #ruby
becky_ has joined #ruby
rovalent has quit [Ping timeout: 248 seconds]
robustus has quit [Ping timeout: 245 seconds]
kpshek has quit []
fuzzy has joined #ruby
fuzzy_ has quit [Ping timeout: 248 seconds]
poga has quit [Ping timeout: 260 seconds]
raul782 has joined #ruby
robustus has joined #ruby
io_syl has joined #ruby
goshakkk has quit [Quit: Textual IRC Client: www.textualapp.com]
nomenkun has joined #ruby
fgo has joined #ruby
pipework has joined #ruby
vince_prignano has quit [Remote host closed the connection]
raul782 has quit [Remote host closed the connection]
a7d7p has quit [Quit: a7d7p]
tomzx_mac has joined #ruby
workmad3 has joined #ruby
nomenkun has quit [Ping timeout: 240 seconds]
freerobby has quit [Quit: Leaving.]
fgo has quit [Ping timeout: 240 seconds]
banister has quit [Read error: Connection reset by peer]
allsystemsarego has quit [Quit: Leaving]
<banger> hi, people i'm new on this. Do you know where can I learn about differents types of modes in Rails (or in general context ) I'm referring to the development or production mode.
<banger> i would like to know what is the diferrence between them
horrror has joined #ruby
<fryguy> banger: config/environments
<banger> i see test as well
Fire-Dragon-DoL has joined #ruby
<fryguy> yep
<fryguy> and you can just create your own as needed
lebo has joined #ruby
blackmesa has joined #ruby
freerobby has joined #ruby
rodacato has quit [Remote host closed the connection]
<banger> oh i see they have some comments , that is helpful
subbyyy has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
freerobby has quit [Client Quit]
<banger> thanks you very much fryguy learn about this was easier than i expected
ewnd9_ has joined #ruby
ewnd9 has quit [Read error: Connection reset by peer]
jjbohn has quit [Quit: Leaving...]
lethjakm1 has joined #ruby
thepumpkin has joined #ruby
vlad_starkov has quit [Ping timeout: 248 seconds]
huoxito has quit [Ping timeout: 264 seconds]
enebo has joined #ruby
lethjakman has quit [Ping timeout: 264 seconds]
vlad_starkov has joined #ruby
snovak has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ch_ has quit [Remote host closed the connection]
i_s has joined #ruby
pkrnj has joined #ruby
snovak has quit [Ping timeout: 246 seconds]
lethjakm1 has quit [Ping timeout: 264 seconds]
devoldmx has joined #ruby
devoldmx has quit [Remote host closed the connection]
poga_ has quit [Remote host closed the connection]
devoldmx has joined #ruby
poga has joined #ruby
Elhu has joined #ruby
devoldmx3 has quit [Ping timeout: 256 seconds]
fcanela has quit [Ping timeout: 264 seconds]
s0ber has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
end_guy has quit [Ping timeout: 240 seconds]
s0ber has joined #ruby
horrror has quit [Quit: horrror]
rodacato has joined #ruby
Rene has joined #ruby
<Rene> good evening to all!
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_sta_ has joined #ruby
henn1nk has joined #ruby
iliketurtles has joined #ruby
<henn1nk> what is the difference of object.nil?
<henn1nk> aeh… opposite
ssvo has quit [Ping timeout: 264 seconds]
<henn1nk> ah. .present?. ok
<Rene> does someone have an idea why gem install rails fails in the rdoc-step with the following debug-error: instance of RDoc::Constant needs to have method `marshal_load'
end_guy has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
zacts has joined #ruby
devoldmx has quit [Ping timeout: 260 seconds]
gz0 has joined #ruby
<ahawkins> henn1nk: .present? is a rails thing. It makes a little more sense. For example " ".present? => false.
jonahR has joined #ruby
cj3kim has joined #ruby
devoldmx has joined #ruby
endash has quit [Quit: endash]
workmad3 has quit [Ping timeout: 264 seconds]
<kold> Hi all. I'm looking into a challenging problem that I'd like to understand more as I run into it a lot with apps I create. I found a blog post http://www.adomokos.com/2012/10/the-organizations-users-roles-kata.html) detailing something close to the structure I'm looking for. I'm trying to get the basic RootOrg/ParentOrg and ChildOrg idea understood and setup. Here's some code I have where I have an Organization class and setup
<kold> I'm stuck on getting org_one to know about child_one
<kold> I was thinking I could add two methods to Organization add_parent_org and add_child_org, then build an array of each held in each object
cj3kim has quit [Ping timeout: 260 seconds]
jjbohn has joined #ruby
zeromodu_ has quit [Read error: Connection reset by peer]
zeromodulus has joined #ruby
zeromodulus has joined #ruby
zeromodulus has quit [Changing host]
elaptics`away is now known as elaptics
devoldmx3 has joined #ruby
renderful has quit [Remote host closed the connection]
m104 has joined #ruby
renderful has joined #ruby
tommyvyo has quit [Quit:]
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
nanoxd_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nanoxd has joined #ruby
<sormina> Hey there, is it possible to use a module method and execute it in the context of an instance?
devoldmx has quit [Ping timeout: 240 seconds]
zorg24 has quit [Read error: Operation timed out]
rodacato has quit [Remote host closed the connection]
renderful has quit [Ping timeout: 264 seconds]
tommyvyo has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
Companion is now known as companion
Elhu has joined #ruby
zeropx has quit [Remote host closed the connection]
zeropx has joined #ruby
stillEPIK has joined #ruby
stillEPIK has quit [Client Quit]
Elhu has quit [Client Quit]
kreeves has quit [Ping timeout: 240 seconds]
tommyvyo has quit [Quit:]
Astralum has quit [Ping timeout: 264 seconds]
timonv has joined #ruby
<kold> heftig: ah, thanks, makes sense now. I was considering something like the Composite design pattern, too, but wanted to ask for input
ffio_ has quit [Quit: WeeChat 0.4.1]
<heftig> kold: updated with an alternative implementation
marr has joined #ruby
fgo has joined #ruby
pipework has quit [Remote host closed the connection]
<kold> heftig: thanks, I see the value in that latest that I'd get a whole new org object
bradsmith has joined #ruby
dagnachew has joined #ruby
ahawkins has quit [Quit: leaving]
fgo has quit [Ping timeout: 240 seconds]
jjbohn has quit [Quit: Leaving...]
devoldmx has joined #ruby
tommyvyo has joined #ruby
workmad3 has joined #ruby
jjbohn has joined #ruby
endash has joined #ruby
devoldmx3 has quit [Ping timeout: 260 seconds]
<sormina> I'm trying to use instance_eval on a Module method, but I get a Type Error (no conversion of Method to String). This is what I am trying to do: https://gist.github.com/anonymous/f0e4e674b17950f64703
Astralum has joined #ruby
<sormina> I want to execute a function from a module in the instance scope of an object. How can I do this?
AlHafoudh has joined #ruby
AlHafoudh has quit [Max SendQ exceeded]
<heftig> kold: actually, the only value in that latest is that it's more concise
AlHafoudh has joined #ruby
<heftig> kold: you're telling the parent org to create a child org, instead of creating a new org with a given parent org
apeiros has joined #ruby
timonv has quit [Remote host closed the connection]
rgbdev has joined #ruby
rgbdev has left #ruby [#ruby]
<waxjar> sormina, i think you need to pass it as a bloc rather than a proc: instance_eval(&mod.method(:say_hi))
<kold> heftig: thanks, I understand
<apeiros> gah, rqrcode only supports byte encoding :(
ebanoid has quit [Quit: brbomgwtfbbq]
snovak has joined #ruby
zodiak has quit [Read error: Operation timed out]
kaldrenon has joined #ruby
devoldmx3 has joined #ruby
<sormina> waxjar: Hey, thank you. Unfortunately, that doesn't work. It now throws a different error, saying that say_hi is being called with the wrong number of arguments.
tommyvyo has quit [Quit:]
devoldmx has quit [Read error: Connection reset by peer]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
<sormina> waxjar: The argument passed to say_hi seems to be self (i.e. foo).
<BrianJ> I have a config file that I want to load and its in a different directory in linux than it is on windows… whats the best way to deal with this?
snovak has quit [Ping timeout: 248 seconds]
dawkirst has quit [Ping timeout: 264 seconds]
<Nilium> It's fun to go back through my old code and replace bad uses of reduce/inject.
mengu has joined #ruby
<waxjar> seems like Method.to_proc returns a lambda sormina
kaldrenon has quit [Ping timeout: 276 seconds]
<waxjar> lambda's will complain when you don't pass them the right arguments
huoxito has joined #ruby
<sormina> waxjar: But the function doesn't take an argument, does it?
zodiak has joined #ruby
<waxjar> no, but the & in front calls #to_proc on the Method object that #method(:say_hi) creates
<waxjar> and the lambda expects no arguments
Ciscoridze has joined #ruby
<sormina> waxjar: So where does this argument come from?
mlpinit has joined #ruby
mengu_ has joined #ruby
<waxjar> instance_eval passes it to the lambda, apparantly
mengu has quit [Read error: Operation timed out]
JimmyNeutron has quit [Quit: Leaving]
stevenrockarts has quit [Quit: stevenrockarts]
Kruppe has joined #ruby
<sormina> waxjar: This is weird. And why is this working now? https://gist.github.com/anonymous/751b9ef448bf3d01dbb8
<sormina> I don't like using code that I don't understand ^_^
Spami has joined #ruby
Spami has joined #ruby
<waxjar> A.method(:say_hi) creates a lambda (a Proc for which Proc#lambda? returns true)
<pontiki> doesn't the module need to be included somewhow?
mlpinit has quit [Ping timeout: 264 seconds]
m104 has quit [Quit: bye]
<waxjar> because A.say_hi originally didnt expect any arguments, it created a lambda that didnt expect any arguments
<pontiki> instance_eval works on the implied self of B, does it not?
<waxjar> but instance_eval gives it an argument anyway, that's why it raised an error
mlpinit has joined #ruby
<waxjar> now A.say_hi expects an argument, so the lambda will also expect an argument and it'll work
<sormina> So what happens with the second ampersand? It's not the same as to_proc because if I use that again, I get another error.
diegoviola has joined #ruby
PapaSierra has quit [Ping timeout: 240 seconds]
<waxjar> & just means "pass this argument as a block argument"
<sormina> Mhm ...
i_s has quit [Remote host closed the connection]
<waxjar> when that argument is something that's not a block, it calls #to_proc on it
<sormina> So, regardless of this now working: Is doing something like that a bad idea?
stkowski has quit [Quit: stkowski]
<waxjar> not per se. i'd do something like instance_eval { A.method(:say_hi).call } instead, though
<sormina> As you might have guessed, I'm relatively new to Ruby and what I am trying to do here is create a class with a fixed set of functionalities. I want to be able to add Modules in order to "hook" into those functionalities.
JumpMast3r has joined #ruby
i_s has joined #ruby
<waxjar> have a look at include and extend :)
kjellski_ has quit [Quit: Leaving]
<sormina> I did use extend at first but that didn't seem to work the way I wanted it to work.
<sormina> I'm just trying to figure out what a decent code style in Ruby would be.
<sormina> Because if I use extend, every module will have to reimplement the code that hooks it to those functionalities, right?
<waxjar> with extend you can just tag the instance methods of a Module on an object
brennanMKE has quit [Read error: Connection reset by peer]
kct has quit [Quit: Leaving]
AlHafoudh has quit [Quit: Textual IRC Client: www.textualapp.com]
Megtastique has quit [Quit: Megtastique]
MrZYX is now known as MrZYX|off
nomenkun has joined #ruby
terlar has quit [Quit: leaving]
bradsmith has quit [Remote host closed the connection]
intuxicated has quit [Ping timeout: 276 seconds]
<x3nu_> i don't want to know the solution but only why the line 23 fails, it's the line 12 in the programm http://pastebin.com/hdCP9AWs
<x3nu_> it's a normal if bigger then x, then do condition
<x3nu_> can't find a typo either
enebo has quit [Quit: enebo]
huoxito has quit [Quit: Leaving]
<waxjar> array[pobV] returns nil x3nu_
<sormina> waxjar: Thank you, but in my case, there might be two modules that implement say_hi and I want to run both of them.
rdg has joined #ruby
dash_ has quit [Quit: dash_]
* Nilium stares
Spami has quit [Quit: Leaving]
cnrk has joined #ruby
pothibo has quit [Quit: pothibo]
stuartrexking has joined #ruby
<sormina> Oh, and it looks like I was just confused. Because in the code I deemed "working", the Module function was still not executed in the object's scope.
<x3nu_> waxjar: thx for the help but i can't grasp what you mean
<x3nu_> i do check if posB does exist before
tacos1de has quit [Ping timeout: 240 seconds]
<waxjar> > is implemented as a method, it isn't an operator :) array[posB] returns nil, and nil doesn't have a > method
<x3nu_> i now changed false to nil
<x3nu_> now it never checks B and always defaults to posA
<x3nu_> but at least in the second iteration there should be a posB
<sormina> This is how I want it to work (except that it still doesn't work): https://gist.github.com/anonymous/1525c959eab678da0237
<x3nu_> ah, i found the problem, array always has only one entry
<x3nu_> there is a problem in mapping it
MrZYX|off is now known as MrZYX
cantonic has joined #ruby
intuxicated has joined #ruby
ravster has quit [Quit: Leaving.]
<Nilium> sormina: Your indentation went insane
<Nilium> Don't mix tabs and spaces.
the_fallen has joined #ruby
intuxicated has quit [Max SendQ exceeded]
nomenkun has quit [Remote host closed the connection]
jonahR_ has joined #ruby
rdg has quit [Quit: ttfn]
b00stfr3ak has quit [Ping timeout: 260 seconds]
<sormina> Mhm, looks like Sublime used spaces for auto-indentation. Here is the code again, but looking nicer :-) https://gist.github.com/anonymous/6cda3c7c774417dc35b4
tacos1de has joined #ruby
ebanoid has joined #ruby
jonahR has quit [Ping timeout: 248 seconds]
jonahR_ is now known as jonahR
Xeago has quit [Remote host closed the connection]
Rokko11 has quit [Quit: Page closed]
havenwood has quit [Remote host closed the connection]
i_s has quit [Remote host closed the connection]
labrat__ has joined #ruby
intuxicated has joined #ruby
Liothen has joined #ruby
Elhu has joined #ruby
v0n has joined #ruby
anonymuse has joined #ruby
endash has quit [Quit: endash]
hackingoff has quit [Ping timeout: 240 seconds]
Elhu has quit [Client Quit]
cnrk has quit [Quit: cnrk]
Guest21208 has quit [Remote host closed the connection]
stevenrockarts has joined #ruby
dangerousdave has quit [Read error: No route to host]
<x3nu_> ah damn, it solves the example with 4 rows right, but the 10 row pyramid it fails
jonahR has quit [Quit: jonahR]
anonymuse has quit [Remote host closed the connection]
Kruppe has quit [Remote host closed the connection]
jonahR has joined #ruby
Lewix has joined #ruby
eliasp_ has quit [Remote host closed the connection]
pkrnj has quit [Quit: Computer has gone to sleep.]
d2dchat_ has quit [Remote host closed the connection]
eliasp has joined #ruby
sporkbomb has joined #ruby
joast has quit [Ping timeout: 260 seconds]
the_fallen has quit [Remote host closed the connection]
<sormina> waxjar: Do you have another idea how I could solve that problem?
nomenkun has joined #ruby
<waxjar> i'd rethink the design, tbh
nitish has quit [Remote host closed the connection]
spider-mario has quit [Read error: Connection reset by peer]
<sormina> waxjar: Do you know of any best practices for similar functionality?
snovak has joined #ruby
stevenrockarts has quit [Remote host closed the connection]
endash has joined #ruby
stevenrockarts has joined #ruby
weeb1e has quit [Ping timeout: 264 seconds]
b00stfr3ak has joined #ruby
weeb1e has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
banger has quit []
MrZYX is now known as MrZYX|off
Fire-Dragon-DoL1 has joined #ruby
Fire-Dragon-DoL has quit [Ping timeout: 248 seconds]
dagnachew has quit [Quit: Leaving]
tommyvyo has joined #ruby
sjltaylor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[rust] has joined #ruby
vince_prignano has joined #ruby
havenwood has joined #ruby
tommyvyo has quit [Client Quit]
<Nilium> sormina: I'd say you're using modules poorly.
tommyvyo has joined #ruby
diegoviola has quit [Ping timeout: 240 seconds]
<Nilium> If you need a series of things to executed, keep an array of lambdas or blocks instead.
vince_pr_ has joined #ruby
<sormina> Nilium: But how do I store these?
<Nilium> As is, the whole design is kind of bonkers, though.
<Nilium> How do you store objects in an array? O_o
freerobby has joined #ruby
<sormina> Nilium: I mean, I want them to be optional.
<sormina> And of course, this example is a bit simplistic, but those modules could also contain classes and more sophisticated functions.
<Nilium> Not sure what about an array of procs/lambdas isn't optional.
saarinen has joined #ruby
<Nilium> That said, the main issue I have is the whole instance_exec (or eval in your case) thing, which is stupid for this purpose.
workmad3 has quit [Ping timeout: 264 seconds]
vince_prignano has quit [Ping timeout: 264 seconds]
<sormina> Well, I want to have one class, in this example it is called Container. And then I want to create several objects from that class and extend them with whatever modules I want them to use.
<Nilium> That depends on what your idea of 'extend' is.
<sormina> Well, the basic idea of that is in my last code example. Conceputally, it is similar to how Sinatra lets you define multiple routes or before/after filters.
ephemerian has quit [Quit: Leaving.]
i_s has joined #ruby
MrZYX|off is now known as MrZYX
iAreBaboon has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
blip- has joined #ruby
<Nilium> Don't know sinatra, so explain it in a way that makes sense in terms of Ruby.
cnrk has joined #ruby
<Nilium> If it's not obvious, I'm telling you to clearly define your problem.
goleldar has joined #ruby
<goleldar> hello
smathieu has joined #ruby
<Nilium> Looks like minified code, which isn't good code.
<sormina> Sinatra is a web application framework. It lets you do things like that: https://gist.github.com/anonymous/4762a0055fb6f53fe0a4
<havenwood> map is better than each because it has fewer letters
Guest15207 has joined #ruby
<Nilium> I know what it is. The problem is that what the sinatra example does there is very, very fundamentally different from what you've described so far.
<goleldar> I am having trouble with my regex https://gist.github.com/justinleveck/ee97d11cfb8494620ecc
<goleldar> I am trying to use a match all inside a negative look-behind
popl has joined #ruby
<Nilium> I don't think look-aheads/behinds can do that.
<sormina> Mhm ... in my example, I want the say_hi! functions from the modules to be like routes or filters in Sinatra.
ping-pong has quit [Ping timeout: 276 seconds]
cougarten has quit [Ping timeout: 264 seconds]
<goleldar> it works in regexbuddy :)
<Nilium> Wait, nevermind, assumed you meant match-all in a greedy sense.
<Nilium> i.e., .* inside a lookahead/behind
<goleldar> ya
<Nilium> That doesn't work.
smathieu has quit [Ping timeout: 246 seconds]
pagios_ has quit [Ping timeout: 276 seconds]
<Nilium> sormina: Then do that.
<Nilium> Keep a list of blocks and execute them.
pagios_ has joined #ruby
<Nilium> Or an array, rather.
i_s has quit [Ping timeout: 276 seconds]
Fire-Dragon-DoL1 has quit [Quit: Leaving.]
Fire-Dragon-DoL has joined #ruby
<sormina> Nilium: But how do I have those blocks in a module and then execute it in the context of the object instance?
<sormina> That's what I've been trying to do all along.
d2dchat_ has joined #ruby
tommyvyo has quit [Quit:]
dodosan has quit [Remote host closed the connection]
stuartrexking has quit [Quit: Leaving...]
Shirakawasuna has joined #ruby
cnrk has quit [Quit: cnrk]
vlad_sta_ has quit [Read error: Connection reset by peer]
cnrk has joined #ruby
cnrk has quit [Client Quit]
freerobby has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
levabalkin has quit [Quit: leaving]
<Nilium> Stop trying to do an instance_exec.
<Nilium> It's not a good practice.
MrZYX is now known as MrZYX|off
<sormina> I figured it wasn't that's why came here :)
<sormina> But ... what would be better then?
Guest15207 is now known as diegoviola
<Nilium> Give your container the interface it needs to expose whatever to other stuff then yield the container to the method.
nomenkun has quit [Remote host closed the connection]
<sormina> Mhm ... but that doesn't sound like an OOP concept to me.
<Nilium> OOP is very poorly defined.
devoldmx3 has quit [Ping timeout: 264 seconds]
<Nilium> That said, what I basically just described is encapsulation. Most people like to think that's an OOP thing.
tommyvyo has joined #ruby
stkowski has joined #ruby
ping-pong has joined #ruby
tommyvyo has quit [Client Quit]
sjltaylor has joined #ruby
<sormina> Mhm ... you're right, encapsulation is what I want to achieve.
anonymuse has joined #ruby
stevenrockarts_ has joined #ruby
ewnd9_ has quit [Read error: Operation timed out]
bradsmith has joined #ruby
stevenrockarts has quit [Ping timeout: 264 seconds]
tanema has joined #ruby
tommyvyo has joined #ruby
zorg24 has joined #ruby
<sormina> Nilium: What do you think about this design then? https://gist.github.com/anonymous/6580dbef2dbe1877601f
<Nilium> Why don't you just add the module to the array and call the method normally?
bradsmith has quit [Ping timeout: 240 seconds]
nari has joined #ruby
stkowski has quit [Quit: stkowski]
tommyvyo has quit [Ping timeout: 248 seconds]
YaNakilon has quit [Ping timeout: 264 seconds]
<Nilium> Yes. Except probably don't even bother with checking if it responds to the method since you shouldn't be calling add_method with bad input.
<sormina> Does it make any difference memory-wise? Would the .method create a copy of the actual method from the Module?
<Nilium> Maybe raise an exception for non-called.
<Nilium> Don't know.
kirun has quit [Quit: Client exiting]
Kricir has joined #ruby
<sormina> Nope, I need the check, because I also want to have other methods, like say_bye.
<sormina> Of course, it would be perfect if I could just use .extend and have a callback in the Container class that does what add_module does now. Something like self.extended in a Module - only that I want it in the object instance instead of the Module. But I guess that doesn't work ...
anonymuse has quit [Remote host closed the connection]
YaNakilon has joined #ruby
ner0x has joined #ruby
Kricir has quit [Ping timeout: 260 seconds]
<waxjar> something along these lines perhaps sormina ?
AlHafoudh has joined #ruby
AlHafoudh has quit [Max SendQ exceeded]
dodosan has joined #ruby
bradsmith has joined #ruby
<sormina> waxjar: That is definitely cool because it makes everything much more flexible.
vlad_starkov has quit [Remote host closed the connection]
jarin has joined #ruby
babykosh has quit [Quit: babykosh]
Lewix has quit [Remote host closed the connection]
<sormina> Thank you, both waxjar and Nilium, you definitely helped me straighten my thoughts :-)
<waxjar> you cant do anything with return values this way tho
saarinen has quit [Quit: saarinen]
nari has quit [Read error: Connection reset by peer]
nari has joined #ruby
Akuma has quit [Ping timeout: 276 seconds]
<sormina> Mhm ... it'll need some more thinking ... but not today. It's 1 am here now^^
snovak has joined #ruby
predator217 has joined #ruby
niknar has joined #ruby
predator117 has quit [Ping timeout: 240 seconds]
eka has quit [Quit: Computer has gone to sleep.]
snovak has quit [Ping timeout: 264 seconds]
stkowski has joined #ruby
daniel_ has joined #ruby
<sormina> Good night, guys/girls :)
sormina has left #ruby [#ruby]
Lewix has joined #ruby
bradsmit_ has joined #ruby
bradsmith has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
devoldmx has joined #ruby
workmad3 has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
mlpinit has quit [Remote host closed the connection]
devoldmx has joined #ruby
cj3kim has quit [Ping timeout: 240 seconds]
fcanela has joined #ruby
ebanoid has quit [Quit: brbomgwtfbbq]
cj3kim has joined #ruby
echevemaster has quit [Quit: Leaving]
bradsmit_ has quit [Remote host closed the connection]
_honning_ has quit [Ping timeout: 264 seconds]
tommyvyo has joined #ruby
ryoDC has joined #ruby
fcanela has quit [Quit: Saliendo]
ryoDC has left #ruby [#ruby]
echevemaster has joined #ruby
echevemaster has quit [Changing host]
echevemaster has joined #ruby
intuxicated has quit [Ping timeout: 264 seconds]
DrShoggoth has quit [Quit: Leaving]
Lewix has quit [Remote host closed the connection]
niknar has left #ruby [#ruby]
tommyvyo has quit [Client Quit]
intuxicated has joined #ruby
johnkary has joined #ruby
jarin has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
vlad_starkov has joined #ruby
tommyvyo has joined #ruby
Astral_ has joined #ruby
intuxicated has quit [Max SendQ exceeded]
diegoviola has quit [Ping timeout: 276 seconds]
lemonsparrow has quit [Ping timeout: 250 seconds]
mando has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
intuxicated has joined #ruby
jefflyne has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Astralum has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
kaspergrubbe has quit [Remote host closed the connection]
Olipro has joined #ruby
xcv has joined #ruby
intuxicated has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Ping timeout: 260 seconds]
fridim_ has joined #ruby
intuxicated has joined #ruby
BRMatt has quit [Ping timeout: 264 seconds]
kaspergrubbe has joined #ruby
stuartrexking has joined #ruby
hadees has quit [Quit: hadees]
babykosh has joined #ruby
babykosh has quit [Client Quit]
Ciscoridze has quit [Quit: WeeChat 0.4.1]
havenwood has quit [Remote host closed the connection]
sheerun has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cj3kim has quit [Read error: Connection reset by peer]
byprdct has joined #ruby
cj3kim has joined #ruby
_honning_ has joined #ruby
tanema has quit [Remote host closed the connection]
ninegrid_ has quit [Quit: leaving]
vince_pr_ has quit [Remote host closed the connection]
sheerun has joined #ruby
ninegrid has joined #ruby
Kricir has joined #ruby
laurone16 has quit [Ping timeout: 264 seconds]
tanema has joined #ruby
rowsdower has joined #ruby
pkrnj has joined #ruby
colonolGron has quit [Quit: Lost terminal]
Kricir has quit [Ping timeout: 276 seconds]
thepumpkin has quit [Remote host closed the connection]
i_s has joined #ruby
emergion has joined #ruby
dodosan has quit [Remote host closed the connection]