rails_deprecated_syntax 0.0.1 → 0.0.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: 5bac8e712e0cc835bae57c75744de878936f3b8bb2244f8f0734c69a0f1ba9f9
4
- data.tar.gz: 7313b31544d590af3f21e9228c607265ddb0aa8b9d657fcfde02fadb45354602
3
+ metadata.gz: 64040d76c1de52e014243be8a403d4b9846c73da46a453d7e0fd9d043c3b9760
4
+ data.tar.gz: 858b06c5cedf897ad5d990fa4ff292a0040532d749ed75b7adda827a7e3619ae
5
5
  SHA512:
6
- metadata.gz: c4daa466c3b538d1453eb30cb922e77539a5c204ca902c1264a99f9766533232e12f776e7e1b1fab263fb721daba675ef6d9a2597211022cd63e08d57d3bc3e0
7
- data.tar.gz: b3b4262da740d459e314d645e4ad82b1335a0ede48ff733ea0bc75746db79cb6d102715cd8051756174ecdf5595059ca7c29bb793a79b92bfdfaac8446cc8403
6
+ metadata.gz: 88da00abf6b478ee8929f5ef842114f4201f6ed220dda4cee40616ec7f8b3e383458bd19ce86892f58bac3769b9d7c77d64ff789d7a53f5c4954b18598e7fccd
7
+ data.tar.gz: c1b7373f87d29d4c3b458c905735c25a16e30a84a817eb2269dae9ec6cb2c5549606ff0ee241d25e4b346bf54eb0a800eadec4ced8476bfb79628de9c3bdca19
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rails_deprecated_syntax/cli'
3
+
4
+ RailsDeprecatedSyntax::Cli.start(ARGV.last)
@@ -1,41 +1 @@
1
- class RailsDeprecatedSyntax
2
-
3
- # DEPRECATIONS illustrates wich methods had been deprecated
4
- # see more on https=>//edgeguides.rubyonrails.org/5_0_release_notes.html
5
- DEPRECATIONS = {
6
- 'config.static_cache_control'=> 'Deprecated config.static_cache_control in favor of config.public_file_server.headers',
7
- 'config.serve_static_files'=> 'Deprecated config.serve_static_files in favor of config.public_file_server.enabled',
8
- '_filter'=> 'Deprecated all *_filter callbacks in favor of *_action callbacks',
9
- '_via_redirect'=> 'Deprecated *_via_redirect integration test methods. Use follow_redirect! manually after the request call for the same behavior',
10
- 'skip_action_callback'=> 'Deprecated AbstractController#skip_action_callback in favor of individual skip_callback methods.',
11
- 'render[[:space:]]nothing'=> 'Deprecated :nothing option for render method',
12
- 'render[[:space:]]\:nothing'=> 'Deprecated :nothing option for render method',
13
- 'redirect_to[[:space:]]:back'=> 'Deprecated redirect_to :back in favor of redirect_back',
14
- 'table_exists?'=> 'Deprecated table_exists? - The #table_exists? method would check both tables and views.',
15
- 'add_on_empty'=> 'Deprecated ActiveModel::Errors#add_on_empty and ActiveModel::Errors#add_on_blank with no replacement.',
16
- 'add_on_blank'=> 'Deprecated ActiveModel::Errors#add_on_empty and ActiveModel::Errors#add_on_blank with no replacement.',
17
- 'MissingSourceFile'=> 'Deprecated MissingSourceFile in favor of LoadError',
18
- 'alias_method_chain'=> 'Deprecated alias_method_chain in favour of Module#prepend introduced in Ruby 2.0',
19
- }.freeze
20
-
21
- @report = ''
22
-
23
- def self.check_deprecations(path)
24
- path = path ? " -- #{path}" : '.'
25
-
26
- DEPRECATIONS.map do |k, v|
27
- result = `git grep -nr #{k} #{path}`
28
- next if result.empty?
29
-
30
- @report.concat("---------------------------------------------------------------------\n")
31
- @report.concat("#{v}\n")
32
- @report.concat("#{result}\n")
33
- end
34
-
35
- @report
36
- end
37
-
38
- def self.show_deprecations(path)
39
- puts self.check_deprecations(path)
40
- end
41
- end
1
+ require 'rails_deprecated_syntax/deprecated_syntax'
@@ -0,0 +1,9 @@
1
+ require 'rails_deprecated_syntax/deprecated_syntax'
2
+
3
+ module RailsDeprecatedSyntax
4
+ class Cli
5
+ def self.start(path)
6
+ ::DeprecatedSyntax.show_deprecations(path)
7
+ end
8
+ end
9
+ end
File without changes
@@ -0,0 +1,41 @@
1
+ class DeprecatedSyntax
2
+
3
+ # DEPRECATIONS illustrates wich methods had been deprecated
4
+ # see more on https=>//edgeguides.rubyonrails.org/5_0_release_notes.html
5
+ DEPRECATIONS = {
6
+ 'config.static_cache_control'=> 'Deprecated config.static_cache_control in favor of config.public_file_server.headers',
7
+ 'config.serve_static_files'=> 'Deprecated config.serve_static_files in favor of config.public_file_server.enabled',
8
+ '_filter'=> 'Deprecated all *_filter callbacks in favor of *_action callbacks',
9
+ '_via_redirect'=> 'Deprecated *_via_redirect integration test methods. Use follow_redirect! manually after the request call for the same behavior',
10
+ 'skip_action_callback'=> 'Deprecated AbstractController#skip_action_callback in favor of individual skip_callback methods.',
11
+ 'render[[:space:]]nothing'=> 'Deprecated :nothing option for render method',
12
+ 'render[[:space:]]\:nothing'=> 'Deprecated :nothing option for render method',
13
+ 'redirect_to[[:space:]]:back'=> 'Deprecated redirect_to :back in favor of redirect_back',
14
+ 'table_exists?'=> 'Deprecated table_exists? - The #table_exists? method would check both tables and views.',
15
+ 'add_on_empty'=> 'Deprecated ActiveModel::Errors#add_on_empty and ActiveModel::Errors#add_on_blank with no replacement.',
16
+ 'add_on_blank'=> 'Deprecated ActiveModel::Errors#add_on_empty and ActiveModel::Errors#add_on_blank with no replacement.',
17
+ 'MissingSourceFile'=> 'Deprecated MissingSourceFile in favor of LoadError',
18
+ 'alias_method_chain'=> 'Deprecated alias_method_chain in favour of Module#prepend introduced in Ruby 2.0',
19
+ }.freeze
20
+
21
+ @report = ''
22
+
23
+ def self.check_deprecations(path)
24
+ path = path ? " -- #{path}" : '.'
25
+
26
+ DEPRECATIONS.map do |k, v|
27
+ result = `git grep -nr #{k} #{path}`
28
+ next if result.empty?
29
+
30
+ @report.concat("---------------------------------------------------------------------\n")
31
+ @report.concat("#{v}\n")
32
+ @report.concat("#{result}\n")
33
+ end
34
+
35
+ @report
36
+ end
37
+
38
+ def self.show_deprecations(path)
39
+ puts self.check_deprecations(path)
40
+ end
41
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_deprecated_syntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandra S. Cernas
@@ -14,11 +14,16 @@ description: When trying to upgrate to Rails 5, there could be lots of methods t
14
14
  not longer work, this gem aims to find the easy replaceable deprecated methods within
15
15
  your app based on the Release Notes of version 5
16
16
  email: stephaniacernas@gmail.com
17
- executables: []
17
+ executables:
18
+ - check_deprecations
18
19
  extensions: []
19
20
  extra_rdoc_files: []
20
21
  files:
22
+ - bin/check_deprecations
21
23
  - lib/rails_deprecated_syntax.rb
24
+ - lib/rails_deprecated_syntax/cli.rb
25
+ - lib/rails_deprecated_syntax/deprecated.rb
26
+ - lib/rails_deprecated_syntax/deprecated_syntax.rb
22
27
  homepage: https://github.com/emerak/rails_deprecated_syntax
23
28
  licenses:
24
29
  - MIT