auto_breadcrumbs 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YTA2OTFlNjRlYWFjZjY3ZTZjMDhlNjdjM2ZiZDAwMzYwZjRjZGYzOA==
5
- data.tar.gz: !binary |-
6
- YWMzOWE0OGQzYTNjNjZhMjAyMDdjZGQ5OTUyNDY1MTdiYjllNGJkZg==
2
+ SHA1:
3
+ metadata.gz: ef333978318c7bf16abc9ecb45e172d91d2cc65f
4
+ data.tar.gz: 9964525a13aaf232da045f36a4393895eb499e0f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NWFhMDA5Yjc4MmRkYWZlMjFkN2M3ZDY5ZmE3Nzg5ZDY2MzgyYjVjMzM2NDM5
10
- YjlmYTJmM2RmNjk4OTY2M2FkYTFmNjgwZDJhMWE3MWFlOTNmZDgxZWRiMTVj
11
- MjViYzFhY2Q0M2IzNTA0OGIyNmUwZGQ4OTNhYjgwZjk1Y2UyZDU=
12
- data.tar.gz: !binary |-
13
- OGQ5ZWZkNmIzNzY2MjU0ZGJhYmU2Y2U1MzAxMGU4N2FmMmUzOTE2N2UyMWJi
14
- Y2ExNTRiZTk5ZWViZjAyOTMxYzZlMjFlOTM0ZmY0YmY3Y2IyZTcxYzYwMTk5
15
- ZmFkNTA2Y2E1MDg0NDU1YjhiYmVhNjY5NzI4MDAwOTQyNzk0ZjU=
6
+ metadata.gz: 737be4c34d4be1d3c3504b8031260fcc72e1e14fa54f5c162765da5a1d557e2776e744c244bbe5bd007f518ec5d9e66b88abace7767f1829dcc0a5979577349b
7
+ data.tar.gz: c0804f8e495cccb51dcccb05c737513e0c03067a6a2650224e6b50a2b2418d7afd2b0cc4e4c2d977a04614da2e31eaee58fc33834c29463bda04a115ea2f23f0
data/README.md CHANGED
@@ -23,7 +23,7 @@ To generate locale file run:
23
23
  1) Include `auto_breadcrumbs` in your controller:
24
24
 
25
25
  ```ruby
26
- class UsersController < ApplicationController
26
+ class ApplicationController < ActionController::Base
27
27
  include AutoBreadcrumbs
28
28
  ...
29
29
  end
@@ -20,7 +20,11 @@ module AutoBreadcrumbs
20
20
  end
21
21
 
22
22
  def index_translation
23
- breadcrumbs_t("controllers.#{ params[:controller] }.index")
23
+ begin
24
+ breadcrumbs_t!("controllers.#{ params[:controller] }.index")
25
+ rescue I18n::MissingTranslationData
26
+ params[:controller].split('_').map(&:capitalize).join(' ')
27
+ end
24
28
  end
25
29
 
26
30
  def action_translation
@@ -1,3 +1,3 @@
1
1
  module AutoBreadcrumbs
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -0,0 +1,4 @@
1
+ class CountryNamesController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -6,5 +6,7 @@ Dummy::Application.routes.draw do
6
6
  get :dup, on: :member
7
7
  end
8
8
 
9
+ resources :country_names, only: [:index]
10
+
9
11
  resources :cities, only: [:edit, :show]
10
12
  end
@@ -9,6 +9,11 @@ feature 'Rendering breadcrumbs' do
9
9
  let(:root_page) { BreadcrumbPage.new(index: root_path) }
10
10
  let(:root_breadcrumbs) { [locale['root']] }
11
11
 
12
+ # Country name page -----------------------------------------------------------------------------
13
+
14
+ let(:country_name_page) { BreadcrumbPage.new(index: country_names_path) }
15
+ let(:country_name_index_breadcrumbs) { root_breadcrumbs + ['Country Names'] }
16
+
12
17
  # City page -------------------------------------------------------------------------------------
13
18
 
14
19
  let(:city_page) {
@@ -40,6 +45,11 @@ feature 'Rendering breadcrumbs' do
40
45
  expect(root_page.breadcrumbs).to eq(root_breadcrumbs)
41
46
  end
42
47
 
48
+ scenario 'without translation' do
49
+ country_name_page.visit_page(:index)
50
+ expect(country_name_page.breadcrumbs).to eq(country_name_index_breadcrumbs)
51
+ end
52
+
43
53
  scenario 'when resource without index action' do
44
54
  city_page.visit_page(:edit)
45
55
  expect(city_page.breadcrumbs).to eq(city_edit_breadcrumbs)
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_breadcrumbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: breadcrumbs_on_rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: capybara
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: poltergeist
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Automatically add breadcrumbs to each page by using locales
@@ -101,6 +101,7 @@ files:
101
101
  - lib/generators/auto_breadcrumbs/install_generator.rb
102
102
  - spec/dummy/app/controllers/application_controller.rb
103
103
  - spec/dummy/app/controllers/cities_controller.rb
104
+ - spec/dummy/app/controllers/country_names_controller.rb
104
105
  - spec/dummy/app/controllers/users_controller.rb
105
106
  - spec/dummy/app/views/layouts/application.html.erb
106
107
  - spec/dummy/app/views/shared/blank_page.html.erb
@@ -132,23 +133,24 @@ require_paths:
132
133
  - lib
133
134
  required_ruby_version: !ruby/object:Gem::Requirement
134
135
  requirements:
135
- - - ! '>='
136
+ - - '>='
136
137
  - !ruby/object:Gem::Version
137
138
  version: '0'
138
139
  required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  requirements:
140
- - - ! '>='
141
+ - - '>='
141
142
  - !ruby/object:Gem::Version
142
143
  version: '0'
143
144
  requirements: []
144
145
  rubyforge_project:
145
- rubygems_version: 2.1.5
146
+ rubygems_version: 2.0.3
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: Automatically adding breadcrumbs by using locales
149
150
  test_files:
150
151
  - spec/dummy/app/controllers/application_controller.rb
151
152
  - spec/dummy/app/controllers/cities_controller.rb
153
+ - spec/dummy/app/controllers/country_names_controller.rb
152
154
  - spec/dummy/app/controllers/users_controller.rb
153
155
  - spec/dummy/app/views/layouts/application.html.erb
154
156
  - spec/dummy/app/views/shared/blank_page.html.erb
@@ -170,4 +172,3 @@ test_files:
170
172
  - spec/features/pages/breadcrumb_page.rb
171
173
  - spec/features/rendering_breadcrumbs_spec.rb
172
174
  - spec/spec_helper.rb
173
- has_rdoc: