raise_deprecation_warnings 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1dda3ba58998056747beeb90e7888d646747fee66ee906f1681c050a614c0a09
4
+ data.tar.gz: 0b69b21703186b215ce80c6cfe7964c8084db915a6fda0340510d91531dabbaf
5
+ SHA512:
6
+ metadata.gz: 1c67cd2e6366c7d40bf7311a795d0fc63a24704541674ae717de3efa4d58caf4639e1e3c1ebae5303e38458d973e28a1b1dc2d933d62472368a888d8a1daa16e
7
+ data.tar.gz: ee7c7791f95c5a26a730da7ed61caa3eedc9f924208ed4198e31ed6d26edc2600e0a787f0d9ff36d352fca31722289a1d2bbbc8d397f0a16aead1b347517c0aa
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+ NewCops: enable
4
+
5
+ Style/StringLiterals:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Style/StringLiteralsInInterpolation:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Layout/LineLength:
14
+ Max: 120
15
+
16
+ Style/StringLiterals:
17
+ Enabled: false
18
+
19
+ Style/Documentation:
20
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-02-22
4
+
5
+ - Initial release
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # RaiseDeprecationWarnings
2
+
3
+ Simple gem to replace ActiveSupport warnings to raise an error instead.
4
+
5
+ This gem extend the actiesupport gem to raise an error on deprecation warning.
6
+
7
+ To experiment with that code, run `bin/console` for an interactive prompt.
8
+
9
+ ## Installation
10
+
11
+ TODO: Replace `raise_deprecation_warnings` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
12
+
13
+ Install the gem and add to the application's Gemfile by executing:
14
+
15
+ $ bundle add raise_deprecation_warnings
16
+
17
+ If bundler is not being used to manage dependencies, install the gem by executing:
18
+
19
+ $ gem install raise_deprecation_warnings
20
+
21
+ ## Usage
22
+
23
+ You probably don't want this in production. but on CI, it can help to keep a branch up to date and clear out warnings after you upgrade all dependencies.
24
+
25
+ ## Development
26
+
27
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+
29
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
+
31
+ ## Contributing
32
+
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mathieujobin/raise_deprecation_warnings.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RaiseDeprecationWarnings
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "raise_deprecation_warnings/version"
4
+ require 'active_support'
5
+
6
+ module RaiseDeprecationWarnings
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
10
+
11
+ module ActiveSupport
12
+ class Deprecation
13
+ module Reporting
14
+ def warn(message = nil, callstack = nil)
15
+ return if message =~ /currently checks both tables and views/
16
+
17
+ e = Exception.new(message)
18
+ callstack ||= caller_locations(2)
19
+ e.set_backtrace(callstack.map(&:to_s))
20
+ raise e
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/raise_deprecation_warnings/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "raise_deprecation_warnings"
7
+ spec.version = RaiseDeprecationWarnings::VERSION
8
+ spec.authors = ["Mathieu Jobin"]
9
+ spec.email = ["mathieu@solidcode.bz"]
10
+
11
+ spec.summary = "Simple gem to replace ActiveSupport warnings to raise an error instead."
12
+ spec.description = "Override ActiveSupport::Deprecation class to raise an error."
13
+ spec.homepage = "https://github.com/mathieujobin/raise_deprecation_warnings"
14
+ spec.required_ruby_version = ">= 2.7.0"
15
+
16
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/mathieujobin/raise_deprecation_warnings"
20
+ spec.metadata["changelog_uri"] = "https://github.com/mathieujobin/raise_deprecation_warnings/blob/main/CHANGELOG.md"
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(__dir__) do
25
+ `git ls-files -z`.split("\x0").reject do |f|
26
+ (File.expand_path(f) == __FILE__) ||
27
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
28
+ end
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ # Uncomment to register a new dependency of your gem
35
+ spec.add_dependency "activesupport", "> 6.0", "< 8.0"
36
+
37
+ # For more information and examples about making a new gem, check out our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ spec.metadata['rubygems_mfa_required'] = 'true'
40
+ end
@@ -0,0 +1,4 @@
1
+ module RaiseDeprecationWarnings
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raise_deprecation_warnings
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mathieu Jobin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">"
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">"
28
+ - !ruby/object:Gem::Version
29
+ version: '6.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8.0'
33
+ description: Override ActiveSupport::Deprecation class to raise an error.
34
+ email:
35
+ - mathieu@solidcode.bz
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - ".rspec"
41
+ - ".rubocop.yml"
42
+ - CHANGELOG.md
43
+ - README.md
44
+ - Rakefile
45
+ - lib/raise_deprecation_warnings.rb
46
+ - lib/raise_deprecation_warnings/version.rb
47
+ - raise_deprecation_warnings.gemspec
48
+ - sig/raise_deprecation_warnings.rbs
49
+ homepage: https://github.com/mathieujobin/raise_deprecation_warnings
50
+ licenses: []
51
+ metadata:
52
+ homepage_uri: https://github.com/mathieujobin/raise_deprecation_warnings
53
+ source_code_uri: https://github.com/mathieujobin/raise_deprecation_warnings
54
+ changelog_uri: https://github.com/mathieujobin/raise_deprecation_warnings/blob/main/CHANGELOG.md
55
+ rubygems_mfa_required: 'true'
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.7.0
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubygems_version: 3.5.3
72
+ signing_key:
73
+ specification_version: 4
74
+ summary: Simple gem to replace ActiveSupport warnings to raise an error instead.
75
+ test_files: []