summaryrefslogtreecommitdiff
path: root/lib/bundler/dependency.rb
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-06-06 13:02:17 -0700
committerCarl Lerche <carllerche@mac.com>2010-06-06 13:02:17 -0700
commit30b63b090c9ab4f733f91b0141100865e8bc99ac (patch)
treeaf1e4562093753503b0874c5b7de55b8e7cb0a10 /lib/bundler/dependency.rb
parent917cc4fd2ffeec796fd2fcb996d2154e15e279dd (diff)
downloadbundler-30b63b090c9ab4f733f91b0141100865e8bc99ac.tar.gz
Get the basic platform DSL working
Diffstat (limited to 'lib/bundler/dependency.rb')
-rw-r--r--lib/bundler/dependency.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb
index 1d0a912d96..060ccce592 100644
--- a/lib/bundler/dependency.rb
+++ b/lib/bundler/dependency.rb
@@ -40,6 +40,11 @@ module Bundler
platforms
end
+ def current_platform?
+ return true if @platforms.empty?
+ @platforms.any? { |p| send("#{p}?") }
+ end
+
def to_lock
out = " #{name}"
@@ -51,5 +56,27 @@ module Bundler
out << "\n"
end
+
+ private
+
+ def ruby?
+ !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
+ end
+
+ def ruby_18?
+ ruby? && RUBY_VERSION < "1.9"
+ end
+
+ def ruby_19?
+ ruby? && RUBY_VERSION >= "1.9"
+ end
+
+ def jruby?
+ RUBY_ENGINE == "jruby"
+ end
+
+ def mswin?
+ # w0t?
+ end
end
end