Rakefile in rs_232-2.0.7 vs Rakefile in rs_232-2.2.0

- old
+ new

@@ -1,47 +1,13 @@ -require 'rake' +lib = File.expand_path '../lib', __FILE__ +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include? lib require 'bundler/setup' require 'bundler/gem_tasks' +require 'rake' -Bundler::GemHelper.install_tasks +load 'tasks/clean.rake' +load 'tasks/cov.rake' +load 'tasks/rspec.rake' +load 'tasks/cucumber.rake' +load 'tasks/compile.rake' -$:.unshift(File.dirname(__FILE__) + '/lib') - -Dir['gem_tasks/**/*.rake'].each { |rake| load rake } - -require 'bundler/gem_tasks' -require 'rake/extensiontask' - -require 'rake/clean' - -CLEAN.include %w(**/*.{log} doc coverage tmp) - - -def gem_spec - @gem_spec ||= Gem::Specification.load('rs_232.gemspec') -end - - -Rake::ExtensionTask.new('rs_232', gem_spec) do |ext| - # stub -end - - -desc 'code statistics' -task :stats do - - def count(glob) - Dir[glob].inject(0) do |count, fi| - next unless File.file?(fi) - count + File.read(fi).lines.to_a.length - end - end - - rb_lines = count 'lib/**/*.rb' - c_lines = count 'ext/**/*.{c,cpp,h,hpp}' - - puts "Lines of Ruby: #{rb_lines}" - puts "Lines of C*: #{c_lines}" -end - - -task :default => [:clean, :compile] \ No newline at end of file +task default: [:clobber, :compile, :spec, :features]