+
Skip to content

Error while parsing valid toml #66

@schneems

Description

@schneems

Reproduction:

cd /tmp
cat > foo.toml <<EOF
api = "0.4"

[buildpack]
id = "heroku/java-function"
version = "0.3.21"
name = "Java Function"
homepage = "https://github.com/heroku/buildpacks-jvm"
keywords = ["java", "function"]

[[licenses]]
type = "MIT"

[[order]]

[[order.group]]
id = "heroku/jvm"
version = "0.1.8"

[[order.group]]
id = "heroku/maven"
version = "0.2.5"

[[order.group]]
id = "heroku/jvm-function-invoker"
version = "0.5.3"

[metadata]

[metadata.release]

[metadata.release.docker]
repository = "public.ecr.aws/heroku-buildpacks/heroku-java-function-buildpack"
EOF

gem install toml
ruby -rtoml -e "TOML.load(File.read('foo.toml'))"

Expected: Toml to be parsed
Actual:

/Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml/parser.rb:57:in `resolve_table_array': undefined method `has_key?' for nil:NilClass (NoMethodError)
	from /Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml/parser.rb:37:in `block in initialize'
	from /Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml/parser.rb:16:in `each'
	from /Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml/parser.rb:16:in `initialize'
	from /Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml.rb:19:in `new'
	from /Users/rschneeman/.gem/ruby/3.0.2/gems/toml-0.3.0/lib/toml.rb:19:in `load'
	from -e:1:in `<main>'

Ruby: 3.0.2
I checked the toml on disk is valid with https://www.toml-lint.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载