Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add rvm list remote rbx/jruby, update #1428

  • Loading branch information...
commit e330bf30333398c5f6902161bd7cb88a3a345f4f 1 parent 7349f07
@mpapis mpapis authored
Showing with 59 additions and 11 deletions.
  1. +3 −0  config/db
  2. +5 −5 help/list
  3. +37 −0 scripts/functions/utility
  4. +14 −6 scripts/list
View
3  config/db
@@ -74,9 +74,12 @@ ironruby_version=1.1.3
ironruby_repo_url=git://github.com/ironruby/ironruby.git
ironruby_1.1.3_url=http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=ironruby&DownloadId=217153&FileTime=129445296766130000&Build=19727
rvm_remote_server_url=https://rvm.io/binaries
+rvm_remote_server_type=rubies
rvm_remote_server_url1=http://jruby.org.s3.amazonaws.com
+rvm_remote_server_type1=jruby
rvm_remote_server_path1=downloads
rvm_remote_server_url2=http://binaries.rubini.us
+rvm_remote_server_type2=rbx
# rvm_remote_server_url2=http://gentoo-binaries.my-custom-server.com
# rvm_remote_server_path2=ec2-2013.09
# Packages
View
10 help/list
@@ -2,16 +2,16 @@ Show list of available rubies,
## Usage:
- rvm list [help,known,remote,gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags]
+ rvm list [help,known,remote [|rbx|jruby],gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags]
## Actions:
- `help` - show this help
- `known` - list known rubies, that can be installed
-- `remote` - list binary build rubies, they do not need compilation
- `gemsets` - list all rubies with their gemsets
- `rubies` - list installed rubies, it is the default action when none given
- `strings` - list installed rubies, machine passable form
-- `known_strings` - list known rubies, that can be installed, machine passable form
-- `ruby_svn_tags` - list ruby tags available at http://svn.ruby-lang.org/repos/ruby/tags/
-- `default [string]` - show the default ruby, passable form with strings
+- `known_strings` - list known rubies, that can be installed, machine passable form
+- `ruby_svn_tags` - list ruby tags available at http://svn.ruby-lang.org/repos/ruby/tags/
+- `default [string]` - show the default ruby, passable form with strings
+- `remote [|rbx|jruby]` - list binary build rubies (also for rbx/jruby), they do not need compilation
View
37 scripts/functions/utility
@@ -498,6 +498,24 @@ __rvm_system_path()
fi
}
+__rvm_system_path_for()
+{
+ typeset _iterator rvm_remote_server_type rvm_remote_server_path
+ _iterator=""
+ while
+ :
+ do
+ rvm_remote_server_type="$(__rvm_db "rvm_remote_server_type${_iterator}")"
+ [[ -n "${rvm_remote_server_type}" ]] || return 0
+ if
+ [[ "${rvm_remote_server_type}" == "$1" ]]
+ then
+ __rvm_system_path - "${_iterator}"
+ fi
+ : $(( _iterator+=1 ))
+ done
+}
+
__rvm_remote_extension()
{
case "$1" in
@@ -592,6 +610,25 @@ __list_remote_rubies_for()
fi
}
+__list_remote_rbx_for()
+{
+ typeset rvm_ruby_url
+ rvm_ruby_url="$1"
+ curl -LsS http://binaries.rubini.us/ |
+ GREP_OPTIONS="" \grep -oE "<Key>[^<]+\.tar\.bz2</Key>" |
+ awk -F"[<>]" '/'"${rvm_ruby_url//\//\/}"'/{print "http://binaries.rubini.us/"$3}'
+}
+
+__list_remote_jruby_for()
+{
+ typeset rvm_ruby_url
+ rvm_ruby_url="$1"
+ curl -LsS http://jruby.org.s3.amazonaws.com/ |
+ GREP_OPTIONS="" \grep -oE "<Key>[^<]+jruby-bin-[^<]+\.tar\.gz</Key>" |
+ awk -F"[<>]" '/'"${rvm_ruby_url//\//\/}"'/{print "http://jruby.org.s3.amazonaws.com/"$3}' |
+ sed 's/-bin-/-/'
+}
+
rubygems_detect_ruby_lib_gem_path()
{
ruby_lib_gem_path="$("${1:-ruby}" -rrbconfig -e "puts ::Kernel.const_get('RbConfig')::CONFIG['rubylibprefix']")/gems/"
View
20 scripts/list
@@ -12,19 +12,27 @@ usage()
list_remote()
{
- typeset version
+ is_a_function __list_remote_${1:-rubies}_for || {
+ rvm_error "Do not know how to display binary rubies for '${1:-rubies}'."
+ return 1
+ }
+ typeset version _system_path
+ _system_path="$( __rvm_system_path_for ${1:-rubies} )"
rubies=($(
- __list_remote_rubies_for "$( __rvm_remote_server_path "${rvm_ruby_string}" )" |
+ __list_remote_${1:-rubies}_for "${_system_path}" |
awk -F/ '{print $NF}' | sed 's/.tar.*$//' | sort -u
))
if (( ${#rubies[@]} == 0 ))
then
- printf "%b" "\n# No remote rubies available. Check 'rvm list known' for what can be installed.\n\n"
- return
+ rvm_error "
+# No remote rubies available for ${_system_path}.
+# Check 'rvm list known' for what can be installed.
+"
+ return 1
fi
- printf "%b" "\n# Rubies available for '$(__rvm_system_path -)':\n\n"
+ printf "%b" "\n# Rubies available for '${_system_path}':\n\n"
for version in "${rubies[@]}"
do
@@ -363,7 +371,7 @@ action="${args[0]:-""}"
args=${args[@]:1} # Strip trailing / leading / extra spacing.
case "${action:-rubies}" in
- -r|--remote|remote) list_remote ;;
+ -r|--remote|remote) list_remote "${args// /}" ;;
known) list_known ;;
known_strings) list_known_strings ;;
gemsets) list_gemsets "$args" ;;
Please sign in to comment.
Something went wrong with that request. Please try again.