From dca872a74ca363fd9a0425886f3babcd38389464 Mon Sep 17 00:00:00 2001 From: Nikita Vasilyev Date: Wed, 2 Feb 2011 22:49:13 +0300 Subject: [PATCH] Simplify installation. Add OS-specific dependencies to the gemspec. http://stackoverflow.com/questions/4596606/rubygems-how-do-i-add-platform-specific-dependency I suggest you to not use Jeweler. http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/ --- README.md | 4 ++-- em-dir-watcher.gemspec | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f82a513..b8977a5 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,11 @@ Mac: Linux: - sudo gem install rb-inotify em-dir-watcher + sudo gem install em-dir-watcher Windows: - gem install win32-changenotify win32-event em-dir-watcher + gem install em-dir-watcher Usage diff --git a/em-dir-watcher.gemspec b/em-dir-watcher.gemspec index 5e9d1a2..e457677 100644 --- a/em-dir-watcher.gemspec +++ b/em-dir-watcher.gemspec @@ -1,6 +1,3 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command # -*- encoding: utf-8 -*- Gem::Specification.new do |s| @@ -52,6 +49,13 @@ Gem::Specification.new do |s| "examples/monitor.rb" ] + if RUBY_PLATFORM[/linux/] + s.add_dependency('rb-inotify', '>= 0.8.0') + elsif RUBY_PLATFORM[/ming/] + s.add_dependency('win32-event', '>= 0.5.0') + s.add_dependency('win32-changenotify', '>= 0.5.0') + end + if s.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION s.specification_version = 3