sin_lru_redux 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a98157264a62bd4929e337957dc19e3d6f26e3d6ecc1c402b1de85865c955ec2
4
- data.tar.gz: 49c6811c455147dbc0434ee5aaf46238b11843a68820559ab260384c6589ed78
3
+ metadata.gz: 9d2e703acd20c2c53c25cd48b9825141b56dbccc618922b8ce9cbacb775f34d7
4
+ data.tar.gz: d4a5fc8a84c63320d0194aa22f5d6bbf6b85de284b8793bec2b9f70e5d1493cd
5
5
  SHA512:
6
- metadata.gz: 7c6eece0bb96966e50dad496a9fc8961ea8df2770f2bfc3dbb8723ac2b570c703745268a71cbb951e4452758109d578a08afe4804a8726f634c208cf1c75a252
7
- data.tar.gz: c1dc7f2a6ca4f2511e0245b1694e8a2f988b1efcf0dba24a629bf8d501240292382ea4f1561dd96d1d5cadc8286e107fa1e1467b6cc42c489adf2d9bd9810ecb
6
+ metadata.gz: 5f23cdad526c465dc8932e8ab9ac4e533cec384ee745c130ce0c4253637318db2e8754485a7bbbab2df70e8d927f258751d2f6dd296997f0d835aad9afd1f611
7
+ data.tar.gz: c00bc3cbd2dd6a496165b91c979336f3a247bdced9d6b0bc4feff6c87e4f301bb67ac518b625bb9897fcbb59b5e5fc8127ebec89d9aa2e4ce7c99140a9c33b1e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.0] - 2025-1-17
4
+
5
+ - New: Add SinLruRedux module compatible with LruRedux module
6
+ - Refactor: Improve implementation
7
+ - Test: Improve tests
8
+ - Other: Improve CI
9
+ - Other: Fix README.md
10
+
3
11
  ## [2.4.0] - 2025-1-2
4
12
 
