lupine

Activity Graph

Page 1 of 14 | Next »

2019-03-17

[03:11:07] lupine: Ping timeout: 240 seconds
[03:13:32] lupine: has joined #ruby
[03:13:32] lupine: has joined #RubyOnRails

2019-03-15

[01:02:28] lupine: Ping timeout: 264 seconds
[01:06:47] lupine: has joined #ruby
[01:06:47] lupine: has joined #RubyOnRails
[18:44:43] lupine: very normal, in rails 3(?)+
[18:44:56] lupine: in rails2, for sure, it was a direct database update. these days, that's called `update_columns`
[18:45:30] lupine: if you have an `ActiveRecord::Relation`, then `update_all` will be a database update that skips callbacks, etc
[18:45:59] lupine: hmm, sorry, I missed the parent / child aspect of the question
[18:46:11] lupine: is updating the child triggering a save of the parent via `autosave: `, I wonder

2019-03-03

[01:36:41] lupine: Ping timeout: 250 seconds
[01:45:46] lupine: has joined #ruby
[01:45:46] lupine: has joined #RubyOnRails

2019-02-28

[11:21:10] lupine: can I ask a model to reload only a single column value?
[11:49:22] lupine: yeah, I'm not finding it. so I'm just querying the database for the value directly :D
[11:49:46] lupine: (it's something of a self-made problem, since a bit earlier in the flow we update the database directly without going through the model)

2019-02-26

[22:58:57] lupine: hard problems #3, after cache invalidation and naming things

2019-02-12

[11:23:38] lupine: there's also the dirty `extend self` tricfk
[11:23:39] lupine: I wouldn't
[11:26:00] lupine: I really wouldn't :D
[11:27:03] lupine: it will lead to bad code
[11:27:29] lupine: class-level attributes invariably do, no matter how you implement them
[11:27:54] lupine: `extend self` is particularly bad because you'll invariably find that someone eventually includes the module elsewhere, and then you'll have two conflicting contexts for the same methods
[11:28:11] lupine: no, they're quite different
[11:29:26] lupine: class << self is better, in that it's more focused and the created methods won't be shared with anything you later include the module into, but I'd still generally avoid it
[12:44:34] lupine: those of us using the danger gem - how do you test the code in your Dangerfile and danger plugins ?
[12:58:41] lupine: oh dear :(

2019-02-07

[15:48:33] lupine: simplifies deployment
[15:49:55] lupine: I don't find a useful distinction TBH. you have a file that the environment interprets, and somewhere in that file is binary data representing your ruby code, surrounded by the full ruby executable + runtime
[15:50:25] lupine: whether that's a .msi or .deb or an executable with mruby + your script, it's all the same

2019-01-22

[01:03:33] lupine: you've probably got an ActiveRecord::Relation to run `each` on
[01:03:46] lupine: normally this is good, but if it's bad, you can always explicitly `.to_a` at the right point
[15:48:50] lupine: Quit: No Ping reply in 180 seconds.
[15:50:31] lupine: has joined #RubyOnRails
[15:50:32] lupine: has joined #ruby
[15:53:08] lupine: Excess Flood
[15:55:59] lupine: has joined #RubyOnRails
[15:56:00] lupine: has joined #ruby

2019-01-20

[00:27:57] lupine: the usual, you know
[23:37:45] lupine: end capitalism

2019-01-19

[19:58:19] lupine: there's a gem that lets you do "foo".color(:red)
[19:59:20] lupine: I don't think I'm thinking of https://github.com/fazibear/colorize but it also exists
[21:19:28] lupine: Remote host closed the connection
[21:46:11] lupine: has joined #RubyOnRails
[21:46:12] lupine: has joined #ruby
[23:34:07] lupine: File.join(Dir.pwd, __FILE__)

2019-01-12

[23:42:26] lupine: just because you can, doesn't mean you should

2019-01-11

[21:04:51] lupine: weird, I'd expect that to work
[21:06:45] lupine: this works: define_singleton_method(:foo, method(:foo))
[21:07:17] lupine: where `method(:foo)` gets a reference to a method created with `def`
[21:08:18] lupine: If I use a block rather than pass a method, then `yield`fails with `LocalJumpError`, which is really unexpected
[21:09:11] lupine: &>> def foo; yield ; end ; a = Object.new ; a.define_singleton_method(:foo, method(:foo)) ; a.foo { puts 'ok' ; 'ok' }
[21:09:34] lupine: &>> a = Object.new ; a.define_singleton_method(:foo) { yield } ; a.foo { puts 'ok' ; 'ok' }
[21:09:55] lupine: thanks ruby, very wise

2019-01-08

[01:32:22] lupine: Ping timeout: 250 seconds
[01:45:18] lupine: has joined #ruby
[01:45:19] lupine: has joined #RubyOnRails

2019-01-07

[11:20:08] lupine: it seems that eager loading doesn't pull `app/views/*` into memory at boot-up. Is there a setting or gem that would cause this to happen?
[11:23:07] lupine: deployments aren't atomic, so sometimes we have a process running with the old code, but new views
[11:23:31] lupine: if the process read the view files into RAM at bootup, that would stop being a problem
[11:31:33] lupine: sevenseacat: it's a consequence of not stopping the process while a package install is ongoing, a decision taken to minimise downtime
[11:31:58] lupine: .deb packages can use either mode when they include a service - stop it while upgrading, or not.
[11:32:24] lupine: if you don't, the files are updated while the old process is still running, then once the extraction is complete, the service is restarted. good for uptime, bad for correctness :/
[11:32:34] lupine: -> https://gitlab.com/gitlab-org/gitlab-ce/issues/55593

2019-01-01

[17:43:49] lupine: nothing quite so insane, but sure, you can define the "==" method for most classes
[17:43:50] lupine: (not all of them)

2018-12-30

[15:36:47] lupine: ACTION calls the file on disk `(eval)`
[15:42:54] lupine: prove it ;)
[17:38:49] lupine: ignore 95% of it, focus on building something small

2018-12-28

[14:50:08] lupine: I don't like either
[19:25:17] lupine: each_with_index
[19:26:18] lupine: >> [6,1,2,3].each_with_index { |a,b| puts "#{a} #{b}" }
[19:26:39] lupine: >> puts [6,1,2,3].each_with_index { |a,b| puts "#{a} #{b}" }
[19:26:51] lupine: works fine locally, anyway, and rings a bell from 1.8.
[19:27:01] lupine: &>> [6,1,2,3].each_with_index { |a,b| puts "#{a} #{b}" }
[19:27:25] lupine: also consider more words per line, and fewer imprecations per minute

2018-12-26

[21:59:24] lupine: maybe you want private_constant. I wouldnt though
[22:26:32] lupine: you really need a process boundary to protect anything from malicious users with eval rights in ruby
[23:08:26] lupine: oh very nice

2018-12-20

[01:23:27] lupine: Company.includes(:employees).all or so
[01:23:57] lupine: but you'd best not be writing software for recruiters
[01:24:02] lupine: that is truly of the devil

2018-12-10

[14:24:33] lupine: Remote host closed the connection
[14:28:44] lupine: has joined #ruby
[14:28:45] lupine: has joined #RubyOnRails

2018-11-26

[22:26:22] lupine: Remote host closed the connection
[22:29:01] lupine: has joined #RubyOnRails
[22:29:01] lupine: has joined #ruby

2018-11-21

[05:17:36] lupine: Ping timeout: 260 seconds
[05:26:46] lupine: has joined #RubyOnRails
[05:26:46] lupine: has joined #ruby

2018-11-18

[01:35:46] lupine: Ping timeout: 260 seconds
[01:48:38] lupine: has joined #RubyOnRails
[01:48:38] lupine: has joined #ruby

2018-11-06

[22:20:56] lupine: downsides of pry: not in stdlib

2018-11-03

[11:53:30] lupine: just use cookies

2018-11-02

[23:08:05] lupine: ACTION waves from shetland

2018-11-01

[08:54:05] lupine: Ping timeout: 276 seconds
[09:01:57] lupine: has joined #RubyOnRails
[09:01:57] lupine: has joined #ruby
[23:58:45] lupine: ruby mostly does pass by roulette
[23:58:59] lupine: never know what you're going to get
[23:59:25] lupine: come on, it deserves a sensible chuckle at minimum

2018-10-28

[22:17:12] lupine: the capitalists strike again

2018-10-25

2018-10-24

[02:57:10] lupine: openstruct: I'd expect that to get very messy, very quicklyt
[02:57:27] lupine: can you split into two separate processes, one for each version, each with their own Gemfile ?

2018-10-23

[16:44:12] lupine: doesn't work without JS :/

2018-10-20

[22:52:39] lupine: so don't?
[23:07:26] lupine: so don't return nil
[23:08:11] lupine: aww, `undef nil` doesn't work :D

2018-10-18

[12:48:59] lupine: Remote host closed the connection
[12:51:12] lupine: has joined #ruby
[12:51:13] lupine: has joined #RubyOnRails

2018-09-19

[11:34:07] lupine: Remote host closed the connection
[11:35:16] lupine: has joined #RubyOnRails
[11:35:16] lupine: has joined #ruby

2018-09-10

[23:13:39] lupine: anime4christ: it doesn't have type information associated with the `custom_at` name
[23:14:19] lupine: well, does it give you a `Time` object at-all?
[23:14:33] lupine: mysql, postgres?
[23:14:57] lupine: maybe you can specify a type in the AS part
[23:16:46] lupine: just guessing TBH

2018-09-04

[05:49:26] lupine: Remote host closed the connection
[05:50:51] lupine: has joined #RubyOnRails
[05:50:51] lupine: has joined #ruby

2018-09-03

[21:29:05] lupine: FWIW, we looked at this kind of memoization magic in our codebase, and ran a mile. We just `include Utils::StrongMemoize` and do def x ; strong_memoize { ... } ; end` instead
[21:29:29] lupine: just because you can, does not mean you should
[21:30:08] lupine: but yes, it's traditional(ish) OO, not prototypes
[21:30:34] lupine: you can emulate javascript behaviour in ruby quite easily by disdaining classes and using hashes everywhere
[21:30:54] lupine: you can even add prototypes with the `Hash.new {|h,k| h[k] = ... }` idiom
[21:31:10] lupine: or, you know, you could just write in javascript. nodejs exists for people who like to do that
[21:31:27] lupine: right, so it's not surprising that some things are different
[21:31:38] lupine: you wouldn't want to though :D
[21:32:33] lupine: here's an alternative. How about a Memoizer class that acts as a facade around an object and memoizes methods going through it?
[21:34:56] lupine: apeiros: one could optionally implement a list of memoable methods
[21:38:54] lupine: looks a bit like https://gitlab.com/snippets/1750773
[21:39:25] lupine: 'though ISTR you should implement responds_to or something as well
[21:40:06] lupine: heh, my solution works for that
[21:48:44] lupine: note that `@foo ||=` doesn't work well if hte result is `false` or `nil`, yet still expensive to compute
[21:49:42] lupine: aye, it's easily forgotten is all
[21:50:15] lupine: I still like mine. the internal vs. external question is by the by - ruby doesn't store data like that
[21:50:34] lupine: all we're asking is whether the memozied class holds a reference to its memoizer or not
[21:51:47] lupine: it can be useful to hold such a reference - for instance, you might want to clear memoized values based on some interaction or another. but you can always include the reference if you need it
[22:05:59] lupine: JJonah: one option would be to override the `new` method to return an always-memoized instance
[22:06:11] lupine: or to add a `build_memoized` class method that does the smae
[22:06:16] lupine: lots of ways to do this
[22:29:19] lupine: I've got production experience of jruby. it's pretty solid
[22:29:47] lupine: sometimes surprising things happen, and the gap between jruby and cruby is a lot narrower now than it was back then. I probably wouldn't use it again

2018-09-01

[17:56:31] lupine: *.net *.split
[18:02:19] lupine: has joined #RubyOnRails
[18:02:19] lupine: has joined #ruby
[22:43:25] lupine: 1.8 -> 1.9 was a bigger jump

2018-08-20

[13:43:33] lupine: Ping timeout: 272 seconds
[13:53:20] lupine: has joined #RubyOnRails
[13:53:20] lupine: has joined #ruby

2018-08-19

[08:44:35] lupine: Ping timeout: 268 seconds
[09:03:56] lupine: has joined #ruby
[09:03:57] lupine: has joined #RubyOnRails

2018-08-10

[02:47:59] lupine: Ping timeout: 255 seconds
[02:49:42] lupine: has joined #RubyOnRails
[02:49:42] lupine: has joined #ruby
[03:27:21] lupine: Ping timeout: 240 seconds
[03:42:04] lupine: has joined #RubyOnRails
[03:42:04] lupine: has joined #ruby

2018-08-09

[10:37:04] lupine: http://help.rubygems.org/discussions/problems/32656-reporting-abuse-on-active-support ^^

2018-08-08

[19:36:29] lupine: there are various surprising costs to having a huge number of files in db/migrate, from slow specs on
[21:00:37] lupine: dunno about ActiveJob, but if it's just sat on top of sidekiq, you can definitely get it form thre
[21:00:40] lupine: from there*
[22:22:56] lupine: yay abstractions

2018-08-03

[01:23:42] lupine: Remote host closed the connection
[01:24:53] lupine: has joined #RubyOnRails
[01:24:53] lupine: has joined #ruby
[01:43:48] lupine: Remote host closed the connection
[01:44:57] lupine: has joined #RubyOnRails
[01:44:57] lupine: has joined #ruby
[02:01:31] lupine: Remote host closed the connection
[02:02:40] lupine: has joined #ruby
[02:02:41] lupine: has joined #RubyOnRails

2018-07-31

[21:28:03] lupine: Remote host closed the connection
[21:29:14] lupine: has joined #RubyOnRails
[21:29:14] lupine: has joined #ruby
[23:46:43] lupine: we're already way too far on the code-reuse side of the equation
[23:50:19] lupine: too much code reuse
[23:50:21] lupine: let's have less of it

2018-07-27

[23:20:57] lupine: I've done a few things in jruby, which is pretty speedy
[23:21:22] lupine: but 1.8 (MRI) -> 1.9 (YARV) was huge, and lots of work keeps happening along the way
[23:22:05] lupine: FFI is pretty common, at least in my experience
[23:22:34] lupine: for jarv it was mostly gc
[23:22:41] lupine: the threading changes helped too
[23:23:18] lupine: we saw literal 10x speedups in several systems
[23:28:50] lupine: aye. ultimately, the performance question can only be answered by benchmarking your thing
[23:29:32] lupine: my beefs with ruby aren't really performance-based these days

2018-07-24

[08:05:47] lupine: sounds like an interesting domain
[21:59:34] lupine: someone tried once, but the necessary hardware achieved self-awareness and took itself off to orion's belt
[23:36:25] lupine: or just run yardoc in $GEM_HOME/gems/chef-14.3.37 or so

2018-07-20

[00:07:17] lupine: *.net *.split
[00:15:26] lupine: has joined #RubyOnRails
[00:15:39] lupine: has joined #ruby

2018-07-19

[23:19:36] lupine: yes, because it's trivial to trace all possible sources of user input
[23:20:46] lupine: don't worry, I'm imagining it hard enough for both of us

2018-07-15

[10:53:07] lupine: if you ensure it's not interpolated, the main thing you have to watch out for is path traversal

2018-07-14

[18:27:40] lupine: note that you can also open with a flag that refuses to open a link
[18:27:47] lupine: which is a nice way to avoid the race
[18:27:53] lupine: not cross-platform though
[18:31:45] lupine: I can try
[18:32:06] lupine: isene: you also want O_NOFOLLOW
[18:32:13] lupine: whatever that is in ruby
[18:34:34] lupine: CREAT + EXCL is ok, yeah
[18:35:05] lupine: if you're just doing an open() of an existing file you don't want to be a symlink, there is
[18:35:23] lupine: I jumped in without context, it's a lot of fun :)
[18:35:29] lupine: sometimes good, sometimes a security risk
[18:35:48] lupine: it's fine when they're owned by root
[18:36:31] lupine: I don't think you can, really. not reliably
[18:36:40] lupine: the filesystem or hardware can always override your hints
[18:40:08] lupine: you can open O_DIRECT or O_SYNC of course, but it's still all just hints
[18:40:45] lupine: you can also mmap() the file and use msync()
[18:41:09] lupine: you *will* need MS_SYNC

2018-07-13

[10:01:51] lupine: Ping timeout: 240 seconds
[12:33:33] lupine: has joined #RubyOnRails
[12:33:33] lupine: has joined #ruby
[12:38:05] lupine: Ping timeout: 240 seconds
[12:38:36] lupine: has joined #RubyOnRails
[12:38:36] lupine: has joined #ruby

2018-07-10

[09:22:45] lupine: Ping timeout: 245 seconds
[13:47:49] lupine: has joined #ruby
[13:47:49] lupine: has joined #RubyOnRails
[13:52:21] lupine: Ping timeout: 240 seconds
[13:52:54] lupine: has joined #ruby
[13:52:54] lupine: has joined #RubyOnRails

2018-07-09

[19:31:52] lupine: not trivial, not particularly hard
[19:32:05] lupine: it's just gluing net/http to nokogiri or whatever
[19:32:36] lupine: I'd just use wget --mirror
[19:53:39] lupine: you may have a connection leak. also note that connections are reaped in the background. pgbouncer can act as a mitigation, or you can just keep increasing the number

2018-07-07

[06:58:05] lupine: Remote host closed the connection
[06:59:16] lupine: has joined #RubyOnRails
[06:59:16] lupine: has joined #ruby

2018-07-05

[04:45:22] lupine: Remote host closed the connection
[04:46:33] lupine: has joined #RubyOnRails
[04:46:33] lupine: has joined #ruby

2018-07-04

[13:08:04] lupine: you literally can't do that
[13:15:04] lupine: you can't deploy to github. it's not a thing. you can push code to github, and have github push to another party for deployment (or for the other party to pull from github)
[14:12:05] lupine: definitely use something that doesn't depend on interpolation