Rakefile in shvets-google_translate-0.5.3 vs Rakefile in shvets-google_translate-0.5.4

- old
+ new

@@ -5,11 +5,11 @@ require 'rake/testtask' require 'spec/rake/spectask' require 'rake/rdoctask' require 'rcov/rcovtask' -SPEC = Gem::Specification.load('google-translate.gemspec') +SPEC = Gem::Specification.load('google_translate.gemspec') Rake::GemPackageTask.new(SPEC) do |pkg| pkg.need_tar = true pkg.need_zip = true end @@ -30,8 +30,28 @@ Rcov::RcovTask.new do |task| task.libs << 'test' task.test_files = FileList['test/**/*_test.rb'] task.verbose = true +end + +desc "test gem compatibility with github" +task :"github:validate" do + require 'yaml' + + require 'rubygems/specification' + data = File.read("google_translate.gemspec") + spec = nil + + if data !~ %r{!ruby/object:Gem::Specification} + Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join + else + spec = YAML.load(data) + end + + spec.validate + + puts spec + puts "OK" end task :default => :rcov