|
4 | 4 | require_relative "../../lib/herb/bootstrap" |
5 | 5 |
|
6 | 6 | extension_name = "herb" |
7 | | -git_build = false |
8 | 7 |
|
9 | | -unless Herb::Bootstrap.templates_generated? |
10 | | - puts "Generated files not found — running template generation..." |
11 | | - git_build = true |
12 | | - Herb::Bootstrap.generate_templates |
13 | | -end |
| 8 | +if Herb::Bootstrap.git_source? |
| 9 | + unless Herb::Bootstrap.templates_generated? |
| 10 | + puts "Generated files not found — running template generation..." |
| 11 | + Herb::Bootstrap.generate_templates |
| 12 | + end |
14 | 13 |
|
15 | | -unless Herb::Bootstrap.prism_vendored? |
16 | | - prism_path = Herb::Bootstrap.find_prism_gem_path |
| 14 | + unless Herb::Bootstrap.prism_vendored? |
| 15 | + prism_path = Herb::Bootstrap.find_prism_gem_path |
17 | 16 |
|
18 | | - abort <<~MSG unless prism_path |
19 | | - ERROR: Could not find Prism C source files. |
| 17 | + abort <<~MSG unless prism_path |
| 18 | + ERROR: Could not find Prism C source files. |
20 | 19 |
|
21 | | - When installing Herb from a git source, a git-sourced Prism is required |
22 | | - (the released gem does not include C source files). |
| 20 | + When installing Herb from a git source, a git-sourced Prism is required |
| 21 | + (the released gem does not include C source files). |
23 | 22 |
|
24 | | - Add it to your Gemfile before the herb git reference: |
| 23 | + Add it to your Gemfile before the herb git reference: |
25 | 24 |
|
26 | | - gem "prism", github: "ruby/prism", tag: "v1.9.0" |
27 | | - gem "herb", github: "...", branch: "..." |
| 25 | + gem "prism", github: "ruby/prism", tag: "v1.9.0" |
| 26 | + gem "herb", github: "...", branch: "..." |
28 | 27 |
|
29 | | - Then run `bundle install` again. |
30 | | - MSG |
| 28 | + Then run `bundle install` again. |
| 29 | + MSG |
31 | 30 |
|
32 | | - puts "Vendoring Prism from #{prism_path}..." |
33 | | - git_build = true |
34 | | - Herb::Bootstrap.vendor_prism(prism_gem_path: prism_path) |
35 | | -end |
| 31 | + puts "Vendoring Prism from #{prism_path}..." |
| 32 | + Herb::Bootstrap.vendor_prism(prism_gem_path: prism_path) |
| 33 | + end |
36 | 34 |
|
37 | | -if git_build |
38 | 35 | root_path = Herb::Bootstrap::ROOT_PATH |
39 | 36 | sha = `git -C #{root_path} rev-parse --short HEAD 2>/dev/null`.strip |
40 | 37 |
|
|
0 commit comments