Sha256: 7ebf77e9d2512f4dcc63b9af4b956eb752109e5123b0772ce4bd99334708c360

Contents?: true

Size: 918 Bytes

Versions: 20

Compression:

Stored size: 918 Bytes

Contents

module OMF::Web; module Widget; module Code
end; end; end

require 'omf-web/widget/code/code_widget'

module OMF::Web::Widget::Code
  
  @@scripts = []
  @@sessions = {}
  
  def self.configure(options = {})
    opts = options.dup
    opts[:scripts] = @@scripts
  
    currDir = File.dirname(__FILE__)
    opts[:resourcePath].insert(0, currDir)
  end
  
  # Register a script which can be visualized through a +CodeWidget+
  #
  # name - Name of script
  # opts -
  #   :???
  # 
  def self.addCode(name, opts = {})
    
    opts[:name] = name
    opts[:widget_class] = OMF::Web::Widget::Code::CodeWidget 
    @@scripts << opts #CodeDescription.new(name, opts)
    opts
  end
  
  def self.[](id)
    @@scripts[id]
  end        
  
  def self.count
    @@scripts.length
  end        
  
  def self.each_with_index
    @@scripts.each_index do |i|
      yield @@scripts[i], i
    end
  end
end # OMF::Web::Widget::Code

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
omf_web-1.2.9 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.8 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.7 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.6 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.5 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.4 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.3 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.2 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.1 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.2.0 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-1.0.0 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.9 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.8 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.7 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.6 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.5 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.4 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.3 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9.1 lib/omf-web/widget/UNUSED/code/code.rb
omf_web-0.9 lib/omf-web/widget/UNUSED/code/code.rb