fresco 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fresco/runtime/runtime.rb +11 -8
- data/lib/fresco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd942c79d9849d74139fc3131ed90c2700045235c23b2335d015be8ea461341d
|
|
4
|
+
data.tar.gz: 46d0216400936abc8dba1714a7baaa789a20e683c16c84f40a8b4846270bce00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69f53e98611e0f7a3aa719ede3e15f6352fda8d5d630747f7905acbceff5994d87a292f8828fd372cfb233ebbb6a8a87a95ce5ea22cda234eec69f0ce5f81c31
|
|
7
|
+
data.tar.gz: efd3fbbeba1fe34872314080f2f7f91ec7131e53bdb636323201010a5cc41b307a78a84df53c0bb80fc414e720ec27203fcc683a75c1713e95027913a4b4dff6
|
|
@@ -437,8 +437,11 @@ end
|
|
|
437
437
|
# reassigning @port / @workers in their own initialize.
|
|
438
438
|
#
|
|
439
439
|
# `run` dispatches between two modes:
|
|
440
|
-
# serve [-p PORT] [-w N] → HTTP listener (run_server)
|
|
441
|
-
#
|
|
440
|
+
# [serve] [-p PORT] [-w N] → HTTP listener (run_server). `serve` is
|
|
441
|
+
# the default when no subcommand is given,
|
|
442
|
+
# so `./build/app` and `./build/app -p 3030`
|
|
443
|
+
# both boot the server.
|
|
444
|
+
# METHOD PATH [BODY] → one-shot CLI dispatch (kept for smoke tests)
|
|
442
445
|
#
|
|
443
446
|
# ARGV is referenced directly rather than passed through as a method
|
|
444
447
|
# parameter — Spinel infers `ARGV` as its dedicated `sp_Argv` type
|
|
@@ -449,7 +452,7 @@ class Fresco::App
|
|
|
449
452
|
attr_accessor :port, :workers
|
|
450
453
|
|
|
451
454
|
def initialize
|
|
452
|
-
@port =
|
|
455
|
+
@port = 3030
|
|
453
456
|
@workers = 1
|
|
454
457
|
end
|
|
455
458
|
|
|
@@ -468,20 +471,20 @@ class Fresco::App
|
|
|
468
471
|
# `respond_to?` guard keeps no-DB apps working.
|
|
469
472
|
Fresco::Db.boot! if Fresco::Db.respond_to?(:boot!)
|
|
470
473
|
|
|
471
|
-
if ARGV[0] == "
|
|
472
|
-
parse_serve_args
|
|
473
|
-
run_server(port: @port, workers: @workers)
|
|
474
|
-
elsif ARGV[0] == "db:migrate"
|
|
474
|
+
if ARGV[0] == "db:migrate"
|
|
475
475
|
Fresco::DbMigrations.migrate!
|
|
476
476
|
elsif ARGV[0] == "db:rollback"
|
|
477
477
|
Fresco::DbMigrations.rollback!
|
|
478
|
+
elsif ARGV.length == 0 || ARGV[0] == "serve" || ARGV[0].start_with?("-")
|
|
479
|
+
parse_serve_args
|
|
480
|
+
run_server(port: @port, workers: @workers)
|
|
478
481
|
else
|
|
479
482
|
run_cli
|
|
480
483
|
end
|
|
481
484
|
end
|
|
482
485
|
|
|
483
486
|
def parse_serve_args
|
|
484
|
-
i = 1
|
|
487
|
+
i = ARGV[0] == "serve" ? 1 : 0
|
|
485
488
|
while i < ARGV.length
|
|
486
489
|
a = ARGV[i]
|
|
487
490
|
if a == "-p"
|
data/lib/fresco/version.rb
CHANGED