Sha256: 6749eaf6ff9be7f343bc89dac8d4e2bcafe538f9f60782f9cb67ddf241782259

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 Bytes

Contents

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

      def initialize(path)
        @path = path
      end

      def name
        File.basename @path
      end

      def to_s
        @path
      end

      def version
        call('-v')[0..1].join =~ VERSION_REGEXP
        $1
      end

      def target
        call('-v')[0..1].join =~ TARGET_REGEXP
        $1
      end

      def compatible?
        false
      end

      def call(*arguments)
        Open3.capture3 arguments.unshift('env LC_ALL=en', @path).join(' ')
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
libv8-tmpfork-3.16.14.13 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.13 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.12 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.11 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.10 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.8 ext/libv8/compiler/generic_compiler.rb
libv8-3.16.14.8.rc1 ext/libv8/compiler/generic_compiler.rb