forked from ogom/draw_erd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Copyright (c) 2014 ogom | ||
Copyright (c) 2015 ogom | ||
|
||
MIT License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
require 'draw_erd/version' | ||
require 'draw_erd/configure' | ||
require 'draw_erd/default' | ||
require 'draw_erd/engine' | ||
|
||
module DrawErd | ||
class << self | ||
def configure | ||
yield DrawErd::Configure | ||
end | ||
|
||
def config | ||
DrawErd::Configure | ||
end | ||
end | ||
end | ||
|
||
DrawErd::Configure.setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module DrawErd | ||
module Configure | ||
class << self | ||
attr_accessor :path, :title, :attributes | ||
|
||
def setup | ||
keys.each do |key| | ||
instance_variable_set(:"@#{key}", DrawErd::Default.send(key)) | ||
end | ||
end | ||
|
||
def keys | ||
@keys ||= %i[path title attributes] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module DrawErd | ||
module Default | ||
PATH = 'draw-erd'.freeze | ||
TITLE = 'erd'.freeze | ||
ATTRIBUTES = [:foreign_keys, :content].freeze | ||
|
||
class << self | ||
def options | ||
Hash[DrawErd::Configure.keys.map{|key| [key, send(key)]}] | ||
end | ||
|
||
def path | ||
PATH | ||
end | ||
|
||
def title | ||
TITLE | ||
end | ||
|
||
def attributes | ||
ATTRIBUTES | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module DrawErd | ||
VERSION = '0.1.2'.freeze | ||
VERSION = '0.2.0'.freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters