deprecations_detector 0.0.1 → 0.2.0

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: 14223f744285f1f73bc7453f2de6a42a9a8f87b599393cb67fb9345043be5f14
4
- data.tar.gz: e1879d540ed9af626488355929a378cfbb71b83b6b9775411a7420173f65dcfc
3
+ metadata.gz: 55be48db383dbe077bd4f5d4a6af0268d556a49fd6eac9e308511b7099391be5
4
+ data.tar.gz: f70e76bf040dabf491c147bad51633e4ce7aa132a3025d5fe54e1171fbbacdaf
5
5
  SHA512:
6
- metadata.gz: 296a9a4345d4aa010f62cd1f967430d3cf40896dbb6361b50fd8b8f8c39e652ce2b44fb464ab91bb78f4c123a786f0702d3dc460d6428b9844457d6eb1ec8dcb
7
- data.tar.gz: 14b1e67170d3e0586f6c56e7c9dd9573bc2998895aeb2f792c9afce7252dcc48e03c5c111473744b7f4f8906610652143622ef13181ad995b4a7e886f13fbb68
6
+ metadata.gz: 0f0c038b934842c4668d60e498e4c5088a457fbf858fbf796b79d56da004232af0c915ab93dc6ebe07a11013cf34f2145728ea30412f1d30e4c921de6fdc5e4a
7
+ data.tar.gz: cd1dafac32b3b3451021a6a61280a65817375a341e4bd08950ac8066b357432edd4231d7eb9952245e9e3bdcc14c9b09ff42f10a82dcffc29051c5e1cdfc1bd5
@@ -0,0 +1,19 @@
1
+ name: "Rspec"
2
+ on:
3
+ pull_request:
4
+ branches: [ "main" ]
5
+ jobs:
6
+ rspec:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ steps:
11
+ - name: Checkout code
12
+ uses: actions/checkout@v3
13
+ - name: Install Ruby and gems
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 3.1.2
17
+ bundler-cache: true
18
+ - name: Run tests
19
+ run: bundle exec rspec spec
data/README.md CHANGED
@@ -6,7 +6,17 @@ The goal of this component is to collect and list all the deprecation of the pro
6
6
 
7
7
  ## Installation
8
8
 
9
- Add `gem 'deprecations_detector', git: 'https://github.com/nebulab/deprecations_detector'` to your application's Gemfile and execute `bundle`.
9
+ Add `gem 'deprecations_detector'` to your application's Gemfile and execute `bundle`.
10
+
11
+ Specify DeprecationDetector::Collect class as deprecation class with:
12
+
13
+ ```
14
+ Rails.application.configure do
15
+ ...
16
+ config.active_support.deprecation = DeprecationsDetector::Collect
17
+ ...
18
+ end
19
+ ```
10
20
 
11
21
  Put the following code under you specs configuration:
12
22
 
@@ -8,7 +8,7 @@ require 'deprecations_detector/version'
8
8
  Gem::Specification.new do |spec|
9
9
  spec.name = 'deprecations_detector'
10
10
  spec.version = DeprecationsDetector::VERSION
11
- spec.summary = 'A tool to find what specs examples cover a specific line of code'
11
+ spec.summary = 'A tool to display deprecations in a simple way on a single HTML page.'
12
12
  spec.description = spec.summary
13
13
  spec.license = 'MIT'
14
14
  spec.authors = ['Daniele Palombo']
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DeprecationsDetector
4
+ class Collect
5
+ def self.call(message = "", callstack = [], deprecation_horizon = nil, gem_name = nil)
6
+ DeprecationsDetector::Main.add_deprecation(message, caller)
7
+ end
8
+
9
+ def self.arity
10
+ 4
11
+ end
12
+ end
13
+ end
@@ -4,7 +4,7 @@ module DeprecationsDetector
4
4
  class Main
5
5
  include Singleton
6
6
 
7
- attr_reader :coverage_matrix, :deprecation_matrix, :suppress_deprecations
7
+ attr_reader :coverage_matrix, :deprecation_matrix
8
8
  attr_accessor :config, :output_path
9
9
 
10
10
  def initialize
@@ -51,9 +51,7 @@ module DeprecationsDetector
51
51
  @deprecation_matrix[file_path][result[2].to_i - 1] = message
52
52
  end
53
53
 
54
- def start(suppress_deprecations: false)
55
- @suppress_deprecations = suppress_deprecations
56
-
54
+ def start
57
55
  @coverage_matrix = {}
58
56
  @deprecation_matrix = {}
59
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeprecationsDetector
4
- VERSION = '0.0.1'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -4,7 +4,7 @@ require 'singleton'
4
4
  require 'yaml'
5
5
  require 'active_support'
6
6
 
7
- require_relative 'deprecations_detector/active_support/deprecation_decorator.rb'
7
+ require_relative 'deprecations_detector/collect'
8
8
  require_relative 'deprecations_detector/version'
9
9
  require_relative 'deprecations_detector/main'
10
10
  require_relative 'deprecations_detector/formatters/html/formatter'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecations_detector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniele Palombo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -164,13 +164,14 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: 3.7.2
167
- description: A tool to find what specs examples cover a specific line of code
167
+ description: A tool to display deprecations in a simple way on a single HTML page.
168
168
  email:
169
169
  - danielepalombo@nebulab.com
170
170
  executables: []
171
171
  extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
+ - ".github/workflows/spec.yml"
174
175
  - ".gitignore"
175
176
  - ".rubocop.yml"
176
177
  - Gemfile
@@ -180,7 +181,7 @@ files:
180
181
  - Rakefile
181
182
  - deprecations_detector.gemspec
182
183
  - lib/deprecations_detector.rb
183
- - lib/deprecations_detector/active_support/deprecation_decorator.rb
184
+ - lib/deprecations_detector/collect.rb
184
185
  - lib/deprecations_detector/formatters/html/assets/javascripts/application.js
185
186
  - lib/deprecations_detector/formatters/html/assets/javascripts/libraries/jquery-1.6.2.min.js
186
187
  - lib/deprecations_detector/formatters/html/assets/javascripts/plugins/highlight.pack.js
@@ -250,5 +251,5 @@ requirements: []
250
251
  rubygems_version: 3.3.17
251
252
  signing_key:
252
253
  specification_version: 4
253
- summary: A tool to find what specs examples cover a specific line of code
254
+ summary: A tool to display deprecations in a simple way on a single HTML page.
254
255
  test_files: []
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DeprecationsDetector
4
- module ActiveSupport
5
- module DeprecationDecorator
6
- def warn(message = nil, callstack = caller)
7
- DeprecationsDetector::Main.add_deprecation(message, caller)
8
-
9
- return if DeprecationsDetector::Main.suppress_deprecations
10
-
11
- super(message, callstack)
12
- end
13
-
14
- ::ActiveSupport::Deprecation.prepend(self)
15
- end
16
- end
17
- end