breadcrumbs 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.github/FUNDING.yml +3 -0
  3. data/.gitignore +4 -0
  4. data/.rubocop.yml +22 -0
  5. data/.travis.yml +11 -0
  6. data/Gemfile +4 -0
  7. data/README.md +143 -0
  8. data/Rakefile +15 -0
  9. data/breadcrumbs.gemspec +38 -0
  10. data/examples/myapp/.gitignore +12 -0
  11. data/examples/myapp/Gemfile +12 -0
  12. data/examples/myapp/README.rdoc +28 -0
  13. data/examples/myapp/Rakefile +6 -0
  14. data/examples/myapp/app/assets/images/.keep +0 -0
  15. data/examples/myapp/app/assets/stylesheets/application.css +49 -0
  16. data/examples/myapp/app/controllers/application_controller.rb +13 -0
  17. data/examples/myapp/app/controllers/concerns/.keep +0 -0
  18. data/examples/myapp/app/controllers/site_controller.rb +9 -0
  19. data/examples/myapp/app/helpers/application_helper.rb +2 -0
  20. data/examples/myapp/app/mailers/.keep +0 -0
  21. data/examples/myapp/app/models/.keep +0 -0
  22. data/examples/myapp/app/models/concerns/.keep +0 -0
  23. data/examples/myapp/app/views/layouts/application.html.erb +15 -0
  24. data/examples/myapp/app/views/site/contact.html.erb +1 -0
  25. data/examples/myapp/app/views/site/home.html.erb +1 -0
  26. data/examples/myapp/bin/bundle +3 -0
  27. data/examples/myapp/bin/rails +4 -0
  28. data/examples/myapp/bin/rake +4 -0
  29. data/examples/myapp/bin/setup +29 -0
  30. data/examples/myapp/config.ru +4 -0
  31. data/examples/myapp/config/application.rb +30 -0
  32. data/examples/myapp/config/boot.rb +3 -0
  33. data/examples/myapp/config/environment.rb +5 -0
  34. data/examples/myapp/config/environments/development.rb +38 -0
  35. data/examples/myapp/config/environments/production.rb +73 -0
  36. data/examples/myapp/config/environments/test.rb +39 -0
  37. data/examples/myapp/config/initializers/assets.rb +11 -0
  38. data/examples/myapp/config/initializers/backtrace_silencers.rb +7 -0
  39. data/examples/myapp/config/initializers/cookies_serializer.rb +3 -0
  40. data/examples/myapp/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/examples/myapp/config/initializers/inflections.rb +16 -0
  42. data/examples/myapp/config/initializers/mime_types.rb +4 -0
  43. data/examples/myapp/config/initializers/session_store.rb +3 -0
  44. data/examples/myapp/config/initializers/wrap_parameters.rb +9 -0
  45. data/examples/myapp/config/locales/en.yml +28 -0
  46. data/examples/myapp/config/routes.rb +5 -0
  47. data/examples/myapp/config/secrets.yml +22 -0
  48. data/examples/myapp/db/seeds.rb +7 -0
  49. data/examples/myapp/lib/assets/.keep +0 -0
  50. data/examples/myapp/lib/tasks/.keep +0 -0
  51. data/examples/myapp/log/.keep +0 -0
  52. data/examples/myapp/public/404.html +67 -0
  53. data/examples/myapp/public/422.html +67 -0
  54. data/examples/myapp/public/500.html +66 -0
  55. data/examples/myapp/public/favicon.ico +0 -0
  56. data/examples/myapp/public/robots.txt +5 -0
  57. data/examples/myapp/vendor/assets/stylesheets/.keep +0 -0
  58. data/lib/breadcrumbs.rb +49 -19
  59. data/lib/breadcrumbs/action_controller_ext.rb +3 -1
  60. data/lib/breadcrumbs/render.rb +10 -3
  61. data/lib/breadcrumbs/render/base.rb +14 -17
  62. data/lib/breadcrumbs/render/inline.rb +12 -14
  63. data/lib/breadcrumbs/render/list.rb +13 -9
  64. data/lib/breadcrumbs/render/ordered_list.rb +11 -0
  65. data/lib/breadcrumbs/version.rb +4 -2
  66. data/test/breadcrumbs_test.rb +45 -30
  67. data/test/{resources/pt.yml → support/pt-BR.yml} +2 -2
  68. data/test/test_helper.rb +11 -4
  69. metadata +273 -50
  70. data/README.rdoc +0 -96
@@ -1,6 +1,6 @@
1
- pt:
1
+ pt-BR:
2
2
  people: "Nosso time"
3
3
 
4
4
  breadcrumbs:
5
5
  home: "Página inicial"
6
- about: "Sobre"
6
+ about: "Sobre"
@@ -1,10 +1,17 @@
1
- require "rubygems"
2
- require "test/unit"
1
+ # frozen_string_literal: true
2
+
3
+ require "simplecov"
4
+ SimpleCov.start
5
+
6
+ require "bundler/setup"
7
+ require "minitest/utils"
8
+ require "minitest/autorun"
3
9
  require "cgi"
4
10
  require "nokogiri"
5
11
  require "action_controller"
12
+ require "mocha/test_unit"
6
13
 
7
14
  require "breadcrumbs"
8
15
 
9
- I18n.load_path << File.dirname(__FILE__) + "/resources/pt.yml"
10
- I18n.locale = :pt
16
+ I18n.load_path << "#{File.dirname(__FILE__)}/support/pt-BR.yml"
17
+ I18n.locale = "pt-BR"
metadata CHANGED
@@ -1,73 +1,296 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: breadcrumbs
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 3
9
- version: 0.1.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Nando Vieira
13
- autorequire:
8
+ autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2010-07-07 00:00:00 -03:00
18
- default_executable:
19
- dependencies: []
20
-
21
- description: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers and views.
22
- email: fnando.vieira@gmail.com
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: actionview
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: i18n
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: actionpack
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest-utils
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mocha
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: nokogiri
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-meta
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-fnando
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ description: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers
196
+ and views.
197
+ email:
198
+ - fnando.vieira@gmail.com
23
199
  executables: []
24
-
25
200
  extensions: []
26
-
27
- extra_rdoc_files:
28
- - README.rdoc
29
- files:
30
- - README.rdoc
201
+ extra_rdoc_files: []
202
+ files:
203
+ - ".github/FUNDING.yml"
204
+ - ".gitignore"
205
+ - ".rubocop.yml"
206
+ - ".travis.yml"
207
+ - Gemfile
208
+ - README.md
209
+ - Rakefile
210
+ - breadcrumbs.gemspec
211
+ - examples/myapp/.gitignore
212
+ - examples/myapp/Gemfile
213
+ - examples/myapp/README.rdoc
214
+ - examples/myapp/Rakefile
215
+ - examples/myapp/app/assets/images/.keep
216
+ - examples/myapp/app/assets/stylesheets/application.css
217
+ - examples/myapp/app/controllers/application_controller.rb
218
+ - examples/myapp/app/controllers/concerns/.keep
219
+ - examples/myapp/app/controllers/site_controller.rb
220
+ - examples/myapp/app/helpers/application_helper.rb
221
+ - examples/myapp/app/mailers/.keep
222
+ - examples/myapp/app/models/.keep
223
+ - examples/myapp/app/models/concerns/.keep
224
+ - examples/myapp/app/views/layouts/application.html.erb
225
+ - examples/myapp/app/views/site/contact.html.erb
226
+ - examples/myapp/app/views/site/home.html.erb
227
+ - examples/myapp/bin/bundle
228
+ - examples/myapp/bin/rails
229
+ - examples/myapp/bin/rake
230
+ - examples/myapp/bin/setup
231
+ - examples/myapp/config.ru
232
+ - examples/myapp/config/application.rb
233
+ - examples/myapp/config/boot.rb
234
+ - examples/myapp/config/environment.rb
235
+ - examples/myapp/config/environments/development.rb
236
+ - examples/myapp/config/environments/production.rb
237
+ - examples/myapp/config/environments/test.rb
238
+ - examples/myapp/config/initializers/assets.rb
239
+ - examples/myapp/config/initializers/backtrace_silencers.rb
240
+ - examples/myapp/config/initializers/cookies_serializer.rb
241
+ - examples/myapp/config/initializers/filter_parameter_logging.rb
242
+ - examples/myapp/config/initializers/inflections.rb
243
+ - examples/myapp/config/initializers/mime_types.rb
244
+ - examples/myapp/config/initializers/session_store.rb
245
+ - examples/myapp/config/initializers/wrap_parameters.rb
246
+ - examples/myapp/config/locales/en.yml
247
+ - examples/myapp/config/routes.rb
248
+ - examples/myapp/config/secrets.yml
249
+ - examples/myapp/db/seeds.rb
250
+ - examples/myapp/lib/assets/.keep
251
+ - examples/myapp/lib/tasks/.keep
252
+ - examples/myapp/log/.keep
253
+ - examples/myapp/public/404.html
254
+ - examples/myapp/public/422.html
255
+ - examples/myapp/public/500.html
256
+ - examples/myapp/public/favicon.ico
257
+ - examples/myapp/public/robots.txt
258
+ - examples/myapp/vendor/assets/stylesheets/.keep
31
259
  - lib/breadcrumbs.rb
32
260
  - lib/breadcrumbs/action_controller_ext.rb
33
261
  - lib/breadcrumbs/render.rb
34
262
  - lib/breadcrumbs/render/base.rb
35
263
  - lib/breadcrumbs/render/inline.rb
