rails-mermaid_erd_markdown 0.1.0 → 0.3.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: ca036f9a93d9694b096ad1bce2d2f2ed21a46fa9b2e042a2a6324522301743be
4
- data.tar.gz: e518276d23ef0e0b8efa1d68a2d36c2528b5c3f5297414e6bef8b9429c742640
3
+ metadata.gz: 67e66530c607079c622c67375de2af66f2e7622c10049a8972ee54daceced528
4
+ data.tar.gz: 79d8cde31fdd334cc53bb43e8bc86088d1525561cd8c05ad523dfd36b287a57c
5
5
  SHA512:
6
- metadata.gz: 8c0791403b7e7c91c35b3c5fb8b17f94fded6b414bf2c98d2f8fed34dd5e75e9b16615b6997bcec2b15c4f962902c5949de26cf69c346fffcee239374d3c9346
7
- data.tar.gz: 685f21a2e320ceb5283c92f2f841c777032a97d8f621be3edbd08585b0fdc3b5966d5f05f84a563d4bd58ec3e3b19f81052d216d562843eac4dc9ec5902f2b9c
6
+ metadata.gz: fb3657a451d92dc2520057b37c5fe75486ec1f6ecbfde168ae498e4b1213b40acca495cff3307aa704e99940b35069b1d9e61af8dd5d4b73dc92a489a4fb0c1d
7
+ data.tar.gz: 58fd1f844c7b8c16645bcdd48f7532d9175e1d53b0ad90ddef9a05021cdd2fa7e00968140d9bace215b4545f8917226b2f788adb15b6ece53c58857896cf1b10
@@ -0,0 +1 @@
1
+ * @humzahkiani # Applies to all files and directories
@@ -0,0 +1,42 @@
1
+ # This workflow uses actions that are not certified by GitHub. They are
2
+ # provided by a third-party and are governed by separate terms of service,
3
+ # privacy policy, and support documentation.
4
+ #
5
+ # This workflow will install a prebuilt Ruby version, install dependencies, and
6
+ # run tests and linters.
7
+ name: 'CI'
8
+ on:
9
+ push:
10
+ branches: ['main']
11
+ pull_request:
12
+ branches: ['main']
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ env:
17
+ RAILS_ENV: test
18
+ steps:
19
+ - name: Checkout code
20
+ uses: actions/checkout@v4
21
+ # Add or replace dependency steps here
22
+ - name: Install Ruby and gems
23
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
24
+ with:
25
+ bundler-cache: true
26
+ # Add or replace database setup steps here
27
+ # Add or replace test runners here
28
+ - name: Run tests
29
+ run: bundle exec rake
30
+
31
+ lint:
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - name: Checkout code
35
+ uses: actions/checkout@v4
36
+ - name: Install Ruby and gems
37
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
38
+ with:
39
+ bundler-cache: true
40
+ # Add or replace any other lints here
41
+ - name: Lint Ruby files
42
+ run: bin/rubocop --parallel
@@ -0,0 +1,93 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: 'CodeQL'
13
+
14
+ on:
15
+ push:
16
+ branches: ['main']
17
+ pull_request:
18
+ branches: ['main']
19
+
20
+ jobs:
21
+ analyze:
22
+ name: Analyze (${{ matrix.language }})
23
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
24
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
25
+ # - https://gh.io/supported-runners-and-hardware-resources
26
+ # - https://gh.io/using-larger-runners (GitHub.com only)
27
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
28
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
29
+ timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
30
+ permissions:
31
+ # required for all workflows
32
+ security-events: write
33
+
34
+ # required to fetch internal or private CodeQL packs
35
+ packages: read
36
+
37
+ # only required for workflows in private repositories
38
+ actions: read
39
+ contents: read
40
+
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ include:
45
+ - language: javascript-typescript
46
+ build-mode: none
47
+ - language: ruby
48
+ build-mode: none
49
+ # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
50
+ # Use `c-cpp` to analyze code written in C, C++ or both
51
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
52
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
53
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
54
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
55
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
56
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
57
+ steps:
58
+ - name: Checkout repository
59
+ uses: actions/checkout@v4
60
+
61
+ # Initializes the CodeQL tools for scanning.
62
+ - name: Initialize CodeQL
63
+ uses: github/codeql-action/init@v3
64
+ with:
65
+ languages: ${{ matrix.language }}
66
+ build-mode: ${{ matrix.build-mode }}
67
+ # If you wish to specify custom queries, you can do so here or in a config file.
68
+ # By default, queries listed here will override any specified in a config file.
69
+ # Prefix the list here with "+" to use these queries and those in the config file.
70
+
71
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
72
+ # queries: security-extended,security-and-quality
73
+
74
+ # If the analyze step fails for one of the languages you are analyzing with
75
+ # "We were unable to automatically build your code", modify the matrix above
76
+ # to set the build mode to "manual" for that language. Then modify this step
77
+ # to build your code.
78
+ # ℹ️ Command-line programs to run using the OS shell.
79
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
80
+ - if: matrix.build-mode == 'manual'
81
+ shell: bash
82
+ run: |
83
+ echo 'If you are using a "manual" build mode for one or more of the' \
84
+ 'languages you are analyzing, replace this with the commands to build' \
85
+ 'your code, for example:'
86
+ echo ' make bootstrap'
87
+ echo ' make release'
88
+ exit 1
89
+
90
+ - name: Perform CodeQL Analysis
91
+ uses: github/codeql-action/analyze@v3
92
+ with:
93
+ category: '/language:${{matrix.language}}'
data/.gitignore ADDED
@@ -0,0 +1,45 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .vscode
10
+
11
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
12
+ #
13
+ # If you find yourself ignoring temporary files generated by your text editor
14
+ # or operating system, you probably want to add a global ignore instead:
15
+ # git config --global core.excludesfile '~/.gitignore_global'
16
+
17
+ # Ignore bundler config.
18
+ /test/dummy-rails/.bundle
19
+
20
+ # Ignore all environment files (except templates).
21
+ /test/dummy-rails/.env*
22
+ /test/dummy-rails/.env*.erb
23
+
24
+ # Ignore all logfiles and tempfiles.
25
+ /test/dummy-rails/log/*
26
+ /test/dummy-rails/tmp/*
27
+ /test/dummy-rails/log/.keep
28
+ /test/dummy-rails/tmp/.keep
29
+
30
+ # Ignore pidfiles, but keep the directory.
31
+ /test/dummy-rails/tmp/pid s/*
32
+ /test/dummy-rails/tmp/pids/
33
+ /test/dummy-rails/tmp/pids/.keep
34
+
35
+ # Ignore storage (uploaded files in development and any SQLite databases).
36
+ /test/dummy-rails/storage/*
37
+ /test/dummy-rails/storage/.keep
38
+ /test/dummy-rails/tmp/storage/*
39
+ /test/dummy-rails/tmp/storage/
40
+ /test/dummy-rails/tmp/storage/.keep
41
+
42
+ /test/dummy-rails/public/assets
43
+
44
+ # Ignore master key for decrypting credentials and more.
45
+ /test/dummy-rails/config/master.key
data/.rubocop.yml ADDED
@@ -0,0 +1,37 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.6
4
+ Exclude:
5
+ - 'test/**/*'
6
+ - 'vendor/**/*'
7
+
8
+ Naming/FileName:
9
+ Enabled: false
10
+
11
+ Style/Documentation:
12
+ Enabled: false
13
+
14
+ Style/StringLiterals:
15
+ Enabled: true
16
+ EnforcedStyle: double_quotes
17
+
18
+ Style/StringLiteralsInInterpolation:
19
+ Enabled: true
20
+ EnforcedStyle: double_quotes
21
+
22
+ Layout/LineLength:
23
+ Max: 120
24
+
25
+ Metrics/AbcSize:
26
+ Exclude:
27
+ - 'lib/rails-mermaid_erd_markdown/configuration.rb'
28
+ - 'lib/rails-mermaid_erd_markdown/source_data.rb'
29
+ - 'lib/rails-mermaid_erd_markdown/generator.rb'
30
+
31
+ Metrics/ClassLength:
32
+ Max: 125
33
+
34
+ Metrics/MethodLength:
35
+ Max: 25
36
+ Exclude:
37
+ - 'lib/rails-mermaid_erd_markdown/configuration.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-05-27
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 89326566+humzahkiani@users.noreply.github.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rails-mermaid_erd_markdown.gemspec
6
+ gemspec
7
+
8
+ group :development do
9
+ gem "minitest"
10
+ gem "rake"
11
+ gem "rubocop"
12
+ gem "sqlite3"
13
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,231 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rails-mermaid_erd_markdown (0.3.0)
5
+ rails (>= 5.2)
6
+ rails-mermaid_erd (~> 0.4.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actioncable (7.1.3.4)
12
+ actionpack (= 7.1.3.4)
13
+ activesupport (= 7.1.3.4)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ zeitwerk (~> 2.6)
17
+ actionmailbox (7.1.3.4)
18
+ actionpack (= 7.1.3.4)
19
+ activejob (= 7.1.3.4)
20
+ activerecord (= 7.1.3.4)
21
+ activestorage (= 7.1.3.4)
22
+ activesupport (= 7.1.3.4)
23
+ mail (>= 2.7.1)
24
+ net-imap
25
+ net-pop
26
+ net-smtp
27
+ actionmailer (7.1.3.4)
28
+ actionpack (= 7.1.3.4)
29
+ actionview (= 7.1.3.4)
30
+ activejob (= 7.1.3.4)
31
+ activesupport (= 7.1.3.4)
32
+ mail (~> 2.5, >= 2.5.4)
33
+ net-imap
34
+ net-pop
35
+ net-smtp
36
+ rails-dom-testing (~> 2.2)
37
+ actionpack (7.1.3.4)
38
+ actionview (= 7.1.3.4)
39
+ activesupport (= 7.1.3.4)
40
+ nokogiri (>= 1.8.5)
41
+ racc
42
+ rack (>= 2.2.4)
43
+ rack-session (>= 1.0.1)
44
+ rack-test (>= 0.6.3)
45
+ rails-dom-testing (~> 2.2)
46
+ rails-html-sanitizer (~> 1.6)
47
+ actiontext (7.1.3.4)
48
+ actionpack (= 7.1.3.4)
49
+ activerecord (= 7.1.3.4)
50
+ activestorage (= 7.1.3.4)
51
+ activesupport (= 7.1.3.4)
52
+ globalid (>= 0.6.0)
53
+ nokogiri (>= 1.8.5)
54
+ actionview (7.1.3.4)
55
+ activesupport (= 7.1.3.4)
56
+ builder (~> 3.1)
57
+ erubi (~> 1.11)
58
+ rails-dom-testing (~> 2.2)
59
+ rails-html-sanitizer (~> 1.6)
60
+ activejob (7.1.3.4)
61
+ activesupport (= 7.1.3.4)
62
+ globalid (>= 0.3.6)
63
+ activemodel (7.1.3.4)
64
+ activesupport (= 7.1.3.4)
65
+ activerecord (7.1.3.4)
66
+ activemodel (= 7.1.3.4)
67
+ activesupport (= 7.1.3.4)
68
+ timeout (>= 0.4.0)
69
+ activestorage (7.1.3.4)
70
+ actionpack (= 7.1.3.4)
71
+ activejob (= 7.1.3.4)
72
+ activerecord (= 7.1.3.4)
73
+ activesupport (= 7.1.3.4)
74
+ marcel (~> 1.0)
75
+ activesupport (7.1.3.4)
76
+ base64
77
+ bigdecimal
78
+ concurrent-ruby (~> 1.0, >= 1.0.2)
79
+ connection_pool (>= 2.2.5)
80
+ drb
81
+ i18n (>= 1.6, < 2)
82
+ minitest (>= 5.1)
83
+ mutex_m
84
+ tzinfo (~> 2.0)
85
+ ast (2.4.2)
86
+ base64 (0.2.0)
87
+ bigdecimal (3.1.8)
88
+ builder (3.3.0)
89
+ concurrent-ruby (1.3.3)
90
+ connection_pool (2.4.1)
91
+ crass (1.0.6)
92
+ date (3.3.4)
93
+ drb (2.2.1)
94
+ erubi (1.13.0)
95
+ globalid (1.2.1)
96
+ activesupport (>= 6.1)
97
+ i18n (1.14.5)
98
+ concurrent-ruby (~> 1.0)
99
+ io-console (0.7.2)
100
+ irb (1.14.0)
101
+ rdoc (>= 4.0.0)
102
+ reline (>= 0.4.2)
103
+ json (2.7.2)
104
+ language_server-protocol (3.17.0.3)
105
+ loofah (2.22.0)
106
+ crass (~> 1.0.2)
107
+ nokogiri (>= 1.12.0)
108
+ mail (2.8.1)
109
+ mini_mime (>= 0.1.1)
110
+ net-imap
111
+ net-pop
112
+ net-smtp
113
+ marcel (1.0.4)
114
+ mini_mime (1.1.5)
115
+ minitest (5.23.1)
116
+ mutex_m (0.2.0)
117
+ net-imap (0.4.14)
118
+ date
119
+ net-protocol
120
+ net-pop (0.1.2)
121
+ net-protocol
122
+ net-protocol (0.2.2)
123
+ timeout
124
+ net-smtp (0.5.0)
125
+ net-protocol
126
+ nio4r (2.7.3)
127
+ nokogiri (1.16.7-arm64-darwin)
128
+ racc (~> 1.4)
129
+ nokogiri (1.16.7-x86_64-darwin)
130
+ racc (~> 1.4)
131
+ nokogiri (1.16.7-x86_64-linux)
132
+ racc (~> 1.4)
133
+ parallel (1.24.0)
134
+ parser (3.3.1.0)
135
+ ast (~> 2.4.1)
136
+ racc
137
+ psych (5.1.2)
138
+ stringio
139
+ racc (1.8.0)
140
+ rack (3.1.7)
141
+ rack-session (2.0.0)
142
+ rack (>= 3.0.0)
143
+ rack-test (2.1.0)
144
+ rack (>= 1.3)
145
+ rackup (2.1.0)
146
+ rack (>= 3)
147
+ webrick (~> 1.8)
148
+ rails (7.1.3.4)
149
+ actioncable (= 7.1.3.4)
150
+ actionmailbox (= 7.1.3.4)
151
+ actionmailer (= 7.1.3.4)
152
+ actionpack (= 7.1.3.4)
153
+ actiontext (= 7.1.3.4)
154
+ actionview (= 7.1.3.4)
155
+ activejob (= 7.1.3.4)
156
+ activemodel (= 7.1.3.4)
157
+ activerecord (= 7.1.3.4)
158
+ activestorage (= 7.1.3.4)
159
+ activesupport (= 7.1.3.4)
160
+ bundler (>= 1.15.0)
161
+ railties (= 7.1.3.4)
162
+ rails-dom-testing (2.2.0)
163
+ activesupport (>= 5.0.0)
164
+ minitest
165
+ nokogiri (>= 1.6)
166
+ rails-html-sanitizer (1.6.0)
167
+ loofah (~> 2.21)
168
+ nokogiri (~> 1.14)
169
+ rails-mermaid_erd (0.4.2)
170
+ rails (>= 5.2)
171
+ railties (7.1.3.4)
172
+ actionpack (= 7.1.3.4)
173
+ activesupport (= 7.1.3.4)
174
+ irb
175
+ rackup (>= 1.0.0)
176
+ rake (>= 12.2)
177
+ thor (~> 1.0, >= 1.2.2)
178
+ zeitwerk (~> 2.6)
179
+ rainbow (3.1.1)
180
+ rake (13.2.1)
181
+ rdoc (6.7.0)
182
+ psych (>= 4.0.0)
183
+ regexp_parser (2.9.2)
184
+ reline (0.5.9)
185
+ io-console (~> 0.5)
186
+ rexml (3.2.8)
187
+ strscan (>= 3.0.9)
188
+ rubocop (1.64.0)
189
+ json (~> 2.3)
190
+ language_server-protocol (>= 3.17.0)
191
+ parallel (~> 1.10)
192
+ parser (>= 3.3.0.2)
193
+ rainbow (>= 2.2.2, < 4.0)
194
+ regexp_parser (>= 1.8, < 3.0)
195
+ rexml (>= 3.2.5, < 4.0)
196
+ rubocop-ast (>= 1.31.1, < 2.0)
197
+ ruby-progressbar (~> 1.7)
198
+ unicode-display_width (>= 2.4.0, < 3.0)
199
+ rubocop-ast (1.31.3)
200
+ parser (>= 3.3.1.0)
201
+ ruby-progressbar (1.13.0)
202
+ sqlite3 (1.7.3-arm64-darwin)
203
+ sqlite3 (1.7.3-x86_64-darwin)
204
+ sqlite3 (1.7.3-x86_64-linux)
205
+ stringio (3.1.1)
206
+ strscan (3.1.0)
207
+ thor (1.3.1)
208
+ timeout (0.4.1)
209
+ tzinfo (2.0.6)
210
+ concurrent-ruby (~> 1.0)
211
+ unicode-display_width (2.5.0)
212
+ webrick (1.8.1)
213
+ websocket-driver (0.7.6)
214
+ websocket-extensions (>= 0.1.0)
215
+ websocket-extensions (0.1.5)
216
+ zeitwerk (2.6.17)
217
+
218
+ PLATFORMS
219
+ arm64-darwin-23
220
+ x86_64-darwin-22
221
+ x86_64-linux
222
+
223
+ DEPENDENCIES
224
+ minitest
225
+ rails-mermaid_erd_markdown!
226
+ rake
227
+ rubocop
228
+ sqlite3
229
+
230
+ BUNDLED WITH
231
+ 2.3.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 humzahkiani
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -22,18 +22,45 @@ Or install it yourself as:
22
22
 
23
23
  To generate a mermaid ERD in markdown, run `rails generate_erd` or `rake generate_erd` from the terminal
24
24
 
25
- The default path for the generated ERD is `app/models/ERD.md`. You can modify this by creating an `erd.yml` file in the root directory
26
- and modifying the `result_path` as seen in the example at `docs/examples/erd.yml`. Make sure to include the markdown file name you
27
- wish to generate in the path.
25
+ The default path for the generated ERD is `app/models/ERD.md`. You can modify this by creating an `erd.yml` file in the root directory and modifying the `output_path` as seen in the example at `docs/examples/erd.yml`. Make sure to include the markdown file name you wish to generate in the path.
28
26
 
29
- If an ERD already exists at the path specified, it will be parsed to determine if it is up to date. If it is, nothing happens. If it
30
- is not, the ERD is ed.
27
+ If an ERD already exists at the path specified, it will be parsed to determine if it is up to date. If it is, nothing happens. If it is not up to date, the ERD will be updated.
31
28
 
32
- One can create self-updating, living documentation by integrating this rake task into their CI. This ensures that the ERD is always up
33
- to date and accurately describes the latest state of the models and their relationships.
29
+ One can create self-updating, living documentation by integrating this rake task into their CI. This ensures that the ERD is always up to date and accurately describes the latest state of the models and their relationships.
34
30
 
35
- You can view the ERD by navigating to the file in Github, which supports rendering mermaid diagrams from code. If you are a Visual
36
- Studio Code user, you can use the [Markdown Preview Enhanced](https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) extension to view the ERD directly in your IDE.
31
+ You can view the ERD by navigating to the file in Github, which supports rendering mermaid diagrams from code. If you are a Visual Studio Code user, you can use the [Markdown Preview Enhanced](https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced) extension to view the ERD directly in your IDE.
32
+
33
+ If your entity diagram is too large to be displayed you can set a `split_output` configuration to `true` to generate multiple ERD files based on each model in your project. You can also set a `relationship_depth` configuration to include more than 1 level (the default) of associations in each document.
34
+
35
+ ## Example ERD
36
+
37
+ ```mermaid
38
+ erDiagram
39
+ %% --------------------------------------------------------
40
+ %% Entity-Relationship Diagram
41
+ %% --------------------------------------------------------
42
+
43
+ %% table name: articles
44
+ Article{
45
+ integer id PK
46
+ string title
47
+ text content
48
+ datetime created_at
49
+ datetime updated_at
50
+ }
51
+
52
+ %% table name: comments
53
+ Comment{
54
+ integer id PK
55
+ string commenter
56
+ text body
57
+ integer article_id FK
58
+ datetime created_at
59
+ datetime updated_at
60
+ }
61
+
62
+ Comment }o--|| Article : "BT:article"
63
+ ```
37
64
 
38
65
  ## Development
39
66
 
data/Rakefile CHANGED
@@ -14,4 +14,4 @@ require "rubocop/rake_task"
14
14
 
15
15
  RuboCop::RakeTask.new
16
16
 
17
- task default: %i[test rubocop]
17
+ task default: %i[test]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rails-mermaid_erd_markdown"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)