rails-erd 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ced613d31cc40de9c81c7e176f08426b2ceb443
4
- data.tar.gz: e8a7613baef3dee1c6eb409c1bb6dfa47a5baeac
3
+ metadata.gz: 0c30fa295be10915a3d5d8e67c20bc05d10aee6d
4
+ data.tar.gz: ef14cf496c1f5fc4b608b9672c18a56d7ad3e978
5
5
  SHA512:
6
- metadata.gz: b4c95e24c1cc9c5b1842fda8c3e538e3c4d52bb0c12d9124ab130b2041120803193e60fb278f61c12652a7df5fc7d85a90a58e4b461bdf83fb06ed4bbd26d256
7
- data.tar.gz: fcd3a51c29f28351bb50aecc73b47432675cfcc349079656a91a1e850316d71d2924171186749d653e1d1bdc04a2a68da01b4ebd10948fff8eae18d3df6ea7ec
6
+ metadata.gz: b03cf48dde711acfe6ae9988cf794629ecaec62cea8e6efabcc04bf43d743c2898b7d4b377c0fca85a944e67635e900a4a90df2477d48fcfbcb68cf42002354a
7
+ data.tar.gz: 5aa2246b32e02b5a8ff0729c84b4f1cdd2476b2c296293a8d7b447eb55bce26998c289528b2e98acb8e66f6bec756aaed2654b2efc5d0bac7c03019af1625be8
@@ -0,0 +1,4 @@
1
+ Add a .rake file that automatically generate the graphical models when you do
2
+ a db:migrate in development mode:
3
+
4
+ rails generate erd:install
@@ -0,0 +1,14 @@
1
+ module Erd
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ desc "Copy rails-erd rakefiles for automatic graphic generation"
5
+ source_root File.expand_path('../templates', __FILE__)
6
+
7
+ # copy rake tasks
8
+ def copy_tasks
9
+ template "auto_generate_diagram.rake", "lib/tasks/auto_generate_diagram.rake"
10
+ end
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ # NOTE: only doing this in development as some production environments (Heroku)
2
+ # NOTE: are sensitive to local FS writes, and besides -- it's just not proper
3
+ # NOTE: to have a dev-mode tool do its thing in production.
4
+ if Rails.env.development?
5
+ Erd.load_tasks
6
+ end
@@ -12,19 +12,16 @@ Choice.options do
12
12
  option :notation do
13
13
  long "--notation=STYLE"
14
14
  desc "Diagram notation style, one of simple, bachman, uml or crowsfoot."
15
- default "simple"
16
15
  end
17
16
 
18
17
  option :attributes do
19
18
  long "--attributes=TYPE,..."
20
19
  desc "Attribute groups to display: content, primary_keys, foreign_keys, timestamps and/or inheritance."
21
- default "content"
22
20
  end
23
21
 
24
22
  option :orientation do
25
23
  long "--orientation=ORIENTATION"
26
24
  desc "Orientation of diagram, either horizontal (default) or vertical."
27
- default "orientation"
28
25
  end
29
26
 
30
27
  option :inheritance do
@@ -60,13 +57,11 @@ Choice.options do
60
57
  option :sort do
61
58
  long "--sort=BOOLEAN"
62
59
  desc "Sort attribute list alphabetically"
63
- default "false"
64
60
  end
65
61
 
66
62
  option :prepend_primary do
67
63
  long "--prepend_primary=BOOLEAN"
68
64
  desc "Ensure primary key is at start of attribute list"
69
- default "false"
70
65
  end
71
66
 
72
67
  separator ""
@@ -75,13 +70,11 @@ Choice.options do
75
70
  option :filename do
76
71
  long "--filename=FILENAME"
77
72
  desc "Basename of the output diagram."
78
- default "erd"
79
73
  end
80
74
 
81
75
  option :filetype do
82
76
  long "--filetype=TYPE"
83
77
  desc "Output file type. Available types depend on the diagram renderer."
84
- default "pdf"
85
78
  end
86
79
 
87
80
  option :no_markup do
@@ -1,4 +1,4 @@
1
1
  module RailsERD
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  BANNER = "RailsERD #{VERSION}"
4
4
  end
@@ -0,0 +1,21 @@
1
+ namespace :db do
2
+ task :migrate do
3
+ ERDGraph::Migration.update_model
4
+ end
5
+
6
+ namespace :migrate do
7
+ [:change, :up, :down, :reset, :redo].each do |t|
8
+ task t do
9
+ ERDGraph::Migration.update_model
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ module ERDGraph
16
+ class Migration
17
+ def self.update_model
18
+ Rake::Task['erd'].invoke
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-erd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rolf Timmermans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -78,6 +78,9 @@ files:
78
78
  - README.md
79
79
  - Rakefile
80
80
  - bin/erd
81
+ - lib/generators/erd/USAGE
82
+ - lib/generators/erd/install_generator.rb
83
+ - lib/generators/erd/templates/auto_generate_diagram.rake
81
84
  - lib/rails-erd.rb
82
85
  - lib/rails_erd.rb
83
86
  - lib/rails_erd/cli.rb
@@ -95,6 +98,7 @@ files:
95
98
  - lib/rails_erd/railtie.rb
96
99
  - lib/rails_erd/tasks.rake
97
100
  - lib/rails_erd/version.rb
101
+ - lib/tasks/auto_generate_diagram.rake
98
102
  - test/support_files/erdconfig.another_example
99
103
  - test/support_files/erdconfig.example
100
104
  - test/support_files/erdconfig.exclude.example