Class: ServiceObjects::CLI
- Inherits:
-
Hexx::CLI::Base
- Object
- Hexx::CLI::Base
- ServiceObjects::CLI
- Defined in:
- lib/service_objects/cli.rb
Overview
Scaffolds a service object with a specification and translations
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/service_objects/cli.rb', line 12 def self.source_root ::File. "../cli", __FILE__ end |
Instance Method Details
#add_locales ⇒ Object
78 79 80 81 82 83 |
# File 'lib/service_objects/cli.rb', line 78 def add_locales locales.each do |lang| @locale = lang template "locale.erb", "config/locales/#{ service.path }/#{ lang }.yml" end end |
#add_service ⇒ Object
73 74 75 |
# File 'lib/service_objects/cli.rb', line 73 def add_service template "service.erb", "app/#{ service.path }.rb" end |
#add_specification ⇒ Object
68 69 70 |
# File 'lib/service_objects/cli.rb', line 68 def add_specification template "spec.erb", "spec/tests/#{ service.path }_spec.rb" end |