xre 0.5.2-x86_64-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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '06999ead5c27d2fb25d186e60d7e2864962483298471fc831005c6493bee00dc'
4
+ data.tar.gz: 303748e91080f002e3c216ed21810f9ecbcc7976888285e068c887ff56b5ee1e
5
+ SHA512:
6
+ metadata.gz: 7e08ac53642bb3dfcbc7f9c7bf7002aff065de5f7aaac6d95689f508ce169ce19a0fcf167bf02efcd9d3df5d5b58eb28faab4a5c5f84313a02d01e3cc9e8e244
7
+ data.tar.gz: b1f2057e4ef1a2fd5536a022fc5efab88711e5bb5bde1a86d99abbe559b5ed35484cf88c9f79f893e59f276ee2da770c2275f5ff957be1f45fe95a7bef0288e2
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.2"
5
+ end
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: x86_64-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: []