diff --git a/CHANGELOG.md b/CHANGELOG.md index addf01a..a660d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [0.2.0] - [unreleased] + +- Add mention about compliance and passed tests in README. +- Declare global variables with `rb_global_variable`. +It may prevent VM from crashing in some cases. + ## [0.1.0] - 2022-08-02 -Initial release +- Initial release diff --git a/README.md b/README.md index a868b5c..cd60d2a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,11 @@ Tomlib is a TOML parser and generator for Ruby. It is fast and standards-compliant by relying on native [tomlc99](https://github.com/cktan/tomlc99) parser. +## Compliance + Tomlib is TOML v1.0 compliant. +It passes both [BurntSushi/toml-test](https://github.com/BurntSushi/toml-test) and +[iarna/toml-spec-tests](https://github.com/iarna/toml-spec-tests). ## Installation diff --git a/lib/tomlib.rb b/lib/tomlib.rb index 5bfe44d..0488e98 100644 --- a/lib/tomlib.rb +++ b/lib/tomlib.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'date' + require_relative 'tomlib/dumper' require_relative 'tomlib/tomlib' require_relative 'tomlib/version' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d2b77ca..93624b2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,17 @@ # frozen_string_literal: true require 'simplecov' +require 'tomlib' + +if GC.respond_to?(:verify_compaction_references) + # This method was added in Ruby 3.0.0. Calling it this way asks the GC to + # move objects around, helping to find object movement bugs. + begin + GC.verify_compaction_references(double_heap: true, toward: :empty) + rescue NotImplementedError + # Some platforms don't support compaction + end +end SimpleCov.start do add_filter '/spec/' @@ -106,15 +117,3 @@ Kernel.srand config.seed =end end - -require 'tomlib' - -if GC.respond_to?(:verify_compaction_references) - # This method was added in Ruby 3.0.0. Calling it this way asks the GC to - # move objects around, helping to find object movement bugs. - begin - GC.verify_compaction_references(double_heap: true, toward: :empty) - rescue NotImplementedError - # Some platforms don't support compaction - end -end