Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' into rails
Browse files Browse the repository at this point in the history
Conflicts:
	spec/spec_helper.rb
  • Loading branch information
winton committed Jan 26, 2010
2 parents 9b0bac4 + 4e86491 commit 1e416d7
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 68 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -7,7 +7,7 @@ Requirements
------------

<pre>
sudo gem install stencil --source http://gemcutter.org
sudo gem install stencil
</pre>

Setup the template
Expand Down
34 changes: 3 additions & 31 deletions Rakefile
@@ -1,29 +1,7 @@
require 'rubygems'
require 'rake'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'gemspec'

desc "Generate gemspec"
task :gemspec do
File.open("#{Dir.pwd}/#{GEM_NAME}.gemspec", 'w') do |f|
f.write(GEM_SPEC.to_ruby)
end
end

desc "Install gem"
task :install do
Rake::Task['gem'].invoke
`sudo gem uninstall #{GEM_NAME} -x`
`sudo gem install pkg/#{GEM_NAME}*.gem`
`rm -Rf pkg`
end

desc "Package gem"
Rake::GemPackageTask.new(GEM_SPEC) do |pkg|
pkg.gem_spec = GEM_SPEC
end
require "#{File.dirname(__FILE__)}/config/dep"
Dep.rakefile!

# You can delete this after you use it
desc "Rename project"
task :rename do
name = ENV['NAME'] || File.basename(Dir.pwd)
Expand All @@ -42,10 +20,4 @@ task :rename do
`sed -i "" 's/gem_template/#{name}/g' #{path}`
end
end
end

desc "Run specs"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
t.spec_files = FileList["spec/**/*_spec.rb"]
end
4 changes: 2 additions & 2 deletions bin/gem_template
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby

$:.push File.expand_path("#{File.dirname(__FILE__)}/../lib")
require 'gem_template'
$:.push File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
Dep.bin!
40 changes: 40 additions & 0 deletions config/dep.rb
@@ -0,0 +1,40 @@
require 'rubygems'
require 'dep'

Dep.gem do

dep '=0.1.1'
rake '=0.8.7', :require => %w(rake)
rspec '=1.3.0'
end

Dep.gemspec do

author 'Winton Welsh'
email 'mail@wintoni.us'
name 'gem_template'
homepage "http://github.com/winton/#{name}"
root File.expand_path("#{File.dirname(__FILE__)}/../")
summary ""
version '0.1.0'
end

Dep.profile do

bin :require => %w(lib/gem_template)

gemspec do
dep
end

lib :require => %w(lib/gem_template/gem_template)

rails_init :require => %w(lib/gem_template)

rakefile :require => %w(dep/tasks) do
rake :require => %w(rake/gempackagetask)
rspec :require => %w(spec/rake/spectask)
end

spec_helper :require => %w(dep/spec_helper rails/init pp)
end
18 changes: 0 additions & 18 deletions gemspec.rb

This file was deleted.

3 changes: 2 additions & 1 deletion lib/gem_template.rb
@@ -1 +1,2 @@
require File.dirname(__FILE__) + "/gem_template/gem_template"
require File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
Dep.lib!
3 changes: 2 additions & 1 deletion rails/init.rb
@@ -1 +1,2 @@
require File.expand_path(File.dirname(__FILE__) + "/../lib/gem_template")
require File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
Dep.rails_init!
1 change: 0 additions & 1 deletion spec/spec.opts

This file was deleted.

16 changes: 3 additions & 13 deletions spec/spec_helper.rb
@@ -1,15 +1,5 @@
$testing = true
SPEC = File.dirname(__FILE__)

require 'pp'
require File.expand_path("#{SPEC}/../rails/init")
require File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
Dep.spec_helper!

Spec::Runner.configure do |config|
end

# For use with rspec textmate bundle
def debug(object)
puts "<pre>"
puts object.pretty_inspect.gsub('<', '&lt;').gsub('>', '&gt;')
puts "</pre>"
end
end

0 comments on commit 1e416d7

Please sign in to comment.