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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe8a005a3c60de0672a5d97461b0ec492efc28cdd47b9ccce953adbb405b032a
4
- data.tar.gz: 2c7e7fa0f87ac51bdc9a78adb68be7c640b2f1f04e01b93d28912031a18de16d
3
+ metadata.gz: ce4c05ff7b71aae943e13eb73189496976b01612790834d08940c3c1102e045e
4
+ data.tar.gz: c24285334e2609897f641e40ef9429efdc930a085e75eef18f8b185533b17e4c
5
5
  SHA512:
6
- metadata.gz: 20e3190211889b56a2a8721050c658253bcb6971a8a14ebf1baa7afecea7457437b8f964ed973678eccf84adad97dd8b50683433475056d201a0861b9836144d
7
- data.tar.gz: 04dc35d206db7f33cee95cbe3adb8668e8bd4536e1d550f69e4118a1d2575f2d24f362d030c263ae3b6e31d29fb7cdf6b1843e00f6d13ba1654ea1a5c964ff02
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
@@ -8,3 +8,4 @@
8
8
  /tmp/
9
9
 
10
10
  Gemfile.lock
11
+ .rbnext/
data/.rubocop.yml CHANGED
@@ -1,6 +1,11 @@
1
+ require:
2
+ - ruby-next/rubocop
3
+
1
4
  AllCops:
2
5
  NewCops: enable
3
6
  TargetRubyVersion: 2.5
7
+ Exclude:
8
+ - 'lib/.rbnext/**/*'
4
9
 
5
10
  Style/Documentation:
6
11
  Enabled: false
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
- setup:
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
  [![Test Coverage](https://api.codeclimate.com/v1/badges/b75e8c130fc8b3bf54b5/test_coverage)](https://codeclimate.com/github/Morozzzko/structurizr-ruby/test_coverage)[![Maintainability](https://api.codeclimate.com/v1/badges/b75e8c130fc8b3bf54b5/maintainability)](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
- 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.
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
@@ -3,8 +3,9 @@
3
3
 
4
4
  require 'structurizr'
5
5
  require 'structurizr/repl'
6
+ require 'ruby-next/pry'
6
7
 
7
- application = Structurizr::REPL::Application.new
8
+ application = Structurizr::REPL::Application.new(ARGV)
8
9
 
9
10
  application.parse_workspace_path!
10
11
  application.prepare_context!
@@ -4,4 +4,10 @@ require 'structurizr/metal'
4
4
 
5
5
  module Structurizr
6
6
  Location = Metal::Model::Location
7
+
8
+ class Location
9
+ def inspect
10
+ %(#<Structurizr::Location::#{name}>)
11
+ end
12
+ end
7
13
  end
@@ -12,7 +12,7 @@ module Structurizr
12
12
 
13
13
  def inspect
14
14
  class_name = self.class.name.split('::').last
15
- %(<#{class_name}: "#{name}">)
15
+ %(#<Structurizr::#{class_name}(#{name.inspect})>)
16
16
  end
17
17
  end
18
18
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Structurizr
4
- VERSION = '1.0.0-alpha.2'
4
+ VERSION = '1.0.0.rc.2'
5
5
  end
@@ -15,5 +15,9 @@ module Structurizr
15
15
  def self.from_json(json)
16
16
  Metal::Util::WorkspaceUtils.from_json(json)
17
17
  end
18
+
19
+ def inspect
20
+ %(#<Structurizr::Workspace(#{name.inspect})>)
21
+ end
18
22
  end
19
23
  end
data/lib/structurizr.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ruby-next/language/setup'
4
+ RubyNext::Language.setup_gem_load_path
5
+
3
6
  require 'structurizr/version'
4
7
  require 'structurizr/model_item'
5
8
  require 'structurizr/workspace'
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|.github)/}) }
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.pre.alpha.2
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-04 00:00:00.000000000 Z
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"