snapbot 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +19 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +21 -0
- data/README.md +64 -0
- data/Rakefile +12 -0
- data/lib/snapbot/diagram/dot_generator/relationship.rb +19 -0
- data/lib/snapbot/diagram/dot_generator.rb +101 -0
- data/lib/snapbot/diagram.rb +11 -0
- data/lib/snapbot/reflector.rb +64 -0
- data/lib/snapbot/rspec/lets.rb +29 -0
- data/lib/snapbot/version.rb +5 -0
- data/lib/snapbot.rb +9 -0
- data/sig/snapbot.rbs +4 -0
- data/snapbot.gemspec +42 -0
- metadata +133 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ff9b478fc49144d2edf97c515e52f946b3f73a0d939e0de6d9789e6ab207a1b
|
4
|
+
data.tar.gz: 3d10ece40e5e1e2dfc67f8552746f6c2f326b54d0977a2a39764f1ba008a9a97
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dff17039b7af000c3d9a6fb17ba2fc21af8da0a0ab3a72a9b2af098f8b0e06b7c5b3a3230b547d78886f5e9bd320c9c30f2095fdb9e55ee5c892488be5c04e6b
|
7
|
+
data.tar.gz: 578806b5e7c84b72691ebad4069ac39a51c0fcd04b79b62282fbb57fbf096dc88e29e8c23d801e1ed230a8925dc4b004d1c80b80520d7eb3ece9caf612e208e3
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
SuggestExtensions: false
|
4
|
+
|
5
|
+
Metrics/BlockLength:
|
6
|
+
Exclude:
|
7
|
+
- spec/**/*_spec.rb
|
8
|
+
- snapbot.gemspec
|
9
|
+
|
10
|
+
Style/StringLiterals:
|
11
|
+
Enabled: true
|
12
|
+
EnforcedStyle: double_quotes
|
13
|
+
|
14
|
+
Style/StringLiteralsInInterpolation:
|
15
|
+
Enabled: true
|
16
|
+
EnforcedStyle: double_quotes
|
17
|
+
|
18
|
+
Layout/LineLength:
|
19
|
+
Max: 120
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at rgarner@zephyros-systems.co.uk. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 Russell Garner
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Snapbot
|
2
|
+
|
3
|
+
Snapbot generates little diagrams via `save_and_open_diagram` for you to visualise the small constellations of
|
4
|
+
ActiveRecord objects that you find in feature and integration tests. These are most often made by
|
5
|
+
[FactoryBot](https://github.com/thoughtbot/factory_bot) or some other fixture-handling method, but this gem has no
|
6
|
+
opinions on those (beyond namechecking).
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Either `gem install snapbot` or add the gem to your project's `:test` group in the gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
group :test do
|
14
|
+
gem 'snapbot'
|
15
|
+
end
|
16
|
+
```
|
17
|
+
|
18
|
+
Add to your tests:
|
19
|
+
|
20
|
+
```
|
21
|
+
include Snapbot::Diagram
|
22
|
+
```
|
23
|
+
|
24
|
+
Use:
|
25
|
+
|
26
|
+
```
|
27
|
+
blog = Blog.create(title: 'My blog')
|
28
|
+
post = Post.create(title: 'My post', blog: blog)
|
29
|
+
|
30
|
+
save_and_open_diagram
|
31
|
+
```
|
32
|
+
|
33
|
+
## Why?
|
34
|
+
|
35
|
+
Sometimes, you need to create a few ActiveRecord objects for your test suite. Sometimes, there will be a little cluster
|
36
|
+
of objects that need to exist for an integration spec or feature spec to run reliably. And sometimes, it will be 4.30pm
|
37
|
+
and your fixtures or FactoryBot factories feel like they're slipping from what you can reasonably hold in your head.
|
38
|
+
|
39
|
+
We don't all write tests like this. Or rather, not all our tests are like this. But when they are,
|
40
|
+
`save_and_open_diagram` is a quick way to see what's what.
|
41
|
+
|
42
|
+
## Development
|
43
|
+
|
44
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can
|
45
|
+
also run `bin/console` for an interactive prompt that will allow you to experiment.
|
46
|
+
|
47
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
|
48
|
+
version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
|
49
|
+
push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rgarner/snapbot. This project is intended to
|
54
|
+
be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of
|
55
|
+
conduct](https://github.com/rgarner/snapbot/blob/main/CODE_OF_CONDUCT.md).
|
56
|
+
|
57
|
+
## License
|
58
|
+
|
59
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
60
|
+
|
61
|
+
## Code of Conduct
|
62
|
+
|
63
|
+
Everyone interacting in the Snapbot project's codebases, issue trackers, chat rooms and mailing lists is expected to
|
64
|
+
follow the [code of conduct](https://github.com/rgarner/snapbot/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Snapbot
|
4
|
+
class Reflector
|
5
|
+
# A source/destination-based relationship
|
6
|
+
class Relationship
|
7
|
+
attr_accessor :source, :destination
|
8
|
+
|
9
|
+
def initialize(source, destination)
|
10
|
+
self.source = source
|
11
|
+
self.destination = destination
|
12
|
+
end
|
13
|
+
|
14
|
+
def equals(other)
|
15
|
+
source == other.source && destination == other.destination
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "snapbot/reflector"
|
4
|
+
require "snapbot/diagram/dot_generator/relationship"
|
5
|
+
|
6
|
+
if defined?(::RSpec)
|
7
|
+
require "snapbot/rspec/lets"
|
8
|
+
require "binding_of_caller"
|
9
|
+
end
|
10
|
+
|
11
|
+
module Snapbot
|
12
|
+
module Diagram
|
13
|
+
# Get a visual handle on what small constellations of objects we're creating
|
14
|
+
# in specs
|
15
|
+
class DotGenerator
|
16
|
+
def initialize(label: "g", attrs: false, ignore_lets: %i[])
|
17
|
+
@label = label
|
18
|
+
@options = { attrs: attrs }
|
19
|
+
@ignore_lets = ignore_lets
|
20
|
+
|
21
|
+
return unless defined?(::RSpec)
|
22
|
+
|
23
|
+
example = binding.of_caller(1).eval("self")
|
24
|
+
collect_lets(example)
|
25
|
+
end
|
26
|
+
|
27
|
+
def dot
|
28
|
+
renderer = ERB.new(template, trim_mode: "-")
|
29
|
+
renderer.result(self.binding)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
delegate :instances, :relationships, :attributes, to: :reflector
|
35
|
+
|
36
|
+
def reflector
|
37
|
+
@reflector ||= Reflector.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def collect_lets(example)
|
41
|
+
@lets_by_value = RSpec::Lets.new(example).collect.each_with_object({}) do |sym, lets_by_value|
|
42
|
+
value = example.send(sym) unless @ignore_lets.include?(sym)
|
43
|
+
lets_by_value[value] = sym if value.is_a?(Reflector::BASE_ACTIVERECORD_CLASS)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def instance_name(instance)
|
48
|
+
"#{instance.model_name}##{instance.id}"
|
49
|
+
end
|
50
|
+
|
51
|
+
def template
|
52
|
+
<<~ERB
|
53
|
+
digraph "<%= @label %>" {
|
54
|
+
rankdir = "LR";
|
55
|
+
ranksep = "0.5";
|
56
|
+
nodesep = "0.4";
|
57
|
+
pad = "0.4,0.4";
|
58
|
+
margin = "0,0";
|
59
|
+
concentrate = "true";
|
60
|
+
labelloc = "t";
|
61
|
+
fontsize = "13";
|
62
|
+
fontname = "Arial BoldMT";
|
63
|
+
splines = "spline";
|
64
|
+
node[ shape = "Mrecord" , fontsize = "10" , fontname = "ArialMT" , margin = "0.07,0.05" , penwidth = "1.0"];
|
65
|
+
edge[ fontname = "ArialMT" , fontsize = "7" , dir = "both" , arrowsize = "0.9" , penwidth = "1.0" , labelangle = "32" , labeldistance = "1.8"];
|
66
|
+
rankdir = "TB";
|
67
|
+
splines = "spline";
|
68
|
+
<%- instances.each do |instance| -%>
|
69
|
+
"<%= instance_name(instance) %>" [
|
70
|
+
label=<
|
71
|
+
<table border="0" cellborder="0">
|
72
|
+
<%- if @lets_by_value[instance] -%>
|
73
|
+
<tr><td fontsize="8"><font face="Monaco" point-size="8">let(:<%= @lets_by_value[instance] %>)</font></td></tr>
|
74
|
+
<%- end -%>
|
75
|
+
<tr><td><%= instance_name(instance) %></td></tr>
|
76
|
+
</table>
|
77
|
+
<%- if @options[:attrs] -%>
|
78
|
+
|
|
79
|
+
<table border="0" cellborder="0">
|
80
|
+
<%- attributes(instance).each_pair do |attr, value| -%>
|
81
|
+
<tr>
|
82
|
+
<td align="left" width="200" port="<%= attr %>">
|
83
|
+
<%= attr %>
|
84
|
+
<font face="Arial BoldMT" color="grey60"><%= value.inspect %></font>
|
85
|
+
</td>
|
86
|
+
</tr>
|
87
|
+
<%- end -%>
|
88
|
+
</table>
|
89
|
+
<%- end -%>
|
90
|
+
>
|
91
|
+
];
|
92
|
+
<% end %>
|
93
|
+
<%- relationships.each do |relationship| -%>
|
94
|
+
"<%= relationship.source %>" -> "<%= relationship.destination %>" [arrowhead = "none", arrowtail = "normal", weight = "6"];
|
95
|
+
<%- end -%>
|
96
|
+
}
|
97
|
+
ERB
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Snapbot
|
4
|
+
# Print the small constellation of objects in your integration test and how they relate.
|
5
|
+
# Requires Graphviz. Optimised for Mac. YMMV.
|
6
|
+
module Diagram
|
7
|
+
def save_and_open_diagram(**args)
|
8
|
+
DotGenerator.new(**args).open
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_record"
|
4
|
+
|
5
|
+
module Snapbot
|
6
|
+
# Reflect models and instances in a way that's useful for generating a diagram
|
7
|
+
class Reflector
|
8
|
+
BASE_ACTIVERECORD_CLASS = defined?(ApplicationRecord) ? ApplicationRecord : ActiveRecord::Base
|
9
|
+
|
10
|
+
def models(only_with_records: true)
|
11
|
+
@models ||= begin
|
12
|
+
Rails.application.eager_load! if defined?(Rails)
|
13
|
+
BASE_ACTIVERECORD_CLASS.descendants.reject do |c|
|
14
|
+
c.to_s == "Schema" || (only_with_records && c.count.zero?)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def instances
|
20
|
+
@instances ||= models.each_with_object([]) do |klass, array|
|
21
|
+
array << klass.all
|
22
|
+
end.flatten
|
23
|
+
end
|
24
|
+
|
25
|
+
# A Set of relationships to other identified entities
|
26
|
+
def relationships
|
27
|
+
@relationships ||= instances.each_with_object(Set.new) do |instance, set|
|
28
|
+
add_relationships(instance, set)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def add_relationships(instance, set)
|
33
|
+
reflect_associations(instance).each do |association|
|
34
|
+
records = Array(instance.send(association.name)).compact
|
35
|
+
records.each do |record|
|
36
|
+
set.add(Relationship.new(instance_name(instance), instance_name(record)))
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def reflect_associations(instance)
|
42
|
+
(
|
43
|
+
instance.class.reflect_on_all_associations(:has_many).reject { |a| a.name == :schemas } +
|
44
|
+
instance.class.reflect_on_all_associations(:has_one)
|
45
|
+
).flatten
|
46
|
+
end
|
47
|
+
|
48
|
+
def attributes(instance)
|
49
|
+
instance.attributes.to_h.transform_values { |v| v.is_a?(Hash) ? escape_hash(v) : v }
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def instance_name(instance)
|
55
|
+
"#{instance.model_name}##{instance.id}"
|
56
|
+
end
|
57
|
+
|
58
|
+
def escape_hash(hash)
|
59
|
+
hash.each_with_object([]) do |(key, value), array|
|
60
|
+
array << "#{key}: #{value.nil? ? "nil" : value}"
|
61
|
+
end.join(", ")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Snapbot
|
4
|
+
module RSpec
|
5
|
+
# Collect RSpec `let`s for a given example and all her parents
|
6
|
+
class Lets
|
7
|
+
def initialize(example)
|
8
|
+
@example = example
|
9
|
+
end
|
10
|
+
|
11
|
+
def collect
|
12
|
+
_collect(@example.class, [])
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def _collect(klass, lets)
|
18
|
+
lets.tap do
|
19
|
+
next if klass.to_s == "RSpec::ExampleGroups"
|
20
|
+
|
21
|
+
lets.concat(klass::LetDefinitions.instance_methods(false))
|
22
|
+
parent_class = klass.to_s.deconstantize.constantize
|
23
|
+
|
24
|
+
_collect(parent_class, lets)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/snapbot.rb
ADDED
data/sig/snapbot.rbs
ADDED
data/snapbot.gemspec
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/snapbot/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "snapbot"
|
7
|
+
spec.version = Snapbot::VERSION
|
8
|
+
spec.authors = ["Russell Garner"]
|
9
|
+
spec.email = ["rgarner@zephyros-systems.co.uk"]
|
10
|
+
|
11
|
+
spec.summary = "A `save_and_open_diagram` tool to visualise ActiveRecord test records"
|
12
|
+
spec.homepage = "https://github.com/rgarner/snapbot"
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.required_ruby_version = ">= 2.6.0"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/rgarner/snapbot"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/rgarner/snapbot/CHANGELOG.md"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(__dir__) do
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
25
|
+
end
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_dependency "binding_of_caller", "~> 1.0"
|
32
|
+
|
33
|
+
version_string = [">= 6.1"]
|
34
|
+
spec.add_runtime_dependency "actionpack", version_string
|
35
|
+
spec.add_runtime_dependency "activerecord", version_string
|
36
|
+
spec.add_runtime_dependency "activesupport", version_string
|
37
|
+
|
38
|
+
spec.add_development_dependency "sqlite3"
|
39
|
+
|
40
|
+
# For more information and examples about making a new gem, check out our
|
41
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: snapbot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Russell Garner
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: binding_of_caller
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: actionpack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '6.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '6.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activerecord
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '6.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '6.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '6.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '6.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- rgarner@zephyros-systems.co.uk
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".rspec"
|
91
|
+
- ".rubocop.yml"
|
92
|
+
- CHANGELOG.md
|
93
|
+
- CODE_OF_CONDUCT.md
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- lib/snapbot.rb
|
99
|
+
- lib/snapbot/diagram.rb
|
100
|
+
- lib/snapbot/diagram/dot_generator.rb
|
101
|
+
- lib/snapbot/diagram/dot_generator/relationship.rb
|
102
|
+
- lib/snapbot/reflector.rb
|
103
|
+
- lib/snapbot/rspec/lets.rb
|
104
|
+
- lib/snapbot/version.rb
|
105
|
+
- sig/snapbot.rbs
|
106
|
+
- snapbot.gemspec
|
107
|
+
homepage: https://github.com/rgarner/snapbot
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata:
|
111
|
+
homepage_uri: https://github.com/rgarner/snapbot
|
112
|
+
source_code_uri: https://github.com/rgarner/snapbot
|
113
|
+
changelog_uri: https://github.com/rgarner/snapbot/CHANGELOG.md
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 2.6.0
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
requirements: []
|
129
|
+
rubygems_version: 3.3.7
|
130
|
+
signing_key:
|
131
|
+
specification_version: 4
|
132
|
+
summary: A `save_and_open_diagram` tool to visualise ActiveRecord test records
|
133
|
+
test_files: []
|