breadcrumbs_on_rails 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -6
- data/.travis.yml +12 -0
- data/Appraisals +11 -0
- data/{CHANGELOG.rdoc → CHANGELOG.md} +22 -8
- data/Gemfile.lock +76 -58
- data/LICENSE +1 -1
- data/README.md +99 -0
- data/Rakefile +13 -20
- data/breadcrumbs_on_rails.gemspec +13 -13
- data/gemfiles/3.0.gemfile +7 -0
- data/gemfiles/3.0.gemfile.lock +100 -0
- data/gemfiles/3.1.gemfile +7 -0
- data/gemfiles/3.1.gemfile.lock +100 -0
- data/gemfiles/3.2.gemfile +7 -0
- data/gemfiles/3.2.gemfile.lock +100 -0
- data/lib/breadcrumbs_on_rails.rb +2 -2
- data/lib/breadcrumbs_on_rails/{controller_mixin.rb → action_controller.rb} +12 -15
- data/lib/breadcrumbs_on_rails/breadcrumbs.rb +1 -1
- data/lib/breadcrumbs_on_rails/railtie.rb +2 -2
- data/lib/breadcrumbs_on_rails/version.rb +2 -2
- data/test/unit/builder_test.rb +51 -55
- data/test/unit/simple_builder_test.rb +9 -13
- metadata +30 -22
- data/README.rdoc +0 -205
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Appraisals
ADDED
@@ -1,30 +1,43 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
|
4
|
+
## Release 2.2.0
|
5
|
+
|
6
|
+
* NEW: Support for Rails 3.2.
|
7
|
+
|
8
|
+
* FIXED: Fixed Rails 3.2 ActiveSupport::Concern deprecation warning (GH-17, GH-20).
|
9
|
+
|
10
|
+
|
11
|
+
## Release 2.1.0
|
4
12
|
|
5
13
|
* NEW: Element now accepts a Hash of options. The options can be useful to customize the appearance of the element, for example to set a link title or class.
|
6
14
|
|
7
|
-
|
15
|
+
|
16
|
+
## Release 2.0.0
|
8
17
|
|
9
18
|
* FIXED: Invalid documentation for Element target in the controller class context (closes #2)
|
10
19
|
|
11
20
|
* CHANGED: Upgraded to Rails 3
|
12
21
|
|
13
|
-
|
22
|
+
|
23
|
+
## Release 1.0.1
|
14
24
|
|
15
25
|
* FIXED: Since the removal of rails/init.rb in 7278376ab77651e540e39552384ad9677e32ff7e, Rails fails to load the helpers.
|
16
26
|
|
17
|
-
|
27
|
+
|
28
|
+
## Release 1.0.0
|
18
29
|
|
19
30
|
* CHANGED: Removed empty install/uninstall hooks and tasks folder.
|
20
31
|
|
21
32
|
* CHANGED: Removed rails/init hook because deprecated in Rails 3.
|
22
33
|
|
23
|
-
|
34
|
+
|
35
|
+
## Release 0.2.0
|
24
36
|
|
25
37
|
* Releasing the library as open source project.
|
26
38
|
|
27
|
-
|
39
|
+
## Release 0.1.1
|
40
|
+
|
28
41
|
|
29
42
|
* ADDED: documentation file.
|
30
43
|
|
@@ -32,6 +45,7 @@
|
|
32
45
|
|
33
46
|
* CHANGED: Removed BUILD and STATUS constants. Added Version::ALPHA constant to be used when I need to package prereleases (see RubyGem --prerelease flag).
|
34
47
|
|
35
|
-
|
48
|
+
|
49
|
+
## Release 0.1.0
|
36
50
|
|
37
51
|
* Initial version
|
data/Gemfile.lock
CHANGED
@@ -1,81 +1,99 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
breadcrumbs_on_rails (2.
|
4
|
+
breadcrumbs_on_rails (2.2.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
rack (~> 1.
|
20
|
-
rack-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
9
|
+
actionmailer (3.2.1)
|
10
|
+
actionpack (= 3.2.1)
|
11
|
+
mail (~> 2.4.0)
|
12
|
+
actionpack (3.2.1)
|
13
|
+
activemodel (= 3.2.1)
|
14
|
+
activesupport (= 3.2.1)
|
15
|
+
builder (~> 3.0.0)
|
16
|
+
erubis (~> 2.7.0)
|
17
|
+
journey (~> 1.0.1)
|
18
|
+
rack (~> 1.4.0)
|
19
|
+
rack-cache (~> 1.1)
|
20
|
+
rack-test (~> 0.6.1)
|
21
|
+
sprockets (~> 2.1.2)
|
22
|
+
activemodel (3.2.1)
|
23
|
+
activesupport (= 3.2.1)
|
24
|
+
builder (~> 3.0.0)
|
25
|
+
activerecord (3.2.1)
|
26
|
+
activemodel (= 3.2.1)
|
27
|
+
activesupport (= 3.2.1)
|
28
|
+
arel (~> 3.0.0)
|
29
|
+
tzinfo (~> 0.3.29)
|
30
|
+
activeresource (3.2.1)
|
31
|
+
activemodel (= 3.2.1)
|
32
|
+
activesupport (= 3.2.1)
|
33
|
+
activesupport (3.2.1)
|
34
|
+
i18n (~> 0.6)
|
35
|
+
multi_json (~> 1.0)
|
36
|
+
appraisal (0.4.0)
|
37
|
+
bundler
|
38
|
+
rake
|
39
|
+
arel (3.0.0)
|
40
|
+
builder (3.0.0)
|
41
|
+
erubis (2.7.0)
|
42
|
+
hike (1.2.1)
|
43
|
+
i18n (0.6.0)
|
44
|
+
journey (1.0.1)
|
45
|
+
json (1.6.5)
|
46
|
+
mail (2.4.1)
|
43
47
|
i18n (>= 0.4.0)
|
44
48
|
mime-types (~> 1.16)
|
45
49
|
treetop (~> 1.4.8)
|
46
|
-
mime-types (1.
|
50
|
+
mime-types (1.17.2)
|
47
51
|
mocha (0.9.12)
|
48
|
-
|
49
|
-
|
50
|
-
rack
|
51
|
-
|
52
|
-
|
52
|
+
multi_json (1.0.4)
|
53
|
+
polyglot (0.3.3)
|
54
|
+
rack (1.4.1)
|
55
|
+
rack-cache (1.1)
|
56
|
+
rack (>= 0.4)
|
57
|
+
rack-ssl (1.3.2)
|
58
|
+
rack
|
59
|
+
rack-test (0.6.1)
|
53
60
|
rack (>= 1.0)
|
54
|
-
rails (3.
|
55
|
-
actionmailer (= 3.
|
56
|
-
actionpack (= 3.
|
57
|
-
activerecord (= 3.
|
58
|
-
activeresource (= 3.
|
59
|
-
activesupport (= 3.
|
61
|
+
rails (3.2.1)
|
62
|
+
actionmailer (= 3.2.1)
|
63
|
+
actionpack (= 3.2.1)
|
64
|
+
activerecord (= 3.2.1)
|
65
|
+
activeresource (= 3.2.1)
|
66
|
+
activesupport (= 3.2.1)
|
60
67
|
bundler (~> 1.0)
|
61
|
-
railties (= 3.
|
62
|
-
railties (3.
|
63
|
-
actionpack (= 3.
|
64
|
-
activesupport (= 3.
|
68
|
+
railties (= 3.2.1)
|
69
|
+
railties (3.2.1)
|
70
|
+
actionpack (= 3.2.1)
|
71
|
+
activesupport (= 3.2.1)
|
72
|
+
rack-ssl (~> 1.3.2)
|
65
73
|
rake (>= 0.8.7)
|
66
|
-
|
67
|
-
|
74
|
+
rdoc (~> 3.4)
|
75
|
+
thor (~> 0.14.6)
|
76
|
+
rake (0.9.2.2)
|
77
|
+
rdoc (3.12)
|
78
|
+
json (~> 1.4)
|
79
|
+
sprockets (2.1.2)
|
80
|
+
hike (~> 1.2)
|
81
|
+
rack (~> 1.0)
|
82
|
+
tilt (~> 1.1, != 1.3.0)
|
68
83
|
thor (0.14.6)
|
69
|
-
|
84
|
+
tilt (1.3.3)
|
85
|
+
treetop (1.4.10)
|
86
|
+
polyglot
|
70
87
|
polyglot (>= 0.3.1)
|
71
|
-
tzinfo (0.3.
|
88
|
+
tzinfo (0.3.31)
|
89
|
+
yard (0.7.5)
|
72
90
|
|
73
91
|
PLATFORMS
|
74
92
|
ruby
|
75
93
|
|
76
94
|
DEPENDENCIES
|
95
|
+
appraisal
|
77
96
|
breadcrumbs_on_rails!
|
78
|
-
bundler
|
79
97
|
mocha (~> 0.9.10)
|
80
|
-
rails (
|
81
|
-
|
98
|
+
rails (>= 3.0)
|
99
|
+
yard
|
data/LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# Breadcrumbs On Rails
|
2
|
+
|
3
|
+
*BreadcrumbsOnRails* is a simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project.
|
4
|
+
It provides helpers for creating navigation elements with a flexible interface.
|
5
|
+
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
* Rails 3
|
10
|
+
|
11
|
+
Please note
|
12
|
+
|
13
|
+
* BreadcrumbsOnRails 2.x requires Rails 3. Use BreadcrumbsOnRails 1.x with Rails 2.
|
14
|
+
* BreadcrumbsOnRails doesn't work with Rails 2.1 or lower.
|
15
|
+
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
[RubyGems](http://rubygems.org) is the preferred way to install *BreadcrumbsOnRails* and the best way if you want install a stable version.
|
20
|
+
|
21
|
+
$ gem install breadcrumbs_on_rails
|
22
|
+
|
23
|
+
Specify the Gem dependency in the [Bundler](http://gembundler.com) `Gemfile`.
|
24
|
+
|
25
|
+
gem "breadcrumbs_on_rails"
|
26
|
+
|
27
|
+
Use [Bundler](http://gembundler.com) and the [:git option](http://gembundler.com/v1.0/git.html) if you want to grab the latest version from the Git repository.
|
28
|
+
|
29
|
+
|
30
|
+
## Basic Usage
|
31
|
+
|
32
|
+
Creating a breadcrumb navigation menu in your Rails app using *BreadcrumbsOnRails* is really straightforward.
|
33
|
+
|
34
|
+
In your controller, call `add_breadcrumb` to push a new element on the breadcrumb stack. `add_breadcrumb` requires two arguments: the name of the breadcrumb and the target path.
|
35
|
+
|
36
|
+
class MyController
|
37
|
+
|
38
|
+
add_breadcrumb "home", :root_path
|
39
|
+
add_breadcrumb "my", :my_path
|
40
|
+
|
41
|
+
def index
|
42
|
+
# ...
|
43
|
+
|
44
|
+
add_breadcrumb "index", index_path
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
The third, optional argument is a Hash of options to customize the breadcrumb link.
|
50
|
+
|
51
|
+
class MyController
|
52
|
+
def index
|
53
|
+
add_breadcrumb "index", index_path, :title => "Back to the Index"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
In your view, you can render the breadcrumb menu with the `render_breadcrumbs` helper.
|
58
|
+
|
59
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
60
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
61
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
62
|
+
<head>
|
63
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
64
|
+
<title>untitled</title>
|
65
|
+
</head>
|
66
|
+
|
67
|
+
<body>
|
68
|
+
<%= render_breadcrumbs %>
|
69
|
+
</body>
|
70
|
+
</html>
|
71
|
+
|
72
|
+
`render_breadcrumbs` understands a limited set of options. For example, you can pass change the default separator with the `:separator` option.
|
73
|
+
|
74
|
+
<body>
|
75
|
+
<%= render_breadcrumbs :separator => ' / ' %>
|
76
|
+
</body>
|
77
|
+
|
78
|
+
More complex customizations require a custom Builder.
|
79
|
+
|
80
|
+
Read the [documentation](http://www.simonecarletti.com/code/breadcrumbs_on_rails/docs/) to learn more about advanced usage and builders.
|
81
|
+
|
82
|
+
|
83
|
+
## Credits
|
84
|
+
|
85
|
+
* [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net> - The Author
|
86
|
+
|
87
|
+
|
88
|
+
## Resources
|
89
|
+
|
90
|
+
* [Homepage](http://www.simonecarletti.com/code/breadcrumbs_on_rails)
|
91
|
+
* [Documentation](http://www.simonecarletti.com/code/breadcrumbs_on_rails/docs/)
|
92
|
+
* [API](http://rubydoc.info/gems/breadcrumbs_on_rails)
|
93
|
+
* [Repository](https://github.com/weppos/breadcrumbs_on_rails)
|
94
|
+
* [Issue Tracker](http://github.com/weppos/breadcrumbs_on_rails/issues)
|
95
|
+
|
96
|
+
|
97
|
+
## License
|
98
|
+
|
99
|
+
*BreadcrumbsOnRails* is Copyright (c) 2009-2012 Simone Carletti. This is Free Software distributed under the MIT license.
|
data/Rakefile
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'rubygems/package_task'
|
3
2
|
require 'bundler'
|
4
|
-
require '
|
5
|
-
require 'yard'
|
6
|
-
require 'yard/rake/yardoc_task'
|
3
|
+
require 'appraisal'
|
7
4
|
|
8
5
|
$:.unshift(File.dirname(__FILE__) + "/lib")
|
9
6
|
require 'breadcrumbs_on_rails/version'
|
@@ -12,19 +9,10 @@ require 'breadcrumbs_on_rails/version'
|
|
12
9
|
PKG_NAME = ENV['PKG_NAME'] || "breadcrumbs_on_rails"
|
13
10
|
PKG_VERSION = ENV['PKG_VERSION'] || BreadcrumbsOnRails::VERSION
|
14
11
|
|
15
|
-
if ENV['SNAPSHOT'].to_i == 1
|
16
|
-
PKG_VERSION << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
|
17
|
-
end
|
18
|
-
|
19
12
|
|
20
13
|
# Run test by default.
|
21
14
|
task :default => :test
|
22
15
|
|
23
|
-
# This builds the actual gem. For details of what all these options
|
24
|
-
# mean, and other ones you can add, check the documentation here:
|
25
|
-
#
|
26
|
-
# http://rubygems.org/read/chapter/20
|
27
|
-
#
|
28
16
|
spec = Gem::Specification.new do |s|
|
29
17
|
s.name = PKG_NAME
|
30
18
|
s.version = PKG_VERSION
|
@@ -35,17 +23,19 @@ spec = Gem::Specification.new do |s|
|
|
35
23
|
s.email = "weppos@weppos.net"
|
36
24
|
s.homepage = "http://www.simonecarletti.com/code/breadcrumbs_on_rails"
|
37
25
|
|
38
|
-
# Add any extra files to include in the gem (like your README)
|
39
26
|
s.files = `git ls-files`.split("\n")
|
40
27
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
41
28
|
s.require_paths = %w( lib )
|
42
29
|
|
43
|
-
s.add_development_dependency
|
44
|
-
s.add_development_dependency
|
45
|
-
s.add_development_dependency
|
46
|
-
s.add_development_dependency
|
30
|
+
s.add_development_dependency "rails", ">= 3.0"
|
31
|
+
s.add_development_dependency "appraisal"
|
32
|
+
s.add_development_dependency "mocha", "~> 0.9.10"
|
33
|
+
s.add_development_dependency "yard"
|
47
34
|
end
|
48
35
|
|
36
|
+
|
37
|
+
require 'rubygems/package_task'
|
38
|
+
|
49
39
|
Gem::PackageTask.new(spec) do |pkg|
|
50
40
|
pkg.gem_spec = spec
|
51
41
|
end
|
@@ -68,7 +58,8 @@ desc "Package the library and generates the gemspec"
|
|
68
58
|
task :package => [:gemspec]
|
69
59
|
|
70
60
|
|
71
|
-
|
61
|
+
require 'rake/testtask'
|
62
|
+
|
72
63
|
Rake::TestTask.new do |t|
|
73
64
|
t.libs << "test"
|
74
65
|
t.test_files = FileList["test/**/*_test.rb"]
|
@@ -77,7 +68,9 @@ Rake::TestTask.new do |t|
|
|
77
68
|
end
|
78
69
|
|
79
70
|
|
80
|
-
|
71
|
+
require 'yard'
|
72
|
+
require 'yard/rake/yardoc_task'
|
73
|
+
|
81
74
|
YARD::Rake::YardocTask.new(:yardoc) do |y|
|
82
75
|
y.options = ["--output-dir", "yardoc"]
|
83
76
|
end
|
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "breadcrumbs_on_rails"
|
5
|
-
s.version = "2.
|
5
|
+
s.version = "2.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Simone Carletti"]
|
9
|
-
s.date = "
|
9
|
+
s.date = "2012-02-03"
|
10
10
|
s.description = "BreadcrumbsOnRails is a simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project."
|
11
11
|
s.email = "weppos@weppos.net"
|
12
|
-
s.files = [".gitignore", "CHANGELOG.
|
12
|
+
s.files = [".gitignore", ".travis.yml", "Appraisals", "CHANGELOG.md", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "breadcrumbs_on_rails.gemspec", "gemfiles/3.0.gemfile", "gemfiles/3.0.gemfile.lock", "gemfiles/3.1.gemfile", "gemfiles/3.1.gemfile.lock", "gemfiles/3.2.gemfile", "gemfiles/3.2.gemfile.lock", "init.rb", "lib/breadcrumbs_on_rails.rb", "lib/breadcrumbs_on_rails/action_controller.rb", "lib/breadcrumbs_on_rails/breadcrumbs.rb", "lib/breadcrumbs_on_rails/railtie.rb", "lib/breadcrumbs_on_rails/version.rb", "test/test_helper.rb", "test/unit/builder_test.rb", "test/unit/element_test.rb", "test/unit/simple_builder_test.rb"]
|
13
13
|
s.homepage = "http://www.simonecarletti.com/code/breadcrumbs_on_rails"
|
14
14
|
s.require_paths = ["lib"]
|
15
|
-
s.rubygems_version = "1.8.
|
15
|
+
s.rubygems_version = "1.8.11"
|
16
16
|
s.summary = "A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation."
|
17
17
|
s.test_files = ["test/test_helper.rb", "test/unit/builder_test.rb", "test/unit/element_test.rb", "test/unit/simple_builder_test.rb"]
|
18
18
|
|
@@ -20,20 +20,20 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.specification_version = 3
|
21
21
|
|
22
22
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
23
|
-
s.add_development_dependency(%q<
|
24
|
-
s.add_development_dependency(%q<
|
25
|
-
s.add_development_dependency(%q<rails>, ["~> 3.0.0"])
|
23
|
+
s.add_development_dependency(%q<rails>, [">= 3.0"])
|
24
|
+
s.add_development_dependency(%q<appraisal>, [">= 0"])
|
26
25
|
s.add_development_dependency(%q<mocha>, ["~> 0.9.10"])
|
26
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
27
27
|
else
|
28
|
-
s.add_dependency(%q<
|
29
|
-
s.add_dependency(%q<
|
30
|
-
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
28
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
29
|
+
s.add_dependency(%q<appraisal>, [">= 0"])
|
31
30
|
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
31
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
32
32
|
end
|
33
33
|
else
|
34
|
-
s.add_dependency(%q<
|
35
|
-
s.add_dependency(%q<
|
36
|
-
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
34
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
35
|
+
s.add_dependency(%q<appraisal>, [">= 0"])
|
37
36
|
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
37
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
38
38
|
end
|
39
39
|
end
|