36
264
  - lib/breadcrumbs/render/list.rb
265
+ - lib/breadcrumbs/render/ordered_list.rb
37
266
  - lib/breadcrumbs/version.rb
38
267
  - test/breadcrumbs_test.rb
39
- - test/resources/pt.yml
268
+ - test/support/pt-BR.yml
40
269
  - test/test_helper.rb
41
- has_rdoc: true
42
- homepage: http://github.com/fnando/breadcrumbs
270
+ homepage: http://rubygems.org/gems/breadcrumbs
43
271
  licenses: []
44
-
45
- post_install_message:
46
- rdoc_options:
47
- - --charset=UTF-8
48
- require_paths:
272
+ metadata: {}
273
+ post_install_message:
274
+ rdoc_options: []
275
+ require_paths:
49
276
  - lib
50
- required_ruby_version: !ruby/object:Gem::Requirement
51
- requirements:
277
+ required_ruby_version: !ruby/object:Gem::Requirement
278
+ requirements:
52
279
  - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
57
- required_rubygems_version: !ruby/object:Gem::Requirement
58
- requirements:
280
+ - !ruby/object:Gem::Version
281
+ version: 2.5.0
282
+ required_rubygems_version: !ruby/object:Gem::Requirement
283
+ requirements:
59
284
  - - ">="
60
- - !ruby/object:Gem::Version
61
- segments:
62
- - 0
63
- version: "0"
285
+ - !ruby/object:Gem::Version
286
+ version: '0'
64
287
  requirements: []
65
-
66
- rubyforge_project:
67
- rubygems_version: 1.3.6
68
- signing_key:
69
- specification_version: 3
70
- summary: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers and views.
71
- test_files:
288
+ rubygems_version: 3.1.2
289
+ signing_key:
290
+ specification_version: 4
291
+ summary: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers
292
+ and views.
293
+ test_files:
72
294
  - test/breadcrumbs_test.rb
295
+ - test/support/pt-BR.yml
73
296
  - test/test_helper.rb
@@ -1,96 +0,0 @@
1
- = Breadcrumbs
2
-
3
- Breadcrumbs is a simple plugin that adds a +breadcrumbs+ object to controllers and views.
4
-
5
- == Instalation
6
-
7
- Just run <tt>sudo gem install breadcrumbs</tt>
8
-
9
- == Usage
10
-
11
- On your controller (optional):
12
-
13
- class ApplicationController < ActionController::Base
14
- before_filter :add_initial_breadcrumbs
15
-
16
- private
17
- def add_initial_breadcrumbs
18
- breadcrumbs.add 'Home', root_path
19
- end
20
- end
21
-
22
- class ThingsController < ApplicationController
23
- def index
24
- breadcrumbs.add 'Things', things_path
25
- end
26
- end
27
-
28
- You don't need to provide an URL; in that case, a span will be generated
29
- instead of a link:
30
-
31
- breadcrumbs.add 'Some page'
32
-
33
- You can set additional HTML attributes if you need to:
34
-
35
- breadcrumbs.add 'Home', root_path, :id => 'home', :title => 'Go to the home page'
36
-
37
- On your view (possibly application.html.erb):
38
-
39
- <%= breadcrumbs.render %>
40
-
41
- You can render as inline links.
42
-
43
- <%= breadcrumbs.render(:format => :inline) %>
44
-
45
- You can set your own separator:
46
-
47
- <p>
48
- You are here: <%= breadcrumbs.render(:format => :inline, :separator => '|') %>
49
- </p>
50
-
51
- === I18n
52
-
53
- Breadcrumbs is integrated with I18n. You can set translations like:
54
-
55
- en:
56
- breadcrumbs:
57
- home: "Home"
58
-
59
- And then you just call
60
-
61
- breadcrumbs.add :home
62
-
63
- In fact, you can provide any scope you want.
64
-
65
- breadcrumbs.add "titles.home"
66
-
67
- If you don't want to translate a label, just pass the option <tt>:i18n</tt> as <tt>false</tt>.
68
-
69
- breadcrumbs.add :home, nil, :i18n => false
70
-
71
- == Maintainer
72
-
73
- * Nando Vieira - http://simplesideias.com.br
74
-
75
- License
76
-
77
- (The MIT License)
78
-
79
- Permission is hereby granted, free of charge, to any person obtaining
80
- a copy of this software and associated documentation files (the
81
- 'Software'), to deal in the Software without restriction, including
82
- without limitation the rights to use, copy, modify, merge, publish,
83
- distribute, sublicense, and/or sell copies of the Software, and to
84
- permit persons to whom the Software is furnished to do so, subject to
85
- the following conditions:
86
-
87
- The above copyright notice and this permission notice shall be
88
- included in all copies or substantial portions of the Software.
89
-
90
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
91
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
92
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
93
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
94
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
95
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
96
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.