Rakefile in s_mail-0.1.2 vs Rakefile in s_mail-0.1.3

- old
+ new

@@ -1,6 +1,48 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" +require 'rake' +require 'json' +require 'uri' + +desc "Run all specs" + RSpec::Core::RakeTask.new(:spec) task :default => :spec + +###################################################### + +require 'rake' +require 'rake/clean' +require 'rubygems' +require 'rubygems/package_task' +require 'fileutils' + + +Gem::PackageTask.new(eval File.read('smail.gemspec')) do |p| + p.need_tar = true if RUBY_PLATFORM !~ /mswin/ +end + +task :install => [ :package ] do + sh %{sudo gem install pkg/#{name}-#{version}.gem} +end + +task :uninstall => [ :clean ] do + sh %{sudo gem uninstall #{name}} +end + +desc "Print all authors from git history" +task :authors do + token = `cat ~/.github_token`.chomp + authors = `git log |grep Author |cut -f 1 -d'<' |cut -f2 -d':' |sort -u` + authors.split(/\n/).each do |a| + print "* #{a} " + ainfo = JSON.parse `curl -u #{token}:x-oauth-basic --silent https://api.github.com/search/users?q=#{URI.encode a}` + puts ainfo unless ainfo['total_count'] + (puts; next) unless ainfo && ainfo['total_count'] > 0 + puts "[@#{ainfo['items'][0]['login']}](#{ainfo['items'][0]['html_url']})" + end +end + +CLEAN.include [ 'pkg', '*.gem', '.config' ]