Class: Policy::CLI Private
- Inherits:
-
Hexx::CLI::Base
- Object
- Hexx::CLI::Base
- Policy::CLI
- 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
- .source_root ⇒ Object private
Instance Method Summary collapse
- #add_locales ⇒ Object private
- #add_policy ⇒ Object private
- #add_spec ⇒ Object private
Class Method Details
.source_root ⇒ Object
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. "../cli", __FILE__ end |
Instance Method Details
#add_locales ⇒ Object
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_policy ⇒ Object
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_spec ⇒ Object
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 |