rails_crumbs 0.0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDk3NjEyZDJmMzQyNjc3YTFlZmE2MDk2MWRiY2UxZDc2ODI2MWJjNA==
5
+ data.tar.gz: !binary |-
6
+ YWJmNWI0NjhjMmUyYjU5MDQ2ZDQ3YjVjYTAwMTVjMDVmYzQ0MDU5NQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZjM5MWQ1ZDE0OTdkMzhhNTIwMjRhNTM2Njg3OWJiZTkwYzNkOWQxMThjNTQy
10
+ YWIwOWE4MzE4ZDMxNzUxMjA1YWE3ZjlkMjYyNTQzZjM1OGEzOWY2OTAxZjNl
11
+ NGNhNDc5NTM4MjJiZTNkZjEyMWMwNWU3NWI4ZThhZmI2ZTNkYzQ=
12
+ data.tar.gz: !binary |-
13
+ ODlkNmRkNGM4NTk3YzNmMTVlYjFlMGVkYjIzNzM5ZTVmOWU3YWZkZjNkMjZh
14
+ ZTExNDJmYzBlZTA3MjgxMGFjMmY0YTk5MjM2NThkYTUwMDNiNzAwN2FhZTRj
15
+ YWU2ZDU3Yjg0ZDVmNWMyOWNjOGY0NjE3NDExNGVhMWNhMjljMWQ=
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea
7
+ .DS_Store
8
+ Gemfile.lock
9
+ InstalledFiles
10
+ _yardoc
11
+ coverage
12
+ doc/
13
+ lib/bundler/man
14
+ pkg
15
+ rdoc
16
+ spec/reports
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rails_crumbs.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Patricio Beckmann
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,29 @@
1
+ # Railscrumbs
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'Railscrumbs'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install Railscrumbs
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,33 @@
1
+ module RailsCrumbs
2
+ module RailsCrumbsController
3
+
4
+ def set_railscrumb(name, path, options = {})
5
+ self.railscrumbs << Crumb.new(name, path, options)
6
+ end
7
+
8
+ def railscrumbs
9
+ @railscrumbs ||= []
10
+ end
11
+
12
+ def self.included(base)
13
+ base.send(:extend, ClassMethods)
14
+ end
15
+
16
+ module ClassMethods
17
+ def set_railscrumb(name, path = nil, options = {})
18
+ only = options.delete(:only){ [] }
19
+ if only.empty?
20
+ filter_options = {}
21
+ else
22
+ filter_options = {:only => only}
23
+ end
24
+
25
+ before_filter(filter_options) do |controller|
26
+ controller.send(:set_railscrumb, name, path, options)
27
+ end
28
+ end
29
+
30
+ end
31
+
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ module RailsCrumbs
2
+ class Crumb
3
+ attr_accessor :name
4
+ attr_accessor :path
5
+ attr_accessor :options
6
+
7
+ def initialize(name, path = nil, options = {})
8
+ self.name = name
9
+ self.path = path
10
+ self.options = options
11
+ end
12
+
13
+ private
14
+
15
+ def method_missing(name, *args)
16
+ if options.has_key? name.to_sym
17
+ options[name.to_sym]
18
+ else
19
+ super(name, *args)
20
+ end
21
+ end
22
+
23
+
24
+
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ module RailsCrumbs
2
+ class Engine < Rails::Engine
3
+ initializer 'Setup Controller' do
4
+ ActionController::Base.send(:include, RailsCrumbs::RailsCrumbsController)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module RailsCrumbs
2
+ module RailsCrumbsHelper
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module RailsCrumbs
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,5 @@
1
+ require 'rails_crumbs/version'
2
+ require 'rails_crumbs/crumbs'
3
+ #require 'rails_crumbs/helper'
4
+ require 'rails_crumbs/controller'
5
+ require 'rails_crumbs/engine'
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/rails_crumbs/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+
6
+ gem.authors = ['Patricio Beckmann']
7
+ gem.email = ['pato.beckmann@gmail.com']
8
+ gem.description = %q{Breadcrumbs for Rails}
9
+ gem.summary = %q{Breadcrumbs for Rails}
10
+ gem.homepage = 'https://github.com/Weyker/Railscrumbs.git'
11
+
12
+ gem.files = `git ls-files`.split("\n")
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+
15
+ gem.name = 'rails_crumbs'
16
+ gem.require_paths = ['lib']
17
+ gem.version = RailsCrumbs::VERSION.dup
18
+ gem.platform = Gem::Platform::RUBY
19
+
20
+ gem.add_dependency 'railties'
21
+
22
+ gem.add_development_dependency 'bundler', '>= 1.0'
23
+ gem.add_development_dependency 'rails', '>= 3.1'
24
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_crumbs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Patricio Beckmann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '3.1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '3.1'
55
+ description: Breadcrumbs for Rails
56
+ email:
57
+ - pato.beckmann@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/rails_crumbs.rb
68
+ - lib/rails_crumbs/controller.rb
69
+ - lib/rails_crumbs/crumbs.rb
70
+ - lib/rails_crumbs/engine.rb
71
+ - lib/rails_crumbs/helper.rb
72
+ - lib/rails_crumbs/version.rb
73
+ - rails_crumbs.gemspec
74
+ homepage: https://github.com/Weyker/Railscrumbs.git
75
+ licenses: []
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.1.11
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Breadcrumbs for Rails
97
+ test_files: []