-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply linting to source and test code
- Loading branch information
Showing
35 changed files
with
1,583 additions
and
1,429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
group :development, :test do | ||
gem 'rake', '>= 12.3.3' | ||
gem 'rspec', '~> 3.9' | ||
gem 'rubocop', '~> 1.60' | ||
gem 'rubocop-minitest', '~> 0.34.5' | ||
gem 'rubocop-packaging', '~> 0.5.2' | ||
gem 'rubocop-rspec', '~> 2.27' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# encoding: utf-8 | ||
require 'benchmark' | ||
|
||
require "benchmark" | ||
|
||
$LOAD_PATH.unshift "lib" | ||
require "ffi-icu" | ||
require "rchardet" | ||
$LOAD_PATH.unshift('lib') | ||
require 'ffi-icu' | ||
require 'rchardet' | ||
|
||
TESTS = 1000 | ||
|
||
Benchmark.bmbm do |results| | ||
results.report("rchardet:") { TESTS.times { CharDet.detect("æåø") } } | ||
results.report("ffi-icu:") { TESTS.times { ICU::CharDet.detect("æåø") } } | ||
end | ||
results.report('rchardet:') { TESTS.times { CharDet.detect('æåø') } } | ||
results.report('ffi-icu:') { TESTS.times { ICU::CharDet.detect('æåø') } } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# encoding: utf-8 | ||
require 'benchmark' | ||
|
||
require "benchmark" | ||
|
||
$LOAD_PATH.unshift "lib" | ||
require "ffi-icu" | ||
require "rchardet" | ||
$LOAD_PATH.unshift('lib') | ||
require 'ffi-icu' | ||
require 'rchardet' | ||
|
||
TESTS = 1000 | ||
|
||
$rchardet = CharDet::UniversalDetector.new | ||
$icu = ICU::CharDet::Detector.new | ||
rchardet = CharDet::UniversalDetector.new | ||
icu = ICU::CharDet::Detector.new | ||
|
||
Benchmark.bmbm do |results| | ||
results.report("rchardet instance:") { TESTS.times { $rchardet.reset; $rchardet.feed("æåø"); $rchardet.result } } | ||
results.report("ffi-icu instance:") { TESTS.times { $icu.detect("æåø") } } | ||
end | ||
results.report('rchardet instance:') do | ||
TESTS.times do | ||
rchardet.reset | ||
rchardet.feed('æåø') | ||
rchardet.result | ||
end | ||
end | ||
results.report('ffi-icu instance:') { TESTS.times { icu.detect('æåø') } } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,33 @@ | ||
require_relative "lib/ffi-icu/version" | ||
require_relative 'lib/ffi-icu/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "ffi-icu" | ||
spec.name = 'ffi-icu' | ||
spec.version = ICU::VERSION | ||
spec.platform = Gem::Platform::RUBY # rely on FFI library, but being platform-independent | ||
|
||
spec.required_rubygems_version = Gem::Requirement.new(">= 2.5.0") | ||
spec.authors = ["Jari Bakken"] | ||
spec.date = "2019-10-15" | ||
spec.licenses = ["MIT"] | ||
spec.summary = "Simple Ruby FFI wrappers for International Components for Unicode (ICU)." | ||
spec.description = "Provides charset detection, locale sensitive collation and more. Depends on libicu." | ||
spec.email = "[email protected]" | ||
spec.homepage = "https://github.com/erickguan/ffi-icu" | ||
|
||
spec.metadata["source_code_uri"] = spec.homepage | ||
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md" | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject do |f| | ||
f.match(%r{^(test|spec|features)/}) | ||
end | ||
spec.bindir = "bin" | ||
spec.required_rubygems_version = Gem::Requirement.new('>= 2.5.0') | ||
spec.authors = ['Jari Bakken'] | ||
spec.licenses = ['MIT'] | ||
spec.summary = 'Simple Ruby FFI wrappers for International Components for Unicode (ICU).' | ||
spec.description = 'Provides charset detection, locale sensitive collation and more. Depends on libicu.' | ||
spec.email = '[email protected]' | ||
spec.homepage = 'https://github.com/erickguan/ffi-icu' | ||
|
||
spec.metadata['source_code_uri'] = spec.homepage | ||
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md" | ||
|
||
spec.files = Dir['lib/**/*.rb', 'Gemfile', 'ffi-icu.gemspec', 'Rakefile'] | ||
spec.bindir = 'bin' | ||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
spec.require_paths = ['lib'] | ||
|
||
spec.extra_rdoc_files = ['LICENSE', 'README.md'] | ||
spec.rdoc_options = ['--charset=UTF-8'] | ||
|
||
spec.extra_rdoc_files = ["LICENSE", "README.md"] | ||
spec.rdoc_options = ["--charset=UTF-8"] | ||
spec.required_ruby_version = '>= 3.0.0' | ||
|
||
spec.add_runtime_dependency "ffi", "~> 1.0", ">= 1.0.9" | ||
spec.add_runtime_dependency "bigdecimal", "~> 3.1" | ||
spec.add_runtime_dependency('bigdecimal', '~> 3.1') | ||
spec.add_runtime_dependency('ffi', '~> 1.0', '>= 1.0.9') | ||
|
||
spec.add_development_dependency('rake', '>= 12.3.3') | ||
spec.add_development_dependency('rspec', '~> 3.9') | ||
spec.add_development_dependency('rubocop', '~> 1.60') | ||
spec.add_development_dependency('rubocop-rspec', '~> 2.27') | ||
spec.add_development_dependency('rubocop-minitest', '~> 0.34.5') | ||
spec.add_development_dependency('rubocop-packaging', '~> 0.5.2') | ||
spec.metadata['rubygems_mfa_required'] = 'true' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.