-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows users to trade off between full-featured and always-deployable by removing the hard dependency on a native extension. The user of the gem needs to depend on FFI themselves to enable `posix_spawn` on Linux. For testing purposes, the Gemfile loads ffi if required by the environment.
- Loading branch information
Showing
6 changed files
with
50 additions
and
9 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
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,24 @@ | ||
# Based on the example from https://en.wikibooks.org/wiki/Ruby_Programming/RubyGems#How_to_install_different_versions_of_gems_depending_on_which_version_of_ruby_the_installee_is_using | ||
require 'rubygems' | ||
require 'rubygems/command.rb' | ||
require 'rubygems/dependency_installer.rb' | ||
|
||
begin | ||
Gem::Command.build_args = ARGV | ||
rescue NoMethodError # rubocop:disable Lint/HandleExceptions | ||
end | ||
|
||
inst = Gem::DependencyInstaller.new | ||
|
||
begin | ||
if Gem.win_platform? | ||
inst.install 'ffi', "~> 1.0", ">= 1.0.11" | ||
end | ||
rescue # rubocop:disable Lint/RescueWithoutErrorClass | ||
exit(1) | ||
end | ||
|
||
# create dummy rakefile to indicate success | ||
File.open(File.join(File.dirname(__FILE__), 'Rakefile'), 'w') do |f| | ||
f.write("task :default\n") | ||
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