Recognizing gem/module when creating a new class?
Is it possible that RM recognizes the structure of folders when creating a new class (File -> New -> Ruby Class)?
For example, I am creating a Ruby Gem and I have a standard gem structure:
|-- gem_name
|-- Gemfile
|-- gem_name.gemspec
|-- lib
|-- A.rb ...
|-- bin
|-- test
Now, in this structure, I have all my classes in lib folder in module GemName, like:
module GemName
class A
# ...
end
end
But when I use the action to create a new class, I have to myself add the module GemName; end; reformat; every time.
Is there a way that RM can be configured to recognize this pattern and do the right thing?
Do I need to configure the default class template for this (I'd like to avoid that)?
Regards,
Kedar
请先登录再写评论。
Hi Kedar,
Please submit a feature request. As for workaround setup a file template (see RubyMine | File | Settings | File Templates)