revocare 0.2.0 → 0.2.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
  SHA256:
3
- metadata.gz: 9cd27b1f9b7fde54066e3c955b49303a8a97f14edba9f8f5996657d3c041bb01
4
- data.tar.gz: e22cda783a276cfff9edad8b20e82f4eb8d482b9f187ddf7187b212d43054a53
3
+ metadata.gz: 9637b980eeb643afddb2be646bbb1fbb1c8fb578230bd7bff5c059d55c7e5e35
4
+ data.tar.gz: 1a167f2baf8e5a4088f03f0e678d5c80673a71665c408772376836d68f3c5576
5
5
  SHA512:
6
- metadata.gz: 9a1f089200fa2e7b8cd79084173bc2b130b2b51edd0e88a11aba87446455ea03038113d6d508e75a2918e6cf01a7eae03b7ac1a4ad77758d6b33b1acf974013c
7
- data.tar.gz: 85b44534562826126299802dac6b44573ec6621c63f1fe88c8cfa1872d171f7ab820e1d6c58b867b69976a8e264eab266f60077ebd301d4c796f17a28e8efca8
6
+ metadata.gz: b52b19f77bc34c45d2fe31c84b8136f4a38838b43f35c9a542ec372b0bffc4597f9b21b2c336af84626b8b58f1afd370b6ea539a271432a7eab0fbfe9affa98f
7
+ data.tar.gz: a0ff65143b452f9afdf3b0b31edde55160bca276438e2f31f40c4c533d5acf882cb48e7bbbf70361ec192d1f85c65aa8bd3120cb2b0d0690a47fc6675a0d8c61
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # `revocare`
2
2
 
3
+ ## [0.2.2]
4
+ - Use "left-to-right" direction for diagrams for better readability
5
+ - Only add "#" to method names and not validator class names
6
+
7
+ ## [0.2.1]
8
+ - Properly handle custom validators
9
+ - Show validator class name instead of underscore-d name
10
+
3
11
  ## [0.2.0]
4
12
  - Create a directory to hold all files. Also, create a file for each model rather than a single file for all models. This vastly improves readability.
5
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- revocare (0.2.0)
4
+ revocare (0.2.2)
5
5
  activerecord (>= 5.2, < 7.1)
6
6
  activesupport (>= 5.2, < 7.1)
7
7
  ruby-graphviz (~> 1.2)
@@ -65,9 +65,14 @@ module Revocare
65
65
 
66
66
  def extract_methods(callback_filter)
67
67
  if callback_filter.is_a?(ActiveModel::Validator)
68
- name = callback_filter.class.name.demodulize.underscore
69
- callback_filter.attributes.map do |attr|
70
- [name, attr].join(":")
68
+ name = callback_filter.class.name.demodulize
69
+
70
+ if callback_filter.respond_to?(:attributes)
71
+ callback_filter.attributes.map do |attribute|
72
+ [name, attribute].join(":")
73
+ end
74
+ else
75
+ [name]
71
76
  end
72
77
  else
73
78
  [callback_filter.to_s]
@@ -34,7 +34,7 @@ module Revocare
34
34
 
35
35
  if format == GRAPHVIZ_FORMAT
36
36
  data.each_with_index do |model_data, index|
37
- @current_graph = GraphViz.new(:G, type: :digraph)
37
+ @current_graph = GraphViz.new(:G, type: :digraph, rankdir: "LR")
38
38
 
39
39
  model_name = model_data[:model]
40
40
  model_node = add_model_node(model_name)
@@ -76,7 +76,11 @@ module Revocare
76
76
  end
77
77
 
78
78
  def add_callback_chain_node(name, index, order)
79
- label = "#{order + 1}) ##{name}"
79
+ label = if name[0].match(/[[:upper:]]/)
80
+ "#{order + 1}) #{name}"
81
+ else
82
+ "#{order + 1}) ##{name}"
83
+ end
80
84
  add_node(name, index, :ellipse, label)
81
85
  end
82
86
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Revocare
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revocare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-22 00:00:00.000000000 Z
11
+ date: 2023-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord