Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating gem_template to use Dep

  • Loading branch information...
commit 4e8649114b5d13c5621e793b63abc7a03751ae36 1 parent a768824
@winton authored
View
2  README.markdown
@@ -7,7 +7,7 @@ Requirements
------------
<pre>
-sudo gem install stencil --source http://gemcutter.org
+sudo gem install stencil
</pre>
Setup the template
View
34 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)
@@ -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
4 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!
View
38 config/dep.rb
@@ -0,0 +1,38 @@
+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)
+
+ 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 lib/gem_template pp)
+end
View
18 gemspec.rb
@@ -1,18 +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.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
3  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!
View
1  spec/spec.opts
@@ -1 +0,0 @@
---color
View
17 spec/spec_helper.rb
@@ -1,16 +1,5 @@
-$testing = true
-SPEC = File.dirname(__FILE__)
-$:.unshift File.expand_path("#{SPEC}/../lib")
-
-require 'gem_template'
-require 'pp'
+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 4e86491

Please sign in to comment.
Something went wrong with that request. Please try again.