Class: RubyNEAT::Cli::Generator::NewProject

Inherits:
Thor::Group
  • Object
show all
Extended by:
GenHelpers
Includes:
Thor::Actions
Defined in:
lib/rubyneat/cli/generate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GenHelpers

source_root

Instance Attribute Details

#rubyObject

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_filesObject



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_filesObject



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_directoriesObject



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_directoryObject



20
21
22
# File 'lib/rubyneat/cli/generate.rb', line 20

def create_project_directory
  empty_directory name.snake
end

#create_project_root_filesObject



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