class Rubygems::XcodeprojGenerator::Rbenv
Constants
- DEFAULT_ROOT_PATH
- VERSIONS_PATH
Public Class Methods
new(root_path = nil)
click to toggle source
Calls superclass method
Rubygems::XcodeprojGenerator::AbstractRubyHeaderProvider::new
# File lib/rubygems/xcodeproj_generator/rbenv.rb, line 9 def initialize(root_path = nil) root_path ||= ENV['RBENV_ROOT'] || DEFAULT_ROOT_PATH super(root_path) end
Private Instance Methods
base_ruby_header_path()
click to toggle source
# File lib/rubygems/xcodeproj_generator/rbenv.rb, line 16 def base_ruby_header_path return nil unless latest_cruby_version find_path(root_path, VERSIONS_PATH, latest_cruby_version, 'include/ruby-*') end
cruby_versions()
click to toggle source
# File lib/rubygems/xcodeproj_generator/rbenv.rb, line 25 def cruby_versions versions.select { |version| version.match(/\A\d+\.\d+\.\d+/) } end
latest_cruby_version()
click to toggle source
# File lib/rubygems/xcodeproj_generator/rbenv.rb, line 21 def latest_cruby_version cruby_versions.sort_by { |version| Gem::Version.new(version) }.last end
versions()
click to toggle source
# File lib/rubygems/xcodeproj_generator/rbenv.rb, line 29 def versions return [] unless available? versions_dir = File.join(root_path, VERSIONS_PATH) Dir.chdir(versions_dir) do Dir['*'] end end