class CreateProj::Creator::HaskellCreator

Class for creating Haskell project

Public Class Methods

new(*args) click to toggle source
Calls superclass method CreateProj::Creator::Creator::new
# File lib/createproj/creator/haskell.rb, line 5
def initialize(*args)
  super(*args)
  @precommit_template = 'lint-pre-commit'
  @precommit_options = { linter: 'hlint', file_ext: '.hs' }
  @gitignore_files = %w(cabal.sandbox.config .cabal-sandbox)
end

Public Instance Methods

install_dependencies() click to toggle source

Installs dependencies in the new cabal sandbox

@example Installs rubocop in the gemset sandbox

install_dependencies #=> happy & hlint installed in the gemset

@return Nothing

# File lib/createproj/creator/haskell.rb, line 28
def install_dependencies
  cabals_to_install = %w(happy hlint)

  system('cabal update')

  cabals_to_install.each do |g|
    system("cabal install #{g}")
  end
end
install_sandbox() click to toggle source

Create an Haskell sandbox

@example Create rvm sandbox for project named test

install_sandbox #=> Executes `cabal sandbox init`

@return Nothing

# File lib/createproj/creator/haskell.rb, line 18
def install_sandbox
  system('cabal sandbox init')
end