cchardet 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79caccb90dff4c75480521201b58e917391cd7aa456b4d07734a627364ec8005
4
- data.tar.gz: e8f9e53f10e87ef646dcee859bbd97cd77ace093ffee8c23da8e3efdadd9efc2
3
+ metadata.gz: 15c796c93834634e0aa4c71da57950fc7a42d43a3a28766d43fd7cf7103936a5
4
+ data.tar.gz: 581baba4d7dc98eb5720933125fdcb47c24272456fbe5cfb3a8b609c42916d0b
5
5
  SHA512:
6
- metadata.gz: d8fb41ab84b626fa1da30517ce706ec89aad3f61652865fcea6d6d4293f4b431d7ea5d37d490fa5e2bb29f6f2e00f99c1a465544a9565c2900aa6518b2b83811
7
- data.tar.gz: 62a8ee2996e8315115436b4ab0cbec41f3af658eb0778f7252d02dbc35f1567445a57622d80c6a5a14200225cb5a0080853dbfc1eaa2ac23cdc65b382a2e73db
6
+ metadata.gz: 3e40197160218e7893d5250cd2c6504d8cbd128d4ff8ade21c0621d80a3faa6498070285dbfa4247363c63a7b66252fcc5c0b06bba86cf669af9937337444f4f
7
+ data.tar.gz: c66c7db53e896f9b609477fed8f67038c9a9143442e563bd79b3ac1ab8fa1cefff709b1c2fd988f098ae853ad246c755402529d9833ee7f8ada8abd2f27f909b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.2.1
2
+ - No functional changes
3
+ - Fix source URL in gemspec
4
+ - Relicense under MIT License. RubyGems recommends using a SPDX-listed license and public domain does not satisfy that.
5
+
1
6
  0.2.0
2
7
  - First functional release
3
8
 
data/README.md CHANGED
@@ -1,35 +1,84 @@
1
- # Cchardet
1
+ # cchardet
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cchardet`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Ruby bindings for freedesktop.org's uchardet (<https://gitlab.freedesktop.org/uchardet/uchardet>).
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ By default, this gem depends on the system uchardet. Alternatively, it can build
6
+ the unreleased `wip/Jehan/improved-API` branch of uchardet as a native extension.
7
+ Note that uchardet's license terms may differ from those of this gem.
6
8
 
7
9
  ## Installation
8
10
 
11
+ ### System uchardet
12
+
9
13
  Add this line to your application's Gemfile:
10
14
 
11
15
  ```ruby
12
- gem 'cchardet'
16
+ gem "cchardet"
13
17
  ```
14
18
 
15
19
  And then execute:
16
20
 
17
- $ bundle install
21
+ ```
22
+ bundle install
23
+ ```
18
24
 
19
25
  Or install it yourself as:
20
26
 
21
- $ gem install cchardet
27
+ ```
28
+ gem install cchardet
29
+ ```
30
+
31
+ ### Unreleased branch as native extension
32
+
33
+ When using bundler:
34
+
35
+ ```
36
+ bundle config set --global build.cchardet --with-unreleased-uchardet
37
+ bundle install
38
+ ```
39
+
40
+ When using gem directly:
41
+
42
+ ```
43
+ gem install cchardet -- --with-unreleased-uchardet
44
+ ```
22
45
 
23
46
  ## Usage
24
47
 
25
- TODO: Write usage instructions here
48
+ ```ruby
49
+ require "cchardet"
50
+
51
+ # ...
52
+
53
+ CChardet.detect(unknown_bytes)
54
+ # released uchardet:
55
+ # { encoding: "UTF-8" }
56
+ # unreleased native extension:
57
+ # { encoding: "UTF-8", confidence: 1.0, language: nil }
58
+ ```
26
59
 
27
- ## Development
60
+ The only public interface is `CChardet.detect`, which takes a sequence of bytes.
28
61
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+ When using a released version of uchardet, it will return a hash with a single
63
+ element, `encoding`, indicating the detected encoding of the byte stream. Future
64
+ versions of uchardet are likely to provide additional fields (see <https://gitlab.freedesktop.org/uchardet/uchardet/-/issues/5#note_474963>).
30
65
 
31
- 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).
66
+ When using the unreleased native extension, it will return an array of hashes
67
+ having three elements:
68
+
69
+ - `encoding` – Detected encoding of the byte stream
70
+ - `confidence` – Confidence of the encoding value
71
+ - `language` – Detected language, if known
72
+
73
+ The hashes are ordered by descending confidence.
32
74
 
33
75
  ## Contributing
34
76
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cchardet.
77
+ Bug reports and pull requests are welcome on GitHub at <https://github.com/elebow/cchardet>.
78
+
79
+ ## License
80
+
81
+ MIT License.
82
+
83
+ Note that uchardet, which may be compiled as a native extension, is covered by its
84
+ own license.
data/cchardet.gemspec CHANGED
@@ -9,12 +9,12 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["elebow@users.noreply.github.com"]
10
10
 
11
11
  spec.summary = "Ruby bindings for freedesktop.org's libuchardet, for encoding detection."
12
- spec.homepage = "https://github.com/elebow/cchardet"
13
- spec.license = "public domain"
12
+ spec.homepage = "https://github.com/elebow/cchardet-ruby"
13
+ spec.license = "MIT"
14
14
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
- spec.metadata["source_code_uri"] = "https://github.com/elebow/cchardet"
17
+ spec.metadata["source_code_uri"] = "https://github.com/elebow/cchardet-ruby"
18
18
  spec.metadata["changelog_uri"] = "https://github.com/elebow/cchardet/blob/trunk/CHANGELOG.md"
19
19
 
20
20
  # Specify which files should be added to the gem when it is released.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CChardet
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cchardet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eddie Lebow
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email:
15
15
  - elebow@users.noreply.github.com
16
16
  executables: []
@@ -333,14 +333,14 @@ files:
333
333
  - lib/cchardet.rb
334
334
  - lib/cchardet/lib_finder.rb
335
335
  - lib/cchardet/version.rb
336
- homepage: https://github.com/elebow/cchardet
336
+ homepage: https://github.com/elebow/cchardet-ruby
337
337
  licenses:
338
- - public domain
338
+ - MIT
339
339
  metadata:
340
- homepage_uri: https://github.com/elebow/cchardet
341
- source_code_uri: https://github.com/elebow/cchardet
340
+ homepage_uri: https://github.com/elebow/cchardet-ruby
341
+ source_code_uri: https://github.com/elebow/cchardet-ruby
342
342
  changelog_uri: https://github.com/elebow/cchardet/blob/trunk/CHANGELOG.md
343
- post_install_message:
343
+ post_install_message:
344
344
  rdoc_options: []
345
345
  require_paths:
346
346
  - lib
@@ -355,8 +355,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  - !ruby/object:Gem::Version
356
356
  version: '0'
357
357
  requirements: []
358
- rubygems_version: 3.2.3
359
- signing_key:
358
+ rubyforge_project:
359
+ rubygems_version: 2.7.6.2
360
+ signing_key:
360
361
  specification_version: 4
361
362
  summary: Ruby bindings for freedesktop.org's libuchardet, for encoding detection.
362
363
  test_files: []