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

Adds RbConfig class to remove deprecation warnings #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Adds RbConfig class to remove deprecation warnings
Since Ruby 1.9.1, the Config class should be renamed to RbConfig. This
commit adds that but also leaves the old Config for olders Ruby
versions.
kurko committed Jun 23, 2012
commit c519c2d083fcc64b8566b9ff662573ba5328de1d
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ end

def ruby
require 'rbconfig'
File.join([Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']]) << Config::CONFIG['EXEEXT']
conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
File.join([conf['bindir'], conf['ruby_install_name']]) << conf['EXEEXT']
end

# --------------------------------------------------
3 changes: 2 additions & 1 deletion lib/watchr.rb
Original file line number Diff line number Diff line change
@@ -107,8 +107,9 @@ def debug(msg)
# handler class for current architecture
#
def handler
conf = Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG
@handler ||=
case ENV['HANDLER'] || Config::CONFIG['host_os']
case ENV['HANDLER'] || conf['host_os']
when /darwin|mach|osx|fsevents?/i
if Watchr::HAVE_FSE
Watchr::EventHandler::Darwin