Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 1.9 support. #2

Closed
wants to merge 1 commit into from
Closed

Conversation

kryzhovnik
Copy link

  1. Forced encoding of loaded data to utf-8.
  2. Fixed Vydumschik::Lorem.capitalize_ru(word) method.

Tested on MRI 1.8.7-p357, 1.9.1-p431, 1.9.2-p290, 1.9.3-p0.

    1. Forced encoding of loaded data to utf-8.
    2. Fixed Vydumschik::Lorem.capitalize_ru(word) method.

Tested on MRI 1.8.7-p357, 1.9.1-p431, 1.9.2-p290, 1.9.3-p0.
@mgrishko
Copy link

Met the same, ruby 1.9.3p194.
With fork works fine.

NoMethodError: undefined method `-' for "ц":String

@dagron
Copy link

dagron commented Oct 12, 2012

Ruby 1.9.3
puts Vydumschik::Name.surname
Encoding::UndefinedConversionError: "\xD0" from ASCII-8BIT to UTF-8
from /var/lib/gems/1.9.1/gems/vydumschik-0.1.0/lib/vydumschik/name.rb:26:in `encode'

diff  /var/lib/gems/1.9.1/gems/vydumschik-0.1.0/lib/vydumschik/name.rb name.rb
27c27
<       surname += 'а'.force_encoding('ASCII-8BIT') if gender==:female
---
>       surname += 'а' if gender==:female

@leonid-shevtsov
Copy link
Owner

Better late than never - I released version 0.2.0 with complete 1.9 support.

Thanks a lot for the pull request. YAML files were better saved with UTF-8 encoding instead of binary; this works with all versions of Ruby and makes YAML files actually readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants