ea 0.2.2 → 0.2.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: 1362d22da8352d2cb6efa171e14fdceffadaedd82c4d4df4c900266a5ea73183
4
- data.tar.gz: bfc5a81f1c31070129e2f46bc97873d0018684bcbdf130c80955c71bd4d2073d
3
+ metadata.gz: f8f192a675161ee0323d85e4f5dc940fc37e094f0816886e9181aed00f18eab8
4
+ data.tar.gz: 2796eff4e85e92713ce7a527f6a1e7ea59f9bd6617a651ab2a8bac0d5c3110a1
5
5
  SHA512:
6
- metadata.gz: 66bed01d2da731f6c33e85e6209ffc020fc973e3bd7083c2aa207a5723f795167a3a45b90ed711f08ed4bd184f459972e2f3c4d8915dfb13122c9a7475748bd6
7
- data.tar.gz: cc3193c4a39027ac5ff70946b2e3dd4b29ce0b6ae51dbed5112b59e74d87fcfb93a97a4c40393eade0408fcc0dabea2e97b41a54f201d2b1de598eae1e98e33d
6
+ metadata.gz: 4ef5196f4c81d1301b97673e7ac5b06cd1ec315add8ed29ebf10200ba28d93b95d8811cca733187517d963939d3337e3831ef186b92ccb554b2164c7dfb9b763
7
+ data.tar.gz: 14363312e481597efc0cdf31f0eb2c5b57e0d6c810bfea575ea71fcd9cbaba2e02804b2d2d09a5aabee27f70522aa1289f96e5089aab884d138aa0e190810bcc
data/lib/ea/cli/app.rb CHANGED
@@ -5,6 +5,18 @@ require "thor"
5
5
  module Ea
6
6
  module Cli
7
7
  class App < Thor
8
+ # Shared kwargs for any command that writes to a file. Keeping
9
+ # the short-form alias in one place makes the CLI surface
10
+ # consistent and the convention a single source of truth:
11
+ # changing `-o` everywhere is a one-line edit, not a per-command
12
+ # search, and every output-bearing command honours the same flag.
13
+ OUTPUT_OPTION = { type: :string, aliases: :o }.freeze
14
+
15
+ # Shared kwargs for any command that accepts a YAML config file.
16
+ # Matches the OUTPUT_OPTION pattern so adding config-file support
17
+ # to another command is a one-line addition.
18
+ CONFIG_OPTION = { type: :string, aliases: :c }.freeze
19
+
8
20
  class << self
9
21
  def exit_on_failure?
10
22
  true
@@ -28,7 +40,7 @@ module Ea
28
40
  desc "diagrams ACTION FILE [NAME]",
29
41
  "Diagram operations: list FILE | extract NAME FILE"
30
42
  option :format, type: :string, default: "table"
31
- option :output, type: :string, desc: "Output path (extract only)"
43
+ option :output, **OUTPUT_OPTION, desc: "Output path (extract only)"
32
44
  def diagrams(action, file = nil, name = nil)
33
45
  Command::Diagrams
34
46
  .new(action: action, file: file, name: name, **symbolize(options))
@@ -56,15 +68,18 @@ module Ea
56
68
 
57
69
  desc "convert FILE", "Convert between EA formats (e.g. QEA → XMI)"
58
70
  option :to, type: :string, required: true, desc: "Target format: xmi"
59
- option :output, type: :string, desc: "Output path"
71
+ option :output, **OUTPUT_OPTION, desc: "Output path"
60
72
  option :format, type: :string, default: "table"
61
73
  def convert(file)
62
74
  Command::Convert.new(file: file, **symbolize(options)).call
63
75
  end
64
76
 
65
77
  desc "spa FILE", "Generate single-page app (SPA) from QEA/XMI/LUR"
66
- option :output, type: :string,
67
- desc: "Output path (default: <basename>.html)"
78
+ option :output, **OUTPUT_OPTION,
79
+ desc: "Output path (default: <basename>.html)"
80
+ option :config, **CONFIG_OPTION,
81
+ desc: "Path to lutaml-uml static-site YAML config " \
82
+ "(sets title, description, logos, etc.)"
68
83
  option :mode, type: :string, default: "single_file",
69
84
  desc: "Output mode: single_file | multi_file"
70
85
  def spa(file)
@@ -29,6 +29,7 @@ module Ea
29
29
  output: output_path,
30
30
  mode: mode,
31
31
  output_strategy: strategy,
32
+ config_path: resolve_config_path,
32
33
  }.compact
33
34
 
34
35
  Lutaml::UmlRepository::StaticSite::Generator
@@ -48,6 +49,19 @@ module Ea
48
49
  options[:output] || default_output_path
49
50
  end
50
51
 
52
+ def resolve_config_path
53
+ path = options[:config]
54
+ return nil unless path
55
+
56
+ expanded = File.expand_path(path)
57
+ unless File.exist?(expanded)
58
+ raise Ea::Cli::FileNotFound,
59
+ "Config file not found: #{path}"
60
+ end
61
+
62
+ expanded
63
+ end
64
+
51
65
  def default_output_path
52
66
  base = File.basename(file_path, ".*")
53
67
  dir = File.dirname(file_path)
data/lib/ea/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ea
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-09 00:00:00.000000000 Z
11
+ date: 2026-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -72,20 +72,20 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.5'
75
+ version: '0.6'
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 0.5.2
78
+ version: 0.6.0
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: '0.5'
85
+ version: '0.6'
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 0.5.2
88
+ version: 0.6.0
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: nokogiri
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '0.5'
151
+ version: 0.5.0
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '0.5'
158
+ version: 0.5.0
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: rubocop
161
161
  requirement: !ruby/object:Gem::Requirement