Sha256: c095eac8a469b450978a45670084a72db955a0157f70f0f8449c1e2f48d05a68

Contents?: true

Size: 1009 Bytes

Versions: 4

Compression:

Stored size: 1009 Bytes

Contents

namespace :enki do
  desc "Generates public/yadis.xrdf from enki.yml, for OpenID delegation"
  task :generate_yadis => :environment do
    file = "public/yadis.xrdf"
    raise "#{file} already exists, please remove it before running this task" if File.exists?(file)
    raise "open_id_delegation section not provided in config/enki.yml" unless Enki.config[:open_id_delegation]
    File.open("public/yadis.xrdf", "w") do |f|
      f.write <<-EOS
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)"
      xmlns:openid="http://openid.net/xmlns/1.0">
  <XRD>

    <Service priority="1">
      <Type>http://openid.net/signon/1.0</Type>
      <URI>#{Enki.config[:open_id_delegation, :server]}</URI>
      <openid:Delegate>#{Enki.config[:open_id_delegation, :delegate]}</openid:Delegate>
    </Service>

  </XRD>
</xrds:XRDS>
      EOS
    end
  end

  desc "Cleans out actions older than 7 days"
  task :clean_actions => :environment do
    UndoItem.delete_all(["created_at < ?", 7.days.ago])
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enki-engine-0.0.5 lib/tasks/enki.rake
enki-engine-0.0.4 lib/tasks/enki.rake
enki-engine-0.0.3 lib/tasks/enki.rake
enki-engine-0.0.2 lib/tasks/enki.rake