loaf 0.6.0 → 0.6.1

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: 2eae83f119feab3c5197cafe6db57e8df4057287
4
- data.tar.gz: dfa24179e0047a473a5645bf4d1c7007b3aaf084
3
+ metadata.gz: 5b5fbc0f403a497955b563df3e8e7928ebec2295
4
+ data.tar.gz: 82a7f616c4966aea6557b7113bf04a27d10a1785
5
5
  SHA512:
6
- metadata.gz: c4af1ee0d63a25affef7ca67cdb63d831b7ddfb51fd64bf8b9d49fe13b6848165b81078c64c7941358ca24c5cddfd836558e07ca1965a38f15abcdd17e0ef157
7
- data.tar.gz: bbc01fbb9984b472bcb99e65a4622465e6053686824f9384e48d0af3f0ac7c87239fa58fd2bd9394125e7587e127ace4bd76723c8afced0e846a1d68c1175eff
6
+ metadata.gz: b1d5a5a2349429b373c69fa31376353ac9e7df4a16bcaa84411f53ea76b96e2533081612fc6cefa87d07b6fb8d0c94530f6a8a97177bdabeeea1644601c30ae7
7
+ data.tar.gz: 53159297fcde6a23dd745213e7df1f55c09ac7d82d9b5ca1e85bfc61084a650bb6bce2b3ab5cdb5660773385acf358976501100d1454d6c54d3b92f5ce5ae672
@@ -8,26 +8,31 @@ install:
8
8
  script:
9
9
  - bundle exec appraisal rake ci
10
10
  rvm:
11
- - 2.0.0
12
11
  - 2.1.10
13
- - 2.2.5
14
- - 2.3.1
15
- - 2.4.1
12
+ - 2.2.9
13
+ - 2.3.6
14
+ - 2.4.3
15
+ - 2.5.0
16
16
  matrix:
17
17
  include:
18
18
  - rvm: jruby-9.1.1.0
19
19
  - rvm: jruby-head
20
20
  - rvm: ruby-head
21
21
  exclude:
22
- - rvm: 2.0.0
23
- gemfile: gemfiles/rails5.0.gemfile
24
22
  - rvm: 2.1.10
25
- gemfile: gemfiles/rails5.0.gemfile
26
- - rvm: 2.2.5
23
+ gemfile:
24
+ - gemfiles/rails5.0.gemfile
25
+ - gemfiles/rails5.1.gemfile
26
+ - rvm: 2.2.9
27
27
  gemfile: gemfiles/rails3.2.gemfile
28
- - rvm: 2.3.1
28
+ - rvm: 2.3.6
29
29
  gemfile: gemfiles/rails3.2.gemfile
30
- - rvm: 2.4.1
30
+ - rvm: 2.4.3
31
+ gemfile:
32
+ - gemfiles/rails3.2.gemfile
33
+ - gemfiles/rails4.0.gemfile
34
+ - gemfiles/rails4.1.gemfile
35
+ - rvm: 2.5.0
31
36
  gemfile:
32
37
  - gemfiles/rails3.2.gemfile
33
38
  - gemfiles/rails4.0.gemfile
@@ -1,5 +1,13 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.6.1] - 2018-03-26
4
+
5
+ ### Added
6
+ * Add nil guard and clear error messages to Loaf::Crumb initialization by Dan Matthews(@dmvt)
7
+
8
+ ### Fixed
9
+ * Fix Loaf::Crumb to stop modifying options hash by Marcel Müller(@TheNeikos)
10
+
3
11
  ## [v0.6.0] - 2017-10-19
4
12
 
5
13
  ### Added
@@ -79,6 +87,7 @@
79
87
 
80
88
  * Initial implementation and release
81
89
 
