Class: Yesman::Yesman
- Inherits:
-
Object
- Object
- Yesman::Yesman
- Defined in:
- lib/yesman.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #create_all ⇒ Object
- #create_defaults(hash) ⇒ Object
- #init ⇒ Object
-
#initialize(options = {}) ⇒ Yesman
constructor
A new instance of Yesman.
Constructor Details
#initialize(options = {}) ⇒ Yesman
Returns a new instance of Yesman.
10 11 12 13 14 15 |
# File 'lib/yesman.rb', line 10 def initialize = {} create_defaults @cp = ConfigProxy.new @log = Logger.new init end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/yesman.rb', line 8 def params @params end |
Instance Method Details
#create_all ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/yesman.rb', line 34 def create_all @cp.create_config params p = CppCreator.new params p.create_project @log. "Initial project files created" @log.line_break g = GTestInstaller.new params g.download_and_install @log.line_break @log.log_emphasis "Setup complete!", "You are clear for take off." end |
#create_defaults(hash) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/yesman.rb', line 17 def create_defaults hash @params = {} @params[:project_name] = hash.fetch(:project_name){"Project"} @params[:extension] = hash.fetch(:extension){"cpp"} @params[:source] = hash.fetch(:source){"src"} @params[:tests] = hash.fetch(:tests){"tests"} @params[:output] = hash.fetch(:output){"bin"} end |
#init ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/yesman.rb', line 26 def init @log.line_break @log.log_heading "Creating initial directories and files" FileUtil.ensure_path params[:project_name] Dir.chdir( params[:project_name] ) create_all end |