diff options
author | AJ Christensen <aj@opscode.com> | 2009-03-11 13:32:10 -0700 |
---|---|---|
committer | AJ Christensen <aj@junglist.gen.nz> | 2009-05-12 16:08:08 +1200 |
commit | dcb2f0f89e0f19bfd82f890e359d28e476f784f6 (patch) | |
tree | 0dc771c6235d08d780db6f759f0ebfc124de9b5d /Rakefile | |
parent | a136f9823b8b0fa01da4e758e64c89bbab0036dc (diff) | |
download | mixlib-log-dcb2f0f89e0f19bfd82f890e359d28e476f784f6.tar.gz |
Convert to jeweler
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 97 |
1 files changed, 43 insertions, 54 deletions
@@ -1,67 +1,56 @@ require 'rubygems' -require 'rake/gempackagetask' -require 'rubygems/specification' -require 'date' -require 'spec/rake/spectask' -require 'cucumber/rake/task' - -GEM = "mixlib-log" -GEM_VERSION = "0.0.1" -AUTHOR = "Opscode, Inc." -EMAIL = "info@opscode.com" -HOMEPAGE = "http://www.opscode.com" -SUMMARY = "A gem that provides a simple mixin for log functionality" - -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", "LICENSE", 'TODO'] - 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 Rakefile TODO) + Dir.glob("{lib,spec}/**/*") +require 'rake' + +begin + require 'jeweler' + Jeweler::Tasks.new do |gem| + gem.name = "mixlib-log" + gem.summary = "A gem that provides a simple mixin for log functionality" + gem.email = "info@opscode.com" + gem.homepage = "http://www.opscode.com" + gem.authors = ["Opscode, Inc."] + + # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings + end +rescue LoadError + puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" end -task :default => :test - -desc "Run specs" -Spec::Rake::SpecTask.new do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.spec_opts = %w(-fs --color) +require 'spec/rake/spectask' +Spec::Rake::SpecTask.new(:spec) do |spec| + spec.libs << 'lib' << 'spec' + spec.spec_files = FileList['spec/**/*_spec.rb'] end - -Rake::GemPackageTask.new(spec) do |pkg| - pkg.gem_spec = spec +Spec::Rake::SpecTask.new(:rcov) do |spec| + spec.libs << 'lib' << 'spec' + spec.pattern = 'spec/**/*_spec.rb' + spec.rcov = true end -desc "install the gem locally" -task :install => [:package] do - sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}} +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 "create a gemspec file" -task :make_spec do - File.open("#{GEM}.gemspec", "w") do |file| - file.puts spec.to_ruby +task :default => :spec + +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 -end -Cucumber::Rake::Task.new(:features) do |t| - t.step_pattern = 'features/steps/**/*.rb' - supportdir = 'features/support' - t.cucumber_opts = "--format pretty -r #{supportdir}" + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "mixlib-log #{version}" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') end -desc "Run the spec and features" -task :test => [ :features, :spec ]
\ No newline at end of file |