Class: Hexx::Validators::Generator
- Inherits:
-
Generator
- Object
- Generator
- Hexx::Validators::Generator
- Defined in:
- lib/hexx/validators/generator.rb
Overview
Scaffolder for a custom validator creates:
-
scope class definition in ‘app/validators`;
-
scope specification in ‘spec/tests/validators`.
Class Method Summary collapse
- .add_declaration ⇒ Object
- .add_specification ⇒ Object
- .add_support ⇒ Object
-
.source_root ⇒ String
private
Root folder for the generator’s templates and description.
-
.start(arguments) ⇒ undefined
Runs the scaffolder with a list of arguments from CLI.
Class Method Details
.add_declaration ⇒ Object
64 65 66 |
# File 'lib/hexx/validators/generator.rb', line 64 def add_declaration template "validator.erb", "app/#{ validator.path }.rb" end |
.add_specification ⇒ Object
59 60 61 |
# File 'lib/hexx/validators/generator.rb', line 59 def add_specification template "spec.erb", "spec/tests/#{ validator.path }_spec.rb" end |
.add_support ⇒ Object
54 55 56 |
# File 'lib/hexx/validators/generator.rb', line 54 def add_support directory "support", "spec/support", skip: true end |
.source_root ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Root folder for the generator’s templates and description.
23 24 25 |
# File 'lib/hexx/validators/generator.rb', line 23 def self.source_root ::File. "../generator", __FILE__ end |
.start(arguments) ⇒ undefined
Runs the scaffolder with a list of arguments from CLI.
|
|
# File 'lib/hexx/validators/generator.rb', line 14
|