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 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
@@ -1,5 +1,4 @@
1
1
  require "rubygems"
2
- require "bundler/setup"
3
2
  require "rake/testtask"
4
3
  require "rake/clean"
5
4
  require "rake/gempackagetask"
@@ -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.
@@ -6,7 +6,7 @@ module Babosa
6
6
  module JavaProxy
7
7
  extend UTF8Proxy
8
8
  extend self
9
- import java.text.Normalizer
9
+ java_import java.text.Normalizer
10
10
 
11
11
  def downcase(string)
12
12
  string.to_java.to_lower_case.to_s
@@ -1,5 +1,5 @@
1
1
  module Babosa
2
2
  module Version
3
- STRING = "0.2.0"
3
+ STRING = "0.2.1"
4
4
  end
5
5
  end
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
- - 0
9
- version: 0.2.0
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: 2010-08-30 00:00:00 -03:00
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"