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
- #add_libprism_source(path) ⇒ Object
-
#generate_templates ⇒ Object
If this gem is being build from a git source, then we need to run templating if it hasn’t been run yet.
-
#make(env, target) ⇒ Object
Runs ‘make` in the root directory of the project.
- #src_list(path) ⇒ Object
Instance Method Details
#add_libprism_source(path) ⇒ Object
116 117 118 119 |
# File 'ext/prism/extconf.rb', line 116 def add_libprism_source(path) $VPATH << path src_list path end |
#generate_templates ⇒ Object
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.("../..", __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.("../..", __dir__)) do system( env, RUBY_PLATFORM.match?(/openbsd|freebsd/) ? "gmake" : "make", target, exception: true ) end end |
#src_list(path) ⇒ Object
110 111 112 113 114 |
# File 'ext/prism/extconf.rb', line 110 def src_list(path) srcdir = path.dup RbConfig.(srcdir) # mutates srcdir :-/ Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")] end |