Permalink
Browse files

Merge branch 'master' into spec-activerecord

Conflicts:
	gemspec.rb
	spec/spec_helper.rb
  • Loading branch information...
winton committed Jan 28, 2010
2 parents 86ab5d7 + a528d46 commit 79840353ba21eb63cd7a983f4d11b9144a5c7687
Showing with 61 additions and 74 deletions.
  1. +1 −1 README.markdown
  2. +3 −31 Rakefile
  3. +2 −2 bin/gem_template
  4. +6 −0 config/database.yml
  5. +38 −0 config/dep.rb
  6. +0 −19 gemspec.rb
  7. +2 −1 lib/gem_template.rb
  8. +6 −0 log/development.log
  9. +0 −1 spec/spec.opts
  10. +3 −19 spec/spec_helper.rb
View
@@ -7,7 +7,7 @@ Requirements
------------
<pre>
-sudo gem install stencil --source http://gemcutter.org
+sudo gem install stencil
</pre>
Setup the template
View
@@ -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)
@@ -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
View
@@ -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!
View
@@ -0,0 +1,6 @@
+development:
+ adapter: mysql
+ database: gem_template
+ username: root
+ password:
+ host: localhost
View
@@ -0,0 +1,38 @@
+require 'rubygems'
+require 'dep'
+
+Dep do
+ gem(:active_wrapper, '=0.2.3') { require 'active_wrapper' }
+ gem :dep, '=0.1.2'
+ gem(:rake, '=0.8.7') { require 'rake' }
+ gem :rspec, '=1.3.0'
+
+ gemspec do
+ author 'Winton Welsh'
+ dependencies do
+ gem :dep
+ end
+ 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
+
+ bin { require 'lib/gem_template' }
+ lib { require 'lib/gem_template/gem_template' }
+
+ rakefile do
+ gem(:active_wrapper)
+ gem(:rake) { require 'rake/gempackagetask' }
+ gem(:rspec) { require 'spec/rake/spectask' }
+ require 'dep/tasks'
+ end
+
+ spec_helper do
+ require 'dep/spec_helper'
+ require 'lib/gem_template'
+ require 'pp'
+ end
+end
View
@@ -1,19 +0,0 @@
-GEM_NAME = 'gem_template'
-GEM_FILES = FileList['**/*'] - FileList['coverage', 'coverage/**/*', 'pkg', 'pkg/**/*']
-GEM_SPEC = Gem::Specification.new do |s|
- # == CONFIGURE ==
- s.author = "Winton Welsh"
- s.email = "mail@wintoni.us"
- s.homepage = "http://github.com/winton/#{GEM_NAME}"
- s.summary = ""
- # == CONFIGURE ==
- s.add_dependency('winton-active_wrapper', '>=0.1.2')
- s.executables << GEM_NAME
- s.extra_rdoc_files = [ "README.markdown" ]
- s.files = GEM_FILES.to_a
- s.has_rdoc = false
- s.name = GEM_NAME
- s.platform = Gem::Platform::RUBY
- s.require_path = "lib"
- s.version = "0.1.0"
-end
View
@@ -1 +1,2 @@
-require File.dirname(__FILE__) + "/gem_template/gem_template"
+require File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
+Dep.lib!
View
@@ -0,0 +1,6 @@
+ SQL (0.2ms) SET SQL_AUTO_IS_NULL=0
+ User Load (59.6ms) SELECT * FROM `users` ORDER BY users.id DESC LIMIT 1
+ User Columns (21.6ms) SHOW FIELDS FROM `users`
+ SQL (0.3ms) SET SQL_AUTO_IS_NULL=0
+ SQL (0.3ms) SHOW TABLES
+ User Columns (13.0ms) SHOW FIELDS FROM `users`
View
@@ -1 +0,0 @@
---color
View
@@ -1,26 +1,10 @@
-$testing = true
-SPEC = File.dirname(__FILE__)
-
-$:.unshift SPEC
-$:.unshift File.expand_path("#{SPEC}/../lib")
-
-require 'gem_template'
-require 'pp'
-
-require 'rubygems'
-require 'active_wrapper'
+require File.expand_path("#{File.dirname(__FILE__)}/../config/dep")
+Dep.spec_helper!
Spec::Runner.configure do |config|
$db, $log, $mail = ActiveWrapper.new(
:base => File.dirname(__FILE__),
:env => ENV['ENV']
)
$db.establish_connection
-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 7984035

Please sign in to comment.