active_explorer 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -22
- data/Rakefile +0 -3
- data/active_explorer.gemspec +2 -2
- data/docs/images/author_books_reviews.png +0 -0
- data/lib/active_explorer/version.rb +1 -1
- data/lib/exploration.rb +4 -2
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 350cfdb7eafac2d2671f1d1c61183734237befd0
|
4
|
+
data.tar.gz: b7ab716a5f2423778ff9181cacba93678d90efd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65f14a606e3e393a2dbc862fa0a40f87543edef4f241b0a26e5650a1d4b7b49cd5396d8c896f0ffd86d39ca23879f14d18e1693dec5d492b39f36526e2820110
|
7
|
+
data.tar.gz: 128b93d226a28d24113ed9cb1b5d8cd10e897dafd5896ffaf6229131f5242b8fd2837d348e57e28935090af14b72f4aca68ec86c1c9d7b400e754784fe7b57c1
|
data/README.md
CHANGED
@@ -8,11 +8,24 @@ Active Explorer is a Ruby gem for visualization of run-time data and association
|
|
8
8
|
|
9
9
|
How the gem works? It simply looks for `has_many`, `has_one` and `belongs_to` associations
|
10
10
|
and traverse through them to associated objects. Then it does the same with them until it explores all the surroundings.
|
11
|
-
|
11
|
+
|
12
|
+
It then prints nice graph represantation:
|
13
|
+
|
14
|
+
- to image file or
|
15
|
+
- to console
|
12
16
|
|
13
17
|
One picture is worth a thousand words:
|
14
18
|
|
15
|
-
|
19
|
+
![Display hierarchy for Author object.](docs/images/author_books_reviews.png)
|
20
|
+
|
21
|
+
And the same objects in console output:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
Author(1592) {:first_name=>"Perer", :last_name=>"Brett"}
|
25
|
+
-> has Book(1642) {:author_id=>1592, :title=>"The Warded Man", :year=>2008}
|
26
|
+
-> has Review(796) {:stars=>5, :text=>"Very nice book. Life changing experience.", :book_id=>1642}
|
27
|
+
-> has Book(1643) {:author_id=>1592, :title=>"The Desert Spear", :year=>2010}
|
28
|
+
```
|
16
29
|
|
17
30
|
## Installation
|
18
31
|
|
@@ -51,7 +64,7 @@ exf my_object # Prints output as a graph to image file
|
|
51
64
|
|
52
65
|
Note: `ex` is abbreviation for `explore` and `exf` for `explore_to_file` methods.
|
53
66
|
|
54
|
-
See [Examples](#
|
67
|
+
See [Examples](#examples) (or test cases) for more examples.
|
55
68
|
|
56
69
|
## Configuration
|
57
70
|
|
@@ -85,9 +98,9 @@ ex Author.first, class_filter: [:books, :reviews],
|
|
85
98
|
|
86
99
|
Important: Use **plural form** of your classes.
|
87
100
|
|
88
|
-
See [Examples](#
|
101
|
+
See [Examples](#examples) (or test cases) see exact usage.
|
89
102
|
|
90
|
-
Check [Global Configuration](#
|
103
|
+
Check [Global Configuration](#global-configuration) to easily set this filter once for all future calls.
|
91
104
|
|
92
105
|
### Global Configuration
|
93
106
|
|
@@ -195,22 +208,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
195
208
|
|
196
209
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
197
210
|
|
198
|
-
### Migrations
|
199
|
-
|
200
|
-
For testing purposes I use [Standalone Migrations](https://github.com/thuss/standalone-migrations)
|
201
|
-
|
202
|
-
Generate new migration:
|
203
|
-
|
204
|
-
```
|
205
|
-
$ rake db:new_migration name=foo_bar_migration
|
206
|
-
```
|
207
|
-
|
208
|
-
Create database as usually:
|
209
|
-
|
210
|
-
```
|
211
|
-
$ rake db:create db:migrate RAILS_ENV=test
|
212
|
-
```
|
213
|
-
|
214
211
|
## TODO
|
215
212
|
|
216
213
|
- Bug hunt.
|
@@ -219,9 +216,19 @@ $ rake db:create db:migrate RAILS_ENV=test
|
|
219
216
|
- Interactive graph.
|
220
217
|
- Rubymine plugin ;)
|
221
218
|
|
219
|
+
## Known Issues
|
220
|
+
|
221
|
+
### Timeout in Debugger
|
222
|
+
|
223
|
+
When calling `exf` during debugging session in Rubymine, gem returns timeout error. Apart from this message everything works. The image gets saved and it is saved far before the timeout appears.
|
224
|
+
|
225
|
+
It seems that it has something to do with Ruby GraphViz gem.
|
226
|
+
|
227
|
+
If you have any hint on this please contact me.
|
228
|
+
|
222
229
|
## Contributing
|
223
230
|
|
224
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
231
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rascasone/active_explorer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
225
232
|
|
226
233
|
|
227
234
|
## License
|
data/Rakefile
CHANGED
data/active_explorer.gemspec
CHANGED
@@ -29,10 +29,10 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "rspec-nc"
|
30
30
|
spec.add_development_dependency "guard"
|
31
31
|
spec.add_development_dependency "guard-rspec"
|
32
|
+
spec.add_development_dependency "sqlite3"
|
32
33
|
spec.add_development_dependency 'ruby-graphviz', '~> 1.2', '>= 1.2.2'
|
33
|
-
spec.add_development_dependency 'mysql'
|
34
|
-
spec.add_development_dependency 'standalone_migrations'
|
35
34
|
spec.add_development_dependency 'awesome_print'
|
36
35
|
spec.add_development_dependency 'factory_girl'
|
37
36
|
spec.add_development_dependency 'appraisal'
|
37
|
+
spec.add_development_dependency 'pry'
|
38
38
|
end
|
Binary file
|
data/lib/exploration.rb
CHANGED
@@ -43,8 +43,10 @@ module ActiveExplorer
|
|
43
43
|
@class_filter = class_filter || ActiveExplorer::Config.class_filter
|
44
44
|
@class_filter = { show: @class_filter } if @class_filter.is_a?(Array)
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
if @class_filter
|
47
|
+
[:show, :ignore].each do |group|
|
48
|
+
@class_filter[group] = @class_filter[group].present? ? each_val_to_s(@class_filter[group]) : []
|
49
|
+
end
|
48
50
|
end
|
49
51
|
|
50
52
|
@association_filter = association_filter || ActiveExplorer::Config.association_filter
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Ulicny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-graphviz
|
@@ -123,41 +123,41 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: sqlite3
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1.2'
|
132
129
|
- - ">="
|
133
130
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
131
|
+
version: '0'
|
135
132
|
type: :development
|
136
133
|
prerelease: false
|
137
134
|
version_requirements: !ruby/object:Gem::Requirement
|
138
135
|
requirements:
|
139
|
-
- - "~>"
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '1.2'
|
142
136
|
- - ">="
|
143
137
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
138
|
+
version: '0'
|
145
139
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
140
|
+
name: ruby-graphviz
|
147
141
|
requirement: !ruby/object:Gem::Requirement
|
148
142
|
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1.2'
|
149
146
|
- - ">="
|
150
147
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
148
|
+
version: 1.2.2
|
152
149
|
type: :development
|
153
150
|
prerelease: false
|
154
151
|
version_requirements: !ruby/object:Gem::Requirement
|
155
152
|
requirements:
|
153
|
+
- - "~>"
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '1.2'
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
158
|
+
version: 1.2.2
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
|
-
name:
|
160
|
+
name: awesome_print
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - ">="
|
@@ -171,7 +171,7 @@ dependencies:
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
174
|
+
name: factory_girl
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - ">="
|
@@ -185,7 +185,7 @@ dependencies:
|
|
185
185
|
- !ruby/object:Gem::Version
|
186
186
|
version: '0'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
|
-
name:
|
188
|
+
name: appraisal
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - ">="
|
@@ -199,7 +199,7 @@ dependencies:
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
|
-
name:
|
202
|
+
name: pry
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
205
|
- - ">="
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- active_explorer.gemspec
|
238
238
|
- bin/console
|
239
239
|
- bin/setup
|
240
|
+
- docs/images/author_books_reviews.png
|
240
241
|
- gemfiles/activerecord_3_0.gemfile
|
241
242
|
- gemfiles/activerecord_3_0.gemfile.lock
|
242
243
|
- gemfiles/activerecord_3_1.gemfile
|