lib/eucalypt/security/namespaces/security-policy/cli/security-policy.rb in eucalypt-0.3.1 vs lib/eucalypt/security/namespaces/security-policy/cli/security-policy.rb in eucalypt-0.3.2
- old
+ new
@@ -2,16 +2,18 @@
require 'eucalypt/errors'
require 'eucalypt/helpers'
require 'eucalypt/security/namespaces/security-policy/generators/policy'
require 'eucalypt/security/namespaces/security-policy-permission/cli/security-policy-permission'
require 'eucalypt/security/namespaces/security-policy-role/cli/security-policy-role'
+require 'eucalypt/list'
module Eucalypt
class SecurityPolicy < Thor
include Thor::Actions
include Eucalypt::Helpers
using Colorize
+ extend Eucalypt::List
option :headless, type: :boolean, aliases: '-H', default: false, desc: "Policy with no associated model"
option :permissions, type: :array, aliases: '-p', default: [], desc: "Permissions to generate along with the policy"
desc "generate [NAME]", "Create a new Pundit policy".colorize(:grey)
def generate(name)
@@ -76,15 +78,11 @@
end
#def destroy()
#end
- class << self
- require 'eucalypt/list'
- include Eucalypt::List
- def banner(task, namespace = false, subcommand = true)
- "#{basename} security #{task.formatted_usage(self, true, subcommand).split(':').join(' ')}"
- end
+ def self.banner(task, namespace = false, subcommand = true)
+ "#{basename} security #{task.formatted_usage(self, true, subcommand).split(':').join(' ')}"
end
register(Eucalypt::SecurityPolicyPermission, 'permission', 'permission [COMMAND]', 'Pundit policy permission commands'.colorize(:grey))
register(Eucalypt::SecurityPolicyRole, 'role', 'role [COMMAND]', 'Pundit policy role commands'.colorize(:grey))
end
\ No newline at end of file