Since presym is now mandatory, mruby.h includes presym.h so that
MRB_SYM() macros are available everywhere without explicit include.
Remove redundant #include <mruby/presym.h> from all source files.
Co-authored-by: Claude <noreply@anthropic.com>
Move casecmp_p from mruby-string-ext and mruby-encoding to core as
mrb_strcasecmp_p (predicate function returning mrb_bool). Add
MRB_STR_CASECMP_P macro to internal.h for comparing mrb_value strings
with literal strings.
This eliminates code duplication and avoids static function name
collision for future amalgamation support.
Co-authored-by: Claude <noreply@anthropic.com>
Added comprehensive call-seq documentation for the 2 missing public
methods in the encoding gem, improving documentation coverage from
33% to 100%.
Documentation added:
- String#encoding: Returns the encoding of a string (UTF-8 or ASCII-8BIT)
- String#force_encoding: Changes string encoding in place
Each method now includes:
- Clear method signatures with parameter and return types
- Descriptions of encoding behavior specific to mruby's limitations
- Practical examples showing usage patterns
- Notes about mruby's simplified encoding support (UTF-8, ASCII-8BIT, BINARY)
This complements the existing String#valid_encoding? documentation and
provides complete coverage for mruby's "poorman's encoding" functionality,
making it easier for developers to understand encoding operations in
embedded Ruby environments.
Co-authored-by: Atlassian Rovo Dev
The difference from CRuby's Encoding:
- Encoding is a module, instead of a class
- each Encoding (e.g. `Encoding::UTF_8) is a string instead of Encoding object
- only supports `UTF-8` and `ASCII-8BIT` (and its alias `BINARY`)
Using this gem automatically turn on `MRB_UTF8_STRING` support.