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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96b93d566a20abf860f206f125b6de7cb4a8cdc079ac728336de53fdd5079037
4
- data.tar.gz: 7c1957106146bfb12a0ea92d1da5e1ac22ff8a1ddb193da1d0620716b24467e0
3
+ metadata.gz: cd942c79d9849d74139fc3131ed90c2700045235c23b2335d015be8ea461341d
4
+ data.tar.gz: 46d0216400936abc8dba1714a7baaa789a20e683c16c84f40a8b4846270bce00
5
5
  SHA512:
6
- metadata.gz: 382422c87387db4558b624ae46c16fb580f2f24964e4fa1a414f8f875aa244552ee241df90700291de506ae97b268da2ffe6e94bdaed20811be252058554761e
7
- data.tar.gz: 7e11baa9149d08133ce3b2afcc1ff932183e7d1bddfa66eab199b7ba2ca8e237f81e7ee634562b2357243cd35f47fd22e0804e29de508be493e1fe58346f7793
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
- # METHOD PATH [BODY] → one-shot CLI dispatch (kept for smoke tests)
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 = 3000
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] == "serve"
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"
@@ -1,3 +1,3 @@
1
1
  module Fresco
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fresco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Fomera