5
13
  - 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
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/LICENSE.txt) [![tag](https://img.shields.io/github/tag/cadenza-tech/sin_lru_redux.svg?logo=github&color=2EBC4F)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md) [![release](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/release.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease) [![test](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/test.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease) [![lint](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/lint.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease)
3
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/LICENSE.txt) [![tag](https://img.shields.io/github/tag/cadenza-tech/sin_lru_redux.svg?logo=github&color=2EBC4F)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md) [![release](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/release.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease) [![test](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/test.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Atest) [![lint](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/lint.yml/badge.svg)](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 |t|
8
- t.pattern = 'test/**/test_*.rb'
7
+ Rake::TestTask.new(:test) do |task|
8
+ task.pattern = 'test/**/test_*.rb'
9
9
  end
10
10
 
11
11
  RuboCop::RakeTask.new
@@ -1,163 +1,165 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class LruRedux::Cache
4
- attr_reader :max_size, :ignore_nil
3
+ module LruRedux
4
+ class Cache
5
+ attr_reader :max_size, :ignore_nil
5
6
 
6
- def initialize(*args)
7
- max_size, ignore_nil, _ = args
7
+ def initialize(*args)
8
+ max_size, ignore_nil, _ = args
8
9
 
9
- max_size ||= 1000
10
- ignore_nil ||= false
10
+ max_size ||= 1000
11
+ ignore_nil ||= false
11
12
 
12
- validate_max_size!(max_size)
13
- validate_ignore_nil!(ignore_nil)
13
+ validate_max_size!(max_size)
14
+ validate_ignore_nil!(ignore_nil)
14
15
 
15
- @max_size = max_size
16
- @ignore_nil = ignore_nil
17
- @data_lru = {}
18
- end
16
+ @max_size = max_size
17
+ @ignore_nil = ignore_nil
18
+ @data_lru = {}
19
+ end
19
20
 
20
- def max_size=(new_max_size)
21
- validate_max_size!(new_max_size)
21
+ def max_size=(new_max_size)
22
+ validate_max_size!(new_max_size)
22
23
 
23
- @max_size = new_max_size
24
- evict_excess
25
- end
24
+ @max_size = new_max_size
25
+ evict_excess
26
+ end
26
27
 
27
- def ttl=(_)
28
- nil
29
- end
28
+ def ttl=(_)
29
+ nil
30
+ end
30
31
 
31
- def ignore_nil=(new_ignore_nil)
32
- validate_ignore_nil!(new_ignore_nil)
32
+ def ignore_nil=(new_ignore_nil)
33
+ validate_ignore_nil!(new_ignore_nil)
33
34
 
34
- @ignore_nil = new_ignore_nil
35
- evict_nil
36
- end
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
- def getset(key)
39
- key_found = true
40
- value = @data_lru.delete(key) { key_found = false }
52
+ def fetch(key)
53
+ key_found = true
54
+ value = @data_lru.delete(key) { key_found = false }
41
55
 
42
- if key_found
43
- @data_lru[key] = value
44
- else
45
- result = yield
46
- store_item(key, result)
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
- def fetch(key)
52
- key_found = true
53
- value = @data_lru.delete(key) { key_found = false }
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
- def [](key)
63
- key_found = true
64
- value = @data_lru.delete(key) { key_found = false }
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
- def []=(key, val)
71
- store_item(key, val)
72
- end
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
- def each(&block)
75
- @data_lru.to_a.reverse_each(&block)
76
- end
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
- def to_a
81
- @data_lru.to_a.reverse
82
- end
85
+ def values
86
+ @data_lru.values.reverse
87
+ end
83
88
 
84
- def values
85
- @data_lru.values.reverse
86
- end
89
+ def delete(key)
90
+ @data_lru.delete(key)
91
+ end
92
+ alias_method :evict, :delete
87
93
 
88
- def delete(key)
89
- @data_lru.delete(key)
90
- end
91
- alias_method :evict, :delete
94
+ def key?(key)
95
+ @data_lru.key?(key)
96
+ end
97
+ alias_method :has_key?, :key?
92
98
 
93
- def key?(key)
94
- @data_lru.key?(key)
95
- end
96
- alias_method :has_key?, :key?
99
+ def clear
100
+ @data_lru.clear
101
+ end
97
102
 
98
- def clear
99
- @data_lru.clear
100
- end
103
+ def count
104
+ @data_lru.size
105
+ end
106
+ alias_method :length, :count
107
+ alias_method :size, :count
101
108
 
102
- def count
103
- @data_lru.size
104
- end
105
- alias_method :length, :count
106
- alias_method :size, :count
109
+ private
107
110
 
108
- private
111
+ # For cache validation only, ensure all is valid
112
+ def valid?
113
+ true
114
+ end
109
115
 
110
- # For cache validation only, ensure all is valid
111
- def valid?
112
- true
113
- end
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 a number.
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
- raise ArgumentError.new(<<~ERROR)
125
- Invalid max_size: #{max_size.inspect}
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
- def validate_ignore_nil!(ignore_nil)
131
- return if [true, false].include?(ignore_nil)
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
- raise ArgumentError.new(<<~ERROR)
134
- Invalid ignore_nil: #{ignore_nil.inspect}
135
- ignore_nil must be a boolean value.
136
- ERROR
137
- end
140
+ def evict_excess
141
+ @data_lru.shift while @data_lru.size > @max_size
142
+ end
138
143
 
139
- def evict_excess
140
- @data_lru.shift while @data_lru.size > @max_size
141
- end
144
+ if RUBY_VERSION >= '2.6.0'
145
+ def evict_nil
146
+ return unless @ignore_nil
142
147
 
143
- if RUBY_VERSION >= '2.6.0'
144
- def evict_nil
145
- return unless @ignore_nil
148
+ @data_lru.compact!
149
+ end
150
+ else
151
+ def evict_nil
152
+ return unless @ignore_nil
146
153
 
147
- @data_lru.compact!
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
- @data_lru.reject! { |_key, value| value.nil? }
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
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class LruRedux::ThreadSafeCache < LruRedux::Cache
4
- include LruRedux::Util::SafeSync
3
+ module LruRedux
4
+ class ThreadSafeCache < Cache
5
+ include ::LruRedux::Util::SafeSync
6
+ end
5
7
  end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class LruRedux::TTL::ThreadSafeCache < LruRedux::TTL::Cache
4
- include LruRedux::Util::SafeSync
3
+ module LruRedux
4
+ module TTL
5
+ class ThreadSafeCache < Cache
6
+ include ::LruRedux::Util::SafeSync
7
+ end
8
+ end
5
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LruRedux
4
- VERSION = '2.4.0'
4
+ VERSION = '2.5.0'
5
5
  end
data/lib/lru_redux.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'lru_redux/version'
3
4
  require 'lru_redux/util'
4
5
  require 'lru_redux/cache'
5
6
  require 'lru_redux/thread_safe_cache'
6
7
  require 'lru_redux/ttl'
7
- require 'lru_redux/version'
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../lru_redux/cache'
4
+
5
+ module SinLruRedux
6
+ class Cache < ::LruRedux::Cache
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SinLruRedux
4
+ class ThreadSafeCache < Cache
5
+ include ::SinLruRedux::Util::SafeSync
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../lru_redux/ttl/cache'
4
+
5
+ module SinLruRedux
6
+ module TTL
7
+ class Cache < ::LruRedux::TTL::Cache
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SinLruRedux
4
+ module TTL
5
+ class ThreadSafeCache < Cache
6
+ include ::SinLruRedux::Util::SafeSync
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sin_lru_redux/util'
4
+ require 'sin_lru_redux/ttl/cache'
5
+ require 'sin_lru_redux/ttl/thread_safe_cache'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../lru_redux/util/safe_sync'
4
+
5
+ module SinLruRedux
6
+ module Util
7
+ module SafeSync
8
+ include ::LruRedux::Util::SafeSync
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sin_lru_redux/util/safe_sync'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../lru_redux/version'
4
+
5
+ module SinLruRedux
6
+ VERSION = ::LruRedux::VERSION
7
+ end
data/lib/sin_lru_redux.rb CHANGED
@@ -1,3 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'lru_redux'
4
+ require 'sin_lru_redux/version'
5
+ require 'sin_lru_redux/util'
6
+ require 'sin_lru_redux/cache'
7
+ require 'sin_lru_redux/thread_safe_cache'
8
+ require 'sin_lru_redux/ttl'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sin_lru_redux
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-02 00:00:00.000000000 Z
10
+ date: 2025-01-17 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |
13
13
  Efficient and thread-safe LRU cache.
@@ -18,9 +18,7 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - ".rubocop.yml"
22
21
  - CHANGELOG.md
23
- - CODE_OF_CONDUCT.md
24
22
  - LICENSE.txt
25
23
  - README.md
26
24
  - Rakefile
@@ -34,17 +32,28 @@ files:
34
32
  - lib/lru_redux/util/safe_sync.rb
35
33
  - lib/lru_redux/version.rb
36
34
  - lib/sin_lru_redux.rb
37
- homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.4.0
35
+ - lib/sin_lru_redux/cache.rb
36
+ - lib/sin_lru_redux/thread_safe_cache.rb
37
+ - lib/sin_lru_redux/ttl.rb
38
+ - lib/sin_lru_redux/ttl/cache.rb
39
+ - lib/sin_lru_redux/ttl/thread_safe_cache.rb
40
+ - lib/sin_lru_redux/util.rb
41
+ - lib/sin_lru_redux/util/safe_sync.rb
42
+ - lib/sin_lru_redux/version.rb
43
+ homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.0
38
44
  licenses:
39
45
  - MIT
40
46
  metadata:
41
- homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.4.0
42
- source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.4.0
43
- changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.4.0/CHANGELOG.md
47
+ homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.0
48
+ source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.0
49
+ changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.5.0/CHANGELOG.md
44
50
  bug_tracker_uri: https://github.com/cadenza-tech/sin_lru_redux/issues
45
- documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.4.0
51
+ documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.5.0
46
52
  funding_uri: https://patreon.com/CadenzaTech
47
53
  rubygems_mfa_required: 'true'
54
+ required_jruby_version: ">= 9.4.0.0"
55
+ required_truffleruby_version: ">= 22.0.0"
56
+ required_truffleruby+graalvm_version: ">= 22.0.0"
48
57
  rdoc_options: []
49
58
  require_paths:
50
59
  - 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