rabl
rabl copied to clipboard
Is v0.13.x going to be compatible with Ruby 2.0.0?
I have a new Rails project using rabl v0.13.0 and I'm getting this error.
lib/rabl/digestor.rb:6: syntax error, unexpected ',' (SyntaxError)
def self.digest(name:, finder:, **options)
@5thWall what is your ruby version?
2.0.0-p648 unfortunately. I didn't realize that was a method definition so error makes sense. I understand if you're dropping support for such an old version.
@5thWall and what is your version of Rails?
The problem is described here: https://robots.thoughtbot.com/ruby-2-keyword-arguments#required-keyword-arguments It's Ruby 2.1
So is Ruby 2.0.0 not being supported? The Travis config lists all the way down to 1.9.3.
@5thWall But not with Rails 5. Rails 5 requires Ruby >= 2.2.2.
Can the gemspec be updated to indicate the minimum Ruby version supported for subsequent releases? I got caught out on this and first checked the compatibility info reported by Rubygems.
@krzysiek1507 Does RABL work on Ruby 2.5 and Rails 5.1?
Bump on this.
Just upgrade Ruby to 2.5.1 and Rails to 5.2.1 and my views were unchanged but whenever I try to render a partial or extend another view it bombs.
cc: @nesquena @krzysiek1507
The tests pass for ruby-2-5-1 so we're missing something in the tests. Can someone provide their template or a new rails app that reproduces the issue?
@databyte what breaks my app is this
child :map_author, object_root: false do
extends('api/v2/maps/map_author')
end
child :map_audios, object_root: false do
extends('api/v2/maps/map_audios')
end
and in the template is
#/views/api/v2/_author.rabl
object @map_author
cache root_object
attributes :id, :name, :description, :photo_file, :photo_s3
node(:photo_url) { |a| "#{ENV['S3_BUCKET_URL']}/#{URI.encode(a.photo_s3)}" unless a.photo_s3.nil? }
#/views/api/v2/_map_audios.rabl
collection @map_audios
cache root_object
attributes :id, :map_id, :name, :description, :file, :file_s3, :created_at, :updated_at
node(:url) { |a| "#{ENV['S3_BUCKET_URL']}/#{URI.encode(a.file_s3)}" unless a.file_s3.nil? }
That's a big file and I don't have all the variables and database fields that go with it. To help out, if you were to comment out each line one by one - can you find the breaking line? Think git bisect but for rabl template file troubleshooting.