breadcrumbs 0.1.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODEOWNERS +4 -0
  3. data/.github/FUNDING.yml +4 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  5. data/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  8. data/.github/dependabot.yml +20 -0
  9. data/.github/workflows/ruby-tests.yml +52 -0
  10. data/.gitignore +4 -0
  11. data/.rubocop.yml +11 -0
  12. data/CODE_OF_CONDUCT.md +74 -0
  13. data/CONTRIBUTING.md +80 -0
  14. data/Gemfile +4 -0
  15. data/LICENSE.md +20 -0
  16. data/README.md +142 -0
  17. data/Rakefile +15 -0
  18. data/breadcrumbs.gemspec +49 -0
  19. data/examples/myapp/.gitignore +12 -0
  20. data/examples/myapp/Gemfile +12 -0
  21. data/examples/myapp/README.rdoc +28 -0
  22. data/examples/myapp/Rakefile +6 -0
  23. data/examples/myapp/app/assets/images/.keep +0 -0
  24. data/examples/myapp/app/assets/stylesheets/application.css +49 -0
  25. data/examples/myapp/app/controllers/application_controller.rb +13 -0
  26. data/examples/myapp/app/controllers/concerns/.keep +0 -0
  27. data/examples/myapp/app/controllers/site_controller.rb +9 -0
  28. data/examples/myapp/app/helpers/application_helper.rb +2 -0
  29. data/examples/myapp/app/mailers/.keep +0 -0
  30. data/examples/myapp/app/models/.keep +0 -0
  31. data/examples/myapp/app/models/concerns/.keep +0 -0
  32. data/examples/myapp/app/views/layouts/application.html.erb +15 -0
  33. data/examples/myapp/app/views/site/contact.html.erb +1 -0
  34. data/examples/myapp/app/views/site/home.html.erb +1 -0
  35. data/examples/myapp/bin/bundle +3 -0
  36. data/examples/myapp/bin/rails +4 -0
  37. data/examples/myapp/bin/rake +4 -0
  38. data/examples/myapp/bin/setup +29 -0
  39. data/examples/myapp/config/application.rb +30 -0
  40. data/examples/myapp/config/boot.rb +3 -0
  41. data/examples/myapp/config/environment.rb +5 -0
  42. data/examples/myapp/config/environments/development.rb +38 -0
  43. data/examples/myapp/config/environments/production.rb +73 -0
  44. data/examples/myapp/config/environments/test.rb +39 -0
  45. data/examples/myapp/config/initializers/assets.rb +11 -0
  46. data/examples/myapp/config/initializers/backtrace_silencers.rb +7 -0
  47. data/examples/myapp/config/initializers/cookies_serializer.rb +3 -0
  48. data/examples/myapp/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/examples/myapp/config/initializers/inflections.rb +16 -0
  50. data/examples/myapp/config/initializers/mime_types.rb +4 -0
  51. data/examples/myapp/config/initializers/session_store.rb +3 -0
  52. data/examples/myapp/config/initializers/wrap_parameters.rb +9 -0
  53. data/examples/myapp/config/locales/en.yml +28 -0
  54. data/examples/myapp/config/routes.rb +5 -0
  55. data/examples/myapp/config/secrets.yml +22 -0
  56. data/examples/myapp/config.ru +4 -0
  57. data/examples/myapp/db/seeds.rb +7 -0
  58. data/examples/myapp/lib/assets/.keep +0 -0
  59. data/examples/myapp/lib/tasks/.keep +0 -0
  60. data/examples/myapp/log/.keep +0 -0
  61. data/examples/myapp/public/404.html +67 -0
  62. data/examples/myapp/public/422.html +67 -0
  63. data/examples/myapp/public/500.html +66 -0
  64. data/examples/myapp/public/favicon.ico +0 -0
  65. data/examples/myapp/public/robots.txt +5 -0
  66. data/examples/myapp/vendor/assets/stylesheets/.keep +0 -0
  67. data/lib/breadcrumbs/action_controller_ext.rb +3 -1
  68. data/lib/breadcrumbs/render/base.rb +9 -21
  69. data/lib/breadcrumbs/render/inline.rb +12 -8
  70. data/lib/breadcrumbs/render/list.rb +8 -8
  71. data/lib/breadcrumbs/render/ordered_list.rb +2 -0
  72. data/lib/breadcrumbs/render.rb +6 -4
  73. data/lib/breadcrumbs/version.rb +4 -2
  74. data/lib/breadcrumbs.rb +36 -21
  75. data/test/breadcrumbs_test.rb +71 -56
  76. data/test/{resources/pt.yml → support/pt-BR.yml} +3 -2
  77. data/test/test_helper.rb +11 -6
  78. metadata +288 -55
  79. data/README.rdoc +0 -113
