Skip to content

Commit f7c860f

Browse files
author
Colby Swandale
committed
set engine args in template.yaml directly
1 parent 06bb985 commit f7c860f

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

app/code_executor.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,8 @@ def ruby_bin_path
4242
end
4343

4444
def ruby_args
45-
return "" if disable_args?
45+
return engine_args if engine_args?
4646

47-
args = ["--disable-did_you_mean"]
48-
49-
unless rubygems_required?
50-
args << "--disable-gems"
51-
end
52-
53-
args.join(" ")
47+
"--disable-did_you_mean --disable-gems"
5448
end
5549
end

app/helper.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ def ruby_bin_path
33
ENV["RUBY_BIN"] || `which ruby`.strip
44
end
55

6-
def rubygems_required?
7-
ENV["RUBYGEMS_REQUIRED"] && !ENV["RUBYGEMS_REQUIRED"].empty?
6+
def engine_args?
7+
!engine_args.nil?
88
end
9-
10-
def disable_args?
11-
ENV["DISBALE_RUBY_ARGS"] && !ENV["DISBALE_RUBY_ARGS"].empty?
9+
10+
def engine_args
11+
ENV["ENGINE_ARGS"]
1212
end
1313

1414
def minimal_execution?
15-
ENV["MINIMAL_EXECUTION"] && !ENV["DISBALE_RUBY_ARGS"].empty?
15+
ENV["MINIMAL_EXECUTION"] && !ENV["MINIMAL_EXECUTION"].empty?
1616
end
1717
end

template.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ Resources:
145145
- !Ref JRuby
146146
Environment:
147147
Variables:
148-
RUBYGEMS_REQUIRED: "true"
148+
ENGINE_ARGS: "--dev --disable-did_you_mean"
149+
MINIMAL_EXECUTION: "true"
149150
Events:
150151
HTTP:
151152
Type: Api
@@ -166,7 +167,7 @@ Resources:
166167
- !Ref MRuby
167168
Environment:
168169
Variables:
169-
DISBALE_RUBY_ARGS: "true"
170+
ENGINE_ARGS: ""
170171
MINIMAL_EXECUTION: "true"
171172
Events:
172173
HTTP:
@@ -188,7 +189,7 @@ Resources:
188189
- !Ref MRubyDev
189190
Environment:
190191
Variables:
191-
DISBALE_RUBY_ARGS: "true"
192+
ENGINE_ARGS: ""
192193
MINIMAL_EXECUTION: "true"
193194
Events:
194195
HTTP:
@@ -205,7 +206,7 @@ Resources:
205206
- !Ref ArtichokeRuby
206207
Environment:
207208
Variables:
208-
DISBALE_RUBY_ARGS: "true"
209+
ENGINE_ARGS: ""
209210
MINIMAL_EXECUTION: "true"
210211
Events:
211212
HTTPDev:

0 commit comments

Comments
 (0)