Class: MRubyGenerate::CreateCliProject
- Inherits:
-
Object
- Object
- MRubyGenerate::CreateCliProject
- Defined in:
- lib/mruby_generate/create_cli_project.rb
Constant Summary collapse
- TEMPLATE_FILES =
%w[ README.md LICENSE build_config.rb Rakefile your_project.gem mrbgem.rake mrblib/mrb_your_project.rb tools/your_project/mrb_your_project.c ].freeze
Instance Attribute Summary collapse
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#your_name ⇒ Object
readonly
Returns the value of attribute your_name.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(project_name) ⇒ CreateCliProject
constructor
A new instance of CreateCliProject.
Constructor Details
#initialize(project_name) ⇒ CreateCliProject
Returns a new instance of CreateCliProject.
21 22 23 24 25 26 |
# File 'lib/mruby_generate/create_cli_project.rb', line 21 def initialize(project_name) @project_name = project_name @your_name = `git config --global --get user.name`.strip @template_path = File.('../../templates/cli_project', __dir__) @dest_path = @project_name end |
Instance Attribute Details
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
8 9 10 |
# File 'lib/mruby_generate/create_cli_project.rb', line 8 def project_name @project_name end |
#your_name ⇒ Object (readonly)
Returns the value of attribute your_name.
8 9 10 |
# File 'lib/mruby_generate/create_cli_project.rb', line 8 def your_name @your_name end |
Instance Method Details
#create ⇒ Object
28 29 30 31 32 |
# File 'lib/mruby_generate/create_cli_project.rb', line 28 def create create_and_copy_template_dir apply_templates rename_files end |