loaf 0.1.1 → 0.2.0

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.
Files changed (75) hide show
  1. data/.document +5 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +28 -0
  5. data/.travis.yml +4 -0
  6. data/CHANGELOG.md +8 -0
  7. data/Gemfile.lock +132 -0
  8. data/LICENSE.txt +20 -0
  9. data/README.md +128 -0
  10. data/Rakefile +2 -45
  11. data/init.rb +3 -0
  12. data/lib/loaf.rb +14 -8
  13. data/lib/loaf/configuration.rb +2 -0
  14. data/lib/loaf/{filters.rb → controller_extensions.rb} +13 -12
  15. data/lib/loaf/crumb.rb +6 -0
  16. data/lib/loaf/crumb_formatter.rb +20 -0
  17. data/lib/loaf/railtie.rb +15 -6
  18. data/lib/loaf/translation.rb +18 -9
  19. data/lib/loaf/version.rb +4 -2
  20. data/lib/loaf/view_extensions.rb +43 -0
  21. data/loaf.gemspec +28 -0
  22. data/spec/integration/configuration_spec.rb +13 -0
  23. data/spec/integration/crumbs_routing_spec.rb +33 -0
  24. data/spec/integration/nested_crumbs_spec.rb +5 -0
  25. data/spec/loaf/crumb_formatter_spec.rb +33 -0
  26. data/spec/loaf/translation_spec.rb +23 -0
  27. data/spec/loaf_spec.rb +5 -0
  28. data/spec/rails_app/.gitignore +5 -0
  29. data/spec/rails_app/Rakefile +8 -0
  30. data/spec/rails_app/app/assets/images/rails.png +0 -0
  31. data/spec/rails_app/app/assets/javascripts/application.js +9 -0
  32. data/spec/rails_app/app/assets/stylesheets/application.css +7 -0
  33. data/spec/rails_app/app/controllers/application_controller.rb +5 -0
  34. data/spec/rails_app/app/controllers/comments_controller.rb +4 -0
  35. data/spec/rails_app/app/controllers/home_controller.rb +4 -0
  36. data/spec/rails_app/app/controllers/posts_controller.rb +12 -0
  37. data/spec/rails_app/app/helpers/application_helper.rb +2 -0
  38. data/spec/rails_app/app/mailers/.gitkeep +0 -0
  39. data/spec/rails_app/app/models/.gitkeep +0 -0
  40. data/spec/rails_app/app/views/home/index.html.erb +1 -0
  41. data/spec/rails_app/app/views/layouts/_breadcrumbs.html.erb +8 -0
  42. data/spec/rails_app/app/views/layouts/application.html.erb +16 -0
  43. data/spec/rails_app/app/views/posts/index.html.erb +1 -0
  44. data/spec/rails_app/app/views/posts/new.html.erb +1 -0
  45. data/spec/rails_app/config.ru +4 -0
  46. data/spec/rails_app/config/application.rb +48 -0
  47. data/spec/rails_app/config/boot.rb +10 -0
  48. data/spec/rails_app/config/database.yml +25 -0
  49. data/spec/rails_app/config/environment.rb +5 -0
  50. data/spec/rails_app/config/environments/development.rb +30 -0
  51. data/spec/rails_app/config/environments/production.rb +60 -0
  52. data/spec/rails_app/config/environments/test.rb +42 -0
  53. data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  54. data/spec/rails_app/config/initializers/inflections.rb +10 -0
  55. data/spec/rails_app/config/initializers/mime_types.rb +5 -0
  56. data/spec/rails_app/config/initializers/secret_token.rb +7 -0
  57. data/spec/rails_app/config/initializers/session_store.rb +8 -0
  58. data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
  59. data/spec/rails_app/config/locales/en.yml +5 -0
  60. data/spec/rails_app/config/routes.rb +9 -0
  61. data/spec/rails_app/db/seeds.rb +7 -0
  62. data/spec/rails_app/lib/assets/.gitkeep +0 -0
  63. data/spec/rails_app/lib/tasks/.gitkeep +0 -0
  64. data/spec/rails_app/public/404.html +26 -0
  65. data/spec/rails_app/public/422.html +26 -0
  66. data/spec/rails_app/public/500.html +26 -0
  67. data/spec/rails_app/public/favicon.ico +0 -0
  68. data/spec/rails_app/public/robots.txt +5 -0
  69. data/spec/rails_app/script/rails +6 -0
  70. data/spec/spec_helper.rb +15 -0
  71. data/spec/support/capybara.rb +10 -0
  72. data/spec/support/load_routes.rb +6 -0
  73. metadata +202 -119
  74. data/README.rdoc +0 -71
  75. data/lib/loaf/helpers.rb +0 -49
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../rails_app/config/environment.rb", __FILE__)
5
+ require 'rspec/rails'
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
11
+
12
+ RSpec.configure do |config|
13
+ config.use_transactional_fixtures = true
14
+ config.mock_with :rspec
15
+ end
@@ -0,0 +1,10 @@
1
+ require 'capybara/rails'
2
+ require 'capybara/dsl'
3
+
4
+ RSpec.configure do |c|
5
+ c.include Capybara::DSL, :example_group => {
6
+ :file_path => /\bspec\/integration\//
7
+ }
8
+ end
9
+ Capybara.default_driver = :rack_test
10
+ Capybara.default_selector = :css
@@ -0,0 +1,6 @@
1
+ RSpec.configure do |c|
2
+ c.include Rails.application.routes.url_helpers,
3
+ :example_group => {
4
+ :file_path => /\bspec\/integration\//
5
+ }
6
+ end
metadata CHANGED
@@ -1,155 +1,238 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: loaf
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 1
9
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Piotr Murach
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-11-20 00:00:00 +00:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rails
16
+ requirement: &2152648740 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
22
23
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
24
+ version_requirements: *2152648740
25
+ - !ruby/object:Gem::Dependency
26
+ name: rails
27
+ requirement: &2152647200 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
25
30
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 3
29
- - 1
30
- - 0
31
- version: 3.1.0
31
+ - !ruby/object:Gem::Version
32
+ version: '3.1'
32
33
  type: :development
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rspec
36
34
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ~>
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 2
43
- - 4
44
- - 0
45
- version: 2.4.0
35
+ version_requirements: *2152647200
36
+ - !ruby/object:Gem::Dependency
37
+ name: sqlite3
38
+ requirement: &2152646320 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
46
44
  type: :development
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: rspec-rails
50
45
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 2
57
- - 0
58
- - 0
59
- version: 2.0.0
46
+ version_requirements: *2152646320
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec-rails
49
+ requirement: &2152644360 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
60
55
  type: :development
