breadcrumbs_on_rails_microdata_builder 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.travis.yml +12 -0
- data/Appraisals +11 -0
- data/CHANGELOG.md +51 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +99 -0
- data/LICENSE +22 -0
- data/README.md +99 -0
- data/Rakefile +85 -0
- data/breadcrumbs_on_rails_microdata_builder.gemspec +39 -0
- 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/init.rb +1 -0
- data/lib/breadcrumbs_on_rails_microdata_builder.rb +21 -0
- data/lib/breadcrumbs_on_rails_microdata_builder/action_controller.rb +93 -0
- data/lib/breadcrumbs_on_rails_microdata_builder/breadcrumbs.rb +100 -0
- data/lib/breadcrumbs_on_rails_microdata_builder/railtie.rb +20 -0
- data/lib/breadcrumbs_on_rails_microdata_builder/version.rb +22 -0
- data/test/test_helper.rb +20 -0
- data/test/unit/builder_test.rb +105 -0
- data/test/unit/element_test.rb +45 -0
- data/test/unit/simple_builder_test.rb +68 -0
- metadata +139 -0
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Appraisals
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
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
|
12
|
+
|
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.
|
14
|
+
|
15
|
+
|
16
|
+
## Release 2.0.0
|
17
|
+
|
18
|
+
* FIXED: Invalid documentation for Element target in the controller class context (closes #2)
|
19
|
+
|
20
|
+
* CHANGED: Upgraded to Rails 3
|
21
|
+
|
22
|
+
|
23
|
+
## Release 1.0.1
|
24
|
+
|
25
|
+
* FIXED: Since the removal of rails/init.rb in 7278376ab77651e540e39552384ad9677e32ff7e, Rails fails to load the helpers.
|
26
|
+
|
27
|
+
|
28
|
+
## Release 1.0.0
|
29
|
+
|
30
|
+
* CHANGED: Removed empty install/uninstall hooks and tasks folder.
|
31
|
+
|
32
|
+
* CHANGED: Removed rails/init hook because deprecated in Rails 3.
|
33
|
+
|
34
|
+
|
35
|
+
## Release 0.2.0
|
36
|
+
|
37
|
+
* Releasing the library as open source project.
|
38
|
+
|
39
|
+
## Release 0.1.1
|
40
|
+
|
41
|
+
|
42
|
+
* ADDED: documentation file.
|
43
|
+
|
44
|
+
* CHANGED: run test against Rails ~> 2.3.0 but ensure compatibility with Rails 2.2.x.
|
45
|
+
|
46
|
+
* CHANGED: Removed BUILD and STATUS constants. Added Version::ALPHA constant to be used when I need to package prereleases (see RubyGem --prerelease flag).
|
47
|
+
|
48
|
+
|
49
|
+
## Release 0.1.0
|
50
|
+
|
51
|
+
* Initial version
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
breadcrumbs_on_rails (2.2.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
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)
|
47
|
+
i18n (>= 0.4.0)
|
48
|
+
mime-types (~> 1.16)
|
49
|
+
treetop (~> 1.4.8)
|
50
|
+
mime-types (1.17.2)
|
51
|
+
mocha (0.9.12)
|
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)
|
60
|
+
rack (>= 1.0)
|
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)
|
67
|
+
bundler (~> 1.0)
|
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)
|
73
|
+
rake (>= 0.8.7)
|
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)
|
83
|
+
thor (0.14.6)
|
84
|
+
tilt (1.3.3)
|
85
|
+
treetop (1.4.10)
|
86
|
+
polyglot
|
87
|
+
polyglot (>= 0.3.1)
|
88
|
+
tzinfo (0.3.31)
|
89
|
+
yard (0.7.5)
|
90
|
+
|
91
|
+
PLATFORMS
|
92
|
+
ruby
|
93
|
+
|
94
|
+
DEPENDENCIES
|
95
|
+
appraisal
|
96
|
+
breadcrumbs_on_rails!
|
97
|
+
mocha (~> 0.9.10)
|
98
|
+
rails (>= 3.0)
|
99
|
+
yard
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2009-2012 Simone Carletti
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
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
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
require 'appraisal'
|
4
|
+
|
5
|
+
$:.unshift(File.dirname(__FILE__) + "/lib")
|
6
|
+
require 'breadcrumbs_on_rails/version'
|
7
|
+
|
8
|
+
|
9
|
+
PKG_NAME = ENV['PKG_NAME'] || "breadcrumbs_on_rails_microdata_builder"
|
10
|
+
PKG_VERSION = ENV['PKG_VERSION'] || BreadcrumbsOnRails::VERSION
|
11
|
+
|
12
|
+
|
13
|
+
# Run test by default.
|
14
|
+
task :default => :test
|
15
|
+
|
16
|
+
spec = Gem::Specification.new do |s|
|
17
|
+
s.name = PKG_NAME
|
18
|
+
s.version = PKG_VERSION
|
19
|
+
s.summary = "A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation."
|
20
|
+
s.description = "BreadcrumbsOnRails is a simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project."
|
21
|
+
|
22
|
+
s.author = "Simone Carletti"
|
23
|
+
s.email = "weppos@weppos.net"
|
24
|
+
s.homepage = "http://www.simonecarletti.com/code/breadcrumbs_on_rails"
|
25
|
+
|
26
|
+
s.files = `git ls-files`.split("\n")
|
27
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
28
|
+
s.require_paths = %w( lib )
|
29
|
+
|
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"
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
require 'rubygems/package_task'
|
38
|
+
|
39
|
+
Gem::PackageTask.new(spec) do |pkg|
|
40
|
+
pkg.gem_spec = spec
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Build the gemspec file #{spec.name}.gemspec"
|
44
|
+
task :gemspec do
|
45
|
+
file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
|
46
|
+
File.open(file, "w") {|f| f << spec.to_ruby }
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Remove any temporary products, including gemspec."
|
50
|
+
task :clean => [:clobber] do
|
51
|
+
rm "#{spec.name}.gemspec"
|
52
|
+
end
|
53
|
+
|
54
|
+
desc "Remove any generated file"
|
55
|
+
task :clobber => [:clobber_package]
|
56
|
+
|
57
|
+
desc "Package the library and generates the gemspec"
|
58
|
+
task :package => [:gemspec]
|
59
|
+
|
60
|
+
|
61
|
+
require 'rake/testtask'
|
62
|
+
|
63
|
+
Rake::TestTask.new do |t|
|
64
|
+
t.libs << "test"
|
65
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
66
|
+
t.verbose = !!ENV["VERBOSE"]
|
67
|
+
t.warning = !!ENV["WARNING"]
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
require 'yard'
|
72
|
+
require 'yard/rake/yardoc_task'
|
73
|
+
|
74
|
+
YARD::Rake::YardocTask.new(:yardoc) do |y|
|
75
|
+
y.options = ["--output-dir", "yardoc"]
|
76
|
+
end
|
77
|
+
|
78
|
+
namespace :yardoc do
|
79
|
+
desc "Remove YARD products"
|
80
|
+
task :clobber do
|
81
|
+
rm_r "yardoc" rescue nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
task :clobber => "yardoc:clobber"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "breadcrumbs_on_rails_microdata_builder"
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Simone Carletti"]
|
9
|
+
s.date = "2012-02-03"
|
10
|
+
s.description = "BreadcrumbsOnRails is a simple Ruby on Rails plugin for creating and managing a breadcrumb navigation for a Rails project."
|
11
|
+
s.email = "weppos@weppos.net"
|
12
|
+
s.files = [".gitignore", ".travis.yml", "Appraisals", "CHANGELOG.md", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "breadcrumbs_on_rails_microdata_builder.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_microdata_builder.rb", "lib/breadcrumbs_on_rails_microdata_builder/action_controller.rb", "lib/breadcrumbs_on_rails_microdata_builder/breadcrumbs.rb", "lib/breadcrumbs_on_rails_microdata_builder/railtie.rb", "lib/breadcrumbs_on_rails_microdata_builder/version.rb", "test/test_helper.rb", "test/unit/builder_test.rb", "test/unit/element_test.rb", "test/unit/simple_builder_test.rb"]
|
13
|
+
s.homepage = "http://www.simonecarletti.com/code/breadcrumbs_on_rails"
|
14
|
+
s.require_paths = ["lib"]
|
15
|
+
s.rubygems_version = "1.8.11"
|
16
|
+
s.summary = "A simple Ruby on Rails plugin for creating and managing a breadcrumb navigation."
|
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
|
+
|
19
|
+
if s.respond_to? :specification_version then
|
20
|
+
s.specification_version = 3
|
21
|
+
|
22
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
23
|
+
s.add_development_dependency(%q<rails>, [">= 3.0"])
|
24
|
+
s.add_development_dependency(%q<appraisal>, [">= 0"])
|
25
|
+
s.add_development_dependency(%q<mocha>, ["~> 0.9.10"])
|
26
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
27
|
+
else
|
28
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
29
|
+
s.add_dependency(%q<appraisal>, [">= 0"])
|
30
|
+
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
31
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
32
|
+
end
|
33
|
+
else
|
34
|
+
s.add_dependency(%q<rails>, [">= 3.0"])
|
35
|
+
s.add_dependency(%q<appraisal>, [">= 0"])
|
36
|
+
s.add_dependency(%q<mocha>, ["~> 0.9.10"])
|
37
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
38
|
+
end
|
39
|
+
end
|