Sha256: 40378f18b9a07341324e53de85e2071b63f65419623ea471f14c790d3736df1a

Contents?: true

Size: 967 Bytes

Versions: 20

Compression:

Stored size: 967 Bytes

Contents

module Libv8
  module Compiler
    class GenericCompiler
      GENERIC_VERSION_REGEXP = /(\d+\.\d+(\.\d+)*)/
      GENERIC_TARGET_REGEXP = /Target: ([a-z0-9\-_.]*)/

      def initialize(command)
        @command = command
      end

      def name
        File.basename @command
      end

      def to_s
        @command
      end

      def version
        version_string =~ version_regexp
        $1
      end

      def target
        version_string =~ target_regexp
        $1
      end

      def compatible?
        false
      end

      def call(*arguments)
        Compiler::execute_command arguments.unshift(@command).join(' ')
      end

      private

      def version_string
        begin
          Compiler::version_string_of @command
        rescue StandardError
          nil
        end
      end

      def version_regexp
        GENERIC_VERSION_REGEXP
      end

      def target_regexp
        GENERIC_TARGET_REGEXP
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
libv8-3.16.14.19.1 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.19 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.18 ext/libv8/compiler/generic_compiler.rb
arcabouco-0.2.13 vendor/bundle/gems/libv8-3.16.14.17/ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.17 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.16 ext/libv8/compiler/generic_compiler.rb
libv8-5.1.281.59.1 ext/libv8/compiler/generic_compiler.rb
libv8-5.1.281.59.0 ext/libv8/compiler/generic_compiler.rb
libv8-5.1.281.59.0beta3 ext/libv8/compiler/generic_compiler.rb
libv8-5.0.71.48.3 ext/libv8/compiler/generic_compiler.rb
libv8-5.0.71.48.2 ext/libv8/compiler/generic_compiler.rb
libv8-5.0.71.48.0beta2 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.15 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.14 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.5 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.4 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.3 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.2 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.1 ext/libv8/compiler/generic_compiler.rb
libv8-4.5.95.0 ext/libv8/compiler/generic_compiler.rb