61
- version_requirements: *id003
62
- - !ruby/object:Gem::Dependency
63
- name: capybara
64
56
  prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- segments:
70
- - 0
71
- - 4
72
- - 0
73
- version: 0.4.0
57
+ version_requirements: *2152644360
58
+ - !ruby/object:Gem::Dependency
59
+ name: capybara
60
+ requirement: &2152642680 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
74
66
  type: :development
75
- version_requirements: *id004
76
- - !ruby/object:Gem::Dependency
77
- name: bundler
78
67
  prerelease: false
79
- requirement: &id005 !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ~>
82
- - !ruby/object:Gem::Version
83
- segments:
84
- - 1
85
- - 0
86
- - 0
87
- version: 1.0.0
68
+ version_requirements: *2152642680
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: &2152641740 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
88
77
  type: :development
89
- version_requirements: *id005
90
- - !ruby/object:Gem::Dependency
91
- name: jeweler
92
78
  prerelease: false
93
- requirement: &id006 !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ~>
96
- - !ruby/object:Gem::Version
97
- segments:
98
- - 1
99
- - 6
100
- - 4
101
- version: 1.6.4
102
- type: :development
103
- version_requirements: *id006
104
- description: Loaf helps you manage breadcrumbs in your rails app. It aims to handle crumb data through easy dsl and expose it through view helpers without any assumptions about markup.
105
- email: ""
79
+ version_requirements: *2152641740
80
+ description: Loaf helps you manage breadcrumbs in your rails app. It aims to handle
81
+ crumb data through easy dsl and expose it through view helpers without any assumptions
82
+ about markup.
83
+ email:
84
+ - ''
106
85
  executables: []
107
-
108
86
  extensions: []
109
-
110
87
  extra_rdoc_files: []
111
-
112
- files:
88
+ files:
89
+ - .document
90
+ - .gitignore
91
+ - .rspec
92
+ - .rvmrc
93
+ - .travis.yml
94
+ - CHANGELOG.md
95
+ - Gemfile
96
+ - Gemfile.lock
97
+ - LICENSE.txt
98
+ - README.md
99
+ - Rakefile
100
+ - init.rb
101
+ - lib/loaf.rb
113
102
  - lib/loaf/builder.rb
114
103
  - lib/loaf/configuration.rb
115
- - lib/loaf/filters.rb
116
- - lib/loaf/helpers.rb
104
+ - lib/loaf/controller_extensions.rb
105
+ - lib/loaf/crumb.rb
106
+ - lib/loaf/crumb_formatter.rb
117
107
  - lib/loaf/railtie.rb
118
108
  - lib/loaf/translation.rb
119
109
  - lib/loaf/version.rb
