mini_suffix 0.1.0 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +49 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +24 -0
- data/README.md +10 -2
- data/build-libpsl.sh +28 -0
- data/lib/mini_suffix/version.rb +1 -1
- data/lib/mini_suffix.rb +8 -1
- data/mini_suffix.gemspec +3 -3
- data/vendor/libpsl.aarch64.so +0 -0
- data/vendor/libpsl.darwin-arm64.dylib +0 -0
- data/vendor/libpsl.darwin-i386.dylib +0 -0
- data/vendor/libpsl.ppc64le.so +0 -0
- data/vendor/libpsl.x86_64.so +0 -0
- metadata +20 -14
- data/.travis.yml +0 -5
- data/vendor/libpsl.so +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fccde82176bf00cfeafda11ca5155185a0dd476a6a22531289883a20d20da96d
|
4
|
+
data.tar.gz: e8e30e2c0433f05fb37338809276c909c2dcf82c9dc5075c48b2a469870e7928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff8f7597ce5345ce451ec496d48ff667dec1b13e86d0075af34a1f1baacf2d70c38b20648122f3adb49558a0468d5452e4647770939348cd285156fd3bf0fbf2
|
7
|
+
data.tar.gz: 203f22ca8c0da035d40291600a19d3552967e276d857edbb66dea702fc10bf4002c6c1e14c4d82c9fa04e84f8a1223df1ecd7c4e3dd552212d36049f924a0e13
|
@@ -0,0 +1,49 @@
|
|
1
|
+
name: Mini Suffix Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
- main
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby: ["2.7", "2.6", "2.5"]
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
- name: Bundler cache
|
24
|
+
uses: actions/cache@v2
|
25
|
+
with:
|
26
|
+
path: vendor/bundle
|
27
|
+
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
28
|
+
restore-keys: |
|
29
|
+
${{ runner.os }}-${{ matrix.ruby }}-gems-
|
30
|
+
- name: Setup gems
|
31
|
+
run: |
|
32
|
+
bundle config path vendor/bundle
|
33
|
+
bundle install --jobs 4
|
34
|
+
- name: Tests
|
35
|
+
run: bundle exec rspec
|
36
|
+
publish:
|
37
|
+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
|
38
|
+
needs: build
|
39
|
+
runs-on: ubuntu-latest
|
40
|
+
|
41
|
+
steps:
|
42
|
+
- uses: actions/checkout@v2
|
43
|
+
|
44
|
+
- name: Release Gem
|
45
|
+
uses: discourse/publish-rubygems-action@v2
|
46
|
+
env:
|
47
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
48
|
+
GIT_EMAIL: team@discourse.org
|
49
|
+
GIT_NAME: discoursebot
|
data/.gitmodules
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# 0.3.3
|
2
|
+
|
3
|
+
* Add libpsl shared libary for Linux aarch64
|
4
|
+
|
5
|
+
*xfalcox*
|
6
|
+
|
7
|
+
# 0.3.2
|
8
|
+
|
9
|
+
* Bump libpsl to v0.21.1, and bump binaries
|
10
|
+
* Add binary for Apple silicon devices
|
11
|
+
|
12
|
+
*davidtaylorhq*
|
13
|
+
|
14
|
+
# 0.3.1
|
15
|
+
|
16
|
+
* Add libpsl shared libary for Linux ppc64le
|
17
|
+
|
18
|
+
*runlevel5*
|
19
|
+
|
20
|
+
# 0.3.0
|
21
|
+
|
22
|
+
* Add libpsl shared library for osx support.
|
23
|
+
|
24
|
+
*tgxworld*
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
## Installation
|
4
4
|
|
5
5
|
### Debian
|
6
|
-
`sudo apt-get install libpsl-dev`
|
7
6
|
|
8
7
|
Add this line to your application's Gemfile:
|
9
8
|
|
@@ -31,7 +30,7 @@ MiniSuffix.domain("www.careers.gov.sg")
|
|
31
30
|
# => "careers.gov.sg"
|
32
31
|
```
|
33
32
|
|
34
|
-
##Benchmark
|
33
|
+
## Benchmark
|
35
34
|
|
36
35
|
```
|
37
36
|
# benchmark/bench.rb
|
@@ -59,6 +58,15 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
59
58
|
|
60
59
|
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
60
|
|
61
|
+
## Updating libpsl
|
62
|
+
|
63
|
+
Libpsl binaries are bundled with the gem. The current version is checked out as a submodule in `./libpsl/`. To update, checkout a later commit
|
64
|
+
in the submodule (ideally matching an upstream release tag). You will then need to rebuild the binaries for all architectures. This requires running `./build-libpsl.sh` in each environment. Depending on your setup, you may be able to accomplish that via virtual machines and/or Docker.
|
65
|
+
|
66
|
+
Check the comments in `./build-libpsl.sh` for more information.
|
67
|
+
|
68
|
+
The submodule bump and updated binaries should be checked in to the repository.
|
69
|
+
|
62
70
|
## Contributing
|
63
71
|
|
64
72
|
Bug reports and pull requests are welcome on GitHub at https://github.com/discourse/mini_suffix.
|
data/build-libpsl.sh
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#! /bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
export DEBIAN_FRONTEND=noninteractive
|
5
|
+
cd $(dirname ${BASH_SOURCE[0]})/libpsl
|
6
|
+
|
7
|
+
# A rough script to build libpsl from source, and move the binary to the /vendor directory.
|
8
|
+
#
|
9
|
+
# On linux, you will need a number of dependencies:
|
10
|
+
# apt-get update
|
11
|
+
# apt-get install -y meson gcc clang libtool llvm-dev valgrind python3 python3-setuptools libicu-dev
|
12
|
+
#
|
13
|
+
# On macOS, run this script in the homebrew build environment using `brew sh -c ./build-libpsl.sh`
|
14
|
+
#
|
15
|
+
# If you're running this, make sure to update the binaries for all other architectures as well
|
16
|
+
|
17
|
+
rm -rf builddir
|
18
|
+
meson builddir --buildtype=release -Druntime=no -Dbuiltin=libicu
|
19
|
+
ninja -C builddir
|
20
|
+
ninja -C builddir test
|
21
|
+
|
22
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
23
|
+
cp builddir/src/libpsl.dylib ../vendor/libpsl.darwin-$(arch).dylib
|
24
|
+
else
|
25
|
+
cp builddir/src/libpsl.so ../vendor/libpsl.$(arch).so
|
26
|
+
fi
|
27
|
+
|
28
|
+
echo "Done $(arch)"
|
data/lib/mini_suffix/version.rb
CHANGED
data/lib/mini_suffix.rb
CHANGED
@@ -4,7 +4,14 @@ require 'ffi'
|
|
4
4
|
module MiniSuffix
|
5
5
|
extend FFI::Library
|
6
6
|
|
7
|
-
ffi_lib
|
7
|
+
ffi_lib [
|
8
|
+
File.join(File.dirname(File.expand_path('..', __FILE__)), 'vendor/libpsl.aarch64.so'),
|
9
|
+
File.join(File.dirname(File.expand_path('..', __FILE__)), 'vendor/libpsl.x86_64.so'),
|
10
|
+
File.join(File.dirname(File.expand_path('..', __FILE__)), 'vendor/libpsl.ppc64le.so'),
|
11
|
+
File.join(File.dirname(File.expand_path('..', __FILE__)), 'vendor/libpsl.darwin-i386.dylib'),
|
12
|
+
File.join(File.dirname(File.expand_path('..', __FILE__)), 'vendor/libpsl.darwin-arm64.dylib'),
|
13
|
+
]
|
14
|
+
|
8
15
|
attach_function :psl_builtin, [], :pointer
|
9
16
|
attach_function :psl_registrable_domain, [:pointer, :string], :string
|
10
17
|
attach_function :psl_get_version, [], :string
|
data/mini_suffix.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_dependency 'ffi', '~> 1.9'
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler"
|
27
|
-
spec.add_development_dependency "rake", "
|
28
|
-
spec.add_development_dependency "rspec", "
|
26
|
+
spec.add_development_dependency "bundler"
|
27
|
+
spec.add_development_dependency "rake", "> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "> 3.0"
|
29
29
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_suffix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guo Xiang Tan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -28,42 +28,42 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '10.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
69
|
description:
|
@@ -73,9 +73,11 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".github/workflows/ci.yml"
|
76
77
|
- ".gitignore"
|
78
|
+
- ".gitmodules"
|
77
79
|
- ".rspec"
|
78
|
-
-
|
80
|
+
- CHANGELOG.md
|
79
81
|
- Gemfile
|
80
82
|
- LICENSE.txt
|
81
83
|
- README.md
|
@@ -83,10 +85,15 @@ files:
|
|
83
85
|
- benchmark/bench.rb
|
84
86
|
- bin/console
|
85
87
|
- bin/setup
|
88
|
+
- build-libpsl.sh
|
86
89
|
- lib/mini_suffix.rb
|
87
90
|
- lib/mini_suffix/version.rb
|
88
91
|
- mini_suffix.gemspec
|
89
|
-
- vendor/libpsl.so
|
92
|
+
- vendor/libpsl.aarch64.so
|
93
|
+
- vendor/libpsl.darwin-arm64.dylib
|
94
|
+
- vendor/libpsl.darwin-i386.dylib
|
95
|
+
- vendor/libpsl.ppc64le.so
|
96
|
+
- vendor/libpsl.x86_64.so
|
90
97
|
homepage: https://github.com/discourse/mini_suffix
|
91
98
|
licenses:
|
92
99
|
- MIT
|
@@ -106,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
113
|
- !ruby/object:Gem::Version
|
107
114
|
version: '0'
|
108
115
|
requirements: []
|
109
|
-
|
110
|
-
rubygems_version: 2.6.13
|
116
|
+
rubygems_version: 3.1.6
|
111
117
|
signing_key:
|
112
118
|
specification_version: 4
|
113
119
|
summary: FFI wrapper for libpsl
|
data/.travis.yml
DELETED
data/vendor/libpsl.so
DELETED
Binary file
|