ea 0.2.3 → 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 +4 -4
- data/lib/ea/cli/app.rb +8 -0
- data/lib/ea/cli/command/spa.rb +14 -0
- data/lib/ea/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: f8f192a675161ee0323d85e4f5dc940fc37e094f0816886e9181aed00f18eab8
|
|
4
|
+
data.tar.gz: 2796eff4e85e92713ce7a527f6a1e7ea59f9bd6617a651ab2a8bac0d5c3110a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ef5196f4c81d1301b97673e7ac5b06cd1ec315add8ed29ebf10200ba28d93b95d8811cca733187517d963939d3337e3831ef186b92ccb554b2164c7dfb9b763
|
|
7
|
+
data.tar.gz: 14363312e481597efc0cdf31f0eb2c5b57e0d6c810bfea575ea71fcd9cbaba2e02804b2d2d09a5aabee27f70522aa1289f96e5089aab884d138aa0e190810bcc
|
data/lib/ea/cli/app.rb
CHANGED
|
@@ -12,6 +12,11 @@ module Ea
|
|
|
12
12
|
# search, and every output-bearing command honours the same flag.
|
|
13
13
|
OUTPUT_OPTION = { type: :string, aliases: :o }.freeze
|
|
14
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
|
+
|
|
15
20
|
class << self
|
|
16
21
|
def exit_on_failure?
|
|
17
22
|
true
|
|
@@ -72,6 +77,9 @@ module Ea
|
|
|
72
77
|
desc "spa FILE", "Generate single-page app (SPA) from QEA/XMI/LUR"
|
|
73
78
|
option :output, **OUTPUT_OPTION,
|
|
74
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.)"
|
|
75
83
|
option :mode, type: :string, default: "single_file",
|
|
76
84
|
desc: "Output mode: single_file | multi_file"
|
|
77
85
|
def spa(file)
|
data/lib/ea/cli/command/spa.rb
CHANGED
|
@@ -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