simple_symbolize 4.0.0 → 4.1.0
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 +4 -4
- data/.github/workflows/ruby.yml +1 -1
- data/.github/workflows/ruby_gem.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +5 -0
- data/README.md +21 -1
- data/lib/simple_symbolize/core_ext/symbol/symbolize.rb +36 -0
- data/lib/simple_symbolize/version.rb +1 -1
- data/lib/simple_symbolize.rb +1 -0
- data/simple_symbolize.gemspec +0 -6
- metadata +7 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fe69f67b8c3e4152dd088e6425f0a0e9c0c5206ff384bd599284f976b664e4e
|
4
|
+
data.tar.gz: d8ce3414da304b386a71e83f482bd3dc2a031274c61dbe8d69efbab1d9dc819a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da85cabac7e7f368cfd7a0366dffa7642e6f0b27f2cbac49b548264df55f82eb715d74cf80e2113a172b7451b2496a86ddcbc13ef818d66e8b7f72aa8df80ff1
|
7
|
+
data.tar.gz: 82a0bd3a48cecbf2ca49607dd136cc8dc46a3babb761507b88a74043a494f396fbe6e7ecc53393c5a2d065e2f8d0302ccfdf80dfe6cb2412d3188091f15d2f44
|
data/.github/workflows/ruby.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.5
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -58,6 +58,16 @@ String.include SimpleSymbolize::CoreExt::String
|
|
58
58
|
'hello world!'.simple_symbolize # => :hello_world
|
59
59
|
```
|
60
60
|
|
61
|
+
### Call the symbolize method on your Symbol object
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
require 'simple_symbolize'
|
65
|
+
|
66
|
+
Symbol.include SimpleSymbolize::CoreExt::Symbol
|
67
|
+
|
68
|
+
:hello_world!.simple_symbolize # => :hello_world
|
69
|
+
```
|
70
|
+
|
61
71
|
## Configuration
|
62
72
|
|
63
73
|
Something not underscored or removed? Or even something underscored/removed that you didn't want transformed?
|
@@ -74,13 +84,23 @@ end
|
|
74
84
|
|
75
85
|
## Updates!
|
76
86
|
|
87
|
+
### V4.1
|
88
|
+
### Symbol methods can now be Mixed in
|
89
|
+
|
90
|
+
SimpleSymbolize now supports mixing in the methods on the Symbol class, allowing you to call `simple_symbolize` directly on a Symbol object.
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
Symbol.include SimpleSymbolize::CoreExt::Symbol
|
94
|
+
:hello_world!.simple_symbolize # => :hello_world
|
95
|
+
```
|
96
|
+
|
77
97
|
### V4
|
78
98
|
#### String methods now need to be Mixed in
|
79
99
|
|
80
100
|
SimpleSymbolize is safe to use with other gems, particularly the popular ActiveSupport gem which SimpleSymbolize use to share
|
81
101
|
certain methods names with.
|
82
102
|
|
83
|
-
You now need to
|
103
|
+
You now need to deliberately mixin the methods on the String class:
|
84
104
|
|
85
105
|
```ruby
|
86
106
|
String.include SimpleSymbolize::CoreExt::String
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Extends the Symbol class by mixing in the symbolize module.
|
4
|
+
# @example Mixin the methods to the Symbol class
|
5
|
+
# Symbol.include SimpleSymbolize::CoreExt::Symbol
|
6
|
+
|
7
|
+
module SimpleSymbolize
|
8
|
+
module CoreExt
|
9
|
+
# Contains methods to be mixed into the String class
|
10
|
+
module Symbol
|
11
|
+
# @example Symbolize a string using the String object method
|
12
|
+
# :hello_world!.symbolize #=> :hello_world
|
13
|
+
def simple_symbolize
|
14
|
+
SimpleSymbolize.symbolize(self)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @example Turns a String into a camelCase Symbol
|
18
|
+
# :hello_world.simple_camelize => :helloWorld
|
19
|
+
def simple_camelize
|
20
|
+
SimpleSymbolize.camelize(self)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @example Symbolizes a String then calls #to_s
|
24
|
+
# :helloWorld!.simple_elementize => 'hello_word'
|
25
|
+
def simple_elementize
|
26
|
+
SimpleSymbolize.elementize(self)
|
27
|
+
end
|
28
|
+
|
29
|
+
# @example Turns a String into it's snake_case equivalent
|
30
|
+
# :helloWorld.simple_snakeize => :hello_word
|
31
|
+
def simple_snakeize
|
32
|
+
SimpleSymbolize.snakeize(self)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/lib/simple_symbolize.rb
CHANGED
@@ -4,6 +4,7 @@ require 'simple_symbolize/version'
|
|
4
4
|
|
5
5
|
require_relative 'simple_symbolize/translations'
|
6
6
|
require_relative 'simple_symbolize/core_ext/string/symbolize'
|
7
|
+
require_relative 'simple_symbolize/core_ext/symbol/symbolize'
|
7
8
|
|
8
9
|
# Main module for the gem
|
9
10
|
# Contains the base methods and allows configuration
|
data/simple_symbolize.gemspec
CHANGED
@@ -29,10 +29,4 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.bindir = 'exe'
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ['lib']
|
32
|
-
|
33
|
-
spec.add_development_dependency 'pry', '~> 0.14'
|
34
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
35
|
-
spec.add_development_dependency 'rspec', '~> 3.12'
|
36
|
-
spec.add_development_dependency 'rubocop', '~> 1.54'
|
37
|
-
spec.add_development_dependency 'simplecov', '~> 0.22'
|
38
32
|
end
|
metadata
CHANGED
@@ -1,86 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_symbolize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alexo
|
8
8
|
- Driver and Vehicle Licensing Agency (DVLA)
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: pry
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0.14'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0.14'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: rake
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '13.0'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '13.0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: rspec
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '3.12'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '3.12'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rubocop
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '1.54'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '1.54'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: simplecov
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0.22'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '0.22'
|
12
|
+
date: 2025-08-01 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
84
14
|
description: 'simple_symbolize will remove special characters from a String, replacing
|
85
15
|
whitespace with an underscore, down-casing and finally calling the #to_sym String
|
86
16
|
method. Configure this gem to your hearts content!'
|
@@ -104,6 +34,7 @@ files:
|
|
104
34
|
- bin/setup
|
105
35
|
- lib/simple_symbolize.rb
|
106
36
|
- lib/simple_symbolize/core_ext/string/symbolize.rb
|
37
|
+
- lib/simple_symbolize/core_ext/symbol/symbolize.rb
|
107
38
|
- lib/simple_symbolize/translations.rb
|
108
39
|
- lib/simple_symbolize/version.rb
|
109
40
|
- simple_symbolize.gemspec
|
@@ -113,7 +44,7 @@ licenses:
|
|
113
44
|
metadata:
|
114
45
|
homepage_uri: https://github.com/dvla/simple-symbolize
|
115
46
|
source_code_uri: https://github.com/dvla/simple-symbolize
|
116
|
-
post_install_message:
|
47
|
+
post_install_message:
|
117
48
|
rdoc_options: []
|
118
49
|
require_paths:
|
119
50
|
- lib
|
@@ -129,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
60
|
version: '0'
|
130
61
|
requirements: []
|
131
62
|
rubygems_version: 3.2.15
|
132
|
-
signing_key:
|
63
|
+
signing_key:
|
133
64
|
specification_version: 4
|
134
65
|
summary: Turns Strings into Symbols.
|
135
66
|
test_files: []
|