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

Remove conditions from gem declarations in Gemfile #584

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 2 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ else
gemspec development_group: :gem_build_tools
end

require 'rbconfig'

case RbConfig::CONFIG['target_os']
when /mswin|mingw|cygwin/i
gem 'wdm', '>= 0.1.0'
when /bsd|dragonfly/i
gem 'rb-kqueue', '>= 0.2'
end
gem 'rb-kqueue', '>= 0.2'
larskanis marked this conversation as resolved.
Show resolved Hide resolved
gem 'wdm', '>= 0.1.0'

group :test do
gem 'coveralls'
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ If you are on Windows, it's recommended to use the [`wdm`](https://github.com/Ma
Please add the following to your Gemfile:

```ruby
gem 'wdm', '>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'wdm', '>= 0.1.0'
```

### On \*BSD
Expand All @@ -275,11 +275,7 @@ If you are on \*BSD you can try to use the [`rb-kqueue`](https://github.com/mat8
Please add the following to your Gemfile:

```ruby
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /bsd|dragonfly/i
gem 'rb-kqueue', '>= 0.2'
end

gem 'rb-kqueue', '>= 0.2'
```

### Getting the [polling fallback message](#options)?
Expand Down
5 changes: 1 addition & 4 deletions lib/listen/adapter/bsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ class BSD < Base

BUNDLER_DECLARE_GEM = <<-EOS.gsub(/^ {6}/, '')
Please add the following to your Gemfile to avoid polling for changes:
require 'rbconfig'
if RbConfig::CONFIG['target_os'] =~ /#{OS_REGEXP}/
gem 'rb-kqueue', '>= 0.2'
end
gem 'rb-kqueue', '>= 0.2'
EOS

def self.usable?
Expand Down
2 changes: 1 addition & 1 deletion lib/listen/adapter/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Windows < Base

BUNDLER_DECLARE_GEM = <<-EOS.gsub(/^ {6}/, '')
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
gem 'wdm', '>= 0.1.0'
EOS

def self.usable?
Expand Down