Skip to content

Commit

Permalink
add Tilt::VERSION and update gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Oct 17, 2009
1 parent f7bcad2 commit 531c141
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
14 changes: 8 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ desc 'Generate test coverage report'
task :rcov do
sh "rcov -Ilib:test test/*_test.rb"
end

desc 'Run specs with unit test style output'
task :test do |t|
sh 'bacon -qa'
Expand All @@ -18,11 +19,8 @@ end

# PACKAGING =================================================================

# load gemspec like github's gem builder to surface any SAFE issues.
Thread.new do
require 'rubygems/specification'
$spec = eval("$SAFE=3\n#{File.read('tilt.gemspec')}")
end.join
require 'rubygems/specification'
$spec ||= eval(File.read('tilt.gemspec'))

def package(ext='')
"dist/tilt-#{$spec.version}" + ext
Expand Down Expand Up @@ -58,8 +56,12 @@ end
# GEMSPEC ===================================================================

file 'tilt.gemspec' => FileList['{lib,test}/**','Rakefile'] do |f|
# read version from tilt.rb
version = File.read('lib/tilt.rb')[/VERSION = '(.*)'/] && $1
# read spec file and split out manifest section
spec = File.read(f.name)
spec = File.
read(f.name).
sub(/s\.version\s*=\s*'.*'/, "s.version = '#{version}'")
parts = spec.split(" # = MANIFEST =\n")
# determine file list from git ls-files
files = `git ls-files`.
Expand Down
2 changes: 2 additions & 0 deletions lib/tilt.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Tilt
VERSION = '0.3'

@template_mappings = {}

# Hash of template path pattern => template implementation
Expand Down
8 changes: 6 additions & 2 deletions tilt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=

s.name = 'tilt'
s.version = '0.2'
s.date = '2009-06-07'
s.version = '0.3'
s.date = '2009-10-16'

s.description = "Generic interface to multiple Ruby template engines"
s.summary = s.description
Expand All @@ -17,13 +17,17 @@ Gem::Specification.new do |s|
COPYING
README.md
Rakefile
TEMPLATES.md
bin/tilt
lib/tilt.rb
test/.bacon
test/spec_tilt.rb
test/spec_tilt_buildertemplate.rb
test/spec_tilt_erbtemplate.rb
test/spec_tilt_erubistemplate.rb
test/spec_tilt_hamltemplate.rb
test/spec_tilt_liquid_template.rb
test/spec_tilt_mustachetemplate.rb
test/spec_tilt_rdiscount.rb
test/spec_tilt_sasstemplate.rb
test/spec_tilt_stringtemplate.rb
Expand Down

0 comments on commit 531c141

Please sign in to comment.