rscaffold 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rscaffold/version.rb +1 -1
- data/lib/rscaffold.rb +2 -1
- data/lib/templates/gemspec.erb +1 -1
- data/lib/templates/project.erb +1 -1
- data/lib/templates/rakefile.erb +17 -5
- data/lib/templates/readme.erb +1 -1
- data/rscaffold.gemspec +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0145ffe4ae1bb87a3cdd05263da382545b235b
|
4
|
+
data.tar.gz: ff2dcf5b25f47546d0c2276395d1819a4883dce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e1c5913a480e64ae8775c4a7c42d9280564a77baf2d956a4d3de3fe987c4e451fed1147053130d16f996c05dc6f77551f9f43d992b16a5b6bc6e826f4f826ce
|
7
|
+
data.tar.gz: da5381885c60faf78ee627bf022f6e51908a998dd7e39c6db82aae87515b58caabba4240f1665e0e6cd4ee2eaf4955d2b3685fc20ea0d2124a783ac288a28e8a
|
data/lib/rscaffold/version.rb
CHANGED
data/lib/rscaffold.rb
CHANGED
@@ -41,6 +41,7 @@ module RScaffold
|
|
41
41
|
@camel = RScaffold.camel_case @name
|
42
42
|
|
43
43
|
@cur_rubyver = '2.1'
|
44
|
+
@erb_required_ruby_version = '<%=@spec.required_ruby_version.to_s%>'
|
44
45
|
@req_rubyver = '>=1.8.7'
|
45
46
|
@license = 'MIT'
|
46
47
|
|
@@ -74,7 +75,7 @@ module RScaffold
|
|
74
75
|
:man => "man/man1/#{@bin}.1",
|
75
76
|
:project => "lib/#{@name}.rb",
|
76
77
|
:rakefile => "Rakefile",
|
77
|
-
:readme => "doc-src/README.md",
|
78
|
+
:readme => "doc-src/README.md.erb",
|
78
79
|
:rspec => ".rspec",
|
79
80
|
:spec => "spec/#{@name}_spec.rb",
|
80
81
|
:travis => ".travis.yml",
|
data/lib/templates/gemspec.erb
CHANGED
data/lib/templates/project.erb
CHANGED
data/lib/templates/rakefile.erb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
require 'erb'
|
1
2
|
require 'rspec/core/rake_task'
|
2
3
|
require 'rake/clean'
|
3
|
-
load '
|
4
|
+
load '<%=@name%>.gemspec'
|
4
5
|
|
5
6
|
RSpec::Core::RakeTask.new('spec')
|
6
7
|
|
@@ -10,13 +11,13 @@ NAME = '<%=@bin%>'
|
|
10
11
|
|
11
12
|
BIN = FileList['bin/*.rb']
|
12
13
|
GEM = "#{PROG}-#{VER}.gem"
|
13
|
-
LIB = FileList['lib/*.rb']
|
14
|
+
LIB = FileList['lib/*.rb', 'lib/*/*.rb']
|
14
15
|
MAN = FileList['man/man*/*.?']
|
15
16
|
MANDIR = '/usr/local/man/man1/'
|
16
17
|
MANFILE = "#{NAME}.1"
|
17
18
|
MANDEST = [MANDIR, MANFILE].join '/'
|
18
|
-
README = 'README.md'
|
19
|
-
READMESRC = 'doc-src/README.md'
|
19
|
+
README = FileList['README.md']
|
20
|
+
READMESRC = 'doc-src/README.md.erb'
|
20
21
|
SPEC = "#{PROG}.gemspec"
|
21
22
|
TEST = FileList['spec/*.rb']
|
22
23
|
CLEAN.include('doc', '*.gem', 'README.md')
|
@@ -34,10 +35,11 @@ file 'doc' => LIB do
|
|
34
35
|
end
|
35
36
|
|
36
37
|
task :readme => README
|
38
|
+
`git add README.md`
|
37
39
|
`git commit -m'update README' README.md`
|
38
40
|
|
39
41
|
file README =>[READMESRC, MAN].flatten do
|
40
|
-
|
42
|
+
erbify READMESRC, README
|
41
43
|
`groff -tman -Thtml #{MAN} | sed '/<html/,$!d; /<style/,/<\\/style>/d' >>#{README}`
|
42
44
|
end
|
43
45
|
|
@@ -70,3 +72,13 @@ task :uninstall do
|
|
70
72
|
`gem uninstall #{PROG}` #FIXME shell out not cool
|
71
73
|
File.delete MANDEST
|
72
74
|
end
|
75
|
+
|
76
|
+
def rendered template
|
77
|
+
ERB.new(File.read(template), nil).result binding
|
78
|
+
end
|
79
|
+
|
80
|
+
def erbify template, destination
|
81
|
+
File.open(destination.to_s, 'w') do |file|
|
82
|
+
file.write rendered template
|
83
|
+
end
|
84
|
+
end
|
data/lib/templates/readme.erb
CHANGED
data/rscaffold.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require "#{File.dirname(__FILE__)}/lib/rscaffold/version"
|
2
2
|
|
3
|
-
Gem::Specification.new do |s|
|
3
|
+
@spec = Gem::Specification.new do |s|
|
4
4
|
s.name = 'rscaffold'
|
5
5
|
s.version = RScaffold::VERSION
|
6
|
-
s.date = '2014-
|
7
|
-
s.required_ruby_version = '>=1.
|
6
|
+
s.date = '2014-04-23'
|
7
|
+
s.required_ruby_version = '>=1.9.2'
|
8
8
|
s.summary = "make a new ruby project"
|
9
9
|
s.description = "rscaffold is a similar concept to jeweler,
|
10
10
|
but is meant to be simpler and smaller."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rscaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noah Birnel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "rscaffold is a similar concept to jeweler, \n but is meant to be
|
14
14
|
simpler and smaller."
|
@@ -50,7 +50,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.9.2
|
54
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - ">="
|