Skip to content

Commit 515efb9

Browse files
committedOct 24, 2013
Add Template.paths as list of registered templates (#412)
1 parent 1eef4d8 commit 515efb9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
 

‎spec/opal/template/paths_spec.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'spec_helper'
2+
require 'template'
3+
4+
describe Template do
5+
describe ".paths" do
6+
it "should be an array of registered templates" do
7+
Template.paths.should be_kind_of(Array)
8+
end
9+
end
10+
end

‎stdlib/template.rb

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def self.[]=(name, instance)
88
@_cache[name] = instance
99
end
1010

11+
def self.paths
12+
@_cache.keys
13+
end
14+
1115
attr_reader :body
1216

1317
def initialize(name, &body)

0 commit comments

Comments
 (0)
Please sign in to comment.