diff options
author | Eric Wong <e@80x24.org> | 2015-01-10 04:27:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-01-10 04:34:03 +0000 |
commit | c0d431d22ee1e2e69338189f9ce5a4b4abc07e6e (patch) | |
tree | 007022f0869232880d196efe6353aef71d0ba449 /Rakefile | |
parent | 633b984a41cc3b036b47982ad72b5658ec54c918 (diff) | |
download | rainbows-c0d431d22ee1e2e69338189f9ce5a4b4abc07e6e.tar.gz |
wrongdoc was difficult to maintain because of the tidy-ffi dependency and the HTML5 changes in Darkfish could not be handled well by Tidy. olddoc is superior as it generates leaner HTML which loads faster, requires less scrolling and less processing power to render. Aesthetic comparisons are subjective of course but completely unimportant compared to speed and accessibility. The presence of images and CSS on the old (Darkfish-based) site probably set unreasonable expectations as to my ability and willingness to view such things. No more, the new website is entirely simple HTML which renders well with even the wimpiest browser (hell, olddoc even tries to generate readable raw HTML).
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 58de7fb..0000000 --- a/Rakefile +++ /dev/null @@ -1,71 +0,0 @@ -# -*- encoding: binary -*- -autoload :Gem, 'rubygems' -autoload :Tempfile, 'tempfile' -require 'wrongdoc' - -cgit_url = Wrongdoc.config[:cgit_url] -git_url = Wrongdoc.config[:git_url] - -desc "read news article from STDIN and post to rubyforge" -task :publish_news do - require 'rubyforge' - spec = Gem::Specification.load('rainbows.gemspec') - tmp = Tempfile.new('rf-news') - _, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3) - tmp.puts subject - tmp.puts - tmp.puts spec.description.strip - tmp.puts "" - tmp.puts "* #{spec.homepage}" - tmp.puts "* #{spec.email}" - tmp.puts "* #{git_url}" - tmp.print "\nChanges:\n\n" - tmp.puts body - tmp.flush - system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?" - msg = File.readlines(tmp.path) - subject = msg.shift - blank = msg.shift - blank == "\n" or abort "no newline after subject!" - subject.strip! - body = msg.join("").strip! - - rf = RubyForge.new.configure - rf.login - rf.post_news('rainbows', subject, body) -end - -desc "post to FM" -task :fm_update do - require 'net/http' - require 'net/netrc' - require 'json' - version = ENV['VERSION'] or abort "VERSION= needed" - uri = URI.parse('https://freecode.com/projects/rainbows/releases.json') - rc = Net::Netrc.locate('rainbows-fm') or abort "~/.netrc not found" - api_token = rc.password - _, subject, body = `git cat-file tag v#{version}`.split(/\n\n/, 3) - tmp = Tempfile.new('fm-changelog') - tmp.puts subject - tmp.puts - tmp.puts body - tmp.flush - system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?" - changelog = File.read(tmp.path).strip - - req = { - "auth_code" => api_token, - "release" => { - "tag_list" => "Stable", - "version" => version, - "changelog" => changelog, - }, - }.to_json - if ! changelog.strip.empty? && version =~ %r{\A[\d\.]+\d+\z} - Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http| - p http.post(uri.path, req, {'Content-Type'=>'application/json'}) - end - else - warn "not updating freshmeat for v#{version}" - end -end |