Skip to content

Commit 63a99aa

Browse files
committedJun 16, 2014
Register Builder processors using .inherited() hook
1 parent c07416f commit 63a99aa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

Diff for: ‎lib/opal/builder.rb

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module Opal
66
class Builder
77
include BuilderProcessors
88

9-
DEFAULT_PROCESSORS = [RubyProcessor, JsProcessor, ERBProcessor]
10-
119
def initialize(options = nil)
1210
(options || {}).each_pair do |k,v|
1311
public_send("#{k}=", v)

Diff for: ‎lib/opal/builder_processors.rb

+6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
module Opal
55
module BuilderProcessors
6+
DEFAULT_PROCESSORS = []
7+
68
class Processor
9+
def self.inherited(processor)
10+
DEFAULT_PROCESSORS << processor
11+
end
12+
713
def initialize(source, filename, options = {})
814
@source, @filename, @options = source, filename, options
915
@requires = []

0 commit comments

Comments
 (0)
Please sign in to comment.