Skip to content

Commit

Permalink
Merge pull request #195 from artichoke/dev/lopopolo-bumps
Browse files Browse the repository at this point in the history
Upgrade Ruby, Bundler, Unicode to 16.0.0, Unicode License
  • Loading branch information
lopopolo authored Dec 8, 2024
2 parents e02f64f + 77ca4e0 commit 20e90da
Show file tree
Hide file tree
Showing 29 changed files with 6,027 additions and 546 deletions.
3 changes: 3 additions & 0 deletions .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
- name: "A-titlecase"
color: "f7e101"
description: "Area: Titlecase case mapping."
- name: "A-unicode"
color: "f7e101"
description: "Area: Unicode tables and version bumps."
- name: "A-uppercase"
color: "f7e101"
description: "Area: Uppercase case mapping."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/[email protected]

- name: Install Ruby toolchain
uses: ruby/setup-ruby@7d3497fd78c07c0d84ebafa58d8dac60cd1f0763 # v1.199.0
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
ruby-version: ".ruby-version"
bundler-cache: true
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
cargo generate-lockfile --verbose
fi
- uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # v2.0.1
- uses: EmbarkStudios/cargo-deny-action@2d8c9929d8f9f42bedba73f1287cb0b479f07acb # v2.0.3
with:
arguments: --locked --all-features
command: check ${{ matrix.checks }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
uses: actions/[email protected]

- name: Install Ruby toolchain
uses: ruby/setup-ruby@7d3497fd78c07c0d84ebafa58d8dac60cd1f0763 # v1.199.0
uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
with:
ruby-version: ".ruby-version"
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.3
3.3.6
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
[package]
name = "roe"
version = "0.0.6" # remember to set `html_root_url` in `src/lib.rs`.
version = "0.0.7" # remember to set `html_root_url` in `src/lib.rs`.
authors = ["Ryan Lopopolo <[email protected]>"]
license = "MIT"
edition = "2018"
license = "MIT AND Unicode-3.0"
edition = "2021"
rust-version = "1.76.0"
readme = "README.md"
repository = "https://github.com/artichoke/roe"
documentation = "https://docs.rs/roe"
homepage = "https://github.com/artichoke/roe"
description = "Unicode case conversion"
keywords = ["capitalize", "case", "lowercase", "unicode", "uppercase"]
categories = ["encoding", "internationalization", "no-std", "no-std::no-alloc", "text-processing"]
include = ["src/**/*", "generated/**/*", "tests/**/*", "LICENSE", "README.md"]
include = ["/src/**/*", "/generated/**/*", "/tests/**/*", "/LICENSE", "/LICENSE-UNICODE", "/README.md"]

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ source 'https://rubygems.org'

gem 'bundler-audit', '~> 0.9', require: false
gem 'rake', '>= 12.3.3', require: false
gem 'rubocop', '~> 1.68', require: false
gem 'rubocop', '~> 1.69', require: false
gem 'rubocop-rake', '~> 0.6', require: false
22 changes: 12 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,44 @@ GEM
bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
json (2.7.5)
json (2.8.2)
language_server-protocol (3.17.0.3)
parallel (1.26.3)
parser (3.3.5.1)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rubocop (1.68.0)
regexp_parser (2.9.3)
rubocop (1.69.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
rubocop-ast (>= 1.36.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.2)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
thor (1.3.2)
unicode-display_width (2.6.0)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)

PLATFORMS
ruby

DEPENDENCIES
bundler-audit (~> 0.9)
rake (>= 12.3.3)
rubocop (~> 1.68)
rubocop (~> 1.69)
rubocop-rake (~> 0.6)

BUNDLED WITH
2.5.15
2.5.23
39 changes: 39 additions & 0 deletions LICENSE-UNICODE
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
UNICODE LICENSE V3

COPYRIGHT AND PERMISSION NOTICE

Copyright © 1991-2024 Unicode, Inc.

NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.

Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.

IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.
68 changes: 48 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

Implements [Unicode case mapping] for [conventionally UTF-8 binary strings].

[unicode case mapping]: https://unicode.org/faq/casemap_charprop.html#casemap
[conventionally utf-8 binary strings]:
https://docs.rs/bstr/1.*/bstr/#when-should-i-use-byte-strings

> Case mapping or case conversion is a process whereby strings are converted to
> a particular form—uppercase, lowercase, or titlecase—possibly for display to
> the user.
Expand All @@ -20,8 +24,33 @@ and uppercase forms. This crate is used to implement [`String#capitalize`],
[`Symbol#capitalize`], [`String#downcase`], [`Symbol#downcase`],
[`String#upcase`], and [`Symbol#upcase`] in [Artichoke Ruby].

[`string#capitalize`]:
https://ruby-doc.org/core-3.1.2/String.html#method-i-capitalize
[`symbol#capitalize`]:
https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-capitalize
[`string#downcase`]:
https://ruby-doc.org/core-3.1.2/String.html#method-i-downcase
[`symbol#downcase`]:
https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-downcase
[`string#upcase`]: https://ruby-doc.org/core-3.1.2/String.html#method-i-upcase
[`symbol#upcase`]: https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-upcase
[artichoke ruby]: https://github.com/artichoke/artichoke

This crate depends on [`bstr`].

[`bstr`]: https://crates.io/crates/bstr

## Implementation

Roe generates conversion tables from Unicode Data Files. Roe implements case
mapping as defined in the [Unicode standard][casemap] (see [`PropList.txt`],
[`SpecialCasing.txt`], [`UnicodeData.txt`]).

[casemap]: https://unicode.org/faq/casemap_charprop.html#casemap
[`proplist.txt`]: generated/ucd/PropList.txt
[`specialcasing.txt`]: generated/ucd/SpecialCasing.txt
[`unicodedata.txt`]: generated/ucd/UnicodeData.txt

## Status

This crate is currently a _work in progress_. When the API is complete, Roe will
Expand All @@ -36,7 +65,7 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
roe = "0.0.6"
roe = "0.0.7"
```

Then convert case like:
Expand Down Expand Up @@ -71,27 +100,26 @@ assert_eq!(
collections library. This feature enables APIs that allocate [`String`] or
[`Vec`].

## License

`roe` is licensed under the [MIT License](LICENSE) (c) Ryan Lopopolo.

[unicode case mapping]: https://unicode.org/faq/casemap_charprop.html#casemap
[conventionally utf-8 binary strings]:
https://docs.rs/bstr/1.*/bstr/#when-should-i-use-byte-strings
[`string#capitalize`]:
https://ruby-doc.org/core-3.1.2/String.html#method-i-capitalize
[`symbol#capitalize`]:
https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-capitalize
[`string#downcase`]:
https://ruby-doc.org/core-3.1.2/String.html#method-i-downcase
[`symbol#downcase`]:
https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-downcase
[`string#upcase`]: https://ruby-doc.org/core-3.1.2/String.html#method-i-upcase
[`symbol#upcase`]: https://ruby-doc.org/core-3.1.2/Symbol.html#method-i-upcase
[artichoke ruby]: https://github.com/artichoke/artichoke
[`bstr`]: https://crates.io/crates/bstr
[`alloc`]: https://doc.rust-lang.org/alloc/index.html
[`std`]: https://doc.rust-lang.org/std/index.html
[`std::error::error`]: https://doc.rust-lang.org/std/error/trait.Error.html
[`string`]: https://doc.rust-lang.org/stable/alloc/string/struct.String.html
[`vec`]: https://doc.rust-lang.org/stable/alloc/vec/struct.Vec.html

## Unicode Version

Roe implements Unicode case mapping with the Unicode 16.0.0 case mapping
ruleset.

Each new release of Unicode may bring updates to the Data Files which are the
source for the case mappings in this crate. Updates to the case mapping rules
will be accompanied with a minor version bump.

## License

`roe` is licensed under the [MIT License](LICENSE) (c) Ryan Lopopolo.

`roe` includes Unicode Data Files which are subject to the [Unicode Terms of
Use] and [Unicode License v3](LICENSE-UNICODE) (c) 1991-2024 Unicode, Inc.

[unicode terms of use]: https://www.unicode.org/copyright.html
32 changes: 32 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,40 @@ namespace :unicode do
sh 'cargo clippy --fix --allow-dirty'
end

# Per the Unicode Terms of Use -- https://www.unicode.org/copyright.html --
# data found under `https://www.unicode.org/Public/` are considered Unicode
# Data Files and are subject to these constaints:
#
# - Except where otherwise more broadly permitted or licensed:
# - you may not make copies of or modifications to Unicode Products for
# public distribution, or incorporate Unicode Products in whole or in part
# into any product or publication, or otherwise publicly distribute them,
# without the express written permission of Unicode, and
# - you may not copy or extract fonts or font data from any Unicode Products,
# including but not limited to Unicode Code Charts.
# - All Unicode Data Files and Unicode Software are subject to the terms and
# conditions of the free and open-source Unicode License v3, unless otherwise
# indicated by specific restriction, permission, or license identified at the
# point of release or in such software, data file, or other documentation.
#
# The Unicode License v3, which can be found at <https://www.unicode.org/license.txt>
# is included in this repository. The license requires one of:
#
# (a) this copyright and permission notice appear with all copies of the Data
# Files or Software
# (b) this copyright and permission notice appear in associated Documentation
#
# `roe` distributes this license as `LICENSE-UNICODE` in crate bundles
# and includes `AND Unicode-3.0` in the `Cargo.toml` SPDX license expression.
# See: https://spdx.org/licenses/Unicode-3.0.html.
#
# Updates to Unicode Data Files performed by this `rake` task also update the
# embedded license.
desc 'Update Unicode data'
task :update do
URI.parse('https://www.unicode.org/license.txt').open do |data|
IO.copy_stream(data, 'LICENSE-UNICODE')
end
%w[UnicodeData.txt SpecialCasing.txt PropList.txt].each do |filename|
uri = "https://www.unicode.org/Public/UCD/latest/ucd/#{filename}"
URI.parse(uri).open do |data|
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ignore = []
[licenses]
allow = [
"MIT",
"Unicode-3.0",
]

[bans]
Expand Down
Loading

0 comments on commit 20e90da

Please sign in to comment.