Module: Ngannotate::ProcessorCommon::ClassMethods

Defined in:
lib/ngannotate/processor_common.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



8
9
10
# File 'lib/ngannotate/processor_common.rb', line 8

def name
  'Ngannotate::Processor'
end

#shared_exec_contextObject



12
13
14
15
16
17
18
19
# File 'lib/ngannotate/processor_common.rb', line 12

def shared_exec_context
  @shared_exec_context ||=
    begin
      ::Rails.logger.info "ng-prepare"
      ngannotate_source = File.open(File.expand_path('../../../vendor/ngannotate.js', __FILE__)).read
      ExecJS.compile "window = {};" + ngannotate_source
    end
end