loaf 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -3
  3. data/.rspec +1 -0
  4. data/.travis.yml +30 -12
  5. data/Appraisals +27 -9
  6. data/CHANGELOG.md +59 -11
  7. data/Gemfile +11 -11
  8. data/Gemfile.lock +182 -0
  9. data/README.md +120 -56
  10. data/assets/loaf_logo.png +0 -0
  11. data/bin/appraisal +16 -0
  12. data/bin/rake +16 -0
  13. data/gemfiles/rails3.2.gemfile +15 -13
  14. data/gemfiles/rails4.0.gemfile +13 -12
  15. data/gemfiles/rails4.1.gemfile +14 -13
  16. data/gemfiles/rails4.2.gemfile +14 -13
  17. data/gemfiles/rails5.0.gemfile +22 -0
  18. data/gemfiles/rails5.1.gemfile +22 -0
  19. data/lib/loaf.rb +2 -22
  20. data/lib/loaf/breadcrumb.rb +30 -0
  21. data/lib/loaf/configuration.rb +7 -8
  22. data/lib/loaf/controller_extensions.rb +13 -28
  23. data/lib/loaf/crumb.rb +5 -4
  24. data/lib/loaf/crumb_formatter.rb +3 -1
  25. data/lib/loaf/errors.rb +1 -3
  26. data/lib/loaf/options_validator.rb +2 -2
  27. data/lib/loaf/railtie.rb +19 -13
  28. data/lib/loaf/translation.rb +1 -1
  29. data/lib/loaf/version.rb +1 -3
  30. data/lib/loaf/view_extensions.rb +69 -18
  31. data/loaf.gemspec +20 -13
  32. data/spec/integration/{crumbs_routing_spec.rb → breadcrumb_trail_spec.rb} +19 -12
  33. data/spec/rails_app/app/controllers/application_controller.rb +2 -0
  34. data/spec/rails_app/app/controllers/posts_controller.rb +1 -4
  35. data/spec/rails_app/app/views/layouts/_breadcrumbs.html.erb +7 -5
  36. data/spec/rails_app/app/views/layouts/application.html.erb +0 -2
  37. data/spec/rails_app/config/environments/test.rb +1 -1
  38. data/spec/rails_app/config/secrets.yml +22 -0
  39. data/spec/spec_helper.rb +3 -3
  40. data/spec/support/dummy_controller.rb +9 -0
  41. data/spec/support/dummy_view.rb +42 -2
  42. data/spec/unit/configuration_spec.rb +35 -0
  43. data/spec/unit/controller_extensions_spec.rb +5 -14
  44. data/spec/unit/generators/install_generator_spec.rb +2 -1
  45. data/spec/unit/view_extensions/breadcrumb_trail_spec.rb +232 -0
  46. metadata +65 -31
  47. data/.ruby-version +0 -1
  48. data/init.rb +0 -3
  49. data/lib/loaf/builder.rb +0 -38
  50. data/spec/rails_app/.gitignore +0 -5
  51. data/spec/rails_app/lib/assets/.gitkeep +0 -0
  52. data/spec/rails_app/lib/tasks/.gitkeep +0 -0
  53. data/spec/rails_app/script/rails +0 -6
  54. data/spec/unit/view_extensions/breadcrumbs_spec.rb +0 -128
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd80cf0439e9736d7c29811f8465ac55b161e3ec
4
- data.tar.gz: b42620aee3caec07147186d72fbd24eeec24102e
3
+ metadata.gz: 2eae83f119feab3c5197cafe6db57e8df4057287
4
+ data.tar.gz: dfa24179e0047a473a5645bf4d1c7007b3aaf084
5
5
  SHA512:
