rvm 0.0.82 → 0.0.83

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ add(){
10
10
  fi
11
11
  }
12
12
 
13
- if [[ ! -z "$(which ruby | awk '/rvm/{print}')" ]] ; then
13
+ if [[ ! -z "$(which ruby 2>/dev/null | awk '/rvm/{print}')" ]] ; then
14
14
  unset format
15
15
  while [[ $# -gt 0 ]] ; do
16
16
  token="$1" ; shift
@@ -30,7 +30,7 @@ if [[ ! -z "$(which ruby | awk '/rvm/{print}')" ]] ; then
30
30
  add "patchlevel"
31
31
  fi
32
32
 
33
- ruby_string=$(dirname "$(which ruby)" | xargs dirname | xargs basename)
33
+ ruby_string=$(dirname "$(which ruby 2>/dev/null)" | xargs dirname | xargs basename)
34
34
  if [[ ! -z "$interpreter_flag" ]] ; then
35
35
  interpreter="$(echo $ruby_string | awk -F'-' '{print $1}')"
36
36
  fi
data/config/db CHANGED
@@ -19,6 +19,9 @@ ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
19
19
  ree_1.8.7_url=http://rubyforge.org/frs/download.php/66162
20
20
  ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
21
21
  ree_1.8.7_patch_level=2009.10
22
+ rbx_version=1.0.0-rc1
23
+ rbx_patch_level=20091125
24
+ rbx_url=http://asset.rubini.us/rubinius-1.0.0-rc1-20091125.tar.gz
22
25
  ruby_1.9.1_patch_level=243
23
26
  ruby_1.9.2_patch_level=preview1
24
27
  ruby_1.8.5_patch_level=231
data/install CHANGED
@@ -38,7 +38,9 @@ cp -f "$source_dir/README" "$rvm_path/"
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
39
  for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
- cp -Rf "$source_dir/$dir_name" "$rvm_path"
41
+ if [[ -d "$source_dir/$dir_name" ]] ; then
42
+ cp -Rf "$source_dir/$dir_name" "$rvm_path"
43
+ fi
42
44
  done ; unset dir_name
43
45
 
44
46
  #
@@ -73,43 +75,7 @@ chmod +x $rvm_path/scripts/rvm
73
75
  #
74
76
  # System Checks
75
77
  #
76
- system="$(uname)"
77
- echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
78
- if [[ "Linux" = "$system" ]] ; then
79
- rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
80
- rvm_emerge_binary="$(which emerge 2> /dev/null)"
81
- rvm_pacman_binary="$(which pacman 2> /dev/null)"
82
- rvm_yum_binary="$(which yum 2> /dev/null)"
83
-
84
- if [[ ! -z "$rvm_apt_get_binary" ]] ; then
85
- echo -e " $item For JRuby (if you wish to use it) you will need:"
86
- echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
87
- echo -e " $item For ree (if you wish to use it) you will need:"
88
- echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
89
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
90
- echo -e " $ aptitude install libxml2-dev"
91
-
92
- elif [[ ! -z "$rvm_emerge_binary" ]] ; then
93
- echo -e " $item For JRuby (if you wish to use it) you will need:"
94
- echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
95
-
96
- elif [[ ! -z "$rvm_pacman_binary" ]] ; then
97
- echo -e " $item For JRuby (if you wish to use it) you will need:"
98
- echo -e " $ pacman -Sy jdk jre"
99
-
100
- elif [[ ! -z "$rvm_yum_binary" ]] ; then
101
- echo -e " $item For ree (if you wish to use it) you will need:"
102
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
103
-
104
- else
105
- echo -e " $item For JRuby (if you wish to use it) you will need:"
106
- echo -e " The SUN java runtime environment and development kit."
107
- fi
108
- elif [[ "Darwin" = "$system" ]] ; then
109
- echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
- echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
111
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
112
- fi
78
+ $rvm_path/scripts/notes
113
79
 
114
80
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
81
  echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 82
4
+ :patch: 83
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.82"
8
+ s.version = "0.0.83"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wayne E. Seguin"]
12
- s.date = %q{2009-11-21}
12
+ s.date = %q{2009-11-26}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter installations and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -44,9 +44,11 @@ Gem::Specification.new do |s|
44
44
  "scripts/install",
45
45
  "scripts/irbrc",
46
46
  "scripts/irbrc.rb",
47
+ "scripts/libraries",
47
48
  "scripts/log",
48
49
  "scripts/match",
49
50
  "scripts/monitor",
51
+ "scripts/notes",
50
52
  "scripts/ruby-installer",
51
53
  "scripts/rvm",
52
54
  "scripts/rvm-install",
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ ! -z "$ZSH_VERSION" ]] ; then __array_start=1 ; else __array_start=0 ; fi
4
+
3
5
  # Usage: contains "a_string" "${an_array[@]}"
4
6
  array_contains() {
5
7
  local pattern="$1" ; shift
@@ -12,11 +14,14 @@ array_contains() {
12
14
  }
13
15
 
14
16
  array_length() {
15
- array=$1 ; return "${#array[*]}"
17
+ array=$1
18
+ eval "length=\${#${array}[*]}"
19
+ echo $length
20
+ return length
16
21
  }
17
22
 
18
23
  array_push() {
19
- array=$1 ; shift ; item=$2
24
+ array=$1 ; item=$2
20
25
  # TODO: allow loop over more arguments.
21
26
  eval "index=\$((\${#${array}[*]} + $__array_start))"
22
27
  eval "${array}[${index}]=${item}"
@@ -17,7 +17,7 @@ __rvm_parse_args() {
17
17
  while [[ $# -gt 0 ]] ; do
18
18
  rvm_token="$1" ; shift
19
19
  case "$rvm_token" in
20
- install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor)
20
+ install|uninstall|path|info|setup|version|srcdir|list|reset|debug|reload|implode|readline|update|iconv|curl|openssl|ncurses|zlib|readline|monitor|notes)
21
21
  rvm_action=$rvm_token
22
22
  ;;
23
23
 
@@ -353,7 +353,11 @@ rvm() {
353
353
  gems) __rvm_gems ; result=$? ;;
354
354
  remove) __rvm_remove_ruby ; result=$? ;;
355
355
  ruby|gem|rake) __rvm_do ; result=$? ;;
356
- monitor) $rvm_scripts_path/monitor ; result=$? ;;
356
+ monitor)
357
+ export rvm_ruby_version rvm_ruby_string
358
+ $rvm_scripts_path/monitor ; result=$?
359
+ ;;
360
+ notes) $rvm_scripts_path/notes ; result=$? ;;
357
361
  reload) source "$rvm_path/scripts/rvm" ;;
