Class: Policy::CLI Private

Inherits:
Hexx::CLI::Base
  • Object
show all
Defined in:
lib/policy/cli.rb,
lib/policy/cli/attribute.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Scaffolds a policy with a specification and translations

Defined Under Namespace

Classes: Attribute

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

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.



15
16
17
# File 'lib/policy/cli.rb', line 15

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

Instance Method Details

#add_localesObject

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.



67
68
69
70
71
72
# File 'lib/policy/cli.rb', line 67

def add_locales
  locales.each do |locale|
    @locale = locale
    template "locale.erb", "config/locales/#{ policy.path }/#{ locale }.yml"
  end
end

#add_policyObject

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.



62
63
64
# File 'lib/policy/cli.rb', line 62

def add_policy
  template "policy.erb", "app/#{ policy.path }.rb"
end

#add_specObject

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.



57
58
59
# File 'lib/policy/cli.rb', line 57

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