structurizr 1.0.0.pre.alpha.2 → 1.0.0.rc.2
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/.github/workflows/ci.yml +35 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +5 -0
- data/Makefile +12 -2
- data/README.md +6 -2
- data/exe/structurizr-repl +2 -1
- data/lib/structurizr/location.rb +6 -0
- data/lib/structurizr/model_item.rb +1 -1
- data/lib/structurizr/relationship.rb +12 -0
- data/lib/structurizr/version.rb +1 -1
- data/lib/structurizr/workspace.rb +4 -0
- data/lib/structurizr.rb +3 -0
- data/structurizr.gemspec +2 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce4c05ff7b71aae943e13eb73189496976b01612790834d08940c3c1102e045e
|
4
|
+
data.tar.gz: c24285334e2609897f641e40ef9429efdc930a085e75eef18f8b185533b17e4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61550f9549122a0b672105f5dd92fa60f201e8fed9dbb9d5944c3f5b0237ea71bf24dbaf4e173790353823c0edfd7c73d13ef0c7083005c30e9b2ddeaabb6637
|
7
|
+
data.tar.gz: a825c405dda69678aec26944c058412ed35b559da8ef3699add383cab98516b6c4d91977e3a3949943f8f9390ce2191e369e8e74878c80db07d1ad9c4b1bccea
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: ci
|
2
|
+
|
3
|
+
on: push
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby_version: [jruby]
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
with:
|
15
|
+
lfs: true
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby_version }}
|
20
|
+
- name: Download CodeClimate reporter
|
21
|
+
run: |
|
22
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
23
|
+
chmod +x ./cc-test-reporter
|
24
|
+
./cc-test-reporter before-build
|
25
|
+
env:
|
26
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
27
|
+
- name: Build and test
|
28
|
+
run: |
|
29
|
+
make bundle
|
30
|
+
make test
|
31
|
+
- name: Report to CodeClimate
|
32
|
+
run: |
|
33
|
+
./cc-test-reporter after-build --exit-code 0
|
34
|
+
env:
|
35
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Makefile
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
-
.PHONY: test setup bundle lint console download-jars
|
1
|
+
.PHONY: test transpile install setup bundle lint console download-jars build-gem build
|
2
2
|
|
3
3
|
test:
|
4
4
|
jruby -Itest -Ilib bin/test
|
5
5
|
|
6
|
-
|
6
|
+
transpile:
|
7
|
+
ruby-next nextify ./lib
|
8
|
+
|
9
|
+
install:
|
7
10
|
jruby -S gem install bundler
|
8
11
|
jruby -S bundle install
|
9
12
|
|
13
|
+
setup: install transpile
|
14
|
+
|
10
15
|
bundle:
|
11
16
|
jruby -S bundle
|
12
17
|
|
@@ -25,3 +30,8 @@ download-jars:
|
|
25
30
|
mvn dependency:get -Dartifact=com.structurizr:structurizr-core:LATEST -Ddest=./lib/structurizr/metal/jars/
|
26
31
|
mvn dependency:get -Dartifact=com.structurizr:structurizr-graphviz:LATEST -Ddest=./lib/structurizr/metal/jars/
|
27
32
|
mvn dependency:get -Dartifact=com.structurizr:structurizr-client:LATEST -Ddest=./lib/structurizr/metal/jars/
|
33
|
+
|
34
|
+
build-gem:
|
35
|
+
gem build
|
36
|
+
|
37
|
+
build: transpile build-gem
|
data/README.md
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
[](https://codeclimate.com/github/Morozzzko/structurizr-ruby/test_coverage)[](https://codeclimate.com/github/Morozzzko/structurizr-ruby/maintainability)
|
4
4
|
|
5
5
|
|
6
|
-
`structurizr-ruby` brings the [C4 model](https://c4model.com) to Ruby. It piggybacks on top of [Java's API](https://github.com/structurizr/java) for [Structurizr](https://structurizr.com), which is a powerful tool for incorporating C4 model into your software architecture process.
|
6
|
+
`structurizr-ruby` brings the [C4 model](https://c4model.com) to Ruby. It piggybacks on top of [Java's API](https://github.com/structurizr/java) for [Structurizr](https://structurizr.com), which is a powerful tool for incorporating C4 model into your software architecture process.
|
7
7
|
|
8
8
|
The primary goal is to enable better introspection & scripting for workspaces defined by Structurizr DSL.
|
9
9
|
|
10
|
-
|
10
|
+
Number 1 feature of this library is actually a runnable `REPL` which allows a flexible introspection. You can run it via `structurizr-repl <workspace.json>`.
|
11
|
+
|
12
|
+
As a bonus, this library provides a complete integration to build Structurizr workspace from Ruby. However, it doesn't make much sense since there's [Structurizr DSL](https://structurizr.com/help/dsl). However, it's still a bit useful if you're using [DSL's scripting feature](https://github.com/structurizr/dsl/blob/master/docs/language-reference.md#scripts), you might find this library a bit useful.
|
11
13
|
|
12
14
|
If you've met something which doesn't have a nice Ruby DSL, you can always use [`Structurizr::Metal`](/lib/structurizr/metal.rb) to access Java classes and methods. Please don't forget to [submit issue or a pull-request](#Contributing) which describes your use-case and the missing features.
|
13
15
|
|
@@ -37,6 +39,8 @@ Before you start, you need to `require` the necessary files:
|
|
37
39
|
require 'structurizr'
|
38
40
|
```
|
39
41
|
|
42
|
+
If you have a `workspace.json`, you can run an interactive REPL to read values from it: `structurizr-repl workspace.json`
|
43
|
+
|
40
44
|
## Development
|
41
45
|
|
42
46
|
After checking out the repo, run `make setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/exe/structurizr-repl
CHANGED
data/lib/structurizr/location.rb
CHANGED
@@ -4,4 +4,16 @@ require 'structurizr/metal'
|
|
4
4
|
|
5
5
|
module Structurizr
|
6
6
|
Relationship = Metal::Model::Relationship
|
7
|
+
|
8
|
+
class Relationship
|
9
|
+
def inspect
|
10
|
+
parts = [
|
11
|
+
"#{source.name.inspect} -> #{destination.name.inspect}",
|
12
|
+
description.inspect,
|
13
|
+
technology.inspect
|
14
|
+
].reject(&:empty?).join(" ")
|
15
|
+
|
16
|
+
%(#<#{parts}>)
|
17
|
+
end
|
18
|
+
end
|
7
19
|
end
|
data/lib/structurizr/version.rb
CHANGED
data/lib/structurizr.rb
CHANGED
data/structurizr.gemspec
CHANGED
@@ -19,13 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
21
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
22
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
23
|
end
|
24
24
|
spec.bindir = 'exe'
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
28
|
spec.add_dependency 'pry'
|
29
|
+
spec.add_dependency 'ruby-next'
|
29
30
|
spec.add_development_dependency 'minitest'
|
30
31
|
spec.add_development_dependency 'rubocop'
|
31
32
|
spec.add_development_dependency 'rubocop-minitest'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: structurizr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor S. Morozov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
name: ruby-next
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
29
43
|
requirements:
|
@@ -89,6 +103,7 @@ extensions: []
|
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
91
105
|
- ".gitattributes"
|
106
|
+
- ".github/workflows/ci.yml"
|
92
107
|
- ".gitignore"
|
93
108
|
- ".jrubyrc"
|
94
109
|
- ".reek.yml"
|