rvmbs 0.0.2 → 0.0.3
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.
- data/CHANGELOG.markdown +7 -1
- data/Gemfile.lock +11 -1
- data/README.markdown +8 -2
- data/lib/rvmbs.rb +39 -20
- data/lib/rvmbs/version.rb +1 -1
- data/man/rvmbs.1 +41 -0
- data/man/rvmbs.1.html +118 -0
- data/man/rvmbs.1.ronn +38 -0
- data/rvmbs.gemspec +5 -4
- metadata +30 -4
data/CHANGELOG.markdown
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rvmbs (0.0.
|
4
|
+
rvmbs (0.0.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: http://rubygems.org/
|
8
8
|
specs:
|
9
|
+
gem-man (0.3.0)
|
10
|
+
hpricot (0.8.6)
|
11
|
+
mustache (0.99.4)
|
12
|
+
rdiscount (1.6.8)
|
13
|
+
ronn (0.7.3)
|
14
|
+
hpricot (>= 0.8.2)
|
15
|
+
mustache (>= 0.7.0)
|
16
|
+
rdiscount (>= 1.5.8)
|
9
17
|
|
10
18
|
PLATFORMS
|
11
19
|
ruby
|
12
20
|
|
13
21
|
DEPENDENCIES
|
22
|
+
gem-man
|
23
|
+
ronn
|
14
24
|
rvmbs!
|
data/README.markdown
CHANGED
@@ -3,6 +3,12 @@ RVM Bootstrap
|
|
3
3
|
|
4
4
|
Command to create a directory project with a configured .rvmrc into.
|
5
5
|
|
6
|
+
Requirements
|
7
|
+
------------
|
8
|
+
|
9
|
+
Just RVM installed.
|
10
|
+
|
11
|
+
|
6
12
|
Installation
|
7
13
|
-----------
|
8
14
|
|
@@ -17,13 +23,13 @@ Generates a my_project directory with a trusted .rvmrc file contains:
|
|
17
23
|
|
18
24
|
rvm use --create 1.9.2@my_project
|
19
25
|
|
20
|
-
Run `rvmbs --help` for more options.
|
26
|
+
Run `rvmbs --help` or `gem man rvmbs` for more options.
|
21
27
|
|
22
28
|
To Do
|
23
29
|
-----
|
24
30
|
|
25
31
|
* Add tests.
|
26
|
-
* Bundler integration.
|
32
|
+
* Bundler integration.
|
27
33
|
|
28
34
|
Copyright
|
29
35
|
---------
|
data/lib/rvmbs.rb
CHANGED
@@ -13,26 +13,34 @@ module RVMBS
|
|
13
13
|
|
14
14
|
optparse = OptionParser.new do |opts|
|
15
15
|
optsp = opts
|
16
|
-
opts.banner = "
|
16
|
+
opts.banner = "RVM Bootstrap - Command to create a project directory with a configured .rvmrc into.
|
17
|
+
|
18
|
+
Usage: rvmbs -d PROJECT_NAME [options]"
|
17
19
|
|
18
20
|
# This define the directory name.
|
19
21
|
opts.on('-d', '--directory NAME', "The name of the project's directory.") do |name|
|
20
22
|
options[:directory] = name
|
21
23
|
end
|
22
24
|
|
23
|
-
# This define the ruby
|
24
|
-
options[:
|
25
|
-
opts.on('-
|
26
|
-
options[:
|
25
|
+
# This define the ruby implementation.
|
26
|
+
options[:implementation] = '1.9.2'
|
27
|
+
opts.on('-i', '--ruby-implementation NAME', "The name of the Ruby implementation.") do |name|
|
28
|
+
options[:implementation] = name
|
27
29
|
end
|
28
30
|
|
29
|
-
# This
|
31
|
+
# This force to delete de directory if already exists.
|
30
32
|
options[:force] = false
|
31
33
|
opts.on('-f', '--force', "Delete directory if already exists.") do
|
32
34
|
options[:force] = true
|
33
35
|
end
|
34
36
|
|
35
|
-
|
37
|
+
# Verbose mode
|
38
|
+
options[:verbose] = false
|
39
|
+
opts.on('-v', '--verbose', "Print extra info.") do
|
40
|
+
options[:verbose] = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# This will print an options summary.
|
36
44
|
opts.on_tail("-h", "--help", "Show this message.") do
|
37
45
|
puts opts
|
38
46
|
exit
|
@@ -42,17 +50,18 @@ module RVMBS
|
|
42
50
|
|
43
51
|
# Directory must be set.
|
44
52
|
if options[:directory] == nil
|
45
|
-
puts optsp
|
53
|
+
puts optsp
|
46
54
|
exit
|
55
|
+
else
|
56
|
+
create_directory(options)
|
57
|
+
create_rvmrc(options)
|
58
|
+
set_rvmrc_trusted(options, Dir.pwd)
|
47
59
|
end
|
48
|
-
|
49
|
-
create_directory(options)
|
50
|
-
create_rvmrc(options)
|
51
|
-
set_rvmrc_trusted(options, Dir.pwd)
|
52
60
|
end
|
53
61
|
|
54
62
|
# Creates the directory.
|
55
63
|
def self.create_directory(options)
|
64
|
+
puts "Making new directory: #{options[:directory]}" if options[:verbose]
|
56
65
|
begin
|
57
66
|
Dir.mkdir options[:directory]
|
58
67
|
rescue
|
@@ -67,17 +76,29 @@ module RVMBS
|
|
67
76
|
|
68
77
|
# Creates the .rvmrc file.
|
69
78
|
def self.create_rvmrc(options)
|
70
|
-
|
79
|
+
puts "Creating rvmrc file" if options[:verbose]
|
80
|
+
Dir.chdir(options[:directory])
|
71
81
|
File.open(".rvmrc", "w") do |f|
|
72
|
-
f.write("rvm use --create #{options[:
|
82
|
+
f.write("rvm use --create #{options[:implementation]}@#{options[:directory]}\n")
|
73
83
|
end
|
74
|
-
Dir.chdir('..')
|
84
|
+
Dir.chdir('..')
|
75
85
|
end
|
76
86
|
|
77
87
|
# Run rvm rvmrc trust command detached from console.
|
78
88
|
def self.set_rvmrc_trusted(options, current_dir)
|
79
|
-
|
80
|
-
pid =
|
89
|
+
puts "Setting rvmrc file to trusted" if options[:verbose]
|
90
|
+
pid = daemonize do
|
91
|
+
current_dir = current_dir + "/" + options[:directory]
|
92
|
+
exit system "rvm rvmrc trust #{current_dir}/"
|
93
|
+
end
|
94
|
+
_, status = Process.waitpid2(pid)
|
95
|
+
puts "ERROR: rvm rvmrc trust command fail!" if status != 0
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
def self.daemonize
|
101
|
+
pid = fork do
|
81
102
|
if RUBY_VERSION < "1.9"
|
82
103
|
exit if fork
|
83
104
|
Process.setsid
|
@@ -89,10 +110,8 @@ module RVMBS
|
|
89
110
|
else
|
90
111
|
Process.daemon
|
91
112
|
end
|
92
|
-
|
113
|
+
yield
|
93
114
|
end
|
94
|
-
_, status = Process.waitpid2(pid)
|
95
|
-
puts "ERROR: rvm rvmrc trust command fail!" if status != 0
|
96
115
|
end
|
97
116
|
|
98
117
|
end
|
data/lib/rvmbs/version.rb
CHANGED
data/man/rvmbs.1
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "RVMBS" "1" "March 2012" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBrvmbs\fR \- RVM Bootstrap \- Command to create a project directory with a configured \.rvmrc into\.
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBrmvbs\fR \fB\-d\fR|\fB\-\-directory\fR \fIdirectory_name\fR \fB\-i\fR|\fB\-\-implementation\fR \fIruby_implementation\fR \fB\-f\fR|\fB\-\-force\fR \fB\-v\fR|\fB\-\-verbose\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
\fBrvmbs\fR is a simple command\-line tool for creating ruby project directorys with a basic rvm configuration\. By default (without any parameters) create and \.rvmrc file in the current directory with the 1\.9\.2 implementationr and a gemset named equal to de current directory name\. The \.rvmrc file is also trusted\.
|
14
|
+
.
|
15
|
+
.SH "OPTIONS"
|
16
|
+
.
|
17
|
+
.IP "\(bu" 4
|
18
|
+
\fB\-d\fR, \fB\-\-directory\fR Directory name of the project\.
|
19
|
+
.
|
20
|
+
.IP "\(bu" 4
|
21
|
+
\fB\-i\fR, \fB\-\-implementation\fR The ruby implementation name, e\.g\., 1\.9\.2, jruby
|
22
|
+
.
|
23
|
+
.IP "\(bu" 4
|
24
|
+
\fB\-f\fR, \fB\-\-force\fR Delete directory if already exist\.
|
25
|
+
.
|
26
|
+
.IP "\(bu" 4
|
27
|
+
\fB\-v\fR, \fB\-\-verbose\fR Prints extra info\.
|
28
|
+
.
|
29
|
+
.IP "" 0
|
30
|
+
.
|
31
|
+
.SH "EXAMPLES"
|
32
|
+
Create a directory \'hello_world\' and a gemset named \'hello_world\' with implementation MRI 1\.9\.2 (default)
|
33
|
+
.
|
34
|
+
.P
|
35
|
+
$ rvmbs \-d hello_world
|
36
|
+
.
|
37
|
+
.P
|
38
|
+
Create a directory \'dog\' and a gemset named \'dog\' with implementation jruby
|
39
|
+
.
|
40
|
+
.P
|
41
|
+
$ rvmbs \-d dog \-i jruby
|
data/man/rvmbs.1.html
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>rvmbs(1) - RVM Bootstrap - Command to create a project directory with a configured .rvmrc into.</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#SYNOPSIS">SYNOPSIS</a>
|
58
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
59
|
+
<a href="#OPTIONS">OPTIONS</a>
|
60
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<ol class='man-decor man-head man head'>
|
64
|
+
<li class='tl'>rvmbs(1)</li>
|
65
|
+
<li class='tc'></li>
|
66
|
+
<li class='tr'>rvmbs(1)</li>
|
67
|
+
</ol>
|
68
|
+
|
69
|
+
<h2 id="NAME">NAME</h2>
|
70
|
+
<p class="man-name">
|
71
|
+
<code>rvmbs</code> - <span class="man-whatis">RVM Bootstrap - Command to create a project directory with a configured .rvmrc into.</span>
|
72
|
+
</p>
|
73
|
+
|
74
|
+
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
75
|
+
|
76
|
+
<p><code>rmvbs</code> <code>-d</code>|<code>--directory</code> <var>directory_name</var> <code>-i</code>|<code>--implementation</code> <var>ruby_implementation</var> <code>-f</code>|<code>--force</code> <code>-v</code>|<code>--verbose</code></p>
|
77
|
+
|
78
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
79
|
+
|
80
|
+
<p><strong>rvmbs</strong> is a simple command-line tool for creating ruby project directorys
|
81
|
+
with a basic rvm configuration. By default (without any parameters) create
|
82
|
+
and .rvmrc file in the current directory with the 1.9.2 implementationr and a
|
83
|
+
gemset named equal to de current directory name. The .rvmrc file is also trusted.</p>
|
84
|
+
|
85
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
86
|
+
|
87
|
+
<ul>
|
88
|
+
<li><p><code>-d</code>, <code>--directory</code>
|
89
|
+
Directory name of the project.</p></li>
|
90
|
+
<li><p><code>-i</code>, <code>--implementation</code>
|
91
|
+
The ruby implementation name, e.g., 1.9.2, jruby</p></li>
|
92
|
+
<li><p><code>-f</code>, <code>--force</code>
|
93
|
+
Delete directory if already exist.</p></li>
|
94
|
+
<li><p><code>-v</code>, <code>--verbose</code>
|
95
|
+
Prints extra info.</p></li>
|
96
|
+
</ul>
|
97
|
+
|
98
|
+
|
99
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
100
|
+
|
101
|
+
<p>Create a directory 'hello_world' and a gemset named 'hello_world' with implementation MRI 1.9.2 (default)</p>
|
102
|
+
|
103
|
+
<p> $ rvmbs -d hello_world</p>
|
104
|
+
|
105
|
+
<p>Create a directory 'dog' and a gemset named 'dog' with implementation jruby</p>
|
106
|
+
|
107
|
+
<p> $ rvmbs -d dog -i jruby</p>
|
108
|
+
|
109
|
+
|
110
|
+
<ol class='man-decor man-foot man foot'>
|
111
|
+
<li class='tl'></li>
|
112
|
+
<li class='tc'>March 2012</li>
|
113
|
+
<li class='tr'>rvmbs(1)</li>
|
114
|
+
</ol>
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</body>
|
118
|
+
</html>
|
data/man/rvmbs.1.ronn
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
rvmbs(1) -- RVM Bootstrap - Command to create a project directory with a configured .rvmrc into.
|
2
|
+
================================================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`rmvbs` `-d`|`--directory` <directory_name> `-i`|`--implementation` <ruby_implementation> `-f`|`--force` `-v`|`--verbose`
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
**rvmbs** is a simple command-line tool for creating ruby project directorys
|
11
|
+
with a basic rvm configuration. By default (without any parameters) create
|
12
|
+
and .rvmrc file in the current directory with the 1.9.2 implementationr and a
|
13
|
+
gemset named equal to de current directory name. The .rvmrc file is also trusted.
|
14
|
+
|
15
|
+
## OPTIONS
|
16
|
+
|
17
|
+
* `-d`, `--directory`
|
18
|
+
Directory name of the project.
|
19
|
+
|
20
|
+
* `-i`, `--implementation`
|
21
|
+
The ruby implementation name, e.g., 1.9.2, jruby
|
22
|
+
|
23
|
+
* `-f`, `--force`
|
24
|
+
Delete directory if already exist.
|
25
|
+
|
26
|
+
* `-v`, `--verbose`
|
27
|
+
Prints extra info.
|
28
|
+
|
29
|
+
## EXAMPLES
|
30
|
+
|
31
|
+
Create a directory 'hello_world' and a gemset named 'hello_world' with implementation MRI 1.9.2 (default)
|
32
|
+
|
33
|
+
$ rvmbs -d hello_world
|
34
|
+
|
35
|
+
Create a directory 'dog' and a gemset named 'dog' with implementation jruby
|
36
|
+
|
37
|
+
$ rvmbs -d dog -i jruby
|
38
|
+
|
data/rvmbs.gemspec
CHANGED
@@ -9,14 +9,15 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["jolisper@gmail.com"]
|
10
10
|
s.homepage = "http://github.com/jolisper/rvmbs"
|
11
11
|
s.summary = %q{RVM Bootstrap}
|
12
|
-
s.description = %q{Command to create a project directory with a configured .rvmrc into.}
|
12
|
+
s.description = %q{RVM Bootstrap - Command to create a project directory with a configured .rvmrc into.}
|
13
13
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
#
|
20
|
-
|
21
|
-
|
19
|
+
# Development dependencies:
|
20
|
+
s.add_development_dependency "gem-man"
|
21
|
+
s.add_development_dependency "ronn"
|
22
|
+
|
22
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rvmbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,9 +9,32 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
14
|
-
|
12
|
+
date: 2012-03-05 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gem-man
|
16
|
+
requirement: &21910480 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *21910480
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: ronn
|
27
|
+
requirement: &21910060 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *21910060
|
36
|
+
description: RVM Bootstrap - Command to create a project directory with a configured
|
37
|
+
.rvmrc into.
|
15
38
|
email:
|
16
39
|
- jolisper@gmail.com
|
17
40
|
executables:
|
@@ -30,6 +53,9 @@ files:
|
|
30
53
|
- bin/rvmbs
|
31
54
|
- lib/rvmbs.rb
|
32
55
|
- lib/rvmbs/version.rb
|
56
|
+
- man/rvmbs.1
|
57
|
+
- man/rvmbs.1.html
|
58
|
+
- man/rvmbs.1.ronn
|
33
59
|
- rvmbs.gemspec
|
34
60
|
homepage: http://github.com/jolisper/rvmbs
|
35
61
|
licenses: []
|