Skip to content

Commit

Permalink
Modernize Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
John Keiser committed Sep 11, 2013
1 parent d120491 commit c6fe829
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
require 'bundler'
require 'rubygems'
require 'rake'
require 'yaml'
require 'rubygems/package_task'
require 'rdoc/task'
require 'rspec/core/rake_task'

spec = eval(File.read("mixlib-config.gemspec"))
Bundler::GemHelper.install_tasks

Gem::PackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
task :default => :spec

begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |rspec|
rspec.pattern = 'spec/**/*_spec.rb'
end
desc "Run specs"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
end

task :default => :spec
gem_spec = eval(File.read("mixlib-config.gemspec"))

require 'rdoc/task'
RDoc::Task.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

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "mixlib-config #{version}"
rdoc.title = "mixlib-config #{gem_spec.version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end

desc "remove build files"
task :clean do
sh %Q{ rm -f pkg/*.gem }
end

desc "Run the spec and features"
task :test => [ :features, :spec ]

0 comments on commit c6fe829

Please sign in to comment.