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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c95c3b5510e19d487ca8ca3bb986b40e33e1d728
4
- data.tar.gz: b3008d259bc017992b30b858966931898604e188
3
+ metadata.gz: 6a0145ffe4ae1bb87a3cdd05263da382545b235b
4
+ data.tar.gz: ff2dcf5b25f47546d0c2276395d1819a4883dce4
5
5
  SHA512:
6
- metadata.gz: aef1ab11ebd307d0508d68e4ab6d5b903ee39cd4d8063d009e77d93f69b619594906c3866e6d7879c8055cfb44941de13bd12bcde1aaf1d1ce7af17b5690566d
7
- data.tar.gz: 31259b70d5de902ba99e50f6ea73831e93800167e0d954abe2b64210c39f56370d42a65e1929c7009817b974f69c3e2478b1badc345c9a8919ab7fabd05b779f
6
+ metadata.gz: 1e1c5913a480e64ae8775c4a7c42d9280564a77baf2d956a4d3de3fe987c4e451fed1147053130d16f996c05dc6f77551f9f43d992b16a5b6bc6e826f4f826ce
7
+ data.tar.gz: da5381885c60faf78ee627bf022f6e51908a998dd7e39c6db82aae87515b58caabba4240f1665e0e6cd4ee2eaf4955d2b3685fc20ea0d2124a783ac288a28e8a
@@ -3,7 +3,7 @@ module RScaffold
3
3
  class Version
4
4
  MAJOR = 0
5
5
  MINOR = 0
6
- PATCH = 3
6
+ PATCH = 4
7
7
 
8
8
  class << self
9
9
  def to_s
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",
@@ -1,6 +1,6 @@
1
1
  require './lib/<%=@name%>'
2
2
 
3
- Gem::Specification.new do |s|
3
+ @spec = Gem::Specification.new do |s|
4
4
  s.name = '<%=@name%>'
5
5
  s.version = <%=@camel%>::VERSION
6
6
  s.date = '<%=@today%>'
@@ -1,4 +1,4 @@
1
- v = File.join(File.expand_path(File.dirname(__FILE__)), '<%=@name%>/version.rb'
1
+ v = File.join(File.expand_path(File.dirname(__FILE__)), '<%=@name%>/version.rb')
2
2
  require v
3
3
 
4
4
  module <%=@camel%>
@@ -1,6 +1,7 @@
1
+ require 'erb'
1
2
  require 'rspec/core/rake_task'
2
3
  require 'rake/clean'
3
- load 'lib/<%=@name%>.rb'
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
- `cp #{READMESRC} #{README}`
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
@@ -17,7 +17,7 @@ or if you want the man page installed:
17
17
 
18
18
  Runtime Requirements
19
19
  ---------
20
- ruby >= <%=@req_rubyver%>
20
+ ruby >= <%=@erb_required_ruby_version%>
21
21
 
22
22
  Build Requirements
23
23
  ---------
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-03-28'
7
- s.required_ruby_version = '>=1.8.7'
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.3
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-03-28 00:00:00.000000000 Z
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.8.7
53
+ version: 1.9.2
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="