### Home Classes Methods

### In Files

- ext/libv8/checkout.rb

### Methods

- #check_git_svn!
- #checkout!
- #git?

### Files

- Makefile

### Class/Module Index

Quicksearch

- Libv8
- Libv8::Arch
- Libv8::Builder
- Libv8::Checkout
- Libv8::Compiler
- Libv8::Location
- Libv8::Location::MkmfContext
- Libv8::Location::System
- Libv8::Location::System::NotFoundError
- Libv8::Location::Vendor
- Libv8::Location::Vendor::ArchiveNotFound
- Libv8::Make
- Libv8::Paths

No matching classes.

# Libv8::Checkout

### Constants

GYP_SVN
GYP_Source
V8_Source

### Public Instance Methods

check_git_svn!() click to toggle source

    # File ext/libv8/checkout.rb, line 42
    def check_git_svn!
      unless system 'git help svn 2>&1 > /dev/null'
        fail "git-svn not installed!\nPlease install git-svn."
      end
    end

checkout!() click to toggle source

    # File ext/libv8/checkout.rb, line 11
    def checkout!
      # When compiling from a source gem, it's not a git repository anymore and
      # we assume the right code is already checked out.
      return unless git?(V8_Source)

      Dir.chdir(V8_Source) do
        `git fetch`
        `git checkout #{Libv8::VERSION.gsub(/\.\d+$/,'')} -f`
        `rm -f .applied_patches`
      end

      return unless git?(GYP_Source)

      check_git_svn!

      Dir.chdir(GYP_Source) do
        mkf = File.readlines(File.join(V8_Source, 'Makefile'))
        idx = mkf.index {|l| l =~ /#{GYP_SVN}/} + 1
        rev = /--revision (\d+)/.match(mkf[idx])[1]
        `git fetch`
        # --git-dir is needed for older versions of git and git-svn
        `git --git-dir=../../.git/modules/vendor/gyp/ svn init #{GYP_SVN} -Ttrunk`
        `git config --replace-all svn-remote.svn.fetch trunk:refs/remotes/origin/master`
        `git checkout $(git --git-dir=../../.git/modules/vendor/gyp/ svn find-rev r#{rev} | tail -n 1) -f`
      end
    end

git?(dir) click to toggle source

    # File ext/libv8/checkout.rb, line 38
    def git?(dir)
      File.exists?(File.join(dir, '.git'))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.