<freedrull>
then maybe rails could go ahead and refine Date.today and other libraries would not have a problem
retro|cz has joined #ruby-lang
<freedrull>
hmm nah nevermind
Domon has joined #ruby-lang
jonahR has quit [Read error: Connection reset by peer]
jonahR has joined #ruby-lang
retro|cz has quit [Ping timeout: 272 seconds]
martynas has joined #ruby-lang
martynas is now known as Guest96043
rippa has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
havenn has joined #ruby-lang
ledestin has joined #ruby-lang
<ledestin>
Are there stable ruby gems like Debian stable? Or is it just constantly rolling and if you want a security update, you're bound to follow the latest versions and potentially break your site?
<ledestin>
your program as well
<drbrain>
ledestin: good maintainers follow good release practices
<ledestin>
drbrain: for example?
<drbrain>
rails
<havenn>
ledestin: Generally, gems are released with semantic versioning. So you can safely update based on selecting the appropriate point release.
Banistergalaxy has quit [Ping timeout: 245 seconds]
wobblini has joined #ruby-lang
Vektur has quit [Ping timeout: 264 seconds]
<apeiros_>
whitequark: what's required kwargs do?
<apeiros_>
i.e., where should kwargs be required?
<whitequark>
apeiros_: def foo(bar:, baz: 1)
<apeiros_>
ah, make it possible to require a kwarg
<whitequark>
apeiros_: exactly
<apeiros_>
if they hadn't overeagerly introduced the foo: bar hash syntax, they could have had all of that cheaply
<apeiros_>
def foo(bar, baz=1) --> foo bar: 2, baz: 3
<apeiros_>
well, too late to whine
<whitequark>
apeiros_: that would require abolishing positional arguments and/or making the parsing work like in python
<apeiros_>
don't know about the latter, but the former is not true
<whitequark>
the problem is that the current **kwargs approach permits composition, i.e. forwarding of both positional and keyword arguments, without too complex logic to differentiate
<apeiros_>
foo(2, baz: 3) --> bar,baz = 2,3
<whitequark>
not sure about your one
<whitequark>
apeiros_: yeah, that's how python does it
<apeiros_>
foo(2, bar: 3) --> bar, baz = 3,2
<apeiros_>
i.e., you consume the named ones first, then the rest is processed as it has been in 1.9. **kwargs consumes unassignable kwargs.
<apeiros_>
I don't want to know the performance implications, though :)
sush24 has joined #ruby-lang
GarethAdams|Work has joined #ruby-lang
GarethAdams has quit [Ping timeout: 264 seconds]
GarethAdams|Work has quit [Ping timeout: 260 seconds]
MehLaptop has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
<whitequark>
apeiros_: uh
<whitequark>
your very example (second one) is a reason *not* to use this
* whitequark
already dislikes 1.9 postargs, to a certain extent
<yorickpeterse>
"more arguments" are the best ones
<yorickpeterse>
*eval is a truly amazing, web scale and thread safe solution
<yorickpeterse>
Why did you remove it?
<whitequark>
except it doesn't work with rails because rails lazily creates callback methods, even in production
<whitequark>
even with config.threadsafe!
Domon has quit [Remote host closed the connection]
<whitequark>
how the fuck is that supposed to be threadsafe?!
<yorickpeterse>
> thread safety as an option
<yorickpeterse>
har har
<whitequark>
yorickpeterse: not anymore in 4, etc.
<yorickpeterse>
took them long enough
<whitequark>
yorickpeterse: took jruby long enough to become a viable platform
toretore has joined #ruby-lang
<whitequark>
and there isn't really a reason to have thread safety in mri
toretore has quit [Remote host closed the connection]
toretore has joined #ruby-lang
<yorickpeterse>
Oh how I long for the day that MRI has actual threads
<yorickpeterse>
but I think I'd be able to ride a unicorn before that happens
sush24 has quit [Ping timeout: 240 seconds]
<lianj>
yorickpeterse: slicing unicorn with lightsaber
cultureulterior_ has joined #ruby-lang
sush24 has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 260 seconds]
tms has joined #ruby-lang
rippa has joined #ruby-lang
tms has left #ruby-lang [#ruby-lang]
aderyabin has joined #ruby-lang
beho has quit [Remote host closed the connection]
smt has joined #ruby-lang
smt has left #ruby-lang [#ruby-lang]
Mon_Ouie has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
tomzx_mac has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
fire is now known as megha
faces has joined #ruby-lang
drumsrgr8forn8 has joined #ruby-lang
segfault_ has joined #ruby-lang
rondale_1c has joined #ruby-lang
xalei has joined #ruby-lang
segfault_ has left #ruby-lang [#ruby-lang]
pryno has joined #ruby-lang
SubSpawn has joined #ruby-lang
Guu has joined #ruby-lang
sebasoga_ has quit [Ping timeout: 240 seconds]
anildigital_work has quit [*.net *.split]
cmckni3 has quit [*.net *.split]
face has quit [*.net *.split]
Spaceghost|cloud has quit [*.net *.split]
SubSpawnLnx has quit [*.net *.split]
drbrain has quit [*.net *.split]
jayne has quit [*.net *.split]
antbody has quit [*.net *.split]
bryno has quit [*.net *.split]
MrWGW- has quit [*.net *.split]
wasnotrice has quit [*.net *.split]
rondale_sc has quit [*.net *.split]
Spaceghost|cloud has joined #ruby-lang
<injekt>
hizzurh
<injekt>
man activerecord sucks at advanced queries
rippa has quit [Ping timeout: 240 seconds]
<injekt>
and #ror makes me want to punch kittens, anyone here good with the ar query interface (or perhaps arel?)
bluepojo has quit [Read error: Connection reset by peer]
drbrain has joined #ruby-lang
techlife has quit [Ping timeout: 250 seconds]
judofyr has joined #ruby-lang
bluepojo has joined #ruby-lang
beiter has joined #ruby-lang
<whitequark>
injekt: activerecord *rules* at advanced queries
<whitequark>
I am. You can ask.
<injekt>
haha, ok then I suck at them with AR
gnufied1 has joined #ruby-lang
<injekt>
'SELECT * FROM contacts WHERE imported_at = (SELECT MAX(imported_at) from contacts)'
<injekt>
I thought Contact.where(imported_at: Contact.maximum(:imported_at)) might know what to do, but alas maximum returns the native type object rather than anything arel can use
<injekt>
so yeah, this isn't even really very advanced.. I have ones that at harder than this
gnufied has quit [Ping timeout: 245 seconds]
sebasoga has joined #ruby-lang
techlife has joined #ruby-lang
<judofyr>
whitequark: have you tried Sequel?
barttenbrinke has joined #ruby-lang
<injekt>
sequel does stuff like this easily
<injekt>
well, a little more easily
<judofyr>
yeah, I'm also a big fan of Sequel :)
jayne has joined #ruby-lang
<whitequark>
judofyr: somewhat
<whitequark>
not much
<injekt>
yeah I like it, one thing I didn't like about it was doing AS stuff, way too many underscores
Mon_Ouie has quit [Remote host closed the connection]
<whitequark>
pass the posts... (without to_sql) to the where(imported_at: ...) and you're done
Mon_Ouie has joined #ruby-lang
<injekt>
whitequark: ahh, what's #project ? I had the same with without that and was getting pg errors
<whitequark>
injekt: #project is what constructs you a (sub)query
<whitequark>
.maximum just creates a lone expression
<injekt>
yeah I know the .maximum part I didn't know of project which is probably why I was having issues before
sebasoga has quit [Ping timeout: 272 seconds]
<whitequark>
injekt: there is exactly zero magic in arel, it's just a constructor of queries which allows for composability
<whitequark>
awesome and simple thing
sebasoga has joined #ruby-lang
<injekt>
whitequark: neat, thanks a lot, want to see the harder one I've been trying to work on building in a single query?
<whitequark>
injekt: yea, but I'd only be able to get some time in a few hours
<injekt>
whitequark: sure I've been trying to hit it for a while, you don't need to write it for me but any tips would be awesome https://gist.github.com/injekt/cd0d27e810f85099be08 I basically want a subquery with a join
<ddfreyne>
drbrain: Rubygems 2.0.3 does not include the 2.0.3 release notes
<jtoy>
can anyone recommend a simple way to parse this into 4 groups: o="\"users.stats\" \"id protected\" \"(= protected true)\" \"true\""
srbaker has quit [Quit: Computer has gone to sleep.]
<whitequark>
injekt: ok, I can look at your query now
<whitequark>
do you use postgres?
<whitequark>
(I guess you do)
banisterfiend has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
<maxmanders>
So, everything's an object in Ruby, so Array.grep(/regex/) {} must know if it's an array of Strings to search the string value… go with me on this… if you have an array of other objects, how do you specify the object property to grep on - or do you have to override .to_s to define what will be searched as the string representation of the object?
<judofyr>
jtoy: Shellwords.split(…)
<judofyr>
maxmanders: [1, 2, 3].grep(foo) is the same as: [1, 2, 3].select { |x| foo === x }
apeiros_ has quit [Remote host closed the connection]
tdy_ has quit [Read error: Operation timed out]
agile has joined #ruby-lang
pbjorklund has quit [Ping timeout: 256 seconds]
fsvehla has joined #ruby-lang
bin7me has joined #ruby-lang
<whitequark>
injekt: ok
<whitequark>
I think I've explained how you can fix it / do it with arel
<whitequark>
also you might want to look into ActiveRecord::Associations::Preloader
<whitequark>
it's for preloading complex, deeply nested associations with additional queries by id IN (...)
<injekt>
whitequark: still can't get there but working on it, i'll check that out too thanks!
pbjorklund has joined #ruby-lang
<whitequark>
without any joins/includes
<injekt>
ah neat
snarfmason has joined #ruby-lang
bin7me has quit [Client Quit]
tdy_ has joined #ruby-lang
torrieri has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
adambeynon has quit [Quit: Leaving]
fsvehla has quit [Quit: fsvehla]
<injekt>
blah i'll look at this again later, syntax is so frustrating
* whitequark
thinks it's better than MetaWhere and all the send hijacking
<whitequark>
a bit loquacious
<injekt>
heh yeah probably, I haven't used metawhere or anything similar as I also wanted to avoid it, but the arel query interface confuses the hell out of me
<whitequark>
injekt: it helps a lot to understand that it's essentially a way of string concatenation
<whitequark>
arel doesn't really do anything by itself, it just composes the stuff originating in AR, your code, etc.
<whitequark>
then sends the queyr.
havenwood has joined #ruby-lang
<injekt>
yeah
fsvehla has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
havenn_ has joined #ruby-lang
srbaker_ has joined #ruby-lang
zzak_ has joined #ruby-lang
kurko______ has joined #ruby-lang
CoverSli1e has joined #ruby-lang
srbaker has quit [Ping timeout: 264 seconds]
zzak has quit [Read error: Connection reset by peer]
kurko__ has quit [Ping timeout: 264 seconds]
dumfries has quit [Ping timeout: 264 seconds]
havenwood has quit [Ping timeout: 264 seconds]
CoverSlide has quit [Ping timeout: 264 seconds]
gianlucadv_ has quit [Ping timeout: 264 seconds]
srbaker_ is now known as srbaker
Guedes has quit [Excess Flood]
nyuszika7h has quit [Excess Flood]
sheerun has quit [Ping timeout: 264 seconds]
hachiya has quit [Ping timeout: 264 seconds]
tpope has quit [Ping timeout: 264 seconds]
hachiya_ has joined #ruby-lang
Guedes has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
rue has quit [Remote host closed the connection]
dumfries has joined #ruby-lang
cschneid has quit [Ping timeout: 264 seconds]
gianlucadv has joined #ruby-lang
nyuszika7h has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 260 seconds]
rue has joined #ruby-lang
sheerun has joined #ruby-lang
tpope has joined #ruby-lang
techlife has quit [Ping timeout: 245 seconds]
kgrz has joined #ruby-lang
jpwhiting has joined #ruby-lang
stardiviner has joined #ruby-lang
<injekt>
whitequark: yeah not getting far with this one, It's probably because I haven't written a successful version in SQL yet either so i should probably fix that first
fire has joined #ruby-lang
apeiros_ has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
<whitequark>
injekt: indeed
<jpwhiting>
hey all, trying to get obs-server running on ruby-rails 2.3.17 installed with gem install
<jpwhiting>
the web ui and rake both complain that I don't have delayed_job < 3.0 but gem list clearly shows I have delayed_job 2.1.4
<jpwhiting>
any idea what I can do to figure out why rake and the web ui both can't see delayed_job?
psycho_one has quit [Remote host closed the connection]
techlife has joined #ruby-lang
techlife has quit [Max SendQ exceeded]
megha has quit [Ping timeout: 256 seconds]
carloslopes has quit [Remote host closed the connection]
<andrewvos>
injekt: i think ive found a place to move to in Notting Hill
<andrewvos>
:)
<whitequark>
injekt: ok, I'm home
<whitequark>
can now help you with irb-proven data :D
torrieri_ has joined #ruby-lang
<Paradox>
is the eval-ing bot in #ruby as well
torrieri has quit [Read error: Connection reset by peer]
pepper_chico has joined #ruby-lang
pellis_ has left #ruby-lang [#ruby-lang]
<whitequark>
Paradox: yes
<Paradox>
whitequark, how do you trigger him again
<Paradox>
her
<Paradox>
it
<Paradox>
w/e
<Paradox>
i cant recal
lajlev has joined #ruby-lang
sush24 has quit [Ping timeout: 260 seconds]
havenwood has quit [Remote host closed the connection]
<whitequark>
>> foo
<eval-in>
whitequark => /tmp/execpad-b911b5d0a363/source-b911b5d0a363:2:in `<main>': undefined local variable or method `foo' for main:Object (NameError) (http://eval.in/12529)
<Paradox>
oh 2 >
<Paradox>
thank you
sush24 has joined #ruby-lang
srbaker has quit [Ping timeout: 245 seconds]
tylersmith has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
CoverSli1e is now known as CoverSlide
tylersmith has joined #ruby-lang
marr has quit []
oon_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
kain_ has joined #ruby-lang
srbaker has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
kain has quit [Ping timeout: 252 seconds]
headius has joined #ruby-lang
davidbalber|away is now known as davidbalbert
__Big0___ has quit [Remote host closed the connection]
kain_ has quit [Quit: exit]
__Big0__ has joined #ruby-lang
havenwood has joined #ruby-lang
cirenyc has quit [Quit: Leaving...]
psycho_one has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
mixandgo has joined #ruby-lang
torrieri_ has quit [Quit: Leaving...]
dc5ala has quit [Quit: Ex-Chat]
<mixandgo>
hello, how would you rescue just from IO exceptions (disk, network, etc)
<whitequark>
rescue IOError ?
<mixandgo>
would that cover everything I need ?
<whitequark>
IO errors, yes.
jvrmaia has joined #ruby-lang
<mixandgo>
ok, thank you whitequark
jvrmaia has quit [Remote host closed the connection]
joevandyk has quit [Quit: joevandyk]
maxmanders has quit [Quit: Computer has gone to sleep.]
tonni has quit [Remote host closed the connection]
wallcloc_ has quit [Remote host closed the connection]
<injekt>
whitequark: my last gist is up to date, the query appears fine its just not assigning yo the instance
<injekt>
to*
xcombelle has quit [Read error: Connection reset by peer]
<whitequark>
injekt: not assigning to the instance?
<whitequark>
have you tried showroom[:showroom_image] ?
realDAB has joined #ruby-lang
bantic has quit [Quit: bantic]
<whitequark>
also the similarity of sequel/arel queries is striking /cc yorickpeterse
sush24 has quit [Quit: This computer has gone to sleep]
snarfmason has quit [Quit: Computer has gone to sleep.]
wobblini has quit [Ping timeout: 248 seconds]
<injekt>
whitequark: no i havent tried that, im on mobile now ill have to try once im back online
lajlev has quit [Quit: lajlev]
blacktulip has quit [Ping timeout: 245 seconds]
* yorickpeterse
is drowning a keyboard
bantic has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
<injekt>
whitequark: rake db:setup; and fire console should get you going
mrsolo has quit [Quit: Leaving]
pr0ton has joined #ruby-lang
cstrahan has quit [Ping timeout: 250 seconds]
dustint has quit [Ping timeout: 256 seconds]
<whitequark>
awesome, ruby 2.0 :)
theoros_ is now known as theoros
<injekt>
how could you tell?
<whitequark>
injekt: 3.2.13.rc2
<whitequark>
actually forget that, I have psychic powers
<injekt>
whitequark: ah, technically I *could* be using 1.9 :D
<injekt>
but na, i moved to 2.0 as soon as it was released
<yorickpeterse>
injekt: RAILS IS A WEB APPLICATION FRAMEWORK THAT INCLUDES EVERYTHING NEEDED TO CREATE A DATABASE-BACKED WEB APPLICATION
torrieri has quit [Quit: Leaving...]
<yorickpeterse>
(harder to type without a caps lock)
* whitequark
slaps yorickpeterse around a bit with a large trout
<lianj>
whitequark: give it another round
<yorickpeterse>
I like it rou...nevermind
<injekt>
I like it rue...
* rue
wiggles about
jg has quit [Read error: Operation timed out]
<injekt>
hey stop wiggling
* whitequark
looks at inkjet
<whitequark>
argh, chrome can't even save history properly
<yorickpeterse>
injekt: don't inkjet yourself into this conversation all the time
<yorickpeterse>
ok I'm done
<whitequark>
injekt: for the love of ctulhu. please. don't write `.'s like that in multiline statements
<whitequark>
it's not really clear if the line is continued; and it doesn't work when copy-pasting to irb
<injekt>
whitequark: yeah it was more for readability, it hurt me in irb too
<whitequark>
um, the variant with the dot at the end is more readable?
<whitequark>
because you can tell if a line is continued by looking at *that* line, and not beginning of the next?
<injekt>
hey man you same potato i say fuck you
<injekt>
say*
<whitequark>
it's like ASI in JS but slightly less evil
<whitequark>
wat
<injekt>
yeah i never use multi-line statements like that really anyway but i do agree
<yorickpeterse>
foo \
<yorickpeterse>
.bar
<yorickpeterse>
is what I do
<injekt>
gtfo
<yorickpeterse>
because fuck dots at the end
cstrahan has joined #ruby-lang
torrieri has joined #ruby-lang
<injekt>
feel like im writing erlang with trailing periods
<injekt>
trailing periods.. tehe
<yorickpeterse>
though generally when I wrap lines like that it means something needs to be cleaned up codewise
<yorickpeterse>
injekt: it's not needed in 1.9 actually
kain has quit [Ping timeout: 240 seconds]
<injekt>
aye
<yorickpeterse>
it's more of a habit from other languages where it is
<injekt>
ruby should do what scala does and make it optional
<injekt>
:D
<injekt>
"foo" reverse upcase
<injekt>
take that
<yorickpeterse>
bah
<whitequark>
wasn't that smalltalk
<whitequark>
which popularized the idea
<injekt>
probably
<whitequark>
injekt: I'm wondering too wtf is with as('AS ...')
<whitequark>
ahhhhh
<whitequark>
in SQL, AS is optional.
<whitequark>
it took me an SQL parser to get this knowledge, though
<injekt>
hah
<whitequark>
injekt: it works for me
<whitequark>
irb(main):019:0> Showroom.select(:name).select(images).limit(10).first[:showroom_image] Showroom Load (1.1ms) SELECT name, (SELECT image FROM "photos" WHERE "photos"."gallery" = 'primary' AND "photos"."attachable_id" = "showrooms"."id" AND "photos"."attachable_type" = 'Showroom' ORDER BY created_at DESC LIMIT 1) showroom_image FROM "showrooms" LIMIT 1
havenwood has joined #ruby-lang
<whitequark>
=> "img-2"
<injekt>
:|
<injekt>
can you paste the images line so I can throw it into irb without hurting kittens