class RVM::Environment::ListWrapper
Provides a ruby-like interface to make listing rubies easier.
Public Class Methods
new(parent)
click to toggle source
# File lib/rvm/environment/list.rb, line 57 def initialize(parent) @parent = parent end
Public Instance Methods
default(options = {})
click to toggle source
Shows the current default. If :gemset is passed in and is true, it will include the gemset in the output.
# File lib/rvm/environment/list.rb, line 75 def default(options = {}) options[:gemset] ? @parent.show_alias(:default) : @parent.list_default end
expanded_known()
click to toggle source
A list of known ruby strings, minus svn tags.
# File lib/rvm/environment/list.rb, line 89 def expanded_known raw_known.map do |raw| expand_variants(raw) end.flatten.uniq.sort end
gemsets()
click to toggle source
Returns an array of ruby + gemset combinations.
# File lib/rvm/environment/list.rb, line 62 def gemsets @parent.list_gemsets end
installable()
click to toggle source
Most installable ruby strings.
# File lib/rvm/environment/list.rb, line 107 def installable (expanded_known + ruby_svn_tags).uniq.sort end
known_strings()
click to toggle source
# File lib/rvm/environment/list.rb, line 84 def known_strings @parent.list_known_strings end
raw_known()
click to toggle source
A raw list of known rubies.
# File lib/rvm/environment/list.rb, line 80 def raw_known @parent.list_known end
rubies()
click to toggle source
Returns an array of installed rubies.
# File lib/rvm/environment/list.rb, line 67 def rubies @parent.list_strings end
Protected Instance Methods
expand_variants(s)
click to toggle source
Expands strings to include optional parts (surrounded in brackets), given a useable string.
# File lib/rvm/environment/list.rb, line 115 def expand_variants(s) if s =~ /(\([^\)]+\))/ part = $1 expand_variants(s.sub(part, "")) + expand_variants(s.sub(part, part[1..-2])) else [s] end end