rubygems-sandbox 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +1 -0
- data/.autotest +26 -0
- data/History.txt +6 -0
- data/Manifest.txt +7 -0
- data/README.txt +69 -0
- data/Rakefile +17 -0
- data/lib/rubygems/commands/sandbox_command.rb +147 -0
- data/lib/rubygems_plugin.rb +3 -0
- metadata +148 -0
- metadata.gz.sig +3 -0
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
6Fm>�������̠��Y�e'����J҄1�ʹۇ����� ����18R����}# �y�i����榗6�Q(��7�1��ۅt���F����'�n���Zj��3N48�4�����QE~E�C���b������b^�L����*������IF��@�#{*6eV�����O��\���31�٪�4��^ ��մ�q����ĵz��Y�����,x��A��I�V�D=ޗf�G��Uመ i���p�
|
data/.autotest
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "autotest/restart"
|
4
|
+
|
5
|
+
Autotest.add_hook :initialize do |at|
|
6
|
+
at.testlib = "minitest/autorun"
|
7
|
+
at.add_exception "tmp"
|
8
|
+
|
9
|
+
# at.extra_files << "../some/external/dependency.rb"
|
10
|
+
#
|
11
|
+
# at.libs << ":../some/external"
|
12
|
+
#
|
13
|
+
# at.add_exception "vendor"
|
14
|
+
#
|
15
|
+
# at.add_mapping(/dependency.rb/) do |f, _|
|
16
|
+
# at.files_matching(/test_.*rb$/)
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# %w(TestA TestB).each do |klass|
|
20
|
+
# at.extra_class_map[klass] = "test/test_misc.rb"
|
21
|
+
# end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Autotest.add_hook :run_command do |at|
|
25
|
+
# system "rake build"
|
26
|
+
# end
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
= rubygems-sandbox
|
2
|
+
|
3
|
+
home :: https://github.com/seattlerb/rubygems-sandbox
|
4
|
+
rdoc :: http://seattlerb.rubyforge.org/rubygems-sandbox
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
The sandbox plugin for rubygems helps you manage your command-line
|
9
|
+
tools and their dependencies. Sandboxed gems are installed in their
|
10
|
+
own private rubygem repositories with all of their dependencies. This
|
11
|
+
means that you don't have to have a rat's nest of gems in your global
|
12
|
+
repository in order to run popular command-tools like rdoc, flog,
|
13
|
+
flay, rcov, etc.
|
14
|
+
|
15
|
+
gem sandbox has the following sub-commands:
|
16
|
+
|
17
|
+
* install gem_name ... - install 1 or more gems
|
18
|
+
* plugin gem_name plugin_name ... - install a gem and plugins for it
|
19
|
+
* remove gem_name ... - uninstall 1 or more gems
|
20
|
+
* help - show this output
|
21
|
+
|
22
|
+
Once you install gem sandbox will output something like:
|
23
|
+
|
24
|
+
Copy the following scripts to any directory in your path to use them:
|
25
|
+
|
26
|
+
cp /Users/USER/.gem/sandboxes/GEM/bin/TOOL _in_your_$PATH_
|
27
|
+
|
28
|
+
Copy the scripts to a directory in your path (eg ~/bin or /usr/bin)
|
29
|
+
and you're good to go.
|
30
|
+
|
31
|
+
== SYNOPSIS:
|
32
|
+
|
33
|
+
% gem uninstall flog flay ruby_parser sexp_processor
|
34
|
+
% gem sandbox install flog flay
|
35
|
+
% cp ~/.gem/sandboxes/*/bin/* ~/bin
|
36
|
+
% flay whatever
|
37
|
+
|
38
|
+
== REQUIREMENTS:
|
39
|
+
|
40
|
+
* rubygems 1.4 or higher
|
41
|
+
|
42
|
+
== INSTALL:
|
43
|
+
|
44
|
+
* sudo gem install rubygems-sandbox
|
45
|
+
|
46
|
+
== LICENSE:
|
47
|
+
|
48
|
+
(The MIT License)
|
49
|
+
|
50
|
+
Copyright (c) Ryan Davis, seattle.rb
|
51
|
+
|
52
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
53
|
+
a copy of this software and associated documentation files (the
|
54
|
+
'Software'), to deal in the Software without restriction, including
|
55
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
56
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
57
|
+
permit persons to whom the Software is furnished to do so, subject to
|
58
|
+
the following conditions:
|
59
|
+
|
60
|
+
The above copyright notice and this permission notice shall be
|
61
|
+
included in all copies or substantial portions of the Software.
|
62
|
+
|
63
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
64
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
65
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
66
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
67
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
68
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
69
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
|
+
|
6
|
+
Hoe.plugin :isolate
|
7
|
+
Hoe.plugin :seattlerb
|
8
|
+
|
9
|
+
Hoe.spec "rubygems-sandbox" do
|
10
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
11
|
+
|
12
|
+
self.rubyforge_name = "seattlerb"
|
13
|
+
|
14
|
+
require_rubygems_version "~> 1.4"
|
15
|
+
end
|
16
|
+
|
17
|
+
# vim: syntax=ruby
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'rubygems/command'
|
3
|
+
require 'rubygems/dependency_installer'
|
4
|
+
|
5
|
+
##
|
6
|
+
# Gem command to "sandbox" command-line tools into their own private
|
7
|
+
# gem repos but with a globally command-line wrapper.
|
8
|
+
|
9
|
+
class Gem::DependencyInstaller
|
10
|
+
attr_accessor :bin_dir
|
11
|
+
end
|
12
|
+
|
13
|
+
class Gem::Commands::SandboxCommand < Gem::Command
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge(
|
18
|
+
:generate_rdoc => false,
|
19
|
+
:generate_ri => false,
|
20
|
+
:format_executable => false,
|
21
|
+
:version => Gem::Requirement.default
|
22
|
+
)
|
23
|
+
|
24
|
+
super("sandbox", "Privately install a command-line tool", defaults)
|
25
|
+
|
26
|
+
@scripts = []
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
def arguments # :nodoc:
|
31
|
+
['SUBCOMMAND one of: install, update, plugin, remove, help',
|
32
|
+
'GEMNAME name of a gem to sandbox'].join "\n"
|
33
|
+
end
|
34
|
+
|
35
|
+
def usage # :nodoc:
|
36
|
+
"#{program_name} SUBCOMMAND GEMNAME(S)"
|
37
|
+
end
|
38
|
+
|
39
|
+
def description
|
40
|
+
<<-EOF
|
41
|
+
|
42
|
+
`gem sandbox` helps you manage your command-line tools and their
|
43
|
+
dependencies. Sandboxed gems are installed in their own private
|
44
|
+
repositories with their dependencies. This means that you don't have
|
45
|
+
to have a rats nest of gems in your global repository in order to run
|
46
|
+
popular command-tools like rdoc, flog, flay, rcov, etc.
|
47
|
+
|
48
|
+
`gem sandbox` has the following sub-commands:
|
49
|
+
|
50
|
+
* install gem_name ... - install 1 or more gems
|
51
|
+
* plugin gem_name plugin_name ... - install a gem and plugins for it
|
52
|
+
* uninstall gem_name ... - uninstall 1 or more gems
|
53
|
+
* help - show this output
|
54
|
+
|
55
|
+
Once you install `gem sandbox` will output something like:
|
56
|
+
|
57
|
+
Copy the following scripts to any directory in your path to use them:
|
58
|
+
|
59
|
+
cp /Users/USER/.gem/sandboxes/TOOL/bin/TOOL _in_your_$PATH_
|
60
|
+
|
61
|
+
Copy the scripts to a directory in your path (eg ~/bin or /usr/bin)
|
62
|
+
and you're good to go.
|
63
|
+
EOF
|
64
|
+
end
|
65
|
+
|
66
|
+
def execute
|
67
|
+
cmd = options[:args].shift
|
68
|
+
|
69
|
+
case cmd
|
70
|
+
when "install" then
|
71
|
+
install
|
72
|
+
when "plugin" then
|
73
|
+
plugin
|
74
|
+
when "uninstall" then
|
75
|
+
abort "not implemented yet"
|
76
|
+
when "help", "usage" then
|
77
|
+
show_help
|
78
|
+
abort
|
79
|
+
else
|
80
|
+
alert_error "Unknown sandbox subcommand: #{cmd}"
|
81
|
+
show_help
|
82
|
+
abort
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def install
|
87
|
+
get_all_gem_names.each do |gem_name|
|
88
|
+
install_gem gem_name
|
89
|
+
end
|
90
|
+
|
91
|
+
list_scripts
|
92
|
+
end
|
93
|
+
|
94
|
+
def plugin
|
95
|
+
gem_name, *plugins = options[:args]
|
96
|
+
dir = sandbox_dir gem_name
|
97
|
+
|
98
|
+
install_gem gem_name, dir
|
99
|
+
|
100
|
+
plugins.each do |plugin_name|
|
101
|
+
inst = Gem::DependencyInstaller.new options.merge(:install_dir => dir)
|
102
|
+
inst.install plugin_name, options[:version]
|
103
|
+
end
|
104
|
+
|
105
|
+
list_scripts
|
106
|
+
end
|
107
|
+
|
108
|
+
def list_scripts
|
109
|
+
say ""
|
110
|
+
say "Copy the following scripts to any directory in your path to use them:"
|
111
|
+
say ""
|
112
|
+
say "cp #{@scripts.join ' '} _in_your_$PATH_"
|
113
|
+
end
|
114
|
+
|
115
|
+
def sandbox_dir gem_name
|
116
|
+
File.join Gem.user_home, '.gem', "sandboxes", gem_name
|
117
|
+
end
|
118
|
+
|
119
|
+
def install_gem gem_name, dir = sandbox_dir(gem_name)
|
120
|
+
# Forces reset of known installed gems so subsequent repeats work
|
121
|
+
Gem.use_paths nil, nil
|
122
|
+
|
123
|
+
inst = Gem::DependencyInstaller.new options.merge(:install_dir => dir)
|
124
|
+
inst.install gem_name, options[:version]
|
125
|
+
|
126
|
+
spec = inst.installed_gems.find { |s| s.name == gem_name }
|
127
|
+
rewrite_executables dir, spec
|
128
|
+
|
129
|
+
say "Successfully installed #{gem_name}"
|
130
|
+
end
|
131
|
+
|
132
|
+
def rewrite_executables dir, spec
|
133
|
+
spec.executables.each do |filename|
|
134
|
+
path = File.join dir, "bin", filename
|
135
|
+
env = "ENV['GEM_HOME'] = ENV['GEM_PATH'] = #{dir.inspect}"
|
136
|
+
|
137
|
+
script = File.read path
|
138
|
+
script.sub!(/require 'rubygems'/, "#{env}\n\\&")
|
139
|
+
|
140
|
+
File.open path, "w" do |f|
|
141
|
+
f.write script
|
142
|
+
end
|
143
|
+
|
144
|
+
@scripts << path
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubygems-sandbox
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Ryan Davis
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain:
|
17
|
+
- |
|
18
|
+
-----BEGIN CERTIFICATE-----
|
19
|
+
MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
20
|
+
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
21
|
+
GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
|
22
|
+
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
23
|
+
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
24
|
+
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
25
|
+
taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
|
26
|
+
oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
|
27
|
+
GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
|
28
|
+
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
29
|
+
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
30
|
+
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
31
|
+
AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
|
32
|
+
vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
|
33
|
+
w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
|
34
|
+
l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
|
35
|
+
n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
|
36
|
+
FBHgymkyj/AOSqKRIpXPhjC6
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
|
39
|
+
date: 2011-07-21 00:00:00 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
prerelease: false
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 5
|
50
|
+
segments:
|
51
|
+
- 2
|
52
|
+
- 3
|
53
|
+
version: "2.3"
|
54
|
+
type: :development
|
55
|
+
version_requirements: *id001
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: hoe
|
58
|
+
prerelease: false
|
59
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ~>
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
hash: 23
|
65
|
+
segments:
|
66
|
+
- 2
|
67
|
+
- 10
|
68
|
+
version: "2.10"
|
69
|
+
type: :development
|
70
|
+
version_requirements: *id002
|
71
|
+
description: |-
|
72
|
+
The sandbox plugin for rubygems helps you manage your command-line
|
73
|
+
tools and their dependencies. Sandboxed gems are installed in their
|
74
|
+
own private rubygem repositories with all of their dependencies. This
|
75
|
+
means that you don't have to have a rat's nest of gems in your global
|
76
|
+
repository in order to run popular command-tools like rdoc, flog,
|
77
|
+
flay, rcov, etc.
|
78
|
+
|
79
|
+
gem sandbox has the following sub-commands:
|
80
|
+
|
81
|
+
* install gem_name ... - install 1 or more gems
|
82
|
+
* plugin gem_name plugin_name ... - install a gem and plugins for it
|
83
|
+
* remove gem_name ... - uninstall 1 or more gems
|
84
|
+
* help - show this output
|
85
|
+
|
86
|
+
Once you install gem sandbox will output something like:
|
87
|
+
|
88
|
+
Copy the following scripts to any directory in your path to use them:
|
89
|
+
|
90
|
+
cp /Users/USER/.gem/sandboxes/GEM/bin/TOOL _in_your_$PATH_
|
91
|
+
|
92
|
+
Copy the scripts to a directory in your path (eg ~/bin or /usr/bin)
|
93
|
+
and you're good to go.
|
94
|
+
email:
|
95
|
+
- ryand-ruby@zenspider.com
|
96
|
+
executables: []
|
97
|
+
|
98
|
+
extensions: []
|
99
|
+
|
100
|
+
extra_rdoc_files:
|
101
|
+
- History.txt
|
102
|
+
- Manifest.txt
|
103
|
+
- README.txt
|
104
|
+
files:
|
105
|
+
- .autotest
|
106
|
+
- History.txt
|
107
|
+
- Manifest.txt
|
108
|
+
- README.txt
|
109
|
+
- Rakefile
|
110
|
+
- lib/rubygems/commands/sandbox_command.rb
|
111
|
+
- lib/rubygems_plugin.rb
|
112
|
+
homepage: https://github.com/seattlerb/rubygems-sandbox
|
113
|
+
licenses: []
|
114
|
+
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options:
|
117
|
+
- --main
|
118
|
+
- README.txt
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ~>
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 7
|
136
|
+
segments:
|
137
|
+
- 1
|
138
|
+
- 4
|
139
|
+
version: "1.4"
|
140
|
+
requirements: []
|
141
|
+
|
142
|
+
rubyforge_project: seattlerb
|
143
|
+
rubygems_version: 1.8.5
|
144
|
+
signing_key:
|
145
|
+
specification_version: 3
|
146
|
+
summary: The sandbox plugin for rubygems helps you manage your command-line tools and their dependencies
|
147
|
+
test_files: []
|
148
|
+
|
metadata.gz.sig
ADDED