Class: CreateProj::Creator::RubyCreator
- Inherits:
-
CreateProj::Creator
- Object
- CreateProj::Creator
- CreateProj::Creator::RubyCreator
- Defined in:
- lib/createproj/creator/ruby.rb
Overview
Class for creating Ruby project
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(*args) ⇒ RubyCreator
constructor
A new instance of RubyCreator.
-
#install_dependencies ⇒ Object
Installs dependencies in the new sandbox.
-
#install_sandbox ⇒ Object
Create an rvm gemset with the project name and creates file dictating gemset.
Constructor Details
#initialize(*args) ⇒ RubyCreator
Returns a new instance of RubyCreator.
5 6 7 8 9 |
# File 'lib/createproj/creator/ruby.rb', line 5 def initialize(*args) super(*args) @precommit_template = 'lint-pre-commit' @precommit_options = { linter: 'rubocop', file_ext: '.rb' } end |
Instance Method Details
#install_dependencies ⇒ Object
Installs dependencies in the new sandbox
35 36 37 38 39 40 41 |
# File 'lib/createproj/creator/ruby.rb', line 35 def install_dependencies gems_to_install = %w(rubocop) gems_to_install.each do |g| system("gem install #{g}") end end |
#install_sandbox ⇒ Object
TODO:
-
make it so can specify ruby version
Create an rvm gemset with the project name and creates file dictating gemset
20 21 22 23 24 25 26 27 |
# File 'lib/createproj/creator/ruby.rb', line 20 def install_sandbox RVM.gemset_create @name RVM.gemset_use @name File.open('.ruby-gemset', 'w+') do |f| f.write(@name) end end |