Skip to content

Commit 7e9f903

Browse files
committed
using a native extension to get win-file gem installed on windows. its another hook for people to jump through to install the devtools, but...
1 parent fedaa03 commit 7e9f903

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

chemistrykit.gemspec

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@ Gem::Specification.new do |s|
1717
s.add_dependency "selenium-webdriver", "~> 2.27.2"
1818
s.add_dependency "ci_reporter", "~> 1.8.3"
1919

20-
# # A user on a Windows platform is notified that they need to install the following gems manually.
21-
# platforms :mswin do
22-
# s.add_dependency "win32-file", "~> 0.6.8"
23-
# end
20+
s.extensions = 'ext/mkrf_conf.rb'
2421
end

ext/mkrf_conf.rb

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'rubygems'
2+
require 'rubygems/command.rb'
3+
require 'rubygems/dependency_installer.rb'
4+
require 'rbconfig'
5+
6+
begin
7+
Gem::Command.build_args = ARGV
8+
rescue NoMethodError
9+
end
10+
11+
inst = Gem::DependencyInstaller.new
12+
begin
13+
if RbConfig::CONFIG['host_os'] =~ /mswin|win|mingw/
14+
inst.install "win32-dir", "~> 0.4.1"
15+
end
16+
rescue
17+
exit(1)
18+
end
19+
20+
f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
21+
f.write("task :default\n")
22+
f.close

0 commit comments

Comments
 (0)