loaf 0.6.1 → 0.6.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +16 -1
- data/lib/loaf/configuration.rb +4 -1
- data/lib/loaf/crumb.rb +1 -1
- data/lib/loaf/version.rb +1 -1
- data/spec/unit/configuration_spec.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff7903e3c4af9741df52746a183ab5ce64be0390
|
4
|
+
data.tar.gz: 2b2361cb571bc40e83dbaf37a58982a0fdcb8903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6649ee9688af545490a3697cf277423b9f9db9b2fb35ebfde2655970fc8ea41fbfe027ee0925a8fa75b3e41b636e3f1f02a4e4f688478793657bb110f3033c0d
|
7
|
+
data.tar.gz: 4cdc8efd1ff9f7eac3adfbbdaadd6e5ac1ef9496680d55de424ab3b73f06080b84b1b2329b5bebf8bb736d5f65578c74fd3f54ce23009982437526aa23875283
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.6.2] - 2018-03-30
|
4
|
+
|
5
|
+
### Added
|
6
|
+
* Add :match to Configuration by Johan Kim(@hiphapis)
|
7
|
+
|
3
8
|
## [v0.6.1] - 2018-03-26
|
4
9
|
|
5
10
|
### Added
|
@@ -87,6 +92,7 @@
|
|
87
92
|
|
88
93
|
* Initial implementation and release
|
89
94
|
|
95
|
+
[v0.6.2]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.1...v0.6.2
|
90
96
|
[v0.6.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.0...v0.6.1
|
91
97
|
[v0.6.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.5.0...v0.6.0
|
92
98
|
[v0.5.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.4.0...v0.5.0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -219,7 +219,7 @@ crumb.current? # => true or false
|
|
219
219
|
For example, you can add the following semantic markup to show breadcrumbs using the `breadcrumb_trail` helper like so:
|
220
220
|
|
221
221
|
```erb
|
222
|
-
<nav aria-label="
|
222
|
+
<nav aria-label="breadcrumb">
|
223
223
|
<ol class='breadcrumbs'>
|
224
224
|
<% breadcrumb_trail do |crumb| %>
|
225
225
|
<li class="<%= crumb.current? ? 'current' : '' %>">
|
@@ -231,6 +231,20 @@ For example, you can add the following semantic markup to show breadcrumbs using
|
|
231
231
|
</nav>
|
232
232
|
```
|
233
233
|
|
234
|
+
For bootstrap,
|
235
|
+
```erb
|
236
|
+
<nav aria-label="breadcrumb">
|
237
|
+
<ol class='breadcrumbs'>
|
238
|
+
<% breadcrumb_trail do |crumb| %>
|
239
|
+
<li class="breadcrumb-item <%= crumb.current? ? 'active' : '' %>">
|
240
|
+
<%= link_to_unless crumb.current?, crumb.name, crumb.url, (crumb.current? ? {'aria-current' => 'page'} : {}) %>
|
241
|
+
</li>
|
242
|
+
<% end %>
|
243
|
+
</ol>
|
244
|
+
</nav>
|
245
|
+
```
|
246
|
+
|
247
|
+
|
234
248
|
Usually best practice is to put such snippet inside its own partial.
|
235
249
|
|
236
250
|
## 3. Configuration
|
@@ -240,6 +254,7 @@ There is a small set of custom opinionated defaults. The following options are v
|
|
240
254
|
```ruby
|
241
255
|
:capitalize # set breadcrumbs to have initial letter uppercase, default false
|
242
256
|
:crumb_length # breadcrumb length in integer, default length is 30 characters
|
257
|
+
:match # set match type, default :inclusive
|
243
258
|
```
|
244
259
|
|
245
260
|
You can override them in your views by passing them to the view `breadcrumb` helper
|
data/lib/loaf/configuration.rb
CHANGED
@@ -5,7 +5,8 @@ module Loaf
|
|
5
5
|
VALID_ATTRIBUTES = [
|
6
6
|
:locales_path,
|
7
7
|
:crumb_length,
|
8
|
-
:capitalize
|
8
|
+
:capitalize,
|
9
|
+
:match
|
9
10
|
].freeze
|
10
11
|
|
11
12
|
attr_accessor(*VALID_ATTRIBUTES)
|
@@ -20,6 +21,8 @@ module Loaf
|
|
20
21
|
|
21
22
|
DEFAULT_CAPITALIZE = false
|
22
23
|
|
24
|
+
DEFAULT_MATCH = :inclusive
|
25
|
+
|
23
26
|
DEFAULT_ROOT = true
|
24
27
|
|
25
28
|
# Setup this configuration
|
data/lib/loaf/crumb.rb
CHANGED
data/lib/loaf/version.rb
CHANGED
@@ -5,15 +5,18 @@ RSpec.describe Loaf::Configuration do
|
|
5
5
|
config = Loaf::Configuration.new
|
6
6
|
|
7
7
|
config.crumb_length = 4
|
8
|
-
|
9
8
|
expect(config.crumb_length).to eq(4)
|
9
|
+
|
10
|
+
config.match = :exact
|
11
|
+
expect(config.match).to eq(:exact)
|
10
12
|
end
|
11
13
|
|
12
14
|
it "accepts attributes at initialization" do
|
13
|
-
options = { crumb_length: 12 }
|
15
|
+
options = { crumb_length: 12, match: :exact }
|
14
16
|
config = Loaf::Configuration.new(options)
|
15
17
|
|
16
18
|
expect(config.crumb_length).to eq(12)
|
19
|
+
expect(config.match).to eq(:exact)
|
17
20
|
end
|
18
21
|
|
19
22
|
it "exports configuration as hash" do
|
@@ -21,7 +24,8 @@ RSpec.describe Loaf::Configuration do
|
|
21
24
|
expect(config.to_hash).to eq({
|
22
25
|
capitalize: false,
|
23
26
|
crumb_length: 30,
|
24
|
-
locales_path: '/'
|
27
|
+
locales_path: '/',
|
28
|
+
match: :inclusive
|
25
29
|
})
|
26
30
|
end
|
27
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|