120
- - lib/loaf.rb
121
- - Rakefile
122
- - Gemfile
123
- - README.rdoc
124
- has_rdoc: true
110
+ - lib/loaf/view_extensions.rb
111
+ - loaf.gemspec
112
+ - spec/integration/configuration_spec.rb
113
+ - spec/integration/crumbs_routing_spec.rb
114
+ - spec/integration/nested_crumbs_spec.rb
115
+ - spec/loaf/crumb_formatter_spec.rb
116
+ - spec/loaf/translation_spec.rb
117
+ - spec/loaf_spec.rb
118
+ - spec/rails_app/.gitignore
119
+ - spec/rails_app/Rakefile
120
+ - spec/rails_app/app/assets/images/rails.png
121
+ - spec/rails_app/app/assets/javascripts/application.js
122
+ - spec/rails_app/app/assets/stylesheets/application.css
123
+ - spec/rails_app/app/controllers/application_controller.rb
124
+ - spec/rails_app/app/controllers/comments_controller.rb
125
+ - spec/rails_app/app/controllers/home_controller.rb
126
+ - spec/rails_app/app/controllers/posts_controller.rb
127
+ - spec/rails_app/app/helpers/application_helper.rb
128
+ - spec/rails_app/app/mailers/.gitkeep
129
+ - spec/rails_app/app/models/.gitkeep
130
+ - spec/rails_app/app/views/home/index.html.erb
131
+ - spec/rails_app/app/views/layouts/_breadcrumbs.html.erb
132
+ - spec/rails_app/app/views/layouts/application.html.erb
133
+ - spec/rails_app/app/views/posts/index.html.erb
134
+ - spec/rails_app/app/views/posts/new.html.erb
135
+ - spec/rails_app/config.ru
136
+ - spec/rails_app/config/application.rb
137
+ - spec/rails_app/config/boot.rb
138
+ - spec/rails_app/config/database.yml
139
+ - spec/rails_app/config/environment.rb
140
+ - spec/rails_app/config/environments/development.rb
141
+ - spec/rails_app/config/environments/production.rb
142
+ - spec/rails_app/config/environments/test.rb
143
+ - spec/rails_app/config/initializers/backtrace_silencers.rb
144
+ - spec/rails_app/config/initializers/inflections.rb
145
+ - spec/rails_app/config/initializers/mime_types.rb
146
+ - spec/rails_app/config/initializers/secret_token.rb
147
+ - spec/rails_app/config/initializers/session_store.rb
148
+ - spec/rails_app/config/initializers/wrap_parameters.rb
149
+ - spec/rails_app/config/locales/en.yml
150
+ - spec/rails_app/config/routes.rb
151
+ - spec/rails_app/db/seeds.rb
152
+ - spec/rails_app/lib/assets/.gitkeep
153
+ - spec/rails_app/lib/tasks/.gitkeep
154
+ - spec/rails_app/public/404.html
155
+ - spec/rails_app/public/422.html
156
+ - spec/rails_app/public/500.html
157
+ - spec/rails_app/public/favicon.ico
158
+ - spec/rails_app/public/robots.txt
159
+ - spec/rails_app/script/rails
160
+ - spec/spec_helper.rb
161
+ - spec/support/capybara.rb
162
+ - spec/support/load_routes.rb
125
163
  homepage: https://github.com/peter-murach/loaf
126
164
  licenses: []
127
-
128
165
  post_install_message:
129
166
  rdoc_options: []
130
-
131
- require_paths:
167
+ require_paths:
132
168
  - lib
133
- required_ruby_version: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- segments:
138
- - 0
139
- version: "0"
140
- required_rubygems_version: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- segments:
145
- - 0
146
- version: "0"
169
+ required_ruby_version: !ruby/object:Gem::Requirement
170
+ none: false
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
147
181
  requirements: []
148
-
149
- rubyforge_project:
150
- rubygems_version: 1.3.6
182
+ rubyforge_project: tytus
183
+ rubygems_version: 1.8.10
151
184
  signing_key:
152
185
  specification_version: 3
153
186
  summary: Loaf is a breadcrumb managing gem.
