40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/redjs/sprockets/base.rb', line 40
def register ( sprockets )
sprockets.append_path RedJS::JAVASCRIPTS_PATH
auto_usage_paths.each { | auto_usage | sprockets.prepend_path auto_usage }
sprockets.register_postprocessor @mime_type, @extention do | context, data |
path = context.pathname.to_s
if path !~ /\.red[^\/]*$/ && auto_usage_paths.any? { | auto_usage | path.include?( auto_usage.to_s ) }
@processor.call context, data
else
data
end
end
end
|