xre 0.5.2-arm64-darwin
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 +7 -0
- data/README.md +54 -0
- data/lib/xre/version.rb +5 -0
- data/lib/xre/xre.bundle +0 -0
- data/lib/xre.rb +26 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8b07765cf4a57ebe7fb9bb226eeb91fd153135a748bd96baf158e08b7a62c62c
|
4
|
+
data.tar.gz: 12746265ee9f4665daa236647bef8c1135445a2079f56a40c8802757fdc24d93
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7c952f1b631432dff1b852d45ad3213783ee867deb219b08910304220e06cd041d06107790cfcade57b10a262e01dd7f71932b18b26016e3bb38173c8dd17e4a
|
7
|
+
data.tar.gz: 6d67ab597c02781f2d3af778381afce0c32dc6bd5d6f86a56c8a1e8571c30ccbfb7772c875c91332344cd70002e1ac05f7bc490fab32e5ea0e430aca64dc87eb
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# Xre
|
2
|
+
|
3
|
+
This is a rust extension for finding all the matches in a text.
|
4
|
+
It's a simple extension that is used in one part of our codebase and this extension makes it substantially faster.
|
5
|
+
|
6
|
+
The following text assumes you're in the `xre` directory inside `clearscope` project.
|
7
|
+
|
8
|
+
## How to build rust code localy:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
rake compile
|
12
|
+
```
|
13
|
+
|
14
|
+
sometimes you might need to clean the build:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
rake clean
|
18
|
+
```
|
19
|
+
|
20
|
+
you might need to install rust toolchain for that:
|
21
|
+
|
22
|
+
```bash
|
23
|
+
curl https://sh.rustup.rs -sSf | sh
|
24
|
+
```
|
25
|
+
|
26
|
+
## How to run tests:
|
27
|
+
|
28
|
+
### Ruby tests:
|
29
|
+
|
30
|
+
Our ruby tests live in the regular `spec` directory of the project, so inside `clearscope` run:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
bundle exec rspec spec/xre
|
34
|
+
```
|
35
|
+
|
36
|
+
### Rust tests:
|
37
|
+
|
38
|
+
```bash
|
39
|
+
cargo test
|
40
|
+
```
|
41
|
+
|
42
|
+
## How to publish the gem:
|
43
|
+
|
44
|
+
First, increment the version in the `lib/xre/version.rb` file according to the semantic versioning rules.
|
45
|
+
|
46
|
+
Then build the gem and push it to rubygems:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
rake build
|
50
|
+
gem push pkg/xre-<version>-gem
|
51
|
+
```
|
52
|
+
|
53
|
+
> Note, currently only [`barseek`](https://github.com/Vagab) has access to the rubygems account, so you might need to ask him to publish the gem.
|
54
|
+
> As soon as this changes and we get a team rubygems account the README will be updated.
|
data/lib/xre/version.rb
ADDED
data/lib/xre/xre.bundle
ADDED
Binary file
|
data/lib/xre.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
begin
|
4
|
+
RUBY_VERSION =~ /(\d+\.\d+)/
|
5
|
+
require_relative "xre/#{Regexp.last_match(1)}/xre"
|
6
|
+
rescue LoadError
|
7
|
+
require_relative "xre/xre"
|
8
|
+
end
|
9
|
+
|
10
|
+
module Xre
|
11
|
+
class RegexList
|
12
|
+
def captures(text, context_radius: nil)
|
13
|
+
if context_radius
|
14
|
+
__captures_with_context(text, context_radius)
|
15
|
+
else
|
16
|
+
__captures_without_context(text)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def inspect
|
21
|
+
"#<Xre::RegexList targets=#{__targets}"
|
22
|
+
end
|
23
|
+
|
24
|
+
private :__captures_with_context, :__captures_without_context, :__targets
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xre
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.2
|
5
|
+
platform: arm64-darwin
|
6
|
+
authors:
|
7
|
+
- barseek
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- sergey.b@hey.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- lib/xre.rb
|
22
|
+
- lib/xre/version.rb
|
23
|
+
- lib/xre/xre.bundle
|
24
|
+
homepage: https://github.com/vagab/xre
|
25
|
+
licenses:
|
26
|
+
- MIT
|
27
|
+
metadata:
|
28
|
+
homepage_uri: https://github.com/vagab/xre
|
29
|
+
source_code_uri: https://github.com/vagab/xre
|
30
|
+
rubygems_mfa_required: 'true'
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '3.2'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 3.3.dev
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.3.11
|
48
|
+
requirements: []
|
49
|
+
rubygems_version: 3.4.4
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: short summary, because RubyGems requires one.
|
53
|
+
test_files: []
|