metadata CHANGED
@@ -1,34 +1,270 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: breadcrumbs
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 5
10
- version: 0.1.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Nando Vieira
14
- autorequire:
8
+ autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-08-26 00:00:00 -03:00
19
- default_executable:
20
- dependencies: []
21
-
22
- description: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers and views.
23
- email: fnando.vieira@gmail.com
11
+ date: 2022-01-26 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
24
199
  executables: []
25
-
26
200
  extensions: []
27
-
28
- extra_rdoc_files:
29
- - README.rdoc
30
- files:
31
- - README.rdoc
201
+ extra_rdoc_files: []
202
+ files:
203
+ - ".github/CODEOWNERS"
204
+ - ".github/FUNDING.yml"
205
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
206
+ - ".github/ISSUE_TEMPLATE/config.yml"
207
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
208
+ - ".github/PULL_REQUEST_TEMPLATE.md"
209
+ - ".github/dependabot.yml"
210
+ - ".github/workflows/ruby-tests.yml"
211
+ - ".gitignore"
212
+ - ".rubocop.yml"
213
+ - CODE_OF_CONDUCT.md
214
+ - CONTRIBUTING.md
215
+ - Gemfile
216
+ - LICENSE.md
217
+ - README.md
218
+ - Rakefile
219
+ - breadcrumbs.gemspec
220
+ - examples/myapp/.gitignore
221
+ - examples/myapp/Gemfile
222
+ - examples/myapp/README.rdoc
223
+ - examples/myapp/Rakefile
224
+ - examples/myapp/app/assets/images/.keep
225
+ - examples/myapp/app/assets/stylesheets/application.css
226
+ - examples/myapp/app/controllers/application_controller.rb
227
+ - examples/myapp/app/controllers/concerns/.keep
228
+ - examples/myapp/app/controllers/site_controller.rb
229
+ - examples/myapp/app/helpers/application_helper.rb
230
+ - examples/myapp/app/mailers/.keep
231
+ - examples/myapp/app/models/.keep
232
+ - examples/myapp/app/models/concerns/.keep
233
+ - examples/myapp/app/views/layouts/application.html.erb
234
+ - examples/myapp/app/views/site/contact.html.erb
235
+ - examples/myapp/app/views/site/home.html.erb
236
+ - examples/myapp/bin/bundle
237
+ - examples/myapp/bin/rails
238
+ - examples/myapp/bin/rake
239
+ - examples/myapp/bin/setup
240
+ - examples/myapp/config.ru
241
+ - examples/myapp/config/application.rb
242
+ - examples/myapp/config/boot.rb
243
+ - examples/myapp/config/environment.rb
244
+ - examples/myapp/config/environments/development.rb
245
+ - examples/myapp/config/environments/production.rb
246
+ - examples/myapp/config/environments/test.rb
247
+ - examples/myapp/config/initializers/assets.rb
248
+ - examples/myapp/config/initializers/backtrace_silencers.rb
249
+ - examples/myapp/config/initializers/cookies_serializer.rb
250
+ - examples/myapp/config/initializers/filter_parameter_logging.rb
251
+ - examples/myapp/config/initializers/inflections.rb
252
+ - examples/myapp/config/initializers/mime_types.rb
253
+ - examples/myapp/config/initializers/session_store.rb
254
+ - examples/myapp/config/initializers/wrap_parameters.rb
255
+ - examples/myapp/config/locales/en.yml
256
+ - examples/myapp/config/routes.rb
257
+ - examples/myapp/config/secrets.yml
258
+ - examples/myapp/db/seeds.rb
259
+ - examples/myapp/lib/assets/.keep
260
+ - examples/myapp/lib/tasks/.keep
261
+ - examples/myapp/log/.keep
262
+ - examples/myapp/public/404.html
263
+ - examples/myapp/public/422.html
264
+ - examples/myapp/public/500.html
265
+ - examples/myapp/public/favicon.ico
266
+ - examples/myapp/public/robots.txt
267
+ - examples/myapp/vendor/assets/stylesheets/.keep
32
268
  - lib/breadcrumbs.rb
33
269
  - lib/breadcrumbs/action_controller_ext.rb
34
270
  - lib/breadcrumbs/render.rb
@@ -38,42 +274,39 @@ files:
38
274
  - lib/breadcrumbs/render/ordered_list.rb
39
275
  - lib/breadcrumbs/version.rb
40
276
  - test/breadcrumbs_test.rb
