Skip to content

support dynamic name directory in template#144

Merged
Watson1978 merged 2 commits intoHipByte:masterfrom
toshiwo:support_dynamic_name_directory
Nov 25, 2013
Merged

support dynamic name directory in template#144
Watson1978 merged 2 commits intoHipByte:masterfrom
toshiwo:support_dynamic_name_directory

Conversation

@toshiwo
Copy link
Copy Markdown
Contributor

@toshiwo toshiwo commented Nov 25, 2013

support dynamic name directory in template

before

motion create foo --template=my_template
  Create foo
  Create foo/app/app_delegate.rb
  Create foo/Gemfile
  Create foo/lib/foo/bar.rb # lib/{name}/bar.rb
/Library/RubyMotion/lib/motion/project/template.rb:110:in `initialize': No such file or directory - lib/foo/bar.rb (Errno::ENOENT)

after

motion create foo --template=my_template
  Create foo
  Create foo/app/app_delegate.rb
  Create foo/Gemfile
  Create foo/lib/foo/bar.rb # lib/{name}/bar.rb
  Create ...

@Watson1978
Copy link
Copy Markdown
Member

If I created template as following,

my_template/
└── files
    └── lib
        └── {name}
            └── {name}.rb.erb

The directory name is changed dynamically. Good.
However, "{name}.rb.erb" is not changed :(

% motion create sample --template=my_template 
    Create sample
    Create sample/.gitignore
    Create sample/lib/sample/{name}.rb

I guess that #sub method should be changed to #gsub method in https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/template.rb#L121

Watson1978 added a commit that referenced this pull request Nov 25, 2013
support dynamic name directory in template
@Watson1978 Watson1978 merged commit 4a9673e into HipByte:master Nov 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants