simple_symbolize 2.0.0 → 2.0.1

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: 1e23023a3bb1c8d394ba3059e5e72d0fef3480b5c0f09900aa9d00e61d784058
4
- data.tar.gz: 557b65ea91d5db0400dd5aa23b66894d9fe5576962bfc7c1bf9895337ccfc093
3
+ metadata.gz: 59e6e0627c56ba92e83ade0f7da175a6900efb94239e7d090cf3021ceecc2c36
4
+ data.tar.gz: c38a440d4feca6c293e39ddd44241f78c1b0096933a60d0929abb254ffe77497
5
5
  SHA512:
6
- metadata.gz: 67ef8dd2fa3215f422fe90ec76f86da67a61f6801a3f6cc1ef9cfb763136d2fe52ba561ab0339e80eab120c16ab0c03f1841868abc9101a61d8f55d45fd3c123
7
- data.tar.gz: e330593b6aae61ad7ed11e6c82a7e9be6b3292d25847e69eafef9218583eaec787b9127e15447f8ca5f0c3d628b459909b5eb46f5a9414ca13f8b7daf0a36acd
6
+ metadata.gz: 6242fbdc38514b7eed4b3931eb5391abc5e7d6b833ccb8bd5dc982c4eb301b4606b256139233ab5f07efec72de2f6fc8964cc38a99a33d4ddd5e734f77382c1e
7
+ data.tar.gz: bf26933555776d4b25f32c3bc2df40e385ad38f45c599b2129a981aae677f38156dbbec63351968e217478c4ea600063a08c02fe6c83320764afa49ef19cdbdc
data/bin/console CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'bundler/setup'
4
4
  require 'simple_symbolize'
5
+ require 'pry'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -1,3 +1,3 @@
1
1
  module SimpleSymbolize
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
@@ -39,7 +39,7 @@ module SimpleSymbolize
39
39
  #
40
40
  # @param str [String] the String object to be symbolized.
41
41
  #
42
- # @example Symbolize a string using the camelize method
42
+ # @example Elementize a string using the elementize method
43
43
  # elementize("hello world!") #=> "helloWorld"
44
44
  def elementize(str)
45
45
  return str unless str.is_a?(Symbol) || str.is_a?(String)
@@ -55,9 +55,9 @@ module SimpleSymbolize
55
55
  # camelize("hello world!") #=> :helloWorld
56
56
  def camelize(str)
57
57
  return str unless str.is_a?(String) || str.is_a?(Symbol)
58
- return str.to_sym if str.is_a?(String) && (str.split(/[_ ]/).size <= 1)
58
+ return symbolize(str) if str.is_a?(String) && (str.split(/[_ ]/).size <= 1)
59
59
 
60
60
  first, *rest = elementize(str).split('_')
61
- rest ? (first << rest.map(&:capitalize).join).to_sym : first.to_sym
61
+ rest ? (first << rest.map(&:capitalize).join).to_sym : symbolize(first)
62
62
  end
63
63
  end
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
+ spec.add_development_dependency 'pry', '~> 0.14'
34
35
  spec.add_development_dependency 'rake', '~> 12.0'
35
36
  spec.add_development_dependency 'rspec', '~> 3.2'
36
37
  spec.add_development_dependency 'rubocop', '~> 1.29.0'
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_symbolize
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.14'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement