gemrage 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +5 -0
- data/VERSION +1 -1
- data/gemrage.gemspec +148 -3
- data/lib/rubygems/commands/scan_command.rb +77 -4
- data/vendor/ruby/1.8/bin/rvm-install +19 -0
- data/vendor/ruby/1.8/cache/macaddr-1.0.0.gem +0 -0
- data/vendor/ruby/1.8/cache/rvm-1.0.14.gem +0 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/README +33 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/gemspec.rb +27 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/install.rb +210 -0
- data/vendor/ruby/1.8/gems/macaddr-1.0.0/lib/macaddr.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/LICENCE +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/README +127 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/bin/rvm-install +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm +76 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-auto-ruby +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-prompt +204 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-shell +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-head +35 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-update-latest +27 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvmsudo +24 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/db +71 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/known +55 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/config/md5 +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/gemset_snapshot +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/install-system-wide +191 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/contrib/r +44 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/examples/rvmrc +47 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/default.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/gemsets/global.gems +1 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/alias +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/benchmark +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/cleanup +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/debug +8 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/disk-usage +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/docs +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/exec +33 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/fetch +5 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gem +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/gemset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/implode +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/info +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/install +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/list +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/migrate +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/monitor +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/notes +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/package +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rake +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/remove +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/repair +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/reset +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/ruby +84 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rubygems +11 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/rvmrc +34 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/snapshot +15 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/specs +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/srcdir +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tests +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/tools +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/uninstall +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/update +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/upgrade +18 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/use +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/help/wrapper +41 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/VERSION.yml +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/capistrano.rb +45 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/alias.rb +69 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/cleanup.rb +54 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/configuration.rb +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/env.rb +52 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/gemset.rb +222 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/info.rb +13 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/list.rb +124 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/rubies.rb +50 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/sets.rb +123 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/tools.rb +68 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/utility.rb +173 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment/wrapper.rb +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/environment.rb +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/errors.rb +31 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/install_command_dumper.rb +51 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/abstract_wrapper.rb +145 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/calculate_rvm_path.sh +26 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/result.rb +42 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/shell_wrapper.sh +10 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/single_shot_wrapper.rb +56 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell/utility.rb +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/shell.rb +25 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm/version.rb +19 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/lib/rvm.rb +156 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1 +385 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/man/man1/rvm.1.gz +0 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/rvm.gemspec +184 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/alias +225 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/aliases +4 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/array +32 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/base +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cd +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cleanup +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/cli +781 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/color +49 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/completion +151 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/db +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/default +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/disk-usage +60 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/docs +115 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/env +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/environment-convertor +74 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/fetch +229 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/gemsets +950 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hash +37 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/help +46 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/hook +23 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/info +214 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/initialize +29 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc +9 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/irbrc.rb +63 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/list +315 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/log +38 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/maglev +193 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/manage +2094 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/match +6 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/md5 +22 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/migrate +175 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/monitor +105 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/notes +121 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/override_gem +14 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/package +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patches +64 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/patchsets +87 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/repair +199 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rubygems +157 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm +120 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/rvm-install +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/selector +818 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/set +301 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/snapshot +262 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/tools +58 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/update +631 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/upgrade +144 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/utility +1557 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/version +17 -0
- data/vendor/ruby/1.8/gems/rvm-1.0.14/scripts/wrapper +210 -0
- data/vendor/ruby/1.8/specifications/macaddr-1.0.0.gemspec +27 -0
- data/vendor/ruby/1.8/specifications/rvm-1.0.14.gemspec +42 -0
- metadata +149 -4
@@ -0,0 +1,69 @@
|
|
1
|
+
##
|
2
|
+
# Cross platform MAC address determination. Works for:
|
3
|
+
# * /sbin/ifconfig
|
4
|
+
# * /bin/ifconfig
|
5
|
+
# * ifconfig
|
6
|
+
# * ipconfig /all
|
7
|
+
#
|
8
|
+
# To return the first MAC address on the system:
|
9
|
+
#
|
10
|
+
# Mac.address
|
11
|
+
#
|
12
|
+
# To return an array of all MAC addresses:
|
13
|
+
#
|
14
|
+
# Mac.address.list
|
15
|
+
|
16
|
+
module Mac
|
17
|
+
VERSION = '1.0.0'
|
18
|
+
|
19
|
+
def Mac.version() ::Mac::VERSION end
|
20
|
+
|
21
|
+
class << self
|
22
|
+
|
23
|
+
##
|
24
|
+
# Accessor for the system's first MAC address, requires a call to #address
|
25
|
+
# first
|
26
|
+
|
27
|
+
attr_accessor "mac_address"
|
28
|
+
|
29
|
+
##
|
30
|
+
# Discovers and returns the system's MAC addresses. Returns the first
|
31
|
+
# MAC address, and includes an accessor #list for the remaining addresses:
|
32
|
+
#
|
33
|
+
# Mac.addr # => first address
|
34
|
+
# Mac.addr.list # => all addresses
|
35
|
+
|
36
|
+
def address
|
37
|
+
return @mac_address if defined? @mac_address and @mac_address
|
38
|
+
re = %r/[^:\-](?:[0-9A-F][0-9A-F][:\-]){5}[0-9A-F][0-9A-F][^:\-]/io
|
39
|
+
cmds = '/sbin/ifconfig', '/bin/ifconfig', 'ifconfig', 'ipconfig /all'
|
40
|
+
|
41
|
+
null = test(?e, '/dev/null') ? '/dev/null' : 'NUL'
|
42
|
+
|
43
|
+
lines = nil
|
44
|
+
cmds.each do |cmd|
|
45
|
+
stdout = IO.popen("#{ cmd } 2> #{ null }"){|fd| fd.readlines} rescue next
|
46
|
+
next unless stdout and stdout.size > 0
|
47
|
+
lines = stdout and break
|
48
|
+
end
|
49
|
+
raise "all of #{ cmds.join ' ' } failed" unless lines
|
50
|
+
|
51
|
+
candidates = lines.select{|line| line =~ re}
|
52
|
+
raise 'no mac address candidates' unless candidates.first
|
53
|
+
candidates.map!{|c| c[re].strip}
|
54
|
+
|
55
|
+
maddr = candidates.first
|
56
|
+
raise 'no mac address found' unless maddr
|
57
|
+
|
58
|
+
maddr.strip!
|
59
|
+
maddr.instance_eval{ @list = candidates; def list() @list end }
|
60
|
+
|
61
|
+
@mac_address = maddr
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Shorter alias for #address
|
66
|
+
|
67
|
+
alias_method "addr", "address"
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2009-2010 Wayne E. Seguin
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to
|
5
|
+
deal in the Software without restriction, including without limitation the
|
6
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
16
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,127 @@
|
|
1
|
+
|
2
|
+
Usage
|
3
|
+
|
4
|
+
rvm [Flags] [Options] Action [Implementation[,Implementation[,...]]
|
5
|
+
|
6
|
+
Flags
|
7
|
+
|
8
|
+
--head - with update, updates rvm to git head version.
|
9
|
+
--rubygems - with update, updates rubygems for selected ruby
|
10
|
+
--default - with ruby select, sets a default ruby for new shells.
|
11
|
+
--debug - Toggle debug mode on for very verbose output.
|
12
|
+
--trace - Toggle trace mode on to see EVERYTHING rvm is doing.
|
13
|
+
--force - Force install, removes old install & source before install.
|
14
|
+
--summary - Used with rubydo to print out a summary of the commands run.
|
15
|
+
--latest - with gemset --dump skips version strings for latest gem.
|
16
|
+
--gems - with uninstall/remove removes gems with the interpreter.
|
17
|
+
--docs - with install, attempt to generate ri after installation.
|
18
|
+
--reconfigure - Force ./configure on install even if Makefile already exists.
|
19
|
+
|
20
|
+
Options
|
21
|
+
|
22
|
+
-v|--version - Emit rvm version loaded for current shell
|
23
|
+
-l|--level - patch level to use with rvm use / install
|
24
|
+
--prefix - path for all rvm files (~/.rvm/), with trailing slash!
|
25
|
+
--bin - path for binaries to be placed (~/.rvm/bin/)
|
26
|
+
-S - Specify a script file to attempt to load and run (rubydo)
|
27
|
+
-e - Execute code from the command line.
|
28
|
+
--gems - Used to set the 'gems_flag', use with 'remove' to remove gems
|
29
|
+
--archive - Used to set the 'archive_flag', use with 'remove' to remove archive
|
30
|
+
--patch - With MRI Rubies you may specify one or more full paths to patches
|
31
|
+
for multiple, specify comma separated:
|
32
|
+
--patch /.../.../a.patch[%prefix],/.../.../.../b.patch
|
33
|
+
'prefix' is an optional argument, which will be bypassed
|
34
|
+
to the '-p' argument of the 'patch' command. It is separated
|
35
|
+
from patch file name with '%' symbol.
|
36
|
+
-C|--configure - custom configure options. If you need to pass several configure
|
37
|
+
options then append them comma separated: -C --...,--...,--...
|
38
|
+
--nice - process niceness (for slow computers, default 0)
|
39
|
+
--ree-options - Options passed directly to ree's './installer' on the command line.
|
40
|
+
--with-rubies - Specifies a string for rvm to attempt to expand for set operations.
|
41
|
+
|
42
|
+
Action
|
43
|
+
|
44
|
+
(Note that for most actions, 'rvm help action-name' may provide more information.)
|
45
|
+
|
46
|
+
* usage - show this usage information
|
47
|
+
version - show the rvm version installed in rvm_path
|
48
|
+
use - setup current shell to use a specific ruby version
|
49
|
+
reload - reload rvm source itself (useful after changing rvm source)
|
50
|
+
implode - (seppuku) removes the rvm installation completely.
|
51
|
+
This means everything in $rvm_path (~/.rvm).
|
52
|
+
This does not touch your profiles, which is why
|
53
|
+
there is an if around the sourcing scripts/rvm.
|
54
|
+
update - upgrades rvm to the latest version.
|
55
|
+
(If you experience bugs try this first with --head)
|
56
|
+
reset - remove current and stored default & system settings.
|
57
|
+
(If you experience odd behavior try this second)
|
58
|
+
info - show the *current* environment information for current ruby
|
59
|
+
debug - show info plus additional information for common issues
|
60
|
+
|
61
|
+
install - install one or many ruby versions
|
62
|
+
See also: http://rvm.beginrescueend.com/rubies/installing/
|
63
|
+
uninstall - uninstall one or many ruby versions, leaves their sources
|
64
|
+
remove - uninstall one or many ruby versions and remove their sources
|
65
|
+
|
66
|
+
migrate - Lets you migrate all gemsets from one ruby to another.
|
67
|
+
upgrade - Lets you upgrade from one version of a ruby to another, including
|
68
|
+
migrating your gemsets semi-automatically.
|
69
|
+
|
70
|
+
wrapper - generates a set of wrapper executables for a given ruby with the
|
71
|
+
specified ruby and gemset combination. Used under the hood for
|
72
|
+
passenger support and the like.
|
73
|
+
|
74
|
+
cleanup - Lets you remove stale source folders / archives and other miscellaneous
|
75
|
+
data associated with rvm.
|
76
|
+
repair - Lets you repair parts of your environment e.g. wrappers, env files and
|
77
|
+
and similar files (e.g. general maintenance).
|
78
|
+
snapshot - Lets your backup / restore an rvm installation in a lightweight manner.
|
79
|
+
|
80
|
+
disk-usage - Tells you how much disk space rvm install is using.
|
81
|
+
tools - Provides general information about the ruby environment,
|
82
|
+
primarily useful when scripting rvm.
|
83
|
+
docs - Tools to make installing ri and rdoc documentation easier.
|
84
|
+
rvmrc - Tools related to managing rvmrc trust and loading.
|
85
|
+
|
86
|
+
exec - runs an arbitrary command as a set operation.
|
87
|
+
ruby - runs a named ruby file against specified and/or all rubies
|
88
|
+
gem - runs a gem command using selected ruby's 'gem'
|
89
|
+
rake - runs a rake task against specified and/or all rubies
|
90
|
+
tests - runs 'rake test' across selected ruby versions
|
91
|
+
specs - runs 'rake spec' across selected ruby versions
|
92
|
+
monitor - Monitor cwd for testing, run `rake {spec,test}` on changes.
|
93
|
+
|
94
|
+
gemset - gemsets: http://rvm.beginrescueend.com/gemsets/
|
95
|
+
|
96
|
+
rubygems - Lets you switch the installed version of rubygems for a given
|
97
|
+
1.8-compatible ruby.
|
98
|
+
|
99
|
+
gemdir - display the path to the current gem directory (GEM_HOME).
|
100
|
+
srcdir - display the path to rvm source directory (may be yanked)
|
101
|
+
|
102
|
+
fetch - Performs an archive / src fetch only of the selected ruby.
|
103
|
+
list - show currently installed rubies, interactive output.
|
104
|
+
http://rvm.beginrescueend.com/rubies/list/
|
105
|
+
package - Install a dependency package {readline,iconv,zlib,openssl}
|
106
|
+
http://rvm.beginrescueend.com/packages/
|
107
|
+
notes - Display notes, with operating system specifics.
|
108
|
+
|
109
|
+
Implementation
|
110
|
+
|
111
|
+
* ruby - MRI/YARV Ruby (The Gold Standard) {1.8.6,1.8.7,1.9.1,1.9.2...}
|
112
|
+
jruby - JRuby, Ruby interpreter on the Java Virtual Machine.
|
113
|
+
rbx - Rubinius
|
114
|
+
ree - Ruby Enterprise Edition, MRI Ruby with several custom
|
115
|
+
patches for performance, stability, and memory.
|
116
|
+
macruby - MacRuby, insanely fast, can make real apps (Mac OS X Only).
|
117
|
+
maglev - GemStone Ruby, awesome persistent ruby object store.
|
118
|
+
ironruby - IronRuby, NOT supported yet. Looking for volunteers to help.
|
119
|
+
mput - shyouhei(mput)'s github repository, popular in Japan :)
|
120
|
+
system - use the system ruby (eg. pre-rvm state)
|
121
|
+
default - use rvm set default ruby and system if it hasn't been set.
|
122
|
+
http://rvm.beginrescueend.com/rubies/default/
|
123
|
+
|
124
|
+
Resources:
|
125
|
+
|
126
|
+
http://rvm.beginrescueend.com/
|
127
|
+
https://www.pivotaltracker.com/projects/26822
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
if [[ ${rvm_ignore_rvmrc:-0} -eq 0 ]]; then
|
4
|
+
|
5
|
+
for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
|
6
|
+
|
7
|
+
if [[ -f "$rvmrc" ]] ; then
|
8
|
+
|
9
|
+
if grep -q '^\s*rvm .*$' "$rvmrc" ; then
|
10
|
+
|
11
|
+
printf "\n Error:
|
12
|
+
$rvmrc is for rvm settings only.
|
13
|
+
rvm CLI may NOT be called from within $rvmrc.
|
14
|
+
Skipping the loading of $rvmrc
|
15
|
+
"
|
16
|
+
exit 1
|
17
|
+
|
18
|
+
else
|
19
|
+
|
20
|
+
source "$rvmrc"
|
21
|
+
|
22
|
+
fi
|
23
|
+
|
24
|
+
fi
|
25
|
+
|
26
|
+
done
|
27
|
+
|
28
|
+
fi
|
29
|
+
|
30
|
+
# Setup default sandbox value. See scripts/rvm for origin.
|
31
|
+
if [[ ${rvm_selfcontained:-0} -eq 0 ]]; then
|
32
|
+
|
33
|
+
if [[ "root" = "$(whoami)" || -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
|
34
|
+
|
35
|
+
rvm_selfcontained=0
|
36
|
+
|
37
|
+
else
|
38
|
+
|
39
|
+
rvm_selfcontained=1
|
40
|
+
|
41
|
+
fi
|
42
|
+
|
43
|
+
fi
|
44
|
+
|
45
|
+
if [[ -z "${rvm_prefix:-""}" ]] ; then
|
46
|
+
|
47
|
+
if [[ ${rvm_selfcontained:-0} -eq 0 ]] ; then
|
48
|
+
|
49
|
+
rvm_prefix="/usr/local/"
|
50
|
+
|
51
|
+
else
|
52
|
+
|
53
|
+
rvm_prefix="$HOME/."
|
54
|
+
|
55
|
+
fi
|
56
|
+
|
57
|
+
fi
|
58
|
+
|
59
|
+
# Fix rvm_prefix changes.
|
60
|
+
echo "$rvm_prefix" | grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
|
61
|
+
|
62
|
+
rvm_prefix_needs_trailing_slash="$?"
|
63
|
+
|
64
|
+
if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
|
65
|
+
rvm_prefix="$rvm_prefix/"
|
66
|
+
fi
|
67
|
+
|
68
|
+
if [[ -z "${rvm_path:-""}" ]] ; then
|
69
|
+
rvm_path="${rvm_prefix}rvm"
|
70
|
+
fi
|
71
|
+
|
72
|
+
source "$rvm_path/scripts/rvm"
|
73
|
+
|
74
|
+
export rvm_interactive_flag=0
|
75
|
+
|
76
|
+
rvm "$@"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
if [[ -n "$rvm_path" && -s "$rvm_path/scripts/rvm" ]]; then
|
4
|
+
source "$rvm_path/scripts/rvm"
|
5
|
+
|
6
|
+
elif [[ -s "/usr/local/lib/rvm" ]]; then
|
7
|
+
source "/usr/local/lib/rvm"
|
8
|
+
|
9
|
+
elif [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
|
10
|
+
source "$HOME/.rvm/scripts/rvm"
|
11
|
+
|
12
|
+
elif [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
|
13
|
+
source "/usr/local/rvm/scripts/rvm"
|
14
|
+
|
15
|
+
else
|
16
|
+
echo "Unable to detect rvm, please manually set the rvm_path env variable." >&2
|
17
|
+
exit 1
|
18
|
+
fi
|
19
|
+
|
20
|
+
[[ -s "$rvm_path/environments/default" ]] && source "$rvm_path/environments/default"
|
21
|
+
|
22
|
+
rvm rvmrc load > /dev/null 2>&1
|
23
|
+
|
24
|
+
exec ruby "$@"
|
@@ -0,0 +1,204 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
add(){
|
4
|
+
|
5
|
+
token=${1:-""}
|
6
|
+
|
7
|
+
eval "${token}_flag=1" ; shift
|
8
|
+
|
9
|
+
if [[ -n "$format" ]] ; then
|
10
|
+
|
11
|
+
format="${format}-\$${token}"
|
12
|
+
|
13
|
+
else
|
14
|
+
|
15
|
+
format="\$${token}"
|
16
|
+
|
17
|
+
fi
|
18
|
+
|
19
|
+
return 0
|
20
|
+
}
|
21
|
+
|
22
|
+
rvm_gemset_separator="${rvm_gemset_separator:-"@"}"
|
23
|
+
|
24
|
+
ruby=$(command -v ruby)
|
25
|
+
|
26
|
+
if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
|
27
|
+
|
28
|
+
unset format
|
29
|
+
|
30
|
+
while [[ $# -gt 0 ]] ; do
|
31
|
+
|
32
|
+
token="$1" ; shift
|
33
|
+
|
34
|
+
case "$token" in
|
35
|
+
|
36
|
+
i|interpreter) add "interpreter" ;;
|
37
|
+
|
38
|
+
v|version) add "version" ;;
|
39
|
+
|
40
|
+
p|patchlevel) add "patchlevel" ;;
|
41
|
+
|
42
|
+
r|revision) add "revision" ;;
|
43
|
+
|
44
|
+
a|architecture) add "architecture" ;;
|
45
|
+
|
46
|
+
g|gemset) add "gemset" ;;
|
47
|
+
|
48
|
+
u|unicode) add "unicode" ;;
|
49
|
+
|
50
|
+
s|system) add "system" ;;
|
51
|
+
|
52
|
+
-d|--no-default) no_default=1 ;;
|
53
|
+
|
54
|
+
*) echo "Unrecognized command line option '$token' for $0" ; exit 1 ;;
|
55
|
+
|
56
|
+
esac
|
57
|
+
|
58
|
+
done
|
59
|
+
|
60
|
+
|
61
|
+
if [[ -z "$format" ]] ; then
|
62
|
+
|
63
|
+
add "interpreter"
|
64
|
+
|
65
|
+
add "version"
|
66
|
+
|
67
|
+
add "patchlevel"
|
68
|
+
|
69
|
+
add "gemset"
|
70
|
+
|
71
|
+
fi
|
72
|
+
|
73
|
+
ruby_string=$(dirname "$ruby" | xargs dirname | xargs basename)
|
74
|
+
|
75
|
+
default_alias="$(rvm alias show default)"
|
76
|
+
|
77
|
+
identifier="$(rvm tools identifier)"
|
78
|
+
|
79
|
+
# Do not display anything if no default flag was provided
|
80
|
+
# and we are using the default ruby
|
81
|
+
if [[ -n "$no_default" && "$identifier" = "$default_alias" ]]; then
|
82
|
+
|
83
|
+
exit 0
|
84
|
+
|
85
|
+
fi
|
86
|
+
|
87
|
+
strings=(${ruby_string//-/ })
|
88
|
+
|
89
|
+
if [[ ${interpreter_flag:-0} -gt 0 || -n "$unicode_flag" ]] ; then
|
90
|
+
|
91
|
+
interpreter=${strings[0]}
|
92
|
+
|
93
|
+
fi
|
94
|
+
|
95
|
+
if [[ ${version_flag:-0} -gt 0 || -n "$unicode_flag" ]] ; then
|
96
|
+
|
97
|
+
version=${strings[1]}
|
98
|
+
|
99
|
+
fi
|
100
|
+
|
101
|
+
if [[ ${#strings[@]} -gt 2 ]] ; then
|
102
|
+
|
103
|
+
if [[ ${patchlevel_flag:-0} -gt 0 ]] ; then
|
104
|
+
|
105
|
+
patchlevel=${strings[2]}
|
106
|
+
|
107
|
+
fi
|
108
|
+
|
109
|
+
fi
|
110
|
+
|
111
|
+
if [[ ${architecture_flag:-0} -gt 0 ]] ; then
|
112
|
+
|
113
|
+
architecture="$(echo "$(ruby -v)" | sed 's/^.*\[//' | sed 's/\].*$//')"
|
114
|
+
|
115
|
+
fi
|
116
|
+
|
117
|
+
if [[ ${gemset_flag:-0} -gt 0 ]] ; then
|
118
|
+
|
119
|
+
case "${GEM_HOME:-""}" in
|
120
|
+
|
121
|
+
*${rvm_gemset_separator:-"@"}*)
|
122
|
+
|
123
|
+
gemset="${rvm_gemset_separator:-"@"}${GEM_HOME/*${rvm_gemset_separator:-"@"}/}"
|
124
|
+
|
125
|
+
;;
|
126
|
+
|
127
|
+
esac
|
128
|
+
|
129
|
+
fi
|
130
|
+
|
131
|
+
if [[ ${unicode_flag:-0} -gt 0 ]] ; then
|
132
|
+
|
133
|
+
case "$interpreter" in
|
134
|
+
|
135
|
+
jruby) unicode="☯" ;;
|
136
|
+
|
137
|
+
rbx) unicode="☃" ;;
|
138
|
+
|
139
|
+
ree) unicode="✈" ;;
|
140
|
+
|
141
|
+
macruby) unicode="⌘" ;;
|
142
|
+
|
143
|
+
maglev) unicode="㎖" ;;
|
144
|
+
|
145
|
+
ironruby) unicode="♭" ;;
|
146
|
+
|
147
|
+
mput) unicode="⎈" ;;
|
148
|
+
|
149
|
+
system) unicode="➆" ;;
|
150
|
+
|
151
|
+
ruby)
|
152
|
+
|
153
|
+
case ${version:-""} in
|
154
|
+
|
155
|
+
1.8.6) unicode="❻" ;;
|
156
|
+
|
157
|
+
1.8.7) unicode="❼" ;;
|
158
|
+
|
159
|
+
1.9.1) unicode="❶" ;;
|
160
|
+
|
161
|
+
1.9.2) unicode="❷" ;;
|
162
|
+
|
163
|
+
*) unicode="♢" ;;
|
164
|
+
|
165
|
+
esac ;;
|
166
|
+
|
167
|
+
*) unicode="♢" ;;
|
168
|
+
|
169
|
+
esac
|
170
|
+
|
171
|
+
if echo "$ruby_string" | \grep -q '-head' ; then
|
172
|
+
|
173
|
+
unicode="${unicode}〠"
|
174
|
+
|
175
|
+
fi
|
176
|
+
|
177
|
+
fi
|
178
|
+
|
179
|
+
eval "prompt=\"$format\""
|
180
|
+
|
181
|
+
echo "$prompt" \
|
182
|
+
| sed -e 's#^[[:space:]]*-*##g' \
|
183
|
+
-e 's#--*#-#g' \
|
184
|
+
-e 's#-*[[:space:]]*$##' \
|
185
|
+
-e 's#-'${rvm_gemset_separator:-"@"}'#'${rvm_gemset_separator:-"@"}'#'
|
186
|
+
|
187
|
+
|
188
|
+
else
|
189
|
+
|
190
|
+
while [[ $# -gt 0 ]] ; do
|
191
|
+
|
192
|
+
token="$1" ; shift
|
193
|
+
|
194
|
+
case "$token" in
|
195
|
+
|
196
|
+
s|system) echo "system" ;;
|
197
|
+
|
198
|
+
esac
|
199
|
+
|
200
|
+
done
|
201
|
+
|
202
|
+
fi
|
203
|
+
|
204
|
+
exit 0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
__rvm_shell_lookup_script() {
|
4
|
+
local relative_scripts_dir
|
5
|
+
relative_scripts_dir="$(dirname -- "$(dirname -- "$0")")/scripts"
|
6
|
+
for directory in "$rvm_path/scripts" "$HOME/.rvm/scripts" "/usr/local/rvm/scripts" "$relative_scripts_dir"; do
|
7
|
+
if [[ -d "$directory" && -s "$directory/rvm" ]]; then
|
8
|
+
echo "$directory/rvm"
|
9
|
+
return
|
10
|
+
fi
|
11
|
+
done
|
12
|
+
}
|
13
|
+
|
14
|
+
# If the first argument isn't -c, remove it and set it to the ruby string value.
|
15
|
+
if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | \grep -v '^-')" ]]; then
|
16
|
+
rvm_shell_ruby_string="$1"
|
17
|
+
shift
|
18
|
+
fi
|
19
|
+
|
20
|
+
rvm_shell_rvm_path="$(__rvm_shell_lookup_script)"
|
21
|
+
if [[ -n "$rvm_shell_rvm_path" ]]; then
|
22
|
+
source "$rvm_shell_rvm_path"
|
23
|
+
# Setup as expected.
|
24
|
+
if [[ -n "$rvm_shell_ruby_string" ]]; then
|
25
|
+
rvm "$rvm_shell_ruby_string"
|
26
|
+
if [[ "$?" -gt 0 ]]; then
|
27
|
+
echo "Error: RVM was unable to use '$rvm_shell_ruby_string'" 1>&2
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
else
|
31
|
+
rvm rvmrc load >/dev/null 2>&1
|
32
|
+
fi
|
33
|
+
fi
|
34
|
+
|
35
|
+
exec bash "$@"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -o errtrace
|
4
|
+
set -o errexit
|
5
|
+
|
6
|
+
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
7
|
+
|
8
|
+
if [[ ${rvm_ignore_rvmrc:-0} -eq 0 ]]; then
|
9
|
+
for file in /etc/rvmrc "$HOME/.rvmrc" ; do
|
10
|
+
if [[ -s "$file" ]] ; then
|
11
|
+
source $file
|
12
|
+
fi
|
13
|
+
done
|
14
|
+
fi
|
15
|
+
|
16
|
+
rvm_path="${rvm_path:-"$HOME/.rvm"}"
|
17
|
+
|
18
|
+
mkdir -p "$rvm_path/src/"
|
19
|
+
|
20
|
+
builtin cd "$rvm_path/src"
|
21
|
+
|
22
|
+
rm -rf ./rvm/
|
23
|
+
|
24
|
+
url="http://github.com/wayneeseguin/rvm.git"
|
25
|
+
|
26
|
+
if ! git clone "$url" ; then
|
27
|
+
printf "ERROR: Cloning from $url failed.\n"
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
builtin cd rvm
|
32
|
+
|
33
|
+
chmod +x "$PWD/scripts/install"
|
34
|
+
|
35
|
+
exec "$PWD/scripts/install"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
rvm_ignore_rvmrc=${rvm_ignore_rvmrc:-0}
|
4
|
+
if [[ $rvm_ignore_rvmrc -eq 0 ]]; then
|
5
|
+
[[ -s /etc/rvmrc ]] && source /etc/rvmrc
|
6
|
+
[[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
|
7
|
+
fi
|
8
|
+
|
9
|
+
rvm_path="${rvm_path:-$HOME/.rvm}"
|
10
|
+
\mkdir -p $rvm_path/src/
|
11
|
+
cd $rvm_path/src
|
12
|
+
|
13
|
+
stable_version=$(curl -B http://rvm.beginrescueend.com/releases/stable-version.txt 2>/dev/null)
|
14
|
+
|
15
|
+
echo "rvm-${stable_version}"
|
16
|
+
|
17
|
+
curl -L "http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz" -o "rvm-${stable_version}.tar.gz"
|
18
|
+
|
19
|
+
tar zxf "rvm-${stable_version}.tar.gz"
|
20
|
+
|
21
|
+
cd "rvm-${stable_version}"
|
22
|
+
|
23
|
+
# v v v This is a godo idea however it does not preserve the executible bit.
|
24
|
+
# Needs more thought, perhaps a simple sed instead.
|
25
|
+
#dos2unix scripts/* >/dev/null 2>&1
|
26
|
+
|
27
|
+
bash scripts/install
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
case "$1" in
|
4
|
+
--trace) set -o xtrace ; shift ;;
|
5
|
+
--verbose) set -o verbose ; shift ;;
|
6
|
+
esac
|
7
|
+
|
8
|
+
prefix="PATH='$PATH'"
|
9
|
+
|
10
|
+
if [[ -n "${BUNDLE_PATH:-""}" ]] ; then
|
11
|
+
prefix="BUNDLE_PATH='$BUNDLE_PATH' $prefix"
|
12
|
+
fi
|
13
|
+
|
14
|
+
if [[ -n "${GEM_HOME:-""}" ]] ; then
|
15
|
+
prefix="GEM_HOME='$GEM_HOME' $prefix"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [[ -n "${GEM_PATH:-""}" ]] ; then
|
19
|
+
prefix="GEM_PATH='$GEM_PATH' $prefix"
|
20
|
+
fi
|
21
|
+
|
22
|
+
eval "sudo /usr/bin/env $prefix $@"
|
23
|
+
|
24
|
+
exit $?
|