legionio 1.4.11 → 1.4.13

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: fa83ccdc411667736211ccc2800f59117768c6036fe0f8c4f3700d5a021f4652
4
- data.tar.gz: e37221768c4808c2846183b5ec13a94eb97a253b7d36f31f253fd260c167317b
3
+ metadata.gz: 8b61599f64cd23e52b9cbf85631dce4bdb16afeec87b5022229e7ae63f664917
4
+ data.tar.gz: 339df852d48a4ce9eddc92d1a8fd6c3240bda51f7d91f258352a6bc021aea2f0
5
5
  SHA512:
6
- metadata.gz: 198f253e147cf8296c5f2e483af8185bbe139fd8344e7b8893042b5ad72247692c6474421498daa3263f7582c8f9b5a2b4699ad95a4820686f8414eedd95d4ea
7
- data.tar.gz: 8204c9f0c0d7483d92f3eb6e4fa04597fa26480216f6fd371a14ebe5c49df991f7c109424f7104a766d1946c7889010256b8ab72e5ba9e247fdb4c396ffd60c6
6
+ metadata.gz: bbb574075f5512af6a3783acb5bf02d666cf94eb959ac9827639e3bfb29467b1c97ad0d2d562e8318b173e3eaaf73a1ad2db7aaa29957f1682ffd0076dfaa27d
7
+ data.tar.gz: 2e4dd37e3f3a7e4520d4b270998a2df0eb1e51accc235061b0974fad27977895e7e29064a6af671b003462815a143081c808fd938e0e4b11eda2823de5416c8d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Legion Changelog
2
2
 
3
+ ## [1.4.13] - 2026-03-16
4
+
5
+ ### Changed
6
+ - SIGHUP signal now triggers `Legion.reload` instead of logging only
7
+
8
+ ## [1.4.12] - 2026-03-16
9
+
10
+ ### Added
11
+ - `--http-port` CLI flag for `legion start` to override API port without editing settings
12
+ - `apply_cli_overrides` method in `Service` applies CLI-provided overrides after settings load
13
+
3
14
  ## [1.4.11] - 2026-03-16
4
15
 
5
16
  ### Fixed
data/CLAUDE.md CHANGED
@@ -9,7 +9,7 @@ The primary gem for the LegionIO framework. An extensible async job engine for s
9
9
 
10
10
  **GitHub**: https://github.com/LegionIO/LegionIO
11
11
  **Gem**: `legionio`
12
- **Version**: 1.4.9
12
+ **Version**: 1.4.13
13
13
  **License**: Apache-2.0
14
14
  **Docker**: `legionio/legion`
15
15
  **Ruby**: >= 3.4
@@ -229,7 +229,7 @@ After loading, each extension calls `autobuild` then publishes a `LexRegister` m
229
229
  ```
230
230
  legion
231
231
  version # Component versions + installed extension count
232
- start [-d] [-p PID] [-l LOG] [-t SECS] [--log-level info]
232
+ start [-d] [-p PID] [-l LOG] [-t SECS] [--log-level info] [--http-port PORT]
233
233
  stop [-p PID] [--signal INT]
234
234
  status
235
235
  check [--extensions] [--full] # exit code 0/1
data/README.md CHANGED
@@ -92,6 +92,7 @@ Everything runs through `legion`:
92
92
  ```bash
93
93
  legion start # foreground
94
94
  legion start -d # daemonize
95
+ legion start --http-port 8080 # custom API port
95
96
  legion status # service status
96
97
  legion stop # graceful shutdown
97
98
  legion check # smoke-test all connections
@@ -14,7 +14,9 @@ module Legion
14
14
  clear_log_file unless options[:daemonize]
15
15
 
16
16
  api = options.fetch(:api, true)
17
- Legion.instance_variable_set(:@service, Legion::Service.new(log_level: log_level, api: api))
17
+ service_opts = { log_level: log_level, api: api }
18
+ service_opts[:http_port] = options[:http_port] if options[:http_port]
19
+ Legion.instance_variable_set(:@service, Legion::Service.new(**service_opts))
18
20
  Legion::Logging.info("Started Legion v#{Legion::VERSION}")
19
21
 
20
22
  process_opts = {
data/lib/legion/cli.rb CHANGED
@@ -79,6 +79,7 @@ module Legion
79
79
  option :time_limit, type: :numeric, aliases: ['-t'], desc: 'Run for N seconds then exit'
80
80
  option :log_level, type: :string, default: 'info', desc: 'Log level (debug, info, warn, error)'
81
81
  option :api, type: :boolean, default: true, desc: 'Start the HTTP API server'
82
+ option :http_port, type: :numeric, desc: 'HTTP API port (overrides settings)'
82
83
  def start
83
84
  Legion::CLI::Start.run(options)
84
85
  end
@@ -117,7 +117,8 @@ module Legion
117
117
  end
118
118
 
119
119
  trap('SIGHUP') do
120
- info 'sighup'
120
+ info 'sighup: triggering reload'
121
+ Thread.new { Legion.reload }
121
122
  end
122
123
 
123
124
  trap('SIGINT') do
@@ -10,10 +10,12 @@ module Legion
10
10
  base.freeze
11
11
  end
12
12
 
13
- def initialize(transport: true, cache: true, data: true, supervision: true, extensions: true, crypt: true, api: true, llm: true, log_level: 'info') # rubocop:disable Metrics/ParameterLists
13
+ def initialize(transport: true, cache: true, data: true, supervision: true, extensions: true, # rubocop:disable Metrics/ParameterLists
14
+ crypt: true, api: true, llm: true, log_level: 'info', http_port: nil)
14
15
  setup_logging(log_level: log_level)
15
16
  Legion::Logging.debug('Starting Legion::Service')
16
17
  setup_settings
18
+ apply_cli_overrides(http_port: http_port)
17
19
  reconfigure_logging(log_level)
18
20
  Legion::Logging.info("node name: #{Legion::Settings[:client][:name]}")
19
21
 
@@ -99,6 +101,14 @@ module Legion
99
101
  Legion::Logging.info('Legion::Settings Loaded')
100
102
  end
101
103
 
104
+ def apply_cli_overrides(http_port: nil)
105
+ return unless http_port
106
+
107
+ Legion::Settings[:api] ||= {}
108
+ Legion::Settings[:api][:port] = http_port
109
+ Legion::Logging.info "CLI override: API port set to #{http_port}"
110
+ end
111
+
102
112
  def setup_logging(log_level: 'info', **_opts)
103
113
  require 'legion/logging'
104
114
  Legion::Logging.setup(log_level: log_level, level: log_level, trace: true)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Legion
4
- VERSION = '1.4.11'
4
+ VERSION = '1.4.13'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legionio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.11
4
+ version: 1.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity