xre 0.5.1-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7bae98cc2bd020f242229b873020a54be674ffb96d7c865e5adb502344a4b6fe
4
+ data.tar.gz: 50c9942e9f5abe3ef32225295643e13f5b96ec1c6a3da752de06b416179d74d8
5
+ SHA512:
6
+ metadata.gz: 532f3e3e5110340a25d2e296665b78a98b19a4bf7f31783c14843faf53525ec1953ab72009431f83f4a9cf45570468266f0b3e6d8457cd9aac51d628054896f9
7
+ data.tar.gz: 5f3e912c1f32c50d605fef2b78e665778d8bbe6a4f07f6d015681eb337d4743c4bc7702c0f2227ce9bb117d612f69a6964c36e538eeb46899b4ffe4548037388
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.
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xre
4
+ VERSION = "0.5.1"
5
+ end
data/lib/xre/xre.so 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.1
5
+ platform: x86_64-linux
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.so
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: []