circulator 2.0.2 → 2.1.0

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: 20f38e7ccf237cac5499afb5723d5d8f8f4ffe26b3ecbe7e05ee71ad05366438
4
- data.tar.gz: e49a9f22259fea102bc6e99d5545590ae4fa40689cd2679318bababba8a5a075
3
+ metadata.gz: a33499a72d0661bf32e27e39213e4b0193f292eef8537c1946f0eb139e751a91
4
+ data.tar.gz: 6c3fa67b66bef192886a17cc9d756cb491bce6509127b43b87e7f5ca74347ef4
5
5
  SHA512:
6
- metadata.gz: 6e59f461501d8bd236755dcc30eaa277372e14aca6a61236545ab5df4334f47668fe4878ee4a418bedc539c16891f1fc6cec3f54d88e19ecd9c766146e4b796e
7
- data.tar.gz: 4e98a06987e4d08f44cc3cf81ea5544c219bff24a5f08990bac6b2c5c93193a47ce2d9a20aaecb4cdb28fa24cce06420093966b0be49c60f19fe8302198097ec
6
+ metadata.gz: 3755e25bcb3a1b34ba3768e8e3b501489dd7827ad9c1695b7365c2ffee9cbf9160181e2bd7226ba49e5c76d1763811e425beef4a0250a28811f22e57f970df98
7
+ data.tar.gz: 0c970bbeca86d6835911ae4ec7369585a14a9815ff6fc4fcdf28886ae556f0fc3b3d1be97fc301a45799bb5cc3b702681b3160f0072489a5eb96cfdb222fd225
data/CHANGELOG.md CHANGED
@@ -5,12 +5,8 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [2.0.2] - 2025-10-02
8
+ ## [2.1.0] - 2025-10-02
9
9
 
10
10
  ### Added
11
11
 
12
- - Loading of required files with -r command option for circulator-diagram.
13
-
14
- ### Changed
15
-
16
- - Implement diagrams through a standard base class to coordinate implementation.
12
+ - Configure directory for generating diagrams, defaulting to "docs"
@@ -8,7 +8,7 @@ require_relative "../lib/circulator/dot"
8
8
  require_relative "../lib/circulator/plantuml"
9
9
 
10
10
  # Parse command-line options
11
- options = {format: "dot", require: nil}
11
+ options = {format: "dot", require: nil, directory: "docs"}
12
12
  parser = OptionParser.new do |opts|
13
13
  opts.banner = "Usage: circulator-diagram MODEL_NAME [options]"
14
14
  opts.separator ""
@@ -23,6 +23,10 @@ parser = OptionParser.new do |opts|
23
23
  options[:format] = format
24
24
  end
25
25
 
26
+ opts.on("-d", "--directory DIRECTORY", "Output directory. Default: docs") do |directory|
27
+ options[:directory] = directory
28
+ end
29
+
26
30
  opts.on("-r", "--require FILE", "Require a file before loading the model (e.g., config/environment)") do |file|
27
31
  options[:require] = file
28
32
  end
@@ -102,11 +106,11 @@ begin
102
106
 
103
107
  if options[:format] == "plantuml"
104
108
  # Use model class name for PlantUML files
105
- output_file = "#{base_name}.puml"
109
+ output_file = File.join(options[:directory], "#{base_name}.puml")
106
110
 
107
111
  # Create directory if needed
108
112
  dir = File.dirname(output_file)
109
- FileUtils.mkdir_p(dir) unless dir == "." || File.exist?(dir)
113
+ FileUtils.mkdir_p(dir) unless File.exist?(dir)
110
114
 
111
115
  File.write(output_file, content)
112
116
  puts "Generated PlantUML file: #{output_file}"
@@ -114,16 +118,16 @@ begin
114
118
  puts " plantuml #{output_file}"
115
119
  else
116
120
  # Use model class name for DOT files
117
- output_file = "#{base_name}.dot"
121
+ output_file = File.join(options[:directory], "#{base_name}.dot")
118
122
 
119
123
  # Create directory if needed
120
124
  dir = File.dirname(output_file)
121
- FileUtils.mkdir_p(dir) unless dir == "." || File.exist?(dir)
125
+ FileUtils.mkdir_p(dir) unless File.exist?(dir)
122
126
 
123
127
  File.write(output_file, content)
124
128
  puts "Generated DOT file: #{output_file}"
125
129
  puts "To create an image, run:"
126
- puts " dot -Tpng #{output_file} -o #{base_name}.png"
130
+ puts " dot -Tpng #{output_file} -o #{File.join(options[:directory], base_name)}.png"
127
131
  end
128
132
 
129
133
  exit 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Circulator
4
- VERSION = "2.0.2"
4
+ VERSION = "2.1.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay