Class: ExecJS::FastNode::ExternalPipedRuntime

Inherits:
Runtime
  • Object
show all
Defined in:
lib/execjs/fastnode/external_piped_runtime.rb

Defined Under Namespace

Classes: Context, VM, VMCommand

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ExternalPipedRuntime

Returns a new instance of ExternalPipedRuntime.



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 174

def initialize(options)
  @name        = options[:name]
  @command     = Command.new(options[:command])
  @runner_path = options[:runner_path]
  @encoding    = options[:encoding]
  @deprecated  = !!options[:deprecated]
  @binary      = nil

  @vm = VM.new(
    binary: binary,
    runner_path: @runner_path
  )

  @popen_options = {}
  @popen_options[:external_encoding] = @encoding if @encoding
  @popen_options[:internal_encoding] = ::Encoding.default_internal || 'UTF-8'
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



172
173
174
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 172

def name
  @name
end

#vmObject (readonly)

Returns the value of attribute vm.



172
173
174
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 172

def vm
  @vm
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


192
193
194
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 192

def available?
  binary ? true : false
end

#deprecated?Boolean

Returns:

  • (Boolean)


196
197
198
# File 'lib/execjs/fastnode/external_piped_runtime.rb', line 196

def deprecated?
  @deprecated
end