6
- metadata.gz: fe8ffab119f314dd4cc95905e0e6b0f70dbf58145740e2c07670adeb9cde9f5570fce875e3c5248b30e9c181b16a7b5b761425138f15154c2f4c55b1cc283783
7
- data.tar.gz: 1df8f9471b34d22ca69fb606dba529ba05dc65903329461aea28a1044c11bb1b10f655c1bbc9279062723513ad36b8a5c74673b85e6670f8c9c12bb4e8bb18db
6
+ metadata.gz: c4af1ee0d63a25affef7ca67cdb63d831b7ddfb51fd64bf8b9d49fe13b6848165b81078c64c7941358ca24c5cddfd836558e07ca1965a38f15abcdd17e0ef157
7
+ data.tar.gz: bbc01fbb9984b472bcb99e65a4622465e6053686824f9384e48d0af3f0ac7c87239fa58fd2bd9394125e7587e127ace4bd76723c8afced0e846a1d68c1175eff
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  gemfiles/*.lock
8
7
  InstalledFiles
9
8
  _yardoc
@@ -13,8 +12,9 @@ lib/bundler/man
13
12
  pkg
14
13
  rdoc
15
14
  spec/reports
16
- test/tmp
17
- test/version_tmp
15
+ spec/rails_app/tmp
16
+ spec/rails_app/db
17
+ spec/rails_app/log
18
18
  tmp
19
19
  *.bundle
20
20
  *.so
data/.rspec CHANGED
@@ -1 +1,2 @@
1
1
  --color
2
+ --require spec_helper
data/.travis.yml CHANGED
@@ -1,25 +1,43 @@
1
+ ---
1
2
  language: ruby
2
3
  sudo: false
3
- bundler_args: --without yard benchmarks
4
- install: 'travis_retry bin/setup'
5
- script: 'bundle exec appraisal rake ci'
4
+ cache: bundler
5
+ install:
6
+ - bundle install
7
+ - bundle exec bin/appraisal install
8
+ script:
9
+ - bundle exec appraisal rake ci
6
10
  rvm:
7
- - 1.9.3
8
11
  - 2.0.0
9
- - 2.1.0
10
- - 2.2.0
12
+ - 2.1.10
13
+ - 2.2.5
14
+ - 2.3.1
15
+ - 2.4.1
11
16
  matrix:
12
17
  include:
13
- - rvm: jruby-19mode
14
- - rvm: jruby-20mode
15
- - rvm: jruby-21mode
18
+ - rvm: jruby-9.1.1.0
16
19
  - rvm: jruby-head
17
- - rvm: rbx-2
20
+ - rvm: ruby-head
21
+ exclude:
22
+ - rvm: 2.0.0
23
+ gemfile: gemfiles/rails5.0.gemfile
24
+ - rvm: 2.1.10
25
+ gemfile: gemfiles/rails5.0.gemfile
26
+ - rvm: 2.2.5
27
+ gemfile: gemfiles/rails3.2.gemfile
28
+ - rvm: 2.3.1
29
+ gemfile: gemfiles/rails3.2.gemfile
30
+ - rvm: 2.4.1
31
+ gemfile:
32
+ - gemfiles/rails3.2.gemfile
33
+ - gemfiles/rails4.0.gemfile
34
+ - gemfiles/rails4.1.gemfile
18
35
  allow_failures:
19
36
  - rvm: ruby-head
37
+ - rvm: jruby-9.1.1.0
20
38
  - rvm: jruby-head
21
- - rvm: jruby-20mode
22
- - rvm: jruby-21mode
23
39
  fast_finish: true
24
40
  branches:
25
41
  only: master
42
+ notifications:
43
+ email: false
data/Appraisals CHANGED
@@ -1,18 +1,36 @@
1
- if RUBY_VERSION < "2.2.0"
1
+ if RUBY_VERSION < '2.2.0'
2
2
  appraise 'rails3.2' do
3
- gem 'rails', '~> 3.2.21'
3
+ gem 'rails', '~> 3.2.22.5'
4
+ gem 'test-unit', '~> 3.0'
4
5
  end
5
6
  end
6
7
 
7
- appraise 'rails4.0' do
8
- gem 'rails', '~> 4.0.13'
9
- gem 'test-unit'
10
- end
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
11
14
 
12
- appraise 'rails4.1' do
13
- gem 'rails', '~> 4.1.9'
15
+ appraise 'rails4.1' do
16
+ gem 'rails', '~> 4.1.16'
17
+ gem 'mime-types', '~> 2.99'
18
+ end
14
19
  end
15
20
 
16
21
  appraise 'rails4.2' do
17
- gem 'rails', '~> 4.2.0'
22
+ gem 'rails', '~> 4.2.9'
23
+ gem 'mime-types', '~> 2.99'
24
+ end
25
+
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
31
+
32
+ appraise 'rails5.1' do
33
+ gem 'rails', '~> 5.1.4'
34
+ gem 'rspec-rails', '~> 3.6.1'
35
+ end
18
36
  end
data/CHANGELOG.md CHANGED
@@ -1,40 +1,88 @@
1
- 0.5.0 (January 31, 2015)
1
+ # Change log
2
2
 
3
+ ## [v0.6.0] - 2017-10-19
4
+
5
+ ### Added
6
+ * Add new :match option to allow customisation of breadcrumb matching behaviour
7
+ * Add #current_crumb? for checking if breadcrumb is current in view
8
+ * Add tests setup for Rails 5.0, 5.1
9
+
10
+ ### Changed
11
+ * Change view helper name from #breadcrumbs to #breadcrumb_trail
12
+ * Change Configuration to accept attributes at initilization
13
+ * Change Loaf::Railtie to load for both old and new rails versions
14
+ * Remove Builder class
15
+ * Remove configuration options :root, :last_crumb_linked, :style_classes
16
+ * Remove #add_breadcrumbs from controller api
17
+
18
+ ### Fixed
19
+ * Fix current page matching logic to allow for inclusive paths
20
+ * Fix controller filter to work with new Rails action semantics
21
+
22
+ ## [v0.5.0] - 2015-01-31
23
+
24
+ ### Added
3
25
  * Add generator for locales file
4
26
  * Add breadcrumbs scope for translations
5
- * Change breadcrumb formatter to use translations for title formatting
6
27
  * Add ability to pass proc as title and/or url for breadcrumb helper inside controller
7
28
 
8
- 0.4.0 (January 10, 2015)
29
+ ### Changed
30
+ * Change breadcrumb formatter to use translations for title formatting
9
31
 
32
+ ## [v0.4.0] - 2015-01-10
33
+
34
+ ### Added
35
+ * Add ability to force current path through :force option
36
+
37
+ ### Changed
10
38
  * Change breadcrumbs view method to return enumerator without block
11
39
  * Change Crumb to ruby class and add force option
12
40
  * Change Configuration to ruby class and scope config options
13
- * Add ability to force current path through :force option
14
41
  * Change format_name to only take name argument
15
42
  * Change to expose config settings on configuration
16
- * Fix bug with url parameter to allow for regular rails path variables
17
43
  * Update test suite to work against different rubies 1.9.x, 2.x
18
44
  * Test Rails 3.2.x, 4.0, 4.1, 4.2
19
45
 
20
- 0.3.0 (February 25, 2012)
46
+ ### Fixed
47
+ * Fix bug with url parameter to allow for regular rails path variables
21
48
 
49
+ ## [0.3.0] - 2012-02-25
50
+
51
+ ### Added
22
52
  * Add loaf gem errors
23
53
  * Add custom options validator for filtering invalid breadcrumbs params
54
+ * Add specs for isolated view testing.
55
+
56
+ ### Changed
24
57
  * Renamed main gem helpers for adding breadcrumbs from `add_breadcrumb` to
25
58
  `breadcrumb`, both inside controllers and views.
26
- * Add specs for isolated view testing.
27
59
 
28
- 0.2.1 (February 22, 2012)
60
+ ## [0.2.1] - 2012-02-22
29
61
 
62
+ ### Added
30
63
  * Add more integration tests and fixed bug with adding breadcrumbs inside view
31
64
  * Add specs for controller extensions
32
65
 
33
- 0.2.0 (February 18, 2012)
66
+ ## [0.2.0] - 2012-02-18
34
67
 
35
- * Change gemspec with new gem dependencies, use git
36
- * Setup testing environment with dummy rails app
68
+ ### Added
37
69
  * Add integration tests for breadcrumbs view rendering
38
70
  * Add translation module for breadcrumbs title lookup
39
71
  * Add breadcrumb formatting module with tests
72
+
73
+ ### Changed
74
+ * Change gemspec with new gem dependencies, use git
75
+ * Setup testing environment with dummy rails app
40
76
  * Refactor names for controller and view extensions
77
+
78
+ ## [v0.1.0] - 2011-10-22
79
+
80
+ * Initial implementation and release
81
+
82
+ [v0.6.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.5.0...v0.6.0
83
+ [v0.5.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.4.0...v0.5.0
84
+ [v0.4.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.3.0...v0.4.0
85
+ [v0.3.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.2.1...v0.3.0
86
+ [v0.2.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.2.0...v0.2.1
87
+ [v0.2.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.1.0...v0.2.0
88
+ [v0.1.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.1.0...HEAD
data/Gemfile CHANGED
@@ -2,18 +2,18 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'ammeter', '~> 1.1.2'
6
- gem 'bundler', '~> 1.3'
7
- gem 'appraisal', '~> 1.0.2'
8
- gem 'rake', '~> 10.4.2'
9
- gem 'yard', '~> 0.8.7'
10
- gem 'sqlite3', '~> 1.3.10', platforms: :ruby
11
- gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.10', platforms: :jruby
12
- gem 'capybara', '~> 2.4.4'
13
- gem 'rspec-rails', '~> 3.1.0'
5
+ gem 'ammeter', '~> 1.1.4'
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'
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
14
 
15
15
  group :metrics do
16
- gem 'coveralls', '~> 0.7.2'
17
- gem 'simplecov', '~> 0.9.1'
16
+ gem 'coveralls', '0.8.17'
17
+ gem 'simplecov', '~> 0.12.0'
18
18
  gem 'yardstick', '~> 0.9.9'
19
19
  end
data/Gemfile.lock ADDED
@@ -0,0 +1,182 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ loaf (0.6.0)
5
+ rails (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (4.2.9)
11
+ actionpack (= 4.2.9)
12
+ actionview (= 4.2.9)
13
+ activejob (= 4.2.9)
14
+ mail (~> 2.5, >= 2.5.4)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ actionpack (4.2.9)
17
+ actionview (= 4.2.9)
18
+ activesupport (= 4.2.9)
19
+ rack (~> 1.6)
20
+ rack-test (~> 0.6.2)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ actionview (4.2.9)
24
+ activesupport (= 4.2.9)
25
+ builder (~> 3.1)
26
+ erubis (~> 2.7.0)
27
+ rails-dom-testing (~> 1.0, >= 1.0.5)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
+ activejob (4.2.9)
30
+ activesupport (= 4.2.9)
31
+ globalid (>= 0.3.0)
32
+ activemodel (4.2.9)
33
+ activesupport (= 4.2.9)
34
+ builder (~> 3.1)
35
+ activerecord (4.2.9)
36
+ activemodel (= 4.2.9)
37
+ activesupport (= 4.2.9)
38
+ arel (~> 6.0)
39
+ activesupport (4.2.9)
40
+ i18n (~> 0.7)
41
+ minitest (~> 5.1)
42
+ thread_safe (~> 0.3, >= 0.3.4)
43
+ tzinfo (~> 1.1)
44
+ addressable (2.5.2)
45
+ public_suffix (>= 2.0.2, < 4.0)
46
+ ammeter (1.1.4)
47
+ activesupport (>= 3.0)
48
+ railties (>= 3.0)
49
+ rspec-rails (>= 2.2)
50
+ appraisal (2.2.0)
51
+ bundler
52
+ rake
53
+ thor (>= 0.14.0)
54
+ arel (6.0.4)
55
+ builder (3.2.3)
56
+ capybara (2.15.4)
57
+ addressable
58
+ mini_mime (>= 0.1.3)
59
+ nokogiri (>= 1.3.3)
60
+ rack (>= 1.0.0)
61
+ rack-test (>= 0.5.4)
62
+ xpath (~> 2.0)
63
+ concurrent-ruby (1.0.5)
64
+ coveralls (0.8.17)
65
+ json (>= 1.8, < 3)
66
+ simplecov (~> 0.12.0)
67
+ term-ansicolor (~> 1.3)
68
+ thor (~> 0.19.1)
69
+ tins (~> 1.6)
70
+ diff-lcs (1.3)
71
+ docile (1.1.5)
72
+ erubis (2.7.0)
73
+ globalid (0.4.0)
74
+ activesupport (>= 4.2.0)
75
+ i18n (0.8.6)
76
+ json (2.1.0)
77
+ loofah (2.0.3)
78
+ nokogiri (>= 1.5.9)
79
+ mail (2.6.6)
80
+ mime-types (>= 1.16, < 4)
81
+ mime-types (3.1)
82
+ mime-types-data (~> 3.2015)
83
+ mime-types-data (3.2016.0521)
84
+ mini_mime (0.1.4)
85
+ mini_portile2 (2.1.0)
86
+ minitest (5.10.3)
87
+ nokogiri (1.6.8.1)
88
+ mini_portile2 (~> 2.1.0)
89
+ public_suffix (2.0.5)
90
+ rack (1.6.8)
91
+ rack-test (0.6.3)
92
+ rack (>= 1.0)
93
+ rails (4.2.9)
94
+ actionmailer (= 4.2.9)
95
+ actionpack (= 4.2.9)
96
+ actionview (= 4.2.9)
97
+ activejob (= 4.2.9)
98
+ activemodel (= 4.2.9)
99
+ activerecord (= 4.2.9)
100
+ activesupport (= 4.2.9)
101
+ bundler (>= 1.3.0, < 2.0)
102
+ railties (= 4.2.9)
103
+ sprockets-rails
104
+ rails-deprecated_sanitizer (1.0.3)
105
+ activesupport (>= 4.2.0.alpha)
106
+ rails-dom-testing (1.0.8)
107
+ activesupport (>= 4.2.0.beta, < 5.0)
108
+ nokogiri (~> 1.6)
109
+ rails-deprecated_sanitizer (>= 1.0.1)
110
+ rails-html-sanitizer (1.0.3)
111
+ loofah (~> 2.0)
112
+ railties (4.2.9)
113
+ actionpack (= 4.2.9)
114
+ activesupport (= 4.2.9)
115
+ rake (>= 0.8.7)
116
+ 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)
121
+ diff-lcs (>= 1.2.0, < 2.0)
122
+ rspec-support (~> 3.6.0)
123
+ rspec-mocks (3.6.0)
124
+ diff-lcs (>= 1.2.0, < 2.0)
125
+ rspec-support (~> 3.6.0)
126
+ rspec-rails (3.6.1)
127
+ actionpack (>= 3.0)
128
+ activesupport (>= 3.0)
129
+ 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)
135
+ simplecov (0.12.0)
136
+ docile (~> 1.1.0)
137
+ json (>= 1.8, < 3)
138
+ simplecov-html (~> 0.10.0)
139
+ simplecov-html (0.10.2)
140
+ sprockets (3.7.1)
141
+ concurrent-ruby (~> 1.0)
142
+ rack (> 1, < 3)
143
+ sprockets-rails (3.2.1)
144
+ actionpack (>= 4.0)
145
+ activesupport (>= 4.0)
146
+ sprockets (>= 3.0.0)
147
+ sqlite3 (1.3.13)
148
+ term-ansicolor (1.6.0)
149
+ tins (~> 1.0)
150
+ thor (0.19.4)
151
+ thread_safe (0.3.6)
152
+ tins (1.15.0)
153
+ tzinfo (1.2.3)
154
+ thread_safe (~> 0.1)
155
+ xpath (2.1.0)
156
+ nokogiri (~> 1.3)
157
+ yard (0.9.9)
158
+ yardstick (0.9.9)
159
+ yard (~> 0.8, >= 0.8.7.2)
160
+
161
+ PLATFORMS
162
+ ruby
163
+
164
+ DEPENDENCIES
165
+ activerecord-jdbcsqlite3-adapter (~> 1.3.23)
166
+ ammeter (~> 1.1.4)
167
+ appraisal (~> 2.2.0)
168
+ bundler (~> 1.5)
169
+ capybara (~> 2.15.4)
170
+ coveralls (= 0.8.17)
171
+ loaf!
172
+ nokogiri (~> 1.6.8)
173
+ public_suffix (~> 2.0.5)
174
+ rake
175
+ rspec-rails (~> 3.6.1)
176
+ simplecov (~> 0.12.0)
177
+ sqlite3 (~> 1.3.13)
178
+ yard (~> 0.9.9)
179
+ yardstick (~> 0.9.9)
180
+
181
+ BUNDLED WITH
182
+ 1.15.4