Class: CreateProj::Creator::HaskellCreator
- Defined in:
- lib/createproj/creator/haskell.rb
Overview
Class for creating Haskell project
Instance Attribute Summary
Attributes inherited from Creator
Instance Method Summary collapse
-
#initialize(*args) ⇒ HaskellCreator
constructor
A new instance of HaskellCreator.
-
#install_dependencies ⇒ Object
Installs dependencies in the new cabal sandbox.
-
#install_sandbox ⇒ Object
Create an Haskell sandbox.
Methods inherited from Creator
#add_pre_commit_hook, #create_directory, #extra_setup, #gitignore, #init_git_repository, #run
Constructor Details
#initialize(*args) ⇒ HaskellCreator
Returns a new instance of HaskellCreator.
5 6 7 8 9 10 |
# 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 |
Instance Method Details
#install_dependencies ⇒ Object
Installs dependencies in the new cabal sandbox
28 29 30 31 32 33 34 35 36 |
# 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 ⇒ Object
Create an Haskell sandbox
18 19 20 |
# File 'lib/createproj/creator/haskell.rb', line 18 def install_sandbox system('cabal sandbox init') end |