delayed_deprecation 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7d436d8b7925ae230ddde32ecaadc0396bba6494
4
+ data.tar.gz: 9c85a11603686e1d83d5f2ed9f811acc8e6b68bf
5
+ SHA512:
6
+ metadata.gz: 341213c4157f79952b99d56759b685fdbdb3344664ee451371f3b2054aaebb636d28b89299336ca3935421a3203b2cde3420293ec7a6d4dcd47f8bb4f03e967e
7
+ data.tar.gz: 57789543a435813e4f319c11cc8213e3d8509f80cc8eefa7f009b7187a50e7061afea7f7be53942029922ea7e4d3f0db4b54b8438f5faf85113e014f108ee897
@@ -0,0 +1,44 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: drivy/rails-ci:0.1.2
6
+ steps:
7
+ - checkout
8
+
9
+ - run: git fetch origin --depth=1000
10
+
11
+ # Install CodeClimate test reporter binary, rebuild without cache to update the binary
12
+ - restore_cache:
13
+ key: cc_test_reporter
14
+ - run:
15
+ name: Install Code Climate test reporter
16
+ command: |
17
+ [ -f bin/cc-test-reporter ] || curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./bin/cc-test-reporter
18
+ chmod +x bin/cc-test-reporter
19
+ - restore_cache:
20
+ key: cc_test_reporter
21
+ paths:
22
+ - bin/cc-test-reporter
23
+
24
+ - run:
25
+ name: "Creating a Gemfile.lock without bundler's version"
26
+ command: "head -n -3 Gemfile.lock > Gemfile.lock.no-version"
27
+
28
+ # Bundle install with cache, Ignore bundler version
29
+ - restore_cache:
30
+ key: timed_deprecation-{{ checksum "Gemfile.lock.no-version"}}
31
+ - run:
32
+ name: Install Ruby dependencies
33
+ command: bundle install --path vendor/bundle --jobs=`nproc`
34
+ - save_cache:
35
+ key: timed_deprecation-{{ checksum "Gemfile.lock.no-version"}}
36
+ paths:
37
+ - vendor/bundle
38
+
39
+ - run:
40
+ name: RSpec
41
+ command: |
42
+ ./bin/cc-test-reporter before-build
43
+ bundle exec rspec --format documentation
44
+ ./bin/cc-test-reporter after-build --exit-code $?
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ *.swp
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,64 @@
1
+ require: rubocop-rspec
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.3
5
+ Exclude:
6
+ - "examples/*.rb"
7
+
8
+ #
9
+ # Opinionated cops
10
+ #
11
+
12
+ Layout/DotPosition:
13
+ EnforcedStyle: trailing
14
+
15
+ Layout/IndentHash:
16
+ EnforcedStyle: consistent
17
+
18
+ Metrics/AbcSize:
19
+ Max: 20
20
+
21
+ Metrics/LineLength:
22
+ Max: 100
23
+
24
+ Style/ClassAndModuleChildren:
25
+ EnforcedStyle: compact
26
+
27
+ Style/StringLiterals:
28
+ EnforcedStyle: double_quotes
29
+
30
+ Style/TrailingCommaInArrayLiteral:
31
+ EnforcedStyleForMultiline: comma
32
+
33
+ Style/TrailingCommaInHashLiteral:
34
+ EnforcedStyleForMultiline: comma
35
+
36
+ #
37
+ # Disabled cops
38
+ #
39
+
40
+ RSpec/VerifiedDoubles:
41
+ Enabled: false
42
+
43
+ Style/FrozenStringLiteralComment:
44
+ Enabled: false
45
+
46
+ Style/BracesAroundHashParameters:
47
+ Enabled: false
48
+
49
+ Style/FormatString:
50
+ Enabled: false
51
+
52
+ Style/Documentation:
53
+ Enabled: false
54
+
55
+ Style/BlockComments:
56
+ Exclude:
57
+ - "spec/spec_helper.rb"
58
+
59
+ Metrics/BlockLength:
60
+ Exclude:
61
+ - "spec/**/*_spec.rb"
62
+
63
+ Style/Proc:
64
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,75 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ delayed_deprecation (0.1.0)
5
+ activesupport (~> 5.1, < 5.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (5.1.6)
11
+ concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ i18n (>= 0.7, < 2)
13
+ minitest (~> 5.1)
14
+ tzinfo (~> 1.1)
15
+ ast (2.4.0)
16
+ concurrent-ruby (1.0.5)
17
+ diff-lcs (1.3)
18
+ docile (1.3.1)
19
+ i18n (1.0.1)
20
+ concurrent-ruby (~> 1.0)
21
+ json (2.1.0)
22
+ minitest (5.11.3)
23
+ parallel (1.12.1)
24
+ parser (2.5.1.0)
25
+ ast (~> 2.4.0)
26
+ powerpack (0.1.1)
27
+ rainbow (3.0.0)
28
+ rake (10.5.0)
29
+ rspec (3.7.0)
30
+ rspec-core (~> 3.7.0)
31
+ rspec-expectations (~> 3.7.0)
32
+ rspec-mocks (~> 3.7.0)
33
+ rspec-core (3.7.1)
34
+ rspec-support (~> 3.7.0)
35
+ rspec-expectations (3.7.0)
36
+ diff-lcs (>= 1.2.0, < 2.0)
37
+ rspec-support (~> 3.7.0)
38
+ rspec-mocks (3.7.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.7.0)
41
+ rspec-support (3.7.1)
42
+ rubocop (0.56.0)
43
+ parallel (~> 1.10)
44
+ parser (>= 2.5)
45
+ powerpack (~> 0.1)
46
+ rainbow (>= 2.2.2, < 4.0)
47
+ ruby-progressbar (~> 1.7)
48
+ unicode-display_width (~> 1.0, >= 1.0.1)
49
+ rubocop-rspec (1.25.1)
50
+ rubocop (>= 0.53.0)
51
+ ruby-progressbar (1.9.0)
52
+ simplecov (0.16.1)
53
+ docile (~> 1.1)
54
+ json (>= 1.8, < 3)
55
+ simplecov-html (~> 0.10.0)
56
+ simplecov-html (0.10.2)
57
+ thread_safe (0.3.6)
58
+ tzinfo (1.2.5)
59
+ thread_safe (~> 0.1)
60
+ unicode-display_width (1.3.2)
61
+
62
+ PLATFORMS
63
+ ruby
64
+
65
+ DEPENDENCIES
66
+ bundler (~> 1.16)
67
+ delayed_deprecation!
68
+ rake (~> 10.0)
69
+ rspec (~> 3.0)
70
+ rubocop
71
+ rubocop-rspec
72
+ simplecov
73
+
74
+ BUNDLED WITH
75
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Marc G Gauthier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # DelayedDeprecation
2
+
3
+ This gem provides a simple way to setup delayed deprecation notices.
4
+
5
+ This can be useful to remind you to cleanup a piece of code, for instance
6
+ if you release in multiple steps. It's also an alternative to FIXME comments that
7
+ will actually warn you when running your test suite.
8
+
9
+ [![Gem Version](https://badge.fury.io/rb/delayed_deprecations.svg)](https://badge.fury.io/rb/delayed_deprecations)
10
+ [![Maintainability](https://api.codeclimate.com/v1/badges/2d83bdfb73a5ac926897/maintainability)](https://codeclimate.com/github/drivy/delayed_deprecation/maintainability)
11
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/2d83bdfb73a5ac926897/test_coverage)](https://codeclimate.com/github/drivy/delayed_deprecation/test_coverage)
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ gem 'delayed_deprecation'
19
+ ```
20
+
21
+ _Please note that because of a current dependency to activesupport this gem is
22
+ optimised to be used with Ruby on Rails._
23
+
24
+ ## Usage
25
+
26
+ You can use it as a one liner:
27
+
28
+ ```ruby
29
+ DelayedDeprecation.new("Only for launch", reconsider_after: Date.new(2017, 10, 1), owner: "Alice")
30
+ ```
31
+
32
+ Or pass it a block:
33
+
34
+ ```ruby
35
+ DelayedDeprecation.new("To refactor", reconsider_after: Date.new(2017, 10, 1), owner: "Bob") do
36
+ # Code to be executed
37
+ end
38
+ ```
39
+
40
+ ## Contributing
41
+
42
+ Bug reports and pull requests are welcome on GitHub at https://github.com/drivy/delayed_deprecation.
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "delayed_deprecation"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,32 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "delayed_deprecation/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "delayed_deprecation"
8
+ spec.version = DelayedDeprecation::VERSION
9
+ spec.authors = ["Drivy", "Tim Petricola", "Marc G Gauthier"]
10
+ spec.email = ["oss@drivy.com"]
11
+
12
+ spec.summary = "Defining future deprecations"
13
+ spec.description = ""
14
+ spec.homepage = "https://github.com/drivy/delayed_deprecation"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.16"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "rubocop"
28
+ spec.add_development_dependency "rubocop-rspec"
29
+ spec.add_development_dependency "simplecov"
30
+
31
+ spec.add_runtime_dependency "activesupport", "~>5.1", "<5.2"
32
+ end
@@ -0,0 +1,31 @@
1
+ require "rubygems"
2
+ require "delayed_deprecation/version"
3
+ require "active_support/deprecation"
4
+
5
+ class DelayedDeprecation
6
+ include ActiveSupport::Deprecation::Reporting
7
+
8
+ def initialize(reason, owner:, reconsider_after: nil, &block)
9
+ @reason = reason
10
+ @owner = owner
11
+ @reconsider_after = reconsider_after
12
+
13
+ yield if block
14
+
15
+ warn(message) if active?
16
+ end
17
+
18
+ def behavior
19
+ ActiveSupport::Deprecation.behavior
20
+ end
21
+
22
+ private
23
+
24
+ def active?(date = Date.today)
25
+ !@reconsider_after || @reconsider_after <= date
26
+ end
27
+
28
+ def message
29
+ "#{@reason} [Owner: #{@owner}]"
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ class DelayedDeprecation
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,164 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: delayed_deprecation
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Drivy
8
+ - Tim Petricola
9
+ - Marc G Gauthier
10
+ autorequire:
11
+ bindir: exe
12
+ cert_chain: []
13
+ date: 2018-06-14 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.16'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1.16'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '10.0'
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '10.0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rspec
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '3.0'
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '3.0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: rubocop
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: rubocop-rspec
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: simplecov
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ - !ruby/object:Gem::Dependency
100
+ name: activesupport
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '5.1'
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: '5.2'
109
+ type: :runtime
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '5.1'
116
+ - - "<"
117
+ - !ruby/object:Gem::Version
118
+ version: '5.2'
119
+ description: ''
120
+ email:
121
+ - oss@drivy.com
122
+ executables: []
123
+ extensions: []
124
+ extra_rdoc_files: []
125
+ files:
126
+ - ".circleci/config.yml"
127
+ - ".gitignore"
128
+ - ".rspec"
129
+ - ".rubocop.yml"
130
+ - Gemfile
131
+ - Gemfile.lock
132
+ - LICENSE.txt
133
+ - README.md
134
+ - Rakefile
135
+ - bin/console
136
+ - bin/setup
137
+ - delayed_deprecation.gemspec
138
+ - lib/delayed_deprecation.rb
139
+ - lib/delayed_deprecation/version.rb
140
+ homepage: https://github.com/drivy/delayed_deprecation
141
+ licenses:
142
+ - MIT
143
+ metadata: {}
144
+ post_install_message:
145
+ rdoc_options: []
146
+ require_paths:
147
+ - lib
148
+ required_ruby_version: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ requirements: []
159
+ rubyforge_project:
160
+ rubygems_version: 2.6.14
161
+ signing_key:
162
+ specification_version: 4
163
+ summary: Defining future deprecations
164
+ test_files: []