wayneeseguin-rvm 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/bash/rvm +24 -46
  2. data/bash/rvm-install +29 -32
  3. data/bash/rvm-update +3 -4
  4. data/rvm.gemspec +1 -1
  5. metadata +1 -1
data/bash/rvm CHANGED
@@ -3,7 +3,7 @@
3
3
  rvm_author="Wayne E. Seguin"
4
4
  rvm_author_email="wayneeseguin@gmail.com"
5
5
  rvm_website="http://rvm.beginrescueend.com/"
6
- rvm_version="0.0.21"
6
+ rvm_version="0.0.22"
7
7
  rvm_updated="2009.08.25"
8
8
 
9
9
  #
@@ -96,42 +96,17 @@ function rvm-usage {
96
96
  * Settings file, user overridable
97
97
  * Show current in rvm list, if applicable
98
98
 
99
- Many Thanks:
100
-
101
- Bash Support Testing
102
-
103
- - Daniel Neighman (dneighman@gmail.com)
104
- irc: hassox ; github: http://github.com/hassox
105
-
106
- - John Mettraux (jmettraux@openwfe.org)
107
- irc: jmettraux ; github: http://github.com/jmettraux
108
-
109
- ZSH Support Testing
110
-
111
- - Franco Lazzarino (flazzarino@gmail.com)
112
- irc: flazz ; github: http://github.com/flazz
113
-
114
- Ubuntu Linux Support Testing
115
-
116
- - Anita Kuno (anteaya@anteaya.info)
117
- irc: anteaya ; github: http://github.com/anteaya
118
-
119
- Website Design
120
-
121
- - Jim Lindley (jlindley@gmail.com)
122
- irc: jlindley ; github: http://github.com/jlindley
123
-
124
99
  Usage
125
100
 
126
101
  }
127
102
 
128
103
  # Logging functions based on level
129
- function rvm-log { echo -e "\n $* \e[0m" ; }
130
- function rvm-log-debug { rvm-log "\e[4;34m <d> \e[0m$*" ; }
131
- function rvm-log-info { rvm-log "\e[0;32m <i> \e[0m$*" ; }
132
- function rvm-log-warn { rvm-log "\e[0;33m <w> \e[0m$*" ; }
133
- function rvm-log-error { rvm-log "\e[0;31m <e> \e[0m$*" ; }
134
- function rvm-log-fail { rvm-log "\e[0;31m <e> \e[0m$*" ; return 1 ; }
104
+ function rvm-log { echo -e "\n $* \033[0m" ; }
105
+ function rvm-log-debug { rvm-log "\033[4;34m <d> \033[0m$*" ; }
106
+ function rvm-log-info { rvm-log "\033[0;32m <i> \033[0m$*" ; }
107
+ function rvm-log-warn { rvm-log "\033[0;33m <w> \033[0m$*" ; }
108
+ function rvm-log-error { rvm-log "\033[0;31m <e> \033[0m$*" ; }
109
+ function rvm-log-fail { rvm-log "\033[0;31m <e> \033[0m$*" ; return 1 ; }
135
110
 
136
111
  function rvm-gi { gem install -q --no-rdoc --no-ri $* ; }
137
112
 
@@ -190,13 +165,13 @@ function rvm-install-source {
190
165
  fi
191
166
 
192
167
  rvm-log-info "\tConfiguring $package_name using ${configure-'--enable-shared'}, this may take a while depending on your cpu(s)..."
193
- ./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} > $install_path/$package_name/configure.log 2> $install_path/$package_name/configure.error.log
168
+ ./configure --prefix=$install_path/$package_name ${configure-'--enable-shared'} > $install_path/log/$package_name/configure.log 2> $install_path/log/$package_name/configure.error.log
194
169
 
195
170
  rvm-log-info "\tCompiling $package_name, this may take a while, depending on your cpu(s)..."
196
- make > $install_path/$package_name/make.log 2> $install_path/$package_name/make.error.log
171
+ make > $install_path/log/$package_name/make.log 2> $install_path/log/$package_name/make.error.log
197
172
 
198
173
  rvm-log-info "\tInstalling $package_name"
199
- make install > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log
174
+ make install > $install_path/log/$package_name/install.log 2> $install_path/log/$package_name/install.error.log
200
175
  chmod +x $install_path/$package_name/bin/*
201
176
 
202
177
  # Create the ~/.rvm/bin/$package_name
@@ -214,13 +189,13 @@ function rvm-install-source {
214
189
  fi
215
190
  # Well this is fun... fix nil error on require_paths:
216
191
  sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb
217
- $install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log
192
+ $install_path/$package_name/bin/ruby ./setup.rb > $install_path/log/$package_name/rubygems.install.log 2> $install_path/log/$package_name/rubygems.install.error.log
218
193
  popd > /dev/null
219
194
  rvm-log-info "Installation of $package_name complete."
220
195
 
221
196
  for gem_name in rake ; do
222
197
  rvm-log-info "Installing $gem_name"
223
- $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
198
+ $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log
224
199
  done
225
200
  }
226
201
 
@@ -250,7 +225,7 @@ function rvm-install-ruby {
250
225
 
251
226
  rvm-log-info "\tInstalling $package_name, this may take a while, depending on your cpu(s)..."
252
227
  mkdir -p $install_path/$package_name
253
- ./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems > $install_path/$package_name/install.log 2> $install_path/$package_name/install.error.log
228
+ ./installer -a $install_path/ruby-enterprise-$version-$patchlevel --dont-install-useful-gems > $install_path/log/$package_name/install.log 2> $install_path/log/$package_name/install.error.log
254
229
  chmod +x $install_path/$package_name/bin/*
255
230
 
256
231
  ln -fs $install_path/$package_name/bin/ruby $install_path/bin/$package_name
@@ -266,13 +241,13 @@ function rvm-install-ruby {
266
241
  fi
267
242
  # Well this is fun... fix nil error on require_paths:
268
243
  sed -i '' "s/require_paths\.join/require_paths.to_a.join/" $source_path/$package_name/$gem_package_name/lib/rubygems/gem_path_searcher.rb
269
- $install_path/$package_name/bin/ruby ./setup.rb > $install_path/$package_name/rubygems.install.log 2> $install_path/$package_name/rubygems.install.error.log
244
+ $install_path/$package_name/bin/ruby ./setup.rb > $install_path/log/$package_name/rubygems.install.log 2> $install_path/log/$package_name/rubygems.install.error.log
270
245
  rvm-log-info "Installation of $package_name complete."
271
246
  popd > /dev/null
272
247
 
273
248
  for gem_name in rake ; do
274
249
  rvm-log-info "Installing $gem_name"
275
- $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
250
+ $install_path/$package_name/bin/gem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log
276
251
  done
277
252
  ;;
278
253
 
@@ -300,7 +275,7 @@ function rvm-install-ruby {
300
275
  rvm-log-info "\tInstalling $package_name..."
301
276
  mkdir -p $install_path/$package_name/bin/
302
277
  rsync -ag $source_path/$package_name/ $install_path/$package_name/
303
- cd $source_path/$package_name/tool/nailgun && make > $install_path/$package_name/install.nailgun.log 2> $install_path/$package_name/install.error.nailgun.log
278
+ cd $source_path/$package_name/tool/nailgun && make > $install_path/log/$package_name/install.nailgun.log 2> $install_path/log/$package_name/install.error.nailgun.log
304
279
  popd > /dev/null
305
280
  chmod +x $install_path/$package_name/bin/*
306
281
  for binary in jruby jgem jirb ; do
@@ -311,7 +286,7 @@ function rvm-install-ruby {
311
286
 
312
287
  for gem_name in rake jruby-openssl ; do
313
288
  rvm-log-info "Installing $gem_name"
314
- $install_path/$package_name/bin/jgem install $gem_name --no-rdoc --no-ri -q >> $install_path/$package_name/gems.install.log
289
+ $install_path/$package_name/bin/jgem install $gem_name --no-rdoc --no-ri -q >> $install_path/log/$package_name/gems.install.log 2> $install_path/log/$package_name/gems.error.log
315
290
  done
316
291
  ;;
317
292
 
@@ -477,7 +452,7 @@ function rvm-use {
477
452
  done
478
453
  fi
479
454
 
480
- rvm-log-info "Switching to $implementation $version $patchlevel ..."
455
+ rvm-log-info "Switching to $implementation $version $patchlevel ...\n"
481
456
  if [ ! -z "$BASH_VERSION" ] ; then
482
457
  exec bash -l
483
458
  elif [ ! -z "$ZSH_VERSION" ] ; then
@@ -727,6 +702,8 @@ function rvm {
727
702
  *) rvm-usage ; return 1
728
703
  esac
729
704
  done
705
+
706
+ if [ "$debug" = "1" ] ; then set -x ; fi
730
707
 
731
708
  curl=`which curl`
732
709
  if [ $? -ne 0 ] ; then
@@ -790,8 +767,6 @@ function rvm {
790
767
  echo $default_system_ruby > $install_path/default_system_ruby
791
768
  fi
792
769
 
793
- if [ "$debug" = "1" ] ; then set -x ; fi
794
-
795
770
  case "$action" in
796
771
  install)
797
772
  if [ "$implementation" = "all" ] ; then
@@ -800,8 +775,9 @@ function rvm {
800
775
  for version in 1.8.6 1.8.7 1.9.1 1.9.2 ; do
801
776
  rvm-install-ruby $implementation $version $patchlevel
802
777
  done
778
+ unset version patchlevel
803
779
  else
804
- rvm-install-ruby $implementation $version $patchlevel
780
+ rvm-install-ruby $implementation $version $patchlevel
805
781
  fi
806
782
  done
807
783
  else
@@ -843,3 +819,5 @@ function rvm {
843
819
 
844
820
  }
845
821
 
822
+ if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi # magic :)
823
+
data/bash/rvm-install CHANGED
@@ -2,22 +2,21 @@
2
2
 
3
3
  user=`whoami`
4
4
  if [ "$user" = "root" ] ; then
5
- echo -e "\e[0;31m <e> \e[0mroot user support is not yet implemented.\e[0m"
5
+ echo -e "\033[0;31m <e> \033[0mroot user support is not yet implemented.\033[0m"
6
6
  exit 1
7
7
  fi
8
8
 
9
- info="\n\e[0;32m<i>\e[0m"
10
- question="\n\e[0;32m<?>\e[0m"
9
+ info="\n\033[0;32m<i>\033[0m"
10
+ question="\n\033[0;32m<?>\033[0m"
11
11
 
12
12
  echo -e "Installing rvm source to ~/.rvm/bin/rvm..."
13
13
  mkdir -p ~/.rvm/src ~/.rvm/bin
14
14
  cp $(pwd)/bash/rvm ~/.rvm/bin/
15
15
 
16
16
  # State what is required to use rvm
17
- echo -e "\n\e[0;32mrvm\e[0m is a shell script that allows a user to manage multiple ruby versions in their own account."
18
- echo -e "$info In order to use rvm two items must occur in your shell's load paths:"
19
- echo -e "\n\e[0;32m (a)\e[0m if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi"
20
- echo -e "\e[0;32m (b)\e[0m if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi"
17
+ echo -e "\n\033[0;32mrvm\033[0m is a shell script that allows a user to manage multiple ruby versions in their own account."
18
+ echo -e "$info In order to use rvm the following line must occur in your shell's loading files:"
19
+ echo -e "\n\033[0;32m (a)\033[0m if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi"
21
20
 
22
21
  while : ; do
23
22
  echo -n -e "$question Do you want this (s)cript to set this up for you, or do it (m)anually yourself ('s' or 'm')? "
@@ -48,8 +47,6 @@ if [ "${response:0:1}" = "s" ] ; then
48
47
  fi
49
48
  done
50
49
 
51
- touch ~/.profile
52
-
53
50
  if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
54
51
 
55
52
  touch ~/.bash_profile
@@ -57,12 +54,13 @@ if [ "${response:0:1}" = "s" ] ; then
57
54
  echo "Adding 'if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi' to your ~/.bash_profile."
58
55
  echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.bash_profile
59
56
  fi
60
-
61
- if [ -z "`grep '\.rvm/current' ~/.bash_profile`" ] ; then
62
- echo "Adding 'if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi' ~/.bash_profile."
63
- echo "if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi" >> ~/.bash_profile
57
+ touch ~/.bashrc
58
+ if [ -z "`grep '\.rvm/bin/rvm' ~/.bashrc`" ] ; then
59
+ echo "Adding 'if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi' to your ~/.bashrc."
60
+ echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.bashrc
64
61
  fi
65
62
 
63
+
66
64
  elif [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
67
65
 
68
66
  touch ~/.zshrc
@@ -71,14 +69,9 @@ if [ "${response:0:1}" = "s" ] ; then
71
69
  echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.zshrc
72
70
  fi
73
71
 
74
- if [ -z "`grep '\.rvm/current' ~/.zshrc`" ] ; then
75
- echo "Adding 'if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi' ~/.zshrc."
76
- echo "if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi" >> ~/.zshrc
77
- fi
78
-
79
72
  else
80
73
 
81
- echo -e "\n\e[0;31m<e> An error has occurred, we were expecting either bash or zsh however we encountered $user_shell \e[0m"
74
+ echo -e "\n\033[0;31m<e> An error has occurred, we were expecting either bash or zsh however we encountered $user_shell \033[0m"
82
75
  return 1
83
76
 
84
77
  fi
@@ -86,25 +79,29 @@ fi
86
79
 
87
80
  system=`uname`
88
81
  if [ "$system" = "Linux" ] ; then
89
- echo -e "For jRuby (if you wish to use it) you will need:"
90
- if [ ! -z "`which apt-get`" ] ; then
91
- echo -e " sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk "
92
- elif [ ! -z "`which emerge`" ] ; then
93
- echo -e "emerge dev-java/sun-jdk dev-java/sun-jre-bin"
94
- elif [ ! -z "`which pacman`" ] ; then
95
- echo -e "pacman -Sy jdk jre"
96
- elif [ ! -z "`which yum`" ] ; then
97
- echo -e "yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
82
+ rvm_apt_get_binary=`which apt-get`
83
+ rvm_emerge_binary=`which emerge`
84
+ rvm_pacman_binary=`which pacman`
85
+ rvm_yum_binary=`which yum`
86
+
87
+ echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
88
+ if [ ! -z "$rvm_apt_get_binary" ] ; then
89
+ echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk "
90
+ elif [ ! -z "$rvm_emerge_binary" ] ; then
91
+ echo -e "\033[0;32m <i> \033[0msudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
92
+ elif [ ! -z "$rvm_pacman_binary" ] ; then
93
+ echo -e "\033[0;32m <i> \033[0msudo pacman -Sy jdk jre"
94
+ elif [ ! -z "$rvm_yum_binary" ] ; then
95
+ echo -e "\033[0;32m <i> \033[0myum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
98
96
  else
99
- echo -e "The SUN java runtime environment and development kit."
97
+ echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
100
98
  fi
101
99
  #elif [ "$sytem" = "Darwin" ] ; then
102
100
  #else
103
-
104
101
  fi
105
102
 
106
103
  source ~/.rvm/bin/rvm
107
- rvm-symlinks
104
+ rvm symlinks
108
105
 
109
106
  echo -e "\n$info If you add ~/.rvm/bin/ to your path you will be able to refer to installed ruby binaries using: <implementation>-<version>p<patchlevel>"
110
107
  echo -e " For example: ruby-1.9.1-p243 -e 'puts \"hello world\"' #=> hello world"
@@ -112,5 +109,5 @@ echo -e "$info Contact wayneeseguin on irc.freenod.net in #rvm for any questions
112
109
  echo -e " I truly hope that you find rvm helpful! Thank you very much for using rvm. \n"
113
110
  echo -e " ~ Wayne"
114
111
 
115
- echo -e "$info To start using rvm see: \e[0;32m rvm usage\e[0m, Now close this login shell and open a new one."
112
+ echo -e "$info To start using rvm see: \033[0;32m rvm usage\033[0m, Now close this login shell and open a new one."
116
113
 
data/bash/rvm-update CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  user=`whoami`
4
4
  if [ "$user" = "root" ] ; then
5
- echo -e "\e[0;31m <e> \e[0mroot user support is not yet implemented.\e[0m"
5
+ echo -e "\033[0;31m <e> \033[0mroot user support is not yet implemented.\033[0m"
6
6
  exit 1
7
7
  fi
8
8
 
9
- info="\n\e[0;32m<i>\e[0m"
9
+ info="\n\033[0;32m<i>\033[0m"
10
10
 
11
11
  echo -e "$info Updating rvm source ~/.rvm/bin/rvm ..."
12
12
  mkdir -p ~/.rvm/src ~/.rvm/bin
@@ -16,6 +16,5 @@ echo -e "\n Thank you, come again! \n"
16
16
  echo -e " ~ Wayne"
17
17
 
18
18
  source ~/.rvm/bin/rvm
19
-
20
- rvm-symlinks
19
+ rvm symlinks
21
20
 
data/rvm.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.20"
8
+ s.version = "0.0.22"
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"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wayneeseguin-rvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin