Skip to content

Commit

Permalink
update rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Feb 14, 2014
1 parent d6423a5 commit f9bb78e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Gemfile.lock
*.rbc
*.swp
.ruby-version
coverage
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ end

group :extra do
gem 'ZenTest'
gem 'pry'
end

group :osx do
Expand Down
40 changes: 35 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'bundler'
begin
Bundler.setup
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end

require 'rake/clean'
require 'rake/testtask'
require 'rake/extensiontask'

$:.unshift(File.join(File.dirname(__FILE__), './lib'))
require 'wapiti/version'

task :default => [:test]

Rake::ExtensionTask.new do |ext|
ext.name = 'native'
Expand All @@ -17,9 +22,34 @@ Rake::ExtensionTask.new do |ext|

CLEAN.include("#{ext.lib_dir}/native.*")
CLEAN.include("#{ext.tmp_dir}")

end

require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList['spec/**/*_spec.rb']
end

desc 'Run an IRB session with Wapiti loaded'
task :console do
require 'pry'
require 'wapiti'

Pry.start
end

task :check_warnings do
$VERBOSE = true
require 'wapiti'
puts Wapiti::VERSION
end

require 'coveralls/rake/task'
Coveralls::RakeTask.new
task :test_with_coveralls => [:spec, 'coveralls:push']

task :default => [:compile, :spec]

task :build => [:clean] do
system 'gem build wapiti.gemspec'
end
Expand Down

0 comments on commit f9bb78e

Please sign in to comment.