babosa 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/Rakefile +0 -1
- data/lib/babosa/identifier.rb +6 -0
- data/lib/babosa/utf8/java_proxy.rb +1 -1
- data/lib/babosa/version.rb +1 -1
- data/test/babosa_test.rb +4 -0
- metadata +3 -5
data/README.md
CHANGED
@@ -142,6 +142,7 @@ Please use Babosa's [Github issue tracker](http://github.com/norman/babosa/issue
|
|
142
142
|
|
143
143
|
## Changelog
|
144
144
|
|
145
|
+
* 0.2.1 - Implement #empty? for compatiblity with Active Support's #blank?.
|
145
146
|
* 0.2.0 - Added support for Danish. Added method to generate Ruby identifiers. Improved performance.
|
146
147
|
* 0.1.1 - Added support for Serbian.
|
147
148
|
* 0.1.0 - Initial extraction from FriendlyId.
|
data/Rakefile
CHANGED
data/lib/babosa/identifier.rb
CHANGED
@@ -56,6 +56,12 @@ module Babosa
|
|
56
56
|
normalize_utf8!
|
57
57
|
end
|
58
58
|
|
59
|
+
def empty?
|
60
|
+
# included to make this class :respond_to? :empty for compatibility with Active Support's
|
61
|
+
# #blank?
|
62
|
+
@wrapped_string.empty?
|
63
|
+
end
|
64
|
+
|
59
65
|
# Approximate an ASCII string. This works only for Western strings using
|
60
66
|
# characters that are Roman-alphabet characters + diacritics. Non-letter
|
61
67
|
# characters are left unmodified.
|
data/lib/babosa/version.rb
CHANGED
data/test/babosa_test.rb
CHANGED
@@ -49,6 +49,10 @@ end
|
|
49
49
|
|
50
50
|
class BabosaTest < Test::Unit::TestCase
|
51
51
|
|
52
|
+
test "should respond_to? :empty?" do
|
53
|
+
assert "".to_slug.respond_to? :empty?
|
54
|
+
end
|
55
|
+
|
52
56
|
test "word_chars! should leave only letters and spaces" do
|
53
57
|
string = "a*$%^$@!@b$%^&*()*!c"
|
54
58
|
assert_match /[a-z ]*/i, string.to_slug.word_chars!
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Norman Clarke
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-12 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -56,7 +56,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 1210160351012131207
|
60
59
|
segments:
|
61
60
|
- 0
|
62
61
|
version: "0"
|
@@ -65,7 +64,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
64
|
requirements:
|
66
65
|
- - ">="
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
hash: 1210160351012131207
|
69
67
|
segments:
|
70
68
|
- 0
|
71
69
|
version: "0"
|