rails-annotate-solargraph 0.5.1 → 0.5.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: a3f9d275d9de0b0a37b8fae4f7f65ec2121ca25990ccfcc75e246e4c28711531
4
- data.tar.gz: 1467357d585931d57d440d964a54ead827a964112757ef53a3253c86ac5d3790
3
+ metadata.gz: ac8d7c78804560db17c10943c462e838059d5f74d6d5d2664083c6da0f26c43a
4
+ data.tar.gz: b9a0d329cb657bdb74220b75ec14a53785d75f2e6847c7bc41e884103edb21df
5
5
  SHA512:
6
- metadata.gz: d93389956d525b72fff9a08ab11bf48b65733fe3eed85c114fee771be0733b27205521d49512c8d3403a5ab1e6dbae699e40d434a10e642ec6eadc4426b42908
7
- data.tar.gz: 225b3e7c0937c65940a7020162a0d2c2d91c1e83420a300d4d0740b187e16ca7119f554e61f73d20ce79fcb5e26a36b99051d8d0cfd3a17afd7c3e366e5cb977
6
+ metadata.gz: 39567ae796da52823201081813575f0859aefad622a5c43522b0b82f0864f4f87a8e3cccc65a83d9631c9a6f4c9febae0968b2e51980d679d7f0736e6c55c552
7
+ data.tar.gz: a8d6a79aa396d9110bc157703678d91f8b0e0f664f4175f296a47e07429727dbc3eb7d3e6025facaaff3b3abea94f151abeaece7e07f2160ba4eb1d48cf23c88
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.2] - 2022-04-20
4
+
5
+ - proxy method overrides get loaded during app initialization
6
+
3
7
  ## [0.5.1] - 2022-04-20
4
8
 
5
9
  - `ActiveRecord` scopes are now documented
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails-annotate-solargraph (0.5.1)
4
+ rails-annotate-solargraph (0.5.2)
5
5
  rails (>= 5.0, < 8.0)
6
6
  solargraph
7
7
  yard
@@ -5,11 +5,13 @@ if ::Rails.env.development?
5
5
  namespace :solargraph do
6
6
  desc "Add YARD comments documenting the models' schemas"
7
7
  task generate: :environment do
8
+ ::ENV['ANNOTATE_SOLARGRAPH_RAKE_TASK'] = 'true'
8
9
  ::Rails::Annotate::Solargraph.generate
9
10
  end
10
11
 
11
12
  desc "Remove YARD comments documenting the models' schemas"
12
13
  task remove: :environment do
14
+ ::ENV['ANNOTATE_SOLARGRAPH_RAKE_TASK'] = 'true'
13
15
  ::Rails::Annotate::Solargraph.remove
14
16
  end
15
17
  end
@@ -5,6 +5,8 @@ class ActiveRecord::Base
5
5
  alias orig_scope scope
6
6
 
7
7
  def scope(*args, **kwargs, &block)
8
+ return orig_scope(*args, **kwargs, &block) unless ::ENV['ANNOTATE_SOLARGRAPH_RAKE_TASK']
9
+
8
10
  file_path, scope_line_number = caller.first.split(':')
9
11
  scope_line_number = scope_line_number.to_i
10
12
  scope_name = args.first
@@ -35,7 +35,10 @@ module Rails
35
35
 
36
36
  class << self
37
37
  # @return [Hash{Class => Array<Rails::Annotate::Solargraph::Model::Scope>}]
38
- attr_reader :scopes
38
+ def scopes
39
+ @scopes ||= {}
40
+ @scopes
41
+ end
39
42
 
40
43
  # @param name [Symbol]
41
44
  # @param model_class [Class]
@@ -3,7 +3,7 @@
3
3
  module Rails
4
4
  module Annotate
5
5
  module Solargraph
6
- VERSION = '0.5.1'
6
+ VERSION = '0.5.2'
7
7
  end
8
8
  end
9
9
  end
@@ -8,6 +8,11 @@ require_relative "solargraph/configuration"
8
8
  require_relative "solargraph/terminal_colors"
9
9
  require_relative "solargraph/model"
10
10
 
11
+ begin
12
+ require_relative "overrides"
13
+ rescue
14
+ nil
15
+ end
11
16
 
12
17
  module Rails
13
18
  module Annotate
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-annotate-solargraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateusz Drewniak