Class: ServiceObjects::CLI

Inherits:
Hexx::CLI::Base
  • Object
show all
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_rootObject



12
13
14
# File 'lib/service_objects/cli.rb', line 12

def self.source_root
  ::File.expand_path "../cli", __FILE__
end

Instance Method Details

#add_localesObject



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_serviceObject



73
74
75
# File 'lib/service_objects/cli.rb', line 73

def add_service
  template "service.erb", "app/#{ service.path }.rb"
end

#add_specificationObject



68
69
70
# File 'lib/service_objects/cli.rb', line 68

def add_specification
  template "spec.erb", "spec/tests/#{ service.path }_spec.rb"
end