loaf 0.4.0 → 0.5.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: 0cb34b106f14868575b5831d9de8255e52e94f2d
4
- data.tar.gz: 8f3fdcef497c132f17cd4496b124a60b92cbc67a
3
+ metadata.gz: bd80cf0439e9736d7c29811f8465ac55b161e3ec
4
+ data.tar.gz: b42620aee3caec07147186d72fbd24eeec24102e
5
5
  SHA512:
6
- metadata.gz: 568cd3729c360ab6d1aa4a8c19d9618d8d6dfb8312a57693896c940d94cddd5f4979e8f656ad0c3cd76db67b2b62c9d9f3fb0d5dce802bb2048a3dcc9d7aa344
7
- data.tar.gz: 8cb65d4d05998f474f9356490f7cfe9a923b65de0e7ec8855a9bad4057f3306941a6f9bb38fea283d100e28a6349015beb79a708f84e278fe437285adef5bdab
6
+ metadata.gz: fe8ffab119f314dd4cc95905e0e6b0f70dbf58145740e2c07670adeb9cde9f5570fce875e3c5248b30e9c181b16a7b5b761425138f15154c2f4c55b1cc283783
7
+ data.tar.gz: 1df8f9471b34d22ca69fb606dba529ba05dc65903329461aea28a1044c11bb1b10f655c1bbc9279062723513ad36b8a5c74673b85e6670f8c9c12bb4e8bb18db
@@ -1,3 +1,10 @@
1
+ 0.5.0 (January 31, 2015)
2
+
3
+ * Add generator for locales file
4
+ * Add breadcrumbs scope for translations
5
+ * Change breadcrumb formatter to use translations for title formatting
6
+ * Add ability to pass proc as title and/or url for breadcrumb helper inside controller
7
+
1
8
  0.4.0 (January 10, 2015)
2
9
 
3
10
  * Change breadcrumbs view method to return enumerator without block
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
+ gem 'ammeter', '~> 1.1.2'
5
6
  gem 'bundler', '~> 1.3'
6
7
  gem 'appraisal', '~> 1.0.2'
7
8
  gem 'rake', '~> 10.4.2'
data/README.md CHANGED
@@ -18,8 +18,9 @@
18
18
  ## Features
19
19
 
20
20
  * Uses controllers or views to specify breadcrumb trails
21
+ * Specify urls using Rails conventions
21
22
  * No markup assumptions for breadcrumbs rendering
22
- * Use locales file for names - optional
23
+ * Use locales file for breadcrumb names
23
24
  * Tested with Rails 3.2, 4.0, 4.1, 4.2
24
25
 
25
26
  ## Installation
@@ -42,11 +43,17 @@ Or install it yourself as:
42
43
  gem install loaf
43
44
  ```
44
45
 
46
+ Then run the generator:
47
+
48
+ ```ruby
49
+ rails generate loaf:install
50
+ ```
51
+
45
52
  ## 1. Usage
46
53
 
47
54
  **Loaf** allows you to add breadcrumbs in controllers and views.
48
55
 
49
- In order to add breadcrumbs in controller use `breadcrumb` method. Outside of controller actions the `breadcrumb` helper behaviour is similar to filters and as such you can limit breadcrumb scope with familiar options `:only`, `:except`. Any breadcrumb specified inside actions creates another level in breadcrumbs trail.
56
+ In order to add breadcrumbs in controller use `breadcrumb` method ([see 1.1](#11-breadcrumb)). Outside of controller actions the `breadcrumb` helper behaviour is similar to filters and as such you can limit breadcrumb scope with familiar options `:only`, `:except`. Any breadcrumb specified inside actions creates another level in breadcrumbs trail.
50
57
 
51
58
  ```ruby
52
59
  class Blog::CategoriesController < ApplicationController
@@ -54,15 +61,15 @@ class Blog::CategoriesController < ApplicationController
54
61
  breadcrumb 'Article Categories', :blog_categories_path, only: [:show]
55
62
 
56
63
  def show
57
- breadcrumb "#{@category.title}", blog_category_path(@category)
64
+ breadcrumb @category.title, blog_category_path(@category)
58
65
  end
59
66
  end
60
67
  ```
61
68
 
62
- **Loaf** adds `breadcrumb` helper also to the views. Together with controller breadcrumbs, the view breadcrumbs are appended as the last. For instance, to specify view breadcrumb do:
69
+ **Loaf** adds `breadcrumb` helper also to the views. Together with controller breadcrumbs, the view breadcrumbs are appended as the last in breadcrumb trail. For instance, to specify view breadcrumb do:
63
70
 
64
71
  ```ruby
65
- <% breadcrumb "#{@category.title}", blog_category_path(@category) %>
72
+ <% breadcrumb @category.title, blog_category_path(@category) %>
66
73
  ```
67
74
 
68
75
  Finally, in your view layout add semantic markup to show breadcrumbs:
@@ -80,6 +87,85 @@ Finally, in your view layout add semantic markup to show breadcrumbs:
80
87
 
81
88
  Usually best practice is to put such snippet inside its own partial.
82
89
 
90
+ ### 1.1 breadcrumb
91
+
92
+ Creation of breadcrumb in Rails is achieved by the `breadcrumb` helper.
93
+
94
+ The `breadcrumb` method takes at minimum two arguments: the first is a name for the crumb that will be displayed and the second is a url that the name points to. The url parameter uses the familiar Rails conventions.
95
+
96
+ When using path variable `blog_categories_path`:
97
+
98
+ ```ruby
99
+ breadcrumb 'Categories', blog_categories_path
100
+ ```
101
+
102
+ When using an instance `@category`:
103
+
104
+ ```ruby
105
+ breadcrumb @category.title, blog_category_path(@category)
106
+ ```
107
+
108
+ You can also use set of objects:
109
+
110
+ ```ruby
111
+ breadcrumb @category.title, [:blog, @category]
112
+ ```
113
+
114
+ You can specify segments of the url:
115
+
116
+ ```ruby
117
+ breadcrumb @category.title, {controller: 'categories', action: 'show', id: @category.id}
118
+ ```
119
+
120
+ #### 1.1.1 breadcrumb in controller
121
+
122
+ Breadcrumbs are inherited, so if you set a breadcrumb in `ApplicationController`, it will be inserted as a first element inside every breadcrumb trail. It is customary to set root breadcrumb like so:
123
+
124
+ ```ruby
125
+ class ApplicationController < ActionController::Base
126
+ breadcrumb 'Home', :root_path
127
+ end
128
+ ```
129
+
130
+ In controller outside of any action the `breadcrumb` acts as filter.
131
+
132
+ ```ruby
133
+ class ArticlesController < ApplicationController
134
+ breadcrumb 'All Articles', :articles_path, only: [:new, :create]
135
+ end
136
+ ```
137
+
138
+ **Loaf** allows you to call controller instance methods inside the `breadcrumb` helper outside of any action. This is useful if your breadcrumb has parameterized behaviour. For example, to dynamically evaluate parameters for breadcrumb title do:
139
+
140
+ ```ruby
141
+ class CommentsController < ApplicationController
142
+ breadcrumb ->(c) { c.find_article(c.params[:post_id]).title }, :articles_path
143
+ end
144
+ ```
145
+
146
+ Also, to dynamically evalute parameters inside the url argument do:
147
+
148
+ ```ruby
149
+ class CommentsController < ApplicationController
150
+ breadcrumb 'All Comments', ->(c) { c.post_comments_path(c.params[:post_id]) }
151
+ end
152
+ ```
153
+
154
+ ### 1.2 force
155
+
156
+ **Loaf** allows you to force a breadcrumb to be current.
157
+
158
+ For example, on the create action as you are likely want the breadcrumb to be similar as for new action.
159
+
160
+ ```ruby
161
+ class PostsController < ApplicationController
162
+ def create
163
+ breadcrumb 'New Post', new_post_path, force: true
164
+ render action: :new
165
+ end
166
+ end
167
+ ```
168
+
83
169
  ## 2. Configuration
84
170
 
85
171
  There is a small set of custom opinionated defaults. The following options are valid parameters:
@@ -108,32 +194,33 @@ Loaf.configure do |config|
108
194
  end
109
195
  ```
110
196
 
111
- ## 3. Locale
197
+ ## 3. Translation
112
198
 
113
- When adding breadcrumbs one can use locales for their titles. The only assumption it makes is that all breadcrumb names are scoped inside `breadcrumbs` namespace. However, this can be easily changed by passing `:scope => 'new_scope_name'` configuration option
199
+ You can use locales files for breadcrumbs' titles. **Loaf** assumes that all breadcrumb names are scoped inside `breadcrumbs` namespace inside `loaf` scope. However, this can be easily changed by passing `scope: 'new_scope_name'` configuration option.
114
200
 
115
201
  ```ruby
116
202
  en:
117
- breadcrumbs:
118
- controller:
119
- action:
203
+ loaf:
204
+ breadcrumbs:
205
+ name: 'my-breadcrumb-name'
120
206
  ```
121
207
 
122
- Therefore in your controller/view one would have
208
+ Therefore, in your controller/view you would do:
123
209
 
124
210
  ```ruby
125
211
  class Blog::CategoriesController < ApplicationController
126
-
127
- breadcrumb 'blog.categories', 'blog_categories_path'
128
-
212
+ breadcrumb 'blog.categories', :blog_categories_path
129
213
  end
214
+ ```
130
215
 
131
- And corresponding entry in locale:
216
+ And corresponding entry in locale would be:
132
217
 
218
+ ```ruby
133
219
  en:
134
- breadcrumbs:
135
- blog:
136
- categories: 'Article Categories'
220
+ loaf:
221
+ breadcrumbs:
222
+ blog:
223
+ categories: 'Article Categories'
137
224
  ```
138
225
 
139
226
  ## Contributing
@@ -0,0 +1,6 @@
1
+ en:
2
+ loaf:
3
+ errors:
4
+ invalid_options: "Invalid option :%{invalid}. Valid options are: %{valid}, make sure these are the ones you are using."
5
+ breadcrumbs:
6
+ home: 'Home'
@@ -2,9 +2,10 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "ammeter"
5
6
  gem "bundler", "~> 1.3"
6
7
  gem "appraisal", "~> 1.0.2"
7
- gem "rake", "~> 10.3.2"
8
+ gem "rake", "~> 10.4.2"
8
9
  gem "yard", "~> 0.8.7"
9
10
  gem "sqlite3", "~> 1.3.10", :platforms => :ruby
10
11
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.10", :platforms => :jruby
@@ -2,9 +2,10 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "ammeter"
5
6
  gem "bundler", "~> 1.3"
6
7
  gem "appraisal", "~> 1.0.2"
7
- gem "rake", "~> 10.3.2"
8
+ gem "rake", "~> 10.4.2"
8
9
  gem "yard", "~> 0.8.7"
9
10
  gem "sqlite3", "~> 1.3.10", :platforms => :ruby
10
11
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.10", :platforms => :jruby
@@ -2,9 +2,10 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "ammeter"
5
6
  gem "bundler", "~> 1.3"
6
7
  gem "appraisal", "~> 1.0.2"
7
- gem "rake", "~> 10.3.2"
8
+ gem "rake", "~> 10.4.2"
8
9
  gem "yard", "~> 0.8.7"
9
10
  gem "sqlite3", "~> 1.3.10", :platforms => :ruby
10
11
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.10", :platforms => :jruby
@@ -2,9 +2,10 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "ammeter"
5
6
  gem "bundler", "~> 1.3"
6
7
  gem "appraisal", "~> 1.0.2"
7
- gem "rake", "~> 10.3.2"
8
+ gem "rake", "~> 10.4.2"
8
9
  gem "yard", "~> 0.8.7"
9
10
  gem "sqlite3", "~> 1.3.10", :platforms => :ruby
10
11
  gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.10", :platforms => :jruby
@@ -0,0 +1,17 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rails/generators'
4
+
5
+ module Loaf
6
+ module Generators
7
+ class InstallGenerator < Rails::Generators::Base
8
+ source_root File.expand_path("../../../..", __FILE__)
9
+
10
+ desc 'Copy locale file to your application'
11
+
12
+ def copy_locale
13
+ copy_file "#{self.class.source_root}/config/locales/loaf.en.yml", "config/locales/loaf.en.yml"
14
+ end
15
+ end # InstallGenerator
16
+ end # Generators
17
+ end # Loaf
@@ -11,9 +11,6 @@ require 'loaf/view_extensions'
11
11
  require 'loaf/crumb_formatter'
12
12
  require 'loaf/options_validator'
13
13
 
14
- # Add English load path by default
15
- I18n.load_path << File.join(File.dirname(__FILE__), 'config', 'locales', 'en.yml')
16
-
17
14
  module Loaf
18
15
  # Set global configuration
19
16
  #
@@ -12,26 +12,29 @@ module Loaf
12
12
  end
13
13
 
14
14
  module ClassMethods
15
+ # Add breacrumb to the trail in controller as class method
16
+ #
15
17
  # @param [String]
16
18
  #
17
19
  # @api public
18
20
  def breadcrumb(name, url, options = {})
21
+ normalizer = method(:_normalize_name)
19
22
  before_filter(options) do |instance|
20
- # instance.send(:add_breadcrumb, _normalize_name(name), url)
21
- instance.send(:breadcrumb, name, url, options)
23
+ normalized_name = normalizer.call(name, instance)
24
+ normalized_url = normalizer.call(url, instance)
25
+ instance.send(:breadcrumb, normalized_name, normalized_url, options)
22
26
  end
23
27
  end
24
28
  alias_method :add_breadcrumb, :breadcrumb
25
29
 
26
30
  private
27
31
 
28
- def _normalize_name(name=nil)
32
+ # @api private
33
+ def _normalize_name(name, instance)
29
34
  case name
30
35
  when NilClass
31
36
  when Proc
32
- name.call
33
- when Symbol
34
- name.to_s
37
+ name.call(instance)
35
38
  else
36
39
  name
37
40
  end
@@ -57,7 +60,7 @@ module Loaf
57
60
  end
58
61
  end
59
62
 
60
- # Add breadcrumb
63
+ # Add breadcrumb in controller as instance method
61
64
  #
62
65
  # @param [String] name
63
66
  #
@@ -8,9 +8,10 @@ module Loaf
8
8
  #
9
9
  # @api public
10
10
  def format_name(name, options = {})
11
- return if name.nil?
11
+ return name if name.nil? || name.empty?
12
12
 
13
13
  formatted = name.to_s.dup
14
+ formatted = Loaf::Translation.find_title(formatted)
14
15
  formatted = formatted.capitalize if options[:capitalize]
15
16
  if options[:crumb_length]
16
17
  formatted = truncate(formatted, length: options[:crumb_length])
@@ -5,7 +5,7 @@ module Loaf #:nodoc:
5
5
  # Default Loaf error for all custom errors.
6
6
  #
7
7
  class LoafError < StandardError
8
- BASE_KEY = "loaf.errors.messages"
8
+ BASE_KEY = "loaf.errors"
9
9
 
10
10
  def error_message(key, attributes)
11
11
  translate(key, attributes)
@@ -5,8 +5,8 @@ module Loaf
5
5
  extend self
6
6
 
7
7
  # Returns translation lookup
8
- def i18n_scope
9
- :breadcrumbs
8
+ def translation_scope
9
+ "loaf.breadcrumbs"
10
10
  end
11
11
 
12
12
  # Translate breadcrumb title
@@ -19,13 +19,11 @@ module Loaf
19
19
  # The default translation
20
20
  #
21
21
  # @api public
22
- def breadcrumb_title(title, options = {})
23
- defaults = []
24
- defaults << :"#{i18n_scope}.#{title}"
25
- defaults << options.delete(:default) if options[:default]
26
-
27
- options.reverse_merge! count: 1, default: defaults
28
- I18n.t(title, options)
22
+ def find_title(title, options = {})
23
+ options[:scope] ||= translation_scope
24
+ options[:default] = Array(options[:default])
25
+ options[:default] << title if options[:default].empty?
26
+ I18n.t("#{title}", options)
29
27
  end
30
28
  end # Translation
31
29
  end # Loaf
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Loaf
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end # Loaf
@@ -33,7 +33,7 @@ RSpec.describe "crumbs routing" do
33
33
  end
34
34
  end
35
35
 
36
- it 'should be current when forced' do
36
+ it 'is current when forced' do
37
37
  visit new_post_path
38
38
  click_button "Create"
39
39
 
@@ -43,4 +43,11 @@ RSpec.describe "crumbs routing" do
43
43
  expect(page).to have_selector('.selected')
44
44
  end
45
45
  end
46
+
47
+ it "allows for procs in name and url" do
48
+ visit post_comments_path(1)
49
+ within '#breadcrumbs' do
50
+ expect(page.html).to include('<a href="/posts/1/comments">Post comments</a>')
51
+ end
52
+ end
46
53
  end
@@ -1,4 +1,17 @@
1
+ class Article < Struct.new(:id, :title); end
2
+
1
3
  class CommentsController < ApplicationController
4
+
5
+ breadcrumb lambda { |c| c.find_article(c.params[:post_id]).title },
6
+ lambda { |c| c.post_comments_path(c.params[:post_id]) }
7
+
2
8
  def index
3
9
  end
10
+
11
+ def show
12
+ end
13
+
14
+ def find_article(id)
15
+ ::Article.new(id, 'Post comments')
16
+ end
4
17
  end
@@ -5,7 +5,7 @@ class PostsController < ApplicationController
5
5
  breadcrumb 'Home', :root_path, only: :index
6
6
 
7
7
  def index
8
- breadcrumb 'All Posts', posts_path
8
+ breadcrumb 'all_posts', posts_path
9
9
  end
10
10
 
11
11
  def show
@@ -0,0 +1 @@
1
+ <h1>Post comments index</h1>
@@ -0,0 +1,6 @@
1
+ en:
2
+ loaf:
3
+ errors:
4
+ invalid_options: "Invalid option :%{invalid}. Valid options are: %{valid}, make sure these are the ones you are using."
5
+ breadcrumbs:
6
+ all_posts: 'All Posts'
@@ -18,9 +18,8 @@ end
18
18
  # Configure Rails Environment
19
19
  ENV["RAILS_ENV"] = "test"
20
20
 
21
- require File.expand_path("../rails_app/config/environment.rb", __FILE__)
21
+ require 'rails_app/config/environment.rb'
22
22
  require 'rspec/rails'
23
-
24
23
  require 'loaf'
25
24
 
26
25
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -2,9 +2,7 @@ require 'capybara/rails'
2
2
  require 'capybara/dsl'
3
3
 
4
4
  RSpec.configure do |c|
5
- c.include Capybara::DSL, :example_group => {
6
- :file_path => /\bspec\/integration\//
7
- }
5
+ c.include Capybara::DSL, :file_path => /\bspec\/integration\//
8
6
  end
9
7
  Capybara.default_driver = :rack_test
10
8
  Capybara.default_selector = :css
@@ -1,6 +1,4 @@
1
1
  RSpec.configure do |c|
2
2
  c.include Rails.application.routes.url_helpers,
3
- :example_group => {
4
- :file_path => /\bspec\/integration\//
5
- }
3
+ :file_path => /\bspec\/integration\//
6
4
  end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require 'generators/loaf/install_generator'
5
+
6
+ RSpec.describe Loaf::Generators::InstallGenerator, type: :generator do
7
+ destination File.expand_path("../../../tmp", __FILE__)
8
+
9
+ before { prepare_destination }
10
+
11
+ it "copies loaf locales to the host application" do
12
+ run_generator
13
+ locale = file("config/locales/loaf.en.yml")
14
+ expect(locale).to exist
15
+ end
16
+ end
@@ -6,17 +6,19 @@ RSpec.describe Loaf::Translation do
6
6
 
7
7
  before { I18n.backend = I18n::Backend::Simple.new }
8
8
 
9
+ after { I18n.backend.reload! }
10
+
9
11
  it 'translates breadcrumb title' do
10
- I18n.backend.store_translations 'en', breadcrumbs: { home: 'Home'}
11
- expect(described_class.breadcrumb_title('breadcrumbs.home')).to eql('Home')
12
+ I18n.backend.store_translations 'en', loaf: { breadcrumbs: { home: 'Home'}}
13
+ expect(described_class.find_title('home')).to eql('Home')
12
14
  end
13
15
 
14
- it 'translates breadcrumb name with default scope' do
16
+ it 'does not translates breadcrumb name with missing scope' do
15
17
  I18n.backend.store_translations 'en', breadcrumbs: {home: 'Home'}
16
- expect(described_class.breadcrumb_title('home')).to eql('Home')
18
+ expect(described_class.find_title('home')).to eql('home')
17
19
  end
18
20
 
19
21
  it 'translates breadcrumb name using default option' do
