fast_underscore 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50dc42327d05bff80a78c353c9242655080e3db58720726d2b2c6c2ccff2480c
4
- data.tar.gz: e9c42a7a02573cf2657dd1b9832a4e521194923d35349a8f669ea4884a32b129
3
+ metadata.gz: 19f7d80999c34375fec07a65c9508caa62532ab60013eb7f14185ff1ff59c3f9
4
+ data.tar.gz: e1079092105d5ce4ef58957d000e12206f053b471a7f4535ed7f72fbb59913fa
5
5
  SHA512:
6
- metadata.gz: 40cd373a635999114a4d24a6214073fbf814d4307738bcbe4a73029c9d1ce996502b2b33bd73de99316e32b251557a4dd2ab3d4f55d9069ddc1a9cc250d906c8
7
- data.tar.gz: 322ad9ed4bb83659cec1e76ed3a2f62a5107ddfa27c9f931053c715b77ac169e345ba0c15b44d28b9817ebdeb2a4ed8078a9494852f85f39ffa77ff01b90efdd
6
+ metadata.gz: a73bb48fdcbad7d4c3791119f21bba127aeba1400aa4c7baa107162ea8c7de0bb84485502491670febb6698e78e99fa3ef1cdaa32cdcc6c1ffc7f5a12203b9c4
7
+ data.tar.gz: 6bc9a730ad636a5904fe2136f3f29822c5dc25bd570f129131d4619f19f4fd31939c0d01db31873367d8b471fc4de54e25fdd8ac71fd460e3c047aba6bbd9f6f
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.4] - 2024-05-25
10
+
11
+ ### Changed
12
+
13
+ - Trim files from built artifact.
14
+
9
15
  ## [0.3.3] - 2021-11-17
10
16
 
11
17
  ### Changed
@@ -42,7 +48,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
42
48
 
43
49
  - Support for the Rails 5.2 beta.
44
50
 
45
- [unreleased]: https://github.com/kddnewton/fast_underscore/compare/v0.3.3...HEAD
51
+ [unreleased]: https://github.com/kddnewton/fast_underscore/compare/v0.3.4...HEAD
52
+ [0.3.4]: https://github.com/kddnewton/fast_underscore/compare/v0.3.3...v0.3.4
46
53
  [0.3.3]: https://github.com/kddnewton/fast_underscore/compare/v0.3.2...v0.3.3
47
54
  [0.3.2]: https://github.com/kddnewton/fast_underscore/compare/v0.3.1...v0.3.2
48
55
  [0.3.1]: https://github.com/kddnewton/fast_underscore/compare/v0.3.0...v0.3.1
data/README.md CHANGED
@@ -27,7 +27,7 @@ Comparison:
27
27
  Add this line to your application's Gemfile:
28
28
 
29
29
  ```ruby
30
- gem 'fast_underscore'
30
+ gem "fast_underscore"
31
31
  ```
32
32
 
33
33
  And then execute:
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'mkmf'
4
- create_makefile('fast_underscore/fast_underscore')
3
+ require "mkmf"
4
+ create_makefile("fast_underscore/fast_underscore")
@@ -1,42 +1,50 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'lib/fast_underscore/version'
3
+ require_relative "lib/fast_underscore/version"
4
4
 
5
5
  version = FastUnderscore::VERSION
6
- repository = 'https://github.com/kddnewton/fast_underscore'
6
+ repository = "https://github.com/kddnewton/fast_underscore"
7
7
 
8
8
  Gem::Specification.new do |spec|
