ea 0.2.3 → 0.2.5
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 +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44e2c62c415fec32597751f87ec29e35529726a61cdcc1908ae0b0a371b94443
|
|
4
|
+
data.tar.gz: 68fce8e4b397c9c9701d443f9dcf74f8fe7b15c286b4442fbdacd63a1808ec5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f251cc03250dbddf267365a7c3f671c8ba4faf8203ce592529ce2cbf9ca95a723f694a2e768c6271d032fd51308bba6694e9368c63f3a47282dd3c58e5921092
|
|
7
|
+
data.tar.gz: 14c25b3daa1ace6436f06109e23a3b01a4b75de008c8a18f789db8e81b66dbe89881a49e01cb8cc8dd90d8c950b927f594a17c2a2b6a7d4a0fd7328da9296793
|
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
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ea
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -148,14 +148,20 @@ dependencies:
|
|
|
148
148
|
requirements:
|
|
149
149
|
- - "~>"
|
|
150
150
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: 0.5
|
|
151
|
+
version: '0.5'
|
|
152
|
+
- - ">="
|
|
153
|
+
- !ruby/object:Gem::Version
|
|
154
|
+
version: 0.5.2
|
|
152
155
|
type: :development
|
|
153
156
|
prerelease: false
|
|
154
157
|
version_requirements: !ruby/object:Gem::Requirement
|
|
155
158
|
requirements:
|
|
156
159
|
- - "~>"
|
|
157
160
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: 0.5
|
|
161
|
+
version: '0.5'
|
|
162
|
+
- - ">="
|
|
163
|
+
- !ruby/object:Gem::Version
|
|
164
|
+
version: 0.5.2
|
|
159
165
|
- !ruby/object:Gem::Dependency
|
|
160
166
|
name: rubocop
|
|
161
167
|
requirement: !ruby/object:Gem::Requirement
|