solargraph-rails 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/README.md +5 -3
- data/lib/solargraph/rails/pin_creator.rb +1 -0
- data/lib/solargraph/rails/ruby_parser.rb +7 -0
- data/lib/solargraph/rails/version.rb +1 -1
- data/solargraph-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60dc687282db670b1cfa0b017c2e0d994f86e6adafca80d99eb4d455aaf2b68f
|
4
|
+
data.tar.gz: 54f79f529ed0fee77b93d88d7a56868b040ded60aa836f001d27e26ddbef843d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b358c11d03830142a393eb55281fa149b8b784474c681c907b509784467cd4b8d6712de6afd1db135dd2794b7888aca02962f483a74b5897c1676440fa6b398e
|
7
|
+
data.tar.gz: 3ebbd33b3f491a2e4a9e2a4b86ecfd08c6eab3a8f3475157fb36fb8683d361ebe000bfcad019b8740761407187e5b7ed3bd00483c388e1fcea5bc50c0523745d
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
solargraph-rails (0.2.0
|
5
|
-
solargraph (~> 0.
|
4
|
+
solargraph-rails (0.2.0)
|
5
|
+
solargraph (~> 0.41.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
rexml
|
22
22
|
kramdown-parser-gfm (1.1.0)
|
23
23
|
kramdown (~> 2.0)
|
24
|
-
mini_portile2 (2.5.
|
24
|
+
mini_portile2 (2.5.3)
|
25
25
|
nokogiri (1.11.6)
|
26
26
|
mini_portile2 (~> 2.5.0)
|
27
27
|
racc (~> 1.4)
|
@@ -48,19 +48,19 @@ GEM
|
|
48
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
49
|
rspec-support (~> 3.10.0)
|
50
50
|
rspec-support (3.10.0)
|
51
|
-
rubocop (1.
|
51
|
+
rubocop (1.16.0)
|
52
52
|
parallel (~> 1.10)
|
53
53
|
parser (>= 3.0.0.0)
|
54
54
|
rainbow (>= 2.2.2, < 4.0)
|
55
55
|
regexp_parser (>= 1.8, < 3.0)
|
56
56
|
rexml
|
57
|
-
rubocop-ast (>= 1.
|
57
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
58
58
|
ruby-progressbar (~> 1.7)
|
59
59
|
unicode-display_width (>= 1.4.0, < 3.0)
|
60
60
|
rubocop-ast (1.7.0)
|
61
61
|
parser (>= 3.0.1.1)
|
62
62
|
ruby-progressbar (1.11.0)
|
63
|
-
solargraph (0.
|
63
|
+
solargraph (0.41.1)
|
64
64
|
backport (~> 1.1)
|
65
65
|
benchmark
|
66
66
|
bundler (>= 1.17.2)
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Solargraph::Rails - Help solargraph with Rails
|
2
2
|
|
3
3
|
## Work in progress - here be dragons
|
4
|
-
There are significant rough edges to this gem still.
|
4
|
+
There are significant rough edges to this gem still.
|
5
5
|
|
6
6
|
## Models
|
7
7
|
Given a typical Rails model like this:
|
@@ -63,13 +63,15 @@ This project is being used to write production code by the maintainer, but it is
|
|
63
63
|
|
64
64
|
Typically gems like these are not installed via the Gemfile, because most projects have more than one contributor and other contributors might have different setups for their editors in mind. Instead you need to use `gem install`.
|
65
65
|
|
66
|
-
`gem install solargraph-rails
|
66
|
+
`gem install solargraph-rails`
|
67
67
|
|
68
68
|
#### Alternative: using bundler
|
69
|
-
If you do want to use bundler, add `gem 'solargraph-rails', '0.2.0
|
69
|
+
If you do want to use bundler, add `gem 'solargraph-rails', '~> 0.2.0'`
|
70
70
|
|
71
71
|
### Add `solargraph-rails` to your `.solargraph.yml`
|
72
72
|
|
73
|
+
(if you don't have a `.solargraph.yml` in your project root, you can run `solargraph config` to add one)
|
74
|
+
|
73
75
|
```
|
74
76
|
plugins:
|
75
77
|
- solargraph-rails
|
@@ -6,6 +6,7 @@ module Solargraph
|
|
6
6
|
def initialize(file_contents: '')
|
7
7
|
@lines = file_contents.lines
|
8
8
|
@comment_handlers = []
|
9
|
+
@non_comment_handlers = []
|
9
10
|
@class_handlers = []
|
10
11
|
@module_handlers = []
|
11
12
|
end
|
@@ -22,6 +23,10 @@ module Solargraph
|
|
22
23
|
@module_handlers << blk
|
23
24
|
end
|
24
25
|
|
26
|
+
def on_ruby_line(&blk)
|
27
|
+
@non_comment_handlers << blk
|
28
|
+
end
|
29
|
+
|
25
30
|
def parse
|
26
31
|
@lines
|
27
32
|
.map(&:rstrip)
|
@@ -32,6 +37,8 @@ module Solargraph
|
|
32
37
|
if is_comment?(line)
|
33
38
|
comment_content = line.gsub(/#\s*/, '')
|
34
39
|
@comment_handlers.each { |handler| handler.call(comment_content) }
|
40
|
+
else
|
41
|
+
@non_comment_handlers.each { |handler| handler.call(line) }
|
35
42
|
end
|
36
43
|
|
37
44
|
if is_class?(line)
|
data/solargraph-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solargraph-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fritz Meissner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.41.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.41.1
|
69
69
|
description: Add reflection on ActiveModel dynamic attributes that will be created
|
70
70
|
at runtime
|
71
71
|
email:
|