lib/cucumber/platform.rb in cucumber-0.1.13 vs lib/cucumber/platform.rb in cucumber-0.1.14

- old
+ new

@@ -1,10 +1,32 @@ # Detect the platform we're running on so we can tweak behaviour # in various places. require 'rbconfig' -$CUCUMBER_JRUBY = defined?(JRUBY_VERSION) -$CUCUMBER_IRONRUBY = Config::CONFIG['sitedir'] =~ /IronRuby/ -$CUCUMBER_WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/ -$CUCUMBER_WINDOWS_MRI = $CUCUMBER_WINDOWS && !$CUCUMBER_JRUBY && !$CUCUMBER_IRONRUBY -$CUCUMBER_RAILS = defined?(Rails) -$CUCUMBER_RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) +module Cucumber + LANGUAGE_FILE = File.expand_path(File.dirname(__FILE__) + '/languages.yml') + BINARY = File.expand_path(File.dirname(__FILE__) + '/../../bin/cucumber') + JRUBY = defined?(JRUBY_VERSION) + IRONRUBY = Config::CONFIG['sitedir'] =~ /IronRuby/ + WINDOWS = Config::CONFIG['host_os'] =~ /mswin|mingw/ + WINDOWS_MRI = WINDOWS && !JRUBY && !IRONRUBY + RAILS = defined?(Rails) + RUBY_BINARY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) + RUBY_1_9 = RUBY_VERSION =~ /^1\.9/ + + class << self + attr_reader :language + + def load_language(lang) + @language = config[lang] + end + + def languages + config.keys.sort + end + + def config + require 'yaml' + @config ||= YAML.load_file(LANGUAGE_FILE) + end + end +end \ No newline at end of file