Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-unicode-display_width for
openSUSE:Factory checked in at 2021-01-21 21:56:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-unicode-display_width (Old)
and /work/SRC/openSUSE:Factory/.rubygem-unicode-display_width.new.28504
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-unicode-display_width"
Thu Jan 21 21:56:07 2021 rev:4 rq:865217 version:2.0.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-unicode-display_width/rubygem-unicode-display_width.changes
2020-05-11 13:40:20.848991350 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-unicode-display_width.new.28504/rubygem-unicode-display_width.changes
2021-01-21 21:56:09.089827204 +0100
@@ -1,0 +2,32 @@
+Wed Jan 20 13:32:28 UTC 2021 - Stephan Kulow <[email protected]>
+
+updated to version 2.0.0
+ see installed CHANGELOG.md
+
+ ## 2.0.0
+
+ - Release 2.0.0
+ - Supports Ruby 3.0
+
+ ## 2.0.0.pre2
+
+ - Update 2.0 branch to Unicode 13
+
+ ## 2.0.0.pre1
+
+ Will be published as non-pre version on rubygems.org when Ruby 3.0 is
released (December 2020)
+
+ - Introduce new class-based API, which remembers your string-width
configuration. See README for details.
+ - Remove auto-loading of string extension
+ - You can: `require "unicode/display_width/string_ext"` to continue to use
the string extension
+ - The manual opt-out `require "unicode/display_width/no_string_ext"` is
not needed anymore and will
+ issue a warning in the future
+ - Remove (already deprecated) String#display_size and String#display_width
aliases
+
+ Refactorings / Internal Changes:
+
+ - Freeze string literals
+ - The Unicode::DisplayWidth now is class, instead of a module, this enables
the new config-object API
+
+
+-------------------------------------------------------------------
Old:
----
unicode-display_width-1.7.0.gem
New:
----
unicode-display_width-2.0.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-unicode-display_width.spec ++++++
--- /var/tmp/diff_new_pack.Od7HoD/_old 2021-01-21 21:56:10.097827906 +0100
+++ /var/tmp/diff_new_pack.Od7HoD/_new 2021-01-21 21:56:10.101827909 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-unicode-display_width
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-unicode-display_width
-Version: 1.7.0
+Version: 2.0.0
Release: 0
%define mod_name unicode-display_width
%define mod_full_name %{mod_name}-%{version}
++++++ unicode-display_width-1.7.0.gem -> unicode-display_width-2.0.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2020-03-11 14:34:04.000000000 +0100
+++ new/CHANGELOG.md 2020-12-30 10:10:25.000000000 +0100
@@ -1,5 +1,30 @@
# CHANGELOG
+## 2.0.0
+
+- Release 2.0.0
+- Supports Ruby 3.0
+
+## 2.0.0.pre2
+
+- Update 2.0 branch to Unicode 13
+
+## 2.0.0.pre1
+
+Will be published as non-pre version on rubygems.org when Ruby 3.0 is released
(December 2020)
+
+- Introduce new class-based API, which remembers your string-width
configuration. See README for details.
+- Remove auto-loading of string extension
+ - You can: `require "unicode/display_width/string_ext"` to continue to use
the string extension
+ - The manual opt-out `require "unicode/display_width/no_string_ext"` is not
needed anymore and will
+ issue a warning in the future
+- Remove (already deprecated) String#display_size and String#display_width
aliases
+
+Refactorings / Internal Changes:
+
+- Freeze string literals
+- The Unicode::DisplayWidth now is class, instead of a module, this enables
the new config-object API
+
## 1.7.0
- Unicode 13
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2020-03-11 14:34:04.000000000 +0100
+++ new/README.md 2020-12-30 10:10:25.000000000 +0100
@@ -1,12 +1,31 @@
-## Unicode::DisplayWidth
[![[version]](https://badge.fury.io/rb/unicode-display_width.svg)](https://badge.fury.io/rb/unicode-display_width)
[<img src="https://travis-ci.org/janlelis/unicode-display_width.png"
/>](https://travis-ci.org/janlelis/unicode-display_width)
+## Unicode::DisplayWidth
[![[version]](https://badge.fury.io/rb/unicode-display_width.svg)](https://badge.fury.io/rb/unicode-display_width)
[<img
src="https://github.com/janlelis/unicode-display_width/workflows/Test/badge.svg"
/>](https://github.com/janlelis/unicode-display_width/actions?query=workflow%3ATest)
-Determines the monospace display width of a string in Ruby. Implementation
based on
[EastAsianWidth.txt](https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt)
and other data, 100% in Ruby. Other than
[wcwidth()](https://github.com/janlelis/wcswidth-ruby), which fulfills a
similar purpose, it does not rely on the OS vendor to provide an up-to-date
method for measuring string width.
+Determines the monospace display width of a string in Ruby. Implementation
based on
[EastAsianWidth.txt](https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt)
and other data, 100% in Ruby. It does not rely on the OS vendor (like
[wcwidth()](https://github.com/janlelis/wcswidth-ruby)) to provide an
up-to-date method for measuring string width.
Unicode version: **13.0.0** (March 2020)
-Supported Rubies: **2.7**, **2.6**, **2.5**, **2.4**
+Supported Rubies: **3.0**, **2.7**, **2.6**, **2.5**
-Old Rubies that might still work: **2.3**, **2.2**, **2.1**, **2.0**, **1.9**
+Old Rubies which might still work: **2.4**, **2.3**, **2.2**, **2.1**,
**2.0**, **1.9**
+
+## Version 2.0 ??? Breaking Changes
+
+Some features of this library were marked deprecated for a long time and have
been removed with Version 2.0:
+
+- Aliases of display_width (???\_size, ???\_length) have been removed
+- Auto-loading of string core extension has been removed:
+
+If you are relying on the `String#display_width` string extension to be
automatically loaded (old behavior), please load it explicitly now:
+
+```ruby
+require "unicode/display_width/string_ext"
+```
+
+You could also change your `Gemfile` line to achieve this:
+
+```ruby
+gem "unicode-display_width", require: "unicode/display_width/string_ext"
+```
## Introduction to Character Widths
@@ -44,6 +63,8 @@
## Usage
+### Classic API
+
```ruby
require 'unicode/display_width'
@@ -51,7 +72,7 @@
Unicode::DisplayWidth.of("???") # => 2
```
-### Ambiguous Characters
+#### Ambiguous Characters
The second parameter defines the value returned by characters defined as
ambiguous:
@@ -60,42 +81,56 @@
Unicode::DisplayWidth.of("??", 2) # => 2
```
-### Custom Overwrites
+#### Custom Overwrites
You can overwrite how to handle specific code points by passing a hash (or
even a proc) as third parameter:
```ruby
-Unicode::DisplayWidth.of("a\tb", 1, 0x09 => 10)) # => 12
+Unicode::DisplayWidth.of("a\tb", 1, "\t".ord => 10)) # => tab counted as 10,
so result is 12
```
-### Emoji Support
+#### Emoji Support
-Experimental emoji support is included. It will adjust the string's size for
modifier and zero-width joiner sequences. You will need to add the
[unicode-emoji](https://github.com/janlelis/unicode-emoji) gem to your Gemfile:
+Emoji width support is included, but in must be activated manually. It will
adjust the string's size for modifier and zero-width joiner sequences. You also
need to add the [unicode-emoji](https://github.com/janlelis/unicode-emoji) gem
to your Gemfile:
```ruby
gem 'unicode-display_width'
gem 'unicode-emoji'
```
-You can then activate the emoji string width adjustments by passing `emoji:
true` as fourth parameter:
+Enable the emoji string width adjustments by passing `emoji: true` as fourth
parameter:
```ruby
Unicode::DisplayWidth.of "?????????????????" # => 5
Unicode::DisplayWidth.of "?????????????????", 1, {}, emoji: true # => 2
```
-### Usage with String Extension
-
-Activated by default. Will be deactivated in version 2.0:
+#### Usage with String Extension
```ruby
require 'unicode/display_width/string_ext'
-"???".display_width #=> 1
-'???'.display_width #=> 2
+"???".display_width # => 1
+'???'.display_width # => 2
```
-You can actively opt-out from the string extension with: `require
'unicode/display_width/no_string_ext'`
+### Modern API: Keyword-arguments Based Config Object
+
+Version 2.0 introduces a keyword-argument based API, which allows you to save
your configuration for later-reuse. This requires an extra line of code, but
has the advantage that you'll need to define your string-width options only
once:
+
+```ruby
+require 'unicode/display_width'
+
+display_width = Unicode::DisplayWidth.new(
+ # ambiguous: 1,
+ overwrite: { "A".ord => 100 },
+ emoji: true,
+)
+
+display_width.of "???" # => 1
+display_width.of "?????????????????" # => 2
+display_width.of "A" # => 100
+```
### Usage From the CLI
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/unicode/display_width/constants.rb
new/lib/unicode/display_width/constants.rb
--- old/lib/unicode/display_width/constants.rb 2020-03-11 14:34:04.000000000
+0100
+++ new/lib/unicode/display_width/constants.rb 2020-12-30 10:10:25.000000000
+0100
@@ -1,8 +1,10 @@
+# frozen_string_literal: true
+
module Unicode
- module DisplayWidth
- VERSION = '1.7.0'
- UNICODE_VERSION = "13.0.0".freeze
- DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) +
'/../../../data/').freeze
- INDEX_FILENAME = (DATA_DIRECTORY + '/display_width.marshal.gz').freeze
+ class DisplayWidth
+ VERSION = "2.0.0"
+ UNICODE_VERSION = "13.0.0"
+ DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) +
"/../../../data/")
+ INDEX_FILENAME = DATA_DIRECTORY + "/display_width.marshal.gz"
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/unicode/display_width/index.rb
new/lib/unicode/display_width/index.rb
--- old/lib/unicode/display_width/index.rb 2020-03-11 14:34:04.000000000
+0100
+++ new/lib/unicode/display_width/index.rb 2020-12-30 10:10:25.000000000
+0100
@@ -1,8 +1,10 @@
-require 'zlib'
-require_relative 'constants'
+# frozen_string_literal: true
+
+require "zlib"
+require_relative "constants"
module Unicode
- module DisplayWidth
+ class DisplayWidth
File.open(INDEX_FILENAME, "rb") do |file|
serialized_data = Zlib::GzipReader.new(file).read
serialized_data.force_encoding Encoding::BINARY
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/unicode/display_width/no_string_ext.rb
new/lib/unicode/display_width/no_string_ext.rb
--- old/lib/unicode/display_width/no_string_ext.rb 2020-03-11
14:34:04.000000000 +0100
+++ new/lib/unicode/display_width/no_string_ext.rb 2020-12-30
10:10:25.000000000 +0100
@@ -1,7 +1,8 @@
-module Unicode
- module DisplayWidth
- NO_STRING_EXT = true
- end
-end
+# frozen_string_literal: true
-require_relative '../display_width'
+warn "You are loading 'unicode-display_width/no_string_ext'\n" \
+ "Beginning with version 2.0, this is not necessary anymore\n"\
+ "You can just require 'unicode-display_width' now and no\n"\
+ "string extension will be loaded"
+
+require_relative "../display_width"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/unicode/display_width/string_ext.rb
new/lib/unicode/display_width/string_ext.rb
--- old/lib/unicode/display_width/string_ext.rb 2020-03-11 14:34:04.000000000
+0100
+++ new/lib/unicode/display_width/string_ext.rb 2020-12-30 10:10:25.000000000
+0100
@@ -1,17 +1,9 @@
-require_relative '../display_width' unless defined? Unicode::DisplayWidth
+# frozen_string_literal: true
+
+require_relative "../display_width" unless defined? Unicode::DisplayWidth
class String
def display_width(ambiguous = 1, overwrite = {}, options = {})
Unicode::DisplayWidth.of(self, ambiguous, overwrite, options)
end
-
- def display_size(*args)
- warn "Deprecation warning: Please use `String#display_width` instead of
`String#display_size`"
- display_width(*args)
- end
-
- def display_length(*args)
- warn "Deprecation warning: Please use `String#display_width` instead of
`String#display_length`"
- display_width(*args)
- end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/unicode/display_width.rb
new/lib/unicode/display_width.rb
--- old/lib/unicode/display_width.rb 2020-03-11 14:34:04.000000000 +0100
+++ new/lib/unicode/display_width.rb 2020-12-30 10:10:25.000000000 +0100
@@ -1,8 +1,10 @@
-require_relative 'display_width/constants'
-require_relative 'display_width/index'
+# frozen_string_literal: true
+
+require_relative "display_width/constants"
+require_relative "display_width/index"
module Unicode
- module DisplayWidth
+ class DisplayWidth
DEPTHS = [0x10000, 0x1000, 0x100, 0x10].freeze
def self.of(string, ambiguous = 1, overwrite = {}, options = {})
@@ -40,12 +42,24 @@
extra_width
end
- end
-end
-# Allows you to opt-out of the default string extension. Will eventually be
removed,
-# so you must opt-in for the core extension by requiring
'display_width/string_ext'
-unless defined?(Unicode::DisplayWidth::NO_STRING_EXT) &&
Unicode::DisplayWidth::NO_STRING_EXT
- require_relative 'display_width/string_ext'
+ def initialize(ambiguous: 1, overwrite: {}, emoji: false)
+ @ambiguous = ambiguous
+ @overwrite = overwrite
+ @emoji = emoji
+ end
+
+ def get_config(**kwargs)
+ [
+ kwargs[:ambiguous] || @ambiguous,
+ kwargs[:overwrite] || @overwrite,
+ { emoji: kwargs[:emoji] || @emoji },
+ ]
+ end
+
+ def of(string, **kwargs)
+ self.class.of(string, *get_config(**kwargs))
+ end
+ end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2020-03-11 14:34:04.000000000 +0100
+++ new/metadata 2020-12-30 10:10:25.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: unicode-display_width
version: !ruby/object:Gem::Version
- version: 1.7.0
+ version: 2.0.0
platform: ruby
authors:
- Jan Lelis
autorequire:
bindir: bin
cert_chain: []
-date: 2020-03-11 00:00:00.000000000 Z
+date: 2020-12-30 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rspec
@@ -30,14 +30,14 @@
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '10.4'
+ version: '13.0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
- version: '10.4'
+ version: '13.0'
description: "[Unicode 13.0.0] Determines the monospace display width of a
string
using EastAsianWidth.txt, Unicode general category, and other data."
email:
@@ -80,7 +80,7 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.1.2
+rubygems_version: 3.2.3
signing_key:
specification_version: 4
summary: Determines the monospace display width of a string in Ruby.