diff options
author | Carl Lerche <carllerche@mac.com> | 2010-06-06 13:02:17 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-06-06 13:02:17 -0700 |
commit | 30b63b090c9ab4f733f91b0141100865e8bc99ac (patch) | |
tree | af1e4562093753503b0874c5b7de55b8e7cb0a10 /lib/bundler/dependency.rb | |
parent | 917cc4fd2ffeec796fd2fcb996d2154e15e279dd (diff) | |
download | bundler-30b63b090c9ab4f733f91b0141100865e8bc99ac.tar.gz |
Get the basic platform DSL working
Diffstat (limited to 'lib/bundler/dependency.rb')
-rw-r--r-- | lib/bundler/dependency.rb | 27 |
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 |