James Adam boosted


Hello! I'm a by trade, and a serial hobbyist. I use in my side project. I would call it a business, but I've yet to be paid for it. I'm interested in prototyping ideas, and in learning best practices!

Some of my serial hobbies include singing, playing drums and guitar, drone racing, rock climbing, knitting, dancing at weddings, running, and visiting breweries!

Sad to hear that @matthewrudy@twitter.com has passed away.

He was a great supporter of the Ruby communities in London, Hong Kong and far beyond.

You'll be missed, Matthew.

@halfbyte @fjfish indeed. What Payola did that was nice was abstract away all of the plumbing so you just had to write a couple of handlers to deal with events (e.g. `customer.subscription.created`). My whole Stripe integration was/is maybe 30 lines tops.

Anyone here use a gem/engine to integrate with Stripe billing? I used `payola-payments` in the past, but it's not been updated for a long time.

@fjfish @phaedryx what are the benefits of abbreviating at all?

The only justification I can think of in an age of auto-completing editors is where a shorter variable name makes the structure of the logic clearer (i.e. single-line enumerations). Even then, I'd still pick a short word over an abbreviation thought.

James Adam boosted

Hey #ruby folk ... I'm trying to trigger an autoscaler for testing purposes. Anybody have a simple cpu-pegging method handy per chance?

James Adam boosted

has anyone upgraded a rails 5.x app to rails 6 beta?

I thought the javascript assets were going to be required to be moved to webpacker, but it looks like they still work via asset pipeline

is the change that webpack is the default for new apps, but sprockets will continue working for existing apps?

#rails #ruby #dev #askmasto #software #rubyonrails #railsdev #sprockets #webpack #js #javascript

James Adam boosted

So where does one post Ruby jobs in 2019?

James Adam boosted

@usmanity “Ruby Quiz” might have some interesting problems to try?

@len if you're already used to the vim keybindings, seems like switching to evil would be pretty seamless?

@postmodern Some instances do support an "instance only" visibility, which has a tangential similarity to this idea. I don't know how we would stop the mechanism you describe from just being a spam vector for the local timeline though...

@phil_pirozhkov congrats on the Ruby Weekly mention! It's a shame that the headline contained the slightly misleading explanation though, but still. Nice! :)

What version of Ruby is your main project or product running against?

@phil_pirozhkov I'm back at the computer, and I'm pretty sure it's lexical scope at play.

When we write `Class.new do ... end`, the lexical scope of the block is the same level as `Class.new`, and that's where the constant is defined.

We can demonstrate this by changing scope by moving into a new class or module:

class Foo
Bar = Class.new do
A = 123

Foo::Bar::A # => Uninitialized constant A ..
Foo::A # => 123

Always fun figuring this stuff out!

@phil_pirozhkov very interesting. Away from IRB, I’m trying to figure out if this is a lexical scope thing, or a block/closure thing, or both… my hunch is it’s mostly the former though.

James Adam boosted

Question. In which namespace `B` is defined?

A = Class.new do
B = 1
A::B # => ???
B # => ???

More on the topic fili.pp.ru/leaky-constants.htm

James Adam boosted

Hi guys.
Ruby student here.
I just learned of mastodon and wanted to check it out. Never caught on to Twitter. This looks like a nice small group. Looking forward to knowing everyone.

Show more

A Mastodon instance for Rubyists & friends