-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathcrummy.rb
69 lines (62 loc) · 1.81 KB
/
crummy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module Crummy
def self.configuration
@configuration ||= Configuration.new
end
def self.configure
yield configuration
end
class Configuration
attr_accessor :format
attr_accessor :links
attr_accessor :skip_if_blank
attr_accessor :html_separator
attr_accessor :html_right_separator
attr_accessor :xml_separator
attr_accessor :xml_right_separator
attr_accessor :html_list_separator
attr_accessor :html_list_right_separator
attr_accessor :first_class
attr_accessor :last_class
attr_accessor :ol_id
attr_accessor :ol_class
attr_accessor :li_class
attr_accessor :microdata
attr_accessor :last_crumb_linked
attr_accessor :truncate
attr_accessor :right_side
def initialize
@format = :html
@html_separator = " » ".html_safe
@html_right_separator = " » ".html_safe
@xml_separator = "crumb"
@xml_right_separator = "crumb"
@html_list_separator = ''
@html_list_right_separator = ''
@skip_if_blank = true
@links = true
@first_class = ''
@last_class = ''
@ol_id = ''
@ol_class = ''
@li_class = ''
@microdata = false
@last_crumb_linked = true
@truncate = nil
@right_side = false
end
def active_li_class=(class_name)
puts "CRUMMY: The 'active_li_class' option is DEPRECATED and will be removed from a future version"
end
def active_li_class
puts "CRUMMY: The 'active_li_class' option is DEPRECATED and will be removed from a future version"
end
end
if defined?(Rails::Railtie)
require 'crummy/railtie'
else
require 'crummy/action_controller'
require 'crummy/action_view'
ActionController::Base.send :include, Crummy::ControllerMethods
ActionView::Base.send :include, Crummy::ViewMethods
end
end