ivanoats has quit [Remote host closed the connection]
torrieri has quit [Quit: Leaving...]
sush24 has joined #ruby-lang
ddd has joined #ruby-lang
psyanid3 has joined #ruby-lang
huydx has joined #ruby-lang
psyanid3 has quit [Client Quit]
torrieri has joined #ruby-lang
ryanf has quit [Ping timeout: 250 seconds]
sush24 has quit [Quit: Leaving]
tomzx_mac has joined #ruby-lang
TTilus has quit [Ping timeout: 264 seconds]
t0h has quit [Ping timeout: 264 seconds]
TTilus has joined #ruby-lang
t0h has joined #ruby-lang
bzalasky has joined #ruby-lang
Axsuul has joined #ruby-lang
apeiros_ has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 248 seconds]
pr0ton has quit [Ping timeout: 248 seconds]
Honeycomb has quit [Quit: Leaving.]
Honeycomb has joined #ruby-lang
Honeycomb has quit [Client Quit]
srbaker has quit [Quit: Computer has gone to sleep.]
gregmoreno has joined #ruby-lang
soypirate_ has joined #ruby-lang
mercwithamouth has joined #ruby-lang
apeiros_ has quit [Ping timeout: 245 seconds]
gregmoreno has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 248 seconds]
nXqd has joined #ruby-lang
ryanf has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
ryanf has quit [Ping timeout: 255 seconds]
sush24 has joined #ruby-lang
intellitech has quit [Ping timeout: 248 seconds]
Kichael has joined #ruby-lang
torrieri has joined #ruby-lang
nXqd has quit [Ping timeout: 256 seconds]
nibbo has quit [Read error: Operation timed out]
chendo_ is now known as chendo
io_syl has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
ryanf has joined #ruby-lang
sush24 has joined #ruby-lang
randallagordon has quit [Quit: leaving]
randallagordon has joined #ruby-lang
nibbo has joined #ruby-lang
bluepojo_ has joined #ruby-lang
datanoise has joined #ruby-lang
ryanf has quit [Ping timeout: 276 seconds]
JohnBat26 has joined #ruby-lang
postmodern has quit [Quit: Leaving]
Honeycomb has joined #ruby-lang
bluepojo has quit [Ping timeout: 276 seconds]
postmodern has joined #ruby-lang
bluepojo_ has quit [Ping timeout: 257 seconds]
postmodern has quit [Remote host closed the connection]
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
r0bgleeson has quit [Ping timeout: 240 seconds]
apeiros_ has joined #ruby-lang
soahccc has quit [Ping timeout: 255 seconds]
eval-in has quit [Ping timeout: 245 seconds]
jarib has quit [Ping timeout: 250 seconds]
mistym has quit [Remote host closed the connection]
postmodern has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
sush24 has quit [Ping timeout: 252 seconds]
cyri_ has joined #ruby-lang
ilyam has joined #ruby-lang
apeiros_ has quit [Ping timeout: 248 seconds]
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
soahccc has joined #ruby-lang
sush24 has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
eval-in has joined #ruby-lang
jarib has joined #ruby-lang
jarib has quit [Changing host]
jarib has joined #ruby-lang
ryanf has joined #ruby-lang
jMCg has quit [Ping timeout: 255 seconds]
ryanf has quit [Ping timeout: 245 seconds]
Kuukunen has quit [Ping timeout: 245 seconds]
soypirate_ has quit [Read error: Operation timed out]
runeb has joined #ruby-lang
soypirate has quit [Ping timeout: 272 seconds]
Kuukunen has joined #ruby-lang
sebasoga has joined #ruby-lang
runeb has quit [Ping timeout: 248 seconds]
sebasoga has quit [Read error: Connection reset by peer]
jMCg has joined #ruby-lang
swav_ has quit [Remote host closed the connection]
sebasoga has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
robbyoconnor has joined #ruby-lang
bzalasky has joined #ruby-lang
apeiros_ has joined #ruby-lang
Domon has quit [Remote host closed the connection]
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
torrieri has joined #ruby-lang
datanoise has quit [Ping timeout: 255 seconds]
sebasoga has quit [Ping timeout: 248 seconds]
sebasoga has joined #ruby-lang
Honeycomb has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
Banistergalaxy has quit [Ping timeout: 250 seconds]
Banistergalaxy has joined #ruby-lang
sebasoga has quit [Ping timeout: 252 seconds]
apeiros_ has quit [Ping timeout: 256 seconds]
sebasoga has joined #ruby-lang
chendo has quit [Ping timeout: 240 seconds]
ryanf has joined #ruby-lang
chendo_ has joined #ruby-lang
sush24 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
madish has quit [Quit: ChatZilla 0.9.90 [Firefox 16.0.1/20121026125834]]
bluepojo has joined #ruby-lang
bluepojo has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
ryanf has quit [Ping timeout: 255 seconds]
mistym has joined #ruby-lang
bluepojo has joined #ruby-lang
datanoise has joined #ruby-lang
kgrz has joined #ruby-lang
bluepojo has quit [Ping timeout: 255 seconds]
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
tomzx_mac has quit [Read error: Operation timed out]
dhruvasagar has quit [Ping timeout: 252 seconds]
apeiros_ has joined #ruby-lang
sepp2k has joined #ruby-lang
apeiros_ has quit [Ping timeout: 248 seconds]
kgrz has quit [Quit: Computer has gone to sleep.]
datanoise has quit [Ping timeout: 252 seconds]
ryanf has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<RickHull>
is there a preferred convention for minitest/spec files
<RickHull>
and running them
<RickHull>
when i first hack my tests, i usually put them in a __FILE__ == $0 inside the lib
<RickHull>
is it better to maintain them separately, like in a toplevel /spec ?
<RickHull>
and then what is the way to run them?
Domon has joined #ruby-lang
<RickHull>
rspec has some handy conventions that I don't recall the exact details
<RickHull>
i'm wondering if minitest/spec has similar, or just punts to minitest/autorun and maybe a rake task?
ivanoats has quit [Remote host closed the connection]
datanoise has joined #ruby-lang
<RickHull>
i'm thinking a spec or tests dir at toplevel, require 'minitest/autorun' and then just: ruby spec/*.rb
havenwood is now known as info
info is now known as havenwood
swav has joined #ruby-lang
ryanf has quit [Ping timeout: 276 seconds]
rippa has joined #ruby-lang
swav has quit [Ping timeout: 248 seconds]
kgrz has joined #ruby-lang
iamjarvo has quit [Quit: Leaving.]
benlovell has joined #ruby-lang
apeiros_ has joined #ruby-lang
benlovell has quit [Client Quit]
noop has joined #ruby-lang
cyri_ has quit [Quit: cyri_]
kgrz has quit [Quit: Computer has gone to sleep.]
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
iamjarvo has joined #ruby-lang
sailias has joined #ruby-lang
kgrz has joined #ruby-lang
NemesisD has joined #ruby-lang
apeiros has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
xalei has quit [Read error: Connection reset by peer]
apeiros_ has quit [Ping timeout: 252 seconds]
<NemesisD>
i'm trying to write a method that given the string Product, it will check descendents of Repository for a ProductRepository or return Repository
slyphon has joined #ruby-lang
slyphon has quit [Client Quit]
<NemesisD>
best implementation i have is def foo(klass); Repository.const_get("#{klass}Repository"); rescue NameError; Repository; end. kinda gross and doesn't do descendants technically
ryanf has joined #ruby-lang
mjio has quit []
mjio has joined #ruby-lang
intellitech has joined #ruby-lang
<RickHull>
blech
slyphon has joined #ruby-lang
<RickHull>
unwind the stack a bit. we shouldn't ever have to write such a method
<NemesisD>
i'm trying to do something of a repository pattern, separating data from persistence
<NemesisD>
currently you use it something like: repo = Repository.new(conn_pool); repo[MyModel].find(123), [] initializes a generic ModelRepository for that class which knows the bucket for it
<NemesisD>
but lets say MyOtherModel supports some additional querying methods, you'd want to have a class MyOtherModelRepository, so you could do repo[MyOtherModel].find_by_some_weird_stuff
gix has quit [Ping timeout: 248 seconds]
<NemesisD>
if there's a nicer separate repository pattern i'd like to see it. stole this design from the first gem i found
<RickHull>
this seems like reinventing inheritance, badly
ryanf has quit [Ping timeout: 245 seconds]
<RickHull>
i'm not familiar with the "repository pattern" though. what's the basic idea, separating data from persistence?
<RickHull>
can we just think of the repo as a hash for a moment?
<RickHull>
you want to pass it a key of some sort, and get back an object?
gix has joined #ruby-lang
<NemesisD>
RickHull: im not that familiar either, but yes, i want persistence completely separate from data. and yes, you'd pass it a key and get back an object. the trick is that i think you need a different repo for Foo than for Bar because they would look in different buckets
datanoise has quit [Ping timeout: 264 seconds]
iamjarvo has quit [Quit: Leaving.]
sebasoga has quit [Ping timeout: 240 seconds]
<RickHull>
constructing class names just feels like an antipattern
<NemesisD>
RickHull: yeah. i agree it feels gross. but i haven't figured out a way yet of having bucket-specific retrieval methods
rippa has quit [Ping timeout: 240 seconds]
<NemesisD>
i'm looking into the Data Mapper pattern, sadly, DataMapper itself doesn't implement it
sebasoga has joined #ruby-lang
slyphon has quit [Quit: slyphon]
<RickHull>
frankly, i wouldn't worry too much about this layer. you can encapsulate your core logic by working on atomic data, method parameters. then you just have an adapter to provide the data from different sources
<RickHull>
a single method, used by convention
<RickHull>
as a primitive example
toretore has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
<RickHull>
e.g. feed your object with #import(foo, bar, baz)
sebasoga has joined #ruby-lang
<NemesisD>
RickHull: import? are foo, bar, baz different types?
<RickHull>
sorry, it's late and this may be a terrible idea
sebasoga has quit [Read error: Connection reset by peer]
rippa has joined #ruby-lang
<RickHull>
but let's say you have a Product with an @id, @sku, @desc, @img
<NemesisD>
ok
sebasoga has joined #ruby-lang
dhruvasagar has joined #ruby-lang
sebasoga_ has joined #ruby-lang
<RickHull>
you can make this independent of your data layer by feeding Product.new(id, sku, desc, img) and strictly using that interface
<RickHull>
or even Marshal.dump and undump
sebasoga_ has quit [Read error: Connection reset by peer]
<RickHull>
like, you probably don't want to do Product.save!
sebasoga has quit [Read error: Operation timed out]
<RickHull>
more like save!(product)
sebasoga has joined #ruby-lang
<RickHull>
and save! will call product.export and decide what to do with an array of parameters
<NemesisD>
RickHull: that inversion of control, with save!(product) seems to be the foundation for the repository and data mapper patterns i think
<NemesisD>
it looks like the gem Curator may do this
<RickHull>
yeah i mean i'm not really happy with what i've said. i'm kind of spitballing here
sebasoga has quit [Read error: Connection reset by peer]
<RickHull>
i totally agree that you want to separate your logic from persistence
sebasoga has joined #ruby-lang
<NemesisD>
RickHull: yeah, on a daily basis i chafe with activerecord, but the real reason is that i'm looking at the viability of using a KV store for this app, so there is some degree of trickery that must go on for a few of the queries. AR is the wrong choice
mjio has quit []
sebasoga has quit [Read error: Connection reset by peer]
<RickHull>
your data may be tied to your persistence, but if not, i would aim for method signatures as your main interface. like, i don't care how you get them, but give me these 6 parameters
countdigi has quit [Ping timeout: 246 seconds]
sebasoga has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
<RickHull>
are you sure something like DataMapper isn't sufficient?
<NemesisD>
RickHull: that's next on my list. i've heard rumor datamapper 2 might have something to do with the actual data mapper pattern
<RickHull>
i wouldn't worry about GoF design patterns
sebasoga_ has joined #ruby-lang
<RickHull>
fowler etc.
<RickHull>
they are targeting a much more primitive ecosystem of languages
countdigi has joined #ruby-lang
<NemesisD>
yeah but the core concept is solid, peristence being a separate responsibility and thus a separate class
<RickHull>
your primary concern should be, what is the problem and what are the requirements and how can i meet them
nXqd has joined #ruby-lang
sebasoga has quit [Ping timeout: 252 seconds]
Honeycomb has joined #ruby-lang
<tsou>
trying to install rvm. installation halts and the error seems to be a permission denied, because it's trying to write to /bin/ruby. Any idea why it'd do that?
sebasoga has joined #ruby-lang
ryanf has joined #ruby-lang
<RickHull>
paste the error, multiline on a paste site
sebasoga_ has quit [Ping timeout: 256 seconds]
<RickHull>
NemesisD: are you familiar with maglev / gemstone? they provide a persistent object repository
<RickHull>
i think it's an interesting paradigm. but hardly necessary
<NemesisD>
RickHull: of course. the problem is that i like testing simple objects. my models represent inert data. persistence is gonna get weird in some places so i want that elsewhere
sebasoga has quit [Read error: Connection reset by peer]
<RickHull>
NemesisD: i totally agree with your last statement
<RickHull>
nothing i am saying is in conflict with that
<NemesisD>
i've seen a few presentations about it, enough to keep me away from using it for anything, but they didn't discuss the object repository in any detail
<yorickpeterse>
brixen: just a small heads up, thanks for making `rbx compile` and in particular the ability to dump the bytecode. That in combination with the Bytecode docs of Rbx have been tremendously useful for me so far.
Banistergalaxy has quit [Ping timeout: 248 seconds]
MaddinXx has quit [Remote host closed the connection]
sush24_ has joined #ruby-lang
benlovell has quit [Quit: Computer has gone to sleep.]
sush24 has quit [Ping timeout: 250 seconds]
hasimo has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
postmodern has quit [Quit: Leaving]
S1kx has quit [Ping timeout: 245 seconds]
tbuehlmann has quit [Quit: Quitting.]
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
emocakes has quit [Quit: emocakes]
marr has joined #ruby-lang
KU0N has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
sush24_ has quit [Quit: This computer has gone to sleep]
cored has quit [Ping timeout: 260 seconds]
io_syl has joined #ruby-lang
beho_ has joined #ruby-lang
Squarepy has joined #ruby-lang
beho has quit [Read error: Operation timed out]
Squarepy has quit [Changing host]
Squarepy has joined #ruby-lang
cored has joined #ruby-lang
charliesome has joined #ruby-lang
cultureulterior has joined #ruby-lang
RickHull has left #ruby-lang [#ruby-lang]
dhruvasagar has quit [Ping timeout: 260 seconds]
cyri_ has joined #ruby-lang
xalei has joined #ruby-lang
Domon has quit [Remote host closed the connection]
<whitequark>
are there private module functions?
plusk has joined #ruby-lang
woollyams has joined #ruby-lang
woollyams has quit [Remote host closed the connection]
jxie has quit [Quit: leaving]
<apeiros_>
whitequark: what do you consider a "private module function"?
<apeiros_>
module_function's create a private instance and public class method
<whitequark>
apeiros_: but what if I want a private class method?
cored has quit [Ping timeout: 276 seconds]
<apeiros_>
private_class_method :foo
<whitequark>
say I have some public module functions and some more as helpers to them
<whitequark>
oh cool, thanks!
nXqd has quit [Quit: leaving]
nXqd has joined #ruby-lang
<whitequark>
hah. compared to `extend self`, that is too much of a mess
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
hasimo has joined #ruby-lang
* apeiros_
thinks extend self is an anti-pattern
<judofyr>
whitequark: if someone includes it, they'll have access to every method though
<apeiros_>
a module's instance methods which are also available as class methods should be private. they're obviously pseudo-functions and should not be callable from outside.
Criztian has joined #ruby-lang
<apeiros_>
with extend self, you either have public instance methods (bad), private class methods (useless), or have to manually mark the class methods as public after the extend self (ugly)
<whitequark>
apeiros_: I agree with you
<apeiros_>
yay! :D
hasimo has quit [Ping timeout: 276 seconds]
<whitequark>
that's why I tried to remove extend self in the first place
<whitequark>
but that produced a huge mess with private_class_method and it's ugly
<whitequark>
also I never include that module anywhere
<apeiros_>
:-/
<whitequark>
yeah
<judofyr>
I guess you can add "real" private method in modules that are intended to be included with define_method + blocks
<apeiros_>
I don't think the frequency of that case can be legitimately estimated
<apeiros_>
it gets worse for cases where the second last argument can be anything
MaddinXx_ has joined #ruby-lang
<pabloh>
whitequark, I think the worst problem is when you pass a single argument without knowing its type then you dont know how many arguments u are actually passing unless u can actually thell if the argument is a Hash or not
<apeiros_>
such cases will work differently depending on what kind of object you pass - if it's a hash, it suddenly works differently
<pabloh>
apeiros_, exactly
<apeiros_>
and the workaround is ugly - you have to know that the method accepts **keywords and then always pass an empty hash in
<whitequark>
pabloh, apeiros_: hmm, interesting
<whitequark>
let's see if this manifests itself as a problem in real world
<judofyr>
apeiros_: or don't write methods which both accepts a mandatory Hash as the last param *and* keyword argument
<pabloh>
apeiros_, even worst the first parameter could be something that happens to inhert from hash, but intented to be something completly different from a Hash
<judofyr>
we have the same problem today with Rails' extract_options!
<whitequark>
it's basically a condification of a Rails convention
<apeiros_>
judofyr: I don't even want to start with how bad that suggestion is.
<judofyr>
*optional argument as last parameter
<whitequark>
apeiros_: it's actually a nice suggestion. because right now such methods already pose a problem
<apeiros_>
no it's not.
<apeiros_>
it says having a hash argument other than as keywords is not legitimate.
MehLaptop has quit [Remote host closed the connection]
<apeiros_>
and that's borderline stupid
gjaldon has quit [Remote host closed the connection]
<judofyr>
apeiros_: it's the combination
<apeiros_>
same
<judofyr>
apeiros_: mixing hashes and keywords are always going to be messy in Ruby 2.0 because they are the same
<judofyr>
it was a trade-off
<apeiros_>
it was the same in 1.9 too and they managed to not fuck it up
<apeiros_>
not that the 1.9 solution was nice. but at least it was not *broken*.
<pabloh>
apeiros_, judofyr, whitequark , I updated the gist if it you inherit from hash you have the same problem
shirokuro11 has joined #ruby-lang
<whitequark>
I'm not sure if one should inherit from Hash at all
<pabloh>
whitequark, maybe not
<pabloh>
whitequark, but in the real world peple does it
<judofyr>
bad real world people
<whitequark>
pabloh: that's not an argument. people do stupid things
<pabloh>
hahah
<whitequark>
you can also set $, or how is it called
S1kx has quit [Ping timeout: 255 seconds]
<whitequark>
doesn't mean it's a bad idea
gix has quit [Ping timeout: 245 seconds]
<whitequark>
(a global variable which magically changes how split() works)
<pabloh>
there are many exambles out there were you have classes inheriting from Array or Hash
<pabloh>
you can't ignore that
<pabloh>
examples*
Mon_Ouie has joined #ruby-lang
<judofyr>
apeiros_: I still don't see why they're broken. what error would you expect with: foo(something: 'else')? do you still want that to give you an empty kw-hash and `value` to the Hash?
<judofyr>
apeiros_: there's always going to be edge cases here.
nkr has joined #ruby-lang
sailias has joined #ruby-lang
<apeiros_>
judofyr: sorry, I don't buy that.
gix has joined #ruby-lang
wallclockbuilder has quit [Read error: Connection reset by peer]
<judofyr>
apeiros_: buy what?
<apeiros_>
"there's always gonna be" is a lame ass argument.
wallclockbuilder has joined #ruby-lang
<judofyr>
apeiros_: you didn't answer my question: what behavior do you want for foo(something: 'else')? ArgumentError or assigning `value`?
<apeiros_>
depends
<judofyr>
on what? :S
<apeiros_>
it's nice that you expect a solution from me on a whim for something other people had many months to think about…
<apeiros_>
intuitively I'd probably say: reserve {}-less use for keyword-args. hence ArgumentError
<apeiros_>
and I'd use syntax to convert a hash-object to keyword args
dustint has joined #ruby-lang
<judofyr>
apeiros_: it's nice that you claimed it was *broken* after looking at it for 2 seconds :)
<apeiros_>
judofyr: a bug is MUCH faster to be spotted than figuring out how to fix it
<whitequark>
apeiros_: this bug :)
<judofyr>
apeiros_: that's not backwards compatible though
<apeiros_>
judofyr: d'uh
<apeiros_>
so you rather have a shitty broken solution? bad trade IMO.
<apeiros_>
anyway, lunch time is over
<judofyr>
apeiros_: as in: if we now have code that runs `image_tag(options)`, then I couldn't refactor #image_tag in 2.0 to use kw without also changing all caller sides
hasimo has quit [Remote host closed the connection]
<judofyr>
apeiros_: well, that was what matz decided :)
<judofyr>
apeiros_: he's really scared for something like Python3 or Perl6 happening to Ruby
<judofyr>
so compat was *very* important
S1kx has joined #ruby-lang
<whitequark>
apeiros_: shitty broken solution is way better than version which no one uses
<whitequark>
pretty much everything which is actually used is shitty and broken
<whitequark>
that's life :)
<judofyr>
apeiros_: I'm just tired of people saying that something is "broken" when it's been solved decently under the given constraints (and it's actually the *constraints* they disagree with)
<judofyr>
see also: encodings in Ruby
srbaker has joined #ruby-lang
dhruvasagar has joined #ruby-lang
kain has quit [Quit: exit]
<apeiros_>
judofyr: it doesn't matter whether it's the constraints or the implementation itself. it doesn't change anything about it being broken.
kain has joined #ruby-lang
yalue has joined #ruby-lang
<apeiros_>
and you're pretending that you knew that it is impossible to have it backwards compatible without breaking. you don't. all you do know is that you don't know how to comply with the constraints and still not breaking it.
<judofyr>
apeiros_: it's hard to discuss when "broken" basically means "I don't like this behavior" :/
srbaker has quit [Quit: Computer has gone to sleep.]
<apeiros_>
oh wow
<apeiros_>
sorry, but fuck you. seriously. it was not "I don't like this behavior". this is an asstastic move.
apeiros_ has left #ruby-lang [#ruby-lang]
<whitequark>
judofyr: the problem with encodings is that no, they aren't solved "decently"
<whitequark>
not by comparison with kwargs, which IMO are
<whitequark>
encodings have a ton of really weird corner cases which simply aren't justified by *anything*
<whitequark>
haha, apeiros ragequit
<whitequark>
lol.
<judofyr>
whitequark: people keep telling me that, but I haven't noticed that many corner cases…
shirokuro11 has quit [Ping timeout: 272 seconds]
<whitequark>
judofyr: ask anyone on #rbx.
<whitequark>
but prepare for a shitstorm
schroedinbug has joined #ruby-lang
sailias has quit [Ping timeout: 248 seconds]
ikst has joined #ruby-lang
kurko_ has joined #ruby-lang
<dbussink>
judofyr: this is a funny one if you use gsub() with a block and use a string with different encoding whether it works depends on whether you replace characters in the old string not valid in the encoding of the block's return value
<dbussink>
judofyr: s originally has encoding utf-8 there
xalei has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
fire has joined #ruby-lang
r0bgleeson has joined #ruby-lang
<judofyr>
dbussink: interesting. have you considered opening feature-request for changing these behaviors? I imagine some of these edge cases could have been made more consistent in a 2.0/2.1-release
<dbussink>
judofyr: a few issues have opened
iamjarvo has joined #ruby-lang
<dbussink>
problem is that so much code in the wild starts to depend on behavior like this
<dbussink>
even if it's not specified behavior perse, but it becomes that de facto
<dbussink>
which is one of the biggest annoyances of encodings
<dbussink>
it hasn't been designed that well and now we're stuck with how it works
barttenbrinke has joined #ruby-lang
<darix>
dbussink: you make it sound like encodings were added to make our life easier :p
<dbussink>
judofyr: but often the response is also "this is how it should work" and you have to mimic it all
<dbussink>
darix: you would think yeah :P
<dbussink>
judofyr: oh, and one thing, every object can have an encoding, not just strings
<dbussink>
and yes, there is code that depends on that...
<judofyr>
dbussink: hm: example of other objects having encodings?
<dbussink>
judofyr: the pg gem sets an encoding on the connection
<dbussink>
and uses that to set encodings on resulting strings
<Rarrikins_e>
Ahh, OK. I'll check that out. Thanks.
<Paradox>
syntax error, unexpected $end, expecting ')'...))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/) do |m|
<Rarrikins_e>
Paradox: It's better to use a library for that. Even popular regexes are usually not fully valid. I hate how so many sites can't handle plusses in e-mail addresses.
<Paradox>
sigh damnit, ok
<Paradox>
i was hoping to keep the dependencies down
<Rarrikins_e>
Oh, I see.
<Paradox>
the problem is
<Paradox>
im getting user inputted strings
<Paradox>
and i want to take them all and run em through a shortener
<Paradox>
its for a reddit sidebar bot
<Paradox>
but they can be ANYWHERE in the text
<Rarrikins_e>
Oh, OK
robbyoconnor has quit [Max SendQ exceeded]
<Paradox>
and i don't want to have to load something like redcarpet just to shoreten urls
<Paradox>
lectrick, heh, thanks, but i'm using URI.regexp
<Paradox>
mehwork, .second comes from activesupport, which is a part of rails
<mehwork>
Paradox: i see, does that mean it makes a .third too?
<Paradox>
i dont believe so
<Paradox>
you really dont need those anyway
<Paradox>
they're convenience methods
<Paradox>
better to use [0], [1], and [-1]
tonni has joined #ruby-lang
<mehwork>
it's not more conventional to use a.last instead of a[-1] in ruby?
<lectrick>
Paradox: Heh, I duplicated it apparently. And, I think, possibly improved it, although I'd have to rework it to use the same API. But... cheers!
Swimming_Bird has joined #ruby-lang
<lectrick>
Is it possible to capture a non-matching group in regex?
Swimming_Bird has quit [Max SendQ exceeded]
<mehwork>
yep
breakingthings has quit []
<lectrick>
Syntax example?
Swimming_Bird has joined #ruby-lang
<Paradox>
hrm
<Paradox>
i didnt think ) could be in urls
<Paradox>
guess i was wrong
<mehwork>
lectrick: negative lookahead (?!) iirc
<mehwork>
to match a q not followed by a u: q(?!u)
<mehwork>
to match everythig except if it contains foo: ^(?!.*foo*).*$
maxmanders has quit [Quit: Computer has gone to sleep.]
<mehwork>
knowing ruby, there's probably convenience methods that can hold the non matches too
mrsolo has joined #ruby-lang
<lectrick>
yeah, but I want to capture something that doesn't actually match the next character.
<lectrick>
basically, I want a regex that when set upon a string 'a', $1 returns 'b'
<mehwork>
doesn't sound like a job for a regex to me
<mehwork>
but i'm no regexpert
davidbalbert is now known as davidbalber|away
pepper_chico has quit [Quit: Computer has gone to sleep.]
benanne has joined #ruby-lang
<andrewvos>
Gah someone write me a blurb for the beginning of my cv
<mehwork>
andrewvos: See my gitub: <url>
ilyam has quit [Read error: Connection reset by peer]
benlovell has quit [Quit: Zzz]
<mehwork>
github
mrsolo has left #ruby-lang [#ruby-lang]
<andrewvos>
mehwork: People want more bullshitty stuff
<mehwork>
only bullshitty people
<lectrick>
mehwork: yeah, I am just curious to see if it is possible. "if the next character is a, capture a b, but don't match on it"
ilyam has joined #ruby-lang
<mehwork>
not any cool company you'd wanna work for
<andrewvos>
I'm a contractor, the people I'm targetting don't know what the git hubs are
<mehwork>
then for those people just put "Rock star PHP guru"
<yorickpeterse>
and convert it to PDF using pandoc
* yorickpeterse
brushes neckbeard
<mehwork>
linkedin doesn't show your profile publically
<yorickpeterse>
`pandoc CV.md --variable mainfont=Georgia --latex-engine=xelatex -o build/CV.pdf` to be exact
<yorickpeterse>
neckbeard++
tdy_ has joined #ruby-lang
<mehwork>
zzak they get ahold of it and once one recruiter gets ahold of your resume, via dice.com, or anywhere you publish it, it ends up in ALL of their databases forever
<mehwork>
and whats worse is if you don't update it, then 4 years later you get all kinds of stupid spam for lower paying jobs doing outdated stuff
<mehwork>
whatever you do, don't put your phone number in it. It's bad enough getting email spam. THe worst is when you're at work all day and having recruiters call your cellphone
<zzak_>
yeh, dont publish it
brianpWins has quit [Quit: brianpWins]
<zzak_>
nothing wrong with having one tho
ilyam has quit [Quit: ilyam]
robbyoconnor has quit [Max SendQ exceeded]
<mehwork>
whenever I answer my phone and hear "Hi, is this mehwork?" I respond "Hi, is this a recruiter?". That's how many times they call me
robbyoconnor has joined #ruby-lang
<mehwork>
I don't know. I just wouldn't want any job that cared about a resume. Sounds like a boring corporate place. All the jobs i've had that needed one sucked hard and all the ones that didn't were awesome
<zzak_>
dont give out your cell phone and get a separate line for your office
<mehwork>
I'm sure there are exceptions. If someone really wnated a resume I'd just print out paste my linkedin to a file and print it