Top Level Namespace

Defined Under Namespace

Modules: Prism

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.



28
29
30
31
32
33
34
# File 'ext/prism/extconf.rb', line 28

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(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.`



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

def make(target)
  Dir.chdir(File.expand_path("../..", __dir__)) do
    system("make", target, exception: true)
  end
end