string_view 0.1.0-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.
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Version is set here as a plain string so the gemspec can load it
4
+ # without requiring the C extension.
5
+ # The C extension defines StringView as a class, so we use `class` here.
6
+ class StringView
7
+ VERSION = "0.1.0"
8
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "string_view/version"
4
+
5
+ begin
6
+ # Load the precompiled binary for this Ruby version (from cibuildgem)
7
+ ruby_version = RUBY_VERSION[/^\d+\.\d+/]
8
+ require_relative "string_view/#{ruby_version}/string_view"
9
+ rescue LoadError
10
+ # Fall back to the locally compiled extension
11
+ require_relative "string_view/string_view"
12
+ end
13
+
14
+ class StringView
15
+ # method_missing safety net:
16
+ # Any String method we haven't implemented natively surfaces as a hard error
17
+ # rather than silently falling through.
18
+ def method_missing(name, *args, &block)
19
+ if String.method_defined?(name)
20
+ raise NotImplementedError,
21
+ "StringView##{name} not yet implemented natively. " \
22
+ "Call .to_s.#{name}(...) explicitly if you need it."
23
+ else
24
+ super
25
+ end
26
+ end
27
+
28
+ def respond_to_missing?(name, include_private = false)
29
+ # We don't claim to respond to unimplemented String methods
30
+ if String.method_defined?(name)
31
+ false
32
+ else
33
+ super
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: string_view
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: arm64-darwin
6
+ authors:
7
+ - Shopify
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-03-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: StringView provides a read-only, zero-copy view into a frozen Ruby String,
14
+ avoiding intermediate allocations for slicing, searching, and delegation of transform
15
+ methods. Uses simdutf for SIMD-accelerated UTF-8 character counting.
16
+ email:
17
+ - ruby@shopify.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - LICENSE-simdutf.txt
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - ext/string_view/extconf.rb
27
+ - ext/string_view/simdutf.cpp
28
+ - ext/string_view/simdutf.h
29
+ - ext/string_view/simdutf_c.h
30
+ - ext/string_view/string_view.c
31
+ - lib/string_view.rb
32
+ - lib/string_view/3.3/string_view.bundle
33
+ - lib/string_view/3.4/string_view.bundle
34
+ - lib/string_view/4.0/string_view.bundle
35
+ - lib/string_view/version.rb
36
+ homepage: https://github.com/Shopify/string_view
37
+ licenses:
38
+ - MIT
39
+ metadata:
40
+ homepage_uri: https://github.com/Shopify/string_view
41
+ source_code_uri: https://github.com/Shopify/string_view
42
+ changelog_uri: https://github.com/Shopify/string_view/releases
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '3.3'
52
+ - - "<"
53
+ - !ruby/object:Gem::Version
54
+ version: 4.1.dev
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubygems_version: 3.5.22
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Zero-copy string slicing for Ruby via a C extension.
65
+ test_files: []