41
- - test/resources/pt.yml
277
+ - test/support/pt-BR.yml
42
278
  - test/test_helper.rb
43
- has_rdoc: true
44
- homepage: http://github.com/fnando/breadcrumbs
279
+ homepage: http://rubygems.org/gems/breadcrumbs
45
280
  licenses: []
46
-
47
- post_install_message:
48
- rdoc_options:
49
- - --charset=UTF-8
50
- require_paths:
281
+ metadata:
282
+ homepage_uri: http://rubygems.org/gems/breadcrumbs
283
+ bug_tracker_uri: https://github.com/fnando/breadcrumbs/issues
284
+ source_code_uri: https://github.com/fnando/breadcrumbs/tree/v0.3.0
285
+ changelog_uri: https://github.com/fnando/breadcrumbs/tree/v0.3.0/CHANGELOG.md
286
+ documentation_uri: https://github.com/fnando/breadcrumbs/tree/v0.3.0/README.md
287
+ license_uri: https://github.com/fnando/breadcrumbs/tree/v0.3.0/LICENSE.md
288
+ rubygems_mfa_required: 'true'
289
+ post_install_message:
290
+ rdoc_options: []
291
+ require_paths:
51
292
  - lib
52
- required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
293
+ required_ruby_version: !ruby/object:Gem::Requirement
294
+ requirements:
55
295
  - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
- requirements:
296
+ - !ruby/object:Gem::Version
297
+ version: 2.7.0
298
+ required_rubygems_version: !ruby/object:Gem::Requirement
299
+ requirements:
64
300
  - - ">="
65
- - !ruby/object:Gem::Version
66
- hash: 3
67
- segments:
68
- - 0
69
- version: "0"
301
+ - !ruby/object:Gem::Version
302
+ version: '0'
70
303
  requirements: []
71
-
72
- rubyforge_project:
73
- rubygems_version: 1.3.7
74
- signing_key:
75
- specification_version: 3
76
- summary: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers and views.
77
- test_files:
304
+ rubygems_version: 3.3.3
305
+ signing_key:
306
+ specification_version: 4
307
+ summary: Breadcrumbs is a simple plugin that adds a `breadcrumbs` object to controllers
308
+ and views.
309
+ test_files:
78
310
  - test/breadcrumbs_test.rb
311
+ - test/support/pt-BR.yml
79
312
  - test/test_helper.rb
data/README.rdoc DELETED
@@ -1,113 +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 ordered list.
42
-
43
- <%= breadcrumbs.render(:format => :ordered_list) %>
44
-
45
- You can render as inline links.
46
-
47
- <%= breadcrumbs.render(:format => :inline) %>
48
-
49
- You can set your own separator:
50
-
51
- <p>
52
- You are here: <%= breadcrumbs.render(:format => :inline, :separator => '|') %>
53
- </p>
54
-
55
- You can also define your own formatter. Just create a class that implements a +render+ instance
56
- method and you're good to go.
57
-
58
- class Breadcrumbs::Render::Dl
59
- def render
60
- # return breadcrumbs wrapped in a <DL> tag
61
- end
62
- end
63
-
64
- To use your new format, just provide the <tt>:format</tt> option.
65
-
66
- breadcrumbs.render(:format => :dl)
67
-
68
- === I18n
69
-
70
- Breadcrumbs is integrated with I18n. You can set translations like:
71
-
72
- en:
73
- breadcrumbs:
74
- home: "Home"
75
-
76
- And then you just call
77
-
78
- breadcrumbs.add :home
79
-
80
- In fact, you can provide any scope you want.
81
-
82
- breadcrumbs.add "titles.home"
83
-
84
- If you don't want to translate a label, just pass the option <tt>:i18n</tt> as <tt>false</tt>.
85
-
86
- breadcrumbs.add :home, nil, :i18n => false
87
-
88
- == Maintainer
89
-
90
- * Nando Vieira - http://simplesideias.com.br
91
-
92
- License
93
-
94
- (The MIT License)
95
-
96
- Permission is hereby granted, free of charge, to any person obtaining
97
- a copy of this software and associated documentation files (the
98
- 'Software'), to deal in the Software without restriction, including
99
- without limitation the rights to use, copy, modify, merge, publish,
100
- distribute, sublicense, and/or sell copies of the Software, and to
101
- permit persons to whom the Software is furnished to do so, subject to
102
- the following conditions:
103
-
104
- The above copyright notice and this permission notice shall be
105
- included in all copies or substantial portions of the Software.
106
-
107
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
108
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
109
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
110
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
111
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
112
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
113
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.