unicodedata_rb 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b94b702d482f678dcff6f587e9cf8c2f30456a75da14d13f7421e8dc8724b951
4
+ data.tar.gz: 0ebd2e2dcf3f1dab5aef1761738d3de6539ed75eb9ba4b4ce6283783881a8c22
5
+ SHA512:
6
+ metadata.gz: 81e52c4d5a36c558c2144f74b30024c921969a3c848fa011c08a3d6fa89d2f2ab76a9ed3770b5e50c0dfb5c0521c86aa2808e2cb60433a7efe1b238c69abfaa8
7
+ data.tar.gz: 27f29908a1302e49479e7e5a0c65851cac971717f516bf1e9a810af077852e31b7f3319536c63656b81160914fac6b92f49b4d19a25b7f83f328a40f19fd4446
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-06-18
4
+
5
+ - Initial release
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ unicodedata_rb (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.5.1)
10
+ rake (13.2.1)
11
+ rspec (3.13.0)
12
+ rspec-core (~> 3.13.0)
13
+ rspec-expectations (~> 3.13.0)
14
+ rspec-mocks (~> 3.13.0)
15
+ rspec-core (3.13.0)
16
+ rspec-support (~> 3.13.0)
17
+ rspec-expectations (3.13.1)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.13.0)
20
+ rspec-mocks (3.13.1)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.13.0)
23
+ rspec-support (3.13.1)
24
+
25
+ PLATFORMS
26
+ arm64-darwin-23
27
+
28
+ DEPENDENCIES
29
+ rake (~> 13.0)
30
+ rspec (~> 3.0)
31
+ unicodedata_rb!
32
+
33
+ BUNDLED WITH
34
+ 2.4.13
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 nebel95
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # UnicodedataRb
2
+
3
+ Ruby wrapper for unicode data.
4
+
5
+ ## Installation
6
+
7
+ $ gem install unicodedata_rb
8
+
9
+ ## Usage
10
+
11
+ The gem already came with `UnicodeData.txt` version 15.1.0 predownloaded. If you want to redownload a version based on your ruby installation (configured with `RbConfig::CONFIG["UNICODE_VERSION"]`), run `UnicodedataRb.generate_index`.
12
+
13
+ ```ruby
14
+ codepoint = UnicodedataRb.codepoint_from_char("n")
15
+ # codepoint field names are codepoint, name, category, combining_class, bidi_class, decomposition, digit_value, non_decimal_digit_value, numeric_value, bidi_mirrored, unicode1_name, iso_comment, simple_uppercase_map, simple_lowercase_map, simple_titlecase_map.
16
+
17
+ puts codepoint.name # should print LATIN SMALL LETTER N
18
+
19
+ # can also query by code value or name
20
+ UnicodedataRb.codepoint_from_name("RIGHT CURLY BRACKET")
21
+ UnicodedataRb.codepoint(214) # or UnicodedataRb.codepoint(0x00D6)
22
+ ```
23
+
24
+ ## Development
25
+
26
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
27
+
28
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
29
+
30
+ ## Contributing
31
+
32
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/unicodedata_rb.
33
+
34
+ ## License
35
+
36
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec