Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow installation on non-supported systems
Closes #6
- Loading branch information
1 parent
1b2c80a
commit 3b3a7a8
Showing
6 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
require 'mkmf' | ||
require 'rbconfig' | ||
|
||
if have_library("kernel32") and | ||
def generate_makefile | ||
create_makefile("wdm_ext") | ||
end | ||
|
||
def generate_dummy_makefile | ||
File.open("Makefile", "w") do |f| | ||
f.puts dummy_makefile('wdm_ext').join | ||
end | ||
end | ||
|
||
def windows? | ||
RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ | ||
end | ||
|
||
if windows? and | ||
have_library("kernel32") and | ||
have_header("windows.h") and | ||
have_header("ruby.h") and | ||
have_const('HAVE_RUBY_ENCODING_H') | ||
then | ||
create_makefile("wdm") | ||
generate_makefile() | ||
else | ||
generate_dummy_makefile() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
begin | ||
require 'wdm_ext' | ||
rescue LoadError | ||
raise LoadError.new(<<-EOS) | ||
Can't load WDM! | ||
WDM is not supported on your system. For a cross-platform alternative, | ||
we recommend using Listen: http://github.com/guard/listen | ||
EOS | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3b3a7a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad to see you back! Thanks!
3b3a7a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm glad to be back as well :)