Chore/sync upstream v0.3.7#3
Open
diegocostares wants to merge 18 commits into
Open
Conversation
- this seems to have changed with newer unrtf versions - missing the header we fail to strip away the other leading comments
- removed 2.6 from the list of tested ruby versions, added more recent ones.
- fixes errors with AS 7.1 as described in rails/rails#49495 - as per https://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition, active_support itself should always be required.
Using "quiet" at end of the command will suppress the messages regarding image resolution and empty pages.
When calling an external command and reading the output, `io.read` returns `""` when no output is available, but `io.read(max_size)` returns `nil` instead of `""`. This return value is then converted to a string with `to_s`, and since ruby 2.7, `nil.to_s` returns a frozen empty string. Then the `Plaintext::Resolver` calling `gsub!` and `strip!` on this string lead to a `FrozenError: can't modify frozen String`. This is fixed by duplicating the string if it is frozen.
Avoid FrozenError with empty images
This avoids a "NoMethodError: undefined method '+@' for nil".
Resolver returns nil if the handler returns nil
- Se actualizaron los regex en los specs del upstream para soportar los saltos de línea de Buk. - Se relajó la dependencia de desarrollo de bundler (de 1.17.2 a genérica) para permitir correr la suite de tests en versiones modernas de Ruby (3.3+).
f9375bf to
fac8a3b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué se hizo
Se realizó una sincronización de la gema con el repositorio upstream original (
planio-gmbh/plaintext) para incorporar las correcciones y mejoras liberadas hasta la versiónv0.3.7. El número de versión se ha actualizado a0.3.7-buk.1.Resolución de Conflictos y Conservación de Reglas Propias (Buk)
El repositorio de Buk mantiene modificaciones (hard fork) implementadas en 2020 para adaptar la extracción de texto a las necesidades del parseo de CVs locales. Durante el merge de la versión 0.3.7 se presentaron conflictos que fueron resueltos preservando estrictamente la lógica de Buk:
Gestión de Saltos de Línea en Archivos Zipped XML (DOCX/ODT):
Resolver#textpara aplicargsub!(/\s+/m, ' ')ystrip!, forzando a que todo el texto quede en una sola línea separada por espacios.8ef2b206(que utiliza\nen lugar de espacios vacíos). Esto es crítico para mantener la estructura vertical y legibilidad de los currículums.Gestión de Encoding:
872944b5, el cual desactiva la conversión forzada de codificación enExternalCommandHandler. Esto previene la destrucción de caracteres especiales y tildes en documentos en español.Adaptación de Tests (Specs):
opendocument_handler_spec.rb,docx_handler_spec.rb, etc.). Se reemplazaron los espacios literales en las aserciones por el patrón\s+(cualquier espacio en blanco, incluyendo saltos de línea), logrando que los 27 tests pasen exitosamente sin alterar el comportamiento de extracción de la aplicación.Beneficios de esta sincronización
text/markdown.FrozenErrory manejos seguros de respuestasnilen el resolver.