Skip to content

Instantly share code, notes, and snippets.

@myabc
Created October 26, 2009 22:08
Show Gist options
  • Save myabc/219086 to your computer and use it in GitHub Desktop.
Save myabc/219086 to your computer and use it in GitHub Desktop.
From 35a10fced828db18449d8adef13f81a8b04db1ac Mon Sep 17 00:00:00 2001
From: Alex Coles <[email protected]>
Date: Mon, 26 Oct 2009 11:43:26 +0100
Subject: [PATCH] Change Rakefiles to use sudo for rake install under JRuby
* Mirror commit a132eac in DataObjects, same behavior in dm-core.
* SUDOLESS env may be set to prevent this behavior, but this brings it
closer inline to how rake install works for MRI.
Signed-off-by: Alex Coles <[email protected]>
---
Rakefile | 4 ++--
adapters/dm-ferret-adapter/Rakefile | 4 ++--
adapters/dm-rest-adapter/Rakefile | 4 ++--
dm-adjust/Rakefile | 4 ++--
dm-aggregates/Rakefile | 4 ++--
dm-ar-finders/Rakefile | 4 ++--
dm-cli/Rakefile | 4 ++--
dm-constraints/Rakefile | 4 ++--
dm-is-example/Rakefile | 4 ++--
dm-is-list/Rakefile | 4 ++--
dm-is-nested_set/Rakefile | 4 ++--
dm-is-remixable/Rakefile | 4 ++--
dm-is-searchable/Rakefile | 4 ++--
dm-is-state_machine/Rakefile | 4 ++--
dm-is-tree/Rakefile | 4 ++--
dm-is-versioned/Rakefile | 4 ++--
dm-migrations/Rakefile | 4 ++--
dm-observer/Rakefile | 4 ++--
dm-serializer/Rakefile | 4 ++--
dm-sweatshop/Rakefile | 4 ++--
dm-tags/Rakefile | 4 ++--
dm-timestamps/Rakefile | 4 ++--
dm-types/Rakefile | 4 ++--
dm-validations/Rakefile | 4 ++--
rails_datamapper/Rakefile | 4 ++--
25 files changed, 50 insertions(+), 50 deletions(-)
mode change 100755 => 100644 Rakefile
diff --git a/Rakefile b/Rakefile
old mode 100755
new mode 100644
index c58d17d..5340e0e
--- a/Rakefile
+++ b/Rakefile
@@ -44,8 +44,8 @@ gems = GEM_PATHS.map { |p| File.basename(p) }
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
AUTHOR = 'Dan Kubb'
EMAIL = 'dan.kubb [a] gmail [d] com'
diff --git a/adapters/dm-ferret-adapter/Rakefile b/adapters/dm-ferret-adapter/Rakefile
index eef3978..4ca9c74 100644
--- a/adapters/dm-ferret-adapter/Rakefile
+++ b/adapters/dm-ferret-adapter/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/ferret_adapter/version'
diff --git a/adapters/dm-rest-adapter/Rakefile b/adapters/dm-rest-adapter/Rakefile
index 26b438f..9e57790 100644
--- a/adapters/dm-rest-adapter/Rakefile
+++ b/adapters/dm-rest-adapter/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/rest_adapter/version'
diff --git a/dm-adjust/Rakefile b/dm-adjust/Rakefile
index 66699d7..0fcd30f 100644
--- a/dm-adjust/Rakefile
+++ b/dm-adjust/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-adjust/version'
diff --git a/dm-aggregates/Rakefile b/dm-aggregates/Rakefile
index 87b2a1a..1bcca2a 100644
--- a/dm-aggregates/Rakefile
+++ b/dm-aggregates/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-aggregates/version'
diff --git a/dm-ar-finders/Rakefile b/dm-ar-finders/Rakefile
index 4f491bb..d837cd4 100644
--- a/dm-ar-finders/Rakefile
+++ b/dm-ar-finders/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-ar-finders/version'
diff --git a/dm-cli/Rakefile b/dm-cli/Rakefile
index 3ec57a5..e49919c 100644
--- a/dm-cli/Rakefile
+++ b/dm-cli/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-cli/version'
diff --git a/dm-constraints/Rakefile b/dm-constraints/Rakefile
index 28ae0a6..ec2f683 100644
--- a/dm-constraints/Rakefile
+++ b/dm-constraints/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-constraints/version'
diff --git a/dm-is-example/Rakefile b/dm-is-example/Rakefile
index 44c8d43..d5c37f3 100644
--- a/dm-is-example/Rakefile
+++ b/dm-is-example/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-example/is/version'
diff --git a/dm-is-list/Rakefile b/dm-is-list/Rakefile
index ec0fe1d..8a73914 100644
--- a/dm-is-list/Rakefile
+++ b/dm-is-list/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-list/is/version'
diff --git a/dm-is-nested_set/Rakefile b/dm-is-nested_set/Rakefile
index 56b6f8a..38e19a7 100644
--- a/dm-is-nested_set/Rakefile
+++ b/dm-is-nested_set/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-nested_set/is/version'
diff --git a/dm-is-remixable/Rakefile b/dm-is-remixable/Rakefile
index bd6e7b7..ad405ea 100644
--- a/dm-is-remixable/Rakefile
+++ b/dm-is-remixable/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-remixable/is/version'
diff --git a/dm-is-searchable/Rakefile b/dm-is-searchable/Rakefile
index 996c2b0..2d1ac55 100644
--- a/dm-is-searchable/Rakefile
+++ b/dm-is-searchable/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-searchable/is/version'
diff --git a/dm-is-state_machine/Rakefile b/dm-is-state_machine/Rakefile
index c811c58..8f5449f 100644
--- a/dm-is-state_machine/Rakefile
+++ b/dm-is-state_machine/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-state_machine/is/version'
diff --git a/dm-is-tree/Rakefile b/dm-is-tree/Rakefile
index f5228ed..a13a208 100644
--- a/dm-is-tree/Rakefile
+++ b/dm-is-tree/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-tree/is/version'
diff --git a/dm-is-versioned/Rakefile b/dm-is-versioned/Rakefile
index cca66e8..862a38c 100644
--- a/dm-is-versioned/Rakefile
+++ b/dm-is-versioned/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-is-versioned/is/version'
diff --git a/dm-migrations/Rakefile b/dm-migrations/Rakefile
index 943e2ac..fa468a0 100644
--- a/dm-migrations/Rakefile
+++ b/dm-migrations/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-migrations/version'
diff --git a/dm-observer/Rakefile b/dm-observer/Rakefile
index 57ae02e..5f7c16c 100644
--- a/dm-observer/Rakefile
+++ b/dm-observer/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-observer/version'
diff --git a/dm-serializer/Rakefile b/dm-serializer/Rakefile
index 6d8552e..d327780 100644
--- a/dm-serializer/Rakefile
+++ b/dm-serializer/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-serializer/version'
diff --git a/dm-sweatshop/Rakefile b/dm-sweatshop/Rakefile
index b9d66ad..ebd33f9 100644
--- a/dm-sweatshop/Rakefile
+++ b/dm-sweatshop/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-sweatshop/version'
diff --git a/dm-tags/Rakefile b/dm-tags/Rakefile
index b1ce725..9a1cdb7 100644
--- a/dm-tags/Rakefile
+++ b/dm-tags/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-tags/version'
diff --git a/dm-timestamps/Rakefile b/dm-timestamps/Rakefile
index c25b4d8..c17a66c 100644
--- a/dm-timestamps/Rakefile
+++ b/dm-timestamps/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-timestamps/version'
diff --git a/dm-types/Rakefile b/dm-types/Rakefile
index da90923..47e8b34 100644
--- a/dm-types/Rakefile
+++ b/dm-types/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-types/version'
diff --git a/dm-validations/Rakefile b/dm-validations/Rakefile
index ab5c50b..23dc604 100644
--- a/dm-validations/Rakefile
+++ b/dm-validations/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/dm-validations/version'
diff --git a/rails_datamapper/Rakefile b/rails_datamapper/Rakefile
index 64b9434..6e8185a 100644
--- a/rails_datamapper/Rakefile
+++ b/rails_datamapper/Rakefile
@@ -2,8 +2,8 @@ require 'pathname'
ROOT = Pathname(__FILE__).dirname.expand_path
JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform?
-SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
+WIN32 = Gem.win_platform?
+SUDO = WIN32 ? '' : ('sudo' unless ENV['SUDOLESS'])
require ROOT + 'lib/rails_datamapper/version'
--
1.6.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment