Class: RubyNEAT::Cli::Generator::NewProject
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- RubyNEAT::Cli::Generator::NewProject
- Extended by:
- GenHelpers
- Includes:
- Thor::Actions
- Defined in:
- lib/rubyneat/cli/generate.rb
Instance Attribute Summary collapse
-
#ruby ⇒ Object
Returns the value of attribute ruby.
Instance Method Summary collapse
- #create_project_bin_files ⇒ Object
- #create_project_config_files ⇒ Object
- #create_project_directories ⇒ Object
- #create_project_directory ⇒ Object
- #create_project_root_files ⇒ Object
Methods included from GenHelpers
Instance Attribute Details
#ruby ⇒ Object
Returns the value of attribute ruby.
18 19 20 |
# File 'lib/rubyneat/cli/generate.rb', line 18 def ruby @ruby end |
Instance Method Details
#create_project_bin_files ⇒ Object
39 40 41 42 |
# File 'lib/rubyneat/cli/generate.rb', line 39 def create_project_bin_files tcopy %w{ neat }. map{ |pfile| ["bin/#{pfile}", "#{name.snake}/bin/#{pfile}"] }, exec: true end |
#create_project_config_files ⇒ Object
44 45 46 47 |
# File 'lib/rubyneat/cli/generate.rb', line 44 def create_project_config_files tcopy %w{ boot.rb }. map{|pfile| ["config/#{pfile}", "#{name.snake}/config/#{pfile}"]} end |
#create_project_directories ⇒ Object
24 25 26 27 28 29 |
# File 'lib/rubyneat/cli/generate.rb', line 24 def create_project_directories inside name.snake do %w{neater lib config tmp log bin}. each {|dir| empty_directory dir} end end |
#create_project_directory ⇒ Object
20 21 22 |
# File 'lib/rubyneat/cli/generate.rb', line 20 def create_project_directory empty_directory name.snake end |
#create_project_root_files ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/rubyneat/cli/generate.rb', line 31 def create_project_root_files @ruby = OpenStruct.new version: RUBY_VERSION, engine: RUBY_ENGINE, platform: RUBY_PLATFORM tcopy %w{Gemfile README.md}. map{ |pfile| [pfile, "#{name.snake}/#{pfile}"] } end |