loaf 0.6.2 → 0.7.0

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: ff7903e3c4af9741df52746a183ab5ce64be0390
4
- data.tar.gz: 2b2361cb571bc40e83dbaf37a58982a0fdcb8903
3
+ metadata.gz: cca72395f0a519e2c8e167a945f0a7aef2904405
4
+ data.tar.gz: 073bea2f84cbe624dc1b281eb945607be99ee091
5
5
  SHA512:
6
- metadata.gz: 6649ee9688af545490a3697cf277423b9f9db9b2fb35ebfde2655970fc8ea41fbfe027ee0925a8fa75b3e41b636e3f1f02a4e4f688478793657bb110f3033c0d
7
- data.tar.gz: 4cdc8efd1ff9f7eac3adfbbdaadd6e5ac1ef9496680d55de424ab3b73f06080b84b1b2329b5bebf8bb736d5f65578c74fd3f54ce23009982437526aa23875283
6
+ metadata.gz: 1011debf785a3fa61247244b1db86937bba310dfc54621759eca9c1dd2d8e1eb7f6d88a7a67b5a2fd99795c26881cc365306aeb5b6f6ebe6267c7614e64f9731
7
+ data.tar.gz: 36daede4d09914f3a488f3dee1c0a1c5250fb0b2b3a8604d77a229d66cb464723d788b075ea553714d25faa7c06dd2a941cbd572e81589ca0e2565ec9ee4fdd6
@@ -1,46 +1,47 @@
1
- ---
2
1
  language: ruby
3
- sudo: false
4
2
  cache: bundler
5
- install:
6
- - bundle install
7
- - bundle exec bin/appraisal install
8
- script:
9
- - bundle exec appraisal rake ci
3
+ sudo: false
4
+ before_install: "gem update bundler"
5
+ script: "bundle exec rake ci"
10
6
  rvm:
11
7
  - 2.1.10
12
8
  - 2.2.9
13
9
  - 2.3.6
14
10
  - 2.4.3
15
- - 2.5.0
11
+ - 2.5.1
12
+ - jruby-9.1.17.0
13
+ gemfile:
14
+ - gemfiles/rails3.2.gemfile
15
+ - gemfiles/rails4.0.gemfile
16
+ - gemfiles/rails4.1.gemfile
17
+ - gemfiles/rails4.2.gemfile
18
+ - gemfiles/rails5.0.gemfile
19
+ - gemfiles/rails5.1.gemfile
20
+ - gemfiles/rails5.2.gemfile
16
21
  matrix:
17
- include:
18
- - rvm: jruby-9.1.1.0
19
- - rvm: jruby-head
20
- - rvm: ruby-head
21
22
  exclude:
22
23
  - rvm: 2.1.10
23
- gemfile:
24
- - gemfiles/rails5.0.gemfile
25
- - gemfiles/rails5.1.gemfile
26
- - rvm: 2.2.9
27
- gemfile: gemfiles/rails3.2.gemfile
28
- - rvm: 2.3.6
24
+ gemfile: gemfiles/rails5.0.gemfile
25
+ - rvm: 2.1.10
26
+ gemfile: gemfiles/rails5.1.gemfile
27
+ - rvm: 2.1.10
28
+ gemfile: gemfiles/rails5.2.gemfile
29
+ - rvm: 2.4.3
29
30
  gemfile: gemfiles/rails3.2.gemfile
30
31
  - 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
36
- gemfile:
37
- - gemfiles/rails3.2.gemfile
38
- - gemfiles/rails4.0.gemfile
39
- - gemfiles/rails4.1.gemfile
32
+ gemfile: gemfiles/rails4.0.gemfile
33
+ - rvm: 2.4.3
34
+ gemfile: gemfiles/rails4.1.gemfile
35
+ - rvm: 2.5.1
36
+ gemfile: gemfiles/rails3.2.gemfile
37
+ - rvm: 2.5.1
38
+ gemfile: gemfiles/rails4.0.gemfile
39
+ - rvm: 2.5.1
40
+ gemfile: gemfiles/rails4.1.gemfile
41
+ - rvm: jruby-9.1.17.0
42
+ gemfile: gemfiles/rails5.2.gemfile
40
43
  allow_failures:
