babosa 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/lib/babosa/identifier.rb +2 -2
- data/lib/babosa/version.rb +1 -1
- data/spec/babosa_spec.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7878565d1bfb436b7110d42e81dff1eb589f86e10e0919ded4b2de695784fae3
|
4
|
+
data.tar.gz: f6f3e7cc2b4876a940ec66fa1895f9cd3390526c62cebc888110494b72d77fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea0ff964d688d9ca29710da13207c12d49509c13d72f8198a33d38141f7f6ad39b5792f5937a94a44b3976dcd68b24233c11b3418dc9d100a170caa799404ed
|
7
|
+
data.tar.gz: 1b37fd01a1907f244e112171da5dd942105181b860e6dc05ede3e1798bfdf1e50e8543b69757109dc9bd7dfddecb6ba2fbec2b59f38843223052c559f085490e
|
data/Changelog.md
CHANGED
data/lib/babosa/identifier.rb
CHANGED
@@ -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!=\\?]/, '')
|
data/lib/babosa/version.rb
CHANGED
data/spec/babosa_spec.rb
CHANGED
@@ -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.
|
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:
|
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.
|
163
|
+
rubygems_version: 3.1.2
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: A library for creating slugs.
|