rscaffold 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +112 -0
- data/lib/rscaffold/version.rb +1 -1
- data/lib/rscaffold.rb +20 -7
- data/lib/templates/gemspec.erb +1 -1
- data/lib/templates/man.erb +2 -2
- data/lib/templates/project.erb +2 -1
- data/lib/templates/rakefile.erb +7 -6
- data/lib/templates/readme.erb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c95c3b5510e19d487ca8ca3bb986b40e33e1d728
|
4
|
+
data.tar.gz: b3008d259bc017992b30b858966931898604e188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aef1ab11ebd307d0508d68e4ab6d5b903ee39cd4d8063d009e77d93f69b619594906c3866e6d7879c8055cfb44941de13bd12bcde1aaf1d1ce7af17b5690566d
|
7
|
+
data.tar.gz: 31259b70d5de902ba99e50f6ea73831e93800167e0d954abe2b64210c39f56370d42a65e1929c7009817b974f69c3e2478b1badc345c9a8919ab7fabd05b779f
|
data/README.md
CHANGED
@@ -33,3 +33,115 @@ MIT license
|
|
33
33
|
|
34
34
|
[![Build Status](https://travis-ci.org/nbirnel/rscaffold.png?branch=master)](https://travis-ci.org/nbirnel/rscaffold)
|
35
35
|
[![Code Climate](https://codeclimate.com/github/nbirnel/rscaffold.png)](https://codeclimate.com/github/nbirnel/rscaffold)
|
36
|
+
<html>
|
37
|
+
<head>
|
38
|
+
<meta name="generator" content="groff -Thtml, see www.gnu.org">
|
39
|
+
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
40
|
+
<meta name="Content-Style" content="text/css">
|
41
|
+
<title>rscaffold</title>
|
42
|
+
|
43
|
+
</head>
|
44
|
+
<body>
|
45
|
+
|
46
|
+
<h1 align="center">rscaffold</h1>
|
47
|
+
|
48
|
+
<a href="#NAME">NAME</a><br>
|
49
|
+
<a href="#SYNOPSIS">SYNOPSIS</a><br>
|
50
|
+
<a href="#DESCRIPTION">DESCRIPTION</a><br>
|
51
|
+
<a href="#OPTIONS">OPTIONS</a><br>
|
52
|
+
<a href="#EXAMPLES">EXAMPLES</a><br>
|
53
|
+
<a href="#FILES">FILES</a><br>
|
54
|
+
<a href="#SEE ALSO">SEE ALSO</a><br>
|
55
|
+
<a href="#BUGS">BUGS</a><br>
|
56
|
+
<a href="#LICENSE">LICENSE</a><br>
|
57
|
+
|
58
|
+
<hr>
|
59
|
+
|
60
|
+
|
61
|
+
<h2>NAME
|
62
|
+
<a name="NAME"></a>
|
63
|
+
</h2>
|
64
|
+
|
65
|
+
|
66
|
+
<p style="margin-left:11%; margin-top: 1em">rscaffold
|
67
|
+
− generate scaffolding for a ruby gem</p>
|
68
|
+
|
69
|
+
<h2>SYNOPSIS
|
70
|
+
<a name="SYNOPSIS"></a>
|
71
|
+
</h2>
|
72
|
+
|
73
|
+
|
74
|
+
<p style="margin-left:11%; margin-top: 1em"><b>rscaffold
|
75
|
+
PROJECT_NAME</b></p>
|
76
|
+
|
77
|
+
<h2>DESCRIPTION
|
78
|
+
<a name="DESCRIPTION"></a>
|
79
|
+
</h2>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<p style="margin-left:11%; margin-top: 1em"><b>rscaffold</b>
|
84
|
+
generates most things you would want in a basic ruby
|
85
|
+
project.</p>
|
86
|
+
|
87
|
+
<h2>OPTIONS
|
88
|
+
<a name="OPTIONS"></a>
|
89
|
+
</h2>
|
90
|
+
|
91
|
+
|
92
|
+
<p style="margin-left:11%; margin-top: 1em"><b>--help</b>
|
93
|
+
Print a brief usage message.</p>
|
94
|
+
|
95
|
+
<h2>EXAMPLES
|
96
|
+
<a name="EXAMPLES"></a>
|
97
|
+
</h2>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<p style="margin-left:11%; margin-top: 1em"><b>rscaffold</b></p>
|
102
|
+
|
103
|
+
<h2>FILES
|
104
|
+
<a name="FILES"></a>
|
105
|
+
</h2>
|
106
|
+
|
107
|
+
|
108
|
+
<h2>SEE ALSO
|
109
|
+
<a name="SEE ALSO"></a>
|
110
|
+
</h2>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<p style="margin-left:11%; margin-top: 1em"><b>ruby(1)</b></p>
|
115
|
+
|
116
|
+
<table width="100%" border="0" rules="none" frame="void"
|
117
|
+
cellspacing="0" cellpadding="0">
|
118
|
+
<tr valign="top" align="left">
|
119
|
+
<td width="11%"></td>
|
120
|
+
<td width="6%">
|
121
|
+
|
122
|
+
|
123
|
+
<h2>BUGS
|
124
|
+
<a name="BUGS"></a>
|
125
|
+
</h2>
|
126
|
+
</td>
|
127
|
+
<td width="5%"></td>
|
128
|
+
<td width="13%">
|
129
|
+
|
130
|
+
|
131
|
+
<p style="margin-top: 1em">Probably.</p></td>
|
132
|
+
<td width="65%">
|
133
|
+
</td></tr>
|
134
|
+
</table>
|
135
|
+
|
136
|
+
<h2>LICENSE
|
137
|
+
<a name="LICENSE"></a>
|
138
|
+
</h2>
|
139
|
+
|
140
|
+
|
141
|
+
<p style="margin-left:11%; margin-top: 1em">Copyright Noah
|
142
|
+
Birnel</p>
|
143
|
+
|
144
|
+
<p style="margin-left:11%; margin-top: 1em">MIT License</p>
|
145
|
+
<hr>
|
146
|
+
</body>
|
147
|
+
</html>
|
data/lib/rscaffold/version.rb
CHANGED
data/lib/rscaffold.rb
CHANGED
@@ -24,7 +24,7 @@ module RScaffold
|
|
24
24
|
owner
|
25
25
|
remote
|
26
26
|
remote_path
|
27
|
-
|
27
|
+
req_rubyver
|
28
28
|
summary
|
29
29
|
travis
|
30
30
|
usage
|
@@ -40,11 +40,12 @@ module RScaffold
|
|
40
40
|
@bin = @name
|
41
41
|
@camel = RScaffold.camel_case @name
|
42
42
|
|
43
|
-
@
|
43
|
+
@cur_rubyver = '2.1'
|
44
|
+
@req_rubyver = '>=1.8.7'
|
44
45
|
@license = 'MIT'
|
45
46
|
|
46
47
|
@today = Time.now.strftime '%Y-%m-%d'
|
47
|
-
@
|
48
|
+
@year = Time.now.year
|
48
49
|
|
49
50
|
# This disgusting thing is to work across *nix, Windows, and Cygwin.
|
50
51
|
@whoami = ( ENV["USER"] || ENV["USERNAME"] ).sub(/.*\\/, '')
|
@@ -59,9 +60,10 @@ module RScaffold
|
|
59
60
|
@codeclimate = codeclimate_of @remote_path
|
60
61
|
@gemversion = gemversion_of @name
|
61
62
|
|
62
|
-
@summary = "
|
63
|
-
@description = "
|
64
|
-
@usage = "
|
63
|
+
@summary = "#FIXME summary"
|
64
|
+
@description = "#FIXME description"
|
65
|
+
@usage = "#FIXME usage"
|
66
|
+
@website = "#FIXME website"
|
65
67
|
|
66
68
|
@location = {
|
67
69
|
:bin => "bin/#{@bin}",
|
@@ -82,7 +84,7 @@ module RScaffold
|
|
82
84
|
end
|
83
85
|
|
84
86
|
def rendered template
|
85
|
-
ERB.new(contents(template), nil
|
87
|
+
ERB.new(contents(template), nil).result binding
|
86
88
|
end
|
87
89
|
|
88
90
|
def write template
|
@@ -92,6 +94,17 @@ module RScaffold
|
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
97
|
+
def git_init
|
98
|
+
`git init`
|
99
|
+
`git add .`
|
100
|
+
`git commit -m'initial commit' -a`
|
101
|
+
end
|
102
|
+
|
103
|
+
def rvm_create
|
104
|
+
`rvm --create use #{cur_rubyver}@#{@name} --ruby-version`
|
105
|
+
`bundle install`
|
106
|
+
end
|
107
|
+
|
95
108
|
def write_all
|
96
109
|
@location.keys.each{|template| self.write(template.to_s)}
|
97
110
|
end
|
data/lib/templates/gemspec.erb
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = '<%=@name%>'
|
5
5
|
s.version = <%=@camel%>::VERSION
|
6
6
|
s.date = '<%=@today%>'
|
7
|
-
s.required_ruby_version = '<%@
|
7
|
+
s.required_ruby_version = '<%@req_rubyver%>'
|
8
8
|
s.summary = "<%=@summary%>"
|
9
9
|
s.description = "<%=@description%>"
|
10
10
|
s.authors = ['<%=@fullname%>']
|
data/lib/templates/man.erb
CHANGED
data/lib/templates/project.erb
CHANGED
data/lib/templates/rakefile.erb
CHANGED
@@ -8,18 +8,18 @@ VER = <%=@camel%>::VERSION
|
|
8
8
|
PROG = '<%=@name%>'
|
9
9
|
NAME = '<%=@bin%>'
|
10
10
|
|
11
|
-
LIB = FileList['lib/*.rb']
|
12
11
|
BIN = FileList['bin/*.rb']
|
13
|
-
TEST = FileList['spec/*.rb']
|
14
|
-
MAN = FileList['man/man*/*.?']
|
15
|
-
MANFILE = "#{NAME}.1"
|
16
|
-
SPEC = "#{PROG}.gemspec"
|
17
12
|
GEM = "#{PROG}-#{VER}.gem"
|
18
|
-
|
13
|
+
LIB = FileList['lib/*.rb']
|
14
|
+
MAN = FileList['man/man*/*.?']
|
19
15
|
MANDIR = '/usr/local/man/man1/'
|
16
|
+
MANFILE = "#{NAME}.1"
|
20
17
|
MANDEST = [MANDIR, MANFILE].join '/'
|
21
18
|
README = 'README.md'
|
22
19
|
READMESRC = 'doc-src/README.md'
|
20
|
+
SPEC = "#{PROG}.gemspec"
|
21
|
+
TEST = FileList['spec/*.rb']
|
22
|
+
CLEAN.include('doc', '*.gem', 'README.md')
|
23
23
|
|
24
24
|
task :all => [:spec, :install]
|
25
25
|
|
@@ -34,6 +34,7 @@ file 'doc' => LIB do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
task :readme => README
|
37
|
+
`git commit -m'update README' README.md`
|
37
38
|
|
38
39
|
file README =>[READMESRC, MAN].flatten do
|
39
40
|
`cp #{READMESRC} #{README}`
|
data/lib/templates/readme.erb
CHANGED
@@ -17,7 +17,7 @@ or if you want the man page installed:
|
|
17
17
|
|
18
18
|
Runtime Requirements
|
19
19
|
---------
|
20
|
-
ruby >=
|
20
|
+
ruby >= <%=@req_rubyver%>
|
21
21
|
|
22
22
|
Build Requirements
|
23
23
|
---------
|
@@ -33,7 +33,7 @@ Inspiration and History
|
|
33
33
|
|
34
34
|
License
|
35
35
|
---------
|
36
|
-
© <%=@
|
36
|
+
© <%=@year%> <%=@owner%>
|
37
37
|
<%=@license%> license
|
38
38
|
|
39
39
|
<%=@travis%>
|