loaf 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b5fbc0f403a497955b563df3e8e7928ebec2295
4
- data.tar.gz: 82a7f616c4966aea6557b7113bf04a27d10a1785
3
+ metadata.gz: ff7903e3c4af9741df52746a183ab5ce64be0390
4
+ data.tar.gz: 2b2361cb571bc40e83dbaf37a58982a0fdcb8903
5
5
  SHA512:
6
- metadata.gz: b1d5a5a2349429b373c69fa31376353ac9e7df4a16bcaa84411f53ea76b96e2533081612fc6cefa87d07b6fb8d0c94530f6a8a97177bdabeeea1644601c30ae7
7
- data.tar.gz: 53159297fcde6a23dd745213e7df1f55c09ac7d82d9b5ca1e85bfc61084a650bb6bce2b3ab5cdb5660773385acf358976501100d1454d6c54d3b92f5ce5ae672
6
+ metadata.gz: 6649ee9688af545490a3697cf277423b9f9db9b2fb35ebfde2655970fc8ea41fbfe027ee0925a8fa75b3e41b636e3f1f02a4e4f688478793657bb110f3033c0d
7
+ data.tar.gz: 4cdc8efd1ff9f7eac3adfbbdaadd6e5ac1ef9496680d55de424ab3b73f06080b84b1b2329b5bebf8bb736d5f65578c74fd3f54ce23009982437526aa23875283
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loaf (0.6.1)
4
+ loaf (0.6.2)
5
5
  rails (>= 3.2)
6
6
 
7
7
  GEM
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="Breadcrumb">
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
@@ -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
@@ -13,7 +13,7 @@ module Loaf
13
13
  def initialize(name, url, options = {})
14
14
  @name = name || raise_name_error
15
15
  @url = url || raise_url_error
16
- @match = options.fetch(:match, :inclusive)
16
+ @match = options.fetch(:match, Loaf.configuration.match)
17
17
  freeze
18
18
  end
19
19
 
@@ -1,3 +1,3 @@
1
1
  module Loaf
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end # Loaf
@@ -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.1
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-26 00:00:00.000000000 Z
11
+ date: 2018-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails