Skip to content

Commit 8f9e7e2

Browse files
committed
Merge branch 'develop' of https://github.com/ctran/annotate_models into develop
2 parents fcce15a + 7863949 commit 8f9e7e2

File tree

8 files changed

+102
-97
lines changed

8 files changed

+102
-97
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 2.6.7

Gemfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
ruby '>= 2.2.0'
3+
ruby '>= 2.4.0'
44

55
gem 'activerecord', '>= 4.2.5', '< 6', require: false
66
gem 'rake', require: false
@@ -20,7 +20,10 @@ group :development, :test do
2020
gem 'rspec', require: false
2121

2222
gem 'rubocop', '~> 0.68.1', require: false unless RUBY_VERSION =~ /^1.8/
23-
gem 'simplecov', require: false
23+
# gem 'rubocop', '~> 1.12', require: false
24+
# gem 'rubocop-rake', require: false
25+
# gem 'rubocop-rspec', require: false
26+
# gem 'simplecov', require: false
2427
gem 'terminal-notifier-guard', require: false
2528

2629
gem 'codeclimate-test-reporter'

Guardfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Note: The cmd option is now required due to the increasing number of ways
1+
# NOTE: The cmd option is now required due to the increasing number of ways
22
# rspec may be run, below are examples of the most common uses.
33
# * bundler: 'bundle exec rspec'
44
# * bundler binstubs: 'bin/rspec'

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def exit_exception(e)
33
exit e.status_code
44
end
55

6-
# Note : this causes annoying psych warnings under Ruby 1.9.2-p180; to fix, upgrade to 1.9.3
6+
# NOTE: this causes annoying psych warnings under Ruby 1.9.2-p180; to fix, upgrade to 1.9.3
77
begin
88
require 'bundler'
99
Bundler.setup(:default, :development)
@@ -162,7 +162,7 @@ namespace :integration do
162162
fixtures[Digest::MD5.hexdigest(File.read(fname))] = File.expand_path(fname)
163163
end
164164

165-
candidates.keys.each do |digest|
165+
candidates.each_key do |digest|
166166
next unless fixtures.key?(digest)
167167
candidates[digest].each do |fname|
168168
# Double-check contents in case of hash collision...

lib/annotate/annotate_models.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,8 @@ def get_loaded_model(model_path, file)
637637
# auto_load/eager_load paths. Try all possible model paths one by one.
638638
absolute_file = File.expand_path(file)
639639
model_paths =
640-
$LOAD_PATH.select { |path| absolute_file.include?(path) }
640+
$LOAD_PATH.map(&:to_s)
641+
.select { |path| absolute_file.include?(path) }
641642
.map { |path| absolute_file.sub(path, '').sub(/\.rb$/, '').sub(/^\//, '') }
642643
model_paths
643644
.map { |path| get_loaded_model_by_path(path) }
@@ -646,9 +647,7 @@ def get_loaded_model(model_path, file)
646647

647648
# Retrieve loaded model class by path to the file where it's supposed to be defined.
648649
def get_loaded_model_by_path(model_path)
649-
klass = ActiveSupport::Inflector.constantize(ActiveSupport::Inflector.camelize(model_path))
650-
651-
klass if klass.is_a?(Class) && klass < ActiveRecord::Base
650+
ActiveSupport::Inflector.constantize(ActiveSupport::Inflector.camelize(model_path))
652651
rescue StandardError, LoadError
653652
# Revert to the old way but it is not really robust
654653
ObjectSpace.each_object(::Class)

spec/integration/rails_5.2.4.1/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ gem 'rails', '~> 5.2.4', '>= 5.2.4.1'
66
# Use sqlite3 as the database for Active Record
77
gem 'sqlite3'
88
# Use Puma as the app server
9-
gem 'puma', '~> 4.3'
9+
gem 'puma', '~> 5.3'
1010
# Use SCSS for stylesheets
1111
gem 'sass-rails', '~> 5.0'
1212
# Use Uglifier as compressor for JavaScript assets

spec/integration/rails_5.2.4.1/Gemfile.lock

Lines changed: 69 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@ PATH
88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
actioncable (5.2.4.1)
12-
actionpack (= 5.2.4.1)
11+
actioncable (5.2.5)
12+
actionpack (= 5.2.5)
1313
nio4r (~> 2.0)
1414
websocket-driver (>= 0.6.1)
15-
actionmailer (5.2.4.1)
16-
actionpack (= 5.2.4.1)
17-
actionview (= 5.2.4.1)
18-
activejob (= 5.2.4.1)
15+
actionmailer (5.2.5)
16+
actionpack (= 5.2.5)
17+
actionview (= 5.2.5)
18+
activejob (= 5.2.5)
1919
mail (~> 2.5, >= 2.5.4)
2020
rails-dom-testing (~> 2.0)
21-
actionpack (5.2.4.1)
22-
actionview (= 5.2.4.1)
23-
activesupport (= 5.2.4.1)
21+
actionpack (5.2.5)
22+
actionview (= 5.2.5)
23+
activesupport (= 5.2.5)
2424
rack (~> 2.0, >= 2.0.8)
2525
rack-test (>= 0.6.3)
2626
rails-dom-testing (~> 2.0)
2727
rails-html-sanitizer (~> 1.0, >= 1.0.2)
28-
actionview (5.2.4.1)
29-
activesupport (= 5.2.4.1)
28+
actionview (5.2.5)
29+
activesupport (= 5.2.5)
3030
builder (~> 3.1)
3131
erubi (~> 1.4)
3232
rails-dom-testing (~> 2.0)
3333
rails-html-sanitizer (~> 1.0, >= 1.0.3)
34-
activejob (5.2.4.1)
35-
activesupport (= 5.2.4.1)
34+
activejob (5.2.5)
35+
activesupport (= 5.2.5)
3636
globalid (>= 0.3.6)
37-
activemodel (5.2.4.1)
38-
activesupport (= 5.2.4.1)
39-
activerecord (5.2.4.1)
40-
activemodel (= 5.2.4.1)
41-
activesupport (= 5.2.4.1)
37+
activemodel (5.2.5)
38+
activesupport (= 5.2.5)
39+
activerecord (5.2.5)
40+
activemodel (= 5.2.5)
41+
activesupport (= 5.2.5)
4242
arel (>= 9.0)
43-
activestorage (5.2.4.1)
44-
actionpack (= 5.2.4.1)
45-
activerecord (= 5.2.4.1)
46-
marcel (~> 0.3.1)
47-
activesupport (5.2.4.1)
43+
activestorage (5.2.5)
44+
actionpack (= 5.2.5)
45+
activerecord (= 5.2.5)
46+
marcel (~> 1.0.0)
47+
activesupport (5.2.5)
4848
concurrent-ruby (~> 1.0, >= 1.0.2)
4949
i18n (>= 0.7, < 2)
5050
minitest (~> 5.1)
@@ -55,11 +55,11 @@ GEM
5555
io-like (~> 0.3.0)
5656
arel (9.0.0)
5757
bindex (0.8.1)
58-
bootsnap (1.4.5)
58+
bootsnap (1.7.3)
5959
msgpack (~> 1.0)
6060
builder (3.2.4)
61-
byebug (11.1.1)
62-
capybara (3.31.0)
61+
byebug (11.1.3)
62+
capybara (3.32.2)
6363
addressable
6464
mini_mime (>= 0.1.3)
6565
nokogiri (~> 1.8)
@@ -78,75 +78,73 @@ GEM
7878
coffee-script-source
7979
execjs
8080
coffee-script-source (1.12.2)
81-
concurrent-ruby (1.1.5)
81+
concurrent-ruby (1.1.8)
8282
crass (1.0.6)
83-
erubi (1.9.0)
83+
erubi (1.10.0)
8484
execjs (2.7.0)
85-
ffi (1.12.2)
85+
ffi (1.15.0)
8686
globalid (0.4.2)
8787
activesupport (>= 4.2.0)
88-
i18n (1.8.2)
88+
i18n (1.8.10)
8989
concurrent-ruby (~> 1.0)
90-
io-like (0.3.0)
91-
jbuilder (2.9.1)
92-
activesupport (>= 4.2.0)
90+
io-like (0.3.1)
91+
jbuilder (2.11.2)
92+
activesupport (>= 5.0.0)
9393
listen (3.1.5)
9494
rb-fsevent (~> 0.9, >= 0.9.4)
9595
rb-inotify (~> 0.9, >= 0.9.7)
9696
ruby_dep (~> 1.2)
97-
loofah (2.4.0)
97+
loofah (2.9.0)
9898
crass (~> 1.0.2)
9999
nokogiri (>= 1.5.9)
100100
mail (2.7.1)
101101
mini_mime (>= 0.1.1)
102-
marcel (0.3.3)
103-
mimemagic (~> 0.3.2)
104-
method_source (0.9.2)
105-
mimemagic (0.3.4)
106-
mini_mime (1.0.2)
102+
marcel (1.0.1)
103+
method_source (1.0.0)
104+
mini_mime (1.0.3)
107105
mini_portile2 (2.4.0)
108-
minitest (5.14.0)
109-
msgpack (1.3.2)
110-
nio4r (2.5.2)
111-
nokogiri (1.10.8)
106+
minitest (5.14.4)
107+
msgpack (1.4.2)
108+
nio4r (2.5.7)
109+
nokogiri (1.10.10)
112110
mini_portile2 (~> 2.4.0)
113-
public_suffix (4.0.3)
114-
puma (4.3.3)
111+
public_suffix (4.0.6)
112+
puma (5.3.2)
115113
nio4r (~> 2.0)
116-
rack (2.1.2)
114+
rack (2.2.3)
117115
rack-test (1.1.0)
118116
rack (>= 1.0, < 3)
119-
rails (5.2.4.1)
120-
actioncable (= 5.2.4.1)
121-
actionmailer (= 5.2.4.1)
122-
actionpack (= 5.2.4.1)
123-
actionview (= 5.2.4.1)
124-
activejob (= 5.2.4.1)
125-
activemodel (= 5.2.4.1)
126-
activerecord (= 5.2.4.1)
127-
activestorage (= 5.2.4.1)
128-
activesupport (= 5.2.4.1)
117+
rails (5.2.5)
118+
actioncable (= 5.2.5)
119+
actionmailer (= 5.2.5)
120+
actionpack (= 5.2.5)
121+
actionview (= 5.2.5)
122+
activejob (= 5.2.5)
123+
activemodel (= 5.2.5)
124+
activerecord (= 5.2.5)
125+
activestorage (= 5.2.5)
126+
activesupport (= 5.2.5)
129127
bundler (>= 1.3.0)
130-
railties (= 5.2.4.1)
128+
railties (= 5.2.5)
131129
sprockets-rails (>= 2.0.0)
132130
rails-dom-testing (2.0.3)
133131
activesupport (>= 4.2.0)
134132
nokogiri (>= 1.6)
135133
rails-html-sanitizer (1.3.0)
136134
loofah (~> 2.3)
137-
railties (5.2.4.1)
138-
actionpack (= 5.2.4.1)
139-
activesupport (= 5.2.4.1)
135+
railties (5.2.5)
136+
actionpack (= 5.2.5)
137+
activesupport (= 5.2.5)
140138
method_source
141139
rake (>= 0.8.7)
142140
thor (>= 0.19.0, < 2.0)
143-
rake (13.0.1)
144-
rb-fsevent (0.10.3)
141+
rake (13.0.3)
142+
rb-fsevent (0.10.4)
145143
rb-inotify (0.10.1)
146144
ffi (~> 1.0)
147-
regexp_parser (1.6.0)
145+
regexp_parser (1.8.2)
148146
ruby_dep (1.5.0)
149-
rubyzip (2.2.0)
147+
rubyzip (2.3.0)
150148
sass (3.7.4)
151149
sass-listen (~> 4.0.0)
152150
sass-listen (4.0.0)
@@ -164,18 +162,18 @@ GEM
164162
sprockets (3.7.2)
165163
concurrent-ruby (~> 1.0)
166164
rack (> 1, < 3)
167-
sprockets-rails (3.2.1)
165+
sprockets-rails (3.2.2)
168166
actionpack (>= 4.0)
169167
activesupport (>= 4.0)
170168
sprockets (>= 3.0.0)
171169
sqlite3 (1.4.2)
172-
thor (1.0.1)
170+
thor (1.1.0)
173171
thread_safe (0.3.6)
174172
tilt (2.0.10)
175173
turbolinks (5.2.1)
176174
turbolinks-source (~> 5.2)
177175
turbolinks-source (5.2.0)
178-
tzinfo (1.2.6)
176+
tzinfo (1.2.9)
179177
thread_safe (~> 0.1)
180178
uglifier (4.2.0)
181179
execjs (>= 0.3.0, < 3)
@@ -184,9 +182,9 @@ GEM
184182
activemodel (>= 5.0)
185183
bindex (>= 0.4.0)
186184
railties (>= 5.0)
187-
websocket-driver (0.7.1)
185+
websocket-driver (0.7.3)
188186
websocket-extensions (>= 0.1.0)
189-
websocket-extensions (0.1.4)
187+
websocket-extensions (0.1.5)
190188
xpath (3.2.0)
191189
nokogiri (~> 1.8)
192190

@@ -202,7 +200,7 @@ DEPENDENCIES
202200
coffee-rails (~> 4.2)
203201
jbuilder (~> 2.5)
204202
listen (>= 3.0.5, < 3.2)
205-
puma (~> 4.3)
203+
puma (~> 5.3)
206204
rails (~> 5.2.4, >= 5.2.4.1)
207205
sass-rails (~> 5.0)
208206
selenium-webdriver
@@ -213,4 +211,4 @@ DEPENDENCIES
213211
web-console (>= 3.3.0)
214212

215213
BUNDLED WITH
216-
2.1.2
214+
2.2.15

0 commit comments

Comments
 (0)