Skip to content

Commit

Permalink
RuboCop 0.36 fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Jan 31, 2016
1 parent 8cc4850 commit 7300371
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
14 changes: 11 additions & 3 deletions Gemfile
@@ -1,7 +1,15 @@
source "https://rubygems.org"

gemspec

gem "jruby-openssl" if defined? JRUBY_VERSION
gem "coveralls", require: false

# Specify your gem's dependencies in nio4r.gemspec
gemspec
group :development do
gem "rake-compiler"
end

group :test do
gem "rspec", "~> 3.0"
gem "rubocop", "0.36.0"
gem "coveralls", require: false
end
8 changes: 5 additions & 3 deletions lib/nio.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "thread"
require "socket"
require "nio/version"
Expand All @@ -16,16 +18,16 @@ def self.engine
if ENV["NIO4R_PURE"] == "true" || (Gem.win_platform? && !defined?(JRUBY_VERSION))
require "nio/monitor"
require "nio/selector"
NIO::ENGINE = "ruby"
NIO::ENGINE = "ruby".freeze
else
require "nio4r_ext"

if defined?(JRUBY_VERSION)
require "java"
require "jruby"
org.nio4r.Nio4r.new.load(JRuby.runtime, false)
NIO::ENGINE = "java"
NIO::ENGINE = "java".freeze
else
NIO::ENGINE = "libev"
NIO::ENGINE = "libev".freeze
end
end
2 changes: 1 addition & 1 deletion lib/nio/monitor.rb
Expand Up @@ -39,7 +39,7 @@ def readable?
def writable?
readiness == :w || readiness == :rw
end
alias_method :writeable?, :writable?
alias writeable? writable?

# Is this monitor closed?
def closed?
Expand Down
6 changes: 1 addition & 5 deletions lib/nio/selector.rb
Expand Up @@ -78,11 +78,7 @@ def select(timeout = nil)

ready_writers.each do |io|
monitor = @selectables[io]
if monitor.readiness == :r
monitor.readiness = :rw
else
monitor.readiness = :w
end
monitor.readiness = (monitor.readiness == :r) ? :rw : :w
selected_monitors << monitor
end

Expand Down
4 changes: 3 additions & 1 deletion lib/nio/version.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module NIO
VERSION = "1.2.0"
VERSION = "1.2.0".freeze
end
4 changes: 1 addition & 3 deletions nio4r.gemspec
Expand Up @@ -23,8 +23,6 @@ Gem::Specification.new do |gem|
gem.extensions = ["ext/nio4r/extconf.rb"]
end

gem.add_development_dependency "rake-compiler"
gem.add_development_dependency "rake"
gem.add_development_dependency "rspec", "~> 3.0"
gem.add_development_dependency "rubocop"
gem.add_development_dependency "bundler"
end

0 comments on commit 7300371

Please sign in to comment.