babosa 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 220cb46c512e19edf7da5fd276cc617f091ea06914c1665c45a2126a352c0e19
4
- data.tar.gz: '0948960e5ee0016e0995981f8474a4ac046f7403115a18ad48e56f4fece68065'
3
+ metadata.gz: 7878565d1bfb436b7110d42e81dff1eb589f86e10e0919ded4b2de695784fae3
4
+ data.tar.gz: f6f3e7cc2b4876a940ec66fa1895f9cd3390526c62cebc888110494b72d77fe5
5
5
  SHA512:
6
- metadata.gz: bf56ad4637bd37dd3e0efcee9a01ab552d7eb23aa01d95df77485c92f86440be8a80dc70fa27b066021987a65427be0f3760fb85abb83c308374a079e808ff8f
7
- data.tar.gz: 86fcc2dd507f57bca63220d0da299695cbee0584b3aee1116b20c1a8773b2db585e7a1b46db652292a55d78cf1accebd2f172c196a34724e66c16cb806ea7566
6
+ metadata.gz: 6ea0ff964d688d9ca29710da13207c12d49509c13d72f8198a33d38141f7f6ad39b5792f5937a94a44b3976dcd68b24233c11b3418dc9d100a170caa799404ed
7
+ data.tar.gz: 1b37fd01a1907f244e112171da5dd942105181b860e6dc05ede3e1798bfdf1e50e8543b69757109dc9bd7dfddecb6ba2fbec2b59f38843223052c559f085490e
@@ -1,5 +1,9 @@
1
1
  # Babosa Changelog
2
2
 
3
+ ## 1.0.4
4
+
5
+ * Fix nil being cast to frozen string (https://github.com/norman/babosa/pull/52)
6
+
3
7
  ## 1.0.3
4
8
 
5
9
  * Fix Active Support 6 deprecations (https://github.com/norman/babosa/pull/50)
@@ -166,8 +166,8 @@ module Babosa
166
166
  # Normalize a string so that it can safely be used as a Ruby method name.
167
167
  def to_ruby_method!(allow_bangs = true)
168
168
  leader, trailer = @wrapped_string.strip.scan(/\A(.+)(.)\z/).flatten
169
- leader = leader.to_s
170
- trailer = trailer.to_s
169
+ leader = leader.to_s.dup
170
+ trailer = trailer.to_s.dup
171
171
  if allow_bangs
172
172
  trailer.downcase!
173
173
  trailer.gsub!(/[^a-z0-9!=\\?]/, '')
@@ -1,5 +1,5 @@
1
1
  module Babosa
2
2
  module Version
3
- STRING = '1.0.3'
3
+ STRING = '1.0.4'
4
4
  end
5
5
  end
@@ -150,5 +150,9 @@ describe Babosa::Identifier do
150
150
  # "1".to_identifier.to_ruby_method
151
151
  expect {"1".to_identifier.to_ruby_method}.to raise_error(Babosa::Identifier::Error)
152
152
  end
153
+
154
+ it "should raise Babosa::Error error when the string is nil" do
155
+ expect { "".to_slug.to_ruby_method }.to raise_error(Babosa::Identifier::Error)
156
+ end
153
157
  end
154
- end
158
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babosa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norman Clarke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.0.3
163
+ rubygems_version: 3.1.2
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: A library for creating slugs.