Class: Gzr::Commands::Role

Inherits:
Thor
  • Object
show all
Defined in:
lib/gzr/commands/role.rb,
lib/gzr/commands/role/ls.rb,
lib/gzr/commands/role/rm.rb,
lib/gzr/commands/role/cat.rb,
lib/gzr/commands/role/create.rb,
lib/gzr/commands/role/user_ls.rb,
lib/gzr/commands/role/user_rm.rb,
lib/gzr/commands/role/group_ls.rb,
lib/gzr/commands/role/group_rm.rb,
lib/gzr/commands/role/user_add.rb,
lib/gzr/commands/role/group_add.rb

Defined Under Namespace

Classes: Cat, Create, GroupAdd, GroupLs, GroupRm, Ls, Rm, UserAdd, UserLs, UserRm

Instance Method Summary collapse

Instance Method Details

#cat(role_id) ⇒ Object



137
138
139
140
141
142
143
144
# File 'lib/gzr/commands/role.rb', line 137

def cat(role_id)
  if options[:help]
    invoke :help, ['cat']
  else
    require_relative 'role/cat'
    Gzr::Commands::Role::Cat.new(role_id,options).execute
  end
end

#create(name, pset, mset) ⇒ Object



170
171
172
173
174
175
176
177
# File 'lib/gzr/commands/role.rb', line 170

def create(name, pset, mset)
  if options[:help]
    invoke :help, ['create']
  else
    require_relative 'role/create'
    Gzr::Commands::Role::Create.new(name, pset, mset, options).execute
  end
end

#group_add(role_id, *groups) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/gzr/commands/role.rb', line 59

def group_add(role_id,*groups)
  if options[:help]
    invoke :help, ['group_add']
  else
    require_relative 'role/group_add'
    Gzr::Commands::Role::GroupAdd.new(role_id, groups, options).execute
  end
end

#group_ls(role_id) ⇒ Object



89
90
91
92
93
94
95
96
# File 'lib/gzr/commands/role.rb', line 89

def group_ls(role_id)
  if options[:help]
    invoke :help, ['group_ls']
  else
    require_relative 'role/group_ls'
    Gzr::Commands::Role::GroupLs.new(role_id,options).execute
  end
end

#group_rm(role_id, *groups) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/gzr/commands/role.rb', line 35

def group_rm(role_id, *groups)
  if options[:help]
    invoke :help, ['group_rm']
  else
    require_relative 'role/group_rm'
    Gzr::Commands::Role::GroupRm.new(role_id, groups, options).execute
  end
end

#lsObject



155
156
157
158
159
160
161
162
# File 'lib/gzr/commands/role.rb', line 155

def ls(*)
  if options[:help]
    invoke :help, ['ls']
  else
    require_relative 'role/ls'
    Gzr::Commands::Role::Ls.new(options).execute
  end
end

#rm(role_id) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/gzr/commands/role.rb', line 121

def rm(role_id)
  if options[:help]
    invoke :help, ['rm']
  else
    require_relative 'role/rm'
    Gzr::Commands::Role::Rm.new(role_id,options).execute
  end
end

#user_add(role_id, *users) ⇒ Object



71
72
73
74
75
76
77
78
# File 'lib/gzr/commands/role.rb', line 71

def user_add(role_id,*users)
  if options[:help]
    invoke :help, ['user_add']
  else
    require_relative 'role/user_add'
    Gzr::Commands::Role::UserAdd.new(role_id,users,options).execute
  end
end

#user_ls(role_id) ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/gzr/commands/role.rb', line 109

def user_ls(role_id)
  if options[:help]
    invoke :help, ['user_ls']
  else
    require_relative 'role/user_ls'
    Gzr::Commands::Role::UserLs.new(role_id,options).execute
  end
end

#user_rm(role_id, *users) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/gzr/commands/role.rb', line 47

def user_rm(role_id,*users)
  if options[:help]
    invoke :help, ['user_rm']
  else
    require_relative 'role/user_rm'
    Gzr::Commands::Role::UserRm.new(role_id,users,options).execute
  end
end