push
github
3 of 3 new or added lines in 1 file covered. (100.0%)
3 existing lines in 3 files now uncovered.2818 of 3081 relevant lines covered (91.46%)
586.2 hits per line
1 |
module Trestle |
13✔ |
2 |
module Controller |
13✔ |
3 |
module Toolbars |
13✔ |
4 |
extend ActiveSupport::Concern |
13✔ |
5 |
|
|
6 |
included do
|
13✔ |
7 |
helper_method :toolbars
|
13✔ |
8 |
helper_method :toolbar
|
13✔ |
9 |
end
|
|
10 |
|
|
11 |
protected |
13✔ |
12 |
def toolbars |
13✔ |
13 |
@_toolbars ||= {}
|
1,924✔ |
14 |
end
|
|
15 |
|
|
16 |
def toolbar(name, options={}, &block) |
13✔ |
17 |
builder = options[:builder] || default_toolbar_builder
|
1,924✔ |
18 |
|
|
19 |
toolbar = (toolbars[name.to_s] ||= Toolbar.new(builder))
|
1,924✔ |
20 |
toolbar.clear! if options[:clear] |
1,924✔ |
21 |
toolbar.append(&block) if block_given?
|
1,924✔ |
22 |
toolbar |
1,924✔ |
23 |
end
|
|
24 |
|
|
25 |
def default_toolbar_builder |
13✔ |
UNCOV
26
|
Toolbar::Builder |
× |
27 |
end
|
|
28 |
end
|
|
29 |
end
|
|
30 |
end
|