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
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #rom-rb
bfleischer has joined #rom-rb
skade_ has joined #rom-rb
skade has quit [Ping timeout: 240 seconds]
jfredett has quit [Read error: Connection reset by peer]
jfredett1 has joined #rom-rb
dkubb has joined #rom-rb
jfredett1 is now known as jfredett
skade_ has quit [Quit: Computer has gone to sleep.]
cored has quit [Ping timeout: 246 seconds]
postmodern has quit [Quit: Leaving]
joakimk has quit [Ping timeout: 245 seconds]
snusnu has quit [Quit: Leaving.]
knowtheo1y has joined #rom-rb
knowtheory has quit [Ping timeout: 248 seconds]
knowtheo1y has quit [Read error: Connection reset by peer]
knowtheory has joined #rom-rb
knowtheo1y has joined #rom-rb
knowtheory has quit [Ping timeout: 264 seconds]
joakimk has joined #rom-rb
mbj has joined #rom-rb
bfleischer has quit [Ping timeout: 240 seconds]
mbj has quit [Ping timeout: 246 seconds]
onewheelskyward has quit [Ping timeout: 256 seconds]
onewheelskyward has joined #rom-rb
dkubb has quit [Quit: Linkinus - http://linkinus.com]
bfleischer has joined #rom-rb
bfleischer has quit [Ping timeout: 256 seconds]
kleech has joined #rom-rb
zekefast has joined #rom-rb
skade has joined #rom-rb
mbj has joined #rom-rb
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
skade has joined #rom-rb
bfleischer has joined #rom-rb
bfleischer has quit [Ping timeout: 245 seconds]
franckverrot has quit [Ping timeout: 260 seconds]
kapowaz has quit [Ping timeout: 248 seconds]
kleech has quit [Remote host closed the connection]
kleech has joined #rom-rb
zekefast has quit [Quit: Leaving.]
zekefast has joined #rom-rb
kenphused has joined #rom-rb
cored has joined #rom-rb
cored has joined #rom-rb
bfleischer has joined #rom-rb
kleech has quit [Remote host closed the connection]
bfleischer has quit [Ping timeout: 264 seconds]
kleech has joined #rom-rb
kapowaz has joined #rom-rb
franckverrot has joined #rom-rb
snusnu1 has joined #rom-rb
kleech has quit [Read error: Connection reset by peer]
kleech has joined #rom-rb
zekefast has quit [Quit: Leaving.]
snusnu1 has quit [Quit: Leaving.]
breakingthings has joined #rom-rb
snusnu has joined #rom-rb
mbj has quit [Quit: leaving]
knowtheo1y has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
knowtheory has quit [Ping timeout: 248 seconds]
kleech has quit [Remote host closed the connection]
knowtheory has joined #rom-rb
kleech has joined #rom-rb
jfredett has quit [Read error: No route to host]
jfredett has joined #rom-rb
kleech has quit [Remote host closed the connection]
misfo has joined #rom-rb
<misfo> does anybody know if there's a way to include methods in the main object w/o polluting Object?: https://gist.github.com/misfo/6796529
<misfo> i.e. something analogous to having a `def self.some_method() end` at the top-level
<jfredett> misfo: you can sometimes use a module to avoid that, though I'm not sure what your goal is
<jfredett> if you have a method on a module like module Foo; def run(&block) ; instance_eval(&block); end ; end
<jfredett> err -- self.run
<jfredett> then you can include in Foo your module
<jfredett> and if you want to run code, you run it inside of a block passed to Foo.run
<jfredett> technically refinements can also be sort of kind of used for this, but I don't recommend it (the semantics are super complicated)
NemesisD has joined #rom-rb
<NemesisD> hey guys. i'm trying to submit a patch to grape to get it working with the virtus 1.0 betas. i'm having it coerce an array of bools. i'm wondering if i'm using virtus wrong
<NemesisD> Virtus::Attribute.build([Virtus::Attribute::Boolean]).coerce(['1', '0']) returns ['1', '0']
<NemesisD> it looks like the coercer of the attribute is Coercible::Coercer::Array, its method is :to_array,
<misfo> @jfredett i wasn't being clear. Using `def self.some_method() end` at the top-level of a file defines the method only on the main object and avoids polluting all objects with your method: https://gist.github.com/misfo/6796883 I was looking a way to add all the methods in a module to the main object w/o polluting all object
<jfredett> misfo: ah... hmm
<jfredett> I don't think there's a way to do that -- all objects walk up the tree and will find stuff in Object
<jfredett> actually, there is a way, it's just toast and you shouldn't use it -- namely Refinements -- iirc the scoping rules would prevent that pollution
<jfredett> why do you need to do it that way?
cored has quit [Ping timeout: 240 seconds]
<NemesisD> before the code was using Virtus::Attribute.build(:a, [Virtus::Attribute::Boolean]), which doesn't work anymore, not sure if those are equivalent
skade has quit [Quit: Computer has gone to sleep.]
cored has joined #rom-rb
cored has joined #rom-rb
<NemesisD> looks like it works if i use TrueClass instead of Virtus::Attribute::Boolean
<NemesisD> and Axiom::Types::Boolean
misfo has quit [Ping timeout: 250 seconds]
skade has joined #rom-rb
snusnu has quit [Quit: Leaving.]
misfo has joined #rom-rb
<misfo> jfredett: you asked about the use case - if a script is using a bunch of constants that are deeply nested, it would be convenient not to have to type the namespace over an over again
<jfredett> misfo: yah, there's no convenient way to get around it -- though in limited-use scripts I have done dirty things like NS = Common::Chunk::Of::Namespace, so I can just do NS::Whatever
<misfo> yeah, that's the best work around i've seen
<misfo> seems weird, though, that there's a way to define singleton methods on main but there's not a way to add all methods from a module as singleton methods
<misfo> because that's what `extend` does inside a class definition, in my understanding
<jfredett> well, sortof
<jfredett> the effect is 'equivalent' -- but really it alters the Ancestor Heirarchy
<jfredett> include adds <YourModule> to the class's ancestors, extend adds it to the eigenclasses' ancestors
<misfo> right, so shouldn't `extend Some::Module` at the top-level of a file add that module to `main`'s eigenclass and therefor make any constants in that module available at the top-level?
<jfredett> main is just Object
<jfredett> the constants should be available at the top level
<jfredett> but they'll also be in Object
<jfredett> because main is object
<jfredett> because ruby is weird
<misfo> agreed
skade has quit [Quit: Computer has gone to sleep.]
<misfo> jfredett: okay now it make a bit more sense: extend makes the method available but not the constants https://gist.github.com/misfo/6798129
skade has joined #rom-rb
skade has quit [Client Quit]
<jfredett> hmm
<jfredett> weird
<jfredett> what if you did class << self + include? does that change the semantics? (it shouldn't)
<misfo> nope, same thing
<jfredett> good.
<jfredett> I wonder if include doesn't pull in the constants either
<jfredett> maybe constants just don't come along
<misfo> include at the top-level makes the contants available at the top-level because it pulls the constants into Object
zekefast has joined #rom-rb
<jfredett> hmm
jfredett has quit [Remote host closed the connection]
knowtheory has quit [Read error: Operation timed out]
knowtheory has joined #rom-rb
kleech has joined #rom-rb
kleech has quit [Remote host closed the connection]
postmodern has joined #rom-rb
breakingthings has quit []
misfo has quit [Ping timeout: 250 seconds]
knowtheory has quit [Quit: Computer has gone to sleep]
knowtheory has joined #rom-rb
knowtheory has quit [Ping timeout: 246 seconds]
snusnu has joined #rom-rb
zekefast has quit [Quit: Leaving.]