sin_lru_redux 2.4.0 → 2.5.1
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 +4 -4
- data/CHANGELOG.md +15 -0
- data/README.md +7 -3
- data/Rakefile +2 -2
- data/lib/lru_redux/cache.rb +120 -118
- data/lib/lru_redux/thread_safe_cache.rb +4 -2
- data/lib/lru_redux/ttl/thread_safe_cache.rb +6 -2
- data/lib/lru_redux/version.rb +1 -1
- data/lib/lru_redux.rb +1 -1
- data/lib/sin_lru_redux/cache.rb +8 -0
- data/lib/sin_lru_redux/thread_safe_cache.rb +7 -0
- data/lib/sin_lru_redux/ttl/cache.rb +10 -0
- data/lib/sin_lru_redux/ttl/thread_safe_cache.rb +9 -0
- data/lib/sin_lru_redux/ttl.rb +5 -0
- data/lib/sin_lru_redux/util/safe_sync.rb +11 -0
- data/lib/sin_lru_redux/util.rb +3 -0
- data/lib/sin_lru_redux/version.rb +7 -0
- data/lib/sin_lru_redux.rb +5 -0
- metadata +19 -12
- data/.rubocop.yml +0 -173
- data/CODE_OF_CONDUCT.md +0 -132
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff8de8966a9a288fa43e66461aaf804e2e10f4dded516597c12e242c66cfe681
|
4
|
+
data.tar.gz: f93a0589c337befa2de5134d38c60a2ae380c93eb7d20b25423dd68a845c21f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69807c37d3b28a61077235ad2d49fc1f9afab0537a746bff25a0ec19979159e078f1496945b8a24dce934063bd985dbc8e93e45429620b912dde1c0434c65626
|
7
|
+
data.tar.gz: 15f6aa14fd2b1929c3440c0978dd3bcf2cfbb4bf38b03f5d5f08cf0861018999a28998ae028939646f0787b96119ba2bfa4474c5202e4e8759378a545f8bd425
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.5.1] - 2025-3-5
|
4
|
+
|
5
|
+
- Other: Update summary
|
6
|
+
- Other: Update .rubocop.yml
|
7
|
+
- Other: Add .editorconfig
|
8
|
+
- Other Update README.md
|
9
|
+
|
10
|
+
## [2.5.0] - 2025-1-17
|
11
|
+
|
12
|
+
- New: Add SinLruRedux module compatible with LruRedux module
|
13
|
+
- Refactor: Improve implementation
|
14
|
+
- Test: Improve tests
|
15
|
+
- Other: Improve CI
|
16
|
+
- Other: Fix README.md
|
17
|
+
|
3
18
|
## [2.4.0] - 2025-1-2
|
4
19
|
|
5
20
|
- New: Be able to require `sin_lru_redux` instead of `lru_redux`
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SinLruRedux
|
2
2
|
|
3
|
-
[](https://github.com/cadenza-tech/sin_lru_redux/blob/main/LICENSE.txt) [](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md) [](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease) [](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Atest) [](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Alint)
|
4
4
|
|
5
5
|
Efficient and thread-safe LRU cache.
|
6
6
|
|
@@ -8,12 +8,12 @@ Forked from [LruRedux](https://github.com/SamSaffron/lru_redux).
|
|
8
8
|
|
9
9
|
- [Installation](#installation)
|
10
10
|
- [Usage](#usage)
|
11
|
-
- [TTL Cache](#ttl-cache)
|
12
11
|
- [Cache Methods](#cache-methods)
|
12
|
+
- [Changelog](#changelog)
|
13
13
|
- [Contributing](#contributing)
|
14
|
-
- [Changelog](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md)
|
15
14
|
- [License](#license)
|
16
15
|
- [Code of Conduct](#code-of-conduct)
|
16
|
+
- [Sponsor](#sponsor)
|
17
17
|
|
18
18
|
## Installation
|
19
19
|
|
@@ -163,6 +163,10 @@ cache = LruRedux::TTL::ThreadSafeCache.new(100, 5 * 60)
|
|
163
163
|
- `#ttl=` Takes `:none` or a positive number. Changes the current ttl and triggers a TTL eviction.
|
164
164
|
- `#expire` Triggers a TTL eviction.
|
165
165
|
|
166
|
+
## Changelog
|
167
|
+
|
168
|
+
See [CHANGELOG.md](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md).
|
169
|
+
|
166
170
|
## Contributing
|
167
171
|
|
168
172
|
Bug reports and pull requests are welcome on GitHub at https://github.com/cadenza-tech/sin_lru_redux. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
@@ -4,8 +4,8 @@ require 'bundler/gem_tasks'
|
|
4
4
|
require 'rake/testtask'
|
5
5
|
require 'rubocop/rake_task'
|
6
6
|
|
7
|
-
Rake::TestTask.new(:test) do |
|
8
|
-
|
7
|
+
Rake::TestTask.new(:test) do |task|
|
8
|
+
task.pattern = 'test/**/test_*.rb'
|
9
9
|
end
|
10
10
|
|
11
11
|
RuboCop::RakeTask.new
|
data/lib/lru_redux/cache.rb
CHANGED
@@ -1,163 +1,165 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module LruRedux
|
4
|
+
class Cache
|
5
|
+
attr_reader :max_size, :ignore_nil
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
def initialize(*args)
|
8
|
+
max_size, ignore_nil, _ = args
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
max_size ||= 1000
|
11
|
+
ignore_nil ||= false
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
validate_max_size!(max_size)
|
14
|
+
validate_ignore_nil!(ignore_nil)
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
@max_size = max_size
|
17
|
+
@ignore_nil = ignore_nil
|
18
|
+
@data_lru = {}
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
def max_size=(new_max_size)
|
22
|
+
validate_max_size!(new_max_size)
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
@max_size = new_max_size
|
25
|
+
evict_excess
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
def ttl=(_)
|
29
|
+
nil
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
-
|
32
|
+
def ignore_nil=(new_ignore_nil)
|
33
|
+
validate_ignore_nil!(new_ignore_nil)
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
@ignore_nil = new_ignore_nil
|
36
|
+
evict_nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def getset(key)
|
40
|
+
key_found = true
|
41
|
+
value = @data_lru.delete(key) { key_found = false }
|
42
|
+
|
43
|
+
if key_found
|
44
|
+
@data_lru[key] = value
|
45
|
+
else
|
46
|
+
result = yield
|
47
|
+
store_item(key, result)
|
48
|
+
result
|
49
|
+
end
|
50
|
+
end
|
37
51
|
|
38
|
-
|
39
|
-
|
40
|
-
|
52
|
+
def fetch(key)
|
53
|
+
key_found = true
|
54
|
+
value = @data_lru.delete(key) { key_found = false }
|
41
55
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
result
|
56
|
+
if key_found
|
57
|
+
@data_lru[key] = value
|
58
|
+
else
|
59
|
+
yield if block_given? # rubocop:disable Style/IfInsideElse
|
60
|
+
end
|
48
61
|
end
|
49
|
-
end
|
50
62
|
|
51
|
-
|
52
|
-
|
53
|
-
|
63
|
+
def [](key)
|
64
|
+
key_found = true
|
65
|
+
value = @data_lru.delete(key) { key_found = false }
|
66
|
+
return unless key_found
|
54
67
|
|
55
|
-
if key_found
|
56
68
|
@data_lru[key] = value
|
57
|
-
else
|
58
|
-
yield if block_given? # rubocop:disable Style/IfInsideElse
|
59
69
|
end
|
60
|
-
end
|
61
70
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
return unless key_found
|
66
|
-
|
67
|
-
@data_lru[key] = value
|
68
|
-
end
|
71
|
+
def []=(key, val)
|
72
|
+
store_item(key, val)
|
73
|
+
end
|
69
74
|
|
70
|
-
|
71
|
-
|
72
|
-
|
75
|
+
def each(&block)
|
76
|
+
@data_lru.to_a.reverse_each(&block)
|
77
|
+
end
|
78
|
+
# Used further up the chain, non thread safe each
|
79
|
+
alias_method :each_unsafe, :each
|
73
80
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
# Used further up the chain, non thread safe each
|
78
|
-
alias_method :each_unsafe, :each
|
81
|
+
def to_a
|
82
|
+
@data_lru.to_a.reverse
|
83
|
+
end
|
79
84
|
|
80
|
-
|
81
|
-
|
82
|
-
|
85
|
+
def values
|
86
|
+
@data_lru.values.reverse
|
87
|
+
end
|
83
88
|
|
84
|
-
|
85
|
-
|
86
|
-
|
89
|
+
def delete(key)
|
90
|
+
@data_lru.delete(key)
|
91
|
+
end
|
92
|
+
alias_method :evict, :delete
|
87
93
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
94
|
+
def key?(key)
|
95
|
+
@data_lru.key?(key)
|
96
|
+
end
|
97
|
+
alias_method :has_key?, :key?
|
92
98
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
alias_method :has_key?, :key?
|
99
|
+
def clear
|
100
|
+
@data_lru.clear
|
101
|
+
end
|
97
102
|
|
98
|
-
|
99
|
-
|
100
|
-
|
103
|
+
def count
|
104
|
+
@data_lru.size
|
105
|
+
end
|
106
|
+
alias_method :length, :count
|
107
|
+
alias_method :size, :count
|
101
108
|
|
102
|
-
|
103
|
-
@data_lru.size
|
104
|
-
end
|
105
|
-
alias_method :length, :count
|
106
|
-
alias_method :size, :count
|
109
|
+
private
|
107
110
|
|
108
|
-
|
111
|
+
# For cache validation only, ensure all is valid
|
112
|
+
def valid?
|
113
|
+
true
|
114
|
+
end
|
109
115
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
116
|
+
def validate_max_size!(max_size)
|
117
|
+
unless max_size.is_a?(Numeric)
|
118
|
+
raise ArgumentError.new(<<~ERROR)
|
119
|
+
Invalid max_size: #{max_size.inspect}
|
120
|
+
max_size must be a number.
|
121
|
+
ERROR
|
122
|
+
end
|
123
|
+
return if max_size >= 1
|
114
124
|
|
115
|
-
def validate_max_size!(max_size)
|
116
|
-
unless max_size.is_a?(Numeric)
|
117
125
|
raise ArgumentError.new(<<~ERROR)
|
118
126
|
Invalid max_size: #{max_size.inspect}
|
119
|
-
max_size must be
|
127
|
+
max_size must be greater than or equal to 1.
|
120
128
|
ERROR
|
121
129
|
end
|
122
|
-
return if max_size >= 1
|
123
130
|
|
124
|
-
|
125
|
-
|
126
|
-
max_size must be greater than or equal to 1.
|
127
|
-
ERROR
|
128
|
-
end
|
131
|
+
def validate_ignore_nil!(ignore_nil)
|
132
|
+
return if [true, false].include?(ignore_nil)
|
129
133
|
|
130
|
-
|
131
|
-
|
134
|
+
raise ArgumentError.new(<<~ERROR)
|
135
|
+
Invalid ignore_nil: #{ignore_nil.inspect}
|
136
|
+
ignore_nil must be a boolean value.
|
137
|
+
ERROR
|
138
|
+
end
|
132
139
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
ERROR
|
137
|
-
end
|
140
|
+
def evict_excess
|
141
|
+
@data_lru.shift while @data_lru.size > @max_size
|
142
|
+
end
|
138
143
|
|
139
|
-
|
140
|
-
|
141
|
-
|
144
|
+
if RUBY_VERSION >= '2.6.0'
|
145
|
+
def evict_nil
|
146
|
+
return unless @ignore_nil
|
142
147
|
|
143
|
-
|
144
|
-
|
145
|
-
|
148
|
+
@data_lru.compact!
|
149
|
+
end
|
150
|
+
else
|
151
|
+
def evict_nil
|
152
|
+
return unless @ignore_nil
|
146
153
|
|
147
|
-
|
154
|
+
@data_lru.reject! { |_key, value| value.nil? }
|
155
|
+
end
|
148
156
|
end
|
149
|
-
else
|
150
|
-
def evict_nil
|
151
|
-
return unless @ignore_nil
|
152
157
|
|
153
|
-
|
158
|
+
def store_item(key, val)
|
159
|
+
@data_lru.delete(key)
|
160
|
+
@data_lru[key] = val if !val.nil? || !@ignore_nil
|
161
|
+
evict_excess
|
162
|
+
val
|
154
163
|
end
|
155
164
|
end
|
156
|
-
|
157
|
-
def store_item(key, val)
|
158
|
-
@data_lru.delete(key)
|
159
|
-
@data_lru[key] = val if !val.nil? || !@ignore_nil
|
160
|
-
evict_excess
|
161
|
-
val
|
162
|
-
end
|
163
165
|
end
|
data/lib/lru_redux/version.rb
CHANGED
data/lib/lru_redux.rb
CHANGED
data/lib/sin_lru_redux.rb
CHANGED
metadata
CHANGED
@@ -1,26 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sin_lru_redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
|
-
description:
|
13
|
-
Efficient and thread-safe LRU cache.
|
14
|
-
Forked from LruRedux.
|
12
|
+
description: Efficient and thread-safe LRU cache.
|
15
13
|
email:
|
16
14
|
- watanabe@cadenza-tech.com
|
17
15
|
executables: []
|
18
16
|
extensions: []
|
19
17
|
extra_rdoc_files: []
|
20
18
|
files:
|
21
|
-
- ".rubocop.yml"
|
22
19
|
- CHANGELOG.md
|
23
|
-
- CODE_OF_CONDUCT.md
|
24
20
|
- LICENSE.txt
|
25
21
|
- README.md
|
26
22
|
- Rakefile
|
@@ -34,17 +30,28 @@ files:
|
|
34
30
|
- lib/lru_redux/util/safe_sync.rb
|
35
31
|
- lib/lru_redux/version.rb
|
36
32
|
- lib/sin_lru_redux.rb
|
37
|
-
|
33
|
+
- lib/sin_lru_redux/cache.rb
|
34
|
+
- lib/sin_lru_redux/thread_safe_cache.rb
|
35
|
+
- lib/sin_lru_redux/ttl.rb
|
36
|
+
- lib/sin_lru_redux/ttl/cache.rb
|
37
|
+
- lib/sin_lru_redux/ttl/thread_safe_cache.rb
|
38
|
+
- lib/sin_lru_redux/util.rb
|
39
|
+
- lib/sin_lru_redux/util/safe_sync.rb
|
40
|
+
- lib/sin_lru_redux/version.rb
|
41
|
+
homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.1
|
38
42
|
licenses:
|
39
43
|
- MIT
|
40
44
|
metadata:
|
41
|
-
homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.
|
42
|
-
source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.
|
43
|
-
changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.
|
45
|
+
homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.1
|
46
|
+
source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.1
|
47
|
+
changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.5.1/CHANGELOG.md
|
44
48
|
bug_tracker_uri: https://github.com/cadenza-tech/sin_lru_redux/issues
|
45
|
-
documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.
|
49
|
+
documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.5.1
|
46
50
|
funding_uri: https://patreon.com/CadenzaTech
|
47
51
|
rubygems_mfa_required: 'true'
|
52
|
+
required_jruby_version: ">= 9.4.0.0"
|
53
|
+
required_truffleruby_version: ">= 22.0.0"
|
54
|
+
required_truffleruby+graalvm_version: ">= 22.0.0"
|
48
55
|
rdoc_options: []
|
49
56
|
require_paths:
|
50
57
|
- lib
|
data/.rubocop.yml
DELETED
@@ -1,173 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-minitest
|
3
|
-
- rubocop-performance
|
4
|
-
- rubocop-rake
|
5
|
-
|
6
|
-
AllCops:
|
7
|
-
TargetRubyVersion: 2.3
|
8
|
-
NewCops: enable
|
9
|
-
|
10
|
-
# https://docs.rubocop.org/rubocop/cops_gemspec.html#gemspecrequiredrubyversion
|
11
|
-
Gemspec/RequiredRubyVersion:
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirstarrayelementindentation
|
15
|
-
Layout/FirstArrayElementIndentation:
|
16
|
-
Enabled: true
|
17
|
-
EnforcedStyle: consistent
|
18
|
-
|
19
|
-
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinelength
|
20
|
-
Layout/LineLength:
|
21
|
-
Enabled: true
|
22
|
-
Max: 150
|
23
|
-
AllowURI: false
|
24
|
-
|
25
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize
|
26
|
-
Metrics/AbcSize:
|
27
|
-
Enabled: true
|
28
|
-
Max: 25
|
29
|
-
|
30
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
|
31
|
-
Metrics/BlockLength:
|
32
|
-
Enabled: true
|
33
|
-
Max: 30
|
34
|
-
Exclude:
|
35
|
-
- 'sin_lru_redux.gemspec'
|
36
|
-
|
37
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
|
38
|
-
Metrics/ClassLength:
|
39
|
-
Enabled: true
|
40
|
-
CountComments: false
|
41
|
-
Max: 200
|
42
|
-
|
43
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength
|
44
|
-
Metrics/MethodLength:
|
45
|
-
Enabled: true
|
46
|
-
CountComments: false
|
47
|
-
Max: 25
|
48
|
-
|
49
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
|
50
|
-
Metrics/ModuleLength:
|
51
|
-
Enabled: true
|
52
|
-
Max: 200
|
53
|
-
|
54
|
-
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsparameterlists
|
55
|
-
Metrics/ParameterLists:
|
56
|
-
Enabled: true
|
57
|
-
Max: 5
|
58
|
-
CountKeywordArgs: true
|
59
|
-
|
60
|
-
# https://docs.rubocop.org/rubocop/cops_naming.html#namingaccessormethodname
|
61
|
-
Naming/AccessorMethodName:
|
62
|
-
Enabled: false
|
63
|
-
|
64
|
-
# https://docs.rubocop.org/rubocop/cops_naming.html#namingblockforwarding
|
65
|
-
Naming/BlockForwarding:
|
66
|
-
Enabled: true
|
67
|
-
EnforcedStyle: explicit
|
68
|
-
|
69
|
-
# https://docs.rubocop.org/rubocop/cops_naming.html#namingmemoizedinstancevariablename
|
70
|
-
Naming/MemoizedInstanceVariableName:
|
71
|
-
Enabled: false
|
72
|
-
|
73
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleaccessmodifierdeclarations
|
74
|
-
Style/AccessModifierDeclarations:
|
75
|
-
Enabled: true
|
76
|
-
AllowModifiersOnSymbols: false
|
77
|
-
|
78
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylealias
|
79
|
-
Style/Alias:
|
80
|
-
Enabled: true
|
81
|
-
EnforcedStyle: prefer_alias_method
|
82
|
-
|
83
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleargumentsforwarding
|
84
|
-
Style/ArgumentsForwarding:
|
85
|
-
Enabled: true
|
86
|
-
UseAnonymousForwarding: false
|
87
|
-
|
88
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleasciicomments
|
89
|
-
Style/AsciiComments:
|
90
|
-
Enabled: false
|
91
|
-
|
92
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren
|
93
|
-
Style/ClassAndModuleChildren:
|
94
|
-
Enabled: false
|
95
|
-
|
96
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylecollectionmethods
|
97
|
-
Style/CollectionMethods:
|
98
|
-
Enabled: true
|
99
|
-
PreferredMethods:
|
100
|
-
detect: 'detect'
|
101
|
-
find: 'detect'
|
102
|
-
inject: 'inject'
|
103
|
-
reduce: 'inject'
|
104
|
-
|
105
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleconditionalassignment
|
106
|
-
Style/ConditionalAssignment:
|
107
|
-
Enabled: true
|
108
|
-
EnforcedStyle: assign_inside_condition
|
109
|
-
|
110
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentation
|
111
|
-
Style/Documentation:
|
112
|
-
Enabled: false
|
113
|
-
|
114
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleemptymethod
|
115
|
-
Style/EmptyMethod:
|
116
|
-
Enabled: true
|
117
|
-
EnforcedStyle: expanded
|
118
|
-
|
119
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylehashsyntax
|
120
|
-
Style/HashSyntax:
|
121
|
-
Enabled: true
|
122
|
-
EnforcedStyle: ruby19_no_mixed_keys
|
123
|
-
EnforcedShorthandSyntax: never
|
124
|
-
|
125
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylelambda
|
126
|
-
Style/Lambda:
|
127
|
-
Enabled: true
|
128
|
-
EnforcedStyle: literal
|
129
|
-
|
130
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylelineendconcatenation
|
131
|
-
Style/LineEndConcatenation:
|
132
|
-
Enabled: false
|
133
|
-
|
134
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericliterals
|
135
|
-
Style/NumericLiterals:
|
136
|
-
Enabled: false
|
137
|
-
|
138
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylenumericpredicate
|
139
|
-
Style/NumericPredicate:
|
140
|
-
Enabled: true
|
141
|
-
EnforcedStyle: comparison
|
142
|
-
|
143
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleraiseargs
|
144
|
-
Style/RaiseArgs:
|
145
|
-
Enabled: true
|
146
|
-
EnforcedStyle: compact
|
147
|
-
|
148
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylesuperarguments
|
149
|
-
Style/SuperArguments:
|
150
|
-
Enabled: false
|
151
|
-
|
152
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylesymbolarray
|
153
|
-
Style/SymbolArray:
|
154
|
-
Enabled: true
|
155
|
-
EnforcedStyle: brackets
|
156
|
-
|
157
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleternaryparentheses
|
158
|
-
Style/TernaryParentheses:
|
159
|
-
Enabled: true
|
160
|
-
EnforcedStyle: require_parentheses_when_complex
|
161
|
-
AllowSafeAssignment: false
|
162
|
-
|
163
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingunderscorevariable
|
164
|
-
Style/TrailingUnderscoreVariable:
|
165
|
-
Enabled: false
|
166
|
-
|
167
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#styleunpackfirst
|
168
|
-
Style/UnpackFirst:
|
169
|
-
Enabled: false
|
170
|
-
|
171
|
-
# https://docs.rubocop.org/rubocop/cops_style.html#stylewordarray
|
172
|
-
Style/WordArray:
|
173
|
-
Enabled: false
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,132 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
9
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
10
|
-
identity and orientation.
|
11
|
-
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
13
|
-
diverse, inclusive, and healthy community.
|
14
|
-
|
15
|
-
## Our Standards
|
16
|
-
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
18
|
-
community include:
|
19
|
-
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
24
|
-
and learning from the experience
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the overall
|
26
|
-
community
|
27
|
-
|
28
|
-
Examples of unacceptable behavior include:
|
29
|
-
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or advances of
|
31
|
-
any kind
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
33
|
-
* Public or private harassment
|
34
|
-
* Publishing others' private information, such as a physical or email address,
|
35
|
-
without their explicit permission
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
37
|
-
professional setting
|
38
|
-
|
39
|
-
## Enforcement Responsibilities
|
40
|
-
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
44
|
-
or harmful.
|
45
|
-
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
49
|
-
decisions when appropriate.
|
50
|
-
|
51
|
-
## Scope
|
52
|
-
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
54
|
-
an individual is officially representing the community in public spaces.
|
55
|
-
Examples of representing our community include using an official email address,
|
56
|
-
posting via an official social media account, or acting as an appointed
|
57
|
-
representative at an online or offline event.
|
58
|
-
|
59
|
-
## Enforcement
|
60
|
-
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
62
|
-
reported to the community leaders responsible for enforcement at
|
63
|
-
[INSERT CONTACT METHOD].
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
65
|
-
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
67
|
-
reporter of any incident.
|
68
|
-
|
69
|
-
## Enforcement Guidelines
|
70
|
-
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
73
|
-
|
74
|
-
### 1. Correction
|
75
|
-
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
77
|
-
unprofessional or unwelcome in the community.
|
78
|
-
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
82
|
-
|
83
|
-
### 2. Warning
|
84
|
-
|
85
|
-
**Community Impact**: A violation through a single incident or series of
|
86
|
-
actions.
|
87
|
-
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
92
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
93
|
-
ban.
|
94
|
-
|
95
|
-
### 3. Temporary Ban
|
96
|
-
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
98
|
-
sustained inappropriate behavior.
|
99
|
-
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
101
|
-
communication with the community for a specified period of time. No public or
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
104
|
-
Violating these terms may lead to a permanent ban.
|
105
|
-
|
106
|
-
### 4. Permanent Ban
|
107
|
-
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
111
|
-
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
113
|
-
community.
|
114
|
-
|
115
|
-
## Attribution
|
116
|
-
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
118
|
-
version 2.1, available at
|
119
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
120
|
-
|
121
|
-
Community Impact Guidelines were inspired by
|
122
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
123
|
-
|
124
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
125
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
126
|
-
[https://www.contributor-covenant.org/translations][translations].
|
127
|
-
|
128
|
-
[homepage]: https://www.contributor-covenant.org
|
129
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
130
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
131
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
132
|
-
[translations]: https://www.contributor-covenant.org/translations
|