Sha256: 912d9fb8e5e2f5c9ca3c928f69f6a21bb753b85e84cce30b9a303ca627588fbb

Contents?: true

Size: 947 Bytes

Versions: 25

Compression:

Stored size: 947 Bytes

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task :default => :spec

begin
  require 'yard'
  YARD::Rake::YardocTask.new
rescue LoadError
  task :yard do
    abort 'YARD is not available. In order to run yard, you must: gem install yard'
  end
end

namespace :popolo do
  desc 'Update Popolo schemas'
  task :schemas do
    require 'base64'

    require 'octokit'

    Octokit.contents('opennorth/popolo-spec', path: 'schemas', ref: 'gh-pages').each do |file|
      response = Octokit.contents('opennorth/popolo-spec', path: file.path, ref: 'gh-pages')
      if response.encoding == 'base64'
        content = Base64.decode64(response.content)
      else
        raise "Can't handle #{response.encoding} encoding"
      end
      File.open(File.expand_path(File.join('schemas', 'popolo', file.name), __dir__), 'w') do |f|
        f.write(content)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
pupa-0.1.11 Rakefile
pupa-0.1.10 Rakefile
pupa-0.1.9 Rakefile
pupa-0.1.8 Rakefile
pupa-0.1.7 Rakefile
pupa-0.1.6 Rakefile
pupa-0.1.5 Rakefile
pupa-0.1.4 Rakefile
pupa-0.1.3 Rakefile
pupa-0.1.2 Rakefile
pupa-0.1.1 Rakefile
pupa-0.1.0 Rakefile
pupa-0.0.13 Rakefile
pupa-0.0.12 Rakefile
pupa-0.0.11 Rakefile
pupa-0.0.10 Rakefile
pupa-0.0.9 Rakefile
pupa-0.0.8 Rakefile
pupa-0.0.7 Rakefile
pupa-0.0.6 Rakefile