Skip to content

Commit

Permalink
Clean at requires, and check for spec task
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Leite authored and dcrec1 committed Apr 23, 2010
1 parent 2417318 commit 4532ffc
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions 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"
Expand All @@ -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"]
Expand All @@ -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
Expand All @@ -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

0 comments on commit 4532ffc

Please sign in to comment.