Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when using custom_name in a template #199

Open
nalexn opened this issue Nov 1, 2017 · 2 comments
Open

Exception when using custom_name in a template #199

nalexn opened this issue Nov 1, 2017 · 2 comments

Comments

@nalexn
Copy link

nalexn commented Nov 1, 2017

I'm trying to create my own template and want to name files based on the module name, for example MyModulePresenter.swift

The key portion of my *.rambaspec file looks like this:

code_files:
- {custom_name: "{{ module_info.name }}Presenter.swift", path: Code/Presenter.swift.liquid}

When I run

$ generamba gen MyModule template_name

I get this output:

+----------------+--------------------------------------------+
|                   Summary for gen MyModule                   |
+----------------+--------------------------------------------+
blah blah blah
+----------------+--------------------------------------------+

Creating code files...
/usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/module_generator.rb:74:in `dirname': no implicit conversion of nil into String (TypeError)
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/module_generator.rb:74:in `block in process_files_if_needed'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/module_generator.rb:63:in `each'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/module_generator.rb:63:in `process_files_if_needed'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/module_generator.rb:22:in `generate_module'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/lib/generamba/cli/gen_command.rb:72:in `gen'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
	from /usr/local/rvm/gems/ruby-2.2.0@global/gems/generamba-1.4.1/bin/generamba:5:in `<top (required)>'
	from /usr/local/rvm/rubies/ruby-2.2.0/bin/generamba:23:in `load'
	from /usr/local/rvm/rubies/ruby-2.2.0/bin/generamba:23:in `<main>'
@kei-sidorov
Copy link

I had same exception when I tryed to use custom_name. I fixed it localy, but my team cant use my templates. Please, make higher priority for this issue.

@tribushevsky
Copy link

Try to use the following code:
code_files:

  • {name: "{{ module_info.name }}Presenter.swift", path: Code/Presenter.swift.liquid}

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

No branches or pull requests

3 participants