Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update development dependencies #62

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,3 @@ RSpec/ExampleLength:
RSpec/ContextWording:
Exclude:
- spec/shared_contexts.rb

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
13 changes: 12 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@

source 'https://rubygems.org'

# Specify your gem's dependencies in rubocop-thread_safety.gemspec
gemspec

gem 'appraisal'
gem 'bundler', '>= 1.10', '< 3'
gem 'prism', '~> 1.2.0'
gem 'pry' unless ENV['CI']
gem 'rake', '>= 10.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', github: 'rubocop/rubocop'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec'
gem 'simplecov'
gem 'yard'
17 changes: 17 additions & 0 deletions docs/modules/ROOT/pages/cops_threadsafety.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

= ThreadSafety

[#threadsafetyclassandmoduleattributes]
== ThreadSafety/ClassAndModuleAttributes

|===
Expand All @@ -22,6 +23,7 @@ Avoid mutating class and module attributes.

They are implemented by class variables, which are not thread-safe.

[#examples-threadsafetyclassandmoduleattributes]
=== Examples

[source,ruby]
Expand All @@ -32,6 +34,7 @@ class User
end
----

[#configurable-attributes-threadsafetyclassandmoduleattributes]
=== Configurable attributes

|===
Expand All @@ -42,6 +45,7 @@ end
| Boolean
|===

[#threadsafetyclassinstancevariable]
== ThreadSafety/ClassInstanceVariable

|===
Expand All @@ -56,6 +60,7 @@ end

Avoid class instance variables.

[#examples-threadsafetyclassinstancevariable]
=== Examples

[source,ruby]
Expand Down Expand Up @@ -117,6 +122,7 @@ module Example
end
----

[#threadsafetydirchdir]
== ThreadSafety/DirChdir

|===
Expand All @@ -131,6 +137,7 @@ end

Avoid using `Dir.chdir` due to its process-wide effect.

[#examples-threadsafetydirchdir]
=== Examples

[source,ruby]
Expand All @@ -142,6 +149,7 @@ Dir.chdir("/var/run")
FileUtils.chdir("/var/run")
----

[#threadsafetymutableclassinstancevariable]
== ThreadSafety/MutableClassInstanceVariable

|===
Expand Down Expand Up @@ -172,8 +180,10 @@ updated with an exhaustive list of all methods that will produce frozen
objects so there is a decent chance of getting some false positives.
Luckily, there is no harm in freezing an already frozen object.

[#examples-threadsafetymutableclassinstancevariable]
=== Examples

[#enforcedstyle_-literals-_default_-threadsafetymutableclassinstancevariable]
==== EnforcedStyle: literals (default)

[source,ruby]
Expand Down Expand Up @@ -201,6 +211,7 @@ class Model
end
----

[#enforcedstyle_-strict-threadsafetymutableclassinstancevariable]
==== EnforcedStyle: strict

[source,ruby]
Expand Down Expand Up @@ -234,6 +245,7 @@ class Model
end
----

[#configurable-attributes-threadsafetymutableclassinstancevariable]
=== Configurable attributes

|===
Expand All @@ -244,6 +256,7 @@ end
| `literals`, `strict`
|===

[#threadsafetynewthread]
== ThreadSafety/NewThread

|===
Expand All @@ -260,6 +273,7 @@ Avoid starting new threads.

Let a framework like Sidekiq handle the threads.

[#examples-threadsafetynewthread]
=== Examples

[source,ruby]
Expand All @@ -268,6 +282,7 @@ Let a framework like Sidekiq handle the threads.
Thread.new { do_work }
----

[#threadsafetyrackmiddlewareinstancevariable]
== ThreadSafety/RackMiddlewareInstanceVariable

|===
Expand All @@ -286,6 +301,7 @@ Middlewares are initialized once, meaning any instance variables are shared betw
To avoid potential race conditions, it's recommended to design middlewares to be stateless
or to implement proper synchronization mechanisms.

[#examples-threadsafetyrackmiddlewareinstancevariable]
=== Examples

[source,ruby]
Expand Down Expand Up @@ -329,6 +345,7 @@ class IdentityMiddleware
end
----

[#configurable-attributes-threadsafetyrackmiddlewareinstancevariable]
=== Configurable attributes

|===
Expand Down
10 changes: 10 additions & 0 deletions gemfiles/rubocop_1.48.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@

source 'https://rubygems.org'

gem 'appraisal'
gem 'base64', '~> 0.1.1'
gem 'bundler', '>= 1.10', '< 3'
gem 'prism', '~> 1.2.0'
gem 'pry'
gem 'rake', '>= 10.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.48.0'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec'
gem 'simplecov'
gem 'yard'

gemspec path: '../'
10 changes: 10 additions & 0 deletions gemfiles/rubocop_1.66.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

source 'https://rubygems.org'

gem 'appraisal'
gem 'bundler', '>= 1.10', '< 3'
gem 'prism', '~> 1.2.0'
gem 'pry'
gem 'rake', '>= 10.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.66.0'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec'
gem 'simplecov'
gem 'yard'

gemspec path: '../'
11 changes: 0 additions & 11 deletions rubocop-thread_safety.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,4 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.7.0'

spec.add_dependency 'rubocop', '>= 1.48.1'

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler', '>= 1.10', '< 3'
spec.add_development_dependency 'prism'
spec.add_development_dependency 'pry' unless ENV['CI']
spec.add_development_dependency 'rake', '>= 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop-rake'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'yard'
end