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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a642cd1f62347458131574d9cbc1f67c603ddbb92f17791d315565c3d0139644
4
- data.tar.gz: ae95dec5c47a2e47e4fda8c6423e1d9d528e5efc38d941e08ec768ac16f6e526
3
+ metadata.gz: f8f192a675161ee0323d85e4f5dc940fc37e094f0816886e9181aed00f18eab8
4
+ data.tar.gz: 2796eff4e85e92713ce7a527f6a1e7ea59f9bd6617a651ab2a8bac0d5c3110a1
5
5
  SHA512:
6
- metadata.gz: be396117551658582cb2bc6b3fb0b248d011ff415e96c205e64e379f414dafc5c2619c42271bf96237d00396d541626f8e0da2635be266300175acccd0a16f2f
7
- data.tar.gz: 482dbbaa5bc81215cc05c0987c9bc14d8211b0e6c5ce17f85c35bd4c393c6fd74532d1a6057e9e5682435b5e9fb3eb372c9d0c94ecfa219a687e98f9d739278d
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)
@@ -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.3"
4
+ VERSION = "0.2.4"
5
5
  end
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.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.