summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorAJ Christensen <aj@opscode.com>2009-03-25 14:25:44 -0700
committerAJ Christensen <aj@junglist.gen.nz>2009-05-12 16:05:35 +1200
commit97884c4b76970015cb46420ab420d05403d0742e (patch)
tree87b3d7654e033e1a2820e47edc63aaf118354827 /Rakefile
parente5fdd8ab3aa158c9264ebc3fb5e61df1e99bc874 (diff)
downloadmixlib-cli-97884c4b76970015cb46420ab420d05403d0742e.tar.gz
Convert mixlib-cli to jeweler.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile92
1 files changed, 43 insertions, 49 deletions
diff --git a/Rakefile b/Rakefile
index 058ed05..6de192e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,60 +1,54 @@
require 'rubygems'
-require 'rake/gempackagetask'
-require 'rubygems/specification'
-require 'date'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "mixlib-cli"
+ gem.summary = "A simple mixin for CLI interfaces, including option parsing"
+ gem.email = "info@opscode.com"
+ gem.homepage = "http://www.opscode.com"
+ gem.authors = ["Opscode, Inc."]
+ end
+rescue LoadError
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
+end
+
require 'spec/rake/spectask'
-require 'cucumber/rake/task'
-
-GEM = "mixlib-cli"
-GEM_VERSION = "1.0.0"
-AUTHOR = "Opscode, Inc."
-EMAIL = "info@opscode.com"
-HOMEPAGE = "http://www.opscode.com"
-SUMMARY = "A simple mixin for CLI interfaces, including option parsing"
-
-spec = Gem::Specification.new do |s|
- s.name = GEM
- s.version = GEM_VERSION
- s.platform = Gem::Platform::RUBY
- s.has_rdoc = true
- s.extra_rdoc_files = ["README.rdoc", "LICENSE", "NOTIFY" ]
- s.summary = SUMMARY
- s.description = s.summary
- s.author = AUTHOR
- s.email = EMAIL
- s.homepage = HOMEPAGE
-
- # Uncomment this to add a dependency
- # s.add_dependency "foo"
-
- s.require_path = 'lib'
- s.autorequire = GEM
- s.files = %w(LICENSE README.rdoc Rakefile NOTIFY) + Dir.glob("{lib,spec}/**/*")
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
end
-task :default => :test
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
+end
-desc "Run specs"
-Spec::Rake::SpecTask.new do |t|
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.spec_opts = %w(-fs --color)
+begin
+ require 'cucumber/rake/task'
+ Cucumber::Rake::Task.new(:features)
+rescue LoadError
+ task :features do
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
+ end
end
-desc "Run the spec"
-task :test => [ :spec ]
+task :default => :spec
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
-end
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
+ end
-desc "install the gem locally"
-task :install => [:package] do
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "mixlib-cli #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
-desc "create a gemspec file"
-task :make_spec do
- File.open("#{GEM}.gemspec", "w") do |file|
- file.puts spec.to_ruby
- end
-end \ No newline at end of file