Skip to content

Commit

Permalink
Merge branch 'master' into inclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
blambeau committed Jan 13, 2011
2 parents aefb7fe + 6d96948 commit cad18c5
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions Rakefile
Expand Up @@ -7,7 +7,6 @@ dir = File.dirname(__FILE__)
lib = File.join(dir, "lib", "wlang.rb")
version = File.read(lib)[/^\s*VERSION\s*=\s*(['"])(\d\.\d\.\d)\1/, 2]


task :default => [:all]
task :all => [:test, :specification, :repackage]

Expand All @@ -21,14 +20,6 @@ end
desc "Runs all tests (unit and rspec)"
task :test => [:unit, :spec]

desc "Generates rdoc documentation"
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include( "README.md", "LICENCE.md", "CHANGELOG.md", "lib/" )
rdoc.main = "README.md"
rdoc.rdoc_dir = "doc/api"
rdoc.title = "WLang Documentation"
end

desc "Generates the specification file"
task :specification do |t|
Kernel.exec("ruby -Ilib bin/wlang --methodize --output doc/specification/specification.html doc/specification/specification.wtpl")
Expand Down Expand Up @@ -56,6 +47,35 @@ Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.need_tar = true
end

#
# Install a rake task for running examples written using rspec.
#
# More information about rspec: http://relishapp.com/rspec
# This file has been written to conform to RSpec v2.4.0
#
begin
require "rspec/core/rake_task"
desc "Run RSpec code examples"
RSpec::Core::RakeTask.new(:spec) do |t|
# Glob pattern to match files.
t.pattern = 'test/spec/*.spec'

# Use verbose output. If this is set to true, the task will print the
# executed spec command to stdout.
t.verbose = true

# Command line options to pass to rspec.
# See 'rspec --help' about this
t.rspec_opts = %w{--color --backtrace}
end
rescue LoadError => ex
task :spec do
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
end
ensure
task :test => [:spec]
end

#
# Install a rake task to generate API documentation using
# yard.
Expand Down

0 comments on commit cad18c5

Please sign in to comment.