Skip to content

Commit

Permalink
Merge pull request #25 from koedame/release/v0.4.0
Browse files Browse the repository at this point in the history
Release/v0.4.0
  • Loading branch information
unchidev authored Oct 15, 2022
2 parents 947bba4 + b173d61 commit c125caf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Specify your gem's dependencies in rails-mermaid_erd.gemspec.
gemspec

gem "bump"
gem "rake"
gem "solargraph"
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rails-mermaid_erd (0.3.0)
rails-mermaid_erd (0.4.0)
rails (>= 5.2)

GEM
Expand Down Expand Up @@ -76,6 +76,7 @@ GEM
backport (1.2.0)
benchmark (0.2.0)
builder (3.2.4)
bump (0.10.0)
concurrent-ruby (1.1.10)
crass (1.0.6)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -232,6 +233,7 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
bump
pg
rails-mermaid_erd!
rake
Expand Down
27 changes: 27 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@


## Perform a release

in docekr devcontainer:

```bash
cd /workspace && bundle install

cd /workspace && bundle exec bump patch --no-commit
# or
cd /workspace && bundle exec bump minor --no-commit
# or
cd /workspace && bundle exec bump major --no-commit

cd /workspace && bundle exec rspec
cd /workspace/spec/dummy && RAILS_ENV=test bundle exec rails mermaid_erd
cp -f /workspace/spec/dummy/mermaid_erd/index.html /workspace/docs/example.html
```

in host machine:

```bash
bundle install
bundle exec rake build
bundle exec rake release
```
6 changes: 3 additions & 3 deletions docs/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
<footer class="bg-gray-100">
<p class="text-center text-xs text-gray-600 py-2">
<a href="https://github.com/koedame/rails-mermaid_erd" class="hover:text-gray-400" target="_blank" rel="noopener noreferrer">
Rails Mermaid ERD v0.3.0
Rails Mermaid ERD v0.4.0
</a>
</p>
</footer>
Expand All @@ -281,7 +281,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/9.1.7/mermaid.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>

<script>window.SCHEMA_DATA={"Models":[{"TableName":"user_images","ModelName":"UserImage","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"image","type":"string","key":"","comment":"Avatar image"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"tags","ModelName":"Tag","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"name","type":"string","key":"","comment":"always lowercase"},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"posts_tags","ModelName":"PostsTag","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"post_id","type":"integer","key":"FK","comment":null},{"name":"tag_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"posts","ModelName":"Post","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"title","type":"string","key":"","comment":"post title"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"comments","ModelName":"Comment","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"body","type":"string","key":"","comment":null},{"name":"post_id","type":"integer","key":"FK","comment":null},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"user_profiles","ModelName":"AuthorProfile","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"birthday","type":"date","key":"","comment":"Birthday"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"users","ModelName":"Author","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"name","type":"string","key":"","comment":"nickname"},{"name":"email","type":"string","key":"","comment":"login email"},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]}],"Relations":[{"LeftModelName":"UserImage","LeftValue":"}o","RightModelName":"Author","RightValue":"o|","Comment":"belongs_to user : has_many images"},{"LeftModelName":"Tag","LeftValue":"}o","RightModelName":"Post","RightValue":"o{","Comment":"HABTM"},{"LeftModelName":"PostsTag","LeftValue":"}o","RightModelName":"Post","RightValue":"||","Comment":""},{"LeftModelName":"PostsTag","LeftValue":"}o","RightModelName":"Tag","RightValue":"||","Comment":""},{"LeftModelName":"Post","LeftValue":"||","RightModelName":"Comment","RightValue":"o{","Comment":""},{"LeftModelName":"Post","LeftValue":"}o","RightModelName":"Author","RightValue":"||","Comment":""},{"LeftModelName":"Comment","LeftValue":"}o","RightModelName":"Author","RightValue":"||","Comment":""},{"LeftModelName":"AuthorProfile","LeftValue":"|o","RightModelName":"Author","RightValue":"||","Comment":"has_one profile"}]}</script>
<script>window.SCHEMA_DATA={"Models":[{"TableName":"users","ModelName":"Author","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"name","type":"string","key":"","comment":"nickname"},{"name":"email","type":"string","key":"","comment":"login email"},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"user_profiles","ModelName":"AuthorProfile","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"birthday","type":"date","key":"","comment":"Birthday"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"comments","ModelName":"Comment","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"body","type":"string","key":"","comment":null},{"name":"post_id","type":"integer","key":"FK","comment":null},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"posts","ModelName":"Post","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"title","type":"string","key":"","comment":"post title"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"posts_tags","ModelName":"PostsTag","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"post_id","type":"integer","key":"FK","comment":null},{"name":"tag_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"tags","ModelName":"Tag","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"name","type":"string","key":"","comment":"always lowercase"},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]},{"TableName":"user_images","ModelName":"UserImage","IsModelExist":true,"Columns":[{"name":"id","type":"integer","key":"PK","comment":null},{"name":"image","type":"string","key":"","comment":"Avatar image"},{"name":"user_id","type":"integer","key":"FK","comment":null},{"name":"created_at","type":"datetime","key":"","comment":null},{"name":"updated_at","type":"datetime","key":"","comment":null}]}],"Relations":[{"LeftModelName":"Author","LeftValue":"||","Line":"--","RightModelName":"Post","RightValue":"o{","Comment":"HM:posts, BT:author"},{"LeftModelName":"Author","LeftValue":"||","Line":"--","RightModelName":"Comment","RightValue":"o{","Comment":"HM:comments, BT:author"},{"LeftModelName":"Author","LeftValue":"}o","Line":"..","RightModelName":"Post","RightValue":"o{","Comment":"HMT:comment_posts, HMT:comment_authors"},{"LeftModelName":"Author","LeftValue":"|o","Line":"--","RightModelName":"UserImage","RightValue":"o{","Comment":"HM:images, BT:user"},{"LeftModelName":"Author","LeftValue":"||","Line":"--","RightModelName":"AuthorProfile","RightValue":"o|","Comment":"HO:profile, BT:author"},{"LeftModelName":"Comment","LeftValue":"}o","Line":"--","RightModelName":"Post","RightValue":"||","Comment":"BT:post, HM:comments"},{"LeftModelName":"Post","LeftValue":"}o","Line":"..","RightModelName":"Tag","RightValue":"o{","Comment":"HABTM"},{"LeftModelName":"PostsTag","LeftValue":"}o","Line":"--","RightModelName":"Post","RightValue":"||","Comment":"BT:post"},{"LeftModelName":"PostsTag","LeftValue":"}o","Line":"--","RightModelName":"Tag","RightValue":"||","Comment":"BT:tag"}]}</script>
<script>
window.i18n = {
en: {
Expand Down Expand Up @@ -469,7 +469,7 @@ <h2 class="font-medium text-gray-900 mb-1">{{i18n[language]["models"]["title"]}}
});

filteredData.value.Relations.forEach(relation => {
lines.push(` ${relation.LeftModelName.replace(/:/g, '-')} ${relation.LeftValue}--${relation.RightValue} ${relation.RightModelName.replace(/:/g, '-')} : "${relation.Comment}"`)
lines.push(` ${relation.LeftModelName.replace(/:/g, '-')} ${relation.LeftValue}${relation.Line}${relation.RightValue} ${relation.RightModelName.replace(/:/g, '-')} : "${relation.Comment}"`)
});

return lines.join("\n")
Expand Down
2 changes: 1 addition & 1 deletion lib/rails-mermaid_erd/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RailsMermaidErd
VERSION = "0.3.0"
VERSION = "0.4.0"
end

0 comments on commit c125caf

Please sign in to comment.