Class: DPL::Provider::Hackage

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/hackage.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#check_appObject



12
13
14
# File 'lib/dpl/provider/hackage.rb', line 12

def check_app
  context.shell "cabal check" or raise Error, "cabal check failed"
end

#check_authObject



6
7
8
9
10
# File 'lib/dpl/provider/hackage.rb', line 6

def check_auth
  unless option(:username) and option(:password)
    raise Error, "must supply username and password"
  end
end

#needs_key?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/dpl/provider/hackage.rb', line 16

def needs_key?
  false
end

#push_appObject



20
21
22
23
24
25
# File 'lib/dpl/provider/hackage.rb', line 20

def push_app
  context.shell "cabal sdist" or raise Error, "cabal sdist failed"
  Dir.glob("dist/*.tar.gz") do |tar|
    context.shell "cabal upload --username=#{option(:username)} --password=#{option(:password)} #{tar}"
  end
end