41
- - rvm: ruby-head
42
- - rvm: jruby-9.1.1.0
43
- - rvm: jruby-head
44
+ - rvm: jruby-9.1.17.0
44
45
  fast_finish: true
45
46
  branches:
46
47
  only: master
data/Appraisals CHANGED
@@ -1,36 +1,31 @@
1
- if RUBY_VERSION < '2.2.0'
2
- appraise 'rails3.2' do
3
- gem 'rails', '~> 3.2.22.5'
4
- gem 'test-unit', '~> 3.0'
5
- end
1
+ appraise 'rails3.2' do
2
+ gem 'rails', '~> 3.2.22.5'
3
+ gem 'test-unit', '~> 3.0'
6
4
  end
7
5
 
8
- if RUBY_VERSION < '2.4.0'
9
- appraise 'rails4.0' do
10
- gem 'rails', '~> 4.0.13'
11
- gem 'test-unit'
12
- gem 'mime-types', '~> 2.99'
13
- end
6
+ appraise 'rails4.0' do
7
+ gem 'rails', '~> 4.0.13'
8
+ gem 'test-unit'
9
+ end
14
10
 
15
- appraise 'rails4.1' do
16
- gem 'rails', '~> 4.1.16'
17
- gem 'mime-types', '~> 2.99'
18
- end
11
+ appraise 'rails4.1' do
12
+ gem 'rails', '~> 4.1.16'
19
13
  end
20
14
 
21
15
  appraise 'rails4.2' do
22
- gem 'rails', '~> 4.2.9'
23
- gem 'mime-types', '~> 2.99'
16
+ gem 'rails', '~> 4.2.10'
17
+ end
18
+
19
+ appraise 'rails5.0' do
20
+ gem 'rails', '~> 5.0.7'
21
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 50.1', platforms: :jruby
24
22
  end
25
23
 
26
- if RUBY_VERSION >= '2.2.0'
27
- appraise 'rails5.0' do
28
- gem 'rails', '~> 5.0.6'
29
- gem 'rspec-rails', '~> 3.6.1'
30
- end
24
+ appraise 'rails5.1' do
25
+ gem 'rails', '~> 5.1.6'
26
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 51.1', platforms: :jruby
27
+ end
31
28
 
32
- appraise 'rails5.1' do
33
- gem 'rails', '~> 5.1.4'
34
- gem 'rspec-rails', '~> 3.6.1'
35
- end
29
+ appraise 'rails5.2' do
30
+ gem 'rails', '~> 5.2.0'
36
31
  end
@@ -1,5 +1,13 @@
1
1
  # Change log
2
2
 
3
+ ## [v0.7.0] - 2018-06-20
4
+
5
+ ### Added
6
+ * Add test setup for Rails 5.2 by Bendon Muir(@brendon)
7
+
8
+ ### Changed
9
+ * Change controller level #breadcrumb helper to accept Proc as name without controller parameter by Brendon Muir(@brendon)
10
+
3
11
  ## [v0.6.2] - 2018-03-30
4
12
 
5
13
  ### Added
@@ -92,6 +100,7 @@
92
100
 
93
101
  * Initial implementation and release
94
102
 