20
- expect(described_class.breadcrumb_title('home', default: 'breadcrumb default name')).to eql('breadcrumb default name')
22
+ expect(described_class.find_title('home', default: 'breadcrumb default name')).to eql('breadcrumb default name')
21
23
  end
22
24
  end
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.4.0
4
+ version: 0.5.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: 2015-01-10 00:00:00.000000000 Z
11
+ date: 2015-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -46,12 +46,13 @@ files:
46
46
  - README.md
47
47
  - Rakefile
48
48
  - bin/setup
49
+ - config/locales/loaf.en.yml
49
50
  - gemfiles/rails3.2.gemfile
50
51
  - gemfiles/rails4.0.gemfile
51
52
  - gemfiles/rails4.1.gemfile
52
53
  - gemfiles/rails4.2.gemfile
53
54
  - init.rb
54
- - lib/config/locales/en.yml
55
+ - lib/generators/loaf/install_generator.rb
55
56
  - lib/loaf.rb
56
57
  - lib/loaf/builder.rb
57
58
  - lib/loaf/configuration.rb
@@ -73,6 +74,7 @@ files:
73
74
  - spec/rails_app/app/controllers/comments_controller.rb
74
75
  - spec/rails_app/app/controllers/home_controller.rb
75
76
  - spec/rails_app/app/controllers/posts_controller.rb
77
+ - spec/rails_app/app/views/comments/index.html.erb
76
78
  - spec/rails_app/app/views/home/index.html.erb
77
79
  - spec/rails_app/app/views/layouts/_breadcrumbs.html.erb
78
80
  - spec/rails_app/app/views/layouts/application.html.erb
@@ -94,6 +96,7 @@ files:
94
96
  - spec/rails_app/config/initializers/session_store.rb
95
97
  - spec/rails_app/config/initializers/wrap_parameters.rb
96
98
  - spec/rails_app/config/locales/en.yml
99
+ - spec/rails_app/config/locales/loaf.en.yml
97
100
  - spec/rails_app/config/routes.rb
98
101
  - spec/rails_app/db/seeds.rb
99
102
  - spec/rails_app/lib/assets/.gitkeep
@@ -111,6 +114,7 @@ files:
111
114
  - spec/support/load_routes.rb
112
115
  - spec/unit/controller_extensions_spec.rb
113
116
  - spec/unit/crumb_formatter_spec.rb
117
+ - spec/unit/generators/install_generator_spec.rb
114
118
  - spec/unit/options_validator_spec.rb
115
119
  - spec/unit/translation_spec.rb
116
120
  - spec/unit/view_extensions/breadcrumb_spec.rb
@@ -151,6 +155,7 @@ test_files:
151
155
  - spec/rails_app/app/controllers/comments_controller.rb
152
156
  - spec/rails_app/app/controllers/home_controller.rb
153
157
  - spec/rails_app/app/controllers/posts_controller.rb
158
+ - spec/rails_app/app/views/comments/index.html.erb
154
159
  - spec/rails_app/app/views/home/index.html.erb
155
160
  - spec/rails_app/app/views/layouts/_breadcrumbs.html.erb
156
161
  - spec/rails_app/app/views/layouts/application.html.erb
@@ -172,6 +177,7 @@ test_files:
172
177
  - spec/rails_app/config/initializers/session_store.rb
173
178
  - spec/rails_app/config/initializers/wrap_parameters.rb
174
179
  - spec/rails_app/config/locales/en.yml
180
+ - spec/rails_app/config/locales/loaf.en.yml
175
181
  - spec/rails_app/config/routes.rb
176
182
  - spec/rails_app/db/seeds.rb
177
183
  - spec/rails_app/lib/assets/.gitkeep
@@ -189,6 +195,7 @@ test_files:
189
195
  - spec/support/load_routes.rb
190
196
  - spec/unit/controller_extensions_spec.rb
191
197
  - spec/unit/crumb_formatter_spec.rb
198
+ - spec/unit/generators/install_generator_spec.rb
192
199
  - spec/unit/options_validator_spec.rb
193
200
  - spec/unit/translation_spec.rb
194
201
  - spec/unit/view_extensions/breadcrumb_spec.rb
@@ -1,6 +0,0 @@
1
- en:
2
- loaf:
3
- errors:
4
- messages:
5
- invalid_options: "Invalid option :%{invalid}. Valid options are: %{valid}, make sure these are the ones you are using."
6
-