Top Level Namespace

Defined Under Namespace

Modules: Prism

Constant Summary collapse

Ripper =

This writes the prism ripper translation into the Ripper constant so that users can transparently use Ripper without any changes.

Prism::Translation::Ripper

Instance Method Summary collapse

Instance Method Details

#generate_templatesObject

If this gem is being build from a git source, then we need to run templating if it hasn’t been run yet. In normal packaging, we would have shipped the templated files with the gem, so this wouldn’t be necessary.



37
38
39
40
41
42
43
# File 'ext/prism/extconf.rb', line 37

def generate_templates
  Dir.chdir(File.expand_path("../..", __dir__)) do
    if !File.exist?("include/prism/ast.h") && Dir.exist?(".git")
      system("templates/template.rb", exception: true)
    end
  end
end

#make(env, target) ⇒ Object

Runs ‘make` in the root directory of the project. Note that this is the `Makefile` for the overall project, not the `Makefile` that is being generated by this script.`



48
49
50
51
52
53
54
55
56
57
58
# File 'ext/prism/extconf.rb', line 48

def make(env, target)
  puts "Running make #{target} with #{env.inspect}"
  Dir.chdir(File.expand_path("../..", __dir__)) do
    system(
      env,
      RUBY_PLATFORM.match?(/openbsd|freebsd/) ? "gmake" : "make",
      target,
      exception: true
    )
  end
end