Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Started working on the gemset ui.

  • Loading branch information...
commit 656f52935f2becb09a400a04b448bc8634f17afc 1 parent eb9aab8
Wayne E. Seguin authored
3  examples/rvmrc
View
@@ -33,3 +33,6 @@
# Install rubies on use when they are not installed
#ruby_install_on_use=1
+
+# Make Flags, I have 2 cpu's so I can do 2 make threads:
+#rvm_make_flags="-j 2"
2  scripts/utility
View
@@ -60,7 +60,7 @@ function __rvm_debug {
# TODO: Allow specification of a base file name to output to.
function __rvm_log {
if [ ! -z "$2" ] ; then level=$1 ; shift ; else level="info" ; fi
- message=$1 ; shift
+ message=$1
case "$level" in
debug) shift ;
if [ ! -z "$rvm_debug_flag" ] ; then
BIN  site/tmp/dependencies
View
Binary file not shown
6 test/btu
View
@@ -7,10 +7,14 @@
#
# Public Methods
#
+
+if [ ! -z "$ZSH_VERSION" ] ; then __array_start=1 ; else __array_start=0 ; fi
+
push() {
array=$1 ; shift ; item=$2
# TODO: allow loop over more arguments.
- eval "${array}[\${#${array}[*]}]=${item}"
+ eval "index=\$((\${#${array}[*]} + $__array_start))"
+ eval "${array}[${index}]=${item}"
}
btu_init() {
6 test/rvm/cli_test 100644 → 100755
View
@@ -1,3 +1,5 @@
-#!/bin/bash
-source btu # Load Bash Test::Unit
+#!/bin/zsh
+
+source ./test/setup
+initialize_rvm
53 test/rvm/gemset_test
View
@@ -0,0 +1,53 @@
+#!/bin/zsh
+
+source ./test/setup
+initialize_rvm
+
+# tests: 29
+# assertions: 290
+
+original_dir=$(pwd)
+testset_dir="$(gem env gemdir)-testset"
+
+setup_testset() {
+ rvm 1.9.1 -m testset
+ echo "Installing Rake"
+ gem install rake --no-rdoc --no-ri
+}
+
+clear_testset() {
+ if [ ! -z "$testset_dir" -a "$testset_dir" != '/' ] ; then rm -rf $testset_dir ; fi
+}
+
+btu_test "rvm gemset testset"
+assert string_eq "testset" $(gem env gemdir | xargs basename | sed "s/^$rvm_ruby_version-//")
+clear_testset
+
+btu_test 'gemset=\`rvm gemset name\`'
+assert string_eq "testset" $gemset
+clear_testset
+
+btu_test 'gemset_dir=\`rvm gemset dir\`'
+assert match "-test$" $gemset_dir
+clear_testset
+
+btu_test "rvm gemset dump"
+assert match "-test$" $gemset_dir
+clear_testset
+
+btu_test "rvm gemset dump my_testset"
+clear_testset
+
+btu_test "rvm gemset dump my_testset.gemset"
+clear_testset
+
+btu_test "rvm gemset load"
+# Should load testset.gemspec
+clear_testset
+
+btu_test "rvm gemset load my_testset.gemspec"
+clear_testset
+
+btu_test "rvm gemset delete test-gemset"
+clear_testset
+
5 test/rvm/initialize
View
@@ -1,5 +0,0 @@
-#!/bin/bash
-__rvm_cleanup_variables
-__rvm_load-rvmrc
-__rvm_initialize
-__rvm_load_defaults
38 test/rvm/selector_test
View
@@ -1,6 +1,7 @@
-#!/bin/bash
+#!/bin/zsh
source ./test/setup
+initialize_rvm
# tests: 29
# assertions: 290
@@ -18,26 +19,27 @@ validate_select() {
assert match "$valid_string/.irbrc" $rvm_ruby_irbrc
}
-for valid_string in $rubies ; do
- source ./test/rvm/initialize
+for valid_string in $(echo $rubies) ; do
btu_test "rvm_ruby_string='$valid_string' ; __rvm_select"
validate_select
done
-rvm_ruby_string='1.8.5' ; valid_string="ruby-1.8.5-p231" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ruby-1.8.5' ; valid_string="ruby-1.8.5-p231" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='1.8.6' ; valid_string="ruby-1.8.6-p383" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ruby-1.8.6' ; valid_string="ruby-1.8.6-p383" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='1.8.7' ; valid_string="ruby-1.8.7-p174" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ruby-1.8.7' ; valid_string="ruby-1.8.7-p174" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='1.9.1' ; valid_string="ruby-1.9.1-p243" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ruby-1.9.1' ; valid_string="ruby-1.9.1-p243" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ree-1.8.6' ; valid_string="ree-1.8.6-20090610" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ree' ; valid_string="ree-1.8.7-20090928" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ree-1.8.7' ; valid_string="ree-1.8.7-20090928" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='ree-head' ; valid_string='ree-1.8.7-head' ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='jruby-1.4.0'; valid_string="jruby-1.4.0RC1" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='jruby-1.3.1'; valid_string="jruby-1.3.1" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
-rvm_ruby_string='jruby' ; valid_string="jruby-1.3.1" ; btu_test "rvm_ruby_string=$rvm_ruby_string ; __rvm_select" ; validate_select
+command="rvm_ruby_string=\$rvm_ruby_string ; __rvm_select"
+rvm_ruby_string='1.8.5' ; valid_string="ruby-1.8.5-p231" ; btu_test $command ; validate_select
+rvm_ruby_string='ruby-1.8.5' ; valid_string="ruby-1.8.5-p231" ; btu_test $command ; validate_select
+rvm_ruby_string='1.8.6' ; valid_string="ruby-1.8.6-p383" ; btu_test $command ; validate_select
+rvm_ruby_string='ruby-1.8.6' ; valid_string="ruby-1.8.6-p383" ; btu_test $command ; validate_select
+rvm_ruby_string='1.8.7' ; valid_string="ruby-1.8.7-p174" ; btu_test $command ; validate_select
+rvm_ruby_string='ruby-1.8.7' ; valid_string="ruby-1.8.7-p174" ; btu_test $command ; validate_select
+rvm_ruby_string='1.9.1' ; valid_string="ruby-1.9.1-p243" ; btu_test $command ; validate_select
+rvm_ruby_string='ruby-1.9.1' ; valid_string="ruby-1.9.1-p243" ; btu_test $command ; validate_select
+rvm_ruby_string='ree-1.8.6' ; valid_string="ree-1.8.6-20090610" ; btu_test $command ; validate_select
+rvm_ruby_string='ree' ; valid_string="ree-1.8.7-20090928" ; btu_test $command ; validate_select
+rvm_ruby_string='ree-1.8.7' ; valid_string="ree-1.8.7-20090928" ; btu_test $command ; validate_select
+rvm_ruby_string='ree-head' ; valid_string='ree-1.8.7-head' ; btu_test $command ; validate_select
+rvm_ruby_string='jruby-1.4.0'; valid_string="jruby-1.4.0RC1" ; btu_test $command ; validate_select
+rvm_ruby_string='jruby-1.3.1'; valid_string="jruby-1.3.1" ; btu_test $command ; validate_select
+rvm_ruby_string='jruby' ; valid_string="jruby-1.3.1" ; btu_test $command ; validate_select
if [ `basename $0` = "selector_test" ] ; then btu_summary ; fi
+
4 test/rvm/use_test
View
@@ -1,5 +1,7 @@
-#!/bin/bash
+#!/bin/zsh
+
source ./test/setup
+initialize_rvm
for ruby in $rubies ; do
rvm_ruby_string=$ruby ; __rvm_select ; __rvm_use
8 test/setup
View
@@ -1,9 +1,17 @@
#!/bin/bash
+
rvm_dir=~/.rvm-test ; export rvm_dir
./install
source scripts/rvm
rubies=$(\ls test/rubies/)
+initialize_rvm() {
+ __rvm_cleanup_variables
+ __rvm_load-rvmrc
+ __rvm_initialize
+ __rvm_load_defaults
+}
+
# Load the Bash Test::Unit Framework
source test/btu
btu_init
Please sign in to comment.
Something went wrong with that request. Please try again.