9
- spec.name = 'fast_underscore'
10
- spec.version = version
11
- spec.authors = ['Kevin Newton']
12
- spec.email = ['kddnewton@gmail.com']
13
-
14
- spec.summary = 'Fast String#underscore implementation'
15
- spec.description = 'Provides a C-optimized method for underscoring a string'
16
- spec.homepage = repository
17
- spec.license = 'MIT'
18
-
19
- spec.metadata = {
20
- 'bug_tracker_uri' => "#{repository}/issues",
21
- 'changelog_uri' => "#{repository}/blob/v#{version}/CHANGELOG.md",
22
- 'source_code_uri' => repository,
23
- 'rubygems_mfa_required' => 'true'
9
+ spec.name = "fast_underscore"
10
+ spec.version = version
11
+ spec.authors = ["Kevin Newton"]
12
+ spec.email = ["kddnewton@gmail.com"]
13
+
14
+ spec.summary = "Fast String#underscore implementation"
15
+ spec.description = "Provides a C-optimized method for underscoring a string"
16
+ spec.homepage = repository
17
+ spec.license = "MIT"
18
+
19
+ spec.metadata = {
20
+ "bug_tracker_uri" => "#{repository}/issues",
21
+ "changelog_uri" => "#{repository}/blob/v#{version}/CHANGELOG.md",
22
+ "source_code_uri" => repository,
23
+ "rubygems_mfa_required" => "true"
24
24
  }
25
25
 
26
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
28
- end
29
-
30
- spec.bindir = 'exe'
31
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
- spec.require_paths = ['lib']
33
- spec.extensions = ['ext/fast_underscore/extconf.rb']
34
-
35
- spec.add_development_dependency 'benchmark-ips', '~> 2'
36
- spec.add_development_dependency 'bundler', '~> 2'
37
- spec.add_development_dependency 'minitest', '~> 5'
38
- spec.add_development_dependency 'rake', '~> 13'
39
- spec.add_development_dependency 'rake-compiler', '~> 1'
40
- spec.add_development_dependency 'rubocop', '~> 1.12'
41
- spec.add_development_dependency 'steep'
26
+ spec.files = [
27
+ "CHANGELOG.md",
28
+ "CODE_OF_CONDUCT.md",
29
+ "LICENSE",
30
+ "README.md",
31
+ "ext/fast_underscore/extconf.rb",
32
+ "ext/fast_underscore/fast_underscore.c",
33
+ "ext/fast_underscore/fast_underscore.h",
34
+ "fast_underscore.gemspec",
35
+ "lib/fast_underscore.rb",
36
+ "lib/fast_underscore/version.rb"
37
+ ]
38
+
39
+ spec.require_paths = ["lib"]
40
+ spec.extensions = ["ext/fast_underscore/extconf.rb"]
41
+
42
+ spec.add_development_dependency "benchmark-ips", "~> 2"
43
+ spec.add_development_dependency "bundler", "~> 2"
44
+ spec.add_development_dependency "minitest", "~> 5"
45
+ spec.add_development_dependency "rake", "~> 13"
46
+ spec.add_development_dependency "rake-compiler", "~> 1"
47
+ spec.add_development_dependency "rubocop", "~> 1.12"
48
+ spec.add_development_dependency "ruby_memcheck"
49
+ spec.add_development_dependency "syntax_tree"
42
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastUnderscore
4
- VERSION = '0.3.3'
4
+ VERSION = "0.3.4"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'fast_underscore/version'
4
- require 'fast_underscore/fast_underscore'
3
+ require "fast_underscore/version"
4
+ require "fast_underscore/fast_underscore"
5
5
 
6
6
  module FastUnderscore
7
7
  # Override ActiveSupport::Inflector::underscore to use
@@ -19,7 +19,7 @@ module FastUnderscore
19
19
 
20
20
  response = string.dup
21
21
  response.gsub!(ActiveSupportInflectorOldPatch.pattern) do
22
- "#{$1 && '_'}#{$2.downcase}"
22
+ "#{$1 && "_"}#{$2.downcase}"
23
23
  end
24
24
 
25
25
  FastUnderscore.underscore(response)
@@ -35,7 +35,7 @@ module FastUnderscore
35
35
  response = string.dup
36
36
  acronyms = ActiveSupport::Inflector.inflections.acronyms_underscore_regex
37
37
 
38
- response.gsub!(acronyms) { "#{$1 && '_'}#{$2.downcase}" }
38
+ response.gsub!(acronyms) { "#{$1 && "_"}#{$2.downcase}" }
39
39
 
40
40
  FastUnderscore.underscore(response)
41
41
  end
@@ -51,7 +51,7 @@ module FastUnderscore
51
51
  end
52
52
 
53
53
  # Override the String#underscore method no matter when it was defined so that
54
- # we're sure it's going to call the correct implementation.
54
+ # we"re sure it"s going to call the correct implementation.
55
55
  module ActiveSupportStringPatch
56
56
  def underscore
57
57
  ActiveSupport::Inflector.underscore(self)
@@ -63,10 +63,10 @@ module FastUnderscore
63
63
  # ActiveSupport::Inflector::underscore method to use the FastUnderscore
64
64
  # native extension.
65
65
  def self.active_support
66
- require 'active_support/version'
66
+ require "active_support/version"
67
67
  gem_version = Gem::Version.new(ActiveSupport::VERSION::STRING)
68
68
 
69
- if gem_version >= Gem::Version.new('5.2.0')
69
+ if gem_version >= Gem::Version.new("5.2.0")
70
70
  ActiveSupport::Inflector.prepend(ActiveSupportInflectorPatch)
71
71
  else
72
72
  ActiveSupport::Inflector.prepend(ActiveSupportInflectorOldPatch)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_underscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Newton
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2024-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -95,7 +95,21 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.12'
97
97
  - !ruby/object:Gem::Dependency
98
- name: steep
98
+ name: ruby_memcheck
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: syntax_tree
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
@@ -116,38 +130,22 @@ extensions:
116
130
  - ext/fast_underscore/extconf.rb
117
131
  extra_rdoc_files: []
118
132
  files:
119
- - ".github/dependabot.yml"
120
- - ".github/workflows/main.yml"
121
- - ".gitignore"
122
- - ".rubocop.yml"
123
133
  - CHANGELOG.md
124
134
  - CODE_OF_CONDUCT.md
125
- - Gemfile
126
- - Gemfile.lock
127
135
  - LICENSE
128
136
  - README.md
129
- - Rakefile
130
- - Steepfile
131
- - bin/bench
132
- - bin/console
133
- - bin/setup
134
137
  - ext/fast_underscore/extconf.rb
135
138
  - ext/fast_underscore/fast_underscore.c
136
139
  - ext/fast_underscore/fast_underscore.h
137
140
  - fast_underscore.gemspec
138
- - gemfiles/5.1.gemfile
139
- - gemfiles/5.2.gemfile
140
- - gemfiles/6.0.gemfile
141
- - gemfiles/6.1.gemfile
142
141
  - lib/fast_underscore.rb
143
142
  - lib/fast_underscore/version.rb
144
- - sig/fast_underscore.rbs
145
143
  homepage: https://github.com/kddnewton/fast_underscore
146
144
  licenses:
147
145
  - MIT
148
146
  metadata:
149
147
  bug_tracker_uri: https://github.com/kddnewton/fast_underscore/issues
150
- changelog_uri: https://github.com/kddnewton/fast_underscore/blob/v0.3.3/CHANGELOG.md
148
+ changelog_uri: https://github.com/kddnewton/fast_underscore/blob/v0.3.4/CHANGELOG.md
151
149
  source_code_uri: https://github.com/kddnewton/fast_underscore
152
150
  rubygems_mfa_required: 'true'
153
151
  post_install_message:
@@ -165,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
163
  - !ruby/object:Gem::Version
166
164
  version: '0'
167
165
  requirements: []
168
- rubygems_version: 3.2.3
166
+ rubygems_version: 3.6.0.dev
169
167
  signing_key:
170
168
  specification_version: 4
171
169
  summary: Fast String#underscore implementation
@@ -1,6 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "bundler"
4
- directory: "/"
5
- schedule:
6
- interval: "daily"
@@ -1,44 +0,0 @@
1
- name: Main
2
- on:
3
- - push
4
- - pull_request_target
5
- jobs:
6
- ci:
7
- name: CI
8
- runs-on: ubuntu-latest
9
- strategy:
10
- fail-fast: false
11
- matrix:
12
- gemfile:
13
- - "5.1"
14
- - "5.2"
15
- - "6.0"
16
- - "6.1"
17
- env:
18
- CI: true
19
- BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
20
- steps:
21
- - uses: actions/checkout@master
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: 3.0
25
- bundler-cache: true
26
- - name: Lint and test
27
- run: |
28
- bundle exec rubocop --parallel
29
- bundle exec rake test
30
- bundle exec steep check
31
- automerge:
32
- name: AutoMerge
33
- needs: ci
34
- runs-on: ubuntu-latest
35
- if: github.event_name == 'pull_request_target' && (github.actor == github.repository_owner || github.actor == 'dependabot[bot]')
36
- steps:
37
- - uses: actions/github-script@v3
38
- with:
39
- script: |
40
- github.pulls.merge({
41
- owner: context.payload.repository.owner.login,
42
- repo: context.payload.repository.name,
43
- pull_number: context.payload.pull_request.number
44
- })
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- /gemfiles/*.lock
11
- /lib/fast_underscore/fast_underscore.bundle
data/.rubocop.yml DELETED
@@ -1,30 +0,0 @@
1
- AllCops:
2
- DisplayCopNames: true
3
- DisplayStyleGuide: true
4
- TargetRubyVersion: 2.7
5
- Exclude:
6
- - '{tmp,vendor,yard}/**/*'
7
-
8
- Gemspec/RequiredRubyVersion:
9
- Enabled: false
10
-
11
- Layout/LineLength:
12
- Max: 80
13
-
14
- Lint/AmbiguousBlockAssociation:
15
- Enabled: false
16
-
17
- Naming/RescuedExceptionsVariableName:
18
- Enabled: false
19
-
20
- Style/Documentation:
21
- Enabled: false
22
-
23
- Style/FormatString:
24
- EnforcedStyle: percent
25
-
26
- Style/FormatStringToken:
27
- Enabled: false
28
-
29
- Style/PerlBackrefs:
30
- Enabled: false
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- gem 'activesupport', '~> 6.1'
data/Gemfile.lock DELETED
@@ -1,82 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- fast_underscore (0.3.3)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- activesupport (6.1.4.1)
10
- concurrent-ruby (~> 1.0, >= 1.0.2)
11
- i18n (>= 1.6, < 2)
12
- minitest (>= 5.1)
13
- tzinfo (~> 2.0)
14
- zeitwerk (~> 2.3)
15
- ast (2.4.2)
16
- benchmark-ips (2.9.2)
17
- concurrent-ruby (1.1.9)
18
- ffi (1.15.4)
19
- i18n (1.8.11)
20
- concurrent-ruby (~> 1.0)
21
- language_server-protocol (3.16.0.3)
22
- listen (3.7.0)
23
- rb-fsevent (~> 0.10, >= 0.10.3)
24
- rb-inotify (~> 0.9, >= 0.9.10)
25
- minitest (5.14.4)
26
- parallel (1.21.0)
27
- parser (3.0.2.0)
28
- ast (~> 2.4.1)
29
- rainbow (3.0.0)
30
- rake (13.0.6)
31
- rake-compiler (1.1.1)
32
- rake
33
- rb-fsevent (0.11.0)
34
- rb-inotify (0.10.1)
35
- ffi (~> 1.0)
36
- rbs (1.7.0)
37
- regexp_parser (2.1.1)
38
- rexml (3.2.5)
39
- rubocop (1.23.0)
40
- parallel (~> 1.10)
41
- parser (>= 3.0.0.0)
42
- rainbow (>= 2.2.2, < 4.0)
43
- regexp_parser (>= 1.8, < 3.0)
44
- rexml
45
- rubocop-ast (>= 1.12.0, < 2.0)
46
- ruby-progressbar (~> 1.7)
47
- unicode-display_width (>= 1.4.0, < 3.0)
48
- rubocop-ast (1.13.0)
49
- parser (>= 3.0.1.1)
50
- ruby-progressbar (1.11.0)
51
- steep (0.46.0)
52
- activesupport (>= 5.1)
53
- language_server-protocol (>= 3.15, < 4.0)
54
- listen (~> 3.0)
55
- parallel (>= 1.0.0)
56
- parser (>= 3.0)
57
- rainbow (>= 2.2.2, < 4.0)
58
- rbs (>= 1.2.0)
59
- terminal-table (>= 2, < 4)
60
- terminal-table (3.0.2)
61
- unicode-display_width (>= 1.1.1, < 3)
62
- tzinfo (2.0.4)
63
- concurrent-ruby (~> 1.0)
64
- unicode-display_width (2.1.0)
65
- zeitwerk (2.5.1)
66
-
67
- PLATFORMS
68
- ruby
69
-
70
- DEPENDENCIES
71
- activesupport (~> 6.1)
72
- benchmark-ips (~> 2)
73
- bundler (~> 2)
74
- fast_underscore!
75
- minitest (~> 5)
76
- rake (~> 13)
77
- rake-compiler (~> 1)
78
- rubocop (~> 1.12)
79
- steep
80
-
81
- BUNDLED WITH
82
- 2.2.3
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rake/testtask'
5
- require 'rake/extensiontask'
6
-
7
- Rake::ExtensionTask.new(:compile) do |ext|
8
- ext.name = 'fast_underscore'
9
- ext.ext_dir = 'ext/fast_underscore'
10
- ext.lib_dir = 'lib/fast_underscore'
11
- ext.gem_spec = Gem::Specification.load('fast_underscore.gemspec')
12
- end
13
-
14
- Rake::TestTask.new(:test) do |t|
15
- t.libs << 'test'
16
- t.libs << 'lib'
17
- t.test_files = FileList['test/**/*_test.rb']
18
- end
19
-
20
- Rake::Task[:test].prerequisites << :compile
21
-
22
- task default: :test
data/Steepfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- target :lib do
4
- signature 'sig'
5
- check 'lib'
6
- end
data/bin/bench DELETED
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'benchmark/ips'
6
-
7
- require 'fast_underscore'
8
- require 'active_support'
9
-
10
- source =
11
- %w[_ - : :: / 漢字 😊🎉] + ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
12
- words = 500.times.map { Array.new(100) { source.sample }.join }
13
-
14
- Benchmark.ips do |x|
15
- x.report('ActiveSupport') do
16
- words.each { |word| ActiveSupport::Inflector.as_underscore(word) }
17
- end
18
-
19
- x.report('FastUnderscore') do
20
- words.each { |word| FastUnderscore.underscore(word) }
21
- end
22
-
23
- x.compare!
24
- end
data/bin/console DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'fast_underscore'
6
-
7
- require 'irb'
8
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
data/gemfiles/5.1.gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '..'
6
-
7
- gem 'activesupport', '~> 5.1.7'
data/gemfiles/5.2.gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '..'
6
-
7
- gem 'activesupport', '~> 5.2.5'
data/gemfiles/6.0.gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '..'
6
-
7
- gem 'activesupport', '~> 6.0.3'
data/gemfiles/6.1.gemfile DELETED
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '..'
6
-
7
- gem 'activesupport', '~> 6.1.3'
@@ -1,10 +0,0 @@
1
- module FastUnderscore
2
- VERSION: String
3
-
4
- def self.active_support: () -> void
5
- def self.underscore: (String string) -> String
6
- end
7
-
8
- class String
9
- def underscore: () -> String
10
- end