Module: Calltally::Erb
- Defined in:
- lib/calltally/erb.rb,
lib/calltally/erb/version.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Class Method Details
.setup ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/calltally/erb.rb', line 9 def self.setup require "calltally/plugin" require "herb" Calltally::Plugin.register(".erb") do |path, src, _cfg| begin ruby_code = Herb.extract_ruby(src) ruby_code.strip.empty? ? nil : ruby_code rescue => e warn "Error processing ERB file #{path}: #{e.}" nil end end rescue LoadError => e if e..include?("calltally/plugin") warn "calltally-erb requires calltally with plugin support" elsif e..include?("herb") warn "calltally-erb requires 'herb' gem. Install with: gem install herb" else warn "calltally-erb failed to load: #{e.}" end end |