solnic changed the topic of #rom-rb to: Ruby Object Mapper | Mailing List: https://groups.google.com/forum/?fromgroups#!forum/rom-rb | Logs: http://irclog.whitequark.org/rom-rb
jgaskins has joined #rom-rb
jgaskins has quit [Client Quit]
kleech has quit [Remote host closed the connection]
cored has joined #rom-rb
knowtheory has joined #rom-rb
mbj has quit [Read error: Operation timed out]
CraigBuchek has quit [Quit: Leaving.]
knowtheory has quit [Read error: Connection reset by peer]
zekefast has joined #rom-rb
cored has quit [Ping timeout: 272 seconds]
zekefast has quit [Read error: Operation timed out]
zekefast has joined #rom-rb
irclogger__ has quit [Remote host closed the connection]
irclogger__ has joined #rom-rb
ezkl has quit [Quit: QUIT!]
zekefast has quit [Quit: Leaving.]
xybre has quit [Read error: Operation timed out]
onewheelskyward has quit [Read error: Operation timed out]
xybre has joined #rom-rb
knowtheory has joined #rom-rb
onewheelskyward has joined #rom-rb
snusnu has quit [Quit: Leaving.]
zekefast has joined #rom-rb
zekefast has quit [Quit: Leaving.]
zekefast has joined #rom-rb
travis-ci has joined #rom-rb
<travis-ci> [travis-ci] dkubb/memoizable#50 (master - 24670ea : Dan Kubb): The build was broken.
travis-ci has left #rom-rb [#rom-rb]
<travis-ci> [travis-ci] Build details : http://travis-ci.org/dkubb/memoizable/builds/14186699
mbj has joined #rom-rb
kalleth has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
kalleth has joined #rom-rb
postmodern has quit [Quit: Leaving]
cored has joined #rom-rb
cored has joined #rom-rb
<cored> hello
<cored> mbj: are you around?
zekefast has quit [Quit: Leaving.]
micho has joined #rom-rb
micho has quit [Client Quit]
<mbj> cored: busy
<cored> aoki
mbj has quit [Quit: Lost terminal]
CraigBuchek has joined #rom-rb
ezkl has joined #rom-rb
bf4-yololologger has joined #rom-rb
bf4 has joined #rom-rb
snusnu has joined #rom-rb
cbuxton__ has joined #rom-rb
jdsiegel has joined #rom-rb
dbussink_ has joined #rom-rb
cbuxton_ has quit [*.net *.split]
jdsiegel_ has quit [*.net *.split]
dbussink has quit [*.net *.split]
cbuxton__ is now known as cbuxton_
knowtheory has quit [Ping timeout: 240 seconds]
mbj has joined #rom-rb
mkristian has joined #rom-rb
snusnu has quit [Quit: Leaving.]
vsorlov has joined #rom-rb
vsorlov has quit [Ping timeout: 272 seconds]
<dkubb> good morning
<mbj> dkubb: hola
<mkristian> dkubb, good evening my time ;)
<mbj> mkristian: hi, and welcome!
<mkristian> hi, and thanx !
<mbj> mkristian: any specific ROM interest you wanna talk about?
<mkristian> mbj, no not really - I am using virtus a lot and DM and just curious - might need to migrate one or the other application one day.
<mbj> mkristian: Heh. With virtus you are already decoupling your business logic from persistance. So you have 40% of the ugprade path already!
<mbj> mkristian: Dont cite me with this number, its out of my personal /dev/random ;)
<mkristian> and I am always thrilled to get input like "mutation testing" from you guys
<mbj> mkristian: heh you are talking to the author of mutant the tool we use for rom.
<mkristian> well virtus I use for my restful stuff but still for the persistence I am using DM resources
<mbj> mkristian: You already tried mutation testing?
<mkristian> mbj, well I read this tweet you posted here yesterday (or the day before) about mutation testing in java
<mkristian> no did not had time to test it but the idea sounds great
<mbj> mkristian: that is a start ;)
<mkristian> and mutant is a ruby library then !!
<mbj> mkristian: mutant is a mutation testing tool for ruby
micho has joined #rom-rb
<mbj> mkristian: you can also see it as a lib if you whant
<mkristian> mbj, lib or tool or gem - sorry I am not so precise with that ;)
<mbj> mkristian: heh
<mbj> np
<mkristian> mkristian, so how does mutant work? does it just delete random lines of my code ?
<mbj> mkristian: it does much more and its not random.
<mkristian> well, it can insert meaningful things I guess ?
dbussink_ has quit [Remote host closed the connection]
<mbj> mkristian: So the mutations for a given AST representation of code are deterministic.
<mbj> mkristian: But we do much more than just deleting lines.
dbussink has joined #rom-rb
<mbj> mkristian: We have around 50+ differend mutators
<mbj> mkristian: And only the statement deletion was shown in that blog post.
<mkristian> mbj, is that AST thingy working with MRI or JRuby or only with rubinius ?
<mbj> mkristian: I use an implementation indepentant AST. Produced by whitequark/parser a ruby parser written in pure ruby.
mkristian_ has joined #rom-rb
<mkristian_> great - since there was some other tool you guys are using which does only with rubinius :)
<mbj> mkristian: mutant "was" RBX only
<mbj> mkristian: It now supports MRI and RBX.
mkristian has quit [Ping timeout: 245 seconds]
_whitelogger has joined #rom-rb
jfredett-w has quit [Quit: Leaving.]
micho has quit [Quit: Leaving]
mkristian__ has joined #rom-rb
mkristian_ has quit [Read error: Operation timed out]
<cored> hi
<cored> mbj: did you manage to check the piece of code I showed you yesterday, regarding a mutation that mutant create for my code?
<dkubb> cored: did you have a gist of that code?
<cored> it's added nil to a method which always return nil, the thing is that probably that test is not getting tested
<cored> I guess I should return self
<cored> dkubb: sure
<cored> dkubb: I switched yesterday but I'm still not testing it https://gist.github.com/cored/7549983
<cored> dkubb: can you give me your feedback on this particular piece of code that I wrote https://gist.github.com/cored/7549990
<cored> dkubb: I should show you the create_file method code instead of that one, wait
<cored> that's the one
jfredett-w has joined #rom-rb
<dkubb> cored: OT, but I would probably represent the filename as a Pathname object
<cored> dkubb: what does OT means?
<dkubb> OT = off topic
<cored> oh oki
<cored> I will take that advice into account for sure
<cored> I was proud of myself just because reek did not find a lot of code smells on that code, even when I know there are not a lot of code there
<dkubb> it's really nice code
<cored> thanks :-)
<cored> most of what I did was reading your code and mbj :-P
<dkubb> one other thing I would mention is that your #each method should usually either return self or to_enum if no block is provided
<dkubb> you'll see that in code we've written for rom and axiom
<dkubb> the each api allows you to go: collection.each.select { ... }
<cored> oh yes
<cored> I remember that now
<cored> probably in this context better to return self
<cored> so I don't have to define to_enum
<dkubb> to_enum is standard
<dkubb> its part of ruby
<cored> agotcha
<dkubb> obviously that inner code differs for each object
<dkubb> when each is passed a block it's supposed to return self
<cored> quite interesting
<cored> also using to_ary I won't have to define the block as argument explicity
<cored> in fact never mind, I just said a nonesense
<cored> you are explicity passing the block to the internal state of the object
<dkubb> in this specific case, yes, but it's not always that way
<cored> which points me to the other question, in the end I'm returning a transformed data, I'm guessing that the reason to return self is to encapsulate the internal data structure that the object use
<dkubb> the main thing is you want to yield the block with the object the caller would expect
<dkubb> the rule of thumb I typically use is that I try to split up methods into two categories: query methods and command methods
<dkubb> a query is allowed to return a meaningful result, but it is not allowed to change state. I can freely call it as many times as I want, safely, without modifying anything
<cored> yes, I follow that advice from the partial work I'm doing with devtools
<dkubb> it's almost always idempotent
<cored> now I'm thinking that one of my collection Words in particular doesn't need to include Enumerable
<dkubb> a command method is allowed to change state, but it cannot return a value that can be queried.. some people return nil from these methods, but I like to return self because it allows me to chain things
<cored> oh, now I remember why I addded it that, it was just to use map on it without defining it
<cored> yes
<cored> that's what I'm trying to do
<cored> probably I can simplify this code a little more following does guidelines and decoupling a little more
<cored> this was an interview assignment, I tried it to solve the best way I could
<dkubb> this is a bit more info on Command Query separation: http://martinfowler.com/bliki/CommandQuerySeparation.html
<cored> great, will read it
<cored> but regarding mutation
<cored> I want to add more specs for killing then
<cored> there are some methods that mutant add nil at the end or raise an exception
<cored> from which I'm not testing and I want to add more tests for it the thing is that in particular the File part returns always nil
<dkubb> yeah, if mutant adds nil, and the specs don't fail, it probably means you're not testing the return value
<dkubb> the return value of every public method should be tested imho
<cored> in fact the spec did not fail because I'm not testing for that
<dkubb> cored: what is the purpose of the Words class?
<dkubb> cored: a better word than purpose is "responsibility". every class/object should have one responsibility. it should generally aggregate different objects or add behaviour (or remove behaviour in some cases to provide a simpler interface)
<cored> dkubb: is a collection for wrapping an array of strings
<cored> but I'm feeling there's another type hidden in the code
<cored> I was thinking in Word in particular to wrap the actual Strings inside my own type but that's also looks more like a data container without any type of particular behaviour at least I can't see it at the moment
<dkubb> I personally wouldn't bother with the :in alias
<cored> you would call .new directly ?
<dkubb> yeah, probably
<cored> I was thinking in some sort of DSL at first, it didn't end as I expected
<cored> something like Sequence.in(word).not_included_in(Sequence)
<dkubb> I try to limit custom constructors to very specific cases. if I saw SomeClass.in I might not be sure what it does without looking at the code, but if I see SomeClass.new it's very likely I know what it does without looking
<cored> but in the end the way I'm representing the data structure assures me to have uniq values for the keys which is what I want
<cored> good thought
<cored> what do you think about my Collection[]
<cored> way to construct collections, I copy that from Hash[]
<dkubb> every line of code has to justify it's existence. if it doesn't have a strong reason for being there I would remove it
<dkubb> I would probably also remove the [] constructor, at least for now
<dkubb> those kinds of things are sugar and can be added back in later. I would focus on the basics at first, you might find you don't need sugar
<cored> I see
mkristian__ has quit [Quit: bye]
<cored> dkubb: but take into account that [] is very explicty what is doing
<cored> parting from the fact that there are other objects in the language that do same thing
<cored> in fact now that I see there's no such thing for instantiation
knowtheory has joined #rom-rb
postmodern has joined #rom-rb
zekefast has joined #rom-rb
dkubb has quit [Quit: Linkinus - http://linkinus.com]
cored has quit [Ping timeout: 252 seconds]
cored has joined #rom-rb
zekefast has quit [Quit: Leaving.]
martxel has quit [Ping timeout: 264 seconds]
dbussink has quit [Read error: Operation timed out]
dbussink has joined #rom-rb
dbussink has quit [Quit: bye]
dbussink has joined #rom-rb
cored has quit [Ping timeout: 272 seconds]
cored has joined #rom-rb
cored has quit [Ping timeout: 245 seconds]
dbussink_ has joined #rom-rb
dbussink_ has quit [Remote host closed the connection]
dbussink has quit [Ping timeout: 272 seconds]
dbussink_ has joined #rom-rb
dbussink_ has quit [Remote host closed the connection]
dbussink has joined #rom-rb
bf4_ has joined #rom-rb
martxel has joined #rom-rb
martxel is now known as Guest60381
bf4 has quit [Ping timeout: 246 seconds]
bf4-yololologger has quit [Ping timeout: 248 seconds]
bf4_ has quit [Ping timeout: 252 seconds]
mbj has quit [Ping timeout: 272 seconds]