358
362
  install|uninstall) __rvm_manage_rubies ; result=$? ;;
359
363
  tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- fetch_command=$(which curl)
3
+ fetch_command=$(which curl 2>/dev/null)
4
4
  if [[ $? -ne 0 ]] ; then
5
5
  $rvm_scripts_path/log "fail" "rvm requires curl, which does not seem to exist in your path :("
6
6
  exit 1
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  __rvm_gems_select() {
4
+ if [[ -z "$(which gem 2>/dev/null)" ]] ; then return 0 ; fi
5
+
4
6
  if [[ -z "$rvm_gem_set_name" ]] ; then
5
7
  if [[ ! -z "$GEM_HOME" ]] ; then
6
8
  rvm_gem_set_name=$(echo $GEM_HOME | xargs basename | awk -F'%' '{print $2}')
@@ -15,12 +17,12 @@ __rvm_gems_select() {
15
17
  else
16
18
  if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ ! -z "$rvm_ruby_version" ]] && [[ "$rvm_ruby_interpreter" != "system" ]] ; then
17
19
  rvm_ruby_gem_home="$rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version"
18
- elif [[ -z "$GEM_HOME" ]] ; then
20
+ elif [[ -z "$GEM_HOME" ]] && [[ ! -z "$(which gem 2>/dev/null)" ]] ; then
19
21
  rvm_ruby_gem_home=$(gem env gemdir)
20
22
  elif [[ ! -z "$GEM_HOME" ]] ; then
21
23
  rvm_ruby_gem_home="$GEM_HOME"
22
24
  else
23
- $rvm_scripts_path/log "error" "Cannot select gem home, something definitely wrong :/"
25
+ unset rvm_ruby_gem_home
24
26
  fi
25
27
  fi
26
28
  if [[ -z "$rvm_gem_set_name" ]] ; then unset rvm_gem_set_name ; fi
@@ -243,6 +245,7 @@ __rvm_gems_load() {
243
245
  }
244
246
 
245
247
  __rvm_gemdir() {
248
+
246
249
  if [[ "$rvm_user_flag" -eq 1 ]] ; then
247
250
  echo $(rvm system ; gem env | grep $HOME | awk '{print $NF}')
248
251
  elif [[ "$rvm_system_flag" -eq 1 ]] ; then
@@ -260,6 +263,11 @@ __rvm_gems() {
260
263
  unset GEM_PATH
261
264
  if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
262
265
 
266
+ if [[ -z "$(which gem 2>/dev/null)" ]] ; then
267
+ $rvm_scripts_path/log "error" "'gem' was not found, cannot perform gem actions."
268
+ return 1
269
+ fi
270
+
263
271
  if [[ ! -z "$rvm_clear_flag" ]] ; then
264
272
  __rvm_gems_clear
265
273
  elif [[ ! -z "$rvm_load_flag" ]] ; then
@@ -38,7 +38,9 @@ cp -f "$source_dir/README" "$rvm_path/"
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
39
  for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
- cp -Rf "$source_dir/$dir_name" "$rvm_path"
41
+ if [[ -d "$source_dir/$dir_name" ]] ; then
42
+ cp -Rf "$source_dir/$dir_name" "$rvm_path"
43
+ fi
42
44
  done ; unset dir_name
43
45
 
44
46
  #
@@ -73,43 +75,7 @@ chmod +x $rvm_path/scripts/rvm
73
75
  #
74
76
  # System Checks
75
77
  #
76
- system="$(uname)"
77
- echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
78
- if [[ "Linux" = "$system" ]] ; then
79
- rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
80
- rvm_emerge_binary="$(which emerge 2> /dev/null)"
81
- rvm_pacman_binary="$(which pacman 2> /dev/null)"
82
- rvm_yum_binary="$(which yum 2> /dev/null)"
83
-
84
- if [[ ! -z "$rvm_apt_get_binary" ]] ; then
85
- echo -e " $item For JRuby (if you wish to use it) you will need:"
86
- echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
87
- echo -e " $item For ree (if you wish to use it) you will need:"
88
- echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
89
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
90
- echo -e " $ aptitude install libxml2-dev"
91
-
92
- elif [[ ! -z "$rvm_emerge_binary" ]] ; then
93
- echo -e " $item For JRuby (if you wish to use it) you will need:"
94
- echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
95
-
96
- elif [[ ! -z "$rvm_pacman_binary" ]] ; then
97
- echo -e " $item For JRuby (if you wish to use it) you will need:"
98
- echo -e " $ pacman -Sy jdk jre"
99
-
100
- elif [[ ! -z "$rvm_yum_binary" ]] ; then
101
- echo -e " $item For ree (if you wish to use it) you will need:"
102
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
103
-
104
- else
105
- echo -e " $item For JRuby (if you wish to use it) you will need:"
106
- echo -e " The SUN java runtime environment and development kit."
107
- fi
108
- elif [[ "Darwin" = "$system" ]] ; then
109
- echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
- echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
111
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
112
- fi
78
+ $rvm_path/scripts/notes
113
79
 
114
80
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
81
  echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #
4
+ # ruby supporting libraries:
5
+ #
6
+ __rvm_readline_install() {
7
+ __rvm_make_flags
8
+ __rvm_pushpop $rvm_src_path
9
+ package="readline" ; version="5.2" ; archive_format="tar.gz"
10
+ # TODO: Figure out how to list, grab and apply the patches
11
+ $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
12
+ $rvm_scripts_path/fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.$archive_format"
13
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
14
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
15
+ builtin cd "$rvm_src_path/$package-$version"
16
+ if [[ "Darwin" = "$(uname)" ]] ; then
17
+ #sdk=$(\ls -t /Developer/SDKs/ | head -n 1)
18
+ #CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
19
+ #LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
20
+ #export CFLAGS LDFLAGS
21
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package"
22
+ else
23
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package"
24
+ fi
25
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
26
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
27
+ __rvm_pushpop
28
+ }
29
+
30
+ __rvm_iconv_install() {
31
+ __rvm_make_flags
32
+ __rvm_pushpop $rvm_src_path
33
+ package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
34
+ $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
35
+ $rvm_scripts_path/fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.$archive_format"
36
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
37
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
38
+ builtin cd "$rvm_src_path/$package-$version"
39
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
40
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
41
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
42
+ __rvm_pushpop
43
+ }
44
+
45
+ __rvm_curl_install() {
46
+ __rvm_make_flags
47
+ __rvm_pushpop $rvm_src_path
48
+ package="curl" ; version=7.19.7 ; archive_format="tar.gz"
49
+ $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
50
+ $rvm_scripts_path/fetch "http://curl.haxx.se/download/$package-$version.$archive_format"
51
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
52
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
53
+ builtin cd "$rvm_src_path/$package-$version"
54
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
55
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
56
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
57
+ __rvm_pushpop
58
+ }
59
+
60
+ __rvm_openssl_install() {
61
+ __rvm_make_flags
62
+ if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then
63
+ openssl_os="os/compiler darwin64-x86_64-cc"
64
+ else
65
+ openssl_os="os/compiler darwin-i386-cc"
66
+ fi
67
+ __rvm_pushpop $rvm_src_path
68
+ package="openssl" ; version="0.9.8k" ; archive_format="tar.gz"
69
+ $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
70
+ $rvm_scripts_path/fetch "http://www.openssl.org/source/$package-$version.tar.gz"
71
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
72
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
73
+ builtin cd "$rvm_src_path/$package-$version"
74
+ __rvm_run "$package/config" "./config --prefix=$rvm_path/usr zlib no-asm no-krb5 shared" "Configuring $package."
75
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
76
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
77
+ __rvm_pushpop
78
+ }
79
+
80
+ __rvm_zlib_install() {
81
+ __rvm_make_flags
82
+ __rvm_pushpop $rvm_src_path
83
+ package="zlib" ; version="1.2.3" ; archive_format="tar.gz"
84
+ $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
85
+ $rvm_scripts_path/fetch "http://www.zlib.net/$package-$version.tar.gz"
86
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
87
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
88
+ builtin cd "$rvm_src_path/$package-$version"
89
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
90
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
91
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
92
+ __rvm_pushpop
93
+ }
94
+
95
+ __rvm_ncurses_install() {
96
+ __rvm_make_flags
97
+ __rvm_pushpop $rvm_src_path
98
+ package="ncurses" ; version="5.7" ; archive_format="tar.gz"
99
+ $rvm_scripts_path/log "info" "Retrieving $package"
100
+ $rvm_scripts_path/fetch "ftp://invisible-island.net/ncurses/ncurses.tar.gz"
101
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
102
+ __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package.$archive_format -C $rvm_src_path" "Extracting $package.$archive_format"
103
+ builtin cd "$rvm_src_path/$package-$version"
104
+ __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" "Configuring $package."
105
+ __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
106
+ __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
107
+ __rvm_pushpop
108
+ }
109
+
@@ -1,5 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ rvm_monitor_sleep=3
4
+ original_ruby_version=$rvm_ruby_version
5
+ original_ruby_string=$rvm_ruby_string
6
+
7
+ source $rvm_scripts_path/rvm
8
+
3
9
  timestamp() {
4
10
  if [[ "Darwin" = "$(uname)" ]] ; then
5
11
  echo $(stat -f "%m" $1)
@@ -8,34 +14,62 @@ timestamp() {
8
14
  fi
9
15
  }
10
16
 
11
- if [[ -d "test/" ]] ; then test_timestamp=$(timestamp "test/") ; fi
12
- if [[ -d "spec/" ]] ; then spec_timestamp=$(timestamp "spec/") ; fi
17
+ push_if_timestamp_changed() {
18
+ file=$1
19
+ file_timestamp=$(timestamp $file)
20
+
21
+ eval "time=\$${framework}_timestamp"
22
+ if [[ "$file_timestamp" -gt $time ]] ; then
23
+ array_push "changed_${framework}_files" $file
24
+ fi
25
+ }
26
+
27
+ update_timestamp() {
28
+ if [[ -d "${1}/" ]] ; then
29
+ touch "$rvm_path/${1}_timestamp"
30
+ eval "${1}_timestamp=\$(timestamp \"$rvm_path/${1}_timestamp\")"
31
+ fi
32
+ }
33
+
34
+ update_timestamp "test"
35
+ update_timestamp "spec"
13
36
 
14
37
  while : ; do
15
38
  changed_test_files=() ; changed_spec_files=()
16
39
 
17
- if [[ -d "test/" ]] ; then
18
- while read -r line ; do
19
- if [[ $(timestamp $file) -gt $timestamp ]] ; then
20
- array_push $changed_test_files $file
21
- fi
22
- done < <($(\ls test/**/*_test.rb))
23
- fi
40
+ for framework in test spec ; do
41
+
42
+ if [[ -d "$framework/" ]] ; then
43
+
44
+ files=($(\ls ${framework}/**/*_${framework}.rb))
45
+ for file in $files ; do
46
+ push_if_timestamp_changed $file $framework
47
+ done
48
+
49
+ if [[ "$(array_length "changed_${framework}_files")" -gt 0 ]] ; then
50
+ rvm_ruby_version=$original_ruby_version
51
+ rvm_ruby_string=$original_ruby_string
52
+ if [[ "spec" = "$framework" ]] ; then
53
+ rvm_action="spec"
54
+ rvm_ruby_args="spec/spec_helper.rb ${changed_spec_files[*]}"
55
+ __rvm_do
24
56
 
25
- if [[ -d "spec/" ]] ; then
26
- while read -r line ; do
27
- if [[ $(timestamp $file) -gt $timestamp ]] ; then
28
- array_push $changed_spec_files $file
57
+ elif [[ "test" = "$framework" ]] ; then
58
+ rvm_action="ruby"
59
+ rvm_ruby_args=" -r$(echo "${changed_test_files[*]}" | sed 's/ / -r/g') test/test_helper.rb"
60
+ __rvm_do
61
+ fi
62
+ update=1
29
63
  fi
30
- done < <($(\ls spec/**/*_spec.rb))
31
- fi
64
+ fi
32
65
 
33
- if [[ $(array_length $changed_test_files) -gt 0 ]] ; then
34
- testrb "${myarray[*]}"
35
- fi
66
+ if [[ "$update" -eq 1 ]] ; then
67
+ update_timestamp $framework
68
+ fi
69
+ done
36
70
 
37
- if [[ $(array_length $changed_spec_files) -gt 0 ]] ; then
38
- spec "${myarray[*]}"
39
- fi
71
+ unset update changed_test_files changed_spec_files
72
+
73
+ sleep $rvm_monitor_sleep
40
74
  done
41
75
 
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+
3
+ system="$(uname)"
4
+
5
+ item="$(tput setaf 2)* $(tput sgr0)"
6
+
7
+ echo -e "\n$(tput setaf 2)rvm notes for $system $(tput sgr0)\n"
8
+
9
+ if [[ "Linux" = "$system" ]] ; then
10
+ rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
11
+ rvm_emerge_binary="$(which emerge 2> /dev/null)"
12
+ rvm_pacman_binary="$(which pacman 2> /dev/null)"
13
+ rvm_yum_binary="$(which yum 2> /dev/null)"
14
+
15
+ if [[ ! -z "$rvm_apt_get_binary" ]] ; then
16
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
17
+ echo -e "\n $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
18
+ echo -e "\n $item For MRI & ree (if you wish to use it) you will need:"
19
+ echo -e "\n $ aptitude install bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev"
20
+
21
+ elif [[ ! -z "$rvm_emerge_binary" ]] ; then
22
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
23
+ echo -e "\n $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
24
+
25
+ elif [[ ! -z "$rvm_pacman_binary" ]] ; then
26
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
27
+ echo -e " $ pacman -Sy jdk jre"
28
+
29
+ elif [[ ! -z "$rvm_yum_binary" ]] ; then
30
+ echo -e " $item For ree (if you wish to use it) you will need:"
31
+ echo -e "\n $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
32
+
33
+ else
34
+ echo -e " $item For JRuby (if you wish to use it) you will need:"
35
+ echo -e "\n The SUN java runtime environment and development kit."
36
+ fi
37
+ elif [[ "Darwin" = "$system" ]] ; then
38
+ echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
39
+ echo -e "\n $item You should download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
40
+ echo -e "\n $item If you intend on installing MacRuby you must install LLVM first."
41
+ fi
42
+
43
+ echo
44
+
@@ -26,7 +26,7 @@ __rvm_install_source() {
26
26
  else
27
27
  if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then
28
28
  if [[ -d "$rvm_ruby_src_path/.git" ]] ; then
29
- builtin builtin cd $rvm_ruby_src_path
29
+ builtin cd $rvm_ruby_src_path
30
30
  if [[ -z "$rvm_ruby_revision" ]] ; then
31
31
  $rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
32
32
  git pull origin master
@@ -73,11 +73,11 @@ __rvm_install_source() {
73
73
  fi
74
74
  fi
75
75
 
76
- builtin builtin cd $rvm_ruby_src_path
76
+ builtin cd $rvm_ruby_src_path
77
77
  if [[ $? -gt 0 ]] ; then result=$? ; $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result ; fi
78
78
 
79
79
  if [[ -z "$rvm_ruby_configure" ]] && [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
80
- rvm_autoconf="$(which autoconf)"
80
+ rvm_autoconf="$(which autoconf 2>/dev/null)"
81
81
  if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
82
82
  __rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
83
83
  # if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
@@ -96,11 +96,11 @@ __rvm_install_source() {
96
96
  $rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
97
97
  fi
98
98
 
99
- rvm_ruby_make=${rvm_ruby_make:-"/usr/bin/make"}
99
+ rvm_ruby_make=${rvm_ruby_make:-"make"}
100
100
  __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
101
101
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
102
102
 
103
- rvm_ruby_make_install=${rvm_ruby_make_install:-"/usr/bin/make install"}
103
+ rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
104
104
  __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_package_name"
105
105
  if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
106
106
 
@@ -237,22 +237,32 @@ RubyWrapper
237
237
  echo "$(export rvm_install_on_use_flag=1 ; rvm 1.8.7)" # This should install if missing.
238
238
  # TODO: use 'rvm gems load' here:
239
239
  unset CFLAGS LDFLAGS ARCHFLAGS # Important.
240
- __rvm_unset_ruby_variables ; rvm_ruby_string="rbx-head" ; __rvm_select
240
+ # __rvm_unset_ruby_variables ; rvm_ruby_string="rbx-head" ; __rvm_select
241
241
 
242
242
  unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC
243
243
  PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
244
244
  PATH=$rvm_bin_path:$PATH ; export PATH
245
245
 
246
- rvm_ruby_repo_url="$rvm_rubinius_repo_url"
247
- rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"
248
-
249
- if [[ ! -d "$rvm_ruby_home" ]] || [[ ! -d "$rvm_ruby_home/.git" ]] ; then
250
- rm -rf "$rvm_ruby_home" ; builtin cd "$rvm_home"
251
- __rvm_run "rbx.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_home" "Cloning $rvm_ruby_repo_url"
252
- builtin cd "$rvm_ruby_home"
246
+ if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.0/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
247
+ if [[ ! -f "$rvm_archives_path/$rvm_ruby_package_name.tar.gz" ]] ; then
248
+ $rvm_scripts_path/log "info" "Downloading $rvm_ruby_file, this may take a while depending on your connection..."
249
+ $rvm_scripts_path/fetch "$rvm_url"
250
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
251
+ fi
252
+ __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_file.tar.gz ..."
253
+ if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
254
+ mv $rvm_src_path/rubinius-$rvm_ruby_version $rvm_ruby_src_path
253
255
  else
254
- builtin cd "$rvm_ruby_home"
255
- __rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master"
256
+ rvm_ruby_repo_url="$rvm_rubinius_repo_url"
257
+ #rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"
258
+ if [[ ! -d "$rvm_ruby_src_path" ]] || [[ ! -d "$rvm_ruby_src_path/.git" ]] ; then
259
+ rm -rf "$rvm_ruby_src_path" ; builtin cd "$rvm_home"
260
+ __rvm_run "rbx.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path" "Cloning $rvm_ruby_repo_url"
261
+ builtin cd "$rvm_ruby_src_path"
262
+ else
263
+ builtin cd "$rvm_ruby_src_path"
264
+ __rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master"
265
+ fi
256
266
  fi
257
267
 
258
268
  #if [[ ! -x "$rvm_ruby_distclean" ]] ; then
@@ -263,19 +273,19 @@ RubyWrapper
263
273
  # RBX_PREFIX="$rvm_ruby_home" ; export RBX_PREFIX
264
274
  # Also see 'rakelib/configuration.rake'
265
275
 
266
- builtin cd "$rvm_ruby_home"
276
+ builtin cd "$rvm_ruby_src_path"
267
277
  # TODO: Once installer is done add the prefix:
268
- #rvm_ruby_configure="./configure --prefix=$rvm_ruby_home" ; message="Configuring rbx"
269
- rvm_ruby_configure="./configure" ; message="Configuring rbx"
278
+ rvm_ruby_configure="./configure --prefix=$rvm_ruby_home" ; message="Configuring rbx"
279
+ #rvm_ruby_configure="./configure" ; message="Configuring rbx"
270
280
  if [[ ! -z "$rvm_jit_flag" ]] ; then
271
281
  rvm_ruby_configure="$rvm_ruby_configure --enable-llvm" ; message="$message with LLVM enabled"
272
282
  fi
273
283
  __rvm_run "configure" "$rvm_ruby_configure" "$message"
274
284
 
275
285
  if [[ "$rvm_trace_flag" -eq 1 ]] ; then
276
- rvm_ruby_make="\$(rvm 1.8.7 ; rake --trace)" ; message="Compiling rbx"
286
+ rvm_ruby_make="\$(rvm 1.8.7 ; rake install --trace)" ; message="Compiling rbx"
277
287
  else
278
- rvm_ruby_make="\$(rvm 1.8.7 ; rake)" ; message="Compiling rbx"
288
+ rvm_ruby_make="\$(rvm 1.8.7 ; rake install)" ; message="Compiling rbx"
279
289
  fi
280
290
  __rvm_run "rake" "$rvm_ruby_make" "$message"
281
291
 
@@ -288,18 +298,6 @@ RubyWrapper
288
298
  ln -fs $rvm_ruby_home/bin/rbx $rvm_ruby_home/bin/$binary_name
289
299
  done ; unset binary_name binaries
290
300
 
291
- __rvm_run "rake.install" "$rvm_ruby_home/bin/rbx gem install rake --no-rdoc --no-ri" "Installing Rake"
292
-
293
- binary=rake
294
- if [[ -f $rvm_ruby_gem_home/bin/$binary ]] ; then
295
- if [[ "$rvm_ruby_gem_home" != "$rvm_ruby_home" ]] ; then
296
- cp $rvm_ruby_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
297
- fi
298
- chmod +x $rvm_ruby_home/bin/$binary
299
- __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$binary"
300
- __rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
301
- fi ; unset binary
302
-
303
301
  binaries="erb ri rdoc"
304
302
  __rvm_post_install
305
303
 
@@ -325,6 +323,19 @@ RubyWrapper
325
323
  done ; unset file_name
326
324
  unset ruby_wrapper binary_name files prefix
327
325
  done
326
+
327
+ __rvm_run "rake.install" "$rvm_ruby_home/bin/rbx gem install rake --no-rdoc --no-ri" "Installing Rake"
328
+
329
+ binary=rake
330
+ if [[ -f $rvm_ruby_gem_home/bin/$binary ]] ; then
331
+ if [[ "$rvm_ruby_gem_home" != "$rvm_ruby_home" ]] ; then
332
+ cp $rvm_ruby_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
333
+ fi
334
+ chmod +x $rvm_ruby_home/bin/$binary
335
+ __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$binary"
336
+ __rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
337
+ fi ; unset binary
338
+
328
339
  __rvm_irbrc
329
340
  __rvm_bin_scripts
330
341
  ;;
@@ -410,7 +421,6 @@ RubyWrapper
410
421
  PATH=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
411
422
  PATH=$rvm_bin_path:$PATH ; export PATH
412
423
 
413
- rvm_ruby_repo_url=$rvm_shyouhei_repo_url
414
424
  unset rvm_ruby_configure
415
425
  rvm_ruby_src_path=$rvm_ruby_home
416
426
  # rvm_ruby_make="rake"
@@ -428,7 +438,7 @@ RubyWrapper
428
438
  fi
429
439
 
430
440
  if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
431
- rvm_autoconf="$(which autoconf)"
441
+ rvm_autoconf="$(which autoconf 2>/dev/null)"
432
442
  if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
433
443
  __rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
434
444
  # if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
@@ -636,8 +646,9 @@ __rvm_rubygems_setup() {
636
646
 
637
647
  __rvm_inject_ruby_shebang() {
638
648
  __rvm_actual_file $1
649
+
639
650
  if [[ -f "$actual_file" ]] ; then
640
- sed -i.orig -e "s=env [j]*ruby=env $rvm_ruby_home/bin/ruby=" $actual_file
651
+ sed -i -e '1,1s=.*=#!'"$rvm_ruby_home/bin/ruby=" $actual_file
641
652
  rm -f $actual_file.orig ; chmod +x "$actual_file"
642
653
  fi ; unset actual_file
643
654
  }
@@ -13,7 +13,11 @@ if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
13
13
  if [[ "root" = "$(whoami)" ]] ; then
14
14
  rvm_path="${rvm_path:-/usr/local/rvm}"
15
15
  else
16
- rvm_path="${rvm_path:-$HOME/.rvm}"
16
+ if [[ -d "$HOME/.rvm" ]] ; then
17
+ rvm_path="${rvm_path:-$HOME/.rvm}"
18
+ else
19
+ rvm_path="${rvm_path:-/usr/local/rvm}"
20
+ fi
17
21
  fi
18
22
 
19
23
  source $rvm_path/scripts/array
@@ -23,6 +27,7 @@ source $rvm_path/scripts/selector
23
27
  source $rvm_path/scripts/ruby-installer # TODO: Script not function.
24
28
  source $rvm_path/scripts/cli
25
29
  source $rvm_path/scripts/gems
30
+ source $rvm_path/scripts/libraries
26
31
 
27
32
  rvm_loaded_flag=1 ; export rvm_loaded_flag
28
33
 
@@ -38,7 +38,9 @@ cp -f "$source_dir/README" "$rvm_path/"
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
39
  for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
- cp -Rf "$source_dir/$dir_name" "$rvm_path"
41
+ if [[ -d "$source_dir/$dir_name" ]] ; then
42
+ cp -Rf "$source_dir/$dir_name" "$rvm_path"
43
+ fi
42
44
  done ; unset dir_name
43
45
 
44
46
  #
@@ -73,43 +75,7 @@ chmod +x $rvm_path/scripts/rvm
73
75
  #
74
76
  # System Checks
75
77
  #
76
- system="$(uname)"
77
- echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
78
- if [[ "Linux" = "$system" ]] ; then
79
- rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
80
- rvm_emerge_binary="$(which emerge 2> /dev/null)"
81
- rvm_pacman_binary="$(which pacman 2> /dev/null)"
82
- rvm_yum_binary="$(which yum 2> /dev/null)"
83
-
84
- if [[ ! -z "$rvm_apt_get_binary" ]] ; then
85
- echo -e " $item For JRuby (if you wish to use it) you will need:"
86
- echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
87
- echo -e " $item For ree (if you wish to use it) you will need:"
88
- echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
89
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
90
- echo -e " $ aptitude install libxml2-dev"
91
-
92
- elif [[ ! -z "$rvm_emerge_binary" ]] ; then
93
- echo -e " $item For JRuby (if you wish to use it) you will need:"
94
- echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
95
-
96
- elif [[ ! -z "$rvm_pacman_binary" ]] ; then
97
- echo -e " $item For JRuby (if you wish to use it) you will need:"
98
- echo -e " $ pacman -Sy jdk jre"
99
-
100
- elif [[ ! -z "$rvm_yum_binary" ]] ; then
101
- echo -e " $item For ree (if you wish to use it) you will need:"
102
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
103
-
104
- else
105
- echo -e " $item For JRuby (if you wish to use it) you will need:"
106
- echo -e " The SUN java runtime environment and development kit."
107
- fi
108
- elif [[ "Darwin" = "$system" ]] ; then
109
- echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
- echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
111
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
112
- fi
78
+ $rvm_path/scripts/notes
113
79
 
114
80
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
81
  echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
@@ -40,14 +40,12 @@ __rvm_select() {
40
40
 
41
41
  rbx|rubinius)
42
42
  rvm_ruby_interpreter="rbx"
43
- rvm_ruby_version="${rvm_ruby_version:-head}"
44
- unset rvm_ruby_patch_level
43
+ rvm_ruby_version=${rvm_ruby_version:-"$($rvm_scripts_path/db "$rvm_config_path/db" "rbx_version")"}
44
+ rvm_ruby_patch_level=${rvm_ruby_patch_level:-"$($rvm_scripts_path/db "$rvm_config_path/db" "rbx_patch_level")"}
45
45
  rvm_ruby_repo_url=${rvm_rbx_repo_url:-"$($rvm_scripts_path/db "$rvm_config_path/db" "rubinius_repo_url")"}
46
- rvm_ruby_string="rbx-head" # for now :)
47
- rvm_url=$rvm_ruby_repo_url
48
- rvm_ruby_configure=" true "
49
- rvm_ruby_make="build"
50
- rvm_ruby_make_install=""
46
+ #rvm_ruby_string="rbx-head" # for now :)
47
+ rvm_url=$($rvm_scripts_path/db "$rvm_config_path/db" "rbx_url")
48
+ rvm_ruby_file="rubinius-$rvm_ruby_version-$rvm_ruby_patch_level"
51
49
  ;;
52
50
 
53
51
  jruby)
@@ -108,7 +106,7 @@ __rvm_select() {
108
106
  ;;
109
107
 
110
108
  current)
111
- ruby_binary="$(which binary)"
109
+ ruby_binary="$(which binary 2>/dev/null)"
112
110
  if $rvm_scripts_path/match "$ruby_binary" "rvm" ; then
113
111
  rvm_ruby_string="$(dirname "$ruby_binary" | xargs dirname | xargs basename)"
114
112
  else
@@ -38,7 +38,9 @@ cp -f "$source_dir/README" "$rvm_path/"
38
38
  rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
39
39
  for dir_name in config scripts examples lib hooks ; do
40
40
  mkdir -p "$rvm_path/$dir_name"
41
- cp -Rf "$source_dir/$dir_name" "$rvm_path"
41
+ if [[ -d "$source_dir/$dir_name" ]] ; then
42
+ cp -Rf "$source_dir/$dir_name" "$rvm_path"
43
+ fi
42
44
  done ; unset dir_name
43
45
 
44
46
  #
@@ -73,43 +75,7 @@ chmod +x $rvm_path/scripts/rvm
73
75
  #
74
76
  # System Checks
75
77
  #
76
- system="$(uname)"
77
- echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
78
- if [[ "Linux" = "$system" ]] ; then
79
- rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
80
- rvm_emerge_binary="$(which emerge 2> /dev/null)"
81
- rvm_pacman_binary="$(which pacman 2> /dev/null)"
82
- rvm_yum_binary="$(which yum 2> /dev/null)"
83
-
84
- if [[ ! -z "$rvm_apt_get_binary" ]] ; then
85
- echo -e " $item For JRuby (if you wish to use it) you will need:"
86
- echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
87
- echo -e " $item For ree (if you wish to use it) you will need:"
88
- echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
89
- echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
90
- echo -e " $ aptitude install libxml2-dev"
91
-
92
- elif [[ ! -z "$rvm_emerge_binary" ]] ; then
93
- echo -e " $item For JRuby (if you wish to use it) you will need:"
94
- echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
95
-
96
- elif [[ ! -z "$rvm_pacman_binary" ]] ; then
97
- echo -e " $item For JRuby (if you wish to use it) you will need:"
98
- echo -e " $ pacman -Sy jdk jre"
99
-
100
- elif [[ ! -z "$rvm_yum_binary" ]] ; then
101
- echo -e " $item For ree (if you wish to use it) you will need:"
102
- echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
103
-
104
- else
105
- echo -e " $item For JRuby (if you wish to use it) you will need:"
106
- echo -e " The SUN java runtime environment and development kit."
107
- fi
108
- elif [[ "Darwin" = "$system" ]] ; then
109
- echo -e " $item Be sure that you have XCode Tools (Version 3.2.1 (1613) or later) installed in order to use rvm."
110
- echo -e " $item You can download the latest XCode tools from developer.apple.com. This will be necessary with the dvd install for Snow Leopard which has bugs."
111
- echo -e " $item If you intend on installing MacRuby you must install LLVM first."
112
- fi
78
+ $rvm_path/scripts/notes
113
79
 
114
80
  echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
115
81
  echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  __rvm_info() {
4
- full_version=$(ruby -v)
4
+ if [[ ! -z "$(which ruby 2>/dev/null)" ]] ; then full_version=$(ruby -v) ; fi
5
+
5
6
  cat <<Info
6
7
 
7
8
  system:
@@ -20,16 +21,17 @@ homes:
20
21
  ruby: "${MY_RUBY_HOME:-'not set'}"
21
22
 
22
23
  binaries:
23
- ruby: "$(which ruby)"
24
- irb: "$(which irb)"
25
- gem: "$(which gem)"
26
- rake: "$(which rake)"
24
+ ruby: "$(which ruby 2>/dev/null)"
25
+ irb: "$(which irb 2>/dev/null)"
26
+ gem: "$(which gem 2>/dev/null)"
27
+ rake: "$(which rake 2>/dev/null)"
27
28
 
28
29
  environment:
29
30
  GEM_HOME: "$GEM_HOME"
30
31
  MY_RUBY_HOME: "$MY_RUBY_HOME"
31
32
  IRBRC: "$IRBRC"
32
33
  Info
34
+
33
35
  unset full_version
34
36
  }
35
37
 
@@ -109,7 +111,7 @@ __rvm_run() {
109
111
 
110
112
  __rvm_cleanup_variables() {
111
113
  __rvm_unset_ruby_variables
112
- unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags CFLAGS LDFLAGS ARCHFLAGS
114
+ unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags
113
115
  }
114
116
 
115
117
  __rvm_unset_ruby_variables() {
@@ -166,22 +168,24 @@ __rvm_load_defaults() {
166
168
 
167
169
  rvm_system_ruby=$($rvm_scripts_path/db "$rvm_config_path/db" "system_ruby")
168
170
  if [[ ! -z "$rvm_system_ruby" ]] ; then
169
- rvm_system_ruby=$(which ruby)
171
+ rvm_system_ruby=$(which ruby 2>/dev/null)
170
172
  if [[ $? -ne 0 ]] ; then
171
- $rvm_scripts_path/log "info" "System ruby not found, no db will be stored."
173
+ $rvm_scripts_path/log "info" "System ruby not found, no system default will be stored."
172
174
  else
173
175
  $rvm_scripts_path/db "$rvm_config_path/db" "system_ruby" "$rvm_system_ruby"
174
176
 
175
177
  # Now store system system & user gem paths
176
- rvm_system_user_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path")
177
- if [[ -z "$rvm_system_user_gem_path" ]] ; then
178
- rvm_system_user_gem_path=$( rvm system ; gem env gemdir user; )
179
- $rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path" "$rvm_system_user_gem_path"
180
- fi
181
- rvm_system_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path")
182
- if [[ -z "$rvm_system_gem_path" ]] ; then
183
- rvm_system_gem_path=$( rvm system ; gem env gemdir; )
184
- $rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path" "$rvm_system_gem_path"
178
+ if [[ ! -z "$(which gem 2>/dev/null)" ]] ; then
179
+ rvm_system_user_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path")
180
+ if [[ -z "$rvm_system_user_gem_path" ]] ; then
181
+ rvm_system_user_gem_path=$( rvm system ; gem env gemdir user; )
182
+ $rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path" "$rvm_system_user_gem_path"
183
+ fi
184
+ rvm_system_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path")
185
+ if [[ -z "$rvm_system_gem_path" ]] ; then
186
+ rvm_system_gem_path=$( rvm system ; gem env gemdir; )
187
+ $rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path" "$rvm_system_gem_path"
188
+ fi
185
189
  fi
186
190
  fi
187
191
  fi
@@ -256,7 +260,11 @@ __rvm_list() {
256
260
  echo -e "macruby(-nightly) # the default macruby\nmacruby-head # Build from the macruby git repository"
257
261
  fi
258
262
  else
259
- current_ruby="$(which ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
263
+ ruby=$(which ruby 2>/dev/null) ; current_ruby=""
264
+ if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo $ruby | awk '/rvm/')" ]] ; then
265
+ current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
266
+ fi
267
+
260
268
  for version in $(\ls -l $rvm_path/ 2> /dev/null | awk '/ ruby-[1-2].*/ { print $NF }') ; do
261
269
  string=$($rvm_path/$version/bin/ruby -v)
262
270
  if [[ "$version" = "$current_ruby" ]] ; then
@@ -336,13 +344,15 @@ __rvm_list() {
336
344
  fi ; unset version
337
345
  fi
338
346
 
339
- system_version=$(rvm system ; ruby -v 2> /dev/null)
347
+ system_version=$(rvm system ; which ruby 2>/dev/null && ruby -v 2> /dev/null)
340
348
  if [[ ! -z "$system_version" ]] ; then
341
349
  if [[ "$($(which ruby) -v)" = "$system_version" ]] ; then
342
350
  echo -e "=> $(tput setaf 2)system$(tput sgr0) ( ruby -v # => $system_version )\n"
343
351
  else
344
352
  echo -e " $(tput setaf 2)system$(tput sgr0) ( ruby -v # => $system_version )\n"
345
353
  fi
354
+ else
355
+ $rvm_scripts_path/log "info" "No system ruby found."
346
356
  fi ; unset current_ruby version selected
347
357
  fi
348
358
  }
@@ -413,8 +423,12 @@ __rvm_ruby_do() {
413
423
  binary="$(echo $rvm_action | sed 's#do$##')"
414
424
  if [[ -x "$rvm_ruby_home/bin/$binary" ]] ; then
415
425
  binary="$rvm_ruby_home/bin/$binary"
426
+ elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] ; then
427
+ binary="$rvm_ruby_gem_home/bin/$binary"
416
428
  elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then
417
- binary="$(which $binary)"
429
+ binary="$(which $binary 2>/dev/null)"
430
+ #elif [[ "spec" = "$binary" ]] ; then
431
+ #binary="$(which $binary 2>/dev/null)"
418
432
  else
419
433
  $rvm_scripts_path/log "warn" "'$binary not found for $rvm_ruby_string' either does not exist or is not executable? :("
420
434
  __rvm_unset_ruby_variables
@@ -442,8 +456,8 @@ __rvm_ruby_do() {
442
456
  rvm_command="$binary $rvm_ruby_mode $rvm_ruby_args"
443
457
  fi
444
458
 
459
+ mkdir -p ./log/$rvm_ruby_string/
445
460
  if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then
446
- mkdir -p ./log/$rvm_ruby_string/
447
461
  touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log
448
462
  eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log
449
463
  else
@@ -451,6 +465,7 @@ __rvm_ruby_do() {
451
465
  eval "$rvm_command"
452
466
  fi
453
467
  result=$?
468
+
454
469
  if [[ $result -eq 0 ]]; then
455
470
  eval "successes=(${successes[*]} $rvm_ruby_string)"
456
471
  else
@@ -583,10 +598,10 @@ __rvm_pushpop() {
583
598
 
584
599
  __rvm_state() {
585
600
  if [[ -z "$rvm_state" ]] ; then
586
- if [[ -z "$(which ruby | awk /$(basename $rvm_path)/)" ]] ; then
601
+ if [[ -z "$(which ruby 2>/dev/null | awk /$(basename $rvm_path)/)" ]] ; then
587
602
  rvm_state=system
588
603
  else
589
- rvm_state="$(dirname $(which ruby) | xargs dirname | xargs basename)"
604
+ rvm_state="$(dirname "$(which ruby 2>/dev/null)" | xargs dirname | xargs basename)"
590
605
  fi
591
606
  else
592
607
  rvm_ruby_string="$rvm_state"
@@ -598,7 +613,7 @@ __rvm_state() {
598
613
 
599
614
  __rvm_inspect() {
600
615
  for binary in $rvm_ruby_args ; do
601
- actual_file=$(which $binary)
616
+ actual_file="$(which $binary 2>/dev/null)"
602
617
  $rvm_scripts_path/log "info" "$actual_file:"
603
618
  if [[ ! -z "$rvm_shebang_flag" ]] ; then cat $actual_file | head -n 1 ; fi
604
619
  if [[ ! -z "$rvm_env_flag" ]] ; then cat $actual_file | awk '/ENV/' ; fi
@@ -609,113 +624,6 @@ __rvm_inspect() {
609
624
  done
610
625
  }
611
626
 
612
- #
613
- # ruby supporting libraries:
614
- #
615
- __rvm_readline_install() {
616
- __rvm_make_flags
617
- __rvm_pushpop $rvm_src_path
618
- package="readline" ; version="5.2" ; archive_format="tar.gz"
619
- # TODO: Figure out how to list, grab and apply the patches
620
- $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
621
- $rvm_scripts_path/fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.$archive_format"
622
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
623
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
624
- builtin cd "$rvm_src_path/$package-$version"
625
- if [[ "Darwin" = "$(uname)" ]] ; then
626
- #sdk=$(\ls -t /Developer/SDKs/ | head -n 1)
627
- #CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
628
- #LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$sdk -arch i386 -arch x86_64"
629
- #export CFLAGS LDFLAGS
630
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package"
631
- else
632
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --disable-dependency-tracking --disable-static --enable-shared" "Configuring $package"
633
- fi
634
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
635
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
636
- __rvm_pushpop
637
- }
638
-
639
- __rvm_iconv_install() {
640
- __rvm_make_flags
641
- __rvm_pushpop $rvm_src_path
642
- package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
643
- $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
644
- $rvm_scripts_path/fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.$archive_format"
645
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
646
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
647
- builtin cd "$rvm_src_path/$package-$version"
648
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
649
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
650
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
651
- __rvm_pushpop
652
- }
653
-
654
- __rvm_curl_install() {
655
- __rvm_make_flags
656
- __rvm_pushpop $rvm_src_path
657
- package="curl" ; version=7.19.7 ; archive_format="tar.gz"
658
- $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
659
- $rvm_scripts_path/fetch "http://curl.haxx.se/download/$package-$version.$archive_format"
660
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
661
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
662
- builtin cd "$rvm_src_path/$package-$version"
663
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
664
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
665
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
666
- __rvm_pushpop
667
- }
668
-
669
- __rvm_openssl_install() {
670
- __rvm_make_flags
671
- if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then
672
- openssl_os="os/compiler darwin64-x86_64-cc"
673
- else
674
- openssl_os="os/compiler darwin-i386-cc"
675
- fi
676
- __rvm_pushpop $rvm_src_path
677
- package="openssl" ; version="0.9.8k" ; archive_format="tar.gz"
678
- $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
679
- $rvm_scripts_path/fetch "http://www.openssl.org/source/$package-$version.tar.gz"
680
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
681
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
682
- builtin cd "$rvm_src_path/$package-$version"
683
- __rvm_run "$package/config" "./config --prefix=$rvm_path/usr zlib no-asm no-krb5 shared" "Configuring $package."
684
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
685
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
686
- __rvm_pushpop
687
- }
688
-
689
- __rvm_zlib_install() {
690
- __rvm_make_flags
691
- __rvm_pushpop $rvm_src_path
692
- package="zlib" ; version="1.2.3" ; archive_format="tar.gz"
693
- $rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
694
- $rvm_scripts_path/fetch "http://www.zlib.net/$package-$version.tar.gz"
695
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
696
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
697
- builtin cd "$rvm_src_path/$package-$version"
698
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
699
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
700
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
701
- __rvm_pushpop
702
- }
703
-
704
- __rvm_ncurses_install() {
705
- __rvm_make_flags
706
- __rvm_pushpop $rvm_src_path
707
- package="ncurses" ; version="5.7" ; archive_format="tar.gz"
708
- $rvm_scripts_path/log "info" "Retrieving $package"
709
- $rvm_scripts_path/fetch "ftp://invisible-island.net/ncurses/ncurses.tar.gz"
710
- result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
711
- __rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package.$archive_format -C $rvm_src_path" "Extracting $package.$archive_format"
712
- builtin cd "$rvm_src_path/$package-$version"
713
- __rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" "Configuring $package."
714
- __rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
715
- __rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
716
- __rvm_pushpop
717
- }
718
-
719
627
  __rvm_make_flags() {
720
628
  PATH=${rvm_path}/usr/bin:$PATH ; export PATH
721
629
  # This is only an issue with Darwin :/
@@ -745,8 +653,8 @@ __rvm_make_flags() {
745
653
  ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
746
654
  # Use the latest sdk available.
747
655
  if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi
748
- CFLAGS="-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export CFLAGS
749
- LDFLAGS="-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export LDFLAGS
656
+ CFLAGS="${CFLAGS:-"-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export CFLAGS
657
+ LDFLAGS="${LDFLAGS:-"-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags"}" ; export LDFLAGS
750
658
  # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$rvm_sdk " ; export CXXFLAGS
751
659
  fi
752
660
  fi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.82
4
+ version: 0.0.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-21 00:00:00 -05:00
12
+ date: 2009-11-26 00:00:00 -05:00
13
13
  default_executable: rvm-install
14
14
  dependencies: []
15
15
 
@@ -48,9 +48,11 @@ files:
48
48
  - scripts/install
49
49
  - scripts/irbrc
50
50
  - scripts/irbrc.rb
51
+ - scripts/libraries
51
52
  - scripts/log
52
53
  - scripts/match
53
54
  - scripts/monitor
55
+ - scripts/notes
54
56
  - scripts/ruby-installer
55
57
  - scripts/rvm
56
58
  - scripts/rvm-install