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, #init_git_repository, #run
Constructor Details
#initialize(*args) ⇒ HaskellCreator
Returns a new instance of HaskellCreator.
5 6 7 8 9 |
# File 'lib/createproj/creator/haskell.rb', line 5 def initialize(*args) super(*args) @precommit_template = 'lint-pre-commit' = { linter: 'hlint', file_ext: '.hs' } end |
Instance Method Details
#install_dependencies ⇒ Object
Installs dependencies in the new cabal sandbox
27 28 29 30 31 32 33 34 35 |
# File 'lib/createproj/creator/haskell.rb', line 27 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
17 18 19 |
# File 'lib/createproj/creator/haskell.rb', line 17 def install_sandbox system('cabal sandbox init') end |