103
+ [v0.7.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.2...v0.7.0
95
104
  [v0.6.2]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.1...v0.6.2
96
105
  [v0.6.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.0...v0.6.1
97
106
  [v0.6.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.5.0...v0.6.0
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gem 'rspec-rails', '~> 3.7.2'
10
10
  gem 'nokogiri', '~> 1.8.1'
11
11
  gem 'public_suffix', '~> 2.0.5'
12
12
  gem 'sqlite3' , '~> 1.3.13', platforms: :ruby
13
- gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.23', platforms: :jruby
13
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.24', platforms: :jruby
14
14
 
15
15
  group :metrics do
16
16
  gem 'coveralls', '0.8.17'
@@ -1,42 +1,47 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loaf (0.6.2)
4
+ loaf (0.7.0)
5
5
  rails (>= 3.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (4.2.9)
11
- actionpack (= 4.2.9)
12
- actionview (= 4.2.9)
13
- activejob (= 4.2.9)
10
+ actionmailer (4.2.10)
11
+ actionpack (= 4.2.10)
12
+ actionview (= 4.2.10)
13
+ activejob (= 4.2.10)
14
14
  mail (~> 2.5, >= 2.5.4)
15
15
  rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.9)
17
- actionview (= 4.2.9)
18
- activesupport (= 4.2.9)
16
+ actionpack (4.2.10)
17
+ actionview (= 4.2.10)
18
+ activesupport (= 4.2.10)
19
19
  rack (~> 1.6)
20
20
  rack-test (~> 0.6.2)
21
21
  rails-dom-testing (~> 1.0, >= 1.0.5)
22
22
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- actionview (4.2.9)
24
- activesupport (= 4.2.9)
23
+ actionview (4.2.10)
24
+ activesupport (= 4.2.10)
25
25
  builder (~> 3.1)
26
26
  erubis (~> 2.7.0)
27
27
  rails-dom-testing (~> 1.0, >= 1.0.5)
28
28
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
- activejob (4.2.9)
30
- activesupport (= 4.2.9)
29
+ activejob (4.2.10)
30
+ activesupport (= 4.2.10)
31
31
  globalid (>= 0.3.0)
32
- activemodel (4.2.9)
33
- activesupport (= 4.2.9)
32
+ activemodel (4.2.10)
33
+ activesupport (= 4.2.10)
34
34
  builder (~> 3.1)
35
- activerecord (4.2.9)
36
- activemodel (= 4.2.9)
37
- activesupport (= 4.2.9)
35
+ activerecord (4.2.10)
36
+ activemodel (= 4.2.10)
37
+ activesupport (= 4.2.10)
38
38
  arel (~> 6.0)
39
- activesupport (4.2.9)
39
+ activerecord-jdbc-adapter (1.3.24)
40
+ activerecord (>= 2.2, < 5.0)
41
+ activerecord-jdbcsqlite3-adapter (1.3.24)
42
+ activerecord-jdbc-adapter (~> 1.3.24)
43
+ jdbc-sqlite3 (>= 3.7.2, < 3.9)
44
+ activesupport (4.2.10)
40
45
  i18n (~> 0.7)
41
46
  minitest (~> 5.1)
42
47
  thread_safe (~> 0.3, >= 0.3.4)
@@ -61,48 +66,49 @@ GEM
61
66
  rack-test (>= 0.5.4)
62
67
  xpath (~> 2.0)
63
68
  concurrent-ruby (1.0.5)
69
+ concurrent-ruby (1.0.5-java)
64
70
  coveralls (0.8.17)
65
71
  json (>= 1.8, < 3)
66
72
  simplecov (~> 0.12.0)
67
73
  term-ansicolor (~> 1.3)
68
74
  thor (~> 0.19.1)
69
75
  tins (~> 1.6)
70
- crass (1.0.3)
76
+ crass (1.0.4)
71
77
  diff-lcs (1.3)
72
78
  docile (1.1.5)
73
79
  erubis (2.7.0)
74
- globalid (0.4.0)
80
+ globalid (0.4.1)
75
81
  activesupport (>= 4.2.0)
76
- i18n (0.9.1)
82
+ i18n (0.9.5)
77
83
  concurrent-ruby (~> 1.0)
84
+ jdbc-sqlite3 (3.8.11.2)
78
85
  json (2.1.0)
79
- loofah (2.1.1)
86
+ json (2.1.0-java)
87
+ loofah (2.2.2)
80
88
  crass (~> 1.0.2)
81
89
  nokogiri (>= 1.5.9)
82
- mail (2.6.6)
83
- mime-types (>= 1.16, < 4)
84
- mime-types (3.1)
85
- mime-types-data (~> 3.2015)
86
- mime-types-data (3.2016.0521)
90
+ mail (2.7.0)
91
+ mini_mime (>= 0.1.1)
87
92
  mini_mime (1.0.0)
88
93
  mini_portile2 (2.3.0)
89
- minitest (5.10.3)
90
- nokogiri (1.8.1)
94
+ minitest (5.11.3)
95
+ nokogiri (1.8.3)
91
96
  mini_portile2 (~> 2.3.0)
97
+ nokogiri (1.8.3-java)
92
98
  public_suffix (2.0.5)
93
- rack (1.6.8)
99
+ rack (1.6.10)
94
100
  rack-test (0.6.3)
95
101
  rack (>= 1.0)
96
- rails (4.2.9)
97
- actionmailer (= 4.2.9)
98
- actionpack (= 4.2.9)
99
- actionview (= 4.2.9)
100
- activejob (= 4.2.9)
101
- activemodel (= 4.2.9)
102
- activerecord (= 4.2.9)
103
- activesupport (= 4.2.9)
102
+ rails (4.2.10)
103
+ actionmailer (= 4.2.10)
104
+ actionpack (= 4.2.10)
105
+ actionview (= 4.2.10)
106
+ activejob (= 4.2.10)
107
+ activemodel (= 4.2.10)
108
+ activerecord (= 4.2.10)
109
+ activesupport (= 4.2.10)
104
110
  bundler (>= 1.3.0, < 2.0)
105
- railties (= 4.2.9)
111
+ railties (= 4.2.10)
106
112
  sprockets-rails
107
113
  rails-deprecated_sanitizer (1.0.3)
108
114
  activesupport (>= 4.2.0.alpha)
@@ -110,15 +116,15 @@ GEM
110
116
  activesupport (>= 4.2.0, < 5.0)
111
117
  nokogiri (~> 1.6)
112
118
  rails-deprecated_sanitizer (>= 1.0.1)
113
- rails-html-sanitizer (1.0.3)
114
- loofah (~> 2.0)
115
- railties (4.2.9)
116
- actionpack (= 4.2.9)
117
- activesupport (= 4.2.9)
119
+ rails-html-sanitizer (1.0.4)
120
+ loofah (~> 2.2, >= 2.2.2)
121
+ railties (4.2.10)
122
+ actionpack (= 4.2.10)
123
+ activesupport (= 4.2.10)
118
124
  rake (>= 0.8.7)
119
125
  thor (>= 0.18.1, < 2.0)
120
- rake (12.3.0)
121
- rspec-core (3.7.0)
126
+ rake (12.3.1)
127
+ rspec-core (3.7.1)
122
128
  rspec-support (~> 3.7.0)
123
129
  rspec-expectations (3.7.0)
124
130
  diff-lcs (>= 1.2.0, < 2.0)
@@ -134,7 +140,7 @@ GEM
134
140
  rspec-expectations (~> 3.7.0)
135
141
  rspec-mocks (~> 3.7.0)
136
142
  rspec-support (~> 3.7.0)
137
- rspec-support (3.7.0)
143
+ rspec-support (3.7.1)
138
144
  simplecov (0.12.0)
139
145
  docile (~> 1.1.0)
140
146
  json (>= 1.8, < 3)
@@ -152,20 +158,22 @@ GEM
152
158
  tins (~> 1.0)
153
159
  thor (0.19.4)
154
160
  thread_safe (0.3.6)
155
- tins (1.15.0)
156
- tzinfo (1.2.4)
161
+ thread_safe (0.3.6-java)
162
+ tins (1.16.3)
163
+ tzinfo (1.2.5)
157
164
  thread_safe (~> 0.1)
158
165
  xpath (2.1.0)
159
166
  nokogiri (~> 1.3)
160
- yard (0.9.12)
167
+ yard (0.9.14)
161
168
  yardstick (0.9.9)
162
169
  yard (~> 0.8, >= 0.8.7.2)
163
170
 
164
171
  PLATFORMS
172
+ java
165
173
  ruby
166
174
 
167
175
  DEPENDENCIES
168
- activerecord-jdbcsqlite3-adapter (~> 1.3.23)
176
+ activerecord-jdbcsqlite3-adapter (~> 1.3.24)
169
177
  ammeter (~> 1.1.4)
170
178
  appraisal (~> 2.2.0)
171
179
  bundler (~> 1.5)
@@ -182,4 +190,4 @@ DEPENDENCIES
182
190
  yardstick (~> 0.9.9)
183
191
 
184
192
  BUNDLED WITH
185
- 1.16.1
193
+ 1.16.2
data/README.md CHANGED
@@ -7,14 +7,12 @@
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
9
  [![Maintainability](https://api.codeclimate.com/v1/badges/966193dafa3895766977/maintainability)][codeclimate]
10
- [![Dependency Status](https://gemnasium.com/piotrmurach/loaf.svg?travis)][gemnasium]
11
10
  [![Coverage Status](https://coveralls.io/repos/github/piotrmurach/loaf/badge.svg?branch=master)][coveralls]
12
11
  [![Inline docs](http://inch-ci.org/github/piotrmurach/loaf.svg?branch=master)][inchpages]
13
12
 
14
13
  [gem]: http://badge.fury.io/rb/loaf
15
14
  [travis]: http://travis-ci.org/piotrmurach/loaf
16
15
  [codeclimate]: https://codeclimate.com/github/piotrmurach/loaf/maintainability
17
- [gemnasium]: https://gemnasium.com/piotrmurach/loaf
18
16
  [coveralls]: https://coveralls.io/github/piotrmurach/loaf
19
17
  [inchpages]: http://inch-ci.org/github/piotrmurach/loaf
20
18
 
@@ -153,7 +151,7 @@ end
153
151
 
154
152
  ```ruby
155
153
  class CommentsController < ApplicationController
156
- breadcrumb ->(c) { c.find_article(c.params[:post_id]).title }, :articles_path
154
+ breadcrumb -> { find_article(params[:post_id]).title }, :articles_path
157
155
  end
158
156
  ```
159
157
 
@@ -161,7 +159,7 @@ Also, to dynamically evalute parameters inside the url argument do:
161
159
 
162
160
  ```ruby
163
161
  class CommentsController < ApplicationController
164
- breadcrumb 'All Comments', ->(c) { c.post_comments_path(c.params[:post_id]) }
162
+ breadcrumb 'All Comments', -> { post_comments_path(params[:post_id]) }
165
163
  end
166
164
  ```
167
165
 
data/Rakefile CHANGED
@@ -4,6 +4,9 @@ require 'rubygems'
4
4
  require 'bundler/setup'
5
5
  require 'bundler/gem_tasks'
6
6
 
7
+ desc "Default: run loaf unit & integration tests."
8
+ task default: :spec
9
+
7
10
  FileList['tasks/**/*.rake'].each(&method(:import))
8
11
 
9
12
  desc 'Run all specs'
@@ -12,8 +12,7 @@ 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
14
14
  gem "rails", "~> 3.2.22.5"
15
- gem "test-unit"
16
- gem "mime-types", "~> 2.99"
15
+ gem "test-unit", "~> 3.0"
17
16
 
18
17
  group :metrics do
19
18
  gem "coveralls", "0.8.17"
@@ -13,7 +13,6 @@ gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
13
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
14
14
  gem "rails", "~> 4.0.13"
15
15
  gem "test-unit"
16
- gem "mime-types", "~> 2.99"
17
16
 
18
17
  group :metrics do
19
18
  gem "coveralls", "0.8.17"
@@ -12,7 +12,6 @@ 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
14
14
  gem "rails", "~> 4.1.16"
15
- gem "mime-types", "~> 2.99"
16
15
 
17
16
  group :metrics do
18
17
  gem "coveralls", "0.8.17"
@@ -11,8 +11,7 @@ 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
14
- gem "rails", "~> 4.2.9"
15
- gem "mime-types", "~> 2.99"
14
+ gem "rails", "~> 4.2.10"
16
15
 
17
16
  group :metrics do
18
17
  gem "coveralls", "0.8.17"
@@ -6,12 +6,12 @@ gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
7
  gem "yard", "~> 0.9.12"
8
8
  gem "capybara", "~> 2.16.1"
9
- gem "rspec-rails", "~> 3.6.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
10
  gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
- gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
14
- gem "rails", "~> 5.0.6"
13
+ gem "activerecord-jdbcsqlite3-adapter", "~> 50.1", platforms: :jruby
14
+ gem "rails", "~> 5.0.7"
15
15
 
16
16
  group :metrics do
17
17
  gem "coveralls", "0.8.17"
@@ -6,12 +6,12 @@ gem "ammeter", "~> 1.1.4"
6
6
  gem "appraisal", "~> 2.2.0"
7
7
  gem "yard", "~> 0.9.12"
8
8
  gem "capybara", "~> 2.16.1"
9
- gem "rspec-rails", "~> 3.6.1"
9
+ gem "rspec-rails", "~> 3.7.2"
10
10
  gem "nokogiri", "~> 1.8.1"
11
11
  gem "public_suffix", "~> 2.0.5"
12
12
  gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
- gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
14
- gem "rails", "~> 5.1.4"
13
+ gem "activerecord-jdbcsqlite3-adapter", "~> 51.1", platforms: :jruby
14
+ gem "rails", "~> 5.1.6"
15
15
 
16
16
  group :metrics do
17
17
  gem "coveralls", "0.8.17"
@@ -0,0 +1,22 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "ammeter", "~> 1.1.4"
6
+ gem "appraisal", "~> 2.2.0"
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
+ gem "public_suffix", "~> 2.0.5"
12
+ gem "sqlite3", "~> 1.3.13", platforms: :ruby
13
+ gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.23", platforms: :jruby
14
+ gem "rails", "~> 5.2.0"
15
+
16
+ group :metrics do
17
+ gem "coveralls", "0.8.17"
18
+ gem "simplecov", "~> 0.12.0"
19
+ gem "yardstick", "~> 0.9.9"
20
+ end
21
+
22
+ gemspec path: "../"
@@ -38,12 +38,20 @@ module Loaf
38
38
  respond_to?(:before_action) ? :before_action : :before_filter
39
39
  end
40
40
 
41
+ # Convert breadcrumb name to string
42
+ #
43
+ # @return [String]
44
+ #
41
45
  # @api private
42
46
  def _normalize_name(name, instance)
43
47
  case name
44
48
  when NilClass
45
49
  when Proc
46
- name.call(instance)
50
+ if name.arity == 1
51
+ instance.instance_exec(instance, &name)
52
+ else
53
+ instance.instance_exec(&name)
54
+ end
47
55
  else
48
56
  name
49
57
  end
@@ -1,3 +1,3 @@
1
1
  module Loaf
2
- VERSION = '0.6.2'
2
+ VERSION = '0.7.0'
3
3
  end # Loaf
@@ -57,4 +57,15 @@ RSpec.describe "breadcrumbs trail" do
57
57
  expect(page.html).to include('<a href="/posts/1/comments">Post comments</a>')
58
58
  end
59
59
  end
60
+
61
+ it "allows for procs in name and url without supplying the controller" do
62
+ visit post_comments_path(1)
63
+
64
+ within "#breadcrumbs .selected" do
65
+ expect(page.html).to include(
66
+ '<a href="/posts/1/comments?no_controller=true">'\
67
+ "Post comments No Controller</a>"
68
+ )
69
+ end
70
+ end
60
71
  end
@@ -5,6 +5,9 @@ class CommentsController < ApplicationController
5
5
  breadcrumb lambda { |c| c.find_article(c.params[:post_id]).title },
6
6
  lambda { |c| c.post_comments_path(c.params[:post_id]) }
7
7
 
8
+ breadcrumb -> { find_article(params[:post_id]).title + " No Controller" },
9
+ -> { post_comments_path(params[:post_id], no_controller: true) }
10
+
8
11
  def index
9
12
  end
10
13
 
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.2
4
+ version: 0.7.0
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-30 00:00:00.000000000 Z
11
+ date: 2018-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -86,6 +86,7 @@ files:
86
86
  - gemfiles/rails4.2.gemfile
87
87
  - gemfiles/rails5.0.gemfile
88
88
  - gemfiles/rails5.1.gemfile
89
+ - gemfiles/rails5.2.gemfile
89
90
  - lib/generators/loaf/install_generator.rb
90
91
  - lib/loaf.rb
91
92
  - lib/loaf/breadcrumb.rb