154
- test_files: []
155
-
187
+ test_files:
188
+ - spec/integration/configuration_spec.rb
189
+ - spec/integration/crumbs_routing_spec.rb
190
+ - spec/integration/nested_crumbs_spec.rb
191
+ - spec/loaf/crumb_formatter_spec.rb
192
+ - spec/loaf/translation_spec.rb
193
+ - spec/loaf_spec.rb
194
+ - spec/rails_app/.gitignore
195
+ - spec/rails_app/Rakefile
196
+ - spec/rails_app/app/assets/images/rails.png
197
+ - spec/rails_app/app/assets/javascripts/application.js
198
+ - spec/rails_app/app/assets/stylesheets/application.css
199
+ - spec/rails_app/app/controllers/application_controller.rb
200
+ - spec/rails_app/app/controllers/comments_controller.rb
201
+ - spec/rails_app/app/controllers/home_controller.rb
202
+ - spec/rails_app/app/controllers/posts_controller.rb
203
+ - spec/rails_app/app/helpers/application_helper.rb
204
+ - spec/rails_app/app/mailers/.gitkeep
205
+ - spec/rails_app/app/models/.gitkeep
206
+ - spec/rails_app/app/views/home/index.html.erb
207
+ - spec/rails_app/app/views/layouts/_breadcrumbs.html.erb
208
+ - spec/rails_app/app/views/layouts/application.html.erb
209
+ - spec/rails_app/app/views/posts/index.html.erb
210
+ - spec/rails_app/app/views/posts/new.html.erb
211
+ - spec/rails_app/config.ru
212
+ - spec/rails_app/config/application.rb
213
+ - spec/rails_app/config/boot.rb
214
+ - spec/rails_app/config/database.yml
215
+ - spec/rails_app/config/environment.rb
216
+ - spec/rails_app/config/environments/development.rb
217
+ - spec/rails_app/config/environments/production.rb
218
+ - spec/rails_app/config/environments/test.rb
219
+ - spec/rails_app/config/initializers/backtrace_silencers.rb
220
+ - spec/rails_app/config/initializers/inflections.rb
221
+ - spec/rails_app/config/initializers/mime_types.rb
222
+ - spec/rails_app/config/initializers/secret_token.rb
223
+ - spec/rails_app/config/initializers/session_store.rb
224
+ - spec/rails_app/config/initializers/wrap_parameters.rb
225
+ - spec/rails_app/config/locales/en.yml
226
+ - spec/rails_app/config/routes.rb
227
+ - spec/rails_app/db/seeds.rb
228
+ - spec/rails_app/lib/assets/.gitkeep
229
+ - spec/rails_app/lib/tasks/.gitkeep
230
+ - spec/rails_app/public/404.html
231
+ - spec/rails_app/public/422.html
232
+ - spec/rails_app/public/500.html
233
+ - spec/rails_app/public/favicon.ico
234
+ - spec/rails_app/public/robots.txt
235
+ - spec/rails_app/script/rails
236
+ - spec/spec_helper.rb
237
+ - spec/support/capybara.rb
238
+ - spec/support/load_routes.rb
data/README.rdoc DELETED
@@ -1,71 +0,0 @@
1
- = Loaf
2
-
3
- Breadcrumbs creation library.
4
-
5
- * Helps in creating breadcrumbs.
6
- * Uses controllers to specify names and routes for parts of breadcrum trails or collections of breadcrumbs.
7
- * Stays out of your way when it comes to markup exposing only single helper method to access breadcrumb data.
8
-
9
- == Installation
10
-
11
- Install from source:
12
-
13
- gem install loaf
14
-
15
- Add to your Gemfile:
16
-
17
- gem 'loaf'
18
-
19
- == Configuration
20
-
21
- There is small set of custom opinionated defaults. However, to override them in your views just pass an option hash. The following options are valid:
22
-
23
- :crumb_length # integer, default length is 30 characters
24
- :root # boolean, default is true, displays the home crumb
25
-
26
- == Usage
27
-
28
- In controller:
29
-
30
- class Blog::CategoriesController < ApplicationController
31
-
32
- add_breadcrumb 'Article Categories', 'blog_categories_path', :only => [:show]
33
-
34
- def show
35
- add_breadcrumb "#{@category.title}", 'blog_category_path(@category)'
36
- end
37
- end
38
-
39
- You can add breadcrumbs for nested resources, for instance, article categories:
40
-
41
- You can add semantic markup in your view to show breadcrumbs
42
-
43
- <ul id="breadcrumbs">
44
- <%- breadcrumbs :crumb_length => 20 do |name, url, styles| -%>
45
- <li class="<%= styles %>">
46
- <%= link_to name, url %>
47
- <span><%= styles == 'selected' ? '' : '::' %></span>
48
- </li>
49
- <%- end -%>
50
- </ul>
51
-
52
- == TODO
53
-
54
- * Add ability to add breadcrumbs for nested resources
55
- * Add support for name internationalisation
56
- * Finish specs
57
-
58
- == Contributing to loaf
59
-
60
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
61
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
62
- * Fork the project
63
- * Start a feature/bugfix branch
64
- * Commit and push until you are happy with your contribution
65
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
66
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
67
-
68
- == Copyright
69
-
70
- Copyright (c) 2011 Piotr Murach. See LICENSE.txt for
71
- further details.