who_am_i 0.0.4 → 0.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07fcf629d4740c2260df772d2471b262ab4c191b
|
4
|
+
data.tar.gz: b18ae631e989115427d6139b61d5869b617c98d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1bd59efc01acd70020e97d884617e4c81699a17193f40af474162a62d8352e9c7ce5172f452102c60c01cf1a0ff382b19c0fef5a50818a31476d7b3b39949b5
|
7
|
+
data.tar.gz: 935cee6e7c3ce8147bf4ff85615c51b4162039d90c13dbc3c27e8384ce3b3ed3caafd9fbe179a4986b4c395ca6e1f551312ca647aa55945d07ce59c8fffc1a14
|
@@ -1,20 +1,13 @@
|
|
1
1
|
module WhoAmI
|
2
|
-
class
|
3
|
-
def
|
4
|
-
|
5
|
-
@classes = [@current_class]
|
6
|
-
end
|
7
|
-
|
8
|
-
def read(file)
|
9
|
-
content = File.read(file)
|
2
|
+
class FindClasses < Parser::AST::Processor
|
3
|
+
def read_and_call(path)
|
4
|
+
content = File.read(path)
|
10
5
|
sexp = Parser::CurrentRuby.parse(content)
|
11
6
|
|
12
|
-
|
13
|
-
klass.model_filepath = file
|
14
|
-
end
|
7
|
+
call(sexp)
|
15
8
|
end
|
16
9
|
|
17
|
-
def
|
10
|
+
def call(sexp)
|
18
11
|
@current_class = ExtractedClass.new(nil)
|
19
12
|
@classes = [@current_class]
|
20
13
|
|
@@ -4,7 +4,11 @@ module WhoAmI
|
|
4
4
|
include ProcParty
|
5
5
|
|
6
6
|
def call
|
7
|
-
ActiveRecord::Base.connection.
|
7
|
+
if ActiveRecord::Base.connection.respond_to?(:data_sources)
|
8
|
+
ActiveRecord::Base.connection.data_sources
|
9
|
+
else
|
10
|
+
ActiveRecord::Base.connection.tables
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
@@ -4,10 +4,10 @@ module WhoAmI
|
|
4
4
|
include ProcParty
|
5
5
|
|
6
6
|
def call(path)
|
7
|
-
walker = WhoAmI::
|
8
|
-
extracted_classes = walker.
|
7
|
+
walker = WhoAmI::FindClasses.new
|
8
|
+
extracted_classes = walker.read_and_call(path)
|
9
9
|
|
10
|
-
extracted_classes
|
10
|
+
extracted_classes.each { |klass| klass.model_filepath = path }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/lib/who_am_i/version.rb
CHANGED
data/lib/who_am_i.rb
CHANGED
@@ -10,7 +10,7 @@ require "who_am_i/comment"
|
|
10
10
|
require "who_am_i/table_info"
|
11
11
|
require "who_am_i/table_column_info"
|
12
12
|
require "who_am_i/version"
|
13
|
-
require "who_am_i/
|
13
|
+
require "who_am_i/find_classes"
|
14
14
|
require "who_am_i/text_table"
|
15
15
|
require "who_am_i/error"
|
16
16
|
require "who_am_i/config"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: who_am_i
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Ahn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- lib/who_am_i/config.rb
|
232
232
|
- lib/who_am_i/error.rb
|
233
233
|
- lib/who_am_i/extracted_class.rb
|
234
|
+
- lib/who_am_i/find_classes.rb
|
234
235
|
- lib/who_am_i/function/annotate_models.rb
|
235
236
|
- lib/who_am_i/function/compute_comment.rb
|
236
237
|
- lib/who_am_i/function/compute_content.rb
|
@@ -256,7 +257,6 @@ files:
|
|
256
257
|
- lib/who_am_i/tasks.rake
|
257
258
|
- lib/who_am_i/text_table.rb
|
258
259
|
- lib/who_am_i/version.rb
|
259
|
-
- lib/who_am_i/walker.rb
|
260
260
|
- who_am_i.gemspec
|
261
261
|
homepage:
|
262
262
|
licenses:
|