Ruby | Gviz gem으로 GiitHub Flow의 그림을 써 보십시오
17313 단어 GraphvizRubyGithub-flow
Ruby | Gviz gem으로 GiitHub Flow의 그림을 써 보십시오
개요
Gviz gem으로 GiitHub Flow의 그림을 써 보세요.
이전에, 나는 astah*community로 GiitHub Flow를 쓴 적이 있다
왜냐하면 오래전부터 이런 그림을 순수한 텍스트로 쓰고 싶었어요.
지비즈로 만들어봐.
GiitHub Flow 다이어그램
astah*community Edition GiitHub Flow 그림
코드
# encoding: UTF-8
require 'gviz'
basic_settings = {fontname:'MS GOTHIC', fontsize: 11}
basic_node = {fontname:'MS GOTHIC', shape: :box, style: :filled, :colorscheme=> :paired12 }
diamond_format = basic_node.merge({label: '', shape: :diamond, fillcolor: :black})
Graph do
color = 0
global layout:'dot', overlap:false, colorscheme: :brbg9
node :master1, {label: 'master', fillcolor: color=color.succ%11}.merge(basic_node)
node :topicBranch, {label: 'topic_branch', fillcolor: color=color.succ%11}.merge(basic_node)
node :dev, {label: '設計開発', fillcolor: color=color.succ%11}.merge(basic_settings).merge(basic_node)
node :commit, {fillcolor: color=color.succ%11}.merge(basic_node)
node :pushToRemote, {label: 'push to remote', fillcolor: color=color.succ%11}.merge(basic_node)
node :topicBranch, {label: 'トピックブランチの作成'}.merge(basic_node)
node :branchNormal, diamond_format
node :branchWip, diamond_format
node :branchConsultation, diamond_format
node :branchReview, diamond_format
node :wipPullRequest, {label: '[WIP]Pull Request', fillcolor: color=color.succ%11}.merge(basic_node)
node :pullRequest, {label: 'Pull Request', fillcolor: color%11}.merge(basic_node)
node :consultation, {label: 'レビュー・相談', fillcolor: color=color.succ%11}.merge(basic_node)
node :review, {label: 'レビュー', fillcolor: color%11}.merge(basic_node)
node :merge, {label: 'マージ', fillcolor: color=color.succ%11}.merge(basic_node)
node :closePullRequest, {label: 'Pull Request Close', fillcolor: color=color.succ%11}.merge(basic_node)
node :master2, {label: 'master', fillcolor: color%11}.merge(basic_node)
node :deleteTopicBranch, basic_node.merge({label: 'トピックブランチ削除', fillcolor: color=color.succ%11, fontcolor: :white})
node :deploy, basic_node.merge({label: 'デプロイ', fillcolor: color%11, fontcolor: :white})
edge :start_master1
edge :master1_master2
edge :master1_topicBranch, {label: '機能追加・バグフィックス'}.merge(basic_settings)
edge :topicBranch_dev, basic_settings
edge :dev_commit, basic_settings
edge :commit_pushToRemote, basic_settings
edge :pushToRemote_branchNormal, {label: 'トピックの実装が完了したか?'}.merge(basic_settings)
edge :branchNormal_pullRequest, {label: '完了'}.merge(basic_settings)
edge :branchNormal_dev, {label: '完了'}.merge(basic_settings)
edge :pushToRemote_branchWip, {label: '設計・実装上の相談があるか?'}.merge(basic_settings)
edge :branchWip_wipPullRequest, {label: 'ある'}.merge(basic_settings)
edge :branchWip_dev, {label: 'ない'}.merge(basic_settings)
edge :wipPullRequest_consultation, basic_settings
edge :consultation_branchConsultation, {label: '設計・実装の課題が解決したか?'}.merge(basic_settings)
edge :branchConsultation_dev, {label: '解決'}.merge(basic_settings)
edge :branchConsultation_consultation, {label: '未解決'}.merge(basic_settings)
edge :pullRequest_review, basic_settings
edge :review_branchReview, {label: 'レビューOK?'}.merge(basic_settings)
edge :branchReview_merge, {label: '解決'}.merge(basic_settings)
edge :branchReview_review, {label: 'NG'}.merge(basic_settings)
edge :merge_closePullRequest, basic_settings
edge :merge_master2, basic_settings
edge :closePullRequest_deleteTopicBranch, basic_settings
edge :master2_end
edge :master2_deploy
rank :min, :start
rank :max, :end
save(:github_flow, :png)
end
출력(Gviz Edition GiitHub Flow 그림)
인용하다
# encoding: UTF-8
require 'gviz'
basic_settings = {fontname:'MS GOTHIC', fontsize: 11}
basic_node = {fontname:'MS GOTHIC', shape: :box, style: :filled, :colorscheme=> :paired12 }
diamond_format = basic_node.merge({label: '', shape: :diamond, fillcolor: :black})
Graph do
color = 0
global layout:'dot', overlap:false, colorscheme: :brbg9
node :master1, {label: 'master', fillcolor: color=color.succ%11}.merge(basic_node)
node :topicBranch, {label: 'topic_branch', fillcolor: color=color.succ%11}.merge(basic_node)
node :dev, {label: '設計開発', fillcolor: color=color.succ%11}.merge(basic_settings).merge(basic_node)
node :commit, {fillcolor: color=color.succ%11}.merge(basic_node)
node :pushToRemote, {label: 'push to remote', fillcolor: color=color.succ%11}.merge(basic_node)
node :topicBranch, {label: 'トピックブランチの作成'}.merge(basic_node)
node :branchNormal, diamond_format
node :branchWip, diamond_format
node :branchConsultation, diamond_format
node :branchReview, diamond_format
node :wipPullRequest, {label: '[WIP]Pull Request', fillcolor: color=color.succ%11}.merge(basic_node)
node :pullRequest, {label: 'Pull Request', fillcolor: color%11}.merge(basic_node)
node :consultation, {label: 'レビュー・相談', fillcolor: color=color.succ%11}.merge(basic_node)
node :review, {label: 'レビュー', fillcolor: color%11}.merge(basic_node)
node :merge, {label: 'マージ', fillcolor: color=color.succ%11}.merge(basic_node)
node :closePullRequest, {label: 'Pull Request Close', fillcolor: color=color.succ%11}.merge(basic_node)
node :master2, {label: 'master', fillcolor: color%11}.merge(basic_node)
node :deleteTopicBranch, basic_node.merge({label: 'トピックブランチ削除', fillcolor: color=color.succ%11, fontcolor: :white})
node :deploy, basic_node.merge({label: 'デプロイ', fillcolor: color%11, fontcolor: :white})
edge :start_master1
edge :master1_master2
edge :master1_topicBranch, {label: '機能追加・バグフィックス'}.merge(basic_settings)
edge :topicBranch_dev, basic_settings
edge :dev_commit, basic_settings
edge :commit_pushToRemote, basic_settings
edge :pushToRemote_branchNormal, {label: 'トピックの実装が完了したか?'}.merge(basic_settings)
edge :branchNormal_pullRequest, {label: '完了'}.merge(basic_settings)
edge :branchNormal_dev, {label: '完了'}.merge(basic_settings)
edge :pushToRemote_branchWip, {label: '設計・実装上の相談があるか?'}.merge(basic_settings)
edge :branchWip_wipPullRequest, {label: 'ある'}.merge(basic_settings)
edge :branchWip_dev, {label: 'ない'}.merge(basic_settings)
edge :wipPullRequest_consultation, basic_settings
edge :consultation_branchConsultation, {label: '設計・実装の課題が解決したか?'}.merge(basic_settings)
edge :branchConsultation_dev, {label: '解決'}.merge(basic_settings)
edge :branchConsultation_consultation, {label: '未解決'}.merge(basic_settings)
edge :pullRequest_review, basic_settings
edge :review_branchReview, {label: 'レビューOK?'}.merge(basic_settings)
edge :branchReview_merge, {label: '解決'}.merge(basic_settings)
edge :branchReview_review, {label: 'NG'}.merge(basic_settings)
edge :merge_closePullRequest, basic_settings
edge :merge_master2, basic_settings
edge :closePullRequest_deleteTopicBranch, basic_settings
edge :master2_end
edge :master2_deploy
rank :min, :start
rank :max, :end
save(:github_flow, :png)
end
https://github.com/tbpgr/github_flow_for_ja
Reference
이 문제에 관하여(Ruby | Gviz gem으로 GiitHub Flow의 그림을 써 보십시오), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tbpgr/items/2d61b1d3b874789e52b4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)