rvm 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
3
  user=`whoami`
4
- if [ "$user" = "root" ] ; then
4
+ if [ "$user" = "root" ] ; then
5
5
  echo -e "\033[0;31m <e> \033[0mroot user support is not yet implemented.\033[0m"
6
6
  exit 1
7
7
  fi
@@ -11,13 +11,15 @@ 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
- cp $(pwd)/bash/rvm ~/.rvm/bin/
14
+ for script in rvm ; do # Preparing for refactoring.
15
+ cp "`dirname "${0}"`/$script" ~/.rvm/bin/
16
+ done
17
+
15
18
 
16
19
  # State what is required to use rvm
17
20
  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 two items must occur in your shell's load paths:"
21
+ echo -e "$info In order to use rvm the following line must occur in your shell's loading files:"
19
22
  echo -e "\n\033[0;32m (a)\033[0m if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi"
20
- echo -e "\033[0;32m (b)\033[0m if [ -f ~/.rvm/current ] ; then source ~/.rvm/current ; fi"
21
23
 
22
24
  while : ; do
23
25
  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')? "
@@ -47,68 +49,62 @@ if [ "${response:0:1}" = "s" ] ; then
47
49
  break
48
50
  fi
49
51
  done
50
-
51
- touch ~/.profile
52
-
52
+
53
53
  if [ "$user_shell" = "bash" -o "$user_shell" = "both" ] ; then
54
-
54
+
55
55
  touch ~/.bash_profile
56
56
  if [ -z "`grep '\.rvm/bin/rvm' ~/.bash_profile`" ] ; then
57
57
  echo "Adding 'if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi' to your ~/.bash_profile."
58
58
  echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.bash_profile
59
59
  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
60
+ touch ~/.bashrc
61
+ if [ -z "`grep '\.rvm/bin/rvm' ~/.bashrc`" ] ; then
62
+ echo "Adding 'if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi' to your ~/.bashrc."
63
+ echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.bashrc
64
64
  fi
65
-
66
- elif [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
67
-
65
+
66
+ fi
67
+
68
+ if [ "$user_shell" = "zsh" -o "$user_shell" = "both" ] ; then
69
+
68
70
  touch ~/.zshrc
69
71
  if [ -z "`grep '\.rvm/bin/rvm' ~/.zshrc`" ] ; then
70
72
  echo "Adding 'if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi' to your ~/.zshrc."
71
73
  echo "if [ -f ~/.rvm/bin/rvm ] ; then source ~/.rvm/bin/rvm ; fi" >> ~/.zshrc
72
74
  fi
73
-
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
- else
80
-
81
- 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
- return 1
83
-
84
75
  fi
76
+
85
77
  fi
86
78
 
87
79
  system=`uname`
88
80
  if [ "$system" = "Linux" ] ; then
89
- echo -e "For jRuby (if you wish to use it) you will need:"
90
- if [ ! -z "`which apt-get 2>/dev/null`" ] ; then
91
- echo -e " sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk "
92
- elif [ ! -z "`which emerge 2>/dev/null`" ] ; then
93
- echo -e "emerge dev-java/sun-jdk dev-java/sun-jre-bin"
94
- elif [ ! -z "`which pacman 2>/dev/null`" ] ; then
95
- echo -e "pacman -Sy jdk jre"
96
- elif [ ! -z "`which yum 2>/dev/null`" ] ; 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..."
81
+ rvm_apt_get_binary=`which apt-get`
82
+ rvm_emerge_binary=`which emerge`
83
+ rvm_pacman_binary=`which pacman`
84
+ rvm_yum_binary=`which yum`
85
+
86
+ echo -e "\033[0;33m <w> \033[0mFor jRuby (if you wish to use it) you will need:"
87
+ if [ ! -z "$rvm_apt_get_binary" ] ; then
88
+ echo -e "\033[0;32m <i> \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk "
89
+ elif [ ! -z "$rvm_emerge_binary" ] ; then
90
+ echo -e "\033[0;32m <i> \033[0msudo emerge dev-java/sun-jdk dev-java/sun-jre-bin"
91
+ elif [ ! -z "$rvm_pacman_binary" ] ; then
92
+ echo -e "\033[0;32m <i> \033[0msudo pacman -Sy jdk jre"
93
+ elif [ ! -z "$rvm_yum_binary" ] ; then
94
+ 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
95
  else
99
- echo -e "The SUN java runtime environment and development kit."
96
+ echo -e "\033[0;32m <i> \033[0mThe SUN java runtime environment and development kit."
100
97
  fi
101
98
  #elif [ "$sytem" = "Darwin" ] ; then
102
99
  #else
103
-
104
100
  fi
105
101
 
106
102
  source ~/.rvm/bin/rvm
107
- rvm-symlinks
103
+ rvm symlinks
108
104
 
109
- 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>"
105
+ 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><patchlevel>"
110
106
  echo -e " For example: ruby-1.9.1-p243 -e 'puts \"hello world\"' #=> hello world"
111
- echo -e "$info Contact wayneeseguin on irc.freenod.net in #rvm for any questions / feedback."
107
+ echo -e "$info Contact wayneeseguin on irc.freenode.net in #rvm for any questions / feedback."
112
108
  echo -e " I truly hope that you find rvm helpful! Thank you very much for using rvm. \n"
113
109
  echo -e " ~ Wayne"
114
110
 
@@ -1,8 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
3
  user=`whoami`
4
- if [ "$user" = "root" ] ; then
5
- echo -e "\033[0;31m <e> \033[0mroot user support is not yet implemented.\033[0m"
4
+ if [ "$user" = "root" ] ; then
5
+ echo -e "\033[0;31m <e> \033[0mroot user support is not implemented yet.\033[0m"
6
6
  exit 1
7
7
  fi
8
8
 
@@ -10,12 +10,13 @@ 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
13
- cp $(pwd)/bash/rvm ~/.rvm/bin/
13
+ for script in rvm ; do # Prepairing for refactoring.
14
+ cp "`dirname "${0}"`/$script" ~/.rvm/bin/
15
+ done
14
16
 
15
17
  echo -e "\n Thank you, come again! \n"
16
18
  echo -e " ~ Wayne"
17
19
 
18
20
  source ~/.rvm/bin/rvm
19
-
20
- rvm-symlinks
21
+ rvm symlinks
21
22
 
@@ -0,0 +1,30 @@
1
+ # Example rvm Defaults file.
2
+ # This file shows some examples of setting defaults to your own tastes.
3
+
4
+ # Default action to assume
5
+ #rvm_action="use"
6
+
7
+ # Default ruby implementation
8
+ #rvm_implementation="ruby"
9
+
10
+ # Default ruby version
11
+ #rvm_version="1.8.6"
12
+
13
+ # Default patchlevel to set, if implementation is set
14
+ #rvm_patchlevel="369"
15
+
16
+ # Default prefix path (~/, or /usr/local/src/ for example.)
17
+ #rvm_prefix_path="$HOME/."
18
+
19
+ # Default Install Path
20
+ #rvm_install_path="${rvm_prefix_path}rvm"
21
+
22
+ # Default Archives Path
23
+ #rvm_archive_path="${rvm_install_path}/archives"
24
+
25
+ # Default Source Path
26
+ #rvm_source_path="${rvm_install_path}/src"
27
+
28
+ # Default Log Path
29
+ #rvm_log_path="${rvm_install_path}/log"
30
+
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.0.22"
8
+ s.version = "0.0.23"
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-08-26}
12
+ s.date = %q{2009-08-27}
13
13
  s.description = %q{Manages Ruby interpreter installations and switching between them.}
14
14
  s.email = %q{wayneeseguin@gmail.com}
15
15
  s.executables = ["rvm-install", "rvm-update"]
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  "bash/rvm",
24
24
  "bash/rvm-install",
25
25
  "bash/rvm-update",
26
+ "bash/rvmrc.sample",
26
27
  "lib/rvm.rb",
27
28
  "rvm.gemspec"
28
29
  ]
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.22
4
+ version: 0.0.23
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-08-26 00:00:00 -04:00
12
+ date: 2009-08-27 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -29,6 +29,7 @@ files:
29
29
  - bash/rvm
30
30
  - bash/rvm-install
31
31
  - bash/rvm-update
32
+ - bash/rvmrc.sample
32
33
  - lib/rvm.rb
33
34
  - rvm.gemspec
34
35
  has_rdoc: true