Rakefile 648 B

1234567891011121314151617181920212223
  1. def version
  2. git_describe_tags = `git describe --tags`
  3. tag = git_describe_tags.split('-').first || git_describe_tags
  4. tag.strip!
  5. commit = `git rev-list --full-history #{tag}.. -- src/ | wc -l`.strip
  6. tag.slice! 0
  7. "#{tag}.#{commit}"
  8. end
  9. task :upload do
  10. require 'net/github-upload'
  11. gh = Net::GitHub::Upload.new(
  12. :login => `git config github.user`.chomp,
  13. :token => `git config github.token`.chomp
  14. )
  15. puts gh.upload(
  16. :repos => 'CSSOM',
  17. :file => 'build/CSSOM.js',
  18. :name => "CSSOM.v#{version}.js",
  19. :content_type => 'text/javascript',
  20. :description => "CSS Object Model implemented in pure JavaScript"
  21. )
  22. end