90
+ [v0.6.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.0...v0.6.1
82
91
  [v0.6.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.5.0...v0.6.0
83
92
  [v0.5.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.4.0...v0.5.0
84
93
  [v0.4.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.3.0...v0.4.0
data/Gemfile CHANGED
@@ -4,10 +4,10 @@ gemspec
4
4
 
5
5
  gem 'ammeter', '~> 1.1.4'
6
6
  gem 'appraisal', '~> 2.2.0'
7
- gem 'yard', '~> 0.9.9'
8
- gem 'capybara', '~> 2.15.4'
9
- gem 'rspec-rails', '~> 3.6.1'
10
- gem 'nokogiri', '~> 1.6.8'
7
+ gem 'yard', '~> 0.9.12'
8
+ gem 'capybara', '~> 2.16.1'
9
+ gem 'rspec-rails', '~> 3.7.2'
10
+ gem 'nokogiri', '~> 1.8.1'
11
11
  gem 'public_suffix', '~> 2.0.5'
12
12
  gem 'sqlite3' , '~> 1.3.13', platforms: :ruby
13
13
  gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.23', platforms: :jruby
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loaf (0.6.0)
4
+ loaf (0.6.1)
5
5
  rails (>= 3.2)
6
6
 
7
7
  GEM
@@ -53,7 +53,7 @@ GEM
53
53
  thor (>= 0.14.0)
54
54
  arel (6.0.4)
55
55
  builder (3.2.3)
56
- capybara (2.15.4)
56
+ capybara (2.16.1)
57
57
  addressable
58
58
  mini_mime (>= 0.1.3)
59
59
  nokogiri (>= 1.3.3)
@@ -67,25 +67,28 @@ GEM
67
67
  term-ansicolor (~> 1.3)
68
68
  thor (~> 0.19.1)
69
69
  tins (~> 1.6)
70
+ crass (1.0.3)
70
71
  diff-lcs (1.3)
71
72
  docile (1.1.5)
72
73
  erubis (2.7.0)
73
74
  globalid (0.4.0)
74
75
  activesupport (>= 4.2.0)
75
- i18n (0.8.6)
76
+ i18n (0.9.1)
77
+ concurrent-ruby (~> 1.0)
76
78
  json (2.1.0)
77
- loofah (2.0.3)
79
+ loofah (2.1.1)
80
+ crass (~> 1.0.2)
78
81
  nokogiri (>= 1.5.9)
79
82
  mail (2.6.6)
80
83
  mime-types (>= 1.16, < 4)
81
84
  mime-types (3.1)
82
85
  mime-types-data (~> 3.2015)
83
86
  mime-types-data (3.2016.0521)
84
- mini_mime (0.1.4)
85
- mini_portile2 (2.1.0)
87
+ mini_mime (1.0.0)
88
+ mini_portile2 (2.3.0)
86
89
  minitest (5.10.3)
87
- nokogiri (1.6.8.1)
88
- mini_portile2 (~> 2.1.0)
90
+ nokogiri (1.8.1)
91
+ mini_portile2 (~> 2.3.0)
89
92
  public_suffix (2.0.5)
90
93
  rack (1.6.8)
91
94
  rack-test (0.6.3)
@@ -103,8 +106,8 @@ GEM
103
106
  sprockets-rails
104
107
  rails-deprecated_sanitizer (1.0.3)
105
108
  activesupport (>= 4.2.0.alpha)
106
- rails-dom-testing (1.0.8)
107
- activesupport (>= 4.2.0.beta, < 5.0)
109
+ rails-dom-testing (1.0.9)
110
+ activesupport (>= 4.2.0, < 5.0)
108
111
  nokogiri (~> 1.6)
109
112
  rails-deprecated_sanitizer (>= 1.0.1)
110
113
  rails-html-sanitizer (1.0.3)
@@ -114,24 +117,24 @@ GEM
114
117
  activesupport (= 4.2.9)
115
118
  rake (>= 0.8.7)
116
119
  thor (>= 0.18.1, < 2.0)
117
- rake (12.1.0)
118
- rspec-core (3.6.0)
119
- rspec-support (~> 3.6.0)
120
- rspec-expectations (3.6.0)
120
+ rake (12.3.0)
121
+ rspec-core (3.7.0)
122
+ rspec-support (~> 3.7.0)
123
+ rspec-expectations (3.7.0)
121
124
  diff-lcs (>= 1.2.0, < 2.0)
122
- rspec-support (~> 3.6.0)
123
- rspec-mocks (3.6.0)
125
+ rspec-support (~> 3.7.0)
126
+ rspec-mocks (3.7.0)
124
127
  diff-lcs (>= 1.2.0, < 2.0)
125
- rspec-support (~> 3.6.0)
126
- rspec-rails (3.6.1)
128
+ rspec-support (~> 3.7.0)
129
+ rspec-rails (3.7.2)
127
130
  actionpack (>= 3.0)
128
131
  activesupport (>= 3.0)
129
132
  railties (>= 3.0)
130
- rspec-core (~> 3.6.0)
131
- rspec-expectations (~> 3.6.0)
132
- rspec-mocks (~> 3.6.0)
133
- rspec-support (~> 3.6.0)
134
- rspec-support (3.6.0)
133
+ rspec-core (~> 3.7.0)
134
+ rspec-expectations (~> 3.7.0)
135
+ rspec-mocks (~> 3.7.0)
136
+ rspec-support (~> 3.7.0)
137
+ rspec-support (3.7.0)
135
138
  simplecov (0.12.0)
136
139
  docile (~> 1.1.0)
137
140
  json (>= 1.8, < 3)
@@ -150,11 +153,11 @@ GEM
150
153
  thor (0.19.4)
151
154
  thread_safe (0.3.6)
152
155
  tins (1.15.0)
153
- tzinfo (1.2.3)
156
+ tzinfo (1.2.4)
154
157
  thread_safe (~> 0.1)
155
158
  xpath (2.1.0)
156
159
  nokogiri (~> 1.3)
157
- yard (0.9.9)
160
+ yard (0.9.12)
158
161
  yardstick (0.9.9)
159
162
  yard (~> 0.8, >= 0.8.7.2)
160
163
 
@@ -166,17 +169,17 @@ DEPENDENCIES
166
169
  ammeter (~> 1.1.4)
167
170
  appraisal (~> 2.2.0)
168
171
  bundler (~> 1.5)
169
- capybara (~> 2.15.4)
172
+ capybara (~> 2.16.1)
170
173
  coveralls (= 0.8.17)
171
174
  loaf!
172
- nokogiri (~> 1.6.8)
175
+ nokogiri (~> 1.8.1)
173
176
  public_suffix (~> 2.0.5)
174
177
  rake
175
- rspec-rails (~> 3.6.1)
178
+ rspec-rails (~> 3.7.2)
176
179
  simplecov (~> 0.12.0)
177
180
  sqlite3 (~> 1.3.13)
178
- yard (~> 0.9.9)
181
+ yard (~> 0.9.12)
179
182
  yardstick (~> 0.9.9)
180
183
 
181
184
  BUNDLED WITH
182
- 1.15.4
185
+ 1.16.1
data/README.md CHANGED
@@ -6,14 +6,14 @@
6
6
 
7
7
  [![Gem Version](https://badge.fury.io/rb/loaf.svg)][gem]
8
8
  [![Build Status](https://secure.travis-ci.org/piotrmurach/loaf.svg?branch=master)][travis]
9
- [![Code Climate](https://codeclimate.com/github/piotrmurach/loaf/badges/gpa.svg)][codeclimate]
9
+ [![Maintainability](https://api.codeclimate.com/v1/badges/966193dafa3895766977/maintainability)][codeclimate]
10
10
  [![Dependency Status](https://gemnasium.com/piotrmurach/loaf.svg?travis)][gemnasium]
11
11
  [![Coverage Status](https://coveralls.io/repos/github/piotrmurach/loaf/badge.svg?branch=master)][coveralls]
12
12
  [![Inline docs](http://inch-ci.org/github/piotrmurach/loaf.svg?branch=master)][inchpages]
13
13
 
14
14
  [gem]: http://badge.fury.io/rb/loaf
15
15
  [travis]: http://travis-ci.org/piotrmurach/loaf
16
- [codeclimate]: https://codeclimate.com/github/piotrmurach/loaf
16
+ [codeclimate]: https://codeclimate.com/github/piotrmurach/loaf/maintainability
17
17
  [gemnasium]: https://gemnasium.com/piotrmurach/loaf
18
18
  [coveralls]: https://coveralls.io/github/piotrmurach/loaf
19
19
  [inchpages]: http://inch-ci.org/github/piotrmurach/loaf
@@ -199,7 +199,7 @@ breadcrumb 'Posts', posts_path(order: :desc), match: {order: :desc}
199
199
 
200
200
  ### 2.2 breadcrumb_trail
201
201
 
202
- In order to display breadcrumbs use the `breadcrumb_trail` view helper which as an argument accepts options and yeilds all breadcrumbs to a block:
202
+ In order to display breadcrumbs use the `breadcrumb_trail` view helper which as an argument accepts options and yields all breadcrumbs to a block:
203
203
 
204
204
  ```ruby
205
205
  breadcrumb_trail do |crumb|
@@ -293,4 +293,4 @@ Questions or problems? Please post them on the [issue tracker](https://github.co
293
293
 
294
294
  ## Copyright
295
295
 
296
- Copyright (c) 2011-2017 Piotr Murach. See LICENSE.txt for further details.
296
+ Copyright (c) 2011-2018 Piotr Murach. See LICENSE.txt for further details.
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
9
- gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
9
- gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
9
- gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
9
- gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
9
  gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -4,10 +4,10 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
- gem "yard", "~> 0.9.9"
8
- gem "capybara", "~> 2.15.4"
7
+ gem "yard", "~> 0.9.12"
8
+ gem "capybara", "~> 2.16.1"
9
9
  gem "rspec-rails", "~> 3.6.1"
10
- gem "nokogiri", "~> 1.6.8"
10
+ gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
@@ -1,6 +1,6 @@
1
1
  module Loaf
2
2
  # A container for breadcrumb values
3
- # @api public
3
+ # @api public
4
4
  class Breadcrumb
5
5
  attr_reader :name
6
6
 
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Loaf
4
- # Basic crumb container
4
+ # Basic crumb container for internal use
5
+ # @api private
5
6
  class Crumb
6
7
  attr_reader :name
7
8
 
@@ -10,10 +11,18 @@ module Loaf
10
11
  attr_reader :match
11
12
 
12
13
  def initialize(name, url, options = {})
13
- @name = name
14
- @url = url
15
- @match = options.delete(:match) { :inclusive }
14
+ @name = name || raise_name_error
15
+ @url = url || raise_url_error
16
+ @match = options.fetch(:match, :inclusive)
16
17
  freeze
17
18
  end
19
+
20
+ def raise_name_error
21
+ raise ArgumentError, 'breadcrumb first argument, `name`, cannot be nil'
22
+ end
23
+
24
+ def raise_url_error
25
+ raise ArgumentError, 'breadcrumb second argument, `url`, cannot be nil'
26
+ end
18
27
  end # Crumb
19
28
  end # Loaf
@@ -1,3 +1,3 @@
1
1
  module Loaf
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end # Loaf
@@ -1,7 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
3
  RSpec.describe Loaf::CrumbFormatter, '.format_name' do
6
4
  let(:formatter) {
7
5
  Class.new do
@@ -0,0 +1,15 @@
1
+ RSpec.describe Loaf::Crumb do
2
+ it "fails when name is nil" do
3
+ expect {
4
+ Loaf::Crumb.new(nil, 'path')
5
+ }.to raise_error(ArgumentError,
6
+ /breadcrumb first argument, `name`, cannot be nil/)
7
+ end
8
+
9
+ it "fails when url is nil" do
10
+ expect {
11
+ Loaf::Crumb.new('name', nil)
12
+ }.to raise_error(ArgumentError,
13
+ /breadcrumb second argument, `url`, cannot be nil/)
14
+ end
15
+ end
@@ -1,7 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
3
  RSpec.describe Loaf::OptionsValidator, '.valid?' do
6
4
  let(:klass) { Class.extend Loaf::OptionsValidator }
7
5
 
@@ -1,7 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
3
  RSpec.describe Loaf::Translation do
6
4
 
7
5
  before { I18n.backend = I18n::Backend::Simple.new }
@@ -1,7 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
3
  RSpec.describe Loaf::ViewExtensions, '.breadcrumb' do
6
4
 
7
5
  it { expect(DummyView.new).to respond_to(:add_breadcrumb) }
@@ -1,7 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'spec_helper'
4
-
5
3
  RSpec.describe Loaf::ViewExtensions, '.breadcrumb?' do
6
4
  it 'checks for breadcrumbs existance' do
7
5
  instance = DummyView.new
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.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-19 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -147,6 +147,7 @@ files:
147
147
  - spec/unit/configuration_spec.rb
148
148
  - spec/unit/controller_extensions_spec.rb
149
149
  - spec/unit/crumb_formatter_spec.rb
150
+ - spec/unit/crumb_spec.rb
150
151
  - spec/unit/generators/install_generator_spec.rb
151
152
  - spec/unit/options_validator_spec.rb
152
153
  - spec/unit/translation_spec.rb
@@ -230,6 +231,7 @@ test_files:
230
231
  - spec/unit/configuration_spec.rb
231
232
  - spec/unit/controller_extensions_spec.rb
232
233
  - spec/unit/crumb_formatter_spec.rb
234
+ - spec/unit/crumb_spec.rb
233
235
  - spec/unit/generators/install_generator_spec.rb
234
236
  - spec/unit/options_validator_spec.rb
235
237
  - spec/unit/translation_spec.rb