From 3bb93cc6f66fb52503ee7e16a2360bdddc2f4309 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 25 Aug 2013 22:19:39 -0400 Subject: [PATCH] Helpers to define OS based gems --- Gemfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index bdab527..461ea69 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,13 @@ source 'https://rubygems.org' +def darwin_only(require_as) + RbConfig::CONFIG['host_os'] =~ /darwin/ && require_as +end + +def linux_only(require_as) + RbConfig::CONFIG['host_os'] =~ /linux/ && require_as +end + gem 'rails', '4.0.0' gem 'sqlite3' gem 'sass-rails', '~> 4.0.0' @@ -21,7 +29,7 @@ group :test, :development do gem 'capybara' gem 'capybara-webkit' gem 'guard-rspec' - gem 'libnotify' + gem 'libnotify', :require => linux_only('libnotify') gem 'rb-fsevent' gem 'database_cleaner', '1.0.1' gem 'coveralls', require: false