diff --git a/Rakefile b/Rakefile index 6606e08..f3e58c5 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,10 @@ -require 'rubygems' -require 'rubygems/specification' require 'rake' require 'rake/gempackagetask' -require 'spec/rake/spectask' GEM = "gemhub" GEM_VERSION = "0.5.0" SUMMARY = "Simple gem creation" +DESCRIPTION = "Create your gems in a spartan way!" AUTHOR = "Diego Carrion" EMAIL = "dc.rec1@gmail.com" HOMEPAGE = "http://www.diegocarrion.com" @@ -16,6 +14,7 @@ spec = Gem::Specification.new do |s| s.version = GEM_VERSION s.platform = Gem::Platform::RUBY s.summary = SUMMARY + s.description = DESCRIPTION s.require_paths = ['app_generators', 'bin', 'lib'] s.files = FileList['app_generators/**/*', 'bin/*', 'lib/**/*.rb', '[A-Z]*'].to_a s.executables = ["gemhub"] @@ -27,11 +26,6 @@ spec = Gem::Specification.new do |s| s.homepage = HOMEPAGE end -Spec::Rake::SpecTask.new do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.spec_opts = %w(-fs --color) -end - Rake::GemPackageTask.new(spec) do |pkg| pkg.gem_spec = spec end @@ -47,3 +41,16 @@ task :make_spec do file.puts spec.to_ruby end end + +begin + require 'spec/rake/spectask' + Spec::Rake::SpecTask.new do |t| + t.spec_files = FileList['spec/**/*_spec.rb'] + t.spec_opts = %w(-fs --color) + end +rescue LoadError => ex + desc 'rspec rake task not available (rspec not installed)' + task :spec do + abort 'RSpec rake task is not available. Be sure to install rspec as a gem.' + end +end