bsm-breadcrumbs 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bsm-breadcrumbs}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nando Vieira", "Dimitrij Denissenko"]
@@ -2,7 +2,7 @@ class Breadcrumbs
2
2
  module Version # :nodoc: all
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
data/lib/breadcrumbs.rb CHANGED
@@ -96,10 +96,9 @@ class Breadcrumbs < Array
96
96
  html.respond_to?(:html_safe) ? html.html_safe : html
97
97
  end
98
98
 
99
- def translate(scope) # :nodoc:
100
- text = I18n.t(scope, :scope => :breadcrumbs, :raise => true) rescue nil
101
- text ||= I18n.t(scope, :default => scope.to_s)
102
- text
99
+ def translate(key) # :nodoc:
100
+ return "" if key.blank?
101
+ I18n.t "breadcrumbs.#{key}", :default => [key.to_sym, key.to_s]
103
102
  end
104
103
 
105
104
  private
@@ -28,6 +28,11 @@ class BreadcrumbsTest < Test::Unit::TestCase
28
28
  assert_equal 2, @breadcrumbs.count
29
29
  end
30
30
 
31
+ def test_add_empty_item # Just in case, we generate the label
32
+ @breadcrumbs.add ""
33
+ assert_equal 1, @breadcrumbs.count
34
+ end
35
+
31
36
  def test_tag
32
37
  assert_equal "<span>Hi!</span>", @inline.tag(:span, "Hi!")
33
38
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsm-breadcrumbs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nando Vieira