rails-erd-d3 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: c65ee903ddb0b3616fdec66fc24991a947cfe0e0
4
- data.tar.gz: 84d21fc888961c141a6bb530aff9abdb02e437bd
3
+ metadata.gz: e040ff402ef8d1b7fdbfc3a7e1573651febd3735
4
+ data.tar.gz: 1729523fa2deec511efa0426f13db96d694676de
5
5
  SHA512:
6
- metadata.gz: ee71c6c0a4ccf010b101bdf71c0e346f02b0301b591e241829664defeaf22aed80082ebe16b530776587c68687c54b7b831a9e58486b67f0dc9103fbc2683050
7
- data.tar.gz: 56e588d8e28c852ec880713563fdc9418b516ba3ba88d0cf1127c7ac3ef024d81d1902a79423cc5448f192f28825b8d404b6e5d3f2e656092d8cf1b31d81dc05
6
+ metadata.gz: 94dc9f497b4840d56253f2311c5bdcb92976897b3b492f68f29b210b86b2ed09da316f8ed21b0d2f6826a5b4fbe6c982537f94de3915bb5d2b49e31f05002f09
7
+ data.tar.gz: aaec67fdebd92cee2290313e8b806e0f592576f005345d3df1519b527b9e96caddade2892ccf8232cccf32b2ac0b6b325dba178517885961a20aa49e9cdd15a2
data/lib/rails_erd_d3.rb CHANGED
@@ -38,12 +38,14 @@ class RailsErdD3
38
38
  models_list[model.model_name.plural.capitalize] = index
39
39
  end
40
40
 
41
+ puts "Generating data..."
42
+
41
43
  nodes = []
42
44
  links = []
43
45
  @@models.each do |model|
44
46
  nodes << { label: model.name, r: 30 }
45
47
 
46
- puts "Generate data for #{model.name}"
48
+ puts " - #{model.name}"
47
49
  model.reflections.each do |refl_name, refl_data|
48
50
  next if refl_data.options[:polymorphic]
49
51
 
@@ -51,10 +53,9 @@ class RailsErdD3
51
53
  association = refl_data.macro.to_s + (refl_data.options[:through] ? "_through" : "")
52
54
  color_index = ASSOCIATIONS.index(association)
53
55
 
54
-
55
56
  targeted_model = refl_model
56
- targeted_model = targeted_model[1..-1] if targeted_model.starts_with?('/')
57
- targeted_model = targeted_model.tr('/', '_').pluralize.capitalize
57
+ targeted_model = targeted_model[1..-1] if targeted_model.starts_with?("/")
58
+ targeted_model = targeted_model.tr("/", "_").pluralize.capitalize
58
59
 
59
60
  links << {
60
61
  source: models_list[model.model_name.plural.capitalize],
@@ -63,6 +64,7 @@ class RailsErdD3
63
64
  }
64
65
  end
65
66
  end
67
+ puts "Done"
66
68
 
67
69
  data = { nodes: nodes, links: links }
68
70
  data.to_json
@@ -91,7 +93,7 @@ class RailsErdD3
91
93
  private
92
94
 
93
95
  def self.get_head
94
- File.read(
96
+ content = File.read(
95
97
  File.expand_path(
96
98
  "templates/head.html",
97
99
  File.dirname(__FILE__)
@@ -100,7 +102,7 @@ class RailsErdD3
100
102
  end
101
103
 
102
104
  def self.get_nav
103
- File.read(
105
+ content = File.read(
104
106
  File.expand_path(
105
107
  "templates/nav.html",
106
108
  File.dirname(__FILE__)
@@ -109,7 +111,9 @@ class RailsErdD3
109
111
  end
110
112
 
111
113
  def self.get_d3
112
- ERB.new(
114
+ puts "Generating JS..."
115
+
116
+ content = ERB.new(
113
117
  File.read(
114
118
  File.expand_path(
115
119
  "templates/d3.html.erb",
@@ -117,10 +121,14 @@ class RailsErdD3
117
121
  )
118
122
  )
119
123
  ).result(binding)
124
+
125
+ puts "Done"
120
126
  end
121
127
 
122
128
  def self.get_modals
123
- ERB.new(
129
+ puts "Generating modals..."
130
+
131
+ content = ERB.new(
124
132
  File.read(
125
133
  File.expand_path(
126
134
  "templates/modals.html.erb",
@@ -128,5 +136,7 @@ class RailsErdD3
128
136
  )
129
137
  )
130
138
  ).result(binding)
139
+
140
+ puts "Done"
131
141
  end
132
142
  end
data/rails-erd-d3.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "rails-erd-d3"
7
7
  spec.authors = ["Roman Krasavtsev"]
8
8
  spec.email = ["mr.krasavtsev@gmail.com"]
9
- spec.version = "0.4.1"
9
+ spec.version = "0.4.2"
10
10
  spec.summary = "Entity–relationship diagram with D3.js for Rails application"
11
11
  spec.description = "This gem creates entity–relationship diagram with D3.js for your Rails application"
12
12
  spec.homepage = "https://github.com/RomanKrasavtsev/rails-erd-d3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-erd-d3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Krasavtsev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-15 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  requirements: []
102
102
  rubyforge_project:
103
- rubygems_version: 2.6.6
103
+ rubygems_version: 2.5.1
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Entity–relationship diagram with D3.js for Rails application