Own-and-Ship / oas_agent

The Own & Ship Ruby agent
2 stars 0 forks source link

Update gemspec for older Rubies #18

Closed caius closed 1 year ago

caius commented 1 year ago

What?

Why?

Ruby 2 introduced __dir__ as a shorthand for directory-containing-current-file, so we can't use it in older rubies.

Rubygems 2 introduced the metadata method (exposed as spec.metadata in the gemspec), so if we try and use it on older rubygem versions it throws a NoMethodError. We can just check for the existence before setting those attributes.