Sha256: 721a627817b015cb5ef7ac3f7c8c2133bcc47b265f84e8fa5f875fc92ea7e8da

Contents?: true

Size: 825 Bytes

Versions: 13

Compression:

Stored size: 825 Bytes

Contents

module Repla
  module REPL
    # REPL view
    class View < Repla::View
      ROOT_ACCESS_DIRECTORY = File.join(File.dirname(__FILE__), '../../')
      HTML_DIRECTORY = File.join(File.dirname(__FILE__), '../html/')
      VIEW_TEMPLATE = File.join(HTML_DIRECTORY, 'index.html')
      def initialize
        super
        self.root_access_directory_path = File.expand_path(
          ROOT_ACCESS_DIRECTORY
        )
        load_file(VIEW_TEMPLATE)
      end

      ADD_INPUT_JAVASCRIPT_FUNCTION = 'WcREPL.addInput'.freeze
      def add_input(input)
        do_javascript_function(ADD_INPUT_JAVASCRIPT_FUNCTION, [input])
      end

      ADD_OUTPUT_JAVASCRIPT_FUNCTION = 'WcREPL.addOutput'.freeze
      def add_output(output)
        do_javascript_function(ADD_OUTPUT_JAVASCRIPT_FUNCTION, [output])
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
repla-0.7.5 lib/repla/repl/lib/view.rb
repla-0.7.4 lib/repla/repl/lib/view.rb
repla-0.7.3 lib/repla/repl/lib/view.rb
repla-0.7.2 lib/repla/repl/lib/view.rb
repla-0.7.1 lib/repla/repl/lib/view.rb
repla-0.7.0 lib/repla/repl/lib/view.rb
repla-0.6.2 lib/repla/repl/lib/view.rb
repla-0.6.1 lib/repla/repl/lib/view.rb
repla-0.6.0 lib/repla/repl/lib/view.rb
repla-0.5.3 lib/repla/repl/lib/view.rb
repla-0.5.2 lib/repla/repl/lib/view.rb
repla-0.5.1 lib/repla/repl/lib/view.rb
repla-0.5.0 lib/repla/repl/lib/view.rb