[Win32utils-devel] [ win32utils-Support Requests-12080 ] How would one add these packages as a dependency to a cross-platform gem?

noreply at rubyforge.org noreply at rubyforge.org
Sun Aug 5 16:34:03 EDT 2007


Support Requests item #12080, was opened at 2007-07-07 21:02
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=412&aid=12080&group_id=85

Category: Install Problem (example)
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Luke Bayes (lukebayes)
Assigned to: Nobody (None)
Summary: How would one add these packages as a dependency to a cross-platform gem?

Initial Comment:
I am building a ruby application that is expected to work across all supported platforms (mac/win/linux). Since my application needs to download and install myriad other external applications, I have made extensive use of the fork and open3 features - which forced me to use the win32-open3 implementations from you guys (I'm immensely grateful for your hard work btw).

Now I'm trying to distribute my application as a rubygem, but when I add win32-open3 as a dependency, I'm afraid users on all of the other platforms are going to get prompted to install it - and subsequently fail the installation. 

When I try to install locally on OS X with the dependency activated, it complains and fails.

Do you folks know how to distribute gems that depend on your packages only for windows users?

Here's my project by the way - it's coming along nicely:
http://code.google.com/p/projectsprouts


----------------------------------------------------------------------

Comment By: John-Mason Shackelford (jpshackelford)
Date: 2007-08-05 15:34

Message:
If you are wanting open3 functionality across platforms take a look at http://popen4.rubyforge.org/

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2007-08-04 07:38

Message:
I think there are two approaches you can use. One is to create a separate gem for MS Windows. The other thing you could do is set the gem.platform conditionally within the gem spec itself. For example:

spec = Gem::Specification.new do |gem|
   ...
   if RUBY_PLATFORM.match('mswin')
      spec.add_dependency("win32-open3")
   end
end

Does that help?

Dan

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=412&aid=12080&group_id=85


More information about the win32utils-devel mailing list