aboutsummaryrefslogtreecommitdiff
path: root/lux-ruby
diff options
context:
space:
mode:
authorEduardo Julian2021-11-29 17:53:01 -0400
committerEduardo Julian2021-11-29 17:53:01 -0400
commit13323c55a4d34ddb74b67fab684d4431f9624dd1 (patch)
tree2d5912a5a50640176507b8274293980c0376475b /lux-ruby
parentbd6ff5014b4d9fad6c6fa6ab3a2e30fc768687e1 (diff)
New packaging for Ruby programs.
Diffstat (limited to 'lux-ruby')
-rw-r--r--lux-ruby/source/program.lux58
1 files changed, 31 insertions, 27 deletions
diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux
index 9aa71067f..3a55ccafc 100644
--- a/lux-ruby/source/program.lux
+++ b/lux-ruby/source/program.lux
@@ -67,7 +67,7 @@
[meta
[archive {"+" Archive}]
["[0]" packager "_"
- ["[1]" script]]]]]]]
+ ["[1]" ruby]]]]]]]
[program
["/" compositor
["/[0]" cli]
@@ -870,9 +870,16 @@
(def: (program context program)
(Program _.Expression _.Statement)
- (_.statement (_.apply_lambda/* (list (runtime.lux//program_args _.command_line_arguments)
- _.nil)
- program)))
+ (let [normal_runtime? (_.do "const_defined?"
+ (list (_.string (_.code _.command_line_arguments)))
+ {.#None}
+ (_.local "Object"))]
+ (_.statement
+ (_.apply_lambda/* (list (runtime.lux//program_args (_.? normal_runtime?
+ _.command_line_arguments
+ (_.array (list))))
+ _.nil)
+ program))))
(def: (declare_success! _)
(-> Any (Async Any))
@@ -880,27 +887,24 @@
(program: [service /cli.service]
(let [extension ".rb"]
- (exec (do async.monad
- [_ (/.compiler [/static.#host @.ruby
- /static.#host_module_extension extension
- /static.#target (/cli.target service)
- /static.#artifact_extension extension]
- ..expander
- analysis.bundle
- ..platform
- generation.bundle
- (function.constant extension/bundle.empty)
- ..program
- [Register _.Expression _.Statement]
- ..extender
- service
- [(packager.package (: _.Statement (_.manual ""))
- _.code
- _.then
- (|>>))
- (format (/cli.target service)
- (# file.default separator)
- "program"
- extension)])]
- (..declare_success! []))
+ (exec
+ (do async.monad
+ [_ (/.compiler [/static.#host @.ruby
+ /static.#host_module_extension extension
+ /static.#target (/cli.target service)
+ /static.#artifact_extension extension]
+ ..expander
+ analysis.bundle
+ ..platform
+ generation.bundle
+ (function.constant extension/bundle.empty)
+ ..program
+ [Register _.Expression _.Statement]
+ ..extender
+ service
+ [packager.package
+ (format (/cli.target service)
+ (# file.default separator)
+ "program")])]
+ (..declare